UNPKG

zego-express-engine-webrtc

Version:

zego webrtc express sdk

1 lines 339 kB
!function(t,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n(require("long"));else if("function"==typeof define&&define.amd)define(["long"],n);else{var i="object"==typeof exports?n(require("long")):n(t.long);for(var r in i)("object"==typeof exports?exports:t)[r]=i[r]}}(Object("undefined"!=typeof self?self:this),function(t){return function(){var n={19:function(t,n,i){var r,e,o,s,u,c,a,l;t.exports=(l=i(9021),i(3009),i(1025),s=(e=(r=l).lib).WordArray,c=(u=r.algo).HMAC,a=u.PBKDF2=(o=e.Base).extend({cfg:o.extend({keySize:4,hasher:u.SHA256,iterations:25e4}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,n){for(var i=this.cfg,r=c.create(i.hasher,t),e=s.create(),o=s.create([1]),u=e.words,a=o.words,l=i.keySize,h=i.iterations;u.length<l;){var d=r.update(n).finalize(o);r.reset();for(var f=d.words,b=f.length,m=d,Z=1;Z<h;Z++){m=r.finalize(m),r.reset();for(var y=m.words,v=0;v<b;v++)f[v]^=y[v]}e.concat(d),a[0]++}return e.sigBytes=4*l,e}}),r.PBKDF2=function(t,n,i){return a.create(i).compute(t,n)},l.PBKDF2)},25:function(t,n,i){var r,e,o;t.exports=(o=i(9021),i(7165),r=o.lib.CipherParams,e=o.enc.Hex,o.format.Hex={stringify:function(t){return t.ciphertext.toString(e)},parse:function(t){var n=e.parse(t);return r.create({ciphertext:n})}},o.format.Hex)},477:function(){},482:function(t,n,i){var r;t.exports=(r=i(9021),i(7165),r.pad.Iso97971={pad:function(t,n){t.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(t,n)},unpad:function(t){r.pad.ZeroPadding.unpad(t),t.sigBytes--}},r.pad.Iso97971)},754:function(t,n,i){var r;t.exports=(r=i(9021),function(){var t=r.lib.WordArray;function n(n,i,r){for(var e=[],o=0,s=0;s<i;s++)if(s%4){var u=r[n.charCodeAt(s-1)]<<s%4*2,c=r[n.charCodeAt(s)]>>>6-s%4*2;e[o>>>2]|=(u|c)<<24-o%4*8,o++}return t.create(e,o)}r.enc.Base64={stringify:function(t){var n=t.words,i=t.sigBytes,r=this._map;t.clamp();for(var e=[],o=0;o<i;o+=3)for(var s=(n[o>>>2]>>>24-o%4*8&255)<<16|(n[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|n[o+2>>>2]>>>24-(o+2)%4*8&255,u=0;u<4&&o+.75*u<i;u++)e.push(r.charAt(s>>>6*(3-u)&63));var c=r.charAt(64);if(c)for(;e.length%4;)e.push(c);return e.join("")},parse:function(t){var i=t.length,r=this._map,e=this._reverseMap;if(!e){e=this._reverseMap=[];for(var o=0;o<r.length;o++)e[r.charCodeAt(o)]=o}var s=r.charAt(64);if(s){var u=t.indexOf(s);-1!==u&&(i=u)}return n(t,i,e)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),r.enc.Base64)},795:function(t){var n;self,n=()=>(()=>{var t={453:(t,n,i)=>{"use strict";i.r(n),i.d(n,{InferenceSession:()=>b,Tensor:()=>d,env:()=>s,registerBackend:()=>o});const r={},e=[],o=(t,n,i)=>{if(!n||"function"!=typeof n.init||"function"!=typeof n.createSessionHandler)throw new TypeError("not a valid backend");{const o=r[t];if(void 0===o)r[t]={backend:n,priority:i};else{if(o.priority>i)return;if(o.priority===i&&o.backend!==n)throw new Error(`cannot register backend "${t}" using priority ${i}`)}if(i>=0){const n=e.indexOf(t);-1!==n&&e.splice(n,1);for(let n=0;n<e.length;n++)if(r[e[n]].priority<=i)return void e.splice(n,0,t);e.push(t)}}},s=new class{constructor(){this.wasm={},this.webgl={},this.logLevelInternal="warning"}set logLevel(t){if(void 0!==t){if("string"!=typeof t||-1===["verbose","info","warning","error","fatal"].indexOf(t))throw new Error(`Unsupported logging level: ${t}`);this.logLevelInternal=t}}get logLevel(){return this.logLevelInternal}},u="undefined"!=typeof BigInt64Array&&"function"==typeof BigInt64Array.from,c="undefined"!=typeof BigUint64Array&&"function"==typeof BigUint64Array.from,a=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array]]),l=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]);u&&(a.set("int64",BigInt64Array),l.set(BigInt64Array,"int64")),c&&(a.set("uint64",BigUint64Array),l.set(BigUint64Array,"uint64"));class h{constructor(t,n,i){let r,e,o;if("string"==typeof t)if(r=t,o=i,"string"===t){if(!Array.isArray(n))throw new TypeError("A string tensor's data must be a string array.");e=n}else{const i=a.get(t);if(void 0===i)throw new TypeError(`Unsupported tensor type: ${t}.`);if(Array.isArray(n))e=i.from(n);else{if(!(n instanceof i))throw new TypeError(`A ${r} tensor's data must be type of ${i}`);e=n}}else if(o=n,Array.isArray(t)){if(0===t.length)throw new TypeError("Tensor type cannot be inferred from an empty array.");const n=typeof t[0];if("string"===n)r="string",e=t;else{if("boolean"!==n)throw new TypeError(`Invalid element type of data array: ${n}.`);r="bool",e=Uint8Array.from(t)}}else{const n=l.get(t.constructor);if(void 0===n)throw new TypeError(`Unsupported type for tensor data: ${t.constructor}.`);r=n,e=t}if(void 0===o)o=[e.length];else if(!Array.isArray(o))throw new TypeError("A tensor's dims must be a number array");const s=(t=>{let n=1;for(let i=0;i<t.length;i++){const r=t[i];if("number"!=typeof r||!Number.isSafeInteger(r))throw new TypeError(`dims[${i}] must be an integer, got: ${r}`);if(r<0)throw new RangeError(`dims[${i}] must be a non-negative integer, got: ${r}`);n*=r}return n})(o);if(s!==e.length)throw new Error(`Tensor's size(${s}) does not match data length(${e.length}).`);this.dims=o,this.type=r,this.data=e,this.size=s}static bufferToTensor(t,n){if(void 0===t)throw new Error("Image buffer must be defined");if(void 0===n.height||void 0===n.width)throw new Error("Image height and width must be defined");const{height:i,width:r}=n,e=n.norm;let o,s;o=void 0===e||void 0===e.mean?255:e.mean,s=void 0===e||void 0===e.bias?0:e.bias;const u=void 0!==n.bitmapFormat?n.bitmapFormat:"RGBA",c=void 0!==n.tensorFormat&&void 0!==n.tensorFormat?n.tensorFormat:"RGB",a=i*r,l="RGBA"===c?new Float32Array(4*a):new Float32Array(3*a);let d=4,f=0,b=1,m=2,Z=3,y=0,v=a,p=2*a,W=-1;"RGB"===u&&(d=3,f=0,b=1,m=2,Z=-1),"RGBA"===c?W=3*a:"RBG"===c?(y=0,p=a,v=2*a):"BGR"===c&&(p=0,v=a,y=2*a);for(let n=0;n<a;n++,f+=d,m+=d,b+=d,Z+=d)l[y++]=(t[f]+s)/o,l[v++]=(t[b]+s)/o,l[p++]=(t[m]+s)/o,-1!==W&&-1!==Z&&(l[W++]=(t[Z]+s)/o);return new h("float32",l,"RGBA"===c?[1,4,i,r]:[1,3,i,r])}static async fromImage(t,n){const i="undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement,r="undefined"!=typeof ImageData&&t instanceof ImageData,e="undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap,o="undefined"!=typeof String&&(t instanceof String||"string"==typeof t);let s,u={};if(i){const i=document.createElement("canvas");i.width=t.width,i.height=t.height;const r=i.getContext("2d");if(null==r)throw new Error("Can not access image data");{let i=t.height,e=t.width;if(void 0!==n&&void 0!==n.resizedHeight&&void 0!==n.resizedWidth&&(i=n.resizedHeight,e=n.resizedWidth),void 0!==n){if(u=n,void 0!==n.tensorFormat)throw new Error("Image input config format must be RGBA for HTMLImageElement");if(u.tensorFormat="RGBA",void 0!==n.height&&n.height!==i)throw new Error("Image input config height doesn't match HTMLImageElement height");if(u.height=i,void 0!==n.width&&n.width!==e)throw new Error("Image input config width doesn't match HTMLImageElement width");u.width=e}else u.tensorFormat="RGBA",u.height=i,u.width=e;r.drawImage(t,0,0),s=r.getImageData(0,0,e,i).data}}else{if(!r){if(e){if(void 0===n)throw new Error("Please provide image config with format for Imagebitmap");if(void 0!==n.bitmapFormat)throw new Error("Image input config format must be defined for ImageBitmap");const i=document.createElement("canvas").getContext("2d");if(null!=i){const r=t.height,e=t.width;if(i.drawImage(t,0,0,e,r),s=i.getImageData(0,0,e,r).data,void 0!==n){if(void 0!==n.height&&n.height!==r)throw new Error("Image input config height doesn't match ImageBitmap height");if(u.height=r,void 0!==n.width&&n.width!==e)throw new Error("Image input config width doesn't match ImageBitmap width");u.width=e}else u.height=r,u.width=e;return h.bufferToTensor(s,u)}throw new Error("Can not access image data")}if(o)return new Promise((i,r)=>{const e=document.createElement("canvas"),o=e.getContext("2d");if(!t||!o)return r();const s=new Image;s.crossOrigin="Anonymous",s.src=t,s.onload=()=>{e.width=s.width,e.height=s.height,o.drawImage(s,0,0,e.width,e.height);const t=o.getImageData(0,0,e.width,e.height);if(void 0!==n){if(void 0!==n.height&&n.height!==e.height)throw new Error("Image input config height doesn't match ImageBitmap height");if(u.height=e.height,void 0!==n.width&&n.width!==e.width)throw new Error("Image input config width doesn't match ImageBitmap width");u.width=e.width}else u.height=e.height,u.width=e.width;i(h.bufferToTensor(t.data,u))}});throw new Error("Input data provided is not supported - aborted tensor creation")}{let i,r;if(void 0!==n&&void 0!==n.resizedWidth&&void 0!==n.resizedHeight?(i=n.resizedHeight,r=n.resizedWidth):(i=t.height,r=t.width),void 0!==n){if(u=n,void 0!==n.bitmapFormat&&"RGBA"!==n.bitmapFormat)throw new Error("Image input config format must be RGBA for ImageData");u.bitmapFormat="RGBA"}else u.bitmapFormat="RGBA";if(u.height=i,u.width=r,void 0!==n){const n=document.createElement("canvas");n.width=r,n.height=i;const e=n.getContext("2d");if(null==e)throw new Error("Can not access image data");e.putImageData(t,0,0),s=e.getImageData(0,0,r,i).data}else s=t.data}}if(void 0!==s)return h.bufferToTensor(s,u);throw new Error("Input data provided is not supported - aborted tensor creation")}toImageData(t){var n,i;const r=document.createElement("canvas").getContext("2d");let e;if(null==r)throw new Error("Can not access image data");{const o=this.dims[3],s=this.dims[2],u=this.dims[1],c=void 0!==t&&void 0!==t.format?t.format:"RGB",a=void 0!==t&&void 0!==(null===(n=t.norm)||void 0===n?void 0:n.mean)?t.norm.mean:255,l=void 0!==t&&void 0!==(null===(i=t.norm)||void 0===i?void 0:i.bias)?t.norm.bias:0,h=s*o;if(void 0!==t){if(void 0!==t.height&&t.height!==s)throw new Error("Image output config height doesn't match tensor height");if(void 0!==t.width&&t.width!==o)throw new Error("Image output config width doesn't match tensor width");if(void 0!==t.format&&4===u&&"RGBA"!==t.format||3===u&&"RGB"!==t.format&&"BGR"!==t.format)throw new Error("Tensor format doesn't match input tensor dims")}const d=4;let f=0,b=1,m=2,Z=3,y=0,v=h,p=2*h,W=-1;"RGBA"===c?(y=0,v=h,p=2*h,W=3*h):"RGB"===c?(y=0,v=h,p=2*h):"RBG"===c&&(y=0,p=h,v=2*h),e=r.createImageData(o,s);for(let t=0;t<s*o;f+=d,b+=d,m+=d,Z+=d,t++)e.data[f]=(this.data[y++]-l)*a,e.data[b]=(this.data[v++]-l)*a,e.data[m]=(this.data[p++]-l)*a,e.data[Z]=-1===W?255:(this.data[W++]-l)*a}return e}reshape(t){return new h(this.type,this.data,t)}}const d=h;class f{constructor(t){this.handler=t}async run(t,n,i){const r={};let e={};if("object"!=typeof t||null===t||t instanceof d||Array.isArray(t))throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");let o=!0;if("object"==typeof n){if(null===n)throw new TypeError("Unexpected argument[1]: cannot be null.");if(n instanceof d)throw new TypeError("'fetches' cannot be a Tensor");if(Array.isArray(n)){if(0===n.length)throw new TypeError("'fetches' cannot be an empty array.");o=!1;for(const t of n){if("string"!=typeof t)throw new TypeError("'fetches' must be a string array or an object.");if(-1===this.outputNames.indexOf(t))throw new RangeError(`'fetches' contains invalid output name: ${t}.`);r[t]=null}if("object"==typeof i&&null!==i)e=i;else if(void 0!==i)throw new TypeError("'options' must be an object.")}else{let t=!1;const s=Object.getOwnPropertyNames(n);for(const i of this.outputNames)if(-1!==s.indexOf(i)){const e=n[i];(null===e||e instanceof d)&&(t=!0,o=!1,r[i]=e)}if(t){if("object"==typeof i&&null!==i)e=i;else if(void 0!==i)throw new TypeError("'options' must be an object.")}else e=n}}else if(void 0!==n)throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'.");for(const n of this.inputNames)if(void 0===t[n])throw new Error(`input '${n}' is missing in 'feeds'.`);if(o)for(const t of this.outputNames)r[t]=null;const s=await this.handler.run(t,r,e),u={};for(const t in s)Object.hasOwnProperty.call(s,t)&&(u[t]=new d(s[t].type,s[t].data,s[t].dims));return u}static async create(t,n,i,o){let s,u={};if("string"==typeof t){if(s=t,"object"==typeof n&&null!==n)u=n;else if(void 0!==n)throw new TypeError("'options' must be an object.")}else if(t instanceof Uint8Array){if(s=t,"object"==typeof n&&null!==n)u=n;else if(void 0!==n)throw new TypeError("'options' must be an object.")}else{if(!(t instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&t instanceof SharedArrayBuffer))throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");{const r=t;let e=0,c=t.byteLength;if("object"==typeof n&&null!==n)u=n;else if("number"==typeof n){if(e=n,!Number.isSafeInteger(e))throw new RangeError("'byteOffset' must be an integer.");if(e<0||e>=r.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${r.byteLength}).`);if(c=t.byteLength-e,"number"==typeof i){if(c=i,!Number.isSafeInteger(c))throw new RangeError("'byteLength' must be an integer.");if(c<=0||e+c>r.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${r.byteLength-e}].`);if("object"==typeof o&&null!==o)u=o;else if(void 0!==o)throw new TypeError("'options' must be an object.")}else if(void 0!==i)throw new TypeError("'byteLength' must be a number.")}else if(void 0!==n)throw new TypeError("'options' must be an object.");s=new Uint8Array(r,e,c)}}const c=(u.executionProviders||[]).map(t=>"string"==typeof t?t:t.name),a=await(async t=>{const n=0===t.length?e:t,i=[];for(const t of n){const n=r[t];if(n){if(n.initialized)return n.backend;if(n.aborted)continue;const r=!!n.initPromise;try{return r||(n.initPromise=n.backend.init()),await n.initPromise,n.initialized=!0,n.backend}catch(e){r||i.push({name:t,err:e}),n.aborted=!0}finally{delete n.initPromise}}}throw new Error(`no available backend found. ERR: ${i.map(t=>`[${t.name}] ${t.err}`).join(", ")}`)})(c),l=await a.createSessionHandler(s,u);return new f(l)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}}const b=f},932:(t,n,i)=>{var r,e=(r=(r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t={}){var n,e,o;n||(n=void 0!==t?t:{}),n.ready=new Promise(function(t,n){e=t,o=n});var s,u,c,a=Object.assign({},n),l="./this.program",h="object"==typeof window,d="function"==typeof importScripts,f="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,b="";if(f){var m=i(384),Z=i(908);b=d?Z.dirname(b)+"/":"//",s=(t,n)=>(t=t.startsWith("file://")?new URL(t):Z.normalize(t),m.readFileSync(t,n?void 0:"utf8")),c=t=>((t=s(t,!0)).buffer||(t=new Uint8Array(t)),t),u=(t,n,i)=>{t=t.startsWith("file://")?new URL(t):Z.normalize(t),m.readFile(t,function(t,r){t?i(t):n(r.buffer)})},1<process.argv.length&&(l=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",function(t){throw t}),15>process.versions.node.split(".")[0]&&process.on("unhandledRejection",function(t){throw t}),n.inspect=function(){return"[Emscripten Module object]"}}else(h||d)&&(d?b=self.location.href:"undefined"!=typeof document&&document.currentScript&&(b=document.currentScript.src),r&&(b=r),b=0!==b.indexOf("blob:")?b.substr(0,b.replace(/[?#].*/,"").lastIndexOf("/")+1):"",s=t=>{var n=new XMLHttpRequest;return n.open("GET",t,!1),n.send(null),n.responseText},d&&(c=t=>{var n=new XMLHttpRequest;return n.open("GET",t,!1),n.responseType="arraybuffer",n.send(null),new Uint8Array(n.response)}),u=(t,n,i)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?n(r.response):i()},r.onerror=i,r.send(null)});var y,v=n.print||console.log.bind(console),p=n.printErr||console.warn.bind(console);Object.assign(n,a),a=null,n.thisProgram&&(l=n.thisProgram),n.wasmBinary&&(y=n.wasmBinary),"object"!=typeof WebAssembly&&F("no native wasm support detected");var W,X,G,V,I,g=!1,w="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function Y(t,n,i){var r=(n>>>=0)+i;for(i=n;t[i]&&!(i>=r);)++i;if(16<i-n&&t.buffer&&w)return w.decode(t.subarray(n,i));for(r="";n<i;){var e=t[n++];if(128&e){var o=63&t[n++];if(192==(224&e))r+=String.fromCharCode((31&e)<<6|o);else{var s=63&t[n++];65536>(e=224==(240&e)?(15&e)<<12|o<<6|s:(7&e)<<18|o<<12|s<<6|63&t[n++])?r+=String.fromCharCode(e):(e-=65536,r+=String.fromCharCode(55296|e>>10,56320|1023&e))}}else r+=String.fromCharCode(e)}return r}function S(t,n){return(t>>>=0)?Y(G,t,n):""}function K(t,n,i,r){if(!(0<r))return 0;var e=i>>>=0;r=i+r-1;for(var o=0;o<t.length;++o){var s=t.charCodeAt(o);if(55296<=s&&57343>=s&&(s=65536+((1023&s)<<10)|1023&t.charCodeAt(++o)),127>=s){if(i>=r)break;n[i++>>>0]=s}else{if(2047>=s){if(i+1>=r)break;n[i++>>>0]=192|s>>6}else{if(65535>=s){if(i+2>=r)break;n[i++>>>0]=224|s>>12}else{if(i+3>=r)break;n[i++>>>0]=240|s>>18,n[i++>>>0]=128|s>>12&63}n[i++>>>0]=128|s>>6&63}n[i++>>>0]=128|63&s}}return n[i>>>0]=0,i-e}function R(t){for(var n=0,i=0;i<t.length;++i){var r=t.charCodeAt(i);127>=r?n++:2047>=r?n+=2:55296<=r&&57343>=r?(n+=4,++i):n+=3}return n}function k(){var t=W.buffer;n.HEAP8=X=new Int8Array(t),n.HEAP16=new Int16Array(t),n.HEAP32=V=new Int32Array(t),n.HEAPU8=G=new Uint8Array(t),n.HEAPU16=new Uint16Array(t),n.HEAPU32=I=new Uint32Array(t),n.HEAPF32=new Float32Array(t),n.HEAPF64=new Float64Array(t)}var C=[],T=[],J=[];function L(){var t=n.preRun.shift();C.unshift(t)}var N,x=0,H=null,P=null;function F(t){throw n.onAbort&&n.onAbort(t),p(t="Aborted("+t+")"),g=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),o(t),t}function B(t){return t.startsWith("data:application/octet-stream;base64,")}if(!B(N="ort-wasm.wasm")){var U=N;N=n.locateFile?n.locateFile(U,b):b+U}function z(t){try{if(t==N&&y)return new Uint8Array(y);if(c)return c(t);throw"both async and sync fetching of the wasm failed"}catch(t){F(t)}}function M(t,n,i){return function(t){if(!y&&(h||d)){if("function"==typeof fetch&&!t.startsWith("file://"))return fetch(t,{credentials:"same-origin"}).then(function(n){if(!n.ok)throw"failed to load wasm binary file at '"+t+"'";return n.arrayBuffer()}).catch(function(){return z(t)});if(u)return new Promise(function(n,i){u(t,function(t){n(new Uint8Array(t))},i)})}return Promise.resolve().then(function(){return z(t)})}(t).then(function(t){return WebAssembly.instantiate(t,n)}).then(function(t){return t}).then(i,function(t){p("failed to asynchronously prepare wasm: "+t),F(t)})}function j(t){for(;0<t.length;)t.shift()(n)}function Q(t){this.na=t-24,this.xa=function(t){I[this.na+4>>2>>>0]=t},this.ua=function(t){I[this.na+8>>2>>>0]=t},this.va=function(){V[this.na>>2>>>0]=0},this.ta=function(){X[(this.na+12|0)>>>0]=0},this.wa=function(){X[(this.na+13|0)>>>0]=0},this.ra=function(t,n){this.sa(),this.xa(t),this.ua(n),this.va(),this.ta(),this.wa()},this.sa=function(){I[this.na+16>>2>>>0]=0}}function E(t){return 0==t%4&&(0!=t%100||0==t%400)}var D=[0,31,60,91,121,152,182,213,244,274,305,335],O=[0,31,59,90,120,151,181,212,243,273,304,334];function A(t){return(E(t.getFullYear())?D:O)[t.getMonth()]+t.getDate()-1}function _(t){var n=R(t)+1,i=ut(n);return i&&K(t,X,i,n),i}var q={};function $(){if(!tt){var t,n={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:l||"./this.program"};for(t in q)void 0===q[t]?delete n[t]:n[t]=q[t];var i=[];for(t in n)i.push(t+"="+n[t]);tt=i}return tt}var tt,nt=[null,[],[]],it=[31,29,31,30,31,30,31,31,30,31,30,31],rt=[31,28,31,30,31,30,31,31,30,31,30,31];function et(t,n,i,r){function e(t,n,i){for(t="number"==typeof t?t.toString():t||"";t.length<n;)t=i[0]+t;return t}function o(t,n){return e(t,n,"0")}function s(t,n){function i(t){return 0>t?-1:0<t?1:0}var r;return 0===(r=i(t.getFullYear()-n.getFullYear()))&&0===(r=i(t.getMonth()-n.getMonth()))&&(r=i(t.getDate()-n.getDate())),r}function u(t){switch(t.getDay()){case 0:return new Date(t.getFullYear()-1,11,29);case 1:return t;case 2:return new Date(t.getFullYear(),0,3);case 3:return new Date(t.getFullYear(),0,2);case 4:return new Date(t.getFullYear(),0,1);case 5:return new Date(t.getFullYear()-1,11,31);case 6:return new Date(t.getFullYear()-1,11,30)}}function c(t){var n=t.la;for(t=new Date(new Date(t.ma+1900,0,1).getTime());0<n;){var i=t.getMonth(),r=(E(t.getFullYear())?it:rt)[i];if(!(n>r-t.getDate())){t.setDate(t.getDate()+n);break}n-=r-t.getDate()+1,t.setDate(1),11>i?t.setMonth(i+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return i=new Date(t.getFullYear()+1,0,4),n=u(new Date(t.getFullYear(),0,4)),i=u(i),0>=s(n,t)?0>=s(i,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var a=V[r+40>>2>>>0];for(var l in r={Aa:V[r>>2>>>0],za:V[r+4>>2>>>0],oa:V[r+8>>2>>>0],qa:V[r+12>>2>>>0],pa:V[r+16>>2>>>0],ma:V[r+20>>2>>>0],ha:V[r+24>>2>>>0],la:V[r+28>>2>>>0],Ca:V[r+32>>2>>>0],ya:V[r+36>>2>>>0],Ba:a?S(a):""},i=S(i),a={"%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"})i=i.replace(new RegExp(l,"g"),a[l]);var h="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),d="January February March April May June July August September October November December".split(" ");for(l in a={"%a":function(t){return h[t.ha].substring(0,3)},"%A":function(t){return h[t.ha]},"%b":function(t){return d[t.pa].substring(0,3)},"%B":function(t){return d[t.pa]},"%C":function(t){return o((t.ma+1900)/100|0,2)},"%d":function(t){return o(t.qa,2)},"%e":function(t){return e(t.qa,2," ")},"%g":function(t){return c(t).toString().substring(2)},"%G":function(t){return c(t)},"%H":function(t){return o(t.oa,2)},"%I":function(t){return 0==(t=t.oa)?t=12:12<t&&(t-=12),o(t,2)},"%j":function(t){for(var n=0,i=0;i<=t.pa-1;n+=(E(t.ma+1900)?it:rt)[i++]);return o(t.qa+n,3)},"%m":function(t){return o(t.pa+1,2)},"%M":function(t){return o(t.za,2)},"%n":function(){return"\n"},"%p":function(t){return 0<=t.oa&&12>t.oa?"AM":"PM"},"%S":function(t){return o(t.Aa,2)},"%t":function(){return"\t"},"%u":function(t){return t.ha||7},"%U":function(t){return o(Math.floor((t.la+7-t.ha)/7),2)},"%V":function(t){var n=Math.floor((t.la+7-(t.ha+6)%7)/7);if(2>=(t.ha+371-t.la-2)%7&&n++,n)53==n&&(4==(i=(t.ha+371-t.la)%7)||3==i&&E(t.ma)||(n=1));else{n=52;var i=(t.ha+7-t.la-1)%7;(4==i||5==i&&E(t.ma%400-1))&&n++}return o(n,2)},"%w":function(t){return t.ha},"%W":function(t){return o(Math.floor((t.la+7-(t.ha+6)%7)/7),2)},"%y":function(t){return(t.ma+1900).toString().substring(2)},"%Y":function(t){return t.ma+1900},"%z":function(t){var n=0<=(t=t.ya);return t=Math.abs(t)/60,(n?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.Ba},"%%":function(){return"%"}},i=i.replace(/%%/g,"\0\0"),a)i.includes(l)&&(i=i.replace(new RegExp(l,"g"),a[l](r)));return l=function(t){var n=Array(R(t)+1);return K(t,n,0,n.length),n}(i=i.replace(/\0\0/g,"%")),l.length>n?0:(X.set(l,t>>>0),l.length-1)}var ot={a:function(t,n,i){throw new Q(t).ra(n,i),t},m:function(){F("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},e:function(){return 0},J:function(){},w:function(){},y:function(){},p:function(){return 0},H:function(){},C:function(){},G:function(){},g:function(){},x:function(){},t:function(){},I:function(){},v:function(){},K:function(){return!0},i:function(t,n){t=new Date(1e3*(I[t>>>2]+4294967296*V[t+4>>>2])),V[n>>2>>>0]=t.getUTCSeconds(),V[n+4>>2>>>0]=t.getUTCMinutes(),V[n+8>>2>>>0]=t.getUTCHours(),V[n+12>>2>>>0]=t.getUTCDate(),V[n+16>>2>>>0]=t.getUTCMonth(),V[n+20>>2>>>0]=t.getUTCFullYear()-1900,V[n+24>>2>>>0]=t.getUTCDay(),V[n+28>>2>>>0]=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},j:function(t,n){t=new Date(1e3*(I[t>>>2]+4294967296*V[t+4>>>2])),V[n>>2>>>0]=t.getSeconds(),V[n+4>>2>>>0]=t.getMinutes(),V[n+8>>2>>>0]=t.getHours(),V[n+12>>2>>>0]=t.getDate(),V[n+16>>2>>>0]=t.getMonth(),V[n+20>>2>>>0]=t.getFullYear()-1900,V[n+24>>2>>>0]=t.getDay(),V[n+28>>2>>>0]=0|A(t),V[n+36>>2>>>0]=-60*t.getTimezoneOffset();var i=new Date(t.getFullYear(),6,1).getTimezoneOffset(),r=new Date(t.getFullYear(),0,1).getTimezoneOffset();V[n+32>>2>>>0]=0|(i!=r&&t.getTimezoneOffset()==Math.min(r,i))},k:function(t){var n=new Date(V[t+20>>2>>>0]+1900,V[t+16>>2>>>0],V[t+12>>2>>>0],V[t+8>>2>>>0],V[t+4>>2>>>0],V[t>>2>>>0],0),i=V[t+32>>2>>>0],r=n.getTimezoneOffset(),e=new Date(n.getFullYear(),6,1).getTimezoneOffset(),o=new Date(n.getFullYear(),0,1).getTimezoneOffset(),s=Math.min(o,e);return 0>i?V[t+32>>2>>>0]=Number(e!=o&&s==r):0<i!=(s==r)&&(e=Math.max(o,e),n.setTime(n.getTime()+6e4*((0<i?s:e)-r))),V[t+24>>2>>>0]=n.getDay(),V[t+28>>2>>>0]=0|A(n),V[t>>2>>>0]=n.getSeconds(),V[t+4>>2>>>0]=n.getMinutes(),V[t+8>>2>>>0]=n.getHours(),V[t+12>>2>>>0]=n.getDate(),V[t+16>>2>>>0]=n.getMonth(),V[t+20>>2>>>0]=n.getYear(),n.getTime()/1e3|0},A:function(){return-52},B:function(){},l:function(t,n,i){function r(t){return(t=t.toTimeString().match(/\(([A-Za-z ]+)\)$/))?t[1]:"GMT"}var e=(new Date).getFullYear(),o=new Date(e,0,1),s=new Date(e,6,1);e=o.getTimezoneOffset();var u=s.getTimezoneOffset();I[t>>2>>>0]=60*Math.max(e,u),V[n>>2>>>0]=Number(e!=u),t=r(o),n=r(s),t=_(t),n=_(n),u<e?(I[i>>2>>>0]=t,I[i+4>>2>>>0]=n):(I[i>>2>>>0]=n,I[i+4>>2>>>0]=t)},c:function(){F("")},D:function(){F("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},h:function(){return Date.now()},r:function(){return 4294901760},b:f?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:()=>performance.now(),z:function(t,n,i){G.copyWithin(t>>>0,n>>>0,n+i>>>0)},q:function(t){var n=G.length;if(4294901760<(t>>>=0))return!1;for(var i=1;4>=i;i*=2){var r=n*(1+.2/i);r=Math.min(r,t+100663296);var e=Math,o=e.min;r=Math.max(t,r),r+=(65536-r%65536)%65536;t:{var s=W.buffer;try{W.grow(o.call(e,4294901760,r)-s.byteLength+65535>>>16),k();var u=1;break t}catch(t){}u=void 0}if(u)return!0}return!1},E:function(t,n){var i=0;return $().forEach(function(r,e){var o=n+i;for(e=I[t+4*e>>2>>>0]=o,o=0;o<r.length;++o)X[(0|e++)>>>0]=r.charCodeAt(o);X[(0|e)>>>0]=0,i+=r.length+1}),0},F:function(t,n){var i=$();I[t>>2>>>0]=i.length;var r=0;return i.forEach(function(t){r+=t.length+1}),I[n>>2>>>0]=r,0},d:function(){return 52},f:function(){return 52},n:function(){return 70},s:function(t,n,i,r){for(var e=0,o=0;o<i;o++){var s=I[n>>2>>>0],u=I[n+4>>2>>>0];n+=8;for(var c=0;c<u;c++){var a=G[s+c>>>0],l=nt[t];0===a||10===a?((1===t?v:p)(Y(l,0)),l.length=0):l.push(a)}e+=u}return I[r>>2>>>0]=e,0},u:et,o:function(t,n,i,r){return et(t,n,i,r)}};!function(){function t(t){if(n.asm=t=t.exports,W=n.asm.L,k(),T.unshift(n.asm.M),x--,n.monitorRunDependencies&&n.monitorRunDependencies(x),0==x&&(null!==H&&(clearInterval(H),H=null),P)){var i=P;P=null,i()}return t}var i={a:ot};if(x++,n.monitorRunDependencies&&n.monitorRunDependencies(x),n.instantiateWasm)try{return n.instantiateWasm(i,t)}catch(t){p("Module.instantiateWasm callback failed with error: "+t),o(t)}(function(t,n){var i=N;return y||"function"!=typeof WebAssembly.instantiateStreaming||B(i)||i.startsWith("file://")||f||"function"!=typeof fetch?M(i,t,n):fetch(i,{credentials:"same-origin"}).then(function(r){return WebAssembly.instantiateStreaming(r,t).then(n,function(r){return v("wasm streaming compile failed: "+r),v("falling back to ArrayBuffer instantiation"),M(i,t,n)})})})(i,function(n){t(n.instance)}).catch(o)}(),n._OrtInit=function(){return(n._OrtInit=n.asm.N).apply(null,arguments)},n._OrtCreateSessionOptions=function(){return(n._OrtCreateSessionOptions=n.asm.O).apply(null,arguments)},n._OrtAppendExecutionProvider=function(){return(n._OrtAppendExecutionProvider=n.asm.P).apply(null,arguments)},n._OrtAddSessionConfigEntry=function(){return(n._OrtAddSessionConfigEntry=n.asm.Q).apply(null,arguments)},n._OrtReleaseSessionOptions=function(){return(n._OrtReleaseSessionOptions=n.asm.R).apply(null,arguments)},n._OrtCreateSession=function(){return(n._OrtCreateSession=n.asm.S).apply(null,arguments)},n._OrtReleaseSession=function(){return(n._OrtReleaseSession=n.asm.T).apply(null,arguments)},n._OrtGetInputCount=function(){return(n._OrtGetInputCount=n.asm.U).apply(null,arguments)},n._OrtGetOutputCount=function(){return(n._OrtGetOutputCount=n.asm.V).apply(null,arguments)},n._OrtGetInputName=function(){return(n._OrtGetInputName=n.asm.W).apply(null,arguments)},n._OrtGetOutputName=function(){return(n._OrtGetOutputName=n.asm.X).apply(null,arguments)},n._OrtFree=function(){return(n._OrtFree=n.asm.Y).apply(null,arguments)},n._OrtCreateTensor=function(){return(n._OrtCreateTensor=n.asm.Z).apply(null,arguments)},n._OrtGetTensorData=function(){return(n._OrtGetTensorData=n.asm._).apply(null,arguments)},n._OrtReleaseTensor=function(){return(n._OrtReleaseTensor=n.asm.$).apply(null,arguments)},n._OrtCreateRunOptions=function(){return(n._OrtCreateRunOptions=n.asm.aa).apply(null,arguments)},n._OrtAddRunConfigEntry=function(){return(n._OrtAddRunConfigEntry=n.asm.ba).apply(null,arguments)},n._OrtReleaseRunOptions=function(){return(n._OrtReleaseRunOptions=n.asm.ca).apply(null,arguments)},n._OrtRun=function(){return(n._OrtRun=n.asm.da).apply(null,arguments)},n._OrtEndProfiling=function(){return(n._OrtEndProfiling=n.asm.ea).apply(null,arguments)};var st,ut=n._malloc=function(){return(ut=n._malloc=n.asm.fa).apply(null,arguments)};function ct(){return(ct=n.asm.ia).apply(null,arguments)}function at(){return(at=n.asm.ja).apply(null,arguments)}function lt(){return(lt=n.asm.ka).apply(null,arguments)}function ht(){function t(){if(!st&&(st=!0,n.calledRun=!0,!g)){if(j(T),e(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;){var t=n.postRun.shift();J.unshift(t)}j(J)}}if(!(0<x)){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)L();j(C),0<x||(n.setStatus?(n.setStatus("Running..."),setTimeout(function(){setTimeout(function(){n.setStatus("")},1),t()},1)):t())}}if(n._free=function(){return(n._free=n.asm.ga).apply(null,arguments)},n.UTF8ToString=S,n.stringToUTF8=function(t,n,i){return K(t,G,n,i)},n.lengthBytesUTF8=R,n.stackAlloc=lt,n.stackSave=ct,n.stackRestore=at,P=function t(){st||ht(),st||(P=t)},n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);0<n.preInit.length;)n.preInit.pop()();return ht(),t.ready});t.exports=e},200:(t,n,i)=>{"use strict";n.c8=n.rX=void 0;const r=i(453),e=i(381),o=i(157),s=i(306);n.rX=()=>{if(("number"!=typeof r.env.wasm.initTimeout||r.env.wasm.initTimeout<0)&&(r.env.wasm.initTimeout=0),"boolean"!=typeof r.env.wasm.simd&&(r.env.wasm.simd=!0),"boolean"!=typeof r.env.wasm.proxy&&(r.env.wasm.proxy=!1),"number"!=typeof r.env.wasm.numThreads||!Number.isInteger(r.env.wasm.numThreads)||r.env.wasm.numThreads<=0){const t="undefined"==typeof navigator?(0,e.cpus)().length:navigator.hardwareConcurrency;r.env.wasm.numThreads=Math.min(4,Math.ceil((t||1)/2))}},n.c8=new class{async init(){(0,n.rX)(),await(0,o.initWasm)()}async createSessionHandler(t,n){const i=new s.OnnxruntimeWebAssemblySessionHandler;return await i.loadModel(t,n),Promise.resolve(i)}}},18:function(t,n,i){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,n,i,r){void 0===r&&(r=i);var e=Object.getOwnPropertyDescriptor(n,i);e&&!("get"in e?!n.__esModule:e.writable||e.configurable)||(e={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,r,e)}:function(t,n,i,r){void 0===r&&(r=i),t[r]=n[i]}),e=this&&this.__exportStar||function(t,n){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||r(n,t,i)};Object.defineProperty(n,"__esModule",{value:!0}),e(i(453),n);const o=i(453);{const t=i(200).c8;(0,o.registerBackend)("cpu",t,10),(0,o.registerBackend)("wasm",t,10),(0,o.registerBackend)("xnnpack",t,9)}},967:(t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.iterateExtraOptions=void 0,n.iterateExtraOptions=(t,i,r,e)=>{if("object"==typeof t&&null!==t){if(r.has(t))throw new Error("Circular reference in options");r.add(t)}Object.entries(t).forEach(([t,o])=>{const s=i?i+t:t;if("object"==typeof o)(0,n.iterateExtraOptions)(o,s+".",r,e);else if("string"==typeof o||"number"==typeof o)e(s,o.toString());else{if("boolean"!=typeof o)throw new Error("Can't handle extra config type: "+typeof o);e(s,o?"1":"0")}})}},157:function(t,n,i){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,n,i,r){void 0===r&&(r=i);var e=Object.getOwnPropertyDescriptor(n,i);e&&!("get"in e?!n.__esModule:e.writable||e.configurable)||(e={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,r,e)}:function(t,n,i,r){void 0===r&&(r=i),t[r]=n[i]}),e=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&r(n,t,i);return e(n,t),n};Object.defineProperty(n,"__esModule",{value:!0}),n.endProfiling=n.run=n.releaseSession=n.createSession=n.createSessionFinalize=n.createSessionAllocate=n.initOrt=n.initWasm=void 0;const s=i(453),u=o(i(349)),c=i(361);"undefined"!=typeof document&&(null===document||void 0===document||document),n.initWasm=async()=>(0,c.initializeWebAssembly)(s.env.wasm),n.initOrt=async(t,n)=>{u.initOrt(t,n)},n.createSessionAllocate=async t=>u.createSessionAllocate(t),n.createSessionFinalize=async(t,n)=>u.createSessionFinalize(t,n),n.createSession=async(t,n)=>u.createSession(t,n),n.releaseSession=async t=>{u.releaseSession(t)},n.run=async(t,n,i,r,e)=>u.run(t,n,i,r,e),n.endProfiling=async t=>{u.endProfiling(t)}},586:(t,n,i)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.setRunOptions=void 0;const r=i(967),e=i(983),o=i(361);n.setRunOptions=t=>{const n=(0,o.getInstance)();let i=0;const s=[],u=t||{};try{if(void 0===(null==t?void 0:t.logSeverityLevel))u.logSeverityLevel=2;else if("number"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))u.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);void 0===(null==t?void 0:t.terminate)&&(u.terminate=!1);let o=0;if(void 0!==(null==t?void 0:t.tag)&&(o=(0,e.allocWasmString)(t.tag,s)),i=n._OrtCreateRunOptions(u.logSeverityLevel,u.logVerbosityLevel,!!u.terminate,o),0===i)throw new Error("Can't create run options");return void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,"",new WeakSet,(t,r)=>{const o=(0,e.allocWasmString)(t,s),u=(0,e.allocWasmString)(r,s);if(0!==n._OrtAddRunConfigEntry(i,o,u))throw new Error(`Can't set a run config entry: ${t} - ${r}`)}),[i,s]}catch(t){throw 0!==i&&n._OrtReleaseRunOptions(i),s.forEach(n._free),t}}},306:(t,n,i)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.OnnxruntimeWebAssemblySessionHandler=void 0;const r=i(806),e=i(453),o=i(850),s=i(157);let u;n.OnnxruntimeWebAssemblySessionHandler=class{async createSessionAllocate(t){const n=await fetch(t),i=await n.arrayBuffer();return(0,s.createSessionAllocate)(new Uint8Array(i))}async loadModel(t,n){if(u||(await(0,s.initOrt)(e.env.wasm.numThreads,(t=>{switch(t){case"verbose":return 0;case"info":return 1;case"warning":return 2;case"error":return 3;case"fatal":return 4;default:throw new Error(`unsupported logging level: ${t}`)}})(e.env.logLevel)),u=!0),"string"==typeof t)if("undefined"==typeof fetch){const i=await(0,o.promisify)(r.readFile)(t);[this.sessionId,this.inputNames,this.outputNames]=await(0,s.createSession)(i,n)}else{const i=await this.createSessionAllocate(t);[this.sessionId,this.inputNames,this.outputNames]=await(0,s.createSessionFinalize)(i,n)}else[this.sessionId,this.inputNames,this.outputNames]=await(0,s.createSession)(t,n)}async dispose(){return(0,s.releaseSession)(this.sessionId)}async run(t,n,i){const r=[],o=[];Object.entries(t).forEach(t=>{const n=t[0],i=t[1],e=this.inputNames.indexOf(n);if(-1===e)throw new Error(`invalid input '${n}'`);r.push(i),o.push(e)});const u=[];Object.entries(n).forEach(t=>{const n=t[0],i=this.outputNames.indexOf(n);if(-1===i)throw new Error(`invalid output '${n}'`);u.push(i)});const c=await(0,s.run)(this.sessionId,o,r.map(t=>[t.type,t.dims,t.data]),u,i),a={};for(let t=0;t<c.length;t++)a[this.outputNames[u[t]]]=new e.Tensor(c[t][0],c[t][2],c[t][1]);return a}startProfiling(){}endProfiling(){(0,s.endProfiling)(this.sessionId)}}},919:(t,n,i)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.setSessionOptions=void 0;const r=i(967),e=i(983),o=i(361);n.setSessionOptions=t=>{const n=(0,o.getInstance)();let i=0;const s=[],u=t||{};(t=>{t.extra||(t.extra={}),t.extra.session||(t.extra.session={});const n=t.extra.session;n.use_ort_model_bytes_directly||(n.use_ort_model_bytes_directly="1")})(u);try{void 0===(null==t?void 0:t.graphOptimizationLevel)&&(u.graphOptimizationLevel="all");const c=(t=>{switch(t){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"all":return 99;default:throw new Error(`unsupported graph optimization level: ${t}`)}})(u.graphOptimizationLevel);void 0===(null==t?void 0:t.enableCpuMemArena)&&(u.enableCpuMemArena=!0),void 0===(null==t?void 0:t.enableMemPattern)&&(u.enableMemPattern=!0),void 0===(null==t?void 0:t.executionMode)&&(u.executionMode="sequential");const a=(t=>{switch(t){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${t}`)}})(u.executionMode);let l=0;if(void 0!==(null==t?void 0:t.logId)&&(l=(0,e.allocWasmString)(t.logId,s)),void 0===(null==t?void 0:t.logSeverityLevel))u.logSeverityLevel=2;else if("number"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))u.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);void 0===(null==t?void 0:t.enableProfiling)&&(u.enableProfiling=!1);let h=0;if("string"==typeof(null==t?void 0:t.optimizedModelFilePath)&&(h=(0,e.allocWasmString)(t.optimizedModelFilePath,s)),i=n._OrtCreateSessionOptions(c,!!u.enableCpuMemArena,!!u.enableMemPattern,a,!!u.enableProfiling,0,l,u.logSeverityLevel,u.logVerbosityLevel,h),0===i)throw new Error("Can't create session options");return(null==t?void 0:t.executionProviders)&&((t,n,i)=>{for(const r of n){let n="string"==typeof r?r:r.name;switch(n){case"xnnpack":n="XNNPACK";break;case"wasm":case"cpu":continue;default:throw new Error(`not supported EP: ${n}`)}const s=(0,e.allocWasmString)(n,i);if(0!==(0,o.getInstance)()._OrtAppendExecutionProvider(t,s))throw new Error(`Can't append execution provider: ${n}`)}})(i,t.executionProviders,s),void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,"",new WeakSet,(t,r)=>{const o=(0,e.allocWasmString)(t,s),u=(0,e.allocWasmString)(r,s);if(0!==n._OrtAddSessionConfigEntry(i,o,u))throw new Error(`Can't set a session config entry: ${t} - ${r}`)}),[i,s]}catch(t){throw 0!==i&&n._OrtReleaseSessionOptions(i),s.forEach(n._free),t}}},983:(t,n,i)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.allocWasmString=void 0;const r=i(361);n.allocWasmString=(t,n)=>{const i=(0,r.getInstance)(),e=i.lengthBytesUTF8(t)+1,o=i._malloc(e);return i.stringToUTF8(t,o,e),n.push(o),o}},349:(t,n,i)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.extractTransferableBuffers=n.endProfiling=n.run=n.releaseSession=n.createSession=n.createSessionFinalize=n.createSessionAllocate=n.initOrt=void 0;const r=i(586),e=i(919),o=i(983),s=i(361);n.initOrt=(t,n)=>{const i=(0,s.getInstance)()._OrtInit(t,n);if(0!==i)throw new Error(`Can't initialize onnxruntime. error code = ${i}`)};const u=new Map;n.createSessionAllocate=t=>{const n=(0,s.getInstance)(),i=n._malloc(t.byteLength);return n.HEAPU8.set(t,i),[i,t.byteLength]},n.createSessionFinalize=(t,n)=>{const i=(0,s.getInstance)();let r=0,o=0,c=[];try{if([o,c]=(0,e.setSessionOptions)(n),r=i._OrtCreateSession(t[0],t[1],o),0===r)throw new Error("Can't create a session")}finally{i._free(t[0]),i._OrtReleaseSessionOptions(o),c.forEach(i._free)}const a=i._OrtGetInputCount(r),l=i._OrtGetOutputCount(r),h=[],d=[],f=[],b=[];for(let t=0;t<a;t++){const n=i._OrtGetInputName(r,t);if(0===n)throw new Error("Can't get an input name");d.push(n),h.push(i.UTF8ToString(n))}for(let t=0;t<l;t++){const n=i._OrtGetOutputName(r,t);if(0===n)throw new Error("Can't get an output name");b.push(n),f.push(i.UTF8ToString(n))}return u.set(r,[r,d,b]),[r,h,f]},n.createSession=(t,i)=>{const r=(0,n.createSessionAllocate)(t);return(0,n.createSessionFinalize)(r,i)},n.releaseSession=t=>{const n=(0,s.getInstance)(),i=u.get(t);if(!i)throw new Error("invalid session id");const r=i[0],e=i[2];i[1].forEach(n._OrtFree),e.forEach(n._OrtFree),n._OrtReleaseSession(r),u.delete(t)};const c=t=>{switch(t){case"int8":return 3;case"uint8":return 2;case"bool":return 9;case"int16":return 5;case"uint16":return 4;case"int32":return 6;case"uint32":return 12;case"float32":return 1;case"float64":return 11;case"string":return 8;case"int64":return 7;case"uint64":return 13;default:throw new Error(`unsupported data type: ${t}`)}},a=t=>{switch(t){case 3:return"int8";case 2:return"uint8";case 9:return"bool";case 5:return"int16";case 4:return"uint16";case 6:return"int32";case 12:return"uint32";case 1:return"float32";case 11:return"float64";case 8:return"string";case 7:return"int64";case 13:return"uint64";default:throw new Error(`unsupported data type: ${t}`)}},l=t=>{switch(t){case"float32":return Float32Array;case"uint8":case"bool":return Uint8Array;case"int8":return Int8Array;case"uint16":return Uint16Array;case"int16":return Int16Array;case"int32":return Int32Array;case"float64":return Float64Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error(`unsupported type: ${t}`)}};n.run=(t,n,i,e,h)=>{const d=(0,s.getInstance)(),f=u.get(t);if(!f)throw new Error("invalid session id");const b=f[0],m=f[1],Z=f[2],y=n.length,v=e.length;let p=0,W=[];const X=[],G=[];try{[p,W]=(0,r.setRunOptions)(h);for(let t=0;t<y;t++){const n=i[t][0],r=i[t][1],e=i[t][2];let s,u;if(Array.isArray(e)){u=4*e.length,s=d._malloc(u),G.push(s);let t=s/4;for(let n=0;n<e.length;n++){if("string"!=typeof e[n])throw new TypeError(`tensor data at index ${n} is not a string`);d.HEAPU32[t++]=(0,o.allocWasmString)(e[n],G)}}else u=e.byteLength,s=d._malloc(u),G.push(s),d.HEAPU8.set(new Uint8Array(e.buffer,e.byteOffset,u),s);const a=d.stackSave(),l=d.stackAlloc(4*r.length);try{let t=l/4;r.forEach(n=>d.HEAP32[t++]=n);const i=d._OrtCreateTensor(c(n),s,u,l,r.length);if(0===i)throw new Error("Can't create a tensor");X.push(i)}finally{d.stackRestore(a)}}const t=d.stackSave(),s=d.stackAlloc(4*y),u=d.stackAlloc(4*y),f=d.stackAlloc(4*v),V=d.stackAlloc(4*v);try{let t=s/4,i=u/4,r=f/4,o=V/4;for(let r=0;r<y;r++)d.HEAPU32[t++]=X[r],d.HEAPU32[i++]=m[n[r]];for(let t=0;t<v;t++)d.HEAPU32[r++]=0,d.HEAPU32[o++]=Z[e[t]];let c=d._OrtRun(b,u,s,y,V,v,f,p);const h=[];if(0===c)for(let t=0;t<v;t++){const n=d.HEAPU32[f/4+t],i=d.stackSave(),r=d.stackAlloc(16);let e,o=0;try{if(c=d._OrtGetTensorData(n,r,r+4,r+8,r+12),0!==c)throw new Error(`Can't access output tensor data. error code = ${c}`);let t=r/4;const i=d.HEAPU32[t++];o=d.HEAPU32[t++];const s=d.HEAPU32[t++],u=d.HEAPU32[t++],f=[];for(let t=0;t<u;t++)f.push(d.HEAPU32[s/4+t]);d._OrtFree(s);const b=0===f.length?1:f.reduce((t,n)=>t*n);if(e=a(i),"string"===e){const t=[];let n=o/4;for(let i=0;i<b;i++){const r=d.HEAPU32[n++];t.push(d.UTF8ToString(r,i===b-1?void 0:d.HEAPU32[n]-r))}h.push([e,f,t])}else{const t=new(l(e))(b);new Uint8Array(t.buffer,t.byteOffset,t.byteLength).set(d.HEAPU8.subarray(o,o+t.byteLength)),h.push([e,f,t])}}finally{d.stackRestore(i),"string"===e&&o&&d._free(o),d._OrtReleaseTensor(n)}}if(0===c)return h;throw new Error(`failed to call OrtRun(). error code = ${c}.`)}finally{d.stackRestore(t)}}finally{X.forEach(d._OrtReleaseTensor),G.forEach(d._free),d._OrtReleaseRunOptions(p),W.forEach(d._free)}},n.endProfiling=t=>{const n=(0,s.getInstance)(),i=u.get(t);if(!i)throw new Error("invalid session id");const r=n._OrtEndProfiling(i[0]);if(0===r)throw new Error("Can't get an profile file name");n._OrtFree(r)},n.extractTransferableBuffers=t=>{const n=[];for(const i of t){const t=i[2];!Array.isArray(t)&&t.buffer&&n.push(t.buffer)}return n}},361:function(t,n,i){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,n,i,r){void 0===r&&(r=i);var e=Object.getOwnPropertyDescriptor(n,i);e&&!("get"in e?!n.__esModule:e.writable||e.configurable)||(e={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,r,e)}:function(t,n,i,r){void 0===r&&(r=i),t[r]=n[i]}),e=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&r(n,t,i);return e(n,t),n},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0}),n.dispose=n.getInstance=n.initializeWebAssembly=void 0,o(i(449));const u=s(i(932)),c=u.default;let a,l=!1,h=!1,d=!1;const f=(t,n)=>n?t?"ort-wasm-simd-threaded.wasm":"ort-wasm-threaded.wasm":t?"ort-wasm-simd.wasm":"ort-wasm.wasm";n.initializeWebAssembly=async t=>{if(l)return Promise.resolve();if(h)throw new Error("multiple calls to 'initializeWebAssembly()' detected.");if(d)throw new Error("previous call to 'initializeWebAssembly()' failed.");h=!0;const n=t.initTimeout,i=t.simd,r=t.numThreads>1&&(()=>{try{return"undefined"!=typeof SharedArrayBuffer&&("undefined"!=typeof MessageChannel&&(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])))}catch(t){return!1}})(),e=i&&(()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch(t){return!1}})(),o="string"==typeof t.wasmPaths?t.wasmPaths:void 0,s=f(!1,r),b=f(e,r),m="object"==typeof t.wasmPaths?t.wasmPaths[b]:void 0;let Z=!1;const y=[];if(n>0&&y.push(new Promise(t=>{setTimeout(()=>{Z=!0,t()},n)})),y.push(new Promise((t,n)=>{(r?c:u.default)({locateFile:(t,n)=>t===s?null!=m?m:(null!=o?o:n)+b:n+t}).then(n=>{h=!1,l=!0,a=n,t()},t=>{h=!1,d=!0,n(t)})})),await Promise.race(y),Z)throw new Error(`WebAssembly backend initializing failed due to timeout: ${n}ms`)},n.getInstance=()=>{if(l&&a)return a;throw new Error("WebAssembly is not initialized yet.")},n.dispose=()=>{var t;!l||h||d||(h=!0,null===(t=a.PThread)||void 0===t||t.terminateAllThreads(),a=void 0,h=!1,l=!1,d=!0)}},384:()=>{},908:()=>{},806:()=>{},449:()=>{},850:()=>{},381:()=>{}},n={};function i(r){var e=n[r];if(void 0!==e)return e.exports;var o=n[r]={exports:{}};return t[r].call(o.exports,o,o.exports,i),o.exports}return i.d=(t,n)=>{for(var r in n)i.o(n,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},i.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i(18)})(),t.exports=n()},955:function(t,n,i){var r;t.exports=(r=i(9021),i(754),i(4636),i(9506),i(7165),function(){var t=r,n=t.lib.BlockCipher,i=t.algo,e=[],o=[],s=[],u=[],c=[],a=[],l=[],h=[],d=[],f=[];!function(){for(var t=[],n=0;n<256;n++)t[n]=n<128?n<<1:n<<1^283;var i=0,r=0;for(n=0;n<256;n++){var b=r^r<<1^r<<2^r<<3^r<<4;e[i]=b=b>>>8^255&b^99,o[b]=i;var m,Z=t[i],y=t[Z],v=t[y];s[i]=(m=257*t[b]^16843008*b)<<24|m>>>8,u[i]=m<<16|m>>>16,c[i]=m<<8|m>>>24,a[i]=m,l[b]=(m=16843009*v^65537*y^257*Z^16843008*i)<<24|m>>>8,h[b]=m<<16|m>>>16,d[b]=m<<8|m>>>24,f[b]=m,i?(i=Z^t[t[t[v^Z]]],r^=t[t[r]]):i=r=1}}();var b=[0,1,2,4,8,16,32,64,128,27,54],m=i.AES=n.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,n=t.words,i=t.sigBytes/4,r=4*((this._nRounds=i+6)+1),o=this._keySchedule=[],s=0;s<r;s++)s<i?o[s]=n[s]:(a=o[s-1],s%i?i>6&&s%i==4&&(a=e[a>>>24]<<24|e[a>>>16&255]<<16|e[a>>>8&255]<<8|e[255&a]):(a=e[(a=a<<8|a>>>24)>>>24]<<24|e[a>>>16&255]<<16|e[a>>>8&255]<<8|e[255&a],a^=b[s/i|0]<<24),o[s]=o[s-i]^a);for(var u=this._invKeySchedule=[],c=0;c<r;c++){if(s=r-c,c%4)var a=o[s];else a=o[s-4];u[c]=c<4||s<=4?a:l[e[a>>>24]]^h[e[a>>>16&255]]^d[e[a>>>8&255]]^f[e[255&a]]}}},encryptBlock:function(t,n){this._doCryptBlock(t,n,this._keySchedule,s,u,c,a,e)},decryptBlock:function(t,n){var i=t[n+1];t[n+1]=t[n+3],t[n+3]=i,this._doCryptBlock(t,n,this._invKeySchedule,l,h,d,f,o),i=t[n+1],t[n+1]=t[n+3],t[n+3]=i},_doCryptBlock:function(t,n,i,r,e,o,s,u){for(var c=this._nRounds,a=t[n]^i[0],l=t[n+1]^i[1],h=t[n+2]^i[2],d=t[n+3]^i[3],f=4,b=1;b<c;b++){var m=r[a>>>24]^e[l