barcode-detector 2.1.1 → 2.1.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/BarcodeDetector.d.ts +2 -2
- package/dist/cjs/pure.js +3 -3
- package/dist/es/BarcodeDetector.d.ts +2 -2
- package/dist/es/pure.js +202 -199
- package/dist/iife/index.js +3 -3
- package/dist/iife/pure.js +3 -3
- package/dist/iife/side-effects.js +3 -3
- package/package.json +7 -7
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var sr=(W,H,z)=>{if(!H.has(W))throw TypeError("Cannot "+z)};var ie=(W,H,z)=>(sr(W,H,"read from private field"),z?z.call(W):H.get(W)),ur=(W,H,z)=>{if(H.has(W))throw TypeError("Cannot add the same private member more than once");H instanceof WeakSet?H.add(W):H.set(W,z)},cr=(W,H,z,ht)=>(sr(W,H,"write to private field"),ht?ht.call(W,z):H.set(W,z),z);var BarcodeDetectionAPI=function(W){var ut;"use strict";const H=["aztec","code_128","code_39","code_93","codabar","data_matrix","ean_13","ean_8","itf","pdf417","qr_code","upc_a","upc_e","unknown"];function z(i){if(ht(i))return{width:i.naturalWidth,height:i.naturalHeight};if(se(i))return{width:i.width.baseVal.value,height:i.height.baseVal.value};if(ue(i))return{width:i.videoWidth,height:i.videoHeight};if(le(i))return{width:i.width,height:i.height};if(fe(i))return{width:i.displayWidth,height:i.displayHeight};if(ce(i))return{width:i.width,height:i.height};if(de(i))return{width:i.width,height:i.height};throw new TypeError("The provided value is not of type '(Blob or HTMLCanvasElement or HTMLImageElement or HTMLVideoElement or ImageBitmap or ImageData or OffscreenCanvas or SVGImageElement or VideoFrame)'.")}function ht(i){try{return i instanceof HTMLImageElement}catch{return!1}}function se(i){try{return i instanceof SVGImageElement}catch{return!1}}function ue(i){try{return i instanceof HTMLVideoElement}catch{return!1}}function ce(i){try{return i instanceof HTMLCanvasElement}catch{return!1}}function le(i){try{return i instanceof ImageBitmap}catch{return!1}}function de(i){try{return i instanceof OffscreenCanvas}catch{return!1}}function fe(i){try{return i instanceof VideoFrame}catch{return!1}}function he(i){try{return i instanceof Blob}catch{return!1}}function lr(i){try{return i instanceof ImageData}catch{return!1}}function dr(i,h){try{const u=new OffscreenCanvas(i,h);if(u.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return u;throw void 0}catch{const u=document.createElement("canvas");return u.width=i,u.height=h,u}}async function pe(i){if(ht(i)&&!await mr(i))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(se(i)&&!await yr(i))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(fe(i)&&vr(i))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(ue(i)&&(i.readyState===0||i.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(le(i)&&wr(i))throw new DOMException("The image source is detached.","InvalidStateError");const{width:h,height:u}=z(i);if(h===0||u===0)return null;const v=dr(h,u).getContext("2d");v.drawImage(i,0,0);try{return v.getImageData(0,0,h,u)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function fr(i){let h;try{if(createImageBitmap)h=await createImageBitmap(i);else if(Image){h=new Image;let w="";try{w=URL.createObjectURL(i),h.src=w,await h.decode()}finally{URL.revokeObjectURL(w)}}else return i}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}return await pe(h)}function hr(i){const{width:h,height:u}=i;if(h===0||u===0)return null;const w=i.getContext("2d");try{return w.getImageData(0,0,h,u)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function pr(i){if(he(i))return await fr(i);if(lr(i)){if(gr(i))throw new DOMException("The image data has been detached.","InvalidStateError");return i}return ce(i)||de(i)?hr(i):await pe(i)}async function mr(i){try{return await i.decode(),!0}catch{return!1}}async function yr(i){var h;try{return await((h=i.decode)==null?void 0:h.call(i)),!0}catch{return!1}}function vr(i){return i.format===null}function gr(i){return i.data.buffer.byteLength===0}function wr(i){return i.width===0&&i.height===0}function me(i,h){return i instanceof DOMException?new DOMException(`${h}: ${i.message}`,i.name):i instanceof Error?new i.constructor(`${h}: ${i.message}`):new Error(`${h}: ${i}`)}const ye=["Aztec","Codabar","Code128","Code39","Code93","DataBar","DataBarExpanded","DataMatrix","EAN-13","EAN-8","ITF","Linear-Codes","Matrix-Codes","MaxiCode","MicroQRCode","None","PDF417","QRCode","UPC-A","UPC-E"];function $r(i){return i.join("|")}function br(i){const h=ve(i);let u=0,w=ye.length-1;for(;u<=w;){const v=Math.floor((u+w)/2),$=ye[v],U=ve($);if(U===h)return $;U<h?u=v+1:w=v-1}return"None"}function ve(i){return i.toLowerCase().replace(/_-\[\]/g,"")}function Cr(i,h){return i.Binarizer[h]}function _r(i,h){return i.CharacterSet[h]}const Tr=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function Pr(i){return Tr[i.value]}function Er(i,h){return i.EanAddOnSymbol[h]}function Ar(i,h){return i.TextMode[h]}const Tt={formats:[],tryHarder:!0,tryRotate:!0,tryInvert:!0,tryDownscale:!0,binarizer:"LocalAverage",isPure:!1,downscaleFactor:3,downscaleThreshold:500,minLineCount:2,maxNumberOfSymbols:255,tryCode39ExtendedMode:!1,validateCode39CheckSum:!1,validateITFCheckSum:!1,returnCodabarStartEnd:!1,returnErrors:!1,eanAddOnSymbol:"Read",textMode:"Plain",characterSet:"Unknown"};function ge(i,h){return{...h,formats:$r(h.formats),binarizer:Cr(i,h.binarizer),eanAddOnSymbol:Er(i,h.eanAddOnSymbol),textMode:Ar(i,h.textMode),characterSet:_r(i,h.characterSet)}}function we(i){return{...i,format:br(i.format),eccLevel:i.eccLevel,contentType:Pr(i.contentType)}}const Dr={locateFile:(i,h)=>{const u=i.match(/_(.+?)\.wasm$/);return u?`https://fastly.jsdelivr.net/npm/zxing-wasm@1.0.0-rc.4/dist/${u[1]}/${i}`:h+i}};let Ht=new WeakMap;function Bt(i,h){var u;const w=Ht.get(i);if(w!=null&&w.modulePromise&&(h===void 0||Object.is(h,w.moduleOverrides)))return w.modulePromise;const v=(u=h??(w==null?void 0:w.moduleOverrides))!=null?u:Dr,$=i({...v});return Ht.set(i,{moduleOverrides:v,modulePromise:$}),$}function Or(i,h){Ht.set(i,{moduleOverrides:h})}async function Sr(i,h,u=Tt){const w={...Tt,...u},v=await Bt(i),{size:$}=h,U=new Uint8Array(await h.arrayBuffer()),G=v._malloc($);v.HEAPU8.set(U,G);const V=v.readBarcodesFromImage(G,$,ge(v,w));v._free(G);const D=[];for(let N=0;N<V.size();++N)D.push(we(V.get(N)));return D}async function Fr(i,h,u=Tt){const w={...Tt,...u},v=await Bt(i),{data:$,width:U,height:G,data:{byteLength:V}}=h,D=v._malloc(V);v.HEAPU8.set($,D);const N=v.readBarcodesFromPixmap(D,U,G,ge(v,w));v._free(D);const Z=[];for(let L=0;L<N.size();++L)Z.push(we(N.get(L)));return Z}var Pt=(()=>{var i=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return function(h={}){var u=h,w,v;u.ready=new Promise((t,e)=>{w=t,v=e});var $=Object.assign({},u),U="./this.program",G=typeof window=="object",V=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&process.versions.node;var D="";function N(t){return u.locateFile?u.locateFile(t,D):D+t}var Z;(G||V)&&(V?D=self.location.href:typeof document<"u"&&document.currentScript&&(D=document.currentScript.src),i&&(D=i),D.indexOf("blob:")!==0?D=D.substr(0,D.replace(/[?#].*/,"").lastIndexOf("/")+1):D="",V&&(Z=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)})),u.print||console.log.bind(console);var L=u.printErr||console.error.bind(console);Object.assign(u,$),$=null,u.arguments&&u.arguments,u.thisProgram&&(U=u.thisProgram),u.quit&&u.quit;var K;u.wasmBinary&&(K=u.wasmBinary),typeof WebAssembly!="object"&&vt("no native wasm support detected");var nt,pt=!1;function Vt(t,e){t||vt(e)}var Y,B,ct,mt,k,_,$e,be;function Ce(){var t=nt.buffer;u.HEAP8=Y=new Int8Array(t),u.HEAP16=ct=new Int16Array(t),u.HEAPU8=B=new Uint8Array(t),u.HEAPU16=mt=new Uint16Array(t),u.HEAP32=k=new Int32Array(t),u.HEAPU32=_=new Uint32Array(t),u.HEAPF32=$e=new Float32Array(t),u.HEAPF64=be=new Float64Array(t)}var _e=[],Te=[],Pe=[];function kr(){if(u.preRun)for(typeof u.preRun=="function"&&(u.preRun=[u.preRun]);u.preRun.length;)Ur(u.preRun.shift());Lt(_e)}function Hr(){Lt(Te)}function Br(){if(u.postRun)for(typeof u.postRun=="function"&&(u.postRun=[u.postRun]);u.postRun.length;)Lr(u.postRun.shift());Lt(Pe)}function Ur(t){_e.unshift(t)}function Vr(t){Te.unshift(t)}function Lr(t){Pe.unshift(t)}var at=0,yt=null;function Yr(t){at++,u.monitorRunDependencies&&u.monitorRunDependencies(at)}function zr(t){if(at--,u.monitorRunDependencies&&u.monitorRunDependencies(at),at==0&&yt){var e=yt;yt=null,e()}}function vt(t){u.onAbort&&u.onAbort(t),t="Aborted("+t+")",L(t),pt=!0,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw v(e),e}var Gr="data:application/octet-stream;base64,",Ee=t=>t.startsWith(Gr),lt;lt="zxing_reader.wasm",Ee(lt)||(lt=N(lt));function Ae(t){if(t==lt&&K)return new Uint8Array(K);if(Z)return Z(t);throw"both async and sync fetching of the wasm failed"}function Nr(t){return!K&&(G||V)&&typeof fetch=="function"?fetch(t,{credentials:"same-origin"}).then(e=>{if(!e.ok)throw"failed to load wasm binary file at '"+t+"'";return e.arrayBuffer()}).catch(()=>Ae(t)):Promise.resolve().then(()=>Ae(t))}function De(t,e,r){return Nr(t).then(n=>WebAssembly.instantiate(n,e)).then(n=>n).then(r,n=>{L(`failed to asynchronously prepare wasm: ${n}`),vt(n)})}function Xr(t,e,r,n){return!t&&typeof WebAssembly.instantiateStreaming=="function"&&!Ee(e)&&typeof fetch=="function"?fetch(e,{credentials:"same-origin"}).then(a=>{var o=WebAssembly.instantiateStreaming(a,r);return o.then(n,function(s){return L(`wasm streaming compile failed: ${s}`),L("falling back to ArrayBuffer instantiation"),De(e,r,n)})}):De(e,r,n)}function qr(){var t={a:Sa};function e(n,a){return E=n.exports,nt=E.fa,Ce(),Be=E.ja,Vr(E.ga),zr(),E}Yr();function r(n){e(n.instance)}if(u.instantiateWasm)try{return u.instantiateWasm(t,e)}catch(n){L(`Module.instantiateWasm callback failed with error: ${n}`),v(n)}return Xr(K,lt,t,r).catch(v),{}}var Lt=t=>{for(;t.length>0;)t.shift()(u)};u.noExitRuntime;var Et=[],At=0,Zr=t=>{var e=new Yt(t);return e.get_caught()||(e.set_caught(!0),At--),e.set_rethrown(!1),Et.push(e),rr(e.excPtr),e.get_exception_ptr()},tt=0,Jr=()=>{A(0,0);var t=Et.pop();er(t.excPtr),tt=0};function Yt(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(e){_[this.ptr+4>>2]=e},this.get_type=function(){return _[this.ptr+4>>2]},this.set_destructor=function(e){_[this.ptr+8>>2]=e},this.get_destructor=function(){return _[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,Y[this.ptr+12>>0]=e},this.get_caught=function(){return Y[this.ptr+12>>0]!=0},this.set_rethrown=function(e){e=e?1:0,Y[this.ptr+13>>0]=e},this.get_rethrown=function(){return Y[this.ptr+13>>0]!=0},this.init=function(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)},this.set_adjusted_ptr=function(e){_[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return _[this.ptr+16>>2]},this.get_exception_ptr=function(){var e=ar(this.get_type());if(e)return _[this.excPtr>>2];var r=this.get_adjusted_ptr();return r!==0?r:this.excPtr}}var Qr=t=>{throw tt||(tt=t),tt},zt=t=>{var e=tt;if(!e)return _t(0),0;var r=new Yt(e);r.set_adjusted_ptr(e);var n=r.get_type();if(!n)return _t(0),e;for(var a in t){var o=t[a];if(o===0||o===n)break;var s=r.ptr+16;if(nr(o,n,s))return _t(o),e}return _t(n),e},Kr=()=>zt([]),tn=t=>zt([t]),en=(t,e)=>zt([t,e]),rn=()=>{var t=Et.pop();t||vt("no exception to throw");var e=t.excPtr;throw t.get_rethrown()||(Et.push(t),t.set_rethrown(!0),t.set_caught(!1),At++),tt=e,tt},nn=(t,e,r)=>{var n=new Yt(t);throw n.init(e,r),tt=t,At++,tt},an=()=>At,Dt={},Oe=t=>{for(;t.length;){var e=t.pop(),r=t.pop();r(e)}};function Gt(t){return this.fromWireType(k[t>>2])}var dt={},ot={},Ot={},Se,St=t=>{throw new Se(t)},it=(t,e,r)=>{t.forEach(function(c){Ot[c]=e});function n(c){var l=r(c);l.length!==t.length&&St("Mismatched type converter count");for(var f=0;f<t.length;++f)J(t[f],l[f])}var a=new Array(e.length),o=[],s=0;e.forEach((c,l)=>{ot.hasOwnProperty(c)?a[l]=ot[c]:(o.push(c),dt.hasOwnProperty(c)||(dt[c]=[]),dt[c].push(()=>{a[l]=ot[c],++s,s===o.length&&n(a)}))}),o.length===0&&n(a)},on=t=>{var e=Dt[t];delete Dt[t];var r=e.rawConstructor,n=e.rawDestructor,a=e.fields,o=a.map(s=>s.getterReturnType).concat(a.map(s=>s.setterArgumentType));it([t],o,s=>{var c={};return a.forEach((l,f)=>{var p=l.fieldName,y=s[f],g=l.getter,b=l.getterContext,T=s[f+a.length],I=l.setter,P=l.setterContext;c[p]={read:R=>y.fromWireType(g(b,R)),write:(R,d)=>{var m=[];I(P,R,T.toWireType(m,d)),Oe(m)}}}),[{name:e.name,fromWireType:l=>{var f={};for(var p in c)f[p]=c[p].read(l);return n(l),f},toWireType:(l,f)=>{for(var p in c)if(!(p in f))throw new TypeError(`Missing field: "${p}"`);var y=r();for(p in c)c[p].write(y,f[p]);return l!==null&&l.push(n,y),y},argPackAdvance:Q,readValueFromPointer:Gt,destructorFunction:n}]})},sn=(t,e,r,n,a)=>{},un=()=>{for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);Fe=t},Fe,j=t=>{for(var e="",r=t;B[r];)e+=Fe[B[r++]];return e},ft,C=t=>{throw new ft(t)};function cn(t,e,r={}){var n=e.name;if(t||C(`type "${n}" must have a positive integer typeid pointer`),ot.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;C(`Cannot register type '${n}' twice`)}if(ot[t]=e,delete Ot[t],dt.hasOwnProperty(t)){var a=dt[t];delete dt[t],a.forEach(o=>o())}}function J(t,e,r={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");return cn(t,e,r)}var Q=8,ln=(t,e,r,n)=>{e=j(e),J(t,{name:e,fromWireType:function(a){return!!a},toWireType:function(a,o){return o?r:n},argPackAdvance:Q,readValueFromPointer:function(a){return this.fromWireType(B[a])},destructorFunction:null})},dn=t=>({count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType}),Nt=t=>{function e(r){return r.$$.ptrType.registeredClass.name}C(e(t)+" instance already deleted")},Xt=!1,xe=t=>{},fn=t=>{t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)},Me=t=>{t.count.value-=1;var e=t.count.value===0;e&&fn(t)},je=(t,e,r)=>{if(e===r)return t;if(r.baseClass===void 0)return null;var n=je(t,e,r.baseClass);return n===null?null:r.downcast(n)},Ie={},hn=()=>Object.keys($t).length,pn=()=>{var t=[];for(var e in $t)$t.hasOwnProperty(e)&&t.push($t[e]);return t},gt=[],qt=()=>{for(;gt.length;){var t=gt.pop();t.$$.deleteScheduled=!1,t.delete()}},wt,mn=t=>{wt=t,gt.length&&wt&&wt(qt)},yn=()=>{u.getInheritedInstanceCount=hn,u.getLiveInheritedInstances=pn,u.flushPendingDeletes=qt,u.setDelayFunction=mn},$t={},vn=(t,e)=>{for(e===void 0&&C("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e},gn=(t,e)=>(e=vn(t,e),$t[e]),Ft=(t,e)=>{(!e.ptrType||!e.ptr)&&St("makeClassHandle requires ptr and ptrType");var r=!!e.smartPtrType,n=!!e.smartPtr;return r!==n&&St("Both smartPtrType and smartPtr must be specified"),e.count={value:1},bt(Object.create(t,{$$:{value:e}}))};function wn(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=gn(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?Ft(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:t}):Ft(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var o=this.registeredClass.getActualType(e),s=Ie[o];if(!s)return a.call(this);var c;this.isConst?c=s.constPointerType:c=s.pointerType;var l=je(e,this.registeredClass,c.registeredClass);return l===null?a.call(this):this.isSmartPointer?Ft(c.registeredClass.instancePrototype,{ptrType:c,ptr:l,smartPtrType:this,smartPtr:t}):Ft(c.registeredClass.instancePrototype,{ptrType:c,ptr:l})}var bt=t=>typeof FinalizationRegistry>"u"?(bt=e=>e,t):(Xt=new FinalizationRegistry(e=>{Me(e.$$)}),bt=e=>{var r=e.$$,n=!!r.smartPtr;if(n){var a={$$:r};Xt.register(e,a,e)}return e},xe=e=>Xt.unregister(e),bt(t)),$n=()=>{Object.assign(xt.prototype,{isAliasOf(t){if(!(this instanceof xt)||!(t instanceof xt))return!1;var e=this.$$.ptrType.registeredClass,r=this.$$.ptr;t.$$=t.$$;for(var n=t.$$.ptrType.registeredClass,a=t.$$.ptr;e.baseClass;)r=e.upcast(r),e=e.baseClass;for(;n.baseClass;)a=n.upcast(a),n=n.baseClass;return e===n&&r===a},clone(){if(this.$$.ptr||Nt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t=bt(Object.create(Object.getPrototypeOf(this),{$$:{value:dn(this.$$)}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t},delete(){this.$$.ptr||Nt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&C("Object already scheduled for deletion"),xe(this),Me(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Nt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&C("Object already scheduled for deletion"),gt.push(this),gt.length===1&&wt&&wt(qt),this.$$.deleteScheduled=!0,this}})};function xt(){}var bn=48,Cn=57,Re=t=>{if(t===void 0)return"_unknown";t=t.replace(/[^a-zA-Z0-9_]/g,"$");var e=t.charCodeAt(0);return e>=bn&&e<=Cn?`_${t}`:t};function Zt(t,e){return t=Re(t),{[t]:function(){return e.apply(this,arguments)}}[t]}var We=(t,e,r)=>{if(t[e].overloadTable===void 0){var n=t[e];t[e]=function(){return t[e].overloadTable.hasOwnProperty(arguments.length)||C(`Function '${r}' called with an invalid number of arguments (${arguments.length}) - expects one of (${t[e].overloadTable})!`),t[e].overloadTable[arguments.length].apply(this,arguments)},t[e].overloadTable=[],t[e].overloadTable[n.argCount]=n}},Jt=(t,e,r)=>{u.hasOwnProperty(t)?((r===void 0||u[t].overloadTable!==void 0&&u[t].overloadTable[r]!==void 0)&&C(`Cannot register public name '${t}' twice`),We(u,t,t),u.hasOwnProperty(r)&&C(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),u[t].overloadTable[r]=e):(u[t]=e,r!==void 0&&(u[t].numArguments=r))};function _n(t,e,r,n,a,o,s,c){this.name=t,this.constructor=e,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=o,this.upcast=s,this.downcast=c,this.pureVirtualFunctions=[]}var Qt=(t,e,r)=>{for(;e!==r;)e.upcast||C(`Expected null or instance of ${r.name}, got an instance of ${e.name}`),t=e.upcast(t),e=e.baseClass;return t};function Tn(t,e){if(e===null)return this.isReference&&C(`null is not a valid ${this.name}`),0;e.$$||C(`Cannot pass "${re(e)}" as a ${this.name}`),e.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=e.$$.ptrType.registeredClass,n=Qt(e.$$.ptr,r,this.registeredClass);return n}function Pn(t,e){var r;if(e===null)return this.isReference&&C(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),t!==null&&t.push(this.rawDestructor,r),r):0;e.$$||C(`Cannot pass "${re(e)}" as a ${this.name}`),e.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&e.$$.ptrType.isConst&&C(`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=Qt(e.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(e.$$.smartPtr===void 0&&C("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:e.$$.smartPtrType===this?r=e.$$.smartPtr:C(`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,rt.toHandle(()=>a.delete())),t!==null&&t.push(this.rawDestructor,r)}break;default:C("Unsupporting sharing policy")}return r}function En(t,e){if(e===null)return this.isReference&&C(`null is not a valid ${this.name}`),0;e.$$||C(`Cannot pass "${re(e)}" as a ${this.name}`),e.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`),e.$$.ptrType.isConst&&C(`Cannot convert argument of type ${e.$$.ptrType.name} to parameter type ${this.name}`);var r=e.$$.ptrType.registeredClass,n=Qt(e.$$.ptr,r,this.registeredClass);return n}function ke(t){return this.fromWireType(_[t>>2])}var An=()=>{Object.assign(Mt.prototype,{getPointee(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t},destructor(t){this.rawDestructor&&this.rawDestructor(t)},argPackAdvance:Q,readValueFromPointer:ke,deleteObject(t){t!==null&&t.delete()},fromWireType:wn})};function Mt(t,e,r,n,a,o,s,c,l,f,p){this.name=t,this.registeredClass=e,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=o,this.sharingPolicy=s,this.rawGetPointee=c,this.rawConstructor=l,this.rawShare=f,this.rawDestructor=p,!a&&e.baseClass===void 0?n?(this.toWireType=Tn,this.destructorFunction=null):(this.toWireType=En,this.destructorFunction=null):this.toWireType=Pn}var He=(t,e,r)=>{u.hasOwnProperty(t)||St("Replacing nonexistant public symbol"),u[t].overloadTable!==void 0&&r!==void 0?u[t].overloadTable[r]=e:(u[t]=e,u[t].argCount=r)},Dn=(t,e,r)=>{var n=u["dynCall_"+t];return r&&r.length?n.apply(null,[e].concat(r)):n.call(null,e)},jt=[],Be,O=t=>{var e=jt[t];return e||(t>=jt.length&&(jt.length=t+1),jt[t]=e=Be.get(t)),e},On=(t,e,r)=>{if(t.includes("j"))return Dn(t,e,r);var n=O(e).apply(null,r);return n},Sn=(t,e)=>{var r=[];return function(){return r.length=0,Object.assign(r,arguments),On(t,e,r)}},q=(t,e)=>{t=j(t);function r(){return t.includes("j")?Sn(t,e):O(e)}var n=r();return typeof n!="function"&&C(`unknown function pointer with signature ${t}: ${e}`),n},Fn=(t,e)=>{var r=Zt(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},Ue,Ve=t=>{var e=tr(t),r=j(e);return et(e),r},It=(t,e)=>{var r=[],n={};function a(o){if(!n[o]&&!ot[o]){if(Ot[o]){Ot[o].forEach(a);return}r.push(o),n[o]=!0}}throw e.forEach(a),new Ue(`${t}: `+r.map(Ve).join([", "]))},xn=(t,e,r,n,a,o,s,c,l,f,p,y,g)=>{p=j(p),o=q(a,o),c&&(c=q(s,c)),f&&(f=q(l,f)),g=q(y,g);var b=Re(p);Jt(b,function(){It(`Cannot construct ${p} due to unbound types`,[n])}),it([t,e,r],n?[n]:[],function(T){T=T[0];var I,P;n?(I=T.registeredClass,P=I.instancePrototype):P=xt.prototype;var R=Zt(b,function(){if(Object.getPrototypeOf(this)!==d)throw new ft("Use 'new' to construct "+p);if(m.constructor_body===void 0)throw new ft(p+" has no accessible constructor");var kt=m.constructor_body[arguments.length];if(kt===void 0)throw new ft(`Tried to invoke ctor of ${p} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(m.constructor_body).toString()}) parameters instead!`);return kt.apply(this,arguments)}),d=Object.create(P,{constructor:{value:R}});R.prototype=d;var m=new _n(p,R,d,g,I,o,c,f);m.baseClass&&(m.baseClass.__derivedClasses===void 0&&(m.baseClass.__derivedClasses=[]),m.baseClass.__derivedClasses.push(m));var x=new Mt(p,m,!0,!1,!1),M=new Mt(p+"*",m,!1,!1,!1),st=new Mt(p+" const*",m,!1,!0,!1);return Ie[t]={pointerType:M,constPointerType:st},He(b,R),[x,M,st]})},Kt=(t,e)=>{for(var r=[],n=0;n<t;n++)r.push(_[e+n*4>>2]);return r};function te(t,e,r,n,a,o){var s=e.length;s<2&&C("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var c=e[1]!==null&&r!==null,l=!1,f=1;f<e.length;++f)if(e[f]!==null&&e[f].destructorFunction===void 0){l=!0;break}var p=e[0].name!=="void",y=s-2,g=new Array(y),b=[],T=[];return function(){arguments.length!==y&&C(`function ${t} called with ${arguments.length} arguments, expected ${y}`),T.length=0;var I;b.length=c?2:1,b[0]=a,c&&(I=e[1].toWireType(T,this),b[1]=I);for(var P=0;P<y;++P)g[P]=e[P+2].toWireType(T,arguments[P]),b.push(g[P]);var R=n.apply(null,b);function d(m){if(l)Oe(T);else for(var x=c?1:2;x<e.length;x++){var M=x===1?I:g[x-2];e[x].destructorFunction!==null&&e[x].destructorFunction(M)}if(p)return e[0].fromWireType(m)}return d(R)}}var Mn=(t,e,r,n,a,o)=>{var s=Kt(e,r);a=q(n,a),it([],[t],function(c){c=c[0];var l=`constructor ${c.name}`;if(c.registeredClass.constructor_body===void 0&&(c.registeredClass.constructor_body=[]),c.registeredClass.constructor_body[e-1]!==void 0)throw new ft(`Cannot register multiple constructors with identical number of parameters (${e-1}) for class '${c.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return c.registeredClass.constructor_body[e-1]=()=>{It(`Cannot construct ${c.name} due to unbound types`,s)},it([],s,f=>(f.splice(1,0,null),c.registeredClass.constructor_body[e-1]=te(l,f,null,a,o),[])),[]})},Le=t=>{t=t.trim();const e=t.indexOf("(");return e!==-1?(Vt(t[t.length-1]==")","Parentheses for argument names should match."),t.substr(0,e)):t},jn=(t,e,r,n,a,o,s,c,l)=>{var f=Kt(r,n);e=j(e),e=Le(e),o=q(a,o),it([],[t],function(p){p=p[0];var y=`${p.name}.${e}`;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),c&&p.registeredClass.pureVirtualFunctions.push(e);function g(){It(`Cannot call ${y} due to unbound types`,f)}var b=p.registeredClass.instancePrototype,T=b[e];return T===void 0||T.overloadTable===void 0&&T.className!==p.name&&T.argCount===r-2?(g.argCount=r-2,g.className=p.name,b[e]=g):(We(b,e,y),b[e].overloadTable[r-2]=g),it([],f,function(I){var P=te(y,I,p,o,s);return b[e].overloadTable===void 0?(P.argCount=r-2,b[e]=P):b[e].overloadTable[r-2]=P,[]}),[]})};function In(){Object.assign(Ye.prototype,{get(t){return this.allocated[t]},has(t){return this.allocated[t]!==void 0},allocate(t){var e=this.freelist.pop()||this.allocated.length;return this.allocated[e]=t,e},free(t){this.allocated[t]=void 0,this.freelist.push(t)}})}function Ye(){this.allocated=[void 0],this.freelist=[]}var X=new Ye,ze=t=>{t>=X.reserved&&--X.get(t).refcount===0&&X.free(t)},Rn=()=>{for(var t=0,e=X.reserved;e<X.allocated.length;++e)X.allocated[e]!==void 0&&++t;return t},Wn=()=>{X.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),X.reserved=X.allocated.length,u.count_emval_handles=Rn},rt={toValue:t=>(t||C("Cannot use deleted val. handle = "+t),X.get(t).value),toHandle:t=>{switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return X.allocate({refcount:1,value:t})}}},kn=(t,e)=>{e=j(e),J(t,{name:e,fromWireType:r=>{var n=rt.toValue(r);return ze(r),n},toWireType:(r,n)=>rt.toHandle(n),argPackAdvance:Q,readValueFromPointer:Gt,destructorFunction:null})},Hn=(t,e,r)=>{switch(e){case 1:return r?function(n){return this.fromWireType(Y[n>>0])}:function(n){return this.fromWireType(B[n>>0])};case 2:return r?function(n){return this.fromWireType(ct[n>>1])}:function(n){return this.fromWireType(mt[n>>1])};case 4:return r?function(n){return this.fromWireType(k[n>>2])}:function(n){return this.fromWireType(_[n>>2])};default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},Bn=(t,e,r,n)=>{e=j(e);function a(){}a.values={},J(t,{name:e,constructor:a,fromWireType:function(o){return this.constructor.values[o]},toWireType:(o,s)=>s.value,argPackAdvance:Q,readValueFromPointer:Hn(e,r,n),destructorFunction:null}),Jt(e,a)},ee=(t,e)=>{var r=ot[t];return r===void 0&&C(e+" has unknown type "+Ve(t)),r},Un=(t,e,r)=>{var n=ee(t,"enum");e=j(e);var a=n.constructor,o=Object.create(n.constructor.prototype,{value:{value:r},constructor:{value:Zt(`${n.name}_${e}`,function(){})}});a.values[r]=o,a[e]=o},re=t=>{if(t===null)return"null";var e=typeof t;return e==="object"||e==="array"||e==="function"?t.toString():""+t},Vn=(t,e)=>{switch(e){case 4:return function(r){return this.fromWireType($e[r>>2])};case 8:return function(r){return this.fromWireType(be[r>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},Ln=(t,e,r)=>{e=j(e),J(t,{name:e,fromWireType:n=>n,toWireType:(n,a)=>a,argPackAdvance:Q,readValueFromPointer:Vn(e,r),destructorFunction:null})},Yn=(t,e,r,n,a,o,s)=>{var c=Kt(e,r);t=j(t),t=Le(t),a=q(n,a),Jt(t,function(){It(`Cannot call ${t} due to unbound types`,c)},e-1),it([],c,function(l){var f=[l[0],null].concat(l.slice(1));return He(t,te(t,f,null,a,o),e-1),[]})},zn=(t,e,r)=>{switch(e){case 1:return r?n=>Y[n>>0]:n=>B[n>>0];case 2:return r?n=>ct[n>>1]:n=>mt[n>>1];case 4:return r?n=>k[n>>2]:n=>_[n>>2];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},Gn=(t,e,r,n,a)=>{e=j(e);var o=p=>p;if(n===0){var s=32-8*r;o=p=>p<<s>>>s}var c=e.includes("unsigned"),l=(p,y)=>{},f;c?f=function(p,y){return l(y,this.name),y>>>0}:f=function(p,y){return l(y,this.name),y},J(t,{name:e,fromWireType:o,toWireType:f,argPackAdvance:Q,readValueFromPointer:zn(e,r,n!==0),destructorFunction:null})},Nn=(t,e,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[e];function o(s){var c=_[s>>2],l=_[s+4>>2];return new a(Y.buffer,l,c)}r=j(r),J(t,{name:r,fromWireType:o,argPackAdvance:Q,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Ge=(t,e,r,n)=>{if(!(n>0))return 0;for(var a=r,o=r+n-1,s=0;s<t.length;++s){var c=t.charCodeAt(s);if(c>=55296&&c<=57343){var l=t.charCodeAt(++s);c=65536+((c&1023)<<10)|l&1023}if(c<=127){if(r>=o)break;e[r++]=c}else if(c<=2047){if(r+1>=o)break;e[r++]=192|c>>6,e[r++]=128|c&63}else if(c<=65535){if(r+2>=o)break;e[r++]=224|c>>12,e[r++]=128|c>>6&63,e[r++]=128|c&63}else{if(r+3>=o)break;e[r++]=240|c>>18,e[r++]=128|c>>12&63,e[r++]=128|c>>6&63,e[r++]=128|c&63}}return e[r]=0,r-a},Xn=(t,e,r)=>Ge(t,B,e,r),Ne=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},Xe=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,qn=(t,e,r)=>{for(var n=e+r,a=e;t[a]&&!(a>=n);)++a;if(a-e>16&&t.buffer&&Xe)return Xe.decode(t.subarray(e,a));for(var o="";e<a;){var s=t[e++];if(!(s&128)){o+=String.fromCharCode(s);continue}var c=t[e++]&63;if((s&224)==192){o+=String.fromCharCode((s&31)<<6|c);continue}var l=t[e++]&63;if((s&240)==224?s=(s&15)<<12|c<<6|l:s=(s&7)<<18|c<<12|l<<6|t[e++]&63,s<65536)o+=String.fromCharCode(s);else{var f=s-65536;o+=String.fromCharCode(55296|f>>10,56320|f&1023)}}return o},ne=(t,e)=>t?qn(B,t,e):"",Zn=(t,e)=>{e=j(e);var r=e==="std::string";J(t,{name:e,fromWireType(n){var a=_[n>>2],o=n+4,s;if(r)for(var c=o,l=0;l<=a;++l){var f=o+l;if(l==a||B[f]==0){var p=f-c,y=ne(c,p);s===void 0?s=y:(s+=String.fromCharCode(0),s+=y),c=f+1}}else{for(var g=new Array(a),l=0;l<a;++l)g[l]=String.fromCharCode(B[o+l]);s=g.join("")}return et(n),s},toWireType(n,a){a instanceof ArrayBuffer&&(a=new Uint8Array(a));var o,s=typeof a=="string";s||a instanceof Uint8Array||a instanceof Uint8ClampedArray||a instanceof Int8Array||C("Cannot pass non-string to std::string"),r&&s?o=Ne(a):o=a.length;var c=oe(4+o+1),l=c+4;if(_[c>>2]=o,r&&s)Xn(a,l,o+1);else if(s)for(var f=0;f<o;++f){var p=a.charCodeAt(f);p>255&&(et(l),C("String has UTF-16 code units that do not fit in 8 bits")),B[l+f]=p}else for(var f=0;f<o;++f)B[l+f]=a[f];return n!==null&&n.push(et,c),c},argPackAdvance:Q,readValueFromPointer:ke,destructorFunction(n){et(n)}})},qe=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,Jn=(t,e)=>{for(var r=t,n=r>>1,a=n+e/2;!(n>=a)&&mt[n];)++n;if(r=n<<1,r-t>32&&qe)return qe.decode(B.subarray(t,r));for(var o="",s=0;!(s>=e/2);++s){var c=ct[t+s*2>>1];if(c==0)break;o+=String.fromCharCode(c)}return o},Qn=(t,e,r)=>{if(r===void 0&&(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);ct[e>>1]=s,e+=2}return ct[e>>1]=0,e-n},Kn=t=>t.length*2,ta=(t,e)=>{for(var r=0,n="";!(r>=e/4);){var a=k[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},ea=(t,e,r)=>{if(r===void 0&&(r=2147483647),r<4)return 0;for(var n=e,a=n+r-4,o=0;o<t.length;++o){var s=t.charCodeAt(o);if(s>=55296&&s<=57343){var c=t.charCodeAt(++o);s=65536+((s&1023)<<10)|c&1023}if(k[e>>2]=s,e+=4,e+4>a)break}return k[e>>2]=0,e-n},ra=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},na=(t,e,r)=>{r=j(r);var n,a,o,s,c;e===2?(n=Jn,a=Qn,s=Kn,o=()=>mt,c=1):e===4&&(n=ta,a=ea,s=ra,o=()=>_,c=2),J(t,{name:r,fromWireType:l=>{for(var f=_[l>>2],p=o(),y,g=l+4,b=0;b<=f;++b){var T=l+4+b*e;if(b==f||p[T>>c]==0){var I=T-g,P=n(g,I);y===void 0?y=P:(y+=String.fromCharCode(0),y+=P),g=T+e}}return et(l),y},toWireType:(l,f)=>{typeof f!="string"&&C(`Cannot pass non-string to C++ string type ${r}`);var p=s(f),y=oe(4+p+e);return _[y>>2]=p>>c,a(f,y+4,p+e),l!==null&&l.push(et,y),y},argPackAdvance:Q,readValueFromPointer:Gt,destructorFunction(l){et(l)}})},aa=(t,e,r,n,a,o)=>{Dt[t]={name:j(e),rawConstructor:q(r,n),rawDestructor:q(a,o),fields:[]}},oa=(t,e,r,n,a,o,s,c,l,f)=>{Dt[t].fields.push({fieldName:j(e),getterReturnType:r,getter:q(n,a),getterContext:o,setterArgumentType:s,setter:q(c,l),setterContext:f})},ia=(t,e)=>{e=j(e),J(t,{isVoid:!0,name:e,argPackAdvance:0,fromWireType:()=>{},toWireType:(r,n)=>{}})},sa={},ua=t=>{var e=sa[t];return e===void 0?j(t):e},Ze=()=>{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.")},ca=t=>t===0?rt.toHandle(Ze()):(t=ua(t),rt.toHandle(Ze()[t])),la=t=>{t>4&&(X.get(t).refcount+=1)},da=t=>{var e=new Array(t+1);return function(r,n,a){e[0]=r;for(var o=0;o<t;++o){var s=ee(_[n+o*4>>2],"parameter "+o);e[o+1]=s.readValueFromPointer(a),a+=s.argPackAdvance}var c=new(r.bind.apply(r,e));return rt.toHandle(c)}},Je={},fa=(t,e,r,n)=>{t=rt.toValue(t);var a=Je[e];return a||(a=da(e),Je[e]=a),a(t,r,n)},ha=(t,e)=>{t=ee(t,"_emval_take_value");var r=t.readValueFromPointer(e);return rt.toHandle(r)},pa=()=>{vt("")},ma=(t,e,r)=>B.copyWithin(t,e,e+r),ya=()=>2147483648,va=t=>{var e=nt.buffer,r=(t-e.byteLength+65535)/65536;try{return nt.grow(r),Ce(),1}catch{}},ga=t=>{var e=B.length;t>>>=0;var r=ya();if(t>r)return!1;for(var n=(l,f)=>l+(f-l%f)%f,a=1;a<=4;a*=2){var o=e*(1+.2/a);o=Math.min(o,t+100663296);var s=Math.min(r,n(Math.max(t,o),65536)),c=va(s);if(c)return!0}return!1},ae={},wa=()=>U||"./this.program",Ct=()=>{if(!Ct.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,_:wa()};for(var r in ae)ae[r]===void 0?delete e[r]:e[r]=ae[r];var n=[];for(var r in e)n.push(`${r}=${e[r]}`);Ct.strings=n}return Ct.strings},$a=(t,e)=>{for(var r=0;r<t.length;++r)Y[e++>>0]=t.charCodeAt(r);Y[e>>0]=0},ba=(t,e)=>{var r=0;return Ct().forEach((n,a)=>{var o=e+r;_[t+a*4>>2]=o,$a(n,o),r+=n.length+1}),0},Ca=(t,e)=>{var r=Ct();_[t>>2]=r.length;var n=0;return r.forEach(a=>n+=a.length+1),_[e>>2]=n,0},_a=t=>t,Rt=t=>t%4===0&&(t%100!==0||t%400===0),Ta=(t,e)=>{for(var r=0,n=0;n<=e;r+=t[n++]);return r},Qe=[31,29,31,30,31,30,31,31,30,31,30,31],Ke=[31,28,31,30,31,30,31,31,30,31,30,31],Pa=(t,e)=>{for(var r=new Date(t.getTime());e>0;){var n=Rt(r.getFullYear()),a=r.getMonth(),o=(n?Qe:Ke)[a];if(e>o-r.getDate())e-=o-r.getDate()+1,r.setDate(1),a<11?r.setMonth(a+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1));else return r.setDate(r.getDate()+e),r}return r};function Ea(t,e,r){var n=r>0?r:Ne(t)+1,a=new Array(n),o=Ge(t,a,0,a.length);return e&&(a.length=o),a}var Aa=(t,e)=>{Y.set(t,e)},Da=(t,e,r,n)=>{var a=_[n+40>>2],o={tm_sec:k[n>>2],tm_min:k[n+4>>2],tm_hour:k[n+8>>2],tm_mday:k[n+12>>2],tm_mon:k[n+16>>2],tm_year:k[n+20>>2],tm_wday:k[n+24>>2],tm_yday:k[n+28>>2],tm_isdst:k[n+32>>2],tm_gmtoff:k[n+36>>2],tm_zone:a?ne(a):""},s=ne(r),c={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var l in c)s=s.replace(new RegExp(l,"g"),c[l]);var f=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],p=["January","February","March","April","May","June","July","August","September","October","November","December"];function y(d,m,x){for(var M=typeof d=="number"?d.toString():d||"";M.length<m;)M=x[0]+M;return M}function g(d,m){return y(d,m,"0")}function b(d,m){function x(st){return st<0?-1:st>0?1:0}var M;return(M=x(d.getFullYear()-m.getFullYear()))===0&&(M=x(d.getMonth()-m.getMonth()))===0&&(M=x(d.getDate()-m.getDate())),M}function T(d){switch(d.getDay()){case 0:return new Date(d.getFullYear()-1,11,29);case 1:return d;case 2:return new Date(d.getFullYear(),0,3);case 3:return new Date(d.getFullYear(),0,2);case 4:return new Date(d.getFullYear(),0,1);case 5:return new Date(d.getFullYear()-1,11,31);case 6:return new Date(d.getFullYear()-1,11,30)}}function I(d){var m=Pa(new Date(d.tm_year+1900,0,1),d.tm_yday),x=new Date(m.getFullYear(),0,4),M=new Date(m.getFullYear()+1,0,4),st=T(x),kt=T(M);return b(st,m)<=0?b(kt,m)<=0?m.getFullYear()+1:m.getFullYear():m.getFullYear()-1}var P={"%a":d=>f[d.tm_wday].substring(0,3),"%A":d=>f[d.tm_wday],"%b":d=>p[d.tm_mon].substring(0,3),"%B":d=>p[d.tm_mon],"%C":d=>{var m=d.tm_year+1900;return g(m/100|0,2)},"%d":d=>g(d.tm_mday,2),"%e":d=>y(d.tm_mday,2," "),"%g":d=>I(d).toString().substring(2),"%G":d=>I(d),"%H":d=>g(d.tm_hour,2),"%I":d=>{var m=d.tm_hour;return m==0?m=12:m>12&&(m-=12),g(m,2)},"%j":d=>g(d.tm_mday+Ta(Rt(d.tm_year+1900)?Qe:Ke,d.tm_mon-1),3),"%m":d=>g(d.tm_mon+1,2),"%M":d=>g(d.tm_min,2),"%n":()=>`
|
|
3
|
-
`,"%p":d=>d.tm_hour>=0&&d.tm_hour<12?"AM":"PM","%S":d=>g(d.tm_sec,2),"%t":()=>" ","%u":d=>d.tm_wday||7,"%U":d=>{var m=d.tm_yday+7-d.tm_wday;return g(Math.floor(m/7),2)},"%V":d=>{var m=Math.floor((d.tm_yday+7-(d.tm_wday+6)%7)/7);if((d.tm_wday+371-d.tm_yday-2)%7<=2&&m++,m){if(m==53){var x=(d.tm_wday+371-d.tm_yday)%7;x!=4&&(x!=3||!Rt(d.tm_year))&&(m=1)}}else{m=52;var M=(d.tm_wday+7-d.tm_yday-1)%7;(M==4||M==5&&Rt(d.tm_year%400-1))&&m++}return g(m,2)},"%w":d=>d.tm_wday,"%W":d=>{var m=d.tm_yday+7-(d.tm_wday+6)%7;return g(Math.floor(m/7),2)},"%y":d=>(d.tm_year+1900).toString().substring(2),"%Y":d=>d.tm_year+1900,"%z":d=>{var m=d.tm_gmtoff,x=m>=0;return m=Math.abs(m)/60,m=m/60*100+m%60,(x?"+":"-")+("0000"+m).slice(-4)},"%Z":d=>d.tm_zone,"%%":()=>"%"};s=s.replace(/%%/g,"\0\0");for(var l in P)s.includes(l)&&(s=s.replace(new RegExp(l,"g"),P[l](o)));s=s.replace(/\0\0/g,"%");var R=Ea(s,!1);return R.length>e?0:(Aa(R,t),R.length-1)},Oa=(t,e,r,n,a)=>Da(t,e,r,n);Se=u.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError"}},un(),ft=u.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},$n(),yn(),An(),Ue=u.UnboundTypeError=Fn(Error,"UnboundTypeError"),
|
|
1
|
+
var sr=(W,H,z)=>{if(!H.has(W))throw TypeError("Cannot "+z)};var ie=(W,H,z)=>(sr(W,H,"read from private field"),z?z.call(W):H.get(W)),ur=(W,H,z)=>{if(H.has(W))throw TypeError("Cannot add the same private member more than once");H instanceof WeakSet?H.add(W):H.set(W,z)},cr=(W,H,z,ht)=>(sr(W,H,"write to private field"),ht?ht.call(W,z):H.set(W,z),z);var BarcodeDetectionAPI=function(W){var ut;"use strict";const H=["aztec","code_128","code_39","code_93","codabar","data_matrix","ean_13","ean_8","itf","pdf417","qr_code","upc_a","upc_e","unknown"];function z(i){if(ht(i))return{width:i.naturalWidth,height:i.naturalHeight};if(se(i))return{width:i.width.baseVal.value,height:i.height.baseVal.value};if(ue(i))return{width:i.videoWidth,height:i.videoHeight};if(le(i))return{width:i.width,height:i.height};if(fe(i))return{width:i.displayWidth,height:i.displayHeight};if(ce(i))return{width:i.width,height:i.height};if(de(i))return{width:i.width,height:i.height};throw new TypeError("The provided value is not of type '(Blob or HTMLCanvasElement or HTMLImageElement or HTMLVideoElement or ImageBitmap or ImageData or OffscreenCanvas or SVGImageElement or VideoFrame)'.")}function ht(i){try{return i instanceof HTMLImageElement}catch{return!1}}function se(i){try{return i instanceof SVGImageElement}catch{return!1}}function ue(i){try{return i instanceof HTMLVideoElement}catch{return!1}}function ce(i){try{return i instanceof HTMLCanvasElement}catch{return!1}}function le(i){try{return i instanceof ImageBitmap}catch{return!1}}function de(i){try{return i instanceof OffscreenCanvas}catch{return!1}}function fe(i){try{return i instanceof VideoFrame}catch{return!1}}function he(i){try{return i instanceof Blob}catch{return!1}}function lr(i){try{return i instanceof ImageData}catch{return!1}}function dr(i,h){try{const u=new OffscreenCanvas(i,h);if(u.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return u;throw void 0}catch{const u=document.createElement("canvas");return u.width=i,u.height=h,u}}async function pe(i){if(ht(i)&&!await mr(i))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(se(i)&&!await yr(i))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(fe(i)&&vr(i))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(ue(i)&&(i.readyState===0||i.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(le(i)&&wr(i))throw new DOMException("The image source is detached.","InvalidStateError");const{width:h,height:u}=z(i);if(h===0||u===0)return null;const v=dr(h,u).getContext("2d");v.drawImage(i,0,0);try{return v.getImageData(0,0,h,u)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function fr(i){let h;try{if(createImageBitmap)h=await createImageBitmap(i);else if(Image){h=new Image;let w="";try{w=URL.createObjectURL(i),h.src=w,await h.decode()}finally{URL.revokeObjectURL(w)}}else return i}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}return await pe(h)}function hr(i){const{width:h,height:u}=i;if(h===0||u===0)return null;const w=i.getContext("2d");try{return w.getImageData(0,0,h,u)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function pr(i){if(he(i))return await fr(i);if(lr(i)){if(gr(i))throw new DOMException("The image data has been detached.","InvalidStateError");return i}return ce(i)||de(i)?hr(i):await pe(i)}async function mr(i){try{return await i.decode(),!0}catch{return!1}}async function yr(i){var h;try{return await((h=i.decode)==null?void 0:h.call(i)),!0}catch{return!1}}function vr(i){return i.format===null}function gr(i){return i.data.buffer.byteLength===0}function wr(i){return i.width===0&&i.height===0}function me(i,h){return i instanceof DOMException?new DOMException(`${h}: ${i.message}`,i.name):i instanceof Error?new i.constructor(`${h}: ${i.message}`):new Error(`${h}: ${i}`)}const ye=["Aztec","Codabar","Code128","Code39","Code93","DataBar","DataBarExpanded","DataMatrix","EAN-13","EAN-8","ITF","Linear-Codes","Matrix-Codes","MaxiCode","MicroQRCode","None","PDF417","QRCode","UPC-A","UPC-E"];function $r(i){return i.join("|")}function br(i){const h=ve(i);let u=0,w=ye.length-1;for(;u<=w;){const v=Math.floor((u+w)/2),$=ye[v],U=ve($);if(U===h)return $;U<h?u=v+1:w=v-1}return"None"}function ve(i){return i.toLowerCase().replace(/_-\[\]/g,"")}function Cr(i,h){return i.Binarizer[h]}function _r(i,h){return i.CharacterSet[h]}const Tr=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function Pr(i){return Tr[i.value]}function Er(i,h){return i.EanAddOnSymbol[h]}function Ar(i,h){return i.TextMode[h]}const pt={formats:[],tryHarder:!0,tryRotate:!0,tryInvert:!0,tryDownscale:!0,binarizer:"LocalAverage",isPure:!1,downscaleFactor:3,downscaleThreshold:500,minLineCount:2,maxNumberOfSymbols:255,tryCode39ExtendedMode:!1,validateCode39CheckSum:!1,validateITFCheckSum:!1,returnCodabarStartEnd:!1,returnErrors:!1,eanAddOnSymbol:"Read",textMode:"Plain",characterSet:"Unknown"};function ge(i,h){return{...h,formats:$r(h.formats),binarizer:Cr(i,h.binarizer),eanAddOnSymbol:Er(i,h.eanAddOnSymbol),textMode:Ar(i,h.textMode),characterSet:_r(i,h.characterSet)}}function we(i){return{...i,format:br(i.format),eccLevel:i.eccLevel,contentType:Pr(i.contentType)}}const Dr={locateFile:(i,h)=>{const u=i.match(/_(.+?)\.wasm$/);return u?`https://fastly.jsdelivr.net/npm/zxing-wasm@1.0.0-rc.6/dist/${u[1]}/${i}`:h+i}};let Ht=new WeakMap;function Bt(i,h){var u;const w=Ht.get(i);if(w!=null&&w.modulePromise&&(h===void 0||Object.is(h,w.moduleOverrides)))return w.modulePromise;const v=(u=h??(w==null?void 0:w.moduleOverrides))!=null?u:Dr,$=i({...v});return Ht.set(i,{moduleOverrides:v,modulePromise:$}),$}function Or(i,h){Ht.set(i,{moduleOverrides:h})}async function Sr(i,h,u=pt){const w={...pt,...u},v=await Bt(i),{size:$}=h,U=new Uint8Array(await h.arrayBuffer()),N=v._malloc($);v.HEAPU8.set(U,N);const V=v.readBarcodesFromImage(N,$,ge(v,w));v._free(N);const D=[];for(let G=0;G<V.size();++G)D.push(we(V.get(G)));return D}async function Fr(i,h,u=pt){const w={...pt,...u},v=await Bt(i),{data:$,width:U,height:N,data:{byteLength:V}}=h,D=v._malloc(V);v.HEAPU8.set($,D);const G=v.readBarcodesFromPixmap(D,U,N,ge(v,w));v._free(D);const Z=[];for(let L=0;L<G.size();++L)Z.push(we(G.get(L)));return Z}structuredClone(pt);var Pt=(()=>{var i=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return function(h={}){var u=h,w,v;u.ready=new Promise((t,e)=>{w=t,v=e});var $=Object.assign({},u),U="./this.program",N=typeof window=="object",V=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&process.versions.node;var D="";function G(t){return u.locateFile?u.locateFile(t,D):D+t}var Z;(N||V)&&(V?D=self.location.href:typeof document<"u"&&document.currentScript&&(D=document.currentScript.src),i&&(D=i),D.indexOf("blob:")!==0?D=D.substr(0,D.replace(/[?#].*/,"").lastIndexOf("/")+1):D="",V&&(Z=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)})),u.print||console.log.bind(console);var L=u.printErr||console.error.bind(console);Object.assign(u,$),$=null,u.arguments&&u.arguments,u.thisProgram&&(U=u.thisProgram),u.quit&&u.quit;var K;u.wasmBinary&&(K=u.wasmBinary),typeof WebAssembly!="object"&>("no native wasm support detected");var nt,mt=!1;function Vt(t,e){t||gt(e)}var Y,B,ct,yt,k,_,$e,be;function Ce(){var t=nt.buffer;u.HEAP8=Y=new Int8Array(t),u.HEAP16=ct=new Int16Array(t),u.HEAPU8=B=new Uint8Array(t),u.HEAPU16=yt=new Uint16Array(t),u.HEAP32=k=new Int32Array(t),u.HEAPU32=_=new Uint32Array(t),u.HEAPF32=$e=new Float32Array(t),u.HEAPF64=be=new Float64Array(t)}var _e=[],Te=[],Pe=[];function kr(){if(u.preRun)for(typeof u.preRun=="function"&&(u.preRun=[u.preRun]);u.preRun.length;)Ur(u.preRun.shift());Lt(_e)}function Hr(){Lt(Te)}function Br(){if(u.postRun)for(typeof u.postRun=="function"&&(u.postRun=[u.postRun]);u.postRun.length;)Lr(u.postRun.shift());Lt(Pe)}function Ur(t){_e.unshift(t)}function Vr(t){Te.unshift(t)}function Lr(t){Pe.unshift(t)}var at=0,vt=null;function Yr(t){at++,u.monitorRunDependencies&&u.monitorRunDependencies(at)}function zr(t){if(at--,u.monitorRunDependencies&&u.monitorRunDependencies(at),at==0&&vt){var e=vt;vt=null,e()}}function gt(t){u.onAbort&&u.onAbort(t),t="Aborted("+t+")",L(t),mt=!0,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw v(e),e}var Nr="data:application/octet-stream;base64,",Ee=t=>t.startsWith(Nr),lt;lt="zxing_reader.wasm",Ee(lt)||(lt=G(lt));function Ae(t){if(t==lt&&K)return new Uint8Array(K);if(Z)return Z(t);throw"both async and sync fetching of the wasm failed"}function Gr(t){return!K&&(N||V)&&typeof fetch=="function"?fetch(t,{credentials:"same-origin"}).then(e=>{if(!e.ok)throw"failed to load wasm binary file at '"+t+"'";return e.arrayBuffer()}).catch(()=>Ae(t)):Promise.resolve().then(()=>Ae(t))}function De(t,e,r){return Gr(t).then(n=>WebAssembly.instantiate(n,e)).then(n=>n).then(r,n=>{L(`failed to asynchronously prepare wasm: ${n}`),gt(n)})}function Xr(t,e,r,n){return!t&&typeof WebAssembly.instantiateStreaming=="function"&&!Ee(e)&&typeof fetch=="function"?fetch(e,{credentials:"same-origin"}).then(a=>{var o=WebAssembly.instantiateStreaming(a,r);return o.then(n,function(s){return L(`wasm streaming compile failed: ${s}`),L("falling back to ArrayBuffer instantiation"),De(e,r,n)})}):De(e,r,n)}function qr(){var t={a:Sa};function e(n,a){return E=n.exports,nt=E.fa,Ce(),Be=E.ja,Vr(E.ga),zr(),E}Yr();function r(n){e(n.instance)}if(u.instantiateWasm)try{return u.instantiateWasm(t,e)}catch(n){L(`Module.instantiateWasm callback failed with error: ${n}`),v(n)}return Xr(K,lt,t,r).catch(v),{}}var Lt=t=>{for(;t.length>0;)t.shift()(u)};u.noExitRuntime;var Et=[],At=0,Zr=t=>{var e=new Yt(t);return e.get_caught()||(e.set_caught(!0),At--),e.set_rethrown(!1),Et.push(e),rr(e.excPtr),e.get_exception_ptr()},tt=0,Jr=()=>{A(0,0);var t=Et.pop();er(t.excPtr),tt=0};function Yt(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(e){_[this.ptr+4>>2]=e},this.get_type=function(){return _[this.ptr+4>>2]},this.set_destructor=function(e){_[this.ptr+8>>2]=e},this.get_destructor=function(){return _[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,Y[this.ptr+12>>0]=e},this.get_caught=function(){return Y[this.ptr+12>>0]!=0},this.set_rethrown=function(e){e=e?1:0,Y[this.ptr+13>>0]=e},this.get_rethrown=function(){return Y[this.ptr+13>>0]!=0},this.init=function(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)},this.set_adjusted_ptr=function(e){_[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return _[this.ptr+16>>2]},this.get_exception_ptr=function(){var e=ar(this.get_type());if(e)return _[this.excPtr>>2];var r=this.get_adjusted_ptr();return r!==0?r:this.excPtr}}var Qr=t=>{throw tt||(tt=t),tt},zt=t=>{var e=tt;if(!e)return Tt(0),0;var r=new Yt(e);r.set_adjusted_ptr(e);var n=r.get_type();if(!n)return Tt(0),e;for(var a in t){var o=t[a];if(o===0||o===n)break;var s=r.ptr+16;if(nr(o,n,s))return Tt(o),e}return Tt(n),e},Kr=()=>zt([]),tn=t=>zt([t]),en=(t,e)=>zt([t,e]),rn=()=>{var t=Et.pop();t||gt("no exception to throw");var e=t.excPtr;throw t.get_rethrown()||(Et.push(t),t.set_rethrown(!0),t.set_caught(!1),At++),tt=e,tt},nn=(t,e,r)=>{var n=new Yt(t);throw n.init(e,r),tt=t,At++,tt},an=()=>At,Dt={},Oe=t=>{for(;t.length;){var e=t.pop(),r=t.pop();r(e)}};function Nt(t){return this.fromWireType(k[t>>2])}var dt={},ot={},Ot={},Se,St=t=>{throw new Se(t)},it=(t,e,r)=>{t.forEach(function(c){Ot[c]=e});function n(c){var l=r(c);l.length!==t.length&&St("Mismatched type converter count");for(var f=0;f<t.length;++f)J(t[f],l[f])}var a=new Array(e.length),o=[],s=0;e.forEach((c,l)=>{ot.hasOwnProperty(c)?a[l]=ot[c]:(o.push(c),dt.hasOwnProperty(c)||(dt[c]=[]),dt[c].push(()=>{a[l]=ot[c],++s,s===o.length&&n(a)}))}),o.length===0&&n(a)},on=t=>{var e=Dt[t];delete Dt[t];var r=e.rawConstructor,n=e.rawDestructor,a=e.fields,o=a.map(s=>s.getterReturnType).concat(a.map(s=>s.setterArgumentType));it([t],o,s=>{var c={};return a.forEach((l,f)=>{var p=l.fieldName,y=s[f],g=l.getter,b=l.getterContext,T=s[f+a.length],j=l.setter,P=l.setterContext;c[p]={read:R=>y.fromWireType(g(b,R)),write:(R,d)=>{var m=[];j(P,R,T.toWireType(m,d)),Oe(m)}}}),[{name:e.name,fromWireType:l=>{var f={};for(var p in c)f[p]=c[p].read(l);return n(l),f},toWireType:(l,f)=>{for(var p in c)if(!(p in f))throw new TypeError(`Missing field: "${p}"`);var y=r();for(p in c)c[p].write(y,f[p]);return l!==null&&l.push(n,y),y},argPackAdvance:Q,readValueFromPointer:Nt,destructorFunction:n}]})},sn=(t,e,r,n,a)=>{},un=()=>{for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);Fe=t},Fe,I=t=>{for(var e="",r=t;B[r];)e+=Fe[B[r++]];return e},ft,C=t=>{throw new ft(t)};function cn(t,e,r={}){var n=e.name;if(t||C(`type "${n}" must have a positive integer typeid pointer`),ot.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;C(`Cannot register type '${n}' twice`)}if(ot[t]=e,delete Ot[t],dt.hasOwnProperty(t)){var a=dt[t];delete dt[t],a.forEach(o=>o())}}function J(t,e,r={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");return cn(t,e,r)}var Q=8,ln=(t,e,r,n)=>{e=I(e),J(t,{name:e,fromWireType:function(a){return!!a},toWireType:function(a,o){return o?r:n},argPackAdvance:Q,readValueFromPointer:function(a){return this.fromWireType(B[a])},destructorFunction:null})},dn=t=>({count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType}),Gt=t=>{function e(r){return r.$$.ptrType.registeredClass.name}C(e(t)+" instance already deleted")},Xt=!1,xe=t=>{},fn=t=>{t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)},Me=t=>{t.count.value-=1;var e=t.count.value===0;e&&fn(t)},Ie=(t,e,r)=>{if(e===r)return t;if(r.baseClass===void 0)return null;var n=Ie(t,e,r.baseClass);return n===null?null:r.downcast(n)},je={},hn=()=>Object.keys(bt).length,pn=()=>{var t=[];for(var e in bt)bt.hasOwnProperty(e)&&t.push(bt[e]);return t},wt=[],qt=()=>{for(;wt.length;){var t=wt.pop();t.$$.deleteScheduled=!1,t.delete()}},$t,mn=t=>{$t=t,wt.length&&$t&&$t(qt)},yn=()=>{u.getInheritedInstanceCount=hn,u.getLiveInheritedInstances=pn,u.flushPendingDeletes=qt,u.setDelayFunction=mn},bt={},vn=(t,e)=>{for(e===void 0&&C("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e},gn=(t,e)=>(e=vn(t,e),bt[e]),Ft=(t,e)=>{(!e.ptrType||!e.ptr)&&St("makeClassHandle requires ptr and ptrType");var r=!!e.smartPtrType,n=!!e.smartPtr;return r!==n&&St("Both smartPtrType and smartPtr must be specified"),e.count={value:1},Ct(Object.create(t,{$$:{value:e}}))};function wn(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=gn(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?Ft(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:t}):Ft(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var o=this.registeredClass.getActualType(e),s=je[o];if(!s)return a.call(this);var c;this.isConst?c=s.constPointerType:c=s.pointerType;var l=Ie(e,this.registeredClass,c.registeredClass);return l===null?a.call(this):this.isSmartPointer?Ft(c.registeredClass.instancePrototype,{ptrType:c,ptr:l,smartPtrType:this,smartPtr:t}):Ft(c.registeredClass.instancePrototype,{ptrType:c,ptr:l})}var Ct=t=>typeof FinalizationRegistry>"u"?(Ct=e=>e,t):(Xt=new FinalizationRegistry(e=>{Me(e.$$)}),Ct=e=>{var r=e.$$,n=!!r.smartPtr;if(n){var a={$$:r};Xt.register(e,a,e)}return e},xe=e=>Xt.unregister(e),Ct(t)),$n=()=>{Object.assign(xt.prototype,{isAliasOf(t){if(!(this instanceof xt)||!(t instanceof xt))return!1;var e=this.$$.ptrType.registeredClass,r=this.$$.ptr;t.$$=t.$$;for(var n=t.$$.ptrType.registeredClass,a=t.$$.ptr;e.baseClass;)r=e.upcast(r),e=e.baseClass;for(;n.baseClass;)a=n.upcast(a),n=n.baseClass;return e===n&&r===a},clone(){if(this.$$.ptr||Gt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t=Ct(Object.create(Object.getPrototypeOf(this),{$$:{value:dn(this.$$)}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t},delete(){this.$$.ptr||Gt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&C("Object already scheduled for deletion"),xe(this),Me(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Gt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&C("Object already scheduled for deletion"),wt.push(this),wt.length===1&&$t&&$t(qt),this.$$.deleteScheduled=!0,this}})};function xt(){}var bn=48,Cn=57,Re=t=>{if(t===void 0)return"_unknown";t=t.replace(/[^a-zA-Z0-9_]/g,"$");var e=t.charCodeAt(0);return e>=bn&&e<=Cn?`_${t}`:t};function Zt(t,e){return t=Re(t),{[t]:function(){return e.apply(this,arguments)}}[t]}var We=(t,e,r)=>{if(t[e].overloadTable===void 0){var n=t[e];t[e]=function(){return t[e].overloadTable.hasOwnProperty(arguments.length)||C(`Function '${r}' called with an invalid number of arguments (${arguments.length}) - expects one of (${t[e].overloadTable})!`),t[e].overloadTable[arguments.length].apply(this,arguments)},t[e].overloadTable=[],t[e].overloadTable[n.argCount]=n}},Jt=(t,e,r)=>{u.hasOwnProperty(t)?((r===void 0||u[t].overloadTable!==void 0&&u[t].overloadTable[r]!==void 0)&&C(`Cannot register public name '${t}' twice`),We(u,t,t),u.hasOwnProperty(r)&&C(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),u[t].overloadTable[r]=e):(u[t]=e,r!==void 0&&(u[t].numArguments=r))};function _n(t,e,r,n,a,o,s,c){this.name=t,this.constructor=e,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=o,this.upcast=s,this.downcast=c,this.pureVirtualFunctions=[]}var Qt=(t,e,r)=>{for(;e!==r;)e.upcast||C(`Expected null or instance of ${r.name}, got an instance of ${e.name}`),t=e.upcast(t),e=e.baseClass;return t};function Tn(t,e){if(e===null)return this.isReference&&C(`null is not a valid ${this.name}`),0;e.$$||C(`Cannot pass "${re(e)}" as a ${this.name}`),e.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=e.$$.ptrType.registeredClass,n=Qt(e.$$.ptr,r,this.registeredClass);return n}function Pn(t,e){var r;if(e===null)return this.isReference&&C(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),t!==null&&t.push(this.rawDestructor,r),r):0;e.$$||C(`Cannot pass "${re(e)}" as a ${this.name}`),e.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&e.$$.ptrType.isConst&&C(`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=Qt(e.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(e.$$.smartPtr===void 0&&C("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:e.$$.smartPtrType===this?r=e.$$.smartPtr:C(`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,rt.toHandle(()=>a.delete())),t!==null&&t.push(this.rawDestructor,r)}break;default:C("Unsupporting sharing policy")}return r}function En(t,e){if(e===null)return this.isReference&&C(`null is not a valid ${this.name}`),0;e.$$||C(`Cannot pass "${re(e)}" as a ${this.name}`),e.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`),e.$$.ptrType.isConst&&C(`Cannot convert argument of type ${e.$$.ptrType.name} to parameter type ${this.name}`);var r=e.$$.ptrType.registeredClass,n=Qt(e.$$.ptr,r,this.registeredClass);return n}function ke(t){return this.fromWireType(_[t>>2])}var An=()=>{Object.assign(Mt.prototype,{getPointee(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t},destructor(t){this.rawDestructor&&this.rawDestructor(t)},argPackAdvance:Q,readValueFromPointer:ke,deleteObject(t){t!==null&&t.delete()},fromWireType:wn})};function Mt(t,e,r,n,a,o,s,c,l,f,p){this.name=t,this.registeredClass=e,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=o,this.sharingPolicy=s,this.rawGetPointee=c,this.rawConstructor=l,this.rawShare=f,this.rawDestructor=p,!a&&e.baseClass===void 0?n?(this.toWireType=Tn,this.destructorFunction=null):(this.toWireType=En,this.destructorFunction=null):this.toWireType=Pn}var He=(t,e,r)=>{u.hasOwnProperty(t)||St("Replacing nonexistant public symbol"),u[t].overloadTable!==void 0&&r!==void 0?u[t].overloadTable[r]=e:(u[t]=e,u[t].argCount=r)},Dn=(t,e,r)=>{var n=u["dynCall_"+t];return r&&r.length?n.apply(null,[e].concat(r)):n.call(null,e)},It=[],Be,O=t=>{var e=It[t];return e||(t>=It.length&&(It.length=t+1),It[t]=e=Be.get(t)),e},On=(t,e,r)=>{if(t.includes("j"))return Dn(t,e,r);var n=O(e).apply(null,r);return n},Sn=(t,e)=>{var r=[];return function(){return r.length=0,Object.assign(r,arguments),On(t,e,r)}},q=(t,e)=>{t=I(t);function r(){return t.includes("j")?Sn(t,e):O(e)}var n=r();return typeof n!="function"&&C(`unknown function pointer with signature ${t}: ${e}`),n},Fn=(t,e)=>{var r=Zt(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},Ue,Ve=t=>{var e=tr(t),r=I(e);return et(e),r},jt=(t,e)=>{var r=[],n={};function a(o){if(!n[o]&&!ot[o]){if(Ot[o]){Ot[o].forEach(a);return}r.push(o),n[o]=!0}}throw e.forEach(a),new Ue(`${t}: `+r.map(Ve).join([", "]))},xn=(t,e,r,n,a,o,s,c,l,f,p,y,g)=>{p=I(p),o=q(a,o),c&&(c=q(s,c)),f&&(f=q(l,f)),g=q(y,g);var b=Re(p);Jt(b,function(){jt(`Cannot construct ${p} due to unbound types`,[n])}),it([t,e,r],n?[n]:[],function(T){T=T[0];var j,P;n?(j=T.registeredClass,P=j.instancePrototype):P=xt.prototype;var R=Zt(b,function(){if(Object.getPrototypeOf(this)!==d)throw new ft("Use 'new' to construct "+p);if(m.constructor_body===void 0)throw new ft(p+" has no accessible constructor");var kt=m.constructor_body[arguments.length];if(kt===void 0)throw new ft(`Tried to invoke ctor of ${p} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(m.constructor_body).toString()}) parameters instead!`);return kt.apply(this,arguments)}),d=Object.create(P,{constructor:{value:R}});R.prototype=d;var m=new _n(p,R,d,g,j,o,c,f);m.baseClass&&(m.baseClass.__derivedClasses===void 0&&(m.baseClass.__derivedClasses=[]),m.baseClass.__derivedClasses.push(m));var x=new Mt(p,m,!0,!1,!1),M=new Mt(p+"*",m,!1,!1,!1),st=new Mt(p+" const*",m,!1,!0,!1);return je[t]={pointerType:M,constPointerType:st},He(b,R),[x,M,st]})},Kt=(t,e)=>{for(var r=[],n=0;n<t;n++)r.push(_[e+n*4>>2]);return r};function te(t,e,r,n,a,o){var s=e.length;s<2&&C("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var c=e[1]!==null&&r!==null,l=!1,f=1;f<e.length;++f)if(e[f]!==null&&e[f].destructorFunction===void 0){l=!0;break}var p=e[0].name!=="void",y=s-2,g=new Array(y),b=[],T=[];return function(){arguments.length!==y&&C(`function ${t} called with ${arguments.length} arguments, expected ${y}`),T.length=0;var j;b.length=c?2:1,b[0]=a,c&&(j=e[1].toWireType(T,this),b[1]=j);for(var P=0;P<y;++P)g[P]=e[P+2].toWireType(T,arguments[P]),b.push(g[P]);var R=n.apply(null,b);function d(m){if(l)Oe(T);else for(var x=c?1:2;x<e.length;x++){var M=x===1?j:g[x-2];e[x].destructorFunction!==null&&e[x].destructorFunction(M)}if(p)return e[0].fromWireType(m)}return d(R)}}var Mn=(t,e,r,n,a,o)=>{var s=Kt(e,r);a=q(n,a),it([],[t],function(c){c=c[0];var l=`constructor ${c.name}`;if(c.registeredClass.constructor_body===void 0&&(c.registeredClass.constructor_body=[]),c.registeredClass.constructor_body[e-1]!==void 0)throw new ft(`Cannot register multiple constructors with identical number of parameters (${e-1}) for class '${c.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return c.registeredClass.constructor_body[e-1]=()=>{jt(`Cannot construct ${c.name} due to unbound types`,s)},it([],s,f=>(f.splice(1,0,null),c.registeredClass.constructor_body[e-1]=te(l,f,null,a,o),[])),[]})},Le=t=>{t=t.trim();const e=t.indexOf("(");return e!==-1?(Vt(t[t.length-1]==")","Parentheses for argument names should match."),t.substr(0,e)):t},In=(t,e,r,n,a,o,s,c,l)=>{var f=Kt(r,n);e=I(e),e=Le(e),o=q(a,o),it([],[t],function(p){p=p[0];var y=`${p.name}.${e}`;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),c&&p.registeredClass.pureVirtualFunctions.push(e);function g(){jt(`Cannot call ${y} due to unbound types`,f)}var b=p.registeredClass.instancePrototype,T=b[e];return T===void 0||T.overloadTable===void 0&&T.className!==p.name&&T.argCount===r-2?(g.argCount=r-2,g.className=p.name,b[e]=g):(We(b,e,y),b[e].overloadTable[r-2]=g),it([],f,function(j){var P=te(y,j,p,o,s);return b[e].overloadTable===void 0?(P.argCount=r-2,b[e]=P):b[e].overloadTable[r-2]=P,[]}),[]})};function jn(){Object.assign(Ye.prototype,{get(t){return this.allocated[t]},has(t){return this.allocated[t]!==void 0},allocate(t){var e=this.freelist.pop()||this.allocated.length;return this.allocated[e]=t,e},free(t){this.allocated[t]=void 0,this.freelist.push(t)}})}function Ye(){this.allocated=[void 0],this.freelist=[]}var X=new Ye,ze=t=>{t>=X.reserved&&--X.get(t).refcount===0&&X.free(t)},Rn=()=>{for(var t=0,e=X.reserved;e<X.allocated.length;++e)X.allocated[e]!==void 0&&++t;return t},Wn=()=>{X.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),X.reserved=X.allocated.length,u.count_emval_handles=Rn},rt={toValue:t=>(t||C("Cannot use deleted val. handle = "+t),X.get(t).value),toHandle:t=>{switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return X.allocate({refcount:1,value:t})}}},kn=(t,e)=>{e=I(e),J(t,{name:e,fromWireType:r=>{var n=rt.toValue(r);return ze(r),n},toWireType:(r,n)=>rt.toHandle(n),argPackAdvance:Q,readValueFromPointer:Nt,destructorFunction:null})},Hn=(t,e,r)=>{switch(e){case 1:return r?function(n){return this.fromWireType(Y[n>>0])}:function(n){return this.fromWireType(B[n>>0])};case 2:return r?function(n){return this.fromWireType(ct[n>>1])}:function(n){return this.fromWireType(yt[n>>1])};case 4:return r?function(n){return this.fromWireType(k[n>>2])}:function(n){return this.fromWireType(_[n>>2])};default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},Bn=(t,e,r,n)=>{e=I(e);function a(){}a.values={},J(t,{name:e,constructor:a,fromWireType:function(o){return this.constructor.values[o]},toWireType:(o,s)=>s.value,argPackAdvance:Q,readValueFromPointer:Hn(e,r,n),destructorFunction:null}),Jt(e,a)},ee=(t,e)=>{var r=ot[t];return r===void 0&&C(e+" has unknown type "+Ve(t)),r},Un=(t,e,r)=>{var n=ee(t,"enum");e=I(e);var a=n.constructor,o=Object.create(n.constructor.prototype,{value:{value:r},constructor:{value:Zt(`${n.name}_${e}`,function(){})}});a.values[r]=o,a[e]=o},re=t=>{if(t===null)return"null";var e=typeof t;return e==="object"||e==="array"||e==="function"?t.toString():""+t},Vn=(t,e)=>{switch(e){case 4:return function(r){return this.fromWireType($e[r>>2])};case 8:return function(r){return this.fromWireType(be[r>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},Ln=(t,e,r)=>{e=I(e),J(t,{name:e,fromWireType:n=>n,toWireType:(n,a)=>a,argPackAdvance:Q,readValueFromPointer:Vn(e,r),destructorFunction:null})},Yn=(t,e,r,n,a,o,s)=>{var c=Kt(e,r);t=I(t),t=Le(t),a=q(n,a),Jt(t,function(){jt(`Cannot call ${t} due to unbound types`,c)},e-1),it([],c,function(l){var f=[l[0],null].concat(l.slice(1));return He(t,te(t,f,null,a,o),e-1),[]})},zn=(t,e,r)=>{switch(e){case 1:return r?n=>Y[n>>0]:n=>B[n>>0];case 2:return r?n=>ct[n>>1]:n=>yt[n>>1];case 4:return r?n=>k[n>>2]:n=>_[n>>2];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},Nn=(t,e,r,n,a)=>{e=I(e);var o=p=>p;if(n===0){var s=32-8*r;o=p=>p<<s>>>s}var c=e.includes("unsigned"),l=(p,y)=>{},f;c?f=function(p,y){return l(y,this.name),y>>>0}:f=function(p,y){return l(y,this.name),y},J(t,{name:e,fromWireType:o,toWireType:f,argPackAdvance:Q,readValueFromPointer:zn(e,r,n!==0),destructorFunction:null})},Gn=(t,e,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[e];function o(s){var c=_[s>>2],l=_[s+4>>2];return new a(Y.buffer,l,c)}r=I(r),J(t,{name:r,fromWireType:o,argPackAdvance:Q,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Ne=(t,e,r,n)=>{if(!(n>0))return 0;for(var a=r,o=r+n-1,s=0;s<t.length;++s){var c=t.charCodeAt(s);if(c>=55296&&c<=57343){var l=t.charCodeAt(++s);c=65536+((c&1023)<<10)|l&1023}if(c<=127){if(r>=o)break;e[r++]=c}else if(c<=2047){if(r+1>=o)break;e[r++]=192|c>>6,e[r++]=128|c&63}else if(c<=65535){if(r+2>=o)break;e[r++]=224|c>>12,e[r++]=128|c>>6&63,e[r++]=128|c&63}else{if(r+3>=o)break;e[r++]=240|c>>18,e[r++]=128|c>>12&63,e[r++]=128|c>>6&63,e[r++]=128|c&63}}return e[r]=0,r-a},Xn=(t,e,r)=>Ne(t,B,e,r),Ge=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},Xe=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,qn=(t,e,r)=>{for(var n=e+r,a=e;t[a]&&!(a>=n);)++a;if(a-e>16&&t.buffer&&Xe)return Xe.decode(t.subarray(e,a));for(var o="";e<a;){var s=t[e++];if(!(s&128)){o+=String.fromCharCode(s);continue}var c=t[e++]&63;if((s&224)==192){o+=String.fromCharCode((s&31)<<6|c);continue}var l=t[e++]&63;if((s&240)==224?s=(s&15)<<12|c<<6|l:s=(s&7)<<18|c<<12|l<<6|t[e++]&63,s<65536)o+=String.fromCharCode(s);else{var f=s-65536;o+=String.fromCharCode(55296|f>>10,56320|f&1023)}}return o},ne=(t,e)=>t?qn(B,t,e):"",Zn=(t,e)=>{e=I(e);var r=e==="std::string";J(t,{name:e,fromWireType(n){var a=_[n>>2],o=n+4,s;if(r)for(var c=o,l=0;l<=a;++l){var f=o+l;if(l==a||B[f]==0){var p=f-c,y=ne(c,p);s===void 0?s=y:(s+=String.fromCharCode(0),s+=y),c=f+1}}else{for(var g=new Array(a),l=0;l<a;++l)g[l]=String.fromCharCode(B[o+l]);s=g.join("")}return et(n),s},toWireType(n,a){a instanceof ArrayBuffer&&(a=new Uint8Array(a));var o,s=typeof a=="string";s||a instanceof Uint8Array||a instanceof Uint8ClampedArray||a instanceof Int8Array||C("Cannot pass non-string to std::string"),r&&s?o=Ge(a):o=a.length;var c=oe(4+o+1),l=c+4;if(_[c>>2]=o,r&&s)Xn(a,l,o+1);else if(s)for(var f=0;f<o;++f){var p=a.charCodeAt(f);p>255&&(et(l),C("String has UTF-16 code units that do not fit in 8 bits")),B[l+f]=p}else for(var f=0;f<o;++f)B[l+f]=a[f];return n!==null&&n.push(et,c),c},argPackAdvance:Q,readValueFromPointer:ke,destructorFunction(n){et(n)}})},qe=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,Jn=(t,e)=>{for(var r=t,n=r>>1,a=n+e/2;!(n>=a)&&yt[n];)++n;if(r=n<<1,r-t>32&&qe)return qe.decode(B.subarray(t,r));for(var o="",s=0;!(s>=e/2);++s){var c=ct[t+s*2>>1];if(c==0)break;o+=String.fromCharCode(c)}return o},Qn=(t,e,r)=>{if(r===void 0&&(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);ct[e>>1]=s,e+=2}return ct[e>>1]=0,e-n},Kn=t=>t.length*2,ta=(t,e)=>{for(var r=0,n="";!(r>=e/4);){var a=k[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},ea=(t,e,r)=>{if(r===void 0&&(r=2147483647),r<4)return 0;for(var n=e,a=n+r-4,o=0;o<t.length;++o){var s=t.charCodeAt(o);if(s>=55296&&s<=57343){var c=t.charCodeAt(++o);s=65536+((s&1023)<<10)|c&1023}if(k[e>>2]=s,e+=4,e+4>a)break}return k[e>>2]=0,e-n},ra=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},na=(t,e,r)=>{r=I(r);var n,a,o,s,c;e===2?(n=Jn,a=Qn,s=Kn,o=()=>yt,c=1):e===4&&(n=ta,a=ea,s=ra,o=()=>_,c=2),J(t,{name:r,fromWireType:l=>{for(var f=_[l>>2],p=o(),y,g=l+4,b=0;b<=f;++b){var T=l+4+b*e;if(b==f||p[T>>c]==0){var j=T-g,P=n(g,j);y===void 0?y=P:(y+=String.fromCharCode(0),y+=P),g=T+e}}return et(l),y},toWireType:(l,f)=>{typeof f!="string"&&C(`Cannot pass non-string to C++ string type ${r}`);var p=s(f),y=oe(4+p+e);return _[y>>2]=p>>c,a(f,y+4,p+e),l!==null&&l.push(et,y),y},argPackAdvance:Q,readValueFromPointer:Nt,destructorFunction(l){et(l)}})},aa=(t,e,r,n,a,o)=>{Dt[t]={name:I(e),rawConstructor:q(r,n),rawDestructor:q(a,o),fields:[]}},oa=(t,e,r,n,a,o,s,c,l,f)=>{Dt[t].fields.push({fieldName:I(e),getterReturnType:r,getter:q(n,a),getterContext:o,setterArgumentType:s,setter:q(c,l),setterContext:f})},ia=(t,e)=>{e=I(e),J(t,{isVoid:!0,name:e,argPackAdvance:0,fromWireType:()=>{},toWireType:(r,n)=>{}})},sa={},ua=t=>{var e=sa[t];return e===void 0?I(t):e},Ze=()=>{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.")},ca=t=>t===0?rt.toHandle(Ze()):(t=ua(t),rt.toHandle(Ze()[t])),la=t=>{t>4&&(X.get(t).refcount+=1)},da=t=>{var e=new Array(t+1);return function(r,n,a){e[0]=r;for(var o=0;o<t;++o){var s=ee(_[n+o*4>>2],"parameter "+o);e[o+1]=s.readValueFromPointer(a),a+=s.argPackAdvance}var c=new(r.bind.apply(r,e));return rt.toHandle(c)}},Je={},fa=(t,e,r,n)=>{t=rt.toValue(t);var a=Je[e];return a||(a=da(e),Je[e]=a),a(t,r,n)},ha=(t,e)=>{t=ee(t,"_emval_take_value");var r=t.readValueFromPointer(e);return rt.toHandle(r)},pa=()=>{gt("")},ma=(t,e,r)=>B.copyWithin(t,e,e+r),ya=()=>2147483648,va=t=>{var e=nt.buffer,r=(t-e.byteLength+65535)/65536;try{return nt.grow(r),Ce(),1}catch{}},ga=t=>{var e=B.length;t>>>=0;var r=ya();if(t>r)return!1;for(var n=(l,f)=>l+(f-l%f)%f,a=1;a<=4;a*=2){var o=e*(1+.2/a);o=Math.min(o,t+100663296);var s=Math.min(r,n(Math.max(t,o),65536)),c=va(s);if(c)return!0}return!1},ae={},wa=()=>U||"./this.program",_t=()=>{if(!_t.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,_:wa()};for(var r in ae)ae[r]===void 0?delete e[r]:e[r]=ae[r];var n=[];for(var r in e)n.push(`${r}=${e[r]}`);_t.strings=n}return _t.strings},$a=(t,e)=>{for(var r=0;r<t.length;++r)Y[e++>>0]=t.charCodeAt(r);Y[e>>0]=0},ba=(t,e)=>{var r=0;return _t().forEach((n,a)=>{var o=e+r;_[t+a*4>>2]=o,$a(n,o),r+=n.length+1}),0},Ca=(t,e)=>{var r=_t();_[t>>2]=r.length;var n=0;return r.forEach(a=>n+=a.length+1),_[e>>2]=n,0},_a=t=>t,Rt=t=>t%4===0&&(t%100!==0||t%400===0),Ta=(t,e)=>{for(var r=0,n=0;n<=e;r+=t[n++]);return r},Qe=[31,29,31,30,31,30,31,31,30,31,30,31],Ke=[31,28,31,30,31,30,31,31,30,31,30,31],Pa=(t,e)=>{for(var r=new Date(t.getTime());e>0;){var n=Rt(r.getFullYear()),a=r.getMonth(),o=(n?Qe:Ke)[a];if(e>o-r.getDate())e-=o-r.getDate()+1,r.setDate(1),a<11?r.setMonth(a+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1));else return r.setDate(r.getDate()+e),r}return r};function Ea(t,e,r){var n=r>0?r:Ge(t)+1,a=new Array(n),o=Ne(t,a,0,a.length);return e&&(a.length=o),a}var Aa=(t,e)=>{Y.set(t,e)},Da=(t,e,r,n)=>{var a=_[n+40>>2],o={tm_sec:k[n>>2],tm_min:k[n+4>>2],tm_hour:k[n+8>>2],tm_mday:k[n+12>>2],tm_mon:k[n+16>>2],tm_year:k[n+20>>2],tm_wday:k[n+24>>2],tm_yday:k[n+28>>2],tm_isdst:k[n+32>>2],tm_gmtoff:k[n+36>>2],tm_zone:a?ne(a):""},s=ne(r),c={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var l in c)s=s.replace(new RegExp(l,"g"),c[l]);var f=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],p=["January","February","March","April","May","June","July","August","September","October","November","December"];function y(d,m,x){for(var M=typeof d=="number"?d.toString():d||"";M.length<m;)M=x[0]+M;return M}function g(d,m){return y(d,m,"0")}function b(d,m){function x(st){return st<0?-1:st>0?1:0}var M;return(M=x(d.getFullYear()-m.getFullYear()))===0&&(M=x(d.getMonth()-m.getMonth()))===0&&(M=x(d.getDate()-m.getDate())),M}function T(d){switch(d.getDay()){case 0:return new Date(d.getFullYear()-1,11,29);case 1:return d;case 2:return new Date(d.getFullYear(),0,3);case 3:return new Date(d.getFullYear(),0,2);case 4:return new Date(d.getFullYear(),0,1);case 5:return new Date(d.getFullYear()-1,11,31);case 6:return new Date(d.getFullYear()-1,11,30)}}function j(d){var m=Pa(new Date(d.tm_year+1900,0,1),d.tm_yday),x=new Date(m.getFullYear(),0,4),M=new Date(m.getFullYear()+1,0,4),st=T(x),kt=T(M);return b(st,m)<=0?b(kt,m)<=0?m.getFullYear()+1:m.getFullYear():m.getFullYear()-1}var P={"%a":d=>f[d.tm_wday].substring(0,3),"%A":d=>f[d.tm_wday],"%b":d=>p[d.tm_mon].substring(0,3),"%B":d=>p[d.tm_mon],"%C":d=>{var m=d.tm_year+1900;return g(m/100|0,2)},"%d":d=>g(d.tm_mday,2),"%e":d=>y(d.tm_mday,2," "),"%g":d=>j(d).toString().substring(2),"%G":d=>j(d),"%H":d=>g(d.tm_hour,2),"%I":d=>{var m=d.tm_hour;return m==0?m=12:m>12&&(m-=12),g(m,2)},"%j":d=>g(d.tm_mday+Ta(Rt(d.tm_year+1900)?Qe:Ke,d.tm_mon-1),3),"%m":d=>g(d.tm_mon+1,2),"%M":d=>g(d.tm_min,2),"%n":()=>`
|
|
3
|
+
`,"%p":d=>d.tm_hour>=0&&d.tm_hour<12?"AM":"PM","%S":d=>g(d.tm_sec,2),"%t":()=>" ","%u":d=>d.tm_wday||7,"%U":d=>{var m=d.tm_yday+7-d.tm_wday;return g(Math.floor(m/7),2)},"%V":d=>{var m=Math.floor((d.tm_yday+7-(d.tm_wday+6)%7)/7);if((d.tm_wday+371-d.tm_yday-2)%7<=2&&m++,m){if(m==53){var x=(d.tm_wday+371-d.tm_yday)%7;x!=4&&(x!=3||!Rt(d.tm_year))&&(m=1)}}else{m=52;var M=(d.tm_wday+7-d.tm_yday-1)%7;(M==4||M==5&&Rt(d.tm_year%400-1))&&m++}return g(m,2)},"%w":d=>d.tm_wday,"%W":d=>{var m=d.tm_yday+7-(d.tm_wday+6)%7;return g(Math.floor(m/7),2)},"%y":d=>(d.tm_year+1900).toString().substring(2),"%Y":d=>d.tm_year+1900,"%z":d=>{var m=d.tm_gmtoff,x=m>=0;return m=Math.abs(m)/60,m=m/60*100+m%60,(x?"+":"-")+("0000"+m).slice(-4)},"%Z":d=>d.tm_zone,"%%":()=>"%"};s=s.replace(/%%/g,"\0\0");for(var l in P)s.includes(l)&&(s=s.replace(new RegExp(l,"g"),P[l](o)));s=s.replace(/\0\0/g,"%");var R=Ea(s,!1);return R.length>e?0:(Aa(R,t),R.length-1)},Oa=(t,e,r,n,a)=>Da(t,e,r,n);Se=u.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError"}},un(),ft=u.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},$n(),yn(),An(),Ue=u.UnboundTypeError=Fn(Error,"UnboundTypeError"),jn(),Wn();var Sa={s:Zr,v:Jr,b:Kr,g:tn,q:en,I:rn,f:nn,T:an,d:Qr,ba:on,P:sn,Y:ln,aa:xn,$:Mn,w:In,X:kn,x:Bn,h:Un,K:Ln,L:Yn,t:Nn,n:Gn,J:Zn,C:na,A:aa,ca:oa,Z:ia,ea:ze,da:ca,M:la,V:fa,_:ha,B:pa,W:ma,U:ga,R:ba,S:Ca,D:za,E:Ya,m:Na,a:Fa,e:ja,o:ka,k:Ia,G:Va,u:Ba,F:La,z:Xa,O:Za,l:Ra,j:Wa,c:Ma,p:xa,H:Ua,r:Ga,i:Ha,y:qa,N:_a,Q:Oa},E=qr(),et=u._free=t=>(et=u._free=E.ha)(t),oe=u._malloc=t=>(oe=u._malloc=E.ia)(t),tr=t=>(tr=E.ka)(t);u.__embind_initialize_bindings=()=>(u.__embind_initialize_bindings=E.la)();var A=(t,e)=>(A=E.ma)(t,e),Tt=t=>(Tt=E.na)(t),S=()=>(S=E.oa)(),F=t=>(F=E.pa)(t),er=t=>(er=E.qa)(t),rr=t=>(rr=E.ra)(t),nr=(t,e,r)=>(nr=E.sa)(t,e,r),ar=t=>(ar=E.ta)(t);u.dynCall_viijii=(t,e,r,n,a,o,s)=>(u.dynCall_viijii=E.ua)(t,e,r,n,a,o,s);var or=u.dynCall_jiiii=(t,e,r,n,a)=>(or=u.dynCall_jiiii=E.va)(t,e,r,n,a);u.dynCall_iiiiij=(t,e,r,n,a,o,s)=>(u.dynCall_iiiiij=E.wa)(t,e,r,n,a,o,s),u.dynCall_iiiiijj=(t,e,r,n,a,o,s,c,l)=>(u.dynCall_iiiiijj=E.xa)(t,e,r,n,a,o,s,c,l),u.dynCall_iiiiiijj=(t,e,r,n,a,o,s,c,l,f)=>(u.dynCall_iiiiiijj=E.ya)(t,e,r,n,a,o,s,c,l,f);function Fa(t,e){var r=S();try{return O(t)(e)}catch(n){if(F(r),n!==n+0)throw n;A(1,0)}}function xa(t,e,r,n){var a=S();try{O(t)(e,r,n)}catch(o){if(F(a),o!==o+0)throw o;A(1,0)}}function Ma(t,e,r){var n=S();try{O(t)(e,r)}catch(a){if(F(n),a!==a+0)throw a;A(1,0)}}function Ia(t,e,r,n,a){var o=S();try{return O(t)(e,r,n,a)}catch(s){if(F(o),s!==s+0)throw s;A(1,0)}}function ja(t,e,r){var n=S();try{return O(t)(e,r)}catch(a){if(F(n),a!==a+0)throw a;A(1,0)}}function Ra(t){var e=S();try{O(t)()}catch(r){if(F(e),r!==r+0)throw r;A(1,0)}}function Wa(t,e){var r=S();try{O(t)(e)}catch(n){if(F(r),n!==n+0)throw n;A(1,0)}}function ka(t,e,r,n){var a=S();try{return O(t)(e,r,n)}catch(o){if(F(a),o!==o+0)throw o;A(1,0)}}function Ha(t,e,r,n,a,o,s,c,l,f,p){var y=S();try{O(t)(e,r,n,a,o,s,c,l,f,p)}catch(g){if(F(y),g!==g+0)throw g;A(1,0)}}function Ba(t,e,r,n,a,o,s){var c=S();try{return O(t)(e,r,n,a,o,s)}catch(l){if(F(c),l!==l+0)throw l;A(1,0)}}function Ua(t,e,r,n,a){var o=S();try{O(t)(e,r,n,a)}catch(s){if(F(o),s!==s+0)throw s;A(1,0)}}function Va(t,e,r,n,a,o){var s=S();try{return O(t)(e,r,n,a,o)}catch(c){if(F(s),c!==c+0)throw c;A(1,0)}}function La(t,e,r,n,a,o,s,c){var l=S();try{return O(t)(e,r,n,a,o,s,c)}catch(f){if(F(l),f!==f+0)throw f;A(1,0)}}function Ya(t,e,r,n){var a=S();try{return O(t)(e,r,n)}catch(o){if(F(a),o!==o+0)throw o;A(1,0)}}function za(t,e,r,n){var a=S();try{return O(t)(e,r,n)}catch(o){if(F(a),o!==o+0)throw o;A(1,0)}}function Na(t){var e=S();try{return O(t)()}catch(r){if(F(e),r!==r+0)throw r;A(1,0)}}function Ga(t,e,r,n,a,o,s,c){var l=S();try{O(t)(e,r,n,a,o,s,c)}catch(f){if(F(l),f!==f+0)throw f;A(1,0)}}function Xa(t,e,r,n,a,o,s,c,l,f,p,y){var g=S();try{return O(t)(e,r,n,a,o,s,c,l,f,p,y)}catch(b){if(F(g),b!==b+0)throw b;A(1,0)}}function qa(t,e,r,n,a,o,s,c,l,f,p,y,g,b,T,j){var P=S();try{O(t)(e,r,n,a,o,s,c,l,f,p,y,g,b,T,j)}catch(R){if(F(P),R!==R+0)throw R;A(1,0)}}function Za(t,e,r,n,a){var o=S();try{return or(t,e,r,n,a)}catch(s){if(F(o),s!==s+0)throw s;A(1,0)}}var Wt;vt=function t(){Wt||ir(),Wt||(vt=t)};function ir(){if(at>0||(kr(),at>0))return;function t(){Wt||(Wt=!0,u.calledRun=!0,!mt&&(Hr(),w(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),Br()))}u.setStatus?(u.setStatus("Running..."),setTimeout(function(){setTimeout(function(){u.setStatus("")},1),t()},1)):t()}if(u.preInit)for(typeof u.preInit=="function"&&(u.preInit=[u.preInit]);u.preInit.length>0;)u.preInit.pop()();return ir(),h.ready}})();function xr(i){return Bt(Pt,i)}function Mr(i){return Or(Pt,i)}async function Ir(i,h){return Sr(Pt,i,h)}async function jr(i,h){return Fr(Pt,i,h)}const Ut=new Map([["aztec","Aztec"],["code_128","Code128"],["code_39","Code39"],["code_93","Code93"],["codabar","Codabar"],["data_matrix","DataMatrix"],["ean_13","EAN-13"],["ean_8","EAN-8"],["itf","ITF"],["pdf417","PDF417"],["qr_code","QRCode"],["upc_a","UPC-A"],["upc_e","UPC-E"]]);function Rr(i){for(const[h,u]of Ut)if(i===u)return h;return"unknown"}class Wr extends EventTarget{constructor(u={}){var w;super();ur(this,ut,void 0);try{const v=(w=u==null?void 0:u.formats)==null?void 0:w.filter($=>$!=="unknown");if((v==null?void 0:v.length)===0)throw new TypeError("Hint option provided, but is empty.");v==null||v.forEach($=>{if(!H.includes($))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${$}' is not a valid enum value of type BarcodeFormat.`)}),cr(this,ut,v??[]),xr().then($=>{this.dispatchEvent(new CustomEvent("load",{detail:$}))}).catch($=>{this.dispatchEvent(new CustomEvent("error",{detail:$}))})}catch(v){throw me(v,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return H.filter(u=>u!=="unknown")}async detect(u){try{const w=await pr(u);if(w===null)return[];let v;try{he(w)?v=await Ir(w,{tryHarder:!0,formats:ie(this,ut).map($=>Ut.get($))}):v=await jr(w,{tryHarder:!0,formats:ie(this,ut).map($=>Ut.get($))})}catch($){throw console.error($),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return v.map($=>{const{topLeft:{x:U,y:N},topRight:{x:V,y:D},bottomLeft:{x:G,y:Z},bottomRight:{x:L,y:K}}=$.position,nt=Math.min(U,V,G,L),mt=Math.min(N,D,Z,K),Vt=Math.max(U,V,G,L),Y=Math.max(N,D,Z,K);return{boundingBox:new DOMRectReadOnly(nt,mt,Vt-nt,Y-mt),rawValue:$.text,format:Rr($.format),cornerPoints:[{x:U,y:N},{x:V,y:D},{x:L,y:K},{x:G,y:Z}]}})}catch(w){throw me(w,"Failed to execute 'detect' on 'BarcodeDetector'")}}}return ut=new WeakMap,globalThis.BarcodeDetector??(globalThis.BarcodeDetector=Wr),W.setZXingModuleOverrides=Mr,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"}),W}({});
|
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": "2.1.
|
|
5
|
+
"version": "2.1.2",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
8
|
"./dist"
|
|
@@ -77,8 +77,8 @@
|
|
|
77
77
|
"bump-zxing-wasm": "npm i zxing-wasm@latest --save-exact"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
81
|
-
"@typescript-eslint/parser": "^6.
|
|
80
|
+
"@typescript-eslint/eslint-plugin": "^6.11.0",
|
|
81
|
+
"@typescript-eslint/parser": "^6.11.0",
|
|
82
82
|
"@vitest/browser": "^0.34.6",
|
|
83
83
|
"@vitest/coverage-istanbul": "^0.34.6",
|
|
84
84
|
"@vitest/ui": "^0.34.6",
|
|
@@ -86,16 +86,16 @@
|
|
|
86
86
|
"http-server": "^14.1.1",
|
|
87
87
|
"npm-check-updates": "^16.14.6",
|
|
88
88
|
"playwright": "^1.39.0",
|
|
89
|
-
"prettier": "^3.0
|
|
89
|
+
"prettier": "^3.1.0",
|
|
90
90
|
"rimraf": "^5.0.5",
|
|
91
91
|
"start-server-and-test": "^2.0.2",
|
|
92
|
-
"tsx": "^
|
|
92
|
+
"tsx": "^4.1.2",
|
|
93
93
|
"typescript": "^5.2.2",
|
|
94
94
|
"vite": "^4.5.0",
|
|
95
95
|
"vitest": "^0.34.6"
|
|
96
96
|
},
|
|
97
97
|
"dependencies": {
|
|
98
|
-
"@types/dom-webcodecs": "^0.1.
|
|
99
|
-
"zxing-wasm": "1.0.0-rc.
|
|
98
|
+
"@types/dom-webcodecs": "^0.1.10",
|
|
99
|
+
"zxing-wasm": "1.0.0-rc.6"
|
|
100
100
|
}
|
|
101
101
|
}
|