barcode-detector 3.0.7 → 3.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ponyfill.js +1 -1
- package/dist/es/ponyfill.js +435 -427
- package/dist/iife/index.js +1 -1
- package/dist/iife/polyfill.js +1 -1
- package/dist/iife/ponyfill.js +1 -1
- package/package.json +9 -9
package/dist/iife/ponyfill.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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})({});
|
|
1
|
+
var BarcodeDetectionAPI=(function(E){"use strict";var er=E=>{throw TypeError(E)};var rr=(E,M,F)=>M.has(E)||er("Cannot "+F);var nr=(E,M,F)=>(rr(E,M,"read from private field"),F?F.call(E):M.get(E)),ar=(E,M,F)=>M.has(E)?er("Cannot add the same private member more than once"):M instanceof WeakSet?M.add(E):M.set(E,F),or=(E,M,F,yt)=>(rr(E,M,"write to private field"),yt?yt.call(E,F):M.set(E,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),yt=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 yt.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 yr(i){return pr.indexOf(i)}const vr=["Plain","ECI","HRI","Hex","Escaped"];function mr(i){return vr.indexOf(i)}const vt={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:yr(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.4",br="fba4e9503fee4518ca2e89510baeea9bcc36dc8d",$r={locateFile:(i,f)=>{const h=i.match(/_(.+?)\.wasm$/);return h?`https://fastly.jsdelivr.net/npm/zxing-wasm@2.2.4/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:C=!1}={}){var l;const[D,A]=(l=mt.get(i))!=null?l:[$r],R=f!=null?f:D;let S;if(C){if(A&&(S=h(D,R)))return A;const B=i({...R});return mt.set(i,[R,B]),B}(S!=null?S:h(D,R))||mt.set(i,[R])}function Tr(i){mt.delete(i)}async function Pr(i,f,h=vt){const C={...vt,...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:B},width:H,height:Y}=f;A=l._malloc(B),l.HEAPU8.set(S,A),D=l.readBarcodesFromPixmap(A,H,Y,ee(C))}else{let S,B;if("buffer"in f)[S,B]=[f.byteLength,f];else if("byteLength"in f)[S,B]=[f.byteLength,new Uint8Array(f)];else if("size"in f)[S,B]=[f.size,new Uint8Array(await f.arrayBuffer())];else throw new TypeError("Invalid input type");A=l._malloc(S),l.HEAPU8.set(B,A),D=l.readBarcodesFromImage(A,S,ee(C))}l._free(A);const R=[];for(let S=0;S<D.size();++S)R.push(gr(D.get(S)));return R}({...vt,formats:[...vt.formats]});async function Bt(i={}){var f,h,C,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&&((C=globalThis.process)===null||C===void 0?void 0:C.type)!="renderer";var S="./this.program",B,H="";function Y(t){return l.locateFile?l.locateFile(t,H):H+t}var nt,Z;if(D||R||A){try{H=new URL(".",B).href}catch{}R&&(Z=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),Q,gt=!1,he,pe,J,N,wt,ut,ct,T,ye,ve,me=!1;function ge(){var t=Dt.buffer;J=new Int8Array(t),wt=new Int16Array(t),l.HEAPU8=N=new Uint8Array(t),ut=new Uint16Array(t),ct=new Int32Array(t),T=new Uint32Array(t),ye=new Float32Array(t),ve=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($e)}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(be)}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 bt;function Yr(){return Y("zxing_reader.wasm")}function Zr(t){if(t==bt&&Q)return new Uint8Array(Q);if(Z)return Z(t);throw"both async and sync fetching of the wasm failed"}async function Qr(t){if(!Q)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:Ba};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))})});bt!=null||(bt=Yr());var n=await Kr(Q,bt,r),a=e(n);return a}var we=t=>{for(;t.length>0;)t.shift()(l)},be=[],rn=t=>be.push(t),$e=[],nn=t=>$e.push(t),m=t=>ke(t),g=()=>Ne(),$t=[],Ct=0,an=t=>{var e=new Vt(t);return e.get_caught()||(e.set_caught(!0),Ct--),e.set_rethrown(!1),$t.push(e),Ge(t),We(t)},z=0,on=()=>{v(0,0);var t=$t.pop();ze(t.excPtr),z=0};class Vt{constructor(e){this.excPtr=e,this.ptr=e-24}set_type(e){T[this.ptr+4>>2]=e}get_type(){return T[this.ptr+4>>2]}set_destructor(e){T[this.ptr+8>>2]=e}get_destructor(){return T[this.ptr+8>>2]}set_caught(e){e=e?1:0,J[this.ptr+12]=e}get_caught(){return J[this.ptr+12]!=0}set_rethrown(e){e=e?1:0,J[this.ptr+13]=e}get_rethrown(){return J[this.ptr+13]!=0}init(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)}set_adjusted_ptr(e){T[this.ptr+16>>2]=e}get_adjusted_ptr(){return T[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=$t.pop();t||Ut("no exception to throw");var e=t.excPtr;throw t.get_rethrown()||($t.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(T[t>>2])}var at={},K={},Et={},yn=class extends Error{constructor(t){super(t),this.name="InternalError"}},Ot=t=>{throw new yn(t)},tt=(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;{const u=e;for(let c=0;c<u.length;++c){const d=u[c];K.hasOwnProperty(d)?a[c]=K[d]:(o.push(d),at.hasOwnProperty(d)||(at[d]=[]),at[d].push(()=>{a[c]=K[d],++s,s===o.length&&n(a)}))}}o.length===0&&n(a)},vn=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));tt([t],o,s=>{var u={};{const c=a;for(let d=0;d<c.length;++d){const p=c[d],y=s[d],$=p.getter,O=p.getterContext,x=s[d+a.length],I=p.setter,_=p.setterContext;u[p.fieldName]={read:P=>y.fromWireType($(O,P)),write:(P,rt)=>{var L=[];I(_,P,x.toWireType(L,rt)),Ht(L)},optional:y.optional}}}return[{name:e.name,fromWireType:c=>{var d={};for(var p in u)d[p]=u[p].read(c);return n(c),d},toWireType:(c,d)=>{for(var p in u)if(!(p in d)&&!u[p].optional)throw new TypeError(`Missing field: "${p}"`);var y=r();for(p in u)u[p].write(y,d[p]);return c!==null&&c.push(n,y),y},readValueFromPointer:lt,destructorFunction:n}]})},mn=(t,e,r,n,a)=>{},j=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`),K.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;b(`Cannot register type '${n}' twice`)}if(K[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=j(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})},bn=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=>{},$n=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&&$n(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:bn(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=[],w=t=>{var e=Ie[t];return e||(Ie[t]=e=Ze.get(t)),e},Bn=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=w(e),a=n(...r);return a},jn=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 Bn(t,e,a,r)}},U=function(t,e){t=j(t);function r(){if(t.includes("j"))return jn(t,e);var a=w(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=j(e);return q(e),r},xt=(t,e)=>{var r=[],n={};function a(o){if(!n[o]&&!K[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,y,$)=>{p=j(p),o=U(a,o),u&&(u=U(s,u)),d&&(d=U(c,d)),$=U(y,$);var O=En(p);Oe(O,function(){xt(`Cannot construct ${p} due to unbound types`,[n])}),tt([t,e,r],n?[n]:[],x=>{x=x[0];var I,_;n?(I=x.registeredClass,_=I.instancePrototype):_=_t.prototype;var P=zt(p,function(){if(Object.getPrototypeOf(this)!==rt)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)}),rt=Object.create(_,{constructor:{value:P}});P.prototype=rt;var L=new On(p,P,rt,$,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 bo=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(O,P),[bo,Qe,Je]})},qt=(t,e)=>{for(var r=[],n=0;n<t;n++)r.push(T[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,y=new Array(p),$=[],O=[],x=function(){O.length=0;var I;$.length=u?2:1,$[0]=a,u&&(I=e[1].toWireType(O,this),$[1]=I);for(var _=0;_<p;++_)y[_]=e[_+2].toWireType(O,_<0||arguments.length<=_?void 0:arguments[_]),$.push(y[_]);var P=n(...$);function rt(L){if(c)Ht(O);else for(var G=u?1:2;G<e.length;G++){var Mt=G===1?I:y[G-2];e[G].destructorFunction!==null&&e[G].destructorFunction(Mt)}if(d)return e[0].fromWireType(L)}return rt(P)};return zt(t,x)}var Wn=(t,e,r,n,a,o)=>{var s=qt(e,r);a=U(n,a),tt([],[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)},tt([],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=j(e),e=De(e),o=U(a,o),tt([],[t],y=>{y=y[0];var $=`${y.name}.${e}`;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),u&&y.registeredClass.pureVirtualFunctions.push(e);function O(){xt(`Cannot call ${$} due to unbound types`,p)}var x=y.registeredClass.instancePrototype,I=x[e];return I===void 0||I.overloadTable===void 0&&I.className!==y.name&&I.argCount===r-2?(O.argCount=r-2,O.className=y.name,x[e]=O):(Ee(x,e,$),x[e].overloadTable[r-2]=O),tt([],p,_=>{var P=Yt($,_,y,o,s);return x[e].overloadTable===void 0?(P.argCount=r-2,x[e]=P):x[e].overloadTable[r-2]=P,[]}),[]})},Me=[],et=[0,1,,1,null,1,!0,1,!1,1],Zt=t=>{t>9&&--et[t+1]===0&&(et[t]=void 0,Me.push(t))},W={toValue:t=>(t||b(`Cannot use deleted val. handle = ${t}`),et[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()||et.length;return et[e]=t,et[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(ye[r>>2])};case 8:return function(r){return this.fromWireType(ve[r>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},zn=(t,e,r)=>{e=j(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=j(t),t=De(t),a=U(n,a),Oe(t,function(){xt(`Cannot call ${t} due to unbound types`,c)},e-1),tt([],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=>J[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=>T[n>>2];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},qn=(t,e,r,n,a)=>{e=j(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=T[s>>2],c=T[s+4>>2];return new a(J.buffer,c,u)}r=j(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,Be=(t,e,r,n)=>{var a=e+r;if(n)return a;for(;t[e]&&!(e>=a);)++e;return e},je=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;var a=Be(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?je(N,t,e,r):"",ta=(t,e)=>{e=j(e),V(t,{name:e,fromWireType(r){var n=T[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 T[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=Be(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=T[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=j(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=T[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 T[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:j(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:j(e),getterReturnType:r,getter:U(n,a),getterContext:o,setterArgumentType:s,setter:U(u,c),setterContext:d})},la=(t,e)=>{e=j(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=K[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(T[e+n*4>>2],`parameter ${n}`);return r},pa=(t,e,r)=>{var n=[],a=t(n,r);return n.length&&(T[e>>2]=W.toHandle(n)),a},ya={},Ue=t=>{var e=ya[t];return e===void 0?j(t):e},va=(t,e,r)=>{var n=8,[a,...o]=ha(t,e),s=a.toWireType.bind(a),u=o.map(y=>y.readValueFromPointer.bind(y));t--;var c=new Array(t),d=(y,$,O,x)=>{for(var I=0,_=0;_<t;++_)c[_]=u[_](x+I),I+=n;var P;switch(r){case 0:P=W.toValue(y).apply(null,c);break;case 2:P=Reflect.construct(W.toValue(y),c);break;case 3:P=c[0];break;case 1:P=W.toValue(y)[Ue($)](...c);break}return pa(s,O,P)},p=`methodCaller<(${o.map(y=>y.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&&(et[t+1]+=1)},wa=(t,e,r,n,a)=>Qt[t](e,r,n,a),ba=t=>{var e=W.toValue(t);Ht(e),Zt(t)},$a=(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);T[t>>2]=d*60,ct[e>>2]=+(u!=c);var p=O=>{var x=O>=0?"-":"+",I=Math.abs(O),_=String(Math.floor(I/60)).padStart(2,"0"),P=String(I%60).padStart(2,"0");return`UTC${x}${_}${P}`},y=p(u),$=p(c);c<u?(ot(y,r,17),ot($,n,17)):(ot(y,n,17),ot($,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;T[t+n>>2]=o,r+=ot(a,o,1/0)+1,n+=4}return 0},Sa=(t,e)=>{var r=ht();T[t>>2]=r.length;var n=0;for(var a of r)n+=Fe(a)+1;return T[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)(je(r)),r.length=0):r.push(e)},Aa=(t,e,r,n)=>{for(var a=0,o=0;o<r;o++){var s=T[e>>2],u=T[e+4>>2];e+=8;for(var c=0;c<u;c++)Ma(t,N[s+c]);a+=u}return T[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&&(Q=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,v,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,v=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 Ba={s:an,w:on,a:sn,j:un,m:cn,Q:ln,p:fn,U:dn,d:hn,ca:pn,ta:vn,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:va,va:Zt,D:ma,S:ga,M:wa,ia:ba,da:$a,ga:Ea,ea:_a,fa:Sa,ha:Ia,$:xa,V:Aa,K:oo,C:uo,Z:ka,T:yo,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:vo,aa:mo,_:go,f:za,l:ja,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 ja(t,e){var r=g();try{w(t)(e)}catch(n){if(m(r),n!==n+0)throw n;v(1,0)}}function La(t,e,r,n,a){var o=g();try{w(t)(e,r,n,a)}catch(s){if(m(o),s!==s+0)throw s;v(1,0)}}function Ua(t,e,r,n){var a=g();try{w(t)(e,r,n)}catch(o){if(m(a),o!==o+0)throw o;v(1,0)}}function Va(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 Wa(t,e){var r=g();try{return w(t)(e)}catch(n){if(m(r),n!==n+0)throw n;v(1,0)}}function Ha(t,e,r,n){var a=g();try{return w(t)(e,r,n)}catch(o){if(m(a),o!==o+0)throw o;v(1,0)}}function ka(t,e,r,n,a,o){var s=g();try{return w(t)(e,r,n,a,o)}catch(u){if(m(s),u!==u+0)throw u;v(1,0)}}function Na(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 za(t){var e=g();try{w(t)()}catch(r){if(m(e),r!==r+0)throw r;v(1,0)}}function Ga(t,e,r,n,a,o,s,u,c,d,p){var y=g();try{w(t)(e,r,n,a,o,s,u,c,d,p)}catch($){if(m(y),$!==$+0)throw $;v(1,0)}}function Xa(t,e,r,n,a){var o=g();try{return w(t)(e,r,n,a)}catch(s){if(m(o),s!==s+0)throw s;v(1,0)}}function qa(t,e,r,n,a,o,s){var u=g();try{w(t)(e,r,n,a,o,s)}catch(c){if(m(u),c!==c+0)throw c;v(1,0)}}function Ya(t,e,r,n,a,o,s,u,c,d,p,y,$,O,x,I){var _=g();try{w(t)(e,r,n,a,o,s,u,c,d,p,y,$,O,x,I)}catch(P){if(m(_),P!==P+0)throw P;v(1,0)}}function Za(t,e,r,n,a,o,s,u,c){var d=g();try{w(t)(e,r,n,a,o,s,u,c)}catch(p){if(m(d),p!==p+0)throw p;v(1,0)}}function Qa(t,e,r,n,a,o){var s=g();try{return w(t)(e,r,n,a,o)}catch(u){if(m(s),u!==u+0)throw u;v(1,0)}}function Ja(t,e,r,n,a,o){var s=g();try{w(t)(e,r,n,a,o)}catch(u){if(m(s),u!==u+0)throw u;v(1,0)}}function Ka(t,e,r,n,a,o,s){var u=g();try{return w(t)(e,r,n,a,o,s)}catch(c){if(m(u),c!==c+0)throw c;v(1,0)}}function to(t,e,r,n,a,o,s,u){var c=g();try{return w(t)(e,r,n,a,o,s,u)}catch(d){if(m(c),d!==d+0)throw d;v(1,0)}}function eo(t){var e=g();try{return w(t)()}catch(r){if(m(e),r!==r+0)throw r;v(1,0)}}function ro(t,e,r,n,a,o,s,u,c){var d=g();try{return w(t)(e,r,n,a,o,s,u,c)}catch(p){if(m(d),p!==p+0)throw p;v(1,0)}}function no(t,e,r,n,a,o,s){var u=g();try{return w(t)(e,r,n,a,o,s)}catch(c){if(m(u),c!==c+0)throw c;v(1,0)}}function ao(t,e,r,n){var a=g();try{return w(t)(e,r,n)}catch(o){if(m(a),o!==o+0)throw o;v(1,0)}}function oo(t,e,r,n){var a=g();try{return w(t)(e,r,n)}catch(o){if(m(a),o!==o+0)throw o;v(1,0)}}function io(t,e,r,n,a,o,s,u){var c=g();try{w(t)(e,r,n,a,o,s,u)}catch(d){if(m(c),d!==d+0)throw d;v(1,0)}}function so(t,e,r,n,a,o,s,u){var c=g();try{w(t)(e,r,n,a,o,s,u)}catch(d){if(m(c),d!==d+0)throw d;v(1,0)}}function uo(t,e,r,n,a,o){var s=g();try{return w(t)(e,r,n,a,o)}catch(u){if(m(s),u!==u+0)throw u;v(1,0)}}function co(t,e,r,n,a,o,s,u,c,d){var p=g();try{return w(t)(e,r,n,a,o,s,u,c,d)}catch(y){if(m(p),y!==y+0)throw y;v(1,0)}}function lo(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 fo(t,e,r,n,a){var o=g();try{return w(t)(e,r,n,a)}catch(s){if(m(o),s!==s+0)throw s;v(1,0)}}function ho(t,e,r,n,a,o,s,u,c,d){var p=g();try{w(t)(e,r,n,a,o,s,u,c,d)}catch(y){if(m(p),y!==y+0)throw y;v(1,0)}}function po(t,e,r,n,a,o,s){var u=g();try{w(t)(e,r,n,a,o,s)}catch(c){if(m(u),c!==c+0)throw c;v(1,0)}}function yo(t,e,r,n){var a=g();try{return w(t)(e,r,n)}catch(o){if(m(a),o!==o+0)throw o;v(1,0)}}function vo(t,e,r,n,a,o,s,u,c,d,p,y){var $=g();try{return w(t)(e,r,n,a,o,s,u,c,d,p,y)}catch(O){if(m($),O!==O+0)throw O;v(1,0)}}function mo(t,e,r,n,a,o,s){var u=g();try{return qe(t,e,r,n,a,o,s)}catch(c){if(m(u),c!==c+0)throw c;v(1,0)}}function go(t,e,r,n,a){var o=g();try{return Ye(t,e,r,n,a)}catch(s){if(m(o),s!==s+0)throw s;v(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 jt(i){return re(Bt,i)}function Er(){return Tr(Bt)}function Or(i){jt({overrides:i,equalityFn:Object.is,fireImmediately:!1})}async function _r(i,f){return Pr(Bt,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 Br(i){const{width:f,height:h}=i;if(f===0||h===0)return null;const C=i.getContext("2d");try{return C.getImageData(0,0,f,h)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function jr(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)?Br(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 C=(h=f==null?void 0:f.formats)==null?void 0:h.filter(l=>l!=="unknown");if((C==null?void 0:C.length)===0)throw new TypeError("Hint option provided, but is empty.");for(const l of C!=null?C:[])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,C!=null?C:[]),jt({fireImmediately:!0}).catch(()=>{})}catch(C){throw de(C,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return Ir.filter(f=>f!=="unknown")}async detect(f){try{const h=await jr(f);if(h===null)return[];let C;const l={tryCode39ExtendedMode:!1,textMode:"Plain",formats:nr(this,it).map(D=>Lt.get(D))};try{C=await _r(h,l)}catch(D){throw console.error(D),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return C.map(D=>{const{topLeft:{x:A,y:R},topRight:{x:S,y:B},bottomLeft:{x:H,y:Y},bottomRight:{x:nt,y:Z}}=D.position,st=Math.min(A,S,H,nt),k=Math.min(R,B,Y,Z),Q=Math.max(A,S,H,nt),gt=Math.max(R,B,Y,Z);return{boundingBox:new DOMRectReadOnly(st,k,Q-st,gt-k),rawValue:D.text,format:xr(D.format),cornerPoints:[{x:A,y:R},{x:S,y:B},{x:nt,y:Z},{x:H,y:Y}]}})}catch(h){throw de(h,"Failed to execute 'detect' on 'BarcodeDetector'")}}}return it=new WeakMap,E.BarcodeDetector=zr,E.ZXING_CPP_COMMIT=br,E.ZXING_WASM_SHA256=Sr,E.ZXING_WASM_VERSION=wr,E.prepareZXingModule=jt,E.purgeZXingModule=Er,E.setZXingModuleOverrides=Or,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"}),E})({});
|
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
|
+
"version": "3.0.8",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
8
|
"./dist"
|
|
@@ -87,15 +87,15 @@
|
|
|
87
87
|
"access": "public"
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
|
90
|
-
"@biomejs/biome": "2.3.
|
|
90
|
+
"@biomejs/biome": "2.3.6",
|
|
91
91
|
"@changesets/cli": "^2.29.7",
|
|
92
92
|
"@commitlint/cli": "^20.1.0",
|
|
93
93
|
"@commitlint/config-conventional": "^20.0.0",
|
|
94
|
-
"@types/node": "^24.10.
|
|
95
|
-
"@vitest/browser": "^4.0.
|
|
96
|
-
"@vitest/browser-playwright": "^4.0.
|
|
97
|
-
"@vitest/coverage-istanbul": "^4.0.
|
|
98
|
-
"@vitest/ui": "^4.0.
|
|
94
|
+
"@types/node": "^24.10.1",
|
|
95
|
+
"@vitest/browser": "^4.0.10",
|
|
96
|
+
"@vitest/browser-playwright": "^4.0.10",
|
|
97
|
+
"@vitest/coverage-istanbul": "^4.0.10",
|
|
98
|
+
"@vitest/ui": "^4.0.10",
|
|
99
99
|
"concurrently": "^9.2.1",
|
|
100
100
|
"http-server": "^14.1.1",
|
|
101
101
|
"lint-staged": "^16.2.6",
|
|
@@ -107,10 +107,10 @@
|
|
|
107
107
|
"tsx": "^4.20.6",
|
|
108
108
|
"typescript": "^5.9.3",
|
|
109
109
|
"vite": "^7.2.2",
|
|
110
|
-
"vitest": "^4.0.
|
|
110
|
+
"vitest": "^4.0.10"
|
|
111
111
|
},
|
|
112
112
|
"dependencies": {
|
|
113
|
-
"zxing-wasm": "2.2.
|
|
113
|
+
"zxing-wasm": "2.2.4"
|
|
114
114
|
},
|
|
115
115
|
"scripts": {
|
|
116
116
|
"update-hooks": "simple-git-hooks",
|