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