barcode-detector 3.0.5 → 3.0.7

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 +1 @@
1
- var BarcodeDetectionAPI=function(_){"use strict";var qe=_=>{throw TypeError(_)};var Ye=(_,M,R)=>M.has(_)||qe("Cannot "+R);var Ze=(_,M,R)=>(Ye(_,M,"read from private field"),R?R.call(_):M.get(_)),Qe=(_,M,R)=>M.has(_)?qe("Cannot add the same private member more than once"):M instanceof WeakSet?M.add(_):M.set(_,R),Je=(_,M,R,gt)=>(Ye(_,M,"write to private field"),gt?gt.call(_,R):M.set(_,R),R);var ct;const M=[["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"]],R=M.map(([i])=>i),gt=R.filter((i,f)=>M[f][1]==="L"),Ke=R.filter((i,f)=>M[f][1]==="M");function Bt(i){switch(i){case"Linear-Codes":return gt.reduce((f,p)=>f|Bt(p),0);case"Matrix-Codes":return Ke.reduce((f,p)=>f|Bt(p),0);case"Any":return(1<<M.length)-1;case"None":return 0;default:return 1<<R.indexOf(i)}}function tr(i){if(i===0)return"None";const f=31-Math.clz32(i);return R[f]}function er(i){return i.reduce((f,p)=>f|Bt(p),0)}const rr=["LocalAverage","GlobalHistogram","FixedThreshold","BoolCast"];function nr(i){return rr.indexOf(i)}const ne=["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 ar(i){return i==="UnicodeBig"?ne.indexOf("UTF16BE"):ne.indexOf(i)}const or=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function ir(i){return or[i]}const sr=["Ignore","Read","Require"];function ur(i){return sr.indexOf(i)}const cr=["Plain","ECI","HRI","Hex","Escaped"];function lr(i){return cr.indexOf(i)}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 ae(i){return{...i,formats:er(i.formats),binarizer:nr(i.binarizer),eanAddOnSymbol:ur(i.eanAddOnSymbol),textMode:lr(i.textMode),characterSet:ar(i.characterSet)}}function fr(i){return{...i,format:tr(i.format),contentType:ir(i.contentType),eccLevel:i.ecLevel}}const dr="2.2.0",hr="0a3797f698b339c1c01c487a7a43f1368610f503",pr={locateFile:(i,f)=>{const p=i.match(/_(.+?)\.wasm$/);return p?`https://fastly.jsdelivr.net/npm/zxing-wasm@2.2.0/dist/${p[1]}/${i}`:f+i}},$t=new WeakMap;function vr(i,f){return Object.is(i,f)||Object.keys(i).length===Object.keys(f).length&&Object.keys(i).every(p=>Object.hasOwn(f,p)&&i[p]===f[p])}function oe(i,{overrides:f,equalityFn:p=vr,fireImmediately:l=!1}={}){var C;const[A,F]=(C=$t.get(i))!=null?C:[pr],B=f!=null?f:A;let S;if(l){if(F&&(S=p(A,B)))return F;const j=i({...B});return $t.set(i,[B,j]),j}(S!=null?S:p(A,B))||$t.set(i,[B])}function yr(i){$t.delete(i)}async function mr(i,f,p=wt){const l={...wt,...p},C=await oe(i,{fireImmediately:!0});let A,F;if("width"in f&&"height"in f&&"data"in f){const{data:S,data:{byteLength:j},width:q,height:Z}=f;F=C._malloc(j),C.HEAPU8.set(S,F),A=C.readBarcodesFromPixmap(F,q,Z,ae(l))}else{let S,j;if("buffer"in f)[S,j]=[f.byteLength,f];else if("byteLength"in f)[S,j]=[f.byteLength,new Uint8Array(f)];else if("size"in f)[S,j]=[f.size,new Uint8Array(await f.arrayBuffer())];else throw new TypeError("Invalid input type");F=C._malloc(S),C.HEAPU8.set(j,F),A=C.readBarcodesFromImage(F,S,ae(l))}C._free(F);const B=[];for(let S=0;S<A.size();++S)B.push(fr(A.get(S)));return B}({...wt,formats:[...wt.formats]});var Wt=async function(i={}){var f,p,l=i,C,A,F=new Promise((e,t)=>{C=e,A=t}),B=typeof window=="object",S=typeof Bun<"u",j=typeof WorkerGlobalScope<"u";typeof process=="object"&&!((p=process.versions)===null||p===void 0)&&p.node&&process.type!="renderer";var q="./this.program",Z,Q="";function lt(e){return l.locateFile?l.locateFile(e,Q):Q+e}var ft,at;if(B||j||S){try{Q=new URL(".",Z).href}catch{}j&&(at=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),ft=async e=>{var t=await fetch(e,{credentials:"same-origin"});if(t.ok)return t.arrayBuffer();throw new Error(t.status+" : "+t.url)}}var bt=console.log.bind(console),Y=console.error.bind(console),dt,Ct,ye=!1,J,V,Tt,ot,it,P,me,ge;function we(){var e=Ct.buffer;J=new Int8Array(e),Tt=new Int16Array(e),l.HEAPU8=V=new Uint8Array(e),ot=new Uint16Array(e),it=new Int32Array(e),P=new Uint32Array(e),me=new Float32Array(e),ge=new Float64Array(e)}function Wr(){if(l.preRun)for(typeof l.preRun=="function"&&(l.preRun=[l.preRun]);l.preRun.length;)Jr(l.preRun.shift());$e(Ce)}function Ur(){E.ya()}function Vr(){if(l.postRun)for(typeof l.postRun=="function"&&(l.postRun=[l.postRun]);l.postRun.length;)Qr(l.postRun.shift());$e(be)}var K=0,ht=null;function kr(e){var t;K++,(t=l.monitorRunDependencies)===null||t===void 0||t.call(l,K)}function Hr(e){var t;if(K--,(t=l.monitorRunDependencies)===null||t===void 0||t.call(l,K),K==0&&ht){var r=ht;ht=null,r()}}function kt(e){var t;(t=l.onAbort)===null||t===void 0||t.call(l,e),e="Aborted("+e+")",Y(e),ye=!0,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw A(r),r}var Pt;function Nr(){return lt("zxing_reader.wasm")}function zr(e){if(e==Pt&&dt)return new Uint8Array(dt);if(at)return at(e);throw"both async and sync fetching of the wasm failed"}async function Gr(e){if(!dt)try{var t=await ft(e);return new Uint8Array(t)}catch{}return zr(e)}async function Xr(e,t){try{var r=await Gr(e),n=await WebAssembly.instantiate(r,t);return n}catch(a){Y(`failed to asynchronously prepare wasm: ${a}`),kt(a)}}async function qr(e,t,r){if(!e&&typeof WebAssembly.instantiateStreaming=="function")try{var n=fetch(t,{credentials:"same-origin"}),a=await WebAssembly.instantiateStreaming(n,r);return a}catch(o){Y(`wasm streaming compile failed: ${o}`),Y("falling back to ArrayBuffer instantiation")}return Xr(t,r)}function Yr(){return{a:xa}}async function Zr(){function e(o,u){return E=o.exports,Ct=E.xa,we(),xe=E.Ba,Hr(),E}kr();function t(o){return e(o.instance)}var r=Yr();if(l.instantiateWasm)return new Promise((o,u)=>{l.instantiateWasm(r,(s,c)=>{o(e(s))})});Pt!=null||(Pt=Nr());try{var n=await qr(dt,Pt,r),a=t(n);return a}catch(o){return A(o),Promise.reject(o)}}var $e=e=>{for(;e.length>0;)e.shift()(l)},be=[],Qr=e=>be.push(e),Ce=[],Jr=e=>Ce.push(e),m=e=>Ra(e),g=()=>La(),_t=[],Et=0,Kr=e=>{var t=new Ht(e);return t.get_caught()||(t.set_caught(!0),Et--),t.set_rethrown(!1),_t.push(t),Wa(e),Fa(e)},N=0,tn=()=>{y(0,0);var e=_t.pop();Ba(e.excPtr),N=0};class Ht{constructor(t){this.excPtr=t,this.ptr=t-24}set_type(t){P[this.ptr+4>>2]=t}get_type(){return P[this.ptr+4>>2]}set_destructor(t){P[this.ptr+8>>2]=t}get_destructor(){return P[this.ptr+8>>2]}set_caught(t){t=t?1:0,J[this.ptr+12]=t}get_caught(){return J[this.ptr+12]!=0}set_rethrown(t){t=t?1:0,J[this.ptr+13]=t}get_rethrown(){return J[this.ptr+13]!=0}init(t,r){this.set_adjusted_ptr(0),this.set_type(t),this.set_destructor(r)}set_adjusted_ptr(t){P[this.ptr+16>>2]=t}get_adjusted_ptr(){return P[this.ptr+16>>2]}}var Ot=e=>ja(e),Nt=e=>{var t=N;if(!t)return Ot(0),0;var r=new Ht(t);r.set_adjusted_ptr(t);var n=r.get_type();if(!n)return Ot(0),t;for(var a of e){if(a===0||a===n)break;var o=r.ptr+16;if(Ua(a,n,o))return Ot(a),t}return Ot(n),t},en=()=>Nt([]),rn=e=>Nt([e]),nn=(e,t)=>Nt([e,t]),an=()=>{var e=_t.pop();e||kt("no exception to throw");var t=e.excPtr;throw e.get_rethrown()||(_t.push(e),e.set_rethrown(!0),e.set_caught(!1),Et++),N=t,N},on=(e,t,r)=>{var n=new Ht(e);throw n.init(t,r),N=e,Et++,N},sn=()=>Et,un=e=>{throw N||(N=e),N},cn=()=>kt(""),At={},zt=e=>{for(;e.length;){var t=e.pop(),r=e.pop();r(t)}};function pt(e){return this.fromWireType(P[e>>2])}var st={},tt={},St={},ln=class extends Error{constructor(e){super(e),this.name="InternalError"}},Dt=e=>{throw new ln(e)},et=(e,t,r)=>{e.forEach(s=>St[s]=t);function n(s){var c=r(s);c.length!==e.length&&Dt("Mismatched type converter count");for(var d=0;d<e.length;++d)H(e[d],c[d])}var a=new Array(t.length),o=[],u=0;t.forEach((s,c)=>{tt.hasOwnProperty(s)?a[c]=tt[s]:(o.push(s),st.hasOwnProperty(s)||(st[s]=[]),st[s].push(()=>{a[c]=tt[s],++u,u===o.length&&n(a)}))}),o.length===0&&n(a)},fn=e=>{var t=At[e];delete At[e];var r=t.rawConstructor,n=t.rawDestructor,a=t.fields,o=a.map(u=>u.getterReturnType).concat(a.map(u=>u.setterArgumentType));et([e],o,u=>{var s={};return a.forEach((c,d)=>{var h=c.fieldName,v=u[d],$=u[d].optional,b=c.getter,O=c.getterContext,I=u[d+a.length],D=c.setter,x=c.setterContext;s[h]={read:X=>v.fromWireType(b(O,X)),write:(X,W)=>{var U=[];D(x,X,I.toWireType(U,W)),zt(U)},optional:$}}),[{name:t.name,fromWireType:c=>{var d={};for(var h in s)d[h]=s[h].read(c);return n(c),d},toWireType:(c,d)=>{for(var h in s)if(!(h in d)&&!s[h].optional)throw new TypeError(`Missing field: "${h}"`);var v=r();for(h in s)s[h].write(v,d[h]);return c!==null&&c.push(n,v),v},argPackAdvance:z,readValueFromPointer:pt,destructorFunction:n}]})},dn=(e,t,r,n,a)=>{},hn=()=>{for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);Te=e},Te,L=e=>{for(var t="",r=e;V[r];)t+=Te[V[r++]];return t},vt=class extends Error{constructor(e){super(e),this.name="BindingError"}},T=e=>{throw new vt(e)};function pn(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=t.name;if(e||T(`type "${n}" must have a positive integer typeid pointer`),tt.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;T(`Cannot register type '${n}' twice`)}if(tt[e]=t,delete St[e],st.hasOwnProperty(e)){var a=st[e];delete st[e],a.forEach(o=>o())}}function H(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return pn(e,t,r)}var z=8,vn=(e,t,r,n)=>{t=L(t),H(e,{name:t,fromWireType:function(a){return!!a},toWireType:function(a,o){return o?r:n},argPackAdvance:z,readValueFromPointer:function(a){return this.fromWireType(V[a])},destructorFunction:null})},yn=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),Gt=e=>{function t(r){return r.$$.ptrType.registeredClass.name}T(t(e)+" instance already deleted")},Xt=!1,Pe=e=>{},mn=e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)},_e=e=>{e.count.value-=1;var t=e.count.value===0;t&&mn(e)},yt=e=>typeof FinalizationRegistry>"u"?(yt=t=>t,e):(Xt=new FinalizationRegistry(t=>{_e(t.$$)}),yt=t=>{var r=t.$$,n=!!r.smartPtr;if(n){var a={$$:r};Xt.register(t,a,t)}return t},Pe=t=>Xt.unregister(t),yt(e)),gn=()=>{let e=It.prototype;Object.assign(e,{isAliasOf(r){if(!(this instanceof It)||!(r instanceof It))return!1;var n=this.$$.ptrType.registeredClass,a=this.$$.ptr;r.$$=r.$$;for(var o=r.$$.ptrType.registeredClass,u=r.$$.ptr;n.baseClass;)a=n.upcast(a),n=n.baseClass;for(;o.baseClass;)u=o.upcast(u),o=o.baseClass;return n===o&&a===u},clone(){if(this.$$.ptr||Gt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var r=yt(Object.create(Object.getPrototypeOf(this),{$$:{value:yn(this.$$)}}));return r.$$.count.value+=1,r.$$.deleteScheduled=!1,r},delete(){this.$$.ptr||Gt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&T("Object already scheduled for deletion"),Pe(this),_e(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Gt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&T("Object already scheduled for deletion"),this.$$.deleteScheduled=!0,this}});const t=Symbol.dispose;t&&(e[t]=e.delete)};function It(){}var qt=(e,t)=>Object.defineProperty(t,"name",{value:e}),Ee={},Oe=(e,t,r)=>{if(e[t].overloadTable===void 0){var n=e[t];e[t]=function(){for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return e[t].overloadTable.hasOwnProperty(o.length)||T(`Function '${r}' called with an invalid number of arguments (${o.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[o.length].apply(this,o)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}},Ae=(e,t,r)=>{l.hasOwnProperty(e)?((r===void 0||l[e].overloadTable!==void 0&&l[e].overloadTable[r]!==void 0)&&T(`Cannot register public name '${e}' twice`),Oe(l,e,e),l[e].overloadTable.hasOwnProperty(r)&&T(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),l[e].overloadTable[r]=t):(l[e]=t,l[e].argCount=r)},wn=48,$n=57,bn=e=>{e=e.replace(/[^a-zA-Z0-9_]/g,"$");var t=e.charCodeAt(0);return t>=wn&&t<=$n?`_${e}`:e};function Cn(e,t,r,n,a,o,u,s){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=o,this.upcast=u,this.downcast=s,this.pureVirtualFunctions=[]}var Yt=(e,t,r)=>{for(;t!==r;)t.upcast||T(`Expected null or instance of ${r.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e},Zt=e=>{if(e===null)return"null";var t=typeof e;return t==="object"||t==="array"||t==="function"?e.toString():""+e};function Tn(e,t){if(t===null)return this.isReference&&T(`null is not a valid ${this.name}`),0;t.$$||T(`Cannot pass "${Zt(t)}" as a ${this.name}`),t.$$.ptr||T(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=t.$$.ptrType.registeredClass,n=Yt(t.$$.ptr,r,this.registeredClass);return n}function Pn(e,t){var r;if(t===null)return this.isReference&&T(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,r),r):0;(!t||!t.$$)&&T(`Cannot pass "${Zt(t)}" as a ${this.name}`),t.$$.ptr||T(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&T(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var n=t.$$.ptrType.registeredClass;if(r=Yt(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(t.$$.smartPtr===void 0&&T("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:T(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var a=t.clone();r=this.rawShare(r,G.toHandle(()=>a.delete())),e!==null&&e.push(this.rawDestructor,r)}break;default:T("Unsupporting sharing policy")}return r}function _n(e,t){if(t===null)return this.isReference&&T(`null is not a valid ${this.name}`),0;t.$$||T(`Cannot pass "${Zt(t)}" as a ${this.name}`),t.$$.ptr||T(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&T(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass,n=Yt(t.$$.ptr,r,this.registeredClass);return n}var Se=(e,t,r)=>{if(t===r)return e;if(r.baseClass===void 0)return null;var n=Se(e,t,r.baseClass);return n===null?null:r.downcast(n)},En={},On=(e,t)=>{for(t===void 0&&T("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t},An=(e,t)=>(t=On(e,t),En[t]),xt=(e,t)=>{(!t.ptrType||!t.ptr)&&Dt("makeClassHandle requires ptr and ptrType");var r=!!t.smartPtrType,n=!!t.smartPtr;return r!==n&&Dt("Both smartPtrType and smartPtr must be specified"),t.count={value:1},yt(Object.create(e,{$$:{value:t,writable:!0}}))};function Sn(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=An(this.registeredClass,t);if(r!==void 0){if(r.$$.count.value===0)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function a(){return this.isSmartPointer?xt(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):xt(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var o=this.registeredClass.getActualType(t),u=Ee[o];if(!u)return a.call(this);var s;this.isConst?s=u.constPointerType:s=u.pointerType;var c=Se(t,this.registeredClass,s.registeredClass);return c===null?a.call(this):this.isSmartPointer?xt(s.registeredClass.instancePrototype,{ptrType:s,ptr:c,smartPtrType:this,smartPtr:e}):xt(s.registeredClass.instancePrototype,{ptrType:s,ptr:c})}var Dn=()=>{Object.assign(Mt.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){var t;(t=this.rawDestructor)===null||t===void 0||t.call(this,e)},argPackAdvance:z,readValueFromPointer:pt,fromWireType:Sn})};function Mt(e,t,r,n,a,o,u,s,c,d,h){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=o,this.sharingPolicy=u,this.rawGetPointee=s,this.rawConstructor=c,this.rawShare=d,this.rawDestructor=h,!a&&t.baseClass===void 0?n?(this.toWireType=Tn,this.destructorFunction=null):(this.toWireType=_n,this.destructorFunction=null):this.toWireType=Pn}var De=(e,t,r)=>{l.hasOwnProperty(e)||Dt("Replacing nonexistent public symbol"),l[e].overloadTable!==void 0&&r!==void 0?l[e].overloadTable[r]=t:(l[e]=t,l[e].argCount=r)},Ie=[],xe,w=e=>{var t=Ie[e];return t||(Ie[e]=t=xe.get(e)),t},In=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(e.includes("j"))return dynCallLegacy(e,t,r);var n=w(t),a=n(...r);return a},xn=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return function(){for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];return In(e,t,a,r)}},k=function(e,t){e=L(e);function r(){if(e.includes("j"))return xn(e,t);var a=w(t);return a}var n=r();return typeof n!="function"&&T(`unknown function pointer with signature ${e}: ${t}`),n};class Mn extends Error{}var Me=e=>{var t=Ma(e),r=L(t);return nt(t),r},Ft=(e,t)=>{var r=[],n={};function a(o){if(!n[o]&&!tt[o]){if(St[o]){St[o].forEach(a);return}r.push(o),n[o]=!0}}throw t.forEach(a),new Mn(`${e}: `+r.map(Me).join([", "]))},Fn=(e,t,r,n,a,o,u,s,c,d,h,v,$)=>{h=L(h),o=k(a,o),s&&(s=k(u,s)),d&&(d=k(c,d)),$=k(v,$);var b=bn(h);Ae(b,function(){Ft(`Cannot construct ${h} due to unbound types`,[n])}),et([e,t,r],n?[n]:[],O=>{O=O[0];var I,D;n?(I=O.registeredClass,D=I.instancePrototype):D=It.prototype;var x=qt(h,function(){if(Object.getPrototypeOf(this)!==X)throw new vt(`Use 'new' to construct ${h}`);if(W.constructor_body===void 0)throw new vt(`${h} has no accessible constructor`);for(var Ge=arguments.length,Rt=new Array(Ge),Lt=0;Lt<Ge;Lt++)Rt[Lt]=arguments[Lt];var Xe=W.constructor_body[Rt.length];if(Xe===void 0)throw new vt(`Tried to invoke ctor of ${h} with invalid number of parameters (${Rt.length}) - expected (${Object.keys(W.constructor_body).toString()}) parameters instead!`);return Xe.apply(this,Rt)}),X=Object.create(D,{constructor:{value:x}});x.prototype=X;var W=new Cn(h,x,X,$,I,o,s,d);if(W.baseClass){var U,jt;(jt=(U=W.baseClass).__derivedClasses)!==null&&jt!==void 0||(U.__derivedClasses=[]),W.baseClass.__derivedClasses.push(W)}var Eo=new Mt(h,W,!0,!1,!1),Ne=new Mt(h+"*",W,!1,!1,!1),ze=new Mt(h+" const*",W,!1,!0,!1);return Ee[e]={pointerType:Ne,constPointerType:ze},De(b,x),[Eo,Ne,ze]})},Qt=(e,t)=>{for(var r=[],n=0;n<e;n++)r.push(P[t+n*4>>2]);return r};function jn(e){for(var t=1;t<e.length;++t)if(e[t]!==null&&e[t].destructorFunction===void 0)return!0;return!1}function Jt(e,t,r,n,a,o){var u=t.length;u<2&&T("argTypes array size mismatch! Must at least get return value and 'this' types!");var s=t[1]!==null&&r!==null,c=jn(t),d=t[0].name!=="void",h=u-2,v=new Array(h),$=[],b=[],O=function(){b.length=0;var I;$.length=s?2:1,$[0]=a,s&&(I=t[1].toWireType(b,this),$[1]=I);for(var D=0;D<h;++D)v[D]=t[D+2].toWireType(b,D<0||arguments.length<=D?void 0:arguments[D]),$.push(v[D]);var x=n(...$);function X(W){if(c)zt(b);else for(var U=s?1:2;U<t.length;U++){var jt=U===1?I:v[U-2];t[U].destructorFunction!==null&&t[U].destructorFunction(jt)}if(d)return t[0].fromWireType(W)}return X(x)};return qt(e,O)}var Rn=(e,t,r,n,a,o)=>{var u=Qt(t,r);a=k(n,a),et([],[e],s=>{s=s[0];var c=`constructor ${s.name}`;if(s.registeredClass.constructor_body===void 0&&(s.registeredClass.constructor_body=[]),s.registeredClass.constructor_body[t-1]!==void 0)throw new vt(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${s.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return s.registeredClass.constructor_body[t-1]=()=>{Ft(`Cannot construct ${s.name} due to unbound types`,u)},et([],u,d=>(d.splice(1,0,null),s.registeredClass.constructor_body[t-1]=Jt(c,d,null,a,o),[])),[]})},Fe=e=>{e=e.trim();const t=e.indexOf("(");return t===-1?e:e.slice(0,t)},Ln=(e,t,r,n,a,o,u,s,c,d)=>{var h=Qt(r,n);t=L(t),t=Fe(t),o=k(a,o),et([],[e],v=>{v=v[0];var $=`${v.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&v.registeredClass.pureVirtualFunctions.push(t);function b(){Ft(`Cannot call ${$} due to unbound types`,h)}var O=v.registeredClass.instancePrototype,I=O[t];return I===void 0||I.overloadTable===void 0&&I.className!==v.name&&I.argCount===r-2?(b.argCount=r-2,b.className=v.name,O[t]=b):(Oe(O,t,$),O[t].overloadTable[r-2]=b),et([],h,D=>{var x=Jt($,D,v,o,u);return O[t].overloadTable===void 0?(x.argCount=r-2,O[t]=x):O[t].overloadTable[r-2]=x,[]}),[]})},je=[],rt=[0,1,,1,null,1,!0,1,!1,1],Kt=e=>{e>9&&--rt[e+1]===0&&(rt[e]=void 0,je.push(e))},G={toValue:e=>(e||T(`Cannot use deleted val. handle = ${e}`),rt[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const t=je.pop()||rt.length;return rt[t]=e,rt[t+1]=1,t}}}},Re={name:"emscripten::val",fromWireType:e=>{var t=G.toValue(e);return Kt(e),t},toWireType:(e,t)=>G.toHandle(t),argPackAdvance:z,readValueFromPointer:pt,destructorFunction:null},Bn=e=>H(e,Re),Wn=(e,t)=>{switch(t){case 4:return function(r){return this.fromWireType(me[r>>2])};case 8:return function(r){return this.fromWireType(ge[r>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},Un=(e,t,r)=>{t=L(t),H(e,{name:t,fromWireType:n=>n,toWireType:(n,a)=>a,argPackAdvance:z,readValueFromPointer:Wn(t,r),destructorFunction:null})},Vn=(e,t,r,n,a,o,u,s)=>{var c=Qt(t,r);e=L(e),e=Fe(e),a=k(n,a),Ae(e,function(){Ft(`Cannot call ${e} due to unbound types`,c)},t-1),et([],c,d=>{var h=[d[0],null].concat(d.slice(1));return De(e,Jt(e,h,null,a,o),t-1),[]})},kn=(e,t,r)=>{switch(t){case 1:return r?n=>J[n]:n=>V[n];case 2:return r?n=>Tt[n>>1]:n=>ot[n>>1];case 4:return r?n=>it[n>>2]:n=>P[n>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Hn=(e,t,r,n,a)=>{t=L(t);const o=n===0;let u=c=>c;if(o){var s=32-8*r;u=c=>c<<s>>>s,a=u(a)}H(e,{name:t,fromWireType:u,toWireType:(c,d)=>d,argPackAdvance:z,readValueFromPointer:kn(t,r,n!==0),destructorFunction:null})},Nn=(e,t,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[t];function o(u){var s=P[u>>2],c=P[u+4>>2];return new a(J.buffer,c,s)}r=L(r),H(e,{name:r,fromWireType:o,argPackAdvance:z,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},zn=Object.assign({optional:!0},Re),Gn=(e,t)=>{H(e,zn)},Xn=(e,t,r,n)=>{if(!(n>0))return 0;for(var a=r,o=r+n-1,u=0;u<e.length;++u){var s=e.charCodeAt(u);if(s>=55296&&s<=57343){var c=e.charCodeAt(++u);s=65536+((s&1023)<<10)|c&1023}if(s<=127){if(r>=o)break;t[r++]=s}else if(s<=2047){if(r+1>=o)break;t[r++]=192|s>>6,t[r++]=128|s&63}else if(s<=65535){if(r+2>=o)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|s&63}else{if(r+3>=o)break;t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|s&63}}return t[r]=0,r-a},ut=(e,t,r)=>Xn(e,V,t,r),Le=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++r):t+=3}return t},Be=typeof TextDecoder<"u"?new TextDecoder:void 0,We=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN;for(var n=t+r,a=t;e[a]&&!(a>=n);)++a;if(a-t>16&&e.buffer&&Be)return Be.decode(e.subarray(t,a));for(var o="";t<a;){var u=e[t++];if(!(u&128)){o+=String.fromCharCode(u);continue}var s=e[t++]&63;if((u&224)==192){o+=String.fromCharCode((u&31)<<6|s);continue}var c=e[t++]&63;if((u&240)==224?u=(u&15)<<12|s<<6|c:u=(u&7)<<18|s<<12|c<<6|e[t++]&63,u<65536)o+=String.fromCharCode(u);else{var d=u-65536;o+=String.fromCharCode(55296|d>>10,56320|d&1023)}}return o},qn=(e,t)=>e?We(V,e,t):"",Yn=(e,t)=>{t=L(t),H(e,{name:t,fromWireType(r){for(var n=P[r>>2],a=r+4,o,s,u=a,s=0;s<=n;++s){var c=a+s;if(s==n||V[c]==0){var d=c-u,h=qn(u,d);o===void 0?o=h:(o+="\0",o+=h),u=c+1}}return nt(r),o},toWireType(r,n){n instanceof ArrayBuffer&&(n=new Uint8Array(n));var a,o=typeof n=="string";o||ArrayBuffer.isView(n)&&n.BYTES_PER_ELEMENT==1||T("Cannot pass non-string to std::string"),o?a=Le(n):a=n.length;var u=He(4+a+1),s=u+4;return P[u>>2]=a,o?ut(n,s,a+1):V.set(n,s),r!==null&&r.push(nt,u),u},argPackAdvance:z,readValueFromPointer:pt,destructorFunction(r){nt(r)}})},Ue=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,Zn=(e,t)=>{for(var r=e>>1,n=r+t/2,a=r;!(a>=n)&&ot[a];)++a;if(a-r>16&&Ue)return Ue.decode(ot.subarray(r,a));for(var o="",u=r;!(u>=n);++u){var s=ot[u];if(s==0)break;o+=String.fromCharCode(s)}return o},Qn=(e,t,r)=>{if(r!=null||(r=2147483647),r<2)return 0;r-=2;for(var n=t,a=r<e.length*2?r/2:e.length,o=0;o<a;++o){var u=e.charCodeAt(o);Tt[t>>1]=u,t+=2}return Tt[t>>1]=0,t-n},Jn=e=>e.length*2,Kn=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var a=it[e+r*4>>2];if(a==0)break;if(++r,a>=65536){var o=a-65536;n+=String.fromCharCode(55296|o>>10,56320|o&1023)}else n+=String.fromCharCode(a)}return n},ta=(e,t,r)=>{if(r!=null||(r=2147483647),r<4)return 0;for(var n=t,a=n+r-4,o=0;o<e.length;++o){var u=e.charCodeAt(o);if(u>=55296&&u<=57343){var s=e.charCodeAt(++o);u=65536+((u&1023)<<10)|s&1023}if(it[t>>2]=u,t+=4,t+4>a)break}return it[t>>2]=0,t-n},ea=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&++r,t+=4}return t},ra=(e,t,r)=>{r=L(r);var n,a,o,u;t===2?(n=Zn,a=Qn,u=Jn,o=s=>ot[s>>1]):t===4&&(n=Kn,a=ta,u=ea,o=s=>P[s>>2]),H(e,{name:r,fromWireType:s=>{for(var c=P[s>>2],d,h=s+4,v=0;v<=c;++v){var $=s+4+v*t;if(v==c||o($)==0){var b=$-h,O=n(h,b);d===void 0?d=O:(d+="\0",d+=O),h=$+t}}return nt(s),d},toWireType:(s,c)=>{typeof c!="string"&&T(`Cannot pass non-string to C++ string type ${r}`);var d=u(c),h=He(4+d+t);return P[h>>2]=d/t,a(c,h+4,d+t),s!==null&&s.push(nt,h),h},argPackAdvance:z,readValueFromPointer:pt,destructorFunction(s){nt(s)}})},na=(e,t,r,n,a,o)=>{At[e]={name:L(t),rawConstructor:k(r,n),rawDestructor:k(a,o),fields:[]}},aa=(e,t,r,n,a,o,u,s,c,d)=>{At[e].fields.push({fieldName:L(t),getterReturnType:r,getter:k(n,a),getterContext:o,setterArgumentType:u,setter:k(s,c),setterContext:d})},oa=(e,t)=>{t=L(t),H(e,{isVoid:!0,name:t,argPackAdvance:0,fromWireType:()=>{},toWireType:(r,n)=>{}})},te=[],ia=(e,t,r,n)=>(e=te[e],t=G.toValue(t),e(null,t,r,n)),sa={},ua=e=>{var t=sa[e];return t===void 0?L(e):t},Ve=()=>{if(typeof globalThis=="object")return globalThis;function e(t){t.$$$embind_global$$$=t;var r=typeof $$$embind_global$$$=="object"&&t.$$$embind_global$$$==t;return r||delete t.$$$embind_global$$$,r}if(typeof $$$embind_global$$$=="object"||(typeof global=="object"&&e(global)?$$$embind_global$$$=global:typeof self=="object"&&e(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")},ca=e=>e===0?G.toHandle(Ve()):(e=ua(e),G.toHandle(Ve()[e])),la=e=>{var t=te.length;return te.push(e),t},ke=(e,t)=>{var r=tt[e];return r===void 0&&T(`${t} has unknown type ${Me(e)}`),r},fa=(e,t)=>{for(var r=new Array(e),n=0;n<e;++n)r[n]=ke(P[t+n*4>>2],`parameter ${n}`);return r},da=(e,t,r)=>{var n=[],a=e.toWireType(n,r);return n.length&&(P[t>>2]=G.toHandle(n)),a},ha=Reflect.construct,pa=(e,t,r)=>{var n=fa(e,t),a=n.shift();e--;var o=new Array(e),u=(c,d,h,v)=>{for(var $=0,b=0;b<e;++b)o[b]=n[b].readValueFromPointer(v+$),$+=n[b].argPackAdvance;var O=r===1?ha(d,o):d.apply(c,o);return da(a,h,O)},s=`methodCaller<(${n.map(c=>c.name).join(", ")}) => ${a.name}>`;return la(qt(s,u))},va=e=>{e>9&&(rt[e+1]+=1)},ya=e=>{var t=G.toValue(e);zt(t),Kt(e)},ma=(e,t)=>{e=ke(e,"_emval_take_value");var r=e.readValueFromPointer(t);return G.toHandle(r)},ga=(e,t,r,n)=>{var a=new Date().getFullYear(),o=new Date(a,0,1),u=new Date(a,6,1),s=o.getTimezoneOffset(),c=u.getTimezoneOffset(),d=Math.max(s,c);P[e>>2]=d*60,it[t>>2]=+(s!=c);var h=b=>{var O=b>=0?"-":"+",I=Math.abs(b),D=String(Math.floor(I/60)).padStart(2,"0"),x=String(I%60).padStart(2,"0");return`UTC${O}${D}${x}`},v=h(s),$=h(c);c<s?(ut(v,r,17),ut($,n,17)):(ut(v,n,17),ut($,r,17))},wa=()=>2147483648,$a=(e,t)=>Math.ceil(e/t)*t,ba=e=>{var t=Ct.buffer,r=(e-t.byteLength+65535)/65536|0;try{return Ct.grow(r),we(),1}catch{}},Ca=e=>{var t=V.length;e>>>=0;var r=wa();if(e>r)return!1;for(var n=1;n<=4;n*=2){var a=t*(1+.2/n);a=Math.min(a,e+100663296);var o=Math.min(r,$a(Math.max(e,a),65536)),u=ba(o);if(u)return!0}return!1},ee={},Ta=()=>q||"./this.program",mt=()=>{if(!mt.strings){var e=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:e,_:Ta()};for(var r in ee)ee[r]===void 0?delete t[r]:t[r]=ee[r];var n=[];for(var r in t)n.push(`${r}=${t[r]}`);mt.strings=n}return mt.strings},Pa=(e,t)=>{var r=0,n=0;for(var a of mt()){var o=t+r;P[e+n>>2]=o,r+=ut(a,o,1/0)+1,n+=4}return 0},_a=(e,t)=>{var r=mt();P[e>>2]=r.length;var n=0;for(var a of r)n+=Le(a)+1;return P[t>>2]=n,0},Ea=e=>52;function Oa(e,t,r,n,a){return 70}var Aa=[null,[],[]],Sa=(e,t)=>{var r=Aa[e];t===0||t===10?((e===1?bt:Y)(We(r)),r.length=0):r.push(t)},Da=(e,t,r,n)=>{for(var a=0,o=0;o<r;o++){var u=P[t>>2],s=P[t+4>>2];t+=8;for(var c=0;c<s;c++)Sa(e,V[u+c]);a+=s}return P[n>>2]=a,0},Ia=e=>e;hn(),gn(),Dn(),l.noExitRuntime&&l.noExitRuntime,l.print&&(bt=l.print),l.printErr&&(Y=l.printErr),l.wasmBinary&&(dt=l.wasmBinary),l.arguments&&l.arguments,l.thisProgram&&(q=l.thisProgram);var xa={s:Kr,w:tn,a:en,j:rn,m:nn,P:an,p:on,ga:sn,d:un,ba:cn,ua:fn,aa:dn,pa:vn,sa:Fn,ra:Rn,H:Ln,na:Bn,V:Un,W:Vn,x:Hn,t:Nn,ta:Gn,oa:Yn,Q:ra,I:na,va:aa,qa:oa,da:ia,wa:Kt,D:ca,ma:pa,X:va,Y:ya,U:ma,ca:ga,ha:Ca,ea:Pa,fa:_a,ia:Ea,_:Oa,S:Da,K:ho,C:vo,M:za,R:bo,q:uo,b:qa,E:fo,ka:mo,c:Ya,ja:go,h:Na,i:Ka,r:no,O:lo,v:oo,F:so,L:co,z:yo,J:Co,$:To,Z:Po,k:Za,f:Ha,e:Xa,g:Ga,N:$o,l:Ja,la:po,o:ao,B:to,u:io,T:ro,A:wo,n:Qa,G:eo,y:Ia},E=await Zr();E.ya;var Ma=E.za,nt=l._free=E.Aa,He=l._malloc=E.Ca,Fa=E.Da,y=E.Ea,ja=E.Fa,Ra=E.Ga,La=E.Ha,Ba=E.Ia,Wa=E.Ja,Ua=E.Ka;l.dynCall_viijii=E.La;var Va=l.dynCall_iiijj=E.Ma;l.dynCall_jiji=E.Na;var ka=l.dynCall_jiiii=E.Oa;l.dynCall_iiiiij=E.Pa,l.dynCall_iiiiijj=E.Qa,l.dynCall_iiiiiijj=E.Ra;function Ha(e,t){var r=g();try{w(e)(t)}catch(n){if(m(r),n!==n+0)throw n;y(1,0)}}function Na(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function za(e,t,r,n,a){var o=g();try{return w(e)(t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function Ga(e,t,r,n){var a=g();try{w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function Xa(e,t,r){var n=g();try{w(e)(t,r)}catch(a){if(m(n),a!==a+0)throw a;y(1,0)}}function qa(e,t){var r=g();try{return w(e)(t)}catch(n){if(m(r),n!==n+0)throw n;y(1,0)}}function Ya(e,t,r){var n=g();try{return w(e)(t,r)}catch(a){if(m(n),a!==a+0)throw a;y(1,0)}}function Za(e){var t=g();try{w(e)()}catch(r){if(m(t),r!==r+0)throw r;y(1,0)}}function Qa(e,t,r,n,a,o,u,s,c,d,h){var v=g();try{w(e)(t,r,n,a,o,u,s,c,d,h)}catch($){if(m(v),$!==$+0)throw $;y(1,0)}}function Ja(e,t,r,n,a){var o=g();try{w(e)(t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function Ka(e,t,r,n,a){var o=g();try{return w(e)(t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function to(e,t,r,n,a,o,u){var s=g();try{w(e)(t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function eo(e,t,r,n,a,o,u,s,c,d,h,v,$,b,O,I){var D=g();try{w(e)(t,r,n,a,o,u,s,c,d,h,v,$,b,O,I)}catch(x){if(m(D),x!==x+0)throw x;y(1,0)}}function ro(e,t,r,n,a,o,u,s,c){var d=g();try{w(e)(t,r,n,a,o,u,s,c)}catch(h){if(m(d),h!==h+0)throw h;y(1,0)}}function no(e,t,r,n,a,o){var u=g();try{return w(e)(t,r,n,a,o)}catch(s){if(m(u),s!==s+0)throw s;y(1,0)}}function ao(e,t,r,n,a,o){var u=g();try{w(e)(t,r,n,a,o)}catch(s){if(m(u),s!==s+0)throw s;y(1,0)}}function oo(e,t,r,n,a,o,u){var s=g();try{return w(e)(t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function io(e,t,r,n,a,o,u,s){var c=g();try{w(e)(t,r,n,a,o,u,s)}catch(d){if(m(c),d!==d+0)throw d;y(1,0)}}function so(e,t,r,n,a,o,u,s){var c=g();try{return w(e)(t,r,n,a,o,u,s)}catch(d){if(m(c),d!==d+0)throw d;y(1,0)}}function uo(e){var t=g();try{return w(e)()}catch(r){if(m(t),r!==r+0)throw r;y(1,0)}}function co(e,t,r,n,a,o,u,s,c){var d=g();try{return w(e)(t,r,n,a,o,u,s,c)}catch(h){if(m(d),h!==h+0)throw h;y(1,0)}}function lo(e,t,r,n,a,o,u){var s=g();try{return w(e)(t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function fo(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function ho(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function po(e,t,r,n,a,o,u,s){var c=g();try{w(e)(t,r,n,a,o,u,s)}catch(d){if(m(c),d!==d+0)throw d;y(1,0)}}function vo(e,t,r,n,a,o){var u=g();try{return w(e)(t,r,n,a,o)}catch(s){if(m(u),s!==s+0)throw s;y(1,0)}}function yo(e,t,r,n,a,o,u,s,c,d){var h=g();try{return w(e)(t,r,n,a,o,u,s,c,d)}catch(v){if(m(h),v!==v+0)throw v;y(1,0)}}function mo(e,t,r){var n=g();try{return w(e)(t,r)}catch(a){if(m(n),a!==a+0)throw a;y(1,0)}}function go(e,t,r,n,a){var o=g();try{return w(e)(t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function wo(e,t,r,n,a,o,u,s,c,d){var h=g();try{w(e)(t,r,n,a,o,u,s,c,d)}catch(v){if(m(h),v!==v+0)throw v;y(1,0)}}function $o(e,t,r,n,a,o,u){var s=g();try{w(e)(t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function bo(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function Co(e,t,r,n,a,o,u,s,c,d,h,v){var $=g();try{return w(e)(t,r,n,a,o,u,s,c,d,h,v)}catch(b){if(m($),b!==b+0)throw b;y(1,0)}}function To(e,t,r,n,a,o,u){var s=g();try{return Va(e,t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function Po(e,t,r,n,a){var o=g();try{return ka(e,t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function re(){if(K>0){ht=re;return}if(Wr(),K>0){ht=re;return}function e(){var t;l.calledRun=!0,!ye&&(Ur(),C(l),(t=l.onRuntimeInitialized)===null||t===void 0||t.call(l),Vr())}l.setStatus?(l.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>l.setStatus(""),1),e()},1)):e()}function _o(){if(l.preInit)for(typeof l.preInit=="function"&&(l.preInit=[l.preInit]);l.preInit.length>0;)l.preInit.shift()()}return _o(),re(),f=F,f};function Ut(i){return oe(Wt,i)}function gr(){return yr(Wt)}function wr(i){Ut({overrides:i,equalityFn:Object.is,fireImmediately:!1})}async function $r(i,f){return mr(Wt,i,f)}const br="68d20eb8c486afabf49fab6d9fbc5f118df8648ec6200e8039ef8912a169c00c",ie=[["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"]],Cr=[...ie,["unknown"]].map(i=>i[0]),Vt=new Map(ie);function Tr(i){for(const[f,p]of Vt)if(i===p)return f;return"unknown"}function Pr(i){if(se(i))return{width:i.naturalWidth,height:i.naturalHeight};if(ue(i))return{width:i.width.baseVal.value,height:i.height.baseVal.value};if(ce(i))return{width:i.videoWidth,height:i.videoHeight};if(fe(i))return{width:i.width,height:i.height};if(he(i))return{width:i.displayWidth,height:i.displayHeight};if(le(i))return{width:i.width,height:i.height};if(de(i))return{width:i.width,height:i.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 se(i){var f,p;try{return i instanceof((p=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.HTMLImageElement)}catch{return!1}}function ue(i){var f,p;try{return i instanceof((p=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.SVGImageElement)}catch{return!1}}function ce(i){var f,p;try{return i instanceof((p=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.HTMLVideoElement)}catch{return!1}}function le(i){var f,p;try{return i instanceof((p=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.HTMLCanvasElement)}catch{return!1}}function fe(i){try{return i instanceof ImageBitmap||Object.prototype.toString.call(i)==="[object ImageBitmap]"}catch{return!1}}function de(i){try{return i instanceof OffscreenCanvas||Object.prototype.toString.call(i)==="[object OffscreenCanvas]"}catch{return!1}}function he(i){try{return i instanceof VideoFrame||Object.prototype.toString.call(i)==="[object VideoFrame]"}catch{return!1}}function _r(i){try{return i instanceof Blob||Object.prototype.toString.call(i)==="[object Blob]"}catch{return!1}}function Er(i){try{return i instanceof ImageData||Object.prototype.toString.call(i)==="[object ImageData]"}catch{return!1}}function Or(i,f){try{const p=new OffscreenCanvas(i,f);if(p.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return p;throw void 0}catch{const p=document.createElement("canvas");return p.width=i,p.height=f,p}}async function pe(i){if(se(i)&&!await Ir(i))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(ue(i)&&!await xr(i))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(he(i)&&Mr(i))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(ce(i)&&(i.readyState===0||i.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(fe(i)&&jr(i))throw new DOMException("The image source is detached.","InvalidStateError");const{width:f,height:p}=Pr(i);if(f===0||p===0)return null;const C=Or(f,p).getContext("2d");C.drawImage(i,0,0);try{return C.getImageData(0,0,f,p)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Ar(i){let f;try{f=await createImageBitmap(i)}catch{try{if(globalThis.Image){f=new Image;let C="";try{C=URL.createObjectURL(i),f.src=C,await f.decode()}finally{URL.revokeObjectURL(C)}}else return i}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}}return await pe(f)}function Sr(i){const{width:f,height:p}=i;if(f===0||p===0)return null;const l=i.getContext("2d");try{return l.getImageData(0,0,f,p)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Dr(i){if(_r(i))return await Ar(i);if(Er(i)){if(Fr(i))throw new DOMException("The image data has been detached.","InvalidStateError");return i}return le(i)||de(i)?Sr(i):await pe(i)}async function Ir(i){try{return await i.decode(),!0}catch{return!1}}async function xr(i){var f;try{return await((f=i.decode)==null?void 0:f.call(i)),!0}catch{return!1}}function Mr(i){return i.format===null}function Fr(i){return i.data.buffer.byteLength===0}function jr(i){return i.width===0&&i.height===0}function ve(i,f){return Rr(i)?new DOMException(`${f}: ${i.message}`,i.name):Lr(i)?new i.constructor(`${f}: ${i.message}`):new Error(`${f}: ${i}`)}function Rr(i){return i instanceof DOMException||Object.prototype.toString.call(i)==="[object DOMException]"}function Lr(i){return i instanceof Error||Object.prototype.toString.call(i)==="[object Error]"}class Br{constructor(f={}){Qe(this,ct);var p;try{const l=(p=f==null?void 0:f.formats)==null?void 0:p.filter(C=>C!=="unknown");if((l==null?void 0:l.length)===0)throw new TypeError("Hint option provided, but is empty.");for(const C of l!=null?l:[])if(!Vt.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.`);Je(this,ct,l!=null?l:[]),Ut({fireImmediately:!0}).catch(()=>{})}catch(l){throw ve(l,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return Cr.filter(f=>f!=="unknown")}async detect(f){try{const p=await Dr(f);if(p===null)return[];let l;const C={tryCode39ExtendedMode:!1,textMode:"Plain",formats:Ze(this,ct).map(A=>Vt.get(A))};try{l=await $r(p,C)}catch(A){throw console.error(A),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return l.map(A=>{const{topLeft:{x:F,y:B},topRight:{x:S,y:j},bottomLeft:{x:q,y:Z},bottomRight:{x:Q,y:lt}}=A.position,ft=Math.min(F,S,q,Q),at=Math.min(B,j,Z,lt),bt=Math.max(F,S,q,Q),Y=Math.max(B,j,Z,lt);return{boundingBox:new DOMRectReadOnly(ft,at,bt-ft,Y-at),rawValue:A.text,format:Tr(A.format),cornerPoints:[{x:F,y:B},{x:S,y:j},{x:Q,y:lt},{x:q,y:Z}]}})}catch(p){throw ve(p,"Failed to execute 'detect' on 'BarcodeDetector'")}}}return ct=new WeakMap,_.BarcodeDetector=Br,_.ZXING_CPP_COMMIT=hr,_.ZXING_WASM_SHA256=br,_.ZXING_WASM_VERSION=dr,_.prepareZXingModule=Ut,_.purgeZXingModule=gr,_.setZXingModuleOverrides=wr,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"}),_}({});
1
+ var BarcodeDetectionAPI=(function(O){"use strict";var er=O=>{throw TypeError(O)};var rr=(O,M,F)=>M.has(O)||er("Cannot "+F);var nr=(O,M,F)=>(rr(O,M,"read from private field"),F?F.call(O):M.get(O)),ar=(O,M,F)=>M.has(O)?er("Cannot add the same private member more than once"):M instanceof WeakSet?M.add(O):M.set(O,F),or=(O,M,F,vt)=>(rr(O,M,"write to private field"),vt?vt.call(O,F):M.set(O,F),F);var it;const M=[["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=M.map(([i])=>i),vt=F.filter((i,f)=>M[f][1]==="L"),ir=F.filter((i,f)=>M[f][1]==="M");function Rt(i){switch(i){case"Linear-Codes":return vt.reduce((f,h)=>f|Rt(h),0);case"Matrix-Codes":return ir.reduce((f,h)=>f|Rt(h),0);case"Any":return(1<<M.length)-1;case"None":return 0;default:return 1<<F.indexOf(i)}}function sr(i){if(i===0)return"None";const f=31-Math.clz32(i);return F[f]}function ur(i){return i.reduce((f,h)=>f|Rt(h),0)}const cr=["LocalAverage","GlobalHistogram","FixedThreshold","BoolCast"];function lr(i){return cr.indexOf(i)}const te=["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 fr(i){return i==="UnicodeBig"?te.indexOf("UTF16BE"):te.indexOf(i)}const dr=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function hr(i){return dr[i]}const pr=["Ignore","Read","Require"];function vr(i){return pr.indexOf(i)}const yr=["Plain","ECI","HRI","Hex","Escaped"];function mr(i){return yr.indexOf(i)}const yt={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 ee(i){return{...i,formats:ur(i.formats),binarizer:lr(i.binarizer),eanAddOnSymbol:vr(i.eanAddOnSymbol),textMode:mr(i.textMode),characterSet:fr(i.characterSet)}}function gr(i){return{...i,format:sr(i.format),contentType:hr(i.contentType),eccLevel:i.ecLevel}}const wr="2.2.3",$r="fba4e9503fee4518ca2e89510baeea9bcc36dc8d",br={locateFile:(i,f)=>{const h=i.match(/_(.+?)\.wasm$/);return h?`https://fastly.jsdelivr.net/npm/zxing-wasm@2.2.3/dist/${h[1]}/${i}`:f+i}},mt=new WeakMap;function Cr(i,f){return Object.is(i,f)||Object.keys(i).length===Object.keys(f).length&&Object.keys(i).every(h=>Object.hasOwn(f,h)&&i[h]===f[h])}function re(i,{overrides:f,equalityFn:h=Cr,fireImmediately:T=!1}={}){var l;const[D,A]=(l=mt.get(i))!=null?l:[br],R=f!=null?f:D;let S;if(T){if(A&&(S=h(D,R)))return A;const j=i({...R});return mt.set(i,[R,j]),j}(S!=null?S:h(D,R))||mt.set(i,[R])}function Tr(i){mt.delete(i)}async function Pr(i,f,h=yt){const T={...yt,...h},l=await re(i,{fireImmediately:!0});let D,A;if("width"in f&&"height"in f&&"data"in f){const{data:S,data:{byteLength:j},width:H,height:Z}=f;A=l._malloc(j),l.HEAPU8.set(S,A),D=l.readBarcodesFromPixmap(A,H,Z,ee(T))}else{let S,j;if("buffer"in f)[S,j]=[f.byteLength,f];else if("byteLength"in f)[S,j]=[f.byteLength,new Uint8Array(f)];else if("size"in f)[S,j]=[f.size,new Uint8Array(await f.arrayBuffer())];else throw new TypeError("Invalid input type");A=l._malloc(S),l.HEAPU8.set(j,A),D=l.readBarcodesFromImage(A,S,ee(T))}l._free(A);const R=[];for(let S=0;S<D.size();++S)R.push(gr(D.get(S)));return R}({...yt,formats:[...yt.formats]});async function jt(i={}){var f,h,T,l=i,D=!!globalThis.window,A=typeof Bun<"u",R=!!globalThis.WorkerGlobalScope;!((h=globalThis.process)===null||h===void 0||(h=h.versions)===null||h===void 0)&&h.node&&((T=globalThis.process)===null||T===void 0?void 0:T.type)!="renderer";var S="./this.program",j,H="";function Z(t){return l.locateFile?l.locateFile(t,H):H+t}var nt,Q;if(D||R||A){try{H=new URL(".",j).href}catch{}R&&(Q=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),nt=async t=>{var e=await fetch(t,{credentials:"same-origin"});if(e.ok)return e.arrayBuffer();throw new Error(e.status+" : "+e.url)}}var st=console.log.bind(console),k=console.error.bind(console),J,gt=!1,he,pe,K,N,wt,ut,ct,E,ve,ye,me=!1;function ge(){var t=Dt.buffer;K=new Int8Array(t),wt=new Int16Array(t),l.HEAPU8=N=new Uint8Array(t),ut=new Uint16Array(t),ct=new Int32Array(t),E=new Uint32Array(t),ve=new Float32Array(t),ye=new Float64Array(t)}function Gr(){if(l.preRun)for(typeof l.preRun=="function"&&(l.preRun=[l.preRun]);l.preRun.length;)nn(l.preRun.shift());we(be)}function Xr(){me=!0,pt.xa()}function qr(){if(l.postRun)for(typeof l.postRun=="function"&&(l.postRun=[l.postRun]);l.postRun.length;)rn(l.postRun.shift());we($e)}function Ut(t){var e,r;(e=l.onAbort)===null||e===void 0||e.call(l,t),t="Aborted("+t+")",k(t),gt=!0,t+=". Build with -sASSERTIONS for more info.";var n=new WebAssembly.RuntimeError(t);throw(r=pe)===null||r===void 0||r(n),n}var $t;function Yr(){return Z("zxing_reader.wasm")}function Zr(t){if(t==$t&&J)return new Uint8Array(J);if(Q)return Q(t);throw"both async and sync fetching of the wasm failed"}async function Qr(t){if(!J)try{var e=await nt(t);return new Uint8Array(e)}catch{}return Zr(t)}async function Jr(t,e){try{var r=await Qr(t),n=await WebAssembly.instantiate(r,e);return n}catch(a){k(`failed to asynchronously prepare wasm: ${a}`),Ut(a)}}async function Kr(t,e,r){if(!t&&WebAssembly.instantiateStreaming)try{var n=fetch(e,{credentials:"same-origin"}),a=await WebAssembly.instantiateStreaming(n,r);return a}catch(o){k(`wasm streaming compile failed: ${o}`),k("falling back to ArrayBuffer instantiation")}return Jr(e,r)}function tn(){var t={a:ja};return t}async function en(){function t(o,s){return pt=o.exports,Ra(pt),ge(),pt}function e(o){return t(o.instance)}var r=tn();if(l.instantiateWasm)return new Promise((o,s)=>{l.instantiateWasm(r,(u,c)=>{o(t(u))})});$t!=null||($t=Yr());var n=await Kr(J,$t,r),a=e(n);return a}var we=t=>{for(;t.length>0;)t.shift()(l)},$e=[],rn=t=>$e.push(t),be=[],nn=t=>be.push(t),g=t=>ke(t),w=()=>Ne(),bt=[],Ct=0,an=t=>{var e=new Vt(t);return e.get_caught()||(e.set_caught(!0),Ct--),e.set_rethrown(!1),bt.push(e),Ge(t),We(t)},z=0,on=()=>{m(0,0);var t=bt.pop();ze(t.excPtr),z=0};class Vt{constructor(e){this.excPtr=e,this.ptr=e-24}set_type(e){E[this.ptr+4>>2]=e}get_type(){return E[this.ptr+4>>2]}set_destructor(e){E[this.ptr+8>>2]=e}get_destructor(){return E[this.ptr+8>>2]}set_caught(e){e=e?1:0,K[this.ptr+12]=e}get_caught(){return K[this.ptr+12]!=0}set_rethrown(e){e=e?1:0,K[this.ptr+13]=e}get_rethrown(){return K[this.ptr+13]!=0}init(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)}set_adjusted_ptr(e){E[this.ptr+16>>2]=e}get_adjusted_ptr(){return E[this.ptr+16>>2]}}var Tt=t=>He(t),Wt=t=>{var e=z;if(!e)return Tt(0),0;var r=new Vt(e);r.set_adjusted_ptr(e);var n=r.get_type();if(!n)return Tt(0),e;for(var a of t){if(a===0||a===n)break;var o=r.ptr+16;if(Xe(a,n,o))return Tt(a),e}return Tt(n),e},sn=()=>Wt([]),un=t=>Wt([t]),cn=(t,e)=>Wt([t,e]),ln=()=>{var t=bt.pop();t||Ut("no exception to throw");var e=t.excPtr;throw t.get_rethrown()||(bt.push(t),t.set_rethrown(!0),t.set_caught(!1),Ct++),z=e,z},fn=(t,e,r)=>{var n=new Vt(t);throw n.init(e,r),z=t,Ct++,z},dn=()=>Ct,hn=t=>{throw z||(z=t),z},pn=()=>Ut(""),Pt={},Ht=t=>{for(;t.length;){var e=t.pop(),r=t.pop();r(e)}};function lt(t){return this.fromWireType(E[t>>2])}var at={},tt={},Et={},vn=class extends Error{constructor(t){super(t),this.name="InternalError"}},Ot=t=>{throw new vn(t)},et=(t,e,r)=>{t.forEach(u=>Et[u]=e);function n(u){var c=r(u);c.length!==t.length&&Ot("Mismatched type converter count");for(var d=0;d<t.length;++d)V(t[d],c[d])}var a=new Array(e.length),o=[],s=0;for(let[u,c]of e.entries())tt.hasOwnProperty(c)?a[u]=tt[c]:(o.push(c),at.hasOwnProperty(c)||(at[c]=[]),at[c].push(()=>{a[u]=tt[c],++s,s===o.length&&n(a)}));o.length===0&&n(a)},yn=t=>{var e=Pt[t];delete Pt[t];var r=e.rawConstructor,n=e.rawDestructor,a=e.fields,o=a.map(s=>s.getterReturnType).concat(a.map(s=>s.setterArgumentType));et([t],o,s=>{var u={};for(var[c,d]of a.entries()){const p=s[c],v=d.getter,y=d.getterContext,C=s[c+a.length],x=d.setter,I=d.setterContext;u[d.fieldName]={read:P=>p.fromWireType(v(y,P)),write:(P,_)=>{var Y=[];x(I,P,C.toWireType(Y,_)),Ht(Y)},optional:p.optional}}return[{name:e.name,fromWireType:p=>{var v={};for(var y in u)v[y]=u[y].read(p);return n(p),v},toWireType:(p,v)=>{for(var y in u)if(!(y in v)&&!u[y].optional)throw new TypeError(`Missing field: "${y}"`);var C=r();for(y in u)u[y].write(C,v[y]);return p!==null&&p.push(n,C),C},readValueFromPointer:lt,destructorFunction:n}]})},mn=(t,e,r,n,a)=>{},B=t=>{for(var e="";;){var r=N[t++];if(!r)return e;e+=String.fromCharCode(r)}},ft=class extends Error{constructor(t){super(t),this.name="BindingError"}},b=t=>{throw new ft(t)};function gn(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=e.name;if(t||b(`type "${n}" must have a positive integer typeid pointer`),tt.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;b(`Cannot register type '${n}' twice`)}if(tt[t]=e,delete Et[t],at.hasOwnProperty(t)){var a=at[t];delete at[t],a.forEach(o=>o())}}function V(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return gn(t,e,r)}var wn=(t,e,r,n)=>{e=B(e),V(t,{name:e,fromWireType:function(a){return!!a},toWireType:function(a,o){return o?r:n},readValueFromPointer:function(a){return this.fromWireType(N[a])},destructorFunction:null})},$n=t=>({count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType}),kt=t=>{function e(r){return r.$$.ptrType.registeredClass.name}b(e(t)+" instance already deleted")},Nt=!1,Ce=t=>{},bn=t=>{t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)},Te=t=>{t.count.value-=1;var e=t.count.value===0;e&&bn(t)},dt=t=>globalThis.FinalizationRegistry?(Nt=new FinalizationRegistry(e=>{Te(e.$$)}),dt=e=>{var r=e.$$,n=!!r.smartPtr;if(n){var a={$$:r};Nt.register(e,a,e)}return e},Ce=e=>Nt.unregister(e),dt(t)):(dt=e=>e,t),Cn=()=>{let t=_t.prototype;Object.assign(t,{isAliasOf(r){if(!(this instanceof _t)||!(r instanceof _t))return!1;var n=this.$$.ptrType.registeredClass,a=this.$$.ptr;r.$$=r.$$;for(var o=r.$$.ptrType.registeredClass,s=r.$$.ptr;n.baseClass;)a=n.upcast(a),n=n.baseClass;for(;o.baseClass;)s=o.upcast(s),o=o.baseClass;return n===o&&a===s},clone(){if(this.$$.ptr||kt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var r=dt(Object.create(Object.getPrototypeOf(this),{$$:{value:$n(this.$$)}}));return r.$$.count.value+=1,r.$$.deleteScheduled=!1,r},delete(){this.$$.ptr||kt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&b("Object already scheduled for deletion"),Ce(this),Te(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||kt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&b("Object already scheduled for deletion"),this.$$.deleteScheduled=!0,this}});const e=Symbol.dispose;e&&(t[e]=t.delete)};function _t(){}var zt=(t,e)=>Object.defineProperty(e,"name",{value:t}),Pe={},Ee=(t,e,r)=>{if(t[e].overloadTable===void 0){var n=t[e];t[e]=function(){for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];return t[e].overloadTable.hasOwnProperty(o.length)||b(`Function '${r}' called with an invalid number of arguments (${o.length}) - expects one of (${t[e].overloadTable})!`),t[e].overloadTable[o.length].apply(this,o)},t[e].overloadTable=[],t[e].overloadTable[n.argCount]=n}},Oe=(t,e,r)=>{l.hasOwnProperty(t)?((r===void 0||l[t].overloadTable!==void 0&&l[t].overloadTable[r]!==void 0)&&b(`Cannot register public name '${t}' twice`),Ee(l,t,t),l[t].overloadTable.hasOwnProperty(r)&&b(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),l[t].overloadTable[r]=e):(l[t]=e,l[t].argCount=r)},Tn=48,Pn=57,En=t=>{t=t.replace(/[^a-zA-Z0-9_]/g,"$");var e=t.charCodeAt(0);return e>=Tn&&e<=Pn?`_${t}`:t};function On(t,e,r,n,a,o,s,u){this.name=t,this.constructor=e,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=o,this.upcast=s,this.downcast=u,this.pureVirtualFunctions=[]}var Gt=(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},Xt=t=>{if(t===null)return"null";var e=typeof t;return e==="object"||e==="array"||e==="function"?t.toString():""+t};function _n(t,e){if(e===null)return this.isReference&&b(`null is not a valid ${this.name}`),0;e.$$||b(`Cannot pass "${Xt(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=Gt(e.$$.ptr,r,this.registeredClass);return n}function Sn(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 "${Xt(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=Gt(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,W.toHandle(()=>a.delete())),t!==null&&t.push(this.rawDestructor,r)}break;default:b("Unsupporting sharing policy")}return r}function In(t,e){if(e===null)return this.isReference&&b(`null is not a valid ${this.name}`),0;e.$$||b(`Cannot pass "${Xt(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=Gt(e.$$.ptr,r,this.registeredClass);return n}var _e=(t,e,r)=>{if(e===r)return t;if(r.baseClass===void 0)return null;var n=_e(t,e,r.baseClass);return n===null?null:r.downcast(n)},xn={},Dn=(t,e)=>{for(e===void 0&&b("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e},Mn=(t,e)=>(e=Dn(t,e),xn[e]),St=(t,e)=>{(!e.ptrType||!e.ptr)&&Ot("makeClassHandle requires ptr and ptrType");var r=!!e.smartPtrType,n=!!e.smartPtr;return r!==n&&Ot("Both smartPtrType and smartPtr must be specified"),e.count={value:1},dt(Object.create(t,{$$:{value:e,writable:!0}}))};function An(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=Mn(this.registeredClass,e);if(r!==void 0){if(r.$$.count.value===0)return r.$$.ptr=e,r.$$.smartPtr=t,r.clone();var n=r.clone();return this.destructor(t),n}function a(){return this.isSmartPointer?St(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:t}):St(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var o=this.registeredClass.getActualType(e),s=Pe[o];if(!s)return a.call(this);var u;this.isConst?u=s.constPointerType:u=s.pointerType;var c=_e(e,this.registeredClass,u.registeredClass);return c===null?a.call(this):this.isSmartPointer?St(u.registeredClass.instancePrototype,{ptrType:u,ptr:c,smartPtrType:this,smartPtr:t}):St(u.registeredClass.instancePrototype,{ptrType:u,ptr:c})}var Fn=()=>{Object.assign(It.prototype,{getPointee(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t},destructor(t){var e;(e=this.rawDestructor)===null||e===void 0||e.call(this,t)},readValueFromPointer:lt,fromWireType:An})};function It(t,e,r,n,a,o,s,u,c,d,p){this.name=t,this.registeredClass=e,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=o,this.sharingPolicy=s,this.rawGetPointee=u,this.rawConstructor=c,this.rawShare=d,this.rawDestructor=p,!a&&e.baseClass===void 0?n?(this.toWireType=_n,this.destructorFunction=null):(this.toWireType=In,this.destructorFunction=null):this.toWireType=Sn}var Se=(t,e,r)=>{l.hasOwnProperty(t)||Ot("Replacing nonexistent public symbol"),l[t].overloadTable!==void 0&&r!==void 0?l[t].overloadTable[r]=e:(l[t]=e,l[t].argCount=r)},X={},Rn=(t,e,r)=>{t=t.replace(/p/g,"i");var n=X[t];return n(e,...r)},Ie=[],$=t=>{var e=Ie[t];return e||(Ie[t]=e=Ze.get(t)),e},jn=function(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(t.includes("j"))return Rn(t,e,r);var n=$(e),a=n(...r);return a},Bn=function(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return function(){for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];return jn(t,e,a,r)}},U=function(t,e){t=B(t);function r(){if(t.includes("j"))return Bn(t,e);var a=$(e);return a}var n=r();return typeof n!="function"&&b(`unknown function pointer with signature ${t}: ${e}`),n};class Ln extends Error{}var xe=t=>{var e=Ve(t),r=B(e);return q(e),r},xt=(t,e)=>{var r=[],n={};function a(o){if(!n[o]&&!tt[o]){if(Et[o]){Et[o].forEach(a);return}r.push(o),n[o]=!0}}throw e.forEach(a),new Ln(`${t}: `+r.map(xe).join([", "]))},Un=(t,e,r,n,a,o,s,u,c,d,p,v,y)=>{p=B(p),o=U(a,o),u&&(u=U(s,u)),d&&(d=U(c,d)),y=U(v,y);var C=En(p);Oe(C,function(){xt(`Cannot construct ${p} due to unbound types`,[n])}),et([t,e,r],n?[n]:[],x=>{x=x[0];var I,P;n?(I=x.registeredClass,P=I.instancePrototype):P=_t.prototype;var _=zt(p,function(){if(Object.getPrototypeOf(this)!==Y)throw new ft(`Use 'new' to construct ${p}`);if(L.constructor_body===void 0)throw new ft(`${p} has no accessible constructor`);for(var Ke=arguments.length,At=new Array(Ke),Ft=0;Ft<Ke;Ft++)At[Ft]=arguments[Ft];var tr=L.constructor_body[At.length];if(tr===void 0)throw new ft(`Tried to invoke ctor of ${p} with invalid number of parameters (${At.length}) - expected (${Object.keys(L.constructor_body).toString()}) parameters instead!`);return tr.apply(this,At)}),Y=Object.create(P,{constructor:{value:_}});_.prototype=Y;var L=new On(p,_,Y,y,I,o,u,d);if(L.baseClass){var G,Mt;(Mt=(G=L.baseClass).__derivedClasses)!==null&&Mt!==void 0||(G.__derivedClasses=[]),L.baseClass.__derivedClasses.push(L)}var $o=new It(p,L,!0,!1,!1),Qe=new It(p+"*",L,!1,!1,!1),Je=new It(p+" const*",L,!1,!0,!1);return Pe[t]={pointerType:Qe,constPointerType:Je},Se(C,_),[$o,Qe,Je]})},qt=(t,e)=>{for(var r=[],n=0;n<t;n++)r.push(E[e+n*4>>2]);return r};function Vn(t){for(var e=1;e<t.length;++e)if(t[e]!==null&&t[e].destructorFunction===void 0)return!0;return!1}function Yt(t,e,r,n,a,o){var s=e.length;s<2&&b("argTypes array size mismatch! Must at least get return value and 'this' types!");var u=e[1]!==null&&r!==null,c=Vn(e),d=!e[0].isVoid,p=s-2,v=new Array(p),y=[],C=[],x=function(){C.length=0;var I;y.length=u?2:1,y[0]=a,u&&(I=e[1].toWireType(C,this),y[1]=I);for(var P=0;P<p;++P)v[P]=e[P+2].toWireType(C,P<0||arguments.length<=P?void 0:arguments[P]),y.push(v[P]);var _=n(...y);function Y(L){if(c)Ht(C);else for(var G=u?1:2;G<e.length;G++){var Mt=G===1?I:v[G-2];e[G].destructorFunction!==null&&e[G].destructorFunction(Mt)}if(d)return e[0].fromWireType(L)}return Y(_)};return zt(t,x)}var Wn=(t,e,r,n,a,o)=>{var s=qt(e,r);a=U(n,a),et([],[t],u=>{u=u[0];var c=`constructor ${u.name}`;if(u.registeredClass.constructor_body===void 0&&(u.registeredClass.constructor_body=[]),u.registeredClass.constructor_body[e-1]!==void 0)throw new ft(`Cannot register multiple constructors with identical number of parameters (${e-1}) for class '${u.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return u.registeredClass.constructor_body[e-1]=()=>{xt(`Cannot construct ${u.name} due to unbound types`,s)},et([],s,d=>(d.splice(1,0,null),u.registeredClass.constructor_body[e-1]=Yt(c,d,null,a,o),[])),[]})},De=t=>{t=t.trim();const e=t.indexOf("(");return e===-1?t:t.slice(0,e)},Hn=(t,e,r,n,a,o,s,u,c,d)=>{var p=qt(r,n);e=B(e),e=De(e),o=U(a,o),et([],[t],v=>{v=v[0];var y=`${v.name}.${e}`;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),u&&v.registeredClass.pureVirtualFunctions.push(e);function C(){xt(`Cannot call ${y} due to unbound types`,p)}var x=v.registeredClass.instancePrototype,I=x[e];return I===void 0||I.overloadTable===void 0&&I.className!==v.name&&I.argCount===r-2?(C.argCount=r-2,C.className=v.name,x[e]=C):(Ee(x,e,y),x[e].overloadTable[r-2]=C),et([],p,P=>{var _=Yt(y,P,v,o,s);return x[e].overloadTable===void 0?(_.argCount=r-2,x[e]=_):x[e].overloadTable[r-2]=_,[]}),[]})},Me=[],rt=[0,1,,1,null,1,!0,1,!1,1],Zt=t=>{t>9&&--rt[t+1]===0&&(rt[t]=void 0,Me.push(t))},W={toValue:t=>(t||b(`Cannot use deleted val. handle = ${t}`),rt[t]),toHandle:t=>{switch(t){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const e=Me.pop()||rt.length;return rt[e]=t,rt[e+1]=1,e}}}},Ae={name:"emscripten::val",fromWireType:t=>{var e=W.toValue(t);return Zt(t),e},toWireType:(t,e)=>W.toHandle(e),readValueFromPointer:lt,destructorFunction:null},kn=t=>V(t,Ae),Nn=(t,e)=>{switch(e){case 4:return function(r){return this.fromWireType(ve[r>>2])};case 8:return function(r){return this.fromWireType(ye[r>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},zn=(t,e,r)=>{e=B(e),V(t,{name:e,fromWireType:n=>n,toWireType:(n,a)=>a,readValueFromPointer:Nn(e,r),destructorFunction:null})},Gn=(t,e,r,n,a,o,s,u)=>{var c=qt(e,r);t=B(t),t=De(t),a=U(n,a),Oe(t,function(){xt(`Cannot call ${t} due to unbound types`,c)},e-1),et([],c,d=>{var p=[d[0],null].concat(d.slice(1));return Se(t,Yt(t,p,null,a,o),e-1),[]})},Xn=(t,e,r)=>{switch(e){case 1:return r?n=>K[n]:n=>N[n];case 2:return r?n=>wt[n>>1]:n=>ut[n>>1];case 4:return r?n=>ct[n>>2]:n=>E[n>>2];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},qn=(t,e,r,n,a)=>{e=B(e);const o=n===0;let s=c=>c;if(o){var u=32-8*r;s=c=>c<<u>>>u,a=s(a)}V(t,{name:e,fromWireType:s,toWireType:(c,d)=>d,readValueFromPointer:Xn(e,r,n!==0),destructorFunction:null})},Yn=(t,e,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[e];function o(s){var u=E[s>>2],c=E[s+4>>2];return new a(K.buffer,c,u)}r=B(r),V(t,{name:r,fromWireType:o,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Zn=Object.assign({optional:!0},Ae),Qn=(t,e)=>{V(t,Zn)},Jn=(t,e,r,n)=>{if(!(n>0))return 0;for(var a=r,o=r+n-1,s=0;s<t.length;++s){var u=t.codePointAt(s);if(u<=127){if(r>=o)break;e[r++]=u}else if(u<=2047){if(r+1>=o)break;e[r++]=192|u>>6,e[r++]=128|u&63}else if(u<=65535){if(r+2>=o)break;e[r++]=224|u>>12,e[r++]=128|u>>6&63,e[r++]=128|u&63}else{if(r+3>=o)break;e[r++]=240|u>>18,e[r++]=128|u>>12&63,e[r++]=128|u>>6&63,e[r++]=128|u&63,s++}}return e[r]=0,r-a},ot=(t,e,r)=>Jn(t,N,e,r),Fe=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n<=127?e++:n<=2047?e+=2:n>=55296&&n<=57343?(e+=4,++r):e+=3}return e},Re=globalThis.TextDecoder&&new TextDecoder,je=(t,e,r,n)=>{var a=e+r;if(n)return a;for(;t[e]&&!(e>=a);)++e;return e},Be=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;var a=je(t,e,r,n);if(a-e>16&&t.buffer&&Re)return Re.decode(t.subarray(e,a));for(var o="";e<a;){var s=t[e++];if(!(s&128)){o+=String.fromCharCode(s);continue}var u=t[e++]&63;if((s&224)==192){o+=String.fromCharCode((s&31)<<6|u);continue}var c=t[e++]&63;if((s&240)==224?s=(s&15)<<12|u<<6|c:s=(s&7)<<18|u<<12|c<<6|t[e++]&63,s<65536)o+=String.fromCharCode(s);else{var d=s-65536;o+=String.fromCharCode(55296|d>>10,56320|d&1023)}}return o},Kn=(t,e,r)=>t?Be(N,t,e,r):"",ta=(t,e)=>{e=B(e),V(t,{name:e,fromWireType(r){var n=E[r>>2],a=r+4,o;return o=Kn(a,n,!0),q(r),o},toWireType(r,n){n instanceof ArrayBuffer&&(n=new Uint8Array(n));var a,o=typeof n=="string";o||ArrayBuffer.isView(n)&&n.BYTES_PER_ELEMENT==1||b("Cannot pass non-string to std::string"),o?a=Fe(n):a=n.length;var s=Kt(4+a+1),u=s+4;return E[s>>2]=a,o?ot(n,u,a+1):N.set(n,u),r!==null&&r.push(q,s),s},readValueFromPointer:lt,destructorFunction(r){q(r)}})},Le=globalThis.TextDecoder?new TextDecoder("utf-16le"):void 0,ea=(t,e,r)=>{var n=t>>1,a=je(ut,n,e/2,r);if(a-n>16&&Le)return Le.decode(ut.subarray(n,a));for(var o="",s=n;s<a;++s){var u=ut[s];o+=String.fromCharCode(u)}return o},ra=(t,e,r)=>{if(r!=null||(r=2147483647),r<2)return 0;r-=2;for(var n=e,a=r<t.length*2?r/2:t.length,o=0;o<a;++o){var s=t.charCodeAt(o);wt[e>>1]=s,e+=2}return wt[e>>1]=0,e-n},na=t=>t.length*2,aa=(t,e,r)=>{for(var n="",a=t>>2,o=0;!(o>=e/4);o++){var s=E[a+o];if(!s&&!r)break;n+=String.fromCodePoint(s)}return n},oa=(t,e,r)=>{if(r!=null||(r=2147483647),r<4)return 0;for(var n=e,a=n+r-4,o=0;o<t.length;++o){var s=t.codePointAt(o);if(s>65535&&o++,ct[e>>2]=s,e+=4,e+4>a)break}return ct[e>>2]=0,e-n},ia=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.codePointAt(r);n>65535&&r++,e+=4}return e},sa=(t,e,r)=>{r=B(r);var n,a,o;e===2?(n=ea,a=ra,o=na):(n=aa,a=oa,o=ia),V(t,{name:r,fromWireType:s=>{var u=E[s>>2],c=n(s+4,u*e,!0);return q(s),c},toWireType:(s,u)=>{typeof u!="string"&&b(`Cannot pass non-string to C++ string type ${r}`);var c=o(u),d=Kt(4+c+e);return E[d>>2]=c/e,a(u,d+4,c+e),s!==null&&s.push(q,d),d},readValueFromPointer:lt,destructorFunction(s){q(s)}})},ua=(t,e,r,n,a,o)=>{Pt[t]={name:B(e),rawConstructor:U(r,n),rawDestructor:U(a,o),fields:[]}},ca=(t,e,r,n,a,o,s,u,c,d)=>{Pt[t].fields.push({fieldName:B(e),getterReturnType:r,getter:U(n,a),getterContext:o,setterArgumentType:s,setter:U(u,c),setterContext:d})},la=(t,e)=>{e=B(e),V(t,{isVoid:!0,name:e,fromWireType:()=>{},toWireType:(r,n)=>{}})},Qt=[],fa=t=>{var e=Qt.length;return Qt.push(t),e},da=(t,e)=>{var r=tt[t];return r===void 0&&b(`${e} has unknown type ${xe(t)}`),r},ha=(t,e)=>{for(var r=new Array(t),n=0;n<t;++n)r[n]=da(E[e+n*4>>2],`parameter ${n}`);return r},pa=(t,e,r)=>{var n=[],a=t(n,r);return n.length&&(E[e>>2]=W.toHandle(n)),a},va={},Ue=t=>{var e=va[t];return e===void 0?B(t):e},ya=(t,e,r)=>{var n=8,[a,...o]=ha(t,e),s=a.toWireType.bind(a),u=o.map(v=>v.readValueFromPointer.bind(v));t--;var c=new Array(t),d=(v,y,C,x)=>{for(var I=0,P=0;P<t;++P)c[P]=u[P](x+I),I+=n;var _;switch(r){case 0:_=W.toValue(v).apply(null,c);break;case 2:_=Reflect.construct(W.toValue(v),c);break;case 3:_=c[0];break;case 1:_=W.toValue(v)[Ue(y)](...c);break}return pa(s,C,_)},p=`methodCaller<(${o.map(v=>v.name)}) => ${a.name}>`;return fa(zt(p,d))},ma=t=>t?(t=Ue(t),W.toHandle(globalThis[t])):W.toHandle(globalThis),ga=t=>{t>9&&(rt[t+1]+=1)},wa=(t,e,r,n,a)=>Qt[t](e,r,n,a),$a=t=>{var e=W.toValue(t);Ht(e),Zt(t)},ba=(t,e,r,n)=>{var a=new Date().getFullYear(),o=new Date(a,0,1),s=new Date(a,6,1),u=o.getTimezoneOffset(),c=s.getTimezoneOffset(),d=Math.max(u,c);E[t>>2]=d*60,ct[e>>2]=+(u!=c);var p=C=>{var x=C>=0?"-":"+",I=Math.abs(C),P=String(Math.floor(I/60)).padStart(2,"0"),_=String(I%60).padStart(2,"0");return`UTC${x}${P}${_}`},v=p(u),y=p(c);c<u?(ot(v,r,17),ot(y,n,17)):(ot(v,n,17),ot(y,r,17))},Ca=()=>2147483648,Ta=(t,e)=>Math.ceil(t/e)*e,Pa=t=>{var e=Dt.buffer.byteLength,r=(t-e+65535)/65536|0;try{return Dt.grow(r),ge(),1}catch{}},Ea=t=>{var e=N.length;t>>>=0;var r=Ca();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 o=Math.min(r,Ta(Math.max(t,a),65536)),s=Pa(o);if(s)return!0}return!1},Jt={},Oa=()=>S||"./this.program",ht=()=>{if(!ht.strings){var t=(typeof navigator=="object"&&navigator.language||"C").replace("-","_")+".UTF-8",e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:t,_:Oa()};for(var r in Jt)Jt[r]===void 0?delete e[r]:e[r]=Jt[r];var n=[];for(var r in e)n.push(`${r}=${e[r]}`);ht.strings=n}return ht.strings},_a=(t,e)=>{var r=0,n=0;for(var a of ht()){var o=e+r;E[t+n>>2]=o,r+=ot(a,o,1/0)+1,n+=4}return 0},Sa=(t,e)=>{var r=ht();E[t>>2]=r.length;var n=0;for(var a of r)n+=Fe(a)+1;return E[e>>2]=n,0},Ia=t=>52;function xa(t,e,r,n,a){return 70}var Da=[null,[],[]],Ma=(t,e)=>{var r=Da[t];e===0||e===10?((t===1?st:k)(Be(r)),r.length=0):r.push(e)},Aa=(t,e,r,n)=>{for(var a=0,o=0;o<r;o++){var s=E[e>>2],u=E[e+4>>2];e+=8;for(var c=0;c<u;c++)Ma(t,N[s+c]);a+=u}return E[n>>2]=a,0},Fa=t=>t;if(Cn(),Fn(),l.noExitRuntime&&l.noExitRuntime,l.print&&(st=l.print),l.printErr&&(k=l.printErr),l.wasmBinary&&(J=l.wasmBinary),l.arguments&&l.arguments,l.thisProgram&&(S=l.thisProgram),l.preInit)for(typeof l.preInit=="function"&&(l.preInit=[l.preInit]);l.preInit.length>0;)l.preInit.shift()();var Ve,q,Kt,We,m,He,ke,Ne,ze,Ge,Xe,qe,Ye,Dt,Ze;function Ra(t){Ve=t.ya,q=l._free=t.za,Kt=l._malloc=t.Ba,We=t.Ca,m=t.Da,He=t.Ea,ke=t.Fa,Ne=t.Ga,ze=t.Ha,Ge=t.Ia,Xe=t.Ja,X.viijii=t.Ka,qe=X.iiijj=t.La,X.jiji=t.Ma,Ye=X.jiiii=t.Na,X.iiiiij=t.Oa,X.iiiiijj=t.Pa,X.iiiiiijj=t.Qa,Dt=t.wa,Ze=t.Aa}var ja={s:an,w:on,a:sn,j:un,m:cn,Q:ln,p:fn,U:dn,d:hn,ca:pn,ta:yn,ba:mn,oa:wn,ra:Un,qa:Wn,H:Hn,ma:kn,X:zn,Y:Gn,x:qn,t:Yn,sa:Qn,na:ta,R:sa,I:ua,ua:ca,pa:la,N:ya,va:Zt,D:ma,S:ga,M:wa,ia:$a,da:ba,ga:Ea,ea:_a,fa:Sa,ha:Ia,$:xa,V:Aa,K:oo,C:uo,Z:ka,T:vo,r:eo,b:Wa,E:ao,ka:lo,c:Na,ja:fo,h:Ha,i:Xa,q:Qa,P:no,v:Ka,F:to,L:ro,z:co,J:yo,aa:mo,_:go,f:za,l:Ba,e:Va,g:Ua,O:po,k:La,la:io,o:Ja,B:qa,u:so,W:Za,A:ho,n:Ga,G:Ya,y:Fa};function Ba(t,e){var r=w();try{$(t)(e)}catch(n){if(g(r),n!==n+0)throw n;m(1,0)}}function La(t,e,r,n,a){var o=w();try{$(t)(e,r,n,a)}catch(s){if(g(o),s!==s+0)throw s;m(1,0)}}function Ua(t,e,r,n){var a=w();try{$(t)(e,r,n)}catch(o){if(g(a),o!==o+0)throw o;m(1,0)}}function Va(t,e,r){var n=w();try{$(t)(e,r)}catch(a){if(g(n),a!==a+0)throw a;m(1,0)}}function Wa(t,e){var r=w();try{return $(t)(e)}catch(n){if(g(r),n!==n+0)throw n;m(1,0)}}function Ha(t,e,r,n){var a=w();try{return $(t)(e,r,n)}catch(o){if(g(a),o!==o+0)throw o;m(1,0)}}function ka(t,e,r,n,a,o){var s=w();try{return $(t)(e,r,n,a,o)}catch(u){if(g(s),u!==u+0)throw u;m(1,0)}}function Na(t,e,r){var n=w();try{return $(t)(e,r)}catch(a){if(g(n),a!==a+0)throw a;m(1,0)}}function za(t){var e=w();try{$(t)()}catch(r){if(g(e),r!==r+0)throw r;m(1,0)}}function Ga(t,e,r,n,a,o,s,u,c,d,p){var v=w();try{$(t)(e,r,n,a,o,s,u,c,d,p)}catch(y){if(g(v),y!==y+0)throw y;m(1,0)}}function Xa(t,e,r,n,a){var o=w();try{return $(t)(e,r,n,a)}catch(s){if(g(o),s!==s+0)throw s;m(1,0)}}function qa(t,e,r,n,a,o,s){var u=w();try{$(t)(e,r,n,a,o,s)}catch(c){if(g(u),c!==c+0)throw c;m(1,0)}}function Ya(t,e,r,n,a,o,s,u,c,d,p,v,y,C,x,I){var P=w();try{$(t)(e,r,n,a,o,s,u,c,d,p,v,y,C,x,I)}catch(_){if(g(P),_!==_+0)throw _;m(1,0)}}function Za(t,e,r,n,a,o,s,u,c){var d=w();try{$(t)(e,r,n,a,o,s,u,c)}catch(p){if(g(d),p!==p+0)throw p;m(1,0)}}function Qa(t,e,r,n,a,o){var s=w();try{return $(t)(e,r,n,a,o)}catch(u){if(g(s),u!==u+0)throw u;m(1,0)}}function Ja(t,e,r,n,a,o){var s=w();try{$(t)(e,r,n,a,o)}catch(u){if(g(s),u!==u+0)throw u;m(1,0)}}function Ka(t,e,r,n,a,o,s){var u=w();try{return $(t)(e,r,n,a,o,s)}catch(c){if(g(u),c!==c+0)throw c;m(1,0)}}function to(t,e,r,n,a,o,s,u){var c=w();try{return $(t)(e,r,n,a,o,s,u)}catch(d){if(g(c),d!==d+0)throw d;m(1,0)}}function eo(t){var e=w();try{return $(t)()}catch(r){if(g(e),r!==r+0)throw r;m(1,0)}}function ro(t,e,r,n,a,o,s,u,c){var d=w();try{return $(t)(e,r,n,a,o,s,u,c)}catch(p){if(g(d),p!==p+0)throw p;m(1,0)}}function no(t,e,r,n,a,o,s){var u=w();try{return $(t)(e,r,n,a,o,s)}catch(c){if(g(u),c!==c+0)throw c;m(1,0)}}function ao(t,e,r,n){var a=w();try{return $(t)(e,r,n)}catch(o){if(g(a),o!==o+0)throw o;m(1,0)}}function oo(t,e,r,n){var a=w();try{return $(t)(e,r,n)}catch(o){if(g(a),o!==o+0)throw o;m(1,0)}}function io(t,e,r,n,a,o,s,u){var c=w();try{$(t)(e,r,n,a,o,s,u)}catch(d){if(g(c),d!==d+0)throw d;m(1,0)}}function so(t,e,r,n,a,o,s,u){var c=w();try{$(t)(e,r,n,a,o,s,u)}catch(d){if(g(c),d!==d+0)throw d;m(1,0)}}function uo(t,e,r,n,a,o){var s=w();try{return $(t)(e,r,n,a,o)}catch(u){if(g(s),u!==u+0)throw u;m(1,0)}}function co(t,e,r,n,a,o,s,u,c,d){var p=w();try{return $(t)(e,r,n,a,o,s,u,c,d)}catch(v){if(g(p),v!==v+0)throw v;m(1,0)}}function lo(t,e,r){var n=w();try{return $(t)(e,r)}catch(a){if(g(n),a!==a+0)throw a;m(1,0)}}function fo(t,e,r,n,a){var o=w();try{return $(t)(e,r,n,a)}catch(s){if(g(o),s!==s+0)throw s;m(1,0)}}function ho(t,e,r,n,a,o,s,u,c,d){var p=w();try{$(t)(e,r,n,a,o,s,u,c,d)}catch(v){if(g(p),v!==v+0)throw v;m(1,0)}}function po(t,e,r,n,a,o,s){var u=w();try{$(t)(e,r,n,a,o,s)}catch(c){if(g(u),c!==c+0)throw c;m(1,0)}}function vo(t,e,r,n){var a=w();try{return $(t)(e,r,n)}catch(o){if(g(a),o!==o+0)throw o;m(1,0)}}function yo(t,e,r,n,a,o,s,u,c,d,p,v){var y=w();try{return $(t)(e,r,n,a,o,s,u,c,d,p,v)}catch(C){if(g(y),C!==C+0)throw C;m(1,0)}}function mo(t,e,r,n,a,o,s){var u=w();try{return qe(t,e,r,n,a,o,s)}catch(c){if(g(u),c!==c+0)throw c;m(1,0)}}function go(t,e,r,n,a){var o=w();try{return Ye(t,e,r,n,a)}catch(s){if(g(o),s!==s+0)throw s;m(1,0)}}function wo(){Gr();function t(){var e,r;l.calledRun=!0,!gt&&(Xr(),(e=he)===null||e===void 0||e(l),(r=l.onRuntimeInitialized)===null||r===void 0||r.call(l),qr())}l.setStatus?(l.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>l.setStatus(""),1),t()},1)):t()}var pt;return pt=await en(),wo(),me?f=l:f=new Promise((t,e)=>{he=t,pe=e}),f}function Bt(i){return re(jt,i)}function Er(){return Tr(jt)}function Or(i){Bt({overrides:i,equalityFn:Object.is,fireImmediately:!1})}async function _r(i,f){return Pr(jt,i,f)}const Sr="85d46f55d7c86a4d09bb04273367408b19c324f582d040d018aecb25a9a82942",ne=[["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"]],Ir=[...ne,["unknown"]].map(i=>i[0]),Lt=new Map(ne);function xr(i){for(const[f,h]of Lt)if(i===h)return f;return"unknown"}function Dr(i){if(ae(i))return{width:i.naturalWidth,height:i.naturalHeight};if(oe(i))return{width:i.width.baseVal.value,height:i.height.baseVal.value};if(ie(i))return{width:i.videoWidth,height:i.videoHeight};if(ue(i))return{width:i.width,height:i.height};if(le(i))return{width:i.displayWidth,height:i.displayHeight};if(se(i))return{width:i.width,height:i.height};if(ce(i))return{width:i.width,height:i.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 ae(i){var f,h;try{return i instanceof((h=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:h.HTMLImageElement)}catch{return!1}}function oe(i){var f,h;try{return i instanceof((h=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:h.SVGImageElement)}catch{return!1}}function ie(i){var f,h;try{return i instanceof((h=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:h.HTMLVideoElement)}catch{return!1}}function se(i){var f,h;try{return i instanceof((h=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:h.HTMLCanvasElement)}catch{return!1}}function ue(i){try{return i instanceof ImageBitmap||Object.prototype.toString.call(i)==="[object ImageBitmap]"}catch{return!1}}function ce(i){try{return i instanceof OffscreenCanvas||Object.prototype.toString.call(i)==="[object OffscreenCanvas]"}catch{return!1}}function le(i){try{return i instanceof VideoFrame||Object.prototype.toString.call(i)==="[object VideoFrame]"}catch{return!1}}function Mr(i){try{return i instanceof Blob||Object.prototype.toString.call(i)==="[object Blob]"}catch{return!1}}function Ar(i){try{return i instanceof ImageData||Object.prototype.toString.call(i)==="[object ImageData]"}catch{return!1}}function Fr(i,f){try{const h=new OffscreenCanvas(i,f);if(h.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return h;throw void 0}catch{const h=document.createElement("canvas");return h.width=i,h.height=f,h}}async function fe(i){if(ae(i)&&!await Lr(i))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(oe(i)&&!await Ur(i))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(le(i)&&Vr(i))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(ie(i)&&(i.readyState===0||i.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(ue(i)&&Hr(i))throw new DOMException("The image source is detached.","InvalidStateError");const{width:f,height:h}=Dr(i);if(f===0||h===0)return null;const l=Fr(f,h).getContext("2d");l.drawImage(i,0,0);try{return l.getImageData(0,0,f,h)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Rr(i){let f;try{f=await createImageBitmap(i)}catch{try{if(globalThis.Image){f=new Image;let l="";try{l=URL.createObjectURL(i),f.src=l,await f.decode()}finally{URL.revokeObjectURL(l)}}else return i}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}}return await fe(f)}function jr(i){const{width:f,height:h}=i;if(f===0||h===0)return null;const T=i.getContext("2d");try{return T.getImageData(0,0,f,h)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Br(i){if(Mr(i))return await Rr(i);if(Ar(i)){if(Wr(i))throw new DOMException("The image data has been detached.","InvalidStateError");return i}return se(i)||ce(i)?jr(i):await fe(i)}async function Lr(i){try{return await i.decode(),!0}catch{return!1}}async function Ur(i){var f;try{return await((f=i.decode)==null?void 0:f.call(i)),!0}catch{return!1}}function Vr(i){return i.format===null}function Wr(i){return i.data.buffer.byteLength===0}function Hr(i){return i.width===0&&i.height===0}function de(i,f){return kr(i)?new DOMException(`${f}: ${i.message}`,i.name):Nr(i)?new i.constructor(`${f}: ${i.message}`):new Error(`${f}: ${i}`)}function kr(i){return i instanceof DOMException||Object.prototype.toString.call(i)==="[object DOMException]"}function Nr(i){return i instanceof Error||Object.prototype.toString.call(i)==="[object Error]"}class zr{constructor(f={}){ar(this,it);var h;try{const T=(h=f==null?void 0:f.formats)==null?void 0:h.filter(l=>l!=="unknown");if((T==null?void 0:T.length)===0)throw new TypeError("Hint option provided, but is empty.");for(const l of T!=null?T:[])if(!Lt.has(l))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${l}' is not a valid enum value of type BarcodeFormat.`);or(this,it,T!=null?T:[]),Bt({fireImmediately:!0}).catch(()=>{})}catch(T){throw de(T,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return Ir.filter(f=>f!=="unknown")}async detect(f){try{const h=await Br(f);if(h===null)return[];let T;const l={tryCode39ExtendedMode:!1,textMode:"Plain",formats:nr(this,it).map(D=>Lt.get(D))};try{T=await _r(h,l)}catch(D){throw console.error(D),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return T.map(D=>{const{topLeft:{x:A,y:R},topRight:{x:S,y:j},bottomLeft:{x:H,y:Z},bottomRight:{x:nt,y:Q}}=D.position,st=Math.min(A,S,H,nt),k=Math.min(R,j,Z,Q),J=Math.max(A,S,H,nt),gt=Math.max(R,j,Z,Q);return{boundingBox:new DOMRectReadOnly(st,k,J-st,gt-k),rawValue:D.text,format:xr(D.format),cornerPoints:[{x:A,y:R},{x:S,y:j},{x:nt,y:Q},{x:H,y:Z}]}})}catch(h){throw de(h,"Failed to execute 'detect' on 'BarcodeDetector'")}}}return it=new WeakMap,O.BarcodeDetector=zr,O.ZXING_CPP_COMMIT=$r,O.ZXING_WASM_SHA256=Sr,O.ZXING_WASM_VERSION=wr,O.prepareZXingModule=Bt,O.purgeZXingModule=Er,O.setZXingModuleOverrides=Or,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"}),O})({});
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "barcode-detector",
3
3
  "description": "A Barcode Detection API polyfill that uses ZXing webassembly under the hood",
4
4
  "private": false,
5
- "version": "3.0.5",
5
+ "version": "3.0.7",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "./dist"
@@ -87,29 +87,30 @@
87
87
  "access": "public"
88
88
  },
89
89
  "devDependencies": {
90
- "@biomejs/biome": "2.0.5",
91
- "@changesets/cli": "^2.29.5",
92
- "@commitlint/cli": "^19.8.1",
93
- "@commitlint/config-conventional": "^19.8.1",
94
- "@types/node": "^22.15.33",
95
- "@vitest/browser": "^3.2.4",
96
- "@vitest/coverage-istanbul": "^3.2.4",
97
- "@vitest/ui": "^3.2.4",
98
- "concurrently": "^9.2.0",
90
+ "@biomejs/biome": "2.3.4",
91
+ "@changesets/cli": "^2.29.7",
92
+ "@commitlint/cli": "^20.1.0",
93
+ "@commitlint/config-conventional": "^20.0.0",
94
+ "@types/node": "^24.10.0",
95
+ "@vitest/browser": "^4.0.8",
96
+ "@vitest/browser-playwright": "^4.0.8",
97
+ "@vitest/coverage-istanbul": "^4.0.8",
98
+ "@vitest/ui": "^4.0.8",
99
+ "concurrently": "^9.2.1",
99
100
  "http-server": "^14.1.1",
100
- "lint-staged": "^16.1.2",
101
- "playwright": "^1.53.1",
102
- "prettier": "^3.6.1",
103
- "rimraf": "^6.0.1",
104
- "simple-git-hooks": "^2.13.0",
105
- "start-server-and-test": "^2.0.12",
106
- "tsx": "^4.20.3",
107
- "typescript": "^5.8.3",
108
- "vite": "^7.0.0",
109
- "vitest": "^3.2.4"
101
+ "lint-staged": "^16.2.6",
102
+ "playwright": "^1.56.1",
103
+ "prettier": "^3.6.2",
104
+ "rimraf": "^6.1.0",
105
+ "simple-git-hooks": "^2.13.1",
106
+ "start-server-and-test": "^2.1.2",
107
+ "tsx": "^4.20.6",
108
+ "typescript": "^5.9.3",
109
+ "vite": "^7.2.2",
110
+ "vitest": "^4.0.8"
110
111
  },
111
112
  "dependencies": {
112
- "zxing-wasm": "2.2.0"
113
+ "zxing-wasm": "2.2.3"
113
114
  },
114
115
  "scripts": {
115
116
  "update-hooks": "simple-git-hooks",