onnxruntime-web
Version:
A Javascript library for running ONNX models on browsers
11 lines • 405 kB
JavaScript
/*!
* ONNX Runtime Web v1.26.0
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
var Wn=Object.defineProperty;var ff=Object.getOwnPropertyDescriptor;var hf=Object.getOwnPropertyNames;var gf=Object.prototype.hasOwnProperty;var Gn=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var V=(t,e)=>()=>(t&&(e=t(t=0)),e);var Vt=(t,e)=>{for(var r in e)Wn(t,r,{get:e[r],enumerable:!0})},bf=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of hf(e))!gf.call(t,o)&&o!==r&&Wn(t,o,{get:()=>e[o],enumerable:!(n=ff(e,o))||n.enumerable});return t};var Xt=t=>bf(Wn({},"__esModule",{value:!0}),t);var xr,Et,kt,yf,Oa,Hn=V(()=>{"use strict";xr=new Map,Et=[],kt=(t,e,r)=>{if(e&&typeof e.init=="function"&&typeof e.createInferenceSessionHandler=="function"){let n=xr.get(t);if(n===void 0)xr.set(t,{backend:e,priority:r});else{if(n.priority>r)return;if(n.priority===r&&n.backend!==e)throw new Error(`cannot register backend "${t}" using priority ${r}`)}if(r>=0){let o=Et.indexOf(t);o!==-1&&Et.splice(o,1);for(let i=0;i<Et.length;i++)if(xr.get(Et[i]).priority<=r){Et.splice(i,0,t);return}Et.push(t)}return}throw new TypeError("not a valid backend")},yf=async t=>{let e=xr.get(t);if(!e)return"backend not found.";if(e.initialized)return e.backend;if(e.aborted)return e.error;{let r=!!e.initPromise;try{return r||(e.initPromise=e.backend.init(t)),await e.initPromise,e.initialized=!0,e.backend}catch(n){return r||(e.error=`${n}`,e.aborted=!0),e.error}finally{delete e.initPromise}}},Oa=async t=>{let e=t.executionProviders||[],r=e.map(d=>typeof d=="string"?d:d.name),n=r.length===0?Et:r,o,i=[],s=new Set;for(let d of n){let c=await yf(d);typeof c=="string"?i.push({name:d,err:c}):(o||(o=c),o===c&&s.add(d))}if(!o)throw new Error(`no available backend found. ERR: ${i.map(d=>`[${d.name}] ${d.err}`).join(", ")}`);for(let{name:d,err:c}of i)r.includes(d)&&console.warn(`removing requested execution provider "${d}" from session options because it is not available: ${c}`);let u=e.filter(d=>s.has(typeof d=="string"?d:d.name));return[o,new Proxy(t,{get:(d,c)=>c==="executionProviders"?u:Reflect.get(d,c)})]}});var za=V(()=>{"use strict";Hn()});var Da,Ba=V(()=>{"use strict";Da="1.26.0"});var Ma,Oe,Fn=V(()=>{"use strict";Ba();Ma="warning",Oe={wasm:{},webgl:{},webgpu:{},versions:{common:Da},set logLevel(t){if(t!==void 0){if(typeof t!="string"||["verbose","info","warning","error","fatal"].indexOf(t)===-1)throw new Error(`Unsupported logging level: ${t}`);Ma=t}},get logLevel(){return Ma}};Object.defineProperty(Oe,"logLevel",{enumerable:!0})});var _e,Ra=V(()=>{"use strict";Fn();_e=Oe});var Ua,Na,Va=V(()=>{"use strict";Ua=(t,e)=>{let r=typeof document<"u"?document.createElement("canvas"):new OffscreenCanvas(1,1);r.width=t.dims[3],r.height=t.dims[2];let n=r.getContext("2d");if(n!=null){let o,i;e?.tensorLayout!==void 0&&e.tensorLayout==="NHWC"?(o=t.dims[2],i=t.dims[3]):(o=t.dims[3],i=t.dims[2]);let s=e?.format!==void 0?e.format:"RGB",u=e?.norm,d,c;u===void 0||u.mean===void 0?d=[255,255,255,255]:typeof u.mean=="number"?d=[u.mean,u.mean,u.mean,u.mean]:(d=[u.mean[0],u.mean[1],u.mean[2],0],u.mean[3]!==void 0&&(d[3]=u.mean[3])),u===void 0||u.bias===void 0?c=[0,0,0,0]:typeof u.bias=="number"?c=[u.bias,u.bias,u.bias,u.bias]:(c=[u.bias[0],u.bias[1],u.bias[2],0],u.bias[3]!==void 0&&(c[3]=u.bias[3]));let p=i*o,m=0,g=p,y=p*2,b=-1;s==="RGBA"?(m=0,g=p,y=p*2,b=p*3):s==="RGB"?(m=0,g=p,y=p*2):s==="RBG"&&(m=0,y=p,g=p*2);for(let _=0;_<i;_++)for(let T=0;T<o;T++){let x=(t.data[m++]-c[0])*d[0],$=(t.data[g++]-c[1])*d[1],S=(t.data[y++]-c[2])*d[2],I=b===-1?255:(t.data[b++]-c[3])*d[3];n.fillStyle="rgba("+x+","+$+","+S+","+I+")",n.fillRect(T,_,1,1)}if("toDataURL"in r)return r.toDataURL();throw new Error("toDataURL is not supported")}else throw new Error("Can not access image data")},Na=(t,e)=>{let r=typeof document<"u"?document.createElement("canvas").getContext("2d"):new OffscreenCanvas(1,1).getContext("2d"),n;if(r!=null){let o,i,s;e?.tensorLayout!==void 0&&e.tensorLayout==="NHWC"?(o=t.dims[2],i=t.dims[1],s=t.dims[3]):(o=t.dims[3],i=t.dims[2],s=t.dims[1]);let u=e!==void 0&&e.format!==void 0?e.format:"RGB",d=e?.norm,c,p;d===void 0||d.mean===void 0?c=[255,255,255,255]:typeof d.mean=="number"?c=[d.mean,d.mean,d.mean,d.mean]:(c=[d.mean[0],d.mean[1],d.mean[2],255],d.mean[3]!==void 0&&(c[3]=d.mean[3])),d===void 0||d.bias===void 0?p=[0,0,0,0]:typeof d.bias=="number"?p=[d.bias,d.bias,d.bias,d.bias]:(p=[d.bias[0],d.bias[1],d.bias[2],0],d.bias[3]!==void 0&&(p[3]=d.bias[3]));let m=i*o;if(e!==void 0&&(e.format!==void 0&&s===4&&e.format!=="RGBA"||s===3&&e.format!=="RGB"&&e.format!=="BGR"))throw new Error("Tensor format doesn't match input tensor dims");let g=4,y=0,b=1,_=2,T=3,x=0,$=m,S=m*2,I=-1;u==="RGBA"?(x=0,$=m,S=m*2,I=m*3):u==="RGB"?(x=0,$=m,S=m*2):u==="RBG"&&(x=0,S=m,$=m*2),n=r.createImageData(o,i);for(let E=0;E<i*o;y+=g,b+=g,_+=g,T+=g,E++)n.data[y]=(t.data[x++]-p[0])*c[0],n.data[b]=(t.data[$++]-p[1])*c[1],n.data[_]=(t.data[S++]-p[2])*c[2],n.data[T]=I===-1?255:(t.data[I++]-p[3])*c[3]}else throw new Error("Can not access image data");return n}});var qn,La,Wa,Ga,Ha,Fa,qa=V(()=>{"use strict";Sr();qn=(t,e)=>{if(t===void 0)throw new Error("Image buffer must be defined");if(e.height===void 0||e.width===void 0)throw new Error("Image height and width must be defined");if(e.tensorLayout==="NHWC")throw new Error("NHWC Tensor layout is not supported yet");let{height:r,width:n}=e,o=e.norm??{mean:255,bias:0},i,s;typeof o.mean=="number"?i=[o.mean,o.mean,o.mean,o.mean]:i=[o.mean[0],o.mean[1],o.mean[2],o.mean[3]??255],typeof o.bias=="number"?s=[o.bias,o.bias,o.bias,o.bias]:s=[o.bias[0],o.bias[1],o.bias[2],o.bias[3]??0];let u=e.format!==void 0?e.format:"RGBA",d=e.tensorFormat!==void 0&&e.tensorFormat!==void 0?e.tensorFormat:"RGB",c=r*n,p=d==="RGBA"?new Float32Array(c*4):new Float32Array(c*3),m=4,g=0,y=1,b=2,_=3,T=0,x=c,$=c*2,S=-1;u==="RGB"&&(m=3,g=0,y=1,b=2,_=-1),d==="RGBA"?S=c*3:d==="RBG"?(T=0,$=c,x=c*2):d==="BGR"&&($=0,x=c,T=c*2);for(let E=0;E<c;E++,g+=m,b+=m,y+=m,_+=m)p[T++]=(t[g]+s[0])/i[0],p[x++]=(t[y]+s[1])/i[1],p[$++]=(t[b]+s[2])/i[2],S!==-1&&_!==-1&&(p[S++]=(t[_]+s[3])/i[3]);return d==="RGBA"?new Be("float32",p,[1,4,r,n]):new Be("float32",p,[1,3,r,n])},La=async(t,e)=>{let r=typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement,n=typeof ImageData<"u"&&t instanceof ImageData,o=typeof ImageBitmap<"u"&&t instanceof ImageBitmap,i=typeof t=="string",s,u=e??{},d=()=>{if(typeof document<"u")return document.createElement("canvas");if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(1,1);throw new Error("Canvas is not supported")},c=p=>typeof HTMLCanvasElement<"u"&&p instanceof HTMLCanvasElement||p instanceof OffscreenCanvas?p.getContext("2d"):null;if(r){let p=d();p.width=t.width,p.height=t.height;let m=c(p);if(m!=null){let g=t.height,y=t.width;if(e!==void 0&&e.resizedHeight!==void 0&&e.resizedWidth!==void 0&&(g=e.resizedHeight,y=e.resizedWidth),e!==void 0){if(u=e,e.tensorFormat!==void 0)throw new Error("Image input config format must be RGBA for HTMLImageElement");u.tensorFormat="RGBA",u.height=g,u.width=y}else u.tensorFormat="RGBA",u.height=g,u.width=y;m.drawImage(t,0,0),s=m.getImageData(0,0,y,g).data}else throw new Error("Can not access image data")}else if(n){let p,m;if(e!==void 0&&e.resizedWidth!==void 0&&e.resizedHeight!==void 0?(p=e.resizedHeight,m=e.resizedWidth):(p=t.height,m=t.width),e!==void 0&&(u=e),u.format="RGBA",u.height=p,u.width=m,e!==void 0){let g=d();g.width=m,g.height=p;let y=c(g);if(y!=null)y.putImageData(t,0,0),s=y.getImageData(0,0,m,p).data;else throw new Error("Can not access image data")}else s=t.data}else if(o){if(e===void 0)throw new Error("Please provide image config with format for Imagebitmap");let p=d();p.width=t.width,p.height=t.height;let m=c(p);if(m!=null){let g=t.height,y=t.width;return m.drawImage(t,0,0,y,g),s=m.getImageData(0,0,y,g).data,u.height=g,u.width=y,qn(s,u)}else throw new Error("Can not access image data")}else{if(i)return new Promise((p,m)=>{let g=d(),y=c(g);if(!t||!y)return m();let b=new Image;b.crossOrigin="Anonymous",b.src=t,b.onload=()=>{g.width=b.width,g.height=b.height,y.drawImage(b,0,0,g.width,g.height);let _=y.getImageData(0,0,g.width,g.height);u.height=g.height,u.width=g.width,p(qn(_.data,u))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(s!==void 0)return qn(s,u);throw new Error("Input data provided is not supported - aborted tensor creation")},Wa=(t,e)=>{let{width:r,height:n,download:o,dispose:i}=e,s=[1,n,r,4];return new Be({location:"texture",type:"float32",texture:t,dims:s,download:o,dispose:i})},Ga=(t,e)=>{let{dataType:r,dims:n,download:o,dispose:i}=e;return new Be({location:"gpu-buffer",type:r??"float32",gpuBuffer:t,dims:n,download:o,dispose:i})},Ha=(t,e)=>{let{dataType:r,dims:n,download:o,dispose:i}=e;return new Be({location:"ml-tensor",type:r??"float32",mlTensor:t,dims:n,download:o,dispose:i})},Fa=(t,e,r)=>new Be({location:"cpu-pinned",type:t,data:e,dims:r??[e.length]})});var Pt,Jt,Ka,ja,Za=V(()=>{"use strict";Pt=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array],["int4",Uint8Array],["uint4",Uint8Array]]),Jt=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]),Ka=!1,ja=()=>{if(!Ka){Ka=!0;let t=typeof BigInt64Array<"u"&&BigInt64Array.from,e=typeof BigUint64Array<"u"&&BigUint64Array.from,r=globalThis.Float16Array,n=typeof r<"u"&&r.from;t&&(Pt.set("int64",BigInt64Array),Jt.set(BigInt64Array,"int64")),e&&(Pt.set("uint64",BigUint64Array),Jt.set(BigUint64Array,"uint64")),n?(Pt.set("float16",r),Jt.set(r,"float16")):Pt.set("float16",Uint16Array)}}});var Qa,Ya,Xa=V(()=>{"use strict";Sr();Qa=t=>{let e=1;for(let r=0;r<t.length;r++){let n=t[r];if(typeof n!="number"||!Number.isSafeInteger(n))throw new TypeError(`dims[${r}] must be an integer, got: ${n}`);if(n<0)throw new RangeError(`dims[${r}] must be a non-negative integer, got: ${n}`);e*=n}return e},Ya=(t,e)=>{switch(t.location){case"cpu":return new Be(t.type,t.data,e);case"cpu-pinned":return new Be({location:"cpu-pinned",data:t.data,type:t.type,dims:e});case"texture":return new Be({location:"texture",texture:t.texture,type:t.type,dims:e});case"gpu-buffer":return new Be({location:"gpu-buffer",gpuBuffer:t.gpuBuffer,type:t.type,dims:e});case"ml-tensor":return new Be({location:"ml-tensor",mlTensor:t.mlTensor,type:t.type,dims:e});default:throw new Error(`tensorReshape: tensor location ${t.location} is not supported`)}}});var Be,Sr=V(()=>{"use strict";Va();qa();Za();Xa();Be=class{constructor(e,r,n){ja();let o,i;if(typeof e=="object"&&"location"in e)switch(this.dataLocation=e.location,o=e.type,i=e.dims,e.location){case"cpu-pinned":{let u=Pt.get(o);if(!u)throw new TypeError(`unsupported type "${o}" to create tensor from pinned buffer`);if(!(e.data instanceof u))throw new TypeError(`buffer should be of type ${u.name}`);this.cpuData=e.data;break}case"texture":{if(o!=="float32")throw new TypeError(`unsupported type "${o}" to create tensor from texture`);this.gpuTextureData=e.texture,this.downloader=e.download,this.disposer=e.dispose;break}case"gpu-buffer":{if(o!=="float32"&&o!=="float16"&&o!=="int32"&&o!=="int64"&&o!=="uint32"&&o!=="uint8"&&o!=="bool"&&o!=="uint4"&&o!=="int4")throw new TypeError(`unsupported type "${o}" to create tensor from gpu buffer`);this.gpuBufferData=e.gpuBuffer,this.downloader=e.download,this.disposer=e.dispose;break}case"ml-tensor":{if(o!=="float32"&&o!=="float16"&&o!=="int32"&&o!=="int64"&&o!=="uint32"&&o!=="uint64"&&o!=="int8"&&o!=="uint8"&&o!=="bool"&&o!=="uint4"&&o!=="int4")throw new TypeError(`unsupported type "${o}" to create tensor from MLTensor`);this.mlTensorData=e.mlTensor,this.downloader=e.download,this.disposer=e.dispose;break}default:throw new Error(`Tensor constructor: unsupported location '${this.dataLocation}'`)}else{let u,d;if(typeof e=="string")if(o=e,d=n,e==="string"){if(!Array.isArray(r))throw new TypeError("A string tensor's data must be a string array.");u=r}else{let c=Pt.get(e);if(c===void 0)throw new TypeError(`Unsupported tensor type: ${e}.`);if(Array.isArray(r)){if(e==="float16"&&c===Uint16Array||e==="uint4"||e==="int4")throw new TypeError(`Creating a ${e} tensor from number array is not supported. Please use ${c.name} as data.`);e==="uint64"||e==="int64"?u=c.from(r,BigInt):u=c.from(r)}else if(r instanceof c)u=r;else if(r instanceof Uint8ClampedArray)if(e==="uint8")u=Uint8Array.from(r);else throw new TypeError("A Uint8ClampedArray tensor's data must be type of uint8");else if(e==="float16"&&r instanceof Uint16Array&&c!==Uint16Array)u=new globalThis.Float16Array(r.buffer,r.byteOffset,r.length);else throw new TypeError(`A ${o} tensor's data must be type of ${c}`)}else if(d=r,Array.isArray(e)){if(e.length===0)throw new TypeError("Tensor type cannot be inferred from an empty array.");let c=typeof e[0];if(c==="string")o="string",u=e;else if(c==="boolean")o="bool",u=Uint8Array.from(e);else throw new TypeError(`Invalid element type of data array: ${c}.`)}else if(e instanceof Uint8ClampedArray)o="uint8",u=Uint8Array.from(e);else{let c=Jt.get(e.constructor);if(c===void 0)throw new TypeError(`Unsupported type for tensor data: ${e.constructor}.`);o=c,u=e}if(d===void 0)d=[u.length];else if(!Array.isArray(d))throw new TypeError("A tensor's dims must be a number array");i=d,this.cpuData=u,this.dataLocation="cpu"}let s=Qa(i);if(this.cpuData&&s!==this.cpuData.length&&!((o==="uint4"||o==="int4")&&Math.ceil(s/2)===this.cpuData.length))throw new Error(`Tensor's size(${s}) does not match data length(${this.cpuData.length}).`);this.type=o,this.dims=i,this.size=s}static async fromImage(e,r){return La(e,r)}static fromTexture(e,r){return Wa(e,r)}static fromGpuBuffer(e,r){return Ga(e,r)}static fromMLTensor(e,r){return Ha(e,r)}static fromPinnedBuffer(e,r,n){return Fa(e,r,n)}toDataURL(e){return Ua(this,e)}toImageData(e){return Na(this,e)}get data(){if(this.ensureValid(),!this.cpuData)throw new Error("The data is not on CPU. Use `getData()` to download GPU data to CPU, or use `texture` or `gpuBuffer` property to access the GPU data directly.");return this.cpuData}get location(){return this.dataLocation}get texture(){if(this.ensureValid(),!this.gpuTextureData)throw new Error("The data is not stored as a WebGL texture.");return this.gpuTextureData}get gpuBuffer(){if(this.ensureValid(),!this.gpuBufferData)throw new Error("The data is not stored as a WebGPU buffer.");return this.gpuBufferData}get mlTensor(){if(this.ensureValid(),!this.mlTensorData)throw new Error("The data is not stored as a WebNN MLTensor.");return this.mlTensorData}async getData(e){switch(this.ensureValid(),this.dataLocation){case"cpu":case"cpu-pinned":return this.data;case"texture":case"gpu-buffer":case"ml-tensor":{if(!this.downloader)throw new Error("The current tensor is not created with a specified data downloader.");if(this.isDownloading)throw new Error("The current tensor is being downloaded.");try{this.isDownloading=!0;let r=await this.downloader();return this.downloader=void 0,this.dataLocation="cpu",this.cpuData=r,e&&this.disposer&&(this.disposer(),this.disposer=void 0),r}finally{this.isDownloading=!1}}default:throw new Error(`cannot get data from location: ${this.dataLocation}`)}}dispose(){if(this.isDownloading)throw new Error("The current tensor is being downloaded.");this.disposer&&(this.disposer(),this.disposer=void 0),this.cpuData=void 0,this.gpuTextureData=void 0,this.gpuBufferData=void 0,this.mlTensorData=void 0,this.downloader=void 0,this.isDownloading=void 0,this.dataLocation="none"}ensureValid(){if(this.dataLocation==="none")throw new Error("The tensor is disposed.")}reshape(e){if(this.ensureValid(),this.downloader||this.disposer)throw new Error("Cannot reshape a tensor that owns GPU resource.");return Ya(this,e)}}});var je,Kn=V(()=>{"use strict";Sr();je=Be});var Tr,Ja,Ve,Re,_t,wt,jn=V(()=>{"use strict";Fn();Tr=(t,e)=>{(typeof Oe.trace>"u"?!Oe.wasm.trace:!Oe.trace)||console.timeStamp(`${t}::ORT::${e}`)},Ja=(t,e)=>{let r=new Error().stack?.split(/\r\n|\r|\n/g)||[],n=!1;for(let o=0;o<r.length;o++){if(n&&!r[o].includes("TRACE_FUNC")){let i=`FUNC_${t}::${r[o].trim().split(" ")[1]}`;e&&(i+=`::${e}`),Tr("CPU",i);return}r[o].includes("TRACE_FUNC")&&(n=!0)}},Ve=t=>{(typeof Oe.trace>"u"?!Oe.wasm.trace:!Oe.trace)||Ja("BEGIN",t)},Re=t=>{(typeof Oe.trace>"u"?!Oe.wasm.trace:!Oe.trace)||Ja("END",t)},_t=t=>{(typeof Oe.trace>"u"?!Oe.wasm.trace:!Oe.trace)||console.time(`ORT::${t}`)},wt=t=>{(typeof Oe.trace>"u"?!Oe.wasm.trace:!Oe.trace)||console.timeEnd(`ORT::${t}`)}});var Ir,es=V(()=>{"use strict";Hn();Kn();jn();Ir=class t{constructor(e){this.handler=e}async run(e,r,n){Ve(),_t("InferenceSession.run");let o={},i={};if(typeof e!="object"||e===null||e instanceof je||Array.isArray(e))throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");let s=!0;if(typeof r=="object"){if(r===null)throw new TypeError("Unexpected argument[1]: cannot be null.");if(r instanceof je)throw new TypeError("'fetches' cannot be a Tensor");if(Array.isArray(r)){if(r.length===0)throw new TypeError("'fetches' cannot be an empty array.");s=!1;for(let c of r){if(typeof c!="string")throw new TypeError("'fetches' must be a string array or an object.");if(this.outputNames.indexOf(c)===-1)throw new RangeError(`'fetches' contains invalid output name: ${c}.`);o[c]=null}if(typeof n=="object"&&n!==null)i=n;else if(typeof n<"u")throw new TypeError("'options' must be an object.")}else{let c=!1,p=Object.getOwnPropertyNames(r);for(let m of this.outputNames)if(p.indexOf(m)!==-1){let g=r[m];(g===null||g instanceof je)&&(c=!0,s=!1,o[m]=g)}if(c){if(typeof n=="object"&&n!==null)i=n;else if(typeof n<"u")throw new TypeError("'options' must be an object.")}else i=r}}else if(typeof r<"u")throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'.");for(let c of this.inputNames)if(typeof e[c]>"u")throw new Error(`input '${c}' is missing in 'feeds'.`);if(s)for(let c of this.outputNames)o[c]=null;let u=await this.handler.run(e,o,i),d={};for(let c in u)if(Object.hasOwnProperty.call(u,c)){let p=u[c];p instanceof je?d[c]=p:d[c]=new je(p.type,p.data,p.dims)}return wt("InferenceSession.run"),Re(),d}async release(){return this.handler.dispose()}static async create(e,r,n,o){Ve(),_t("InferenceSession.create");let i,s={};if(typeof e=="string"){if(i=e,typeof r=="object"&&r!==null)s=r;else if(typeof r<"u")throw new TypeError("'options' must be an object.")}else if(e instanceof Uint8Array){if(i=e,typeof r=="object"&&r!==null)s=r;else if(typeof r<"u")throw new TypeError("'options' must be an object.")}else if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer){let p=e,m=0,g=e.byteLength;if(typeof r=="object"&&r!==null)s=r;else if(typeof r=="number"){if(m=r,!Number.isSafeInteger(m))throw new RangeError("'byteOffset' must be an integer.");if(m<0||m>=p.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${p.byteLength}).`);if(g=e.byteLength-m,typeof n=="number"){if(g=n,!Number.isSafeInteger(g))throw new RangeError("'byteLength' must be an integer.");if(g<=0||m+g>p.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${p.byteLength-m}].`);if(typeof o=="object"&&o!==null)s=o;else if(typeof o<"u")throw new TypeError("'options' must be an object.")}else if(typeof n<"u")throw new TypeError("'byteLength' must be a number.")}else if(typeof r<"u")throw new TypeError("'options' must be an object.");i=new Uint8Array(p,m,g)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");let[u,d]=await Oa(s),c=await u.createInferenceSessionHandler(i,d);return wt("InferenceSession.create"),Re(),new t(c)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}get inputMetadata(){return this.handler.inputMetadata}get outputMetadata(){return this.handler.outputMetadata}}});var _f,ts=V(()=>{"use strict";es();_f=Ir});var rs=V(()=>{"use strict"});var ns=V(()=>{"use strict"});var os=V(()=>{"use strict"});var is=V(()=>{"use strict"});var Zn={};Vt(Zn,{InferenceSession:()=>_f,TRACE:()=>Tr,TRACE_EVENT_BEGIN:()=>_t,TRACE_EVENT_END:()=>wt,TRACE_FUNC_BEGIN:()=>Ve,TRACE_FUNC_END:()=>Re,Tensor:()=>je,env:()=>_e,registerBackend:()=>kt});var Le=V(()=>{"use strict";za();Ra();ts();Kn();rs();ns();jn();os();is()});var Cr=V(()=>{"use strict"});var ds={};Vt(ds,{default:()=>wf});var ss,us,wf,ls=V(()=>{"use strict";Qn();vt();Ar();ss="ort-wasm-proxy-worker",us=globalThis.self?.name===ss;us&&(self.onmessage=t=>{let{type:e,in:r}=t.data;try{switch(e){case"init-wasm":Er(r.wasm).then(()=>{kr(r).then(()=>{postMessage({type:e})},n=>{postMessage({type:e,err:n})})},n=>{postMessage({type:e,err:n})});break;case"init-ep":{let{epName:n,env:o}=r;Pr(o,n).then(()=>{postMessage({type:e})},i=>{postMessage({type:e,err:i})});break}case"copy-from":{let{buffer:n}=r,o=er(n);postMessage({type:e,out:o});break}case"create":{let{model:n,options:o}=r;Or(n,o).then(i=>{postMessage({type:e,out:i})},i=>{postMessage({type:e,err:i})});break}case"release":zr(r),postMessage({type:e});break;case"run":{let{sessionId:n,inputIndices:o,inputs:i,outputIndices:s,options:u}=r;Dr(n,o,i,s,new Array(s.length).fill(null),u).then(d=>{d.some(c=>c[3]!=="cpu")?postMessage({type:e,err:"Proxy does not support non-cpu tensor location."}):postMessage({type:e,out:d},Mr([...i,...d]))},d=>{postMessage({type:e,err:d})});break}case"end-profiling":Br(r),postMessage({type:e});break;default:}}catch(n){postMessage({type:e,err:n})}});wf=us?null:t=>new Worker(t??We,{type:"module",name:ss})});var ps={};Vt(ps,{default:()=>vf});async function cs(t={}){var e=t,r=!!globalThis.window,n=!!globalThis.WorkerGlobalScope,o=n&&self.name?.startsWith("em-pthread");e.mountExternalData=(a,l)=>{a.startsWith("./")&&(a=a.substring(2)),(e.Xc||(e.Xc=new Map)).set(a,l)},e.unmountExternalData=()=>{delete e.Xc},globalThis.SharedArrayBuffer??new WebAssembly.Memory({initial:0,maximum:0,shared:!0}).buffer.constructor;let i=a=>async(...l)=>{try{if(e.Yc)throw Error("Session already started");let h=e.Yc={Kd:l[0],errors:[]},f=await a(...l);if(e.Yc!==h)throw Error("Session mismatch");e.dd?.flush();let w=h.errors;if(0<w.length){let C=await Promise.all(w);if(C=C.filter(P=>P),0<C.length)throw Error(C.join(`
`))}return f}finally{e.Yc=null}};e.jsepInit=(a,l)=>{if(a==="webgpu"){[e.dd,e.Ad,e.Ed,e.ed,e.Dd,e.$b,e.Fd,e.Hd,e.Bd,e.Cd,e.Gd]=l;let h=e.dd;e.jsepRegisterBuffer=(f,w,C,P)=>h.registerBuffer(f,w,C,P),e.jsepGetBuffer=f=>h.getBuffer(f),e.jsepCreateDownloader=(f,w,C)=>h.createDownloader(f,w,C),e.jsepOnCreateSession=f=>{h.onCreateSession(f)},e.jsepOnReleaseSession=f=>{h.onReleaseSession(f)},e.jsepOnRunStart=f=>h.onRunStart(f),e.Id=(f,w)=>{h.upload(f,w)}}else if(a==="webnn"){let h=l[0];[e.Wd,e.sd,e.webnnEnsureTensor,e.td,e.webnnDownloadTensor,e.Rd,e.webnnEnableTraceEvent]=l.slice(1),e.webnnReleaseTensorId=e.sd,e.webnnUploadTensor=e.td,e.webnnRegisterMLContext=e.Rd,e.webnnOnRunStart=f=>h.onRunStart(f),e.webnnOnRunEnd=h.onRunEnd.bind(h),e.webnnOnReleaseSession=f=>{h.onReleaseSession(f)},e.webnnCreateMLTensorDownloader=(f,w)=>h.createMLTensorDownloader(f,w),e.webnnRegisterMLTensor=(f,w,C,P)=>h.registerMLTensor(f,w,C,P),e.webnnCreateMLContext=f=>h.createMLContext(f),e.webnnRegisterMLConstant=(f,w,C,P,B,H)=>h.registerMLConstant(f,w,C,P,B,e.Xc,H),e.webnnRegisterGraphInput=h.registerGraphInput.bind(h),e.webnnIsGraphInput=h.isGraphInput.bind(h),e.webnnRegisterGraphOutput=h.registerGraphOutput.bind(h),e.webnnIsGraphOutput=h.isGraphOutput.bind(h),e.webnnCreateTemporaryTensor=h.createTemporaryTensor.bind(h),e.webnnIsGraphInputOutputTypeSupported=h.isGraphInputOutputTypeSupported.bind(h)}};let s=()=>{let a=l=>(...h)=>{let f=et;return h=l(...h),et!=f?new Promise((w,C)=>{En={resolve:w,reject:C}}):h};(()=>{for(let l of["_OrtAppendExecutionProvider","_OrtCreateSession","_OrtRun","_OrtRunWithBinding","_OrtBindInput"])e[l]=a(e[l])})(),i!==void 0&&(e._OrtRun=i(e._OrtRun),e._OrtRunWithBinding=i(e._OrtRunWithBinding)),s=void 0};e.asyncInit=()=>{s?.()};var u,d,c=(a,l)=>{throw l},p=import.meta.url,m="";if(r||n){try{m=new URL(".",p).href}catch{}n&&(d=a=>{var l=new XMLHttpRequest;return l.open("GET",a,!1),l.responseType="arraybuffer",l.send(null),new Uint8Array(l.response)}),u=async a=>{if(z(a))return new Promise((h,f)=>{var w=new XMLHttpRequest;w.open("GET",a,!0),w.responseType="arraybuffer",w.onload=()=>{w.status==200||w.status==0&&w.response?h(w.response):f(w.status)},w.onerror=f,w.send(null)});var l=await fetch(a,{credentials:"same-origin"});if(l.ok)return l.arrayBuffer();throw Error(l.status+" : "+l.url)}}var g,y,b,_,T,x,$=console.log.bind(console),S=console.error.bind(console),I=$,E=S,A=!1,z=a=>a.startsWith("file://");function v(){ht.buffer!=N.buffer&&Me()}if(o){let a=function(l){try{var h=l.data,f=h.Sc;if(f==="load"){let w=[];self.onmessage=C=>w.push(C),x=()=>{postMessage({Sc:"loaded"});for(let C of w)a(C);self.onmessage=a};for(let C of h.xd)e[C]&&!e[C].proxy||(e[C]=(...P)=>{postMessage({Sc:"callHandler",wd:C,args:P})},C=="print"&&(I=e[C]),C=="printErr"&&(E=e[C]));ht=h.Od,Me(),y=h.Pd,be(),$r()}else if(f==="run"){(function(w){var C=(v(),L)[w+52>>>2>>>0];w=(v(),L)[w+56>>>2>>>0],Wi(C,C-w),ue(C)})(h.Rc),Dn(h.Rc,0,0,1,0,0),Go(),In(h.Rc),R||(Mi(),R=!0);try{np(h.Md,h.bd)}catch(w){if(w!="unwind")throw w}}else h.target!=="setimmediate"&&(f==="checkMailbox"?R&&hr():f&&(E(`worker: received unknown command ${f}`),E(h)))}catch(w){throw Ri(),w}};var Zb=a,R=!1;self.onunhandledrejection=l=>{throw l.reason||l},self.onmessage=a}var N,F,q,X,D,L,Q,Y,Z,te,ae,le=!1;function Me(){var a=ht.buffer;e.HEAP8=N=new Int8Array(a),q=new Int16Array(a),e.HEAPU8=F=new Uint8Array(a),X=new Uint16Array(a),e.HEAP32=D=new Int32Array(a),e.HEAPU32=L=new Uint32Array(a),Q=new Float32Array(a),Y=new Float64Array(a),Z=new BigInt64Array(a),te=new BigUint64Array(a)}function ve(){le=!0,o?x():ct.sb()}function M(a){throw E(a="Aborted("+a+")"),A=!0,a=new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info."),T?.(a),a}function G(){return{a:{ma:Am,gb:Cm,g:op,J:ip,f:ap,o:sp,h:up,ha:dp,b:lp,T:cp,Ha:Zo,n:pp,$:Jo,Xa:ei,Da:ti,Fa:ri,Ya:ni,Va:oi,Oa:ii,Ua:ai,ka:si,Ea:ui,Ba:di,Wa:li,Ca:ci,bb:mp,ea:hp,wa:gp,ua:yp,da:wp,O:vp,H:$p,va:xp,_:kp,xa:Pp,Ra:Op,za:Dp,Ia:Bp,sa:Mp,fa:Rp,Qa:In,_a:Up,R:Wp,r:Kp,c:Sn,hb:jp,y:Zp,M:Qp,D:Yp,l:Xp,s:_i,ib:Jp,I:em,S:tm,j:rm,u:nm,q:om,k:im,La:am,Ma:sm,Na:um,Ja:xi,Ka:Si,ta:Ti,db:lm,ab:mm,v:fm,aa:hm,ga:gm,$a:cm,W:bm,Za:ym,Aa:_m,F:dm,U:wm,la:wr,ya:$m,fb:vm,eb:xm,Sa:Ei,Ta:ki,Ga:_n,V:Pi,ja:Oi,Pa:zi,ia:Di,kb:cf,na:af,lb:lf,oa:of,G:Zm,d:Om,t:km,w:Em,A:Wm,mb:tf,K:qm,x:Bm,pa:rf,Y:sf,ba:ef,nb:Jm,ob:Xm,P:Gm,qa:Ym,pb:Qm,N:Km,Z:nf,e:Pm,B:Dm,m:zm,jb:pf,p:Rm,z:Um,C:Mm,E:Nm,L:Hm,qb:jm,Q:uf,ca:Fm,X:df,rb:Lm,ra:Vm,i:Tm,a:ht,cb:lr}}}async function be(){function a(f,w){var C=ct=f.exports;f={};for(let[P,B]of Object.entries(C))typeof B=="function"?(C=Np(B),f[P]=C):f[P]=B;return ct=f,ct=function(){var P=ct,B=K=>se=>K(se)>>>0,H=K=>()=>K()>>>0;return(P=Object.assign({},P)).tb=B(P.tb),P.Xb=H(P.Xb),P.Zb=B(P.Zb),P.lc=B(P.lc),P.mc=H(P.mc),P.qc=B(P.qc),P}(),Lo.push(ct._b),Bi=(f=ct).tb,Mi=f.ub,e._OrtInit=f.vb,e._OrtGetLastError=f.wb,e._OrtCreateSessionOptions=f.xb,e._OrtAppendExecutionProvider=f.yb,e._OrtAddFreeDimensionOverride=f.zb,e._OrtAddSessionConfigEntry=f.Ab,e._OrtReleaseSessionOptions=f.Bb,e._OrtCreateSession=f.Cb,e._OrtReleaseSession=f.Db,e._OrtGetInputOutputCount=f.Eb,e._OrtGetInputOutputMetadata=f.Fb,e._OrtFree=f.Gb,e._OrtCreateTensor=f.Hb,e._OrtGetTensorData=f.Ib,e._OrtReleaseTensor=f.Jb,e._OrtCreateRunOptions=f.Kb,e._OrtAddRunConfigEntry=f.Lb,e._OrtReleaseRunOptions=f.Mb,e._OrtCreateBinding=f.Nb,e._OrtBindInput=f.Ob,e._OrtBindOutput=f.Pb,e._OrtClearBoundOutputs=f.Qb,e._OrtReleaseBinding=f.Rb,e._OrtRunWithBinding=f.Sb,e._OrtRun=f.Tb,e._OrtEndProfiling=f.Ub,e._JsepOutput=f.Vb,e._JsepGetNodeName=f.Wb,vr=f.Xb,tt=e._free=f.Yb,Qt=e._malloc=f.Zb,Dn=f.ac,Ri=f.bc,Ui=f.cc,Ni=f.dc,Bn=f.ec,Vi=f.fc,Li=f.gc,ce=f.hc,Yt=f.ic,Wi=f.jc,ue=f.kc,Mn=f.lc,de=f.mc,Gi=f.nc,Rn=f.oc,Hi=f.pc,Fi=f.qc,qi=f.rc,Un=f.sc,Ki=f.tc,ji=f.uc,Zi=f.vc,Qi=f.wc,Yi=f.xc,Xi=f.yc,Ji=f.zc,ea=f.Ac,ta=f.Bc,ra=f.Cc,na=f.Dc,oa=f.Ec,ia=f.Fc,aa=f.Gc,sa=f.Hc,ua=f.Ic,da=f.Jc,la=f.Kc,ca=f.Lc,pa=f.Mc,ma=f.Nc,fa=f.Pc,ha=f.Qc,ga=f.$c,ba=f.ad,ya=f.fd,_a=f.jd,wa=f.kd,va=f.ld,$a=f.md,xa=f.nd,Sa=f.od,Ta=f.pd,Ia=f.qd,Ca=f.vd,Aa=f.Sd,Ea=f.Td,ka=f.Ud,Pa=f.Vd,y=w,ct}var l,h=G();return e.instantiateWasm?new Promise(f=>{e.instantiateWasm(h,(w,C)=>{f(a(w,C))})}):o?a(new WebAssembly.Instance(y,G()),y):(ae??=e.locateFile?e.locateFile?e.locateFile("ort-wasm-simd-threaded.jsep.wasm",m):m+"ort-wasm-simd-threaded.jsep.wasm":new URL("ort-wasm-simd-threaded.jsep.wasm",import.meta.url).href,l=await async function(f){var w=ae;if(!g&&!z(w))try{var C=fetch(w,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(C,f)}catch(P){E(`wasm streaming compile failed: ${P}`),E("falling back to ArrayBuffer instantiation")}return async function(P,B){try{var H=await async function(K){if(!g)try{var se=await u(K);return new Uint8Array(se)}catch{}if(K==ae&&g)K=new Uint8Array(g);else{if(!d)throw"both async and sync fetching of the wasm failed";K=d(K)}return K}(P);return await WebAssembly.instantiate(H,B)}catch(K){E(`failed to asynchronously prepare wasm: ${K}`),M(K)}}(w,f)}(h),a(l.instance,l.module))}class Ee{name="ExitStatus";constructor(l){this.message=`Program terminated with exit(${l})`,this.status=l}}var $e=a=>{a.terminate(),a.onmessage=()=>{}},Pe=[],he=0,Te=null,qe=a=>{ft.length==0&&(Fo(),Ho(ft[0]));var l=ft.pop();if(!l)return 6;jt.push(l),It[a.Rc]=l,l.Rc=a.Rc;var h={Sc:"run",Md:a.Ld,bd:a.bd,Rc:a.Rc};return l.postMessage(h,a.rd),0},Ne=0,Se=(a,l,...h)=>{var f,w=16*h.length,C=de(),P=Mn(w),B=P>>>3;for(f of h)typeof f=="bigint"?((v(),Z)[B++>>>0]=1n,(v(),Z)[B++>>>0]=f):((v(),Z)[B++>>>0]=0n,(v(),Y)[B++>>>0]=f);return a=Ui(a,0,w,P,l),ue(C),a};function lr(a){if(o)return Se(0,1,a);if(b=a,!(0<Ne)){for(var l of jt)$e(l);for(l of ft)$e(l);ft=[],jt=[],It={},A=!0}c(0,new Ee(a))}function Vo(a){if(o)return Se(1,0,a);_n(a)}var _n=a=>{if(b=a,o)throw Vo(a),"unwind";lr(a)},ft=[],jt=[],Lo=[],It={},Wo=a=>{var l=a.Rc;delete It[l],ft.push(a),jt.splice(jt.indexOf(a),1),a.Rc=0,Ni(l)};function Go(){Lo.forEach(a=>a())}var Ho=a=>new Promise(l=>{a.onmessage=w=>{var C=w.data;if(w=C.Sc,C.Zc&&C.Zc!=vr()){var P=It[C.Zc];P?P.postMessage(C,C.rd):E(`Internal error! Worker sent a message "${w}" to target pthread ${C.Zc}, but that thread no longer exists!`)}else w==="checkMailbox"?hr():w==="spawnThread"?qe(C):w==="cleanupThread"?fr(()=>{Wo(It[C.Nd])}):w==="loaded"?(a.loaded=!0,l(a)):C.target==="setimmediate"?a.postMessage(C):w==="uncaughtException"?a.onerror(C.error):w==="callHandler"?e[C.wd](...C.args):w&&E(`worker sent an unknown command ${w}`)},a.onerror=w=>{throw E(`worker sent an error! ${w.filename}:${w.lineno}: ${w.message}`),w};var h,f=[];for(h of[])e.propertyIsEnumerable(h)&&f.push(h);a.postMessage({Sc:"load",xd:f,Od:ht,Pd:y})});function Fo(){var a=new Worker((()=>{let l=URL;return import.meta.url>"file:"&&import.meta.url<"file;"?new l("ort.bundle.min.mjs",import.meta.url):new URL(import.meta.url)})(),{type:"module",workerData:"em-pthread",name:"em-pthread"});ft.push(a)}var ht,np=(a,l)=>{Ne=0,a=Un(a,l),0<Ne?b=a:Bn(a)},cr=[],pr=0;function op(a){var l=new wn(a>>>=0);return(v(),N)[l.Tc+12>>>0]==0&&(qo(l,!0),pr--),Ko(l,!1),cr.push(l),Fi(a)}var Ut=0,ip=()=>{ce(0,0);var a=cr.pop();Gi(a.cd),Ut=0};function qo(a,l){l=l?1:0,(v(),N)[a.Tc+12>>>0]=l}function Ko(a,l){l=l?1:0,(v(),N)[a.Tc+13>>>0]=l}class wn{constructor(l){this.cd=l,this.Tc=l-24}}var vn=a=>{var l=Ut;if(!l)return Yt(0),0;var h=new wn(l);(v(),L)[h.Tc+16>>>2>>>0]=l;var f=(v(),L)[h.Tc+4>>>2>>>0];if(!f)return Yt(0),l;for(var w of a){if(w===0||w===f)break;if(Hi(w,f,h.Tc+16))return Yt(w),l}return Yt(f),l};function ap(){return vn([])}function sp(a){return vn([a>>>0])}function up(a,l,h,f){return vn([a>>>0,l>>>0,h>>>0,f>>>0])}var dp=()=>{var a=cr.pop();a||M("no exception to throw");var l=a.cd;throw(v(),N)[a.Tc+13>>>0]==0&&(cr.push(a),Ko(a,!0),qo(a,!1),pr++),Rn(l),Ut=l};function lp(a,l,h){var f=new wn(a>>>=0);throw l>>>=0,h>>>=0,(v(),L)[f.Tc+16>>>2>>>0]=0,(v(),L)[f.Tc+4>>>2>>>0]=l,(v(),L)[f.Tc+8>>>2>>>0]=h,Rn(a),pr++,Ut=a}var cp=()=>pr;function jo(a,l,h,f){return o?Se(2,1,a,l,h,f):Zo(a,l,h,f)}function Zo(a,l,h,f){if(a>>>=0,l>>>=0,h>>>=0,f>>>=0,!globalThis.SharedArrayBuffer)return 6;var w=[];return o&&w.length===0?jo(a,l,h,f):(a={Ld:h,Rc:a,bd:f,rd:w},o?(a.Sc="spawnThread",postMessage(a,w),0):qe(a))}function pp(a){throw Ut||=a>>>0,Ut}var Qo=globalThis.TextDecoder&&new TextDecoder,Yo=(a,l,h,f)=>{if(h=l+h,f)return h;for(;a[l]&&!(l>=h);)++l;return l},Xo=(a,l=0,h,f)=>{if(16<(h=Yo(a,l>>>=0,h,f))-l&&a.buffer&&Qo)return Qo.decode(a.buffer instanceof ArrayBuffer?a.subarray(l,h):a.slice(l,h));for(f="";l<h;){var w=a[l++];if(128&w){var C=63&a[l++];if((224&w)==192)f+=String.fromCharCode((31&w)<<6|C);else{var P=63&a[l++];65536>(w=(240&w)==224?(15&w)<<12|C<<6|P:(7&w)<<18|C<<12|P<<6|63&a[l++])?f+=String.fromCharCode(w):(w-=65536,f+=String.fromCharCode(55296|w>>10,56320|1023&w))}}else f+=String.fromCharCode(w)}return f},Ae=(a,l,h)=>(a>>>=0)?Xo((v(),F),a,l,h):"";function Jo(a,l,h){return o?Se(3,1,a,l,h):0}function ei(a,l){if(o)return Se(4,1,a,l)}function ti(a,l){if(o)return Se(5,1,a,l)}function ri(a,l,h){if(o)return Se(6,1,a,l,h)}function ni(a,l,h){return o?Se(7,1,a,l,h):0}function oi(a,l){if(o)return Se(8,1,a,l)}function ii(a,l,h){if(o)return Se(9,1,a,l,h)}function ai(a,l,h,f){if(o)return Se(10,1,a,l,h,f)}function si(a,l,h,f){if(o)return Se(11,1,a,l,h,f)}function ui(a,l,h,f){if(o)return Se(12,1,a,l,h,f)}function di(a){if(o)return Se(13,1,a)}function li(a,l){if(o)return Se(14,1,a,l)}function ci(a,l,h){if(o)return Se(15,1,a,l,h)}var mp=()=>M(""),Je=a=>{a>>>=0;for(var l="";;){var h=(v(),F)[a++>>>0];if(!h)return l;l+=String.fromCharCode(h)}},$n={},xn={},fp={},Nt=class extends Error{constructor(a){super(a),this.name="BindingError"}};function lt(a,l,h={}){return function(f,w,C={}){var P=w.name;if(!f)throw new Nt(`type "${P}" must have a positive integer typeid pointer`);if(xn.hasOwnProperty(f)){if(C.yd)return;throw new Nt(`Cannot register type '${P}' twice`)}xn[f]=w,delete fp[f],$n.hasOwnProperty(f)&&(w=$n[f],delete $n[f],w.forEach(B=>B()))}(a,l,h)}var pi=(a,l,h)=>{switch(l){case 1:return h?f=>(v(),N)[f>>>0]:f=>(v(),F)[f>>>0];case 2:return h?f=>(v(),q)[f>>>1>>>0]:f=>(v(),X)[f>>>1>>>0];case 4:return h?f=>(v(),D)[f>>>2>>>0]:f=>(v(),L)[f>>>2>>>0];case 8:return h?f=>(v(),Z)[f>>>3>>>0]:f=>(v(),te)[f>>>3>>>0];default:throw new TypeError(`invalid integer width (${l}): ${a}`)}};function hp(a,l,h,f,w){a>>>=0,h>>>=0,l=Je(l>>>0);let C=P=>P;if(f=f===0n){let P=8*h;C=B=>BigInt.asUintN(P,B),w=C(w)}lt(a,{name:l,Oc:C,Vc:(P,B)=>(typeof B=="number"&&(B=BigInt(B)),B),Uc:pi(l,h,!f),Wc:null})}function gp(a,l,h,f){lt(a>>>=0,{name:l=Je(l>>>0),Oc:function(w){return!!w},Vc:function(w,C){return C?h:f},Uc:function(w){return this.Oc((v(),F)[w>>>0])},Wc:null})}var mi=[],Ct=[0,1,,1,null,1,!0,1,!1,1];function Sn(a){9<(a>>>=0)&&--Ct[a+1]==0&&(Ct[a]=void 0,mi.push(a))}var He=a=>{if(!a)throw new Nt(`Cannot use deleted val. handle = ${a}`);return Ct[a]},Ke=a=>{switch(a){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let l=mi.pop()||Ct.length;return Ct[l]=a,Ct[l+1]=1,l}};function Tn(a){return this.Oc((v(),L)[a>>>2>>>0])}var bp={name:"emscripten::val",Oc:a=>{var l=He(a);return Sn(a),l},Vc:(a,l)=>Ke(l),Uc:Tn,Wc:null};function yp(a){return lt(a>>>0,bp)}var _p=(a,l)=>{switch(l){case 4:return function(h){return this.Oc((v(),Q)[h>>>2>>>0])};case 8:return function(h){return this.Oc((v(),Y)[h>>>3>>>0])};default:throw new TypeError(`invalid float width (${l}): ${a}`)}};function wp(a,l,h){h>>>=0,lt(a>>>=0,{name:l=Je(l>>>0),Oc:f=>f,Vc:(f,w)=>w,Uc:_p(l,h),Wc:null})}function vp(a,l,h,f,w){a>>>=0,h>>>=0,l=Je(l>>>0);let C=B=>B;if(f===0){var P=32-8*h;C=B=>B<<P>>>P,w=C(w)}lt(a,{name:l,Oc:C,Vc:(B,H)=>H,Uc:pi(l,h,f!==0),Wc:null})}function $p(a,l,h){function f(C){var P=(v(),L)[C>>>2>>>0];return C=(v(),L)[C+4>>>2>>>0],new w((v(),N).buffer,C,P)}var w=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][l];lt(a>>>=0,{name:h=Je(h>>>0),Oc:f,Uc:f},{yd:!0})}var gt=(a,l,h)=>{var f=(v(),F);if(l>>>=0,0<h){var w=l;h=l+h-1;for(var C=0;C<a.length;++C){var P=a.codePointAt(C);if(127>=P){if(l>=h)break;f[l++>>>0]=P}else if(2047>=P){if(l+1>=h)break;f[l++>>>0]=192|P>>6,f[l++>>>0]=128|63&P}else if(65535>=P){if(l+2>=h)break;f[l++>>>0]=224|P>>12,f[l++>>>0]=128|P>>6&63,f[l++>>>0]=128|63&P}else{if(l+3>=h)break;f[l++>>>0]=240|P>>18,f[l++>>>0]=128|P>>12&63,f[l++>>>0]=128|P>>6&63,f[l++>>>0]=128|63&P,C++}}f[l>>>0]=0,a=l-w}else a=0;return a},mr=a=>{for(var l=0,h=0;h<a.length;++h){var f=a.charCodeAt(h);127>=f?l++:2047>=f?l+=2:55296<=f&&57343>=f?(l+=4,++h):l+=3}return l};function xp(a,l){lt(a>>>=0,{name:l=Je(l>>>0),Oc(h){var f=(v(),L)[h>>>2>>>0];return f=Ae(h+4,f,!0),tt(h),f},Vc(h,f){f instanceof ArrayBuffer&&(f=new Uint8Array(f));var w=typeof f=="string";if(!(w||ArrayBuffer.isView(f)&&f.BYTES_PER_ELEMENT==1))throw new Nt("Cannot pass non-string to std::string");var C=w?mr(f):f.length,P=Qt(4+C+1),B=P+4;return(v(),L)[P>>>2>>>0]=C,w?gt(f,B,C+1):(v(),F).set(f,B>>>0),h!==null&&h.push(tt,P),P},Uc:Tn,Wc(h){tt(h)}})}var fi=globalThis.TextDecoder?new TextDecoder("utf-16le"):void 0,Sp=(a,l,h)=>{if(a>>>=1,16<(l=Yo((v(),X),a,l/2,h))-a&&fi)return fi.decode((v(),X).slice(a,l));for(h="";a<l;++a){var f=(v(),X)[a>>>0];h+=String.fromCharCode(f)}return h},Tp=(a,l,h)=>{if(h??=2147483647,2>h)return 0;var f=l;h=(h-=2)<2*a.length?h/2:a.length;for(var w=0;w<h;++w){var C=a.charCodeAt(w);(v(),q)[l>>>1>>>0]=C,l+=2}return(v(),q)[l>>>1>>>0]=0,l-f},Ip=a=>2*a.length,Cp=(a,l,h)=>{var f="";a>>>=2;for(var w=0;!(w>=l/4);w++){var C=(v(),L)[a+w>>>0];if(!C&&!h)break;f+=String.fromCodePoint(C)}return f},Ap=(a,l,h)=>{if(l>>>=0,h??=2147483647,4>h)return 0;var f=l;h=f+h-4;for(var w=0;w<a.length;++w){var C=a.codePointAt(w);if(65535<C&&w++,(v(),D)[l>>>2>>>0]=C,(l+=4)+4>h)break}return(v(),D)[l>>>2>>>0]=0,l-f},Ep=a=>{for(var l=0,h=0;h<a.length;++h)65535<a.codePointAt(h)&&h++,l+=4;return l};function kp(a,l,h){if(a>>>=0,l>>>=0,h=Je(h>>>=0),l===2)var f=Sp,w=Tp,C=Ip;else f=Cp,w=Ap,C=Ep;lt(a,{name:h,Oc:P=>{var B=(v(),L)[P>>>2>>>0];return B=f(P+4,B*l,!0),tt(P),B},Vc:(P,B)=>{if(typeof B!="string")throw new Nt(`Cannot pass non-string to C++ string type ${h}`);var H=C(B),K=Qt(4+H+l);return(v(),L)[K>>>2>>>0]=H/l,w(B,K+4,H+l),P!==null&&P.push(tt,K),K},Uc:Tn,Wc(P){tt(P)}})}function Pp(a,l){lt(a>>>=0,{zd:!0,name:l=Je(l>>>0),Oc:()=>{},Vc:()=>{}})}function Op(a){Dn(a>>>0,!n,1,!r,131072,!1),Go()}var fr=a=>{if(!A)try{if(a(),!(0<Ne))try{o?vr()&&Bn(b):_n(b)}catch(l){l instanceof Ee||l=="unwind"||c(0,l)}}catch(l){l instanceof Ee||l=="unwind"||c(0,l)}},zp=!Atomics.waitAsync||globalThis.navigator?.userAgent&&91>Number((navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./)||[])[2]);function In(a){a>>>=0,zp||(Atomics.waitAsync((v(),D),a>>>2,a).value.then(hr),a+=128,Atomics.store((v(),D),a>>>2,1))}var hr=()=>fr(()=>{var a=vr();a&&(In(a),Li())});function Dp(a,l){(a>>>=0)==l>>>0?setTimeout(hr):o?postMessage({Zc:a,Sc:"checkMailbox"}):(a=It[a])&&a.postMessage({Sc:"checkMailbox"})}var Cn=[];function Bp(a,l,h,f,w){for(l>>>=0,w>>>=0,Cn.length=0,h=w>>>3,f=w+f>>>3;h<f;){var C;C=(v(),Z)[h++>>>0]?(v(),Z)[h++>>>0]:(v(),Y)[h++>>>0],Cn.push(C)}return(l?Nn[l]:Im[a])(...Cn)}var Mp=()=>{Ne=0};function Rp(a){a>>>=0,o?postMessage({Sc:"cleanupThread",Nd:a}):Wo(It[a])}function Up(a){}var gr=a=>{try{a()}catch(l){M(l)}};function Np(a){var l=(...h)=>{br.push(a);try{return a(...h)}finally{A||(br.pop(),et&&bt===1&&br.length===0&&(bt=0,Ne+=1,gr(Ea),typeof Fibers<"u"&&Fibers.Zd()))}};return bi.set(a,l),l}var bt=0,et=null,hi=0,br=[],An=new Map,gi=new Map,bi=new Map,Vp=0,En=null,Lp=[],yi=a=>function(l){if(!A){if(bt===0){var h=!1,f=!1;l((w=0)=>{if(!A&&(hi=w,h=!0,f)){bt=2,gr(()=>ka(et)),typeof MainLoop<"u"&&MainLoop.ud&&MainLoop.resume(),w=!1;try{var C=function(){var H=(v(),D)[et+8>>>2>>>0];return H=gi.get(H),H=bi.get(H),--Ne,H()}()}catch(H){C=H,w=!0}var P=!1;if(!et){var B=En;B&&(En=null,(w?B.reject:B.resolve)(C),P=!0)}if(w&&!P)throw C}}),f=!0,h||(bt=1,et=function(){var w=Qt(65548),C=w+12;if((v(),L)[w>>>2>>>0]=C,(v(),L)[w+4>>>2>>>0]=C+65536,C=br[0],!An.has(C)){var P=Vp++;An.set(C,P),gi.set(P,C)}return C=An.get(C),(v(),D)[w+8>>>2>>>0]=C,w}(),typeof MainLoop<"u"&&MainLoop.ud&&MainLoop.pause(),gr(()=>Aa(et)))}else bt===2?(bt=0,gr(Pa),tt(et),et=null,Lp.forEach(fr)):M(`invalid state: ${bt}`);return hi}}(l=>{a().then(l)});function Wp(a){return a>>>=0,yi(async()=>{var l=await He(a);return Ke(l)})}var kn=[],Gp=a=>{var l=kn.length;return kn.push(a),l},Hp=(a,l)=>{for(var h=Array(a),f=0;f<a;++f){var w=f,C=(v(),L)[l+4*f>>>2>>>0],P=xn[C];if(P===void 0)throw a=`parameter ${f}`,C=Bi(C),l=Je(C),tt(C),new Nt(`${a} has unknown type ${l}`);h[w]=P}return h},Fp=(a,l,h)=>{var f=[];return a=a(f,h),f.length&&((v(),L)[l>>>2>>>0]=Ke(f)),a},qp={},yr=a=>{var l=qp[a];return l===void 0?Je(a):l};function Kp(a,l,h){var[f,...w]=Hp(a,l>>>0);l=f.Vc.bind(f);var C=w.map(H=>H.Uc.bind(H));a--;var P={toValue:He};switch(a=C.map((H,K)=>{var se=`argFromPtr${K}`;return P[se]=H,`${se}(args${K?"+"+8*K:""})`}),h){case 0:var B="toValue(handle)";break;case 2:B="new (toValue(handle))";break;case 3:B="";break;case 1:P.getStringOrSymbol=yr,B="toValue(handle)[getStringOrSymbol(methodName)]"}return B+=`(${a})`,f.zd||(P.toReturnWire=l,P.emval_returnValue=Fp,B=`return emval_returnValue(toReturnWire, destructorsRef, ${B})`),B=`return function (handle, methodName, destructorsRef, args) {
${B}
}`,h=new Function(Object.keys(P),B)(...Object.values(P)),B=`methodCaller<(${w.map(H=>H.name)}) => ${f.name}>`,Gp(Object.defineProperty(h,"name",{value:B}))}function jp(a,l){return l>>>=0,(a=He(a>>>0))==He(l)}function Zp(a){return(a>>>=0)?(a=yr(a),Ke(globalThis[a])):Ke(globalThis)}function Qp(a){return a=yr(a>>>0),Ke(e[a])}function Yp(a,l){return l>>>=0,a=He(a>>>0),l=He(l),Ke(a[l])}function Xp(a){9<(a>>>=0)&&(Ct[a+1]+=1)}function _i(a,l,h,f,w){return kn[a>>>0](l>>>0,h>>>0,f>>>0,w>>>0)}function Jp(a,l,h,f,w){return _i(a>>>0,l>>>0,h>>>0,f>>>0,w>>>0)}function em(){return Ke([])}function tm(a){a=He(a>>>0);for(var l=Array(a.length),h=0;h<a.length;h++)l[h]=a[h];return Ke(l)}function rm(a){return Ke(yr(a>>>0))}function nm(){return Ke({})}function om(a){for(var l=He(a>>>=0);l.length;){var h=l.pop();l.pop()(h)}Sn(a)}function im(a,l,h){l>>>=0,h>>>=0,a=He(a>>>0),l=He(l),h=He(h),a[l]=h}function am(a,l){a=-9007199254740992>a||9007199254740992<a?NaN:Number(a),l>>>=0,a=new Date(1e3*a),(v(),D)[l>>>2>>>0]=a.getUTCSeconds(),(v(),D)[l+4>>>2>>>0]=a.getUTCMinutes(),(v(),D)[l+8>>>2>>>0]=a.getUTCHours(),(v(),D)[l+12>>>2>>>0]=a.getUTCDate(),(v(),D)[l+16>>>2>>>0]=a.getUTCMonth(),(v(),D)[l+20>>>2>>>0]=a.getUTCFullYear()-1900,(v(),D)[l+24>>>2>>>0]=a.getUTCDay(),a=(a.getTime()-Date.UTC(a.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,(v(),D)[l+28>>>2>>>0]=a}var wi=a=>a%4==0&&(a%100!=0||a%400==0),vi=[0,31,60,91,121,152,182,213,244,274,305,335],$i=[0,31,59,90,120,151,181,212,243,273,304,334];function sm(a,l){a=-9007199254740992>a||9007199254740992<a?NaN:Number(a),l>>>=0,a=new Date(1e3*a),(v(),D)[l>>>2>>>0]=a.getSeconds(),(v(),D)[l+4>>>2>>>0]=a.getMinutes(),(v(),D)[l+8>>>2>>>0]=a.getHours(),(v(),D)[l+12>>>2>>>0]=a.getDate(),(v(),D)[l+16>>>2>>>0]=a.getMonth(),(v(),D)[l+20>>>2>>>0]=a.getFullYear()-1900,(v(),D)[l+24>>>2>>>0]=a.getDay();var h=(wi(a.getFullYear())?vi:$i)[a.getMonth()]+a.getDate()-1|0;(v(),D)[l+28>>>2>>>0]=h,(v(),D)[l+36>>>2>>>0]=-60*a.getTimezoneOffset(),h=new Date(a.getFullYear(),6,1).getTimezoneOffset();var f=new Date(a.getFullYear(),0,1).getTimezoneOffset();a=0|(h!=f&&a.getTimezoneOffset()==Math.min(f,h)),(v(),D)[l+32>>>2>>>0]=a}function um(a){a>>>=0;var l=new Date((v(),D)[a+20>>>2>>>0]+1900,(v(),D)[a+16>>>2>>>0],(v(),D)[a+12>>>2>>>0],(v(),D)[a+8>>>2>>>0],(v(),D)[a+4>>>2>>>0],(v(),D)[a>>>2>>>0],0),h=(v(),D)[a+32>>>2>>>0],f=l.getTimezoneOffset(),w=new Date(l.getFullYear(),6,1).getTimezoneOffset(),C=new Date(l.getFullYear(),0,1).getTimezoneOffset(),P=Math.min(C,w);return 0>h?(v(),D)[a+32>>>2>>>0]=+(w!=C&&P==f):0<h!=(P==f)&&(w=Math.max(C,w),l.setTime(l.getTime()+6e4*((0<h?P:w)-f))),(v(),D)[a+24>>>2>>>0]=l.getDay(),h=(wi(l.getFullYear())?vi:$i)[l.getMonth()]+l.getDate()-1|0,(v(),D)[a+28>>>2>>>0]=h,(v(),D)[a>>>2>>>0]=l.getSeconds(),(v(),D)[a+4>>>2>>>0]=l.getMinutes(),(v(),D)[a+8>>>2>>>0]=l.getHours(),(v(),D)[a+12>>>2>>>0]=l.getDate(),(v(),D)[a+16>>>2>>>0]=l.getMonth(),(v(),D)[a+20>>>2>>>0]=l.getYear(),a=l.getTime(),BigInt(isNaN(a)?-1:a/1e3)}function xi(a,l,h,f,w,C,P){return o?Se(16,1,a,l,h,f,w,C,P):-52}function Si(a,l,h,f,w,C){if(o)return Se(17,1,a,l,h,f,w,C)}var Zt={},dm=()=>performance.timeOrigin+performance.now();function Ti(a,l){if(o)return Se(18,1,a,l);if(Zt[a]&&(clearTimeout(Zt[a].id),delete Zt[a]),!l)return 0;var h=setTimeout(()=>{delete Zt[a],fr(()=>Vi(a,performance.timeOrigin+performance.now()))},l);return Zt[a]={id:h,Yd:l},0}function lm(a,l,h,f){a>>>=0,l>>>=0,h>>>=0,f>>>=0;var w=new Date().getFullYear(),C=new Date(w,0,1).getTimezoneOffset();w=new Date(w,6,1).getTimezoneOffset();var P=Math.max(C,w);(v(),L)[a>>>2>>>0]=60*P,(v(),D)[l>>>2>>>0]=+(C!=w),a=(l=B=>{var H=Math.abs(B);return`UTC${0<=B?"-":"+"}${String(Math.floor(H/60)).padStart(2,"0")}${String(H%60).padStart(2,"0")}`})(C),l=l(w),w<C?(gt(a,h,17),gt(l,f,17)):(gt(a,f,17),gt(l,h,17))}var cm=()=>Date.now(),pm=1;function mm(a,l,h){if(h>>>=0,!(0<=a&&3>=a))return 28;if(a===0)a=Date.now();else{if(!pm)return 52;a=performance.timeOrigin+performance.now()}return a=Math.round(1e6*a),(v(),Z)[h>>>3>>>0]=BigInt(a),0}var Pn=[],Ii=(a,l)=>{Pn.length=0;for(var h;h=(v(),F)[a++>>>0];){var f=h!=105;l+=(f&=h!=112)&&l%8?4:0,Pn.push(h==112?(v(),L)[l>>>2>>>0]:h==106?(v(),Z)[l>>>3>>>0]:h==105?(v(),D)[l>>>2>>>0]:(v(),Y)[l>>>3>>>0]),l+=f?8:4}return Pn};function fm(a,l,h){return a>>>=0,l=Ii(l>>>0,h>>>0),Nn[a](...l)}function hm(a,l,h){return a>>>=0,l=Ii(l>>>0,h>>>0),Nn[a](...l)}var gm=()=>{};function bm(a,l){return E(Ae(a>>>0,l>>>0))}var ym=()=>{throw Ne+=1,"unwind"};function _m(){return 4294901760}var wm=()=>navigator.hardwareConcurrency,At={},_r=a=>{var l;return(l=/\bwasm-function\[\d+\]:(0x[0-9a-f]+)/.exec(a))?+l[1]:(l=/:(\d+):\d+(?:\)|$)/.exec(a))?2147483648|+l[1]:0},Ci=a=>{for(var l of a)(a=_r(l))&&(At[a]=l)};function vm(){var a=Error().stack.toString().split(`
`);return a[0]=="Error"&&a.shift(),Ci(a),At.gd=_r(a[3]),At.Jd=a,At.gd}function wr(a){if(!(a=At[a>>>0]))return 0;var l;if(l=/^\s+at .*\.wasm\.(.*) \(.*\)$/.exec(a))a=l[1];else if(l=/^\s+at (.*) \(.*\)$/.exec(a))a=l[1];else{if(!(l=/^(.+?)@/.exec(a)))return 0;a=l[1]}tt(wr.hd??0),l=mr(a)+1;var h=Qt(l);return h&>(a,h,l),wr.hd=h,wr.hd}function $m(a){a>>>=0;var l=(v(),F).length;if(a<=l||4294901760<a)return!1;for(var h=1;4>=h;h*=2){var f=l*(1+.2/h);f=Math.min(f,a+100663296);e:{f=(Math.min(4294901760,65536*Math.ceil(Math.max(a,f)/65536))-ht.buffer.byteLength+65535)/65536|0;try{ht.grow(f),Me();var w=1;break e}catch{}w=void 0}if(w)return!0}return!1}function xm(a,l,h){if(a>>>=0,l>>>=0,At.gd==a)var f=At.Jd;else(f=Error().stack.toString().split(`
`))[0]=="Error"&&f.shift(),Ci(f);for(var w=3;f[w]&&_r(f[w])!=a;)++w;for(a=0;a<h&&f[a+w];++a)(v(),D)[l+4*a>>>2>>>0]=_r(f[a+w]);return a}var On,zn={},Ai=()=>{if(!On){var a,l={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(globalThis.navigator?.language??"C").replace("-","_")+".UTF-8",_:"./this.program"};for(a in zn)zn[a]===void 0?delete l[a]:l[a]=zn[a];var h=[];for(a in l)h.push(`${a}=${l[a]}`);On=h}return On};function Ei(a,l){if(o)return Se(19,1,a,l);a>>>=0,l>>>=0;var h,f=0,w=0;for(h of Ai()){var C=l+f;(v(),L)[a+w>>>2>>>0]=C,f+=gt(h,C,1/0)+1,w+=4}return 0}function ki(a,l){if(o)return Se(20,1,a,l);a>>>=0,l>>>=0;var h=Ai();for(var f of((v(),L)[a>>>2>>>0]=h.length,a=0,h))a+=mr(f)+1;return(v(),L)[l>>>2>>>0]=a,0}function Pi(a){return o?Se(21,1,a):52}function Oi(a,l,h,f){return o?Se(22,1,a,l,h,f):52}function zi(a,l,h,f){return o?Se(23,1,a,l,h,f):70}var Sm=[null,[],[]];function Di(a,l,h,f){if(o)return Se(24,1,a,l,h,f);l>>>=0,h>>>=0,f>>>=0;for(var w=0,C=0;C<h;C++){var P=(v(),L)[l>>>2>>>0],B=(v(),L)[l+4>>>2>>>0];l+=8;for(var H=0;H<B;H++){var K=a,se=(v(),F)[P+H>>>0],pe=Sm[K];se===0||se===10?((K===1?I:E)(Xo(pe)),pe.length=0):pe.push(se)}w+=B}return(v(),L)[f>>>2>>>0]=w,0}function Tm(a){return a>>>0}o||function(){for(var a=e.numThreads-1;a--;)Fo();Pe.push(async()=>{var l=async function(){if(!o)return Promise.all(ft.map(Ho))}();he++,await l,--he==0&&Te&&(l=Te,Te=null,l())})}(),o||(ht=new WebAssembly.Memory({initial:256,maximum:65536,shared:!0}),Me()),e.wasmBinary&&(g=e.wasmBinary),e.stackSave=()=>de(),e.stackRestore=a=>ue(a),e.stackAlloc=a=>Mn(a),e.setValue=function(a,l,h="i8"){switch(h.endsWith("*")&&(h="*"),h){case"i1":case"i8":(v(),N)[a>>>0]=l;break;case"i16":(v(),q)[a>>>1>>>0]=l;break;case"i32":(v(),D)[a>>>2>>>0]=l;break;case"i64":(v(),Z)[a>>>3>>>0]=BigInt(l);break;case"float":(v(),Q)[a>>>2>>>0]=l;break;case"double":(v(),Y)[a>>>3>>>0]=l;break;case"*":(v(),L)[a>>>2>>>0]=l;break;default:M(`invalid type for setValue: ${h}`)}},e.getValue=function(a,l="i8"){switch(l.endsWith("*")&&(l="*"),l){case"i1":case"i8":return(v(),N)[a>>>0];case"i16":return(v(),q)[a>>>1>>>0];case"i32":return(v(),D)[a>>>2>>>0];case"i64":return(v(),Z)[a>>>3>>>0];case"float":return(v(),Q)[a>>>2>>>0];case"double":return(v(),Y)[a>>>3>>>0];case"*":return(v(),L)[a>>>2>>>0];default:M(`invalid type for getValue: ${l}`)}},e.UTF8ToString=Ae,e.stringToUTF8=gt,e.lengthBytesUTF8=mr;var Bi,Mi,vr,tt,Qt,Dn,Ri,Ui,Ni,Bn,Vi,Li,ce,