7 lines
628 KiB
JavaScript
7 lines
628 KiB
JavaScript
/*!
|
||
* ONNX Runtime Web v1.14.0
|
||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||
* Licensed under the MIT License.
|
||
*/
|
||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ort=e():t.ort=e()}(self,(function(){return function(){var __webpack_modules__={8453:function(t,e,n){"use strict";n.r(e),n.d(e,{InferenceSession:function(){return d},Tensor:function(){return p},env:function(){return a},registerBackend:function(){return i}});const r={},o=[],i=(t,e,n)=>{if(!e||"function"!=typeof e.init||"function"!=typeof e.createSessionHandler)throw new TypeError("not a valid backend");{const i=r[t];if(void 0===i)r[t]={backend:e,priority:n};else{if(i.priority>n)return;if(i.priority===n&&i.backend!==e)throw new Error(`cannot register backend "${t}" using priority ${n}`)}if(n>=0){const e=o.indexOf(t);-1!==e&&o.splice(e,1);for(let e=0;e<o.length;e++)if(r[o[e]].priority<=n)return void o.splice(e,0,t);o.push(t)}}},a=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}},s="undefined"!=typeof BigInt64Array&&"function"==typeof BigInt64Array.from,u="undefined"!=typeof BigUint64Array&&"function"==typeof BigUint64Array.from,c=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"]]);s&&(c.set("int64",BigInt64Array),l.set(BigInt64Array,"int64")),u&&(c.set("uint64",BigUint64Array),l.set(BigUint64Array,"uint64"));class f{constructor(t,e,n){let r,o,i;if("string"==typeof t)if(r=t,i=n,"string"===t){if(!Array.isArray(e))throw new TypeError("A string tensor's data must be a string array.");o=e}else{const n=c.get(t);if(void 0===n)throw new TypeError(`Unsupported tensor type: ${t}.`);if(Array.isArray(e))o=n.from(e);else{if(!(e instanceof n))throw new TypeError(`A ${r} tensor's data must be type of ${n}`);o=e}}else if(i=e,Array.isArray(t)){if(0===t.length)throw new TypeError("Tensor type cannot be inferred from an empty array.");const e=typeof t[0];if("string"===e)r="string",o=t;else{if("boolean"!==e)throw new TypeError(`Invalid element type of data array: ${e}.`);r="bool",o=Uint8Array.from(t)}}else{const e=l.get(t.constructor);if(void 0===e)throw new TypeError(`Unsupported type for tensor data: ${t.constructor}.`);r=e,o=t}if(void 0===i)i=[o.length];else if(!Array.isArray(i))throw new TypeError("A tensor's dims must be a number array");const a=(t=>{let e=1;for(let n=0;n<t.length;n++){const r=t[n];if("number"!=typeof r||!Number.isSafeInteger(r))throw new TypeError(`dims[${n}] must be an integer, got: ${r}`);if(r<0)throw new RangeError(`dims[${n}] must be a non-negative integer, got: ${r}`);e*=r}return e})(i);if(a!==o.length)throw new Error(`Tensor's size(${a}) does not match data length(${o.length}).`);this.dims=i,this.type=r,this.data=o,this.size=a}static bufferToTensor(t,e){if(void 0===t)throw new Error("Image buffer must be defined");if(void 0===e.height||void 0===e.width)throw new Error("Image height and width must be defined");const{height:n,width:r}=e,o=e.norm;let i,a;i=void 0===o||void 0===o.mean?255:o.mean,a=void 0===o||void 0===o.bias?0:o.bias;const s=void 0!==e.bitmapFormat?e.bitmapFormat:"RGBA",u=void 0!==e.tensorFormat&&void 0!==e.tensorFormat?e.tensorFormat:"RGB",c=n*r,l="RGBA"===u?new Float32Array(4*c):new Float32Array(3*c);let p=4,h=0,d=1,g=2,b=3,y=0,m=c,v=2*c,_=-1;"RGB"===s&&(p=3,h=0,d=1,g=2,b=-1),"RGBA"===u?_=3*c:"RBG"===u?(y=0,v=c,m=2*c):"BGR"===u&&(v=0,m=c,y=2*c);for(let e=0;e<c;e++,h+=p,g+=p,d+=p,b+=p)l[y++]=(t[h]+a)/i,l[m++]=(t[d]+a)/i,l[v++]=(t[g]+a)/i,-1!==_&&-1!==b&&(l[_++]=(t[b]+a)/i);return new f("float32",l,"RGBA"===u?[1,4,n,r]:[1,3,n,r])}static async fromImage(t,e){const n="undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement,r="undefined"!=typeof ImageData&&t instanceof ImageData,o="undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap,i="undefined"!=typeof String&&(t instanceof String||"string"==typeof t);let a,s={};if(n){const n=document.createElement("canvas"),r=n.getContext("2d");if(null==r)throw new Error("Can not access image data");{let o=t.naturalHeight,i=t.naturalWidth;if(void 0!==e&&void 0!==e.resizedHeight&&void 0!==e.resizedWidth&&(o=e.resizedHeight,i=e.resizedWidth),void 0!==e){if(s=e,void 0!==e.tensorFormat)throw new Error("Image input config format must be RGBA for HTMLImageElement");if(s.tensorFormat="RGBA",void 0!==e.height&&e.height!==o)throw new Error("Image input config height doesn't match HTMLImageElement height");if(s.height=o,void 0!==e.width&&e.width!==i)throw new Error("Image input config width doesn't match HTMLImageElement width");s.width=i}else s.tensorFormat="RGBA",s.height=o,s.width=i;n.width=i,n.height=o,r.drawImage(t,0,0,i,o),a=r.getImageData(0,0,i,o).data}}else{if(!r){if(o){if(void 0===e)throw new Error("Please provide image config with format for Imagebitmap");if(void 0!==e.bitmapFormat)throw new Error("Image input config format must be defined for ImageBitmap");const n=document.createElement("canvas").getContext("2d");if(null!=n){const r=t.height,o=t.width;if(n.drawImage(t,0,0,o,r),a=n.getImageData(0,0,o,r).data,void 0!==e){if(void 0!==e.height&&e.height!==r)throw new Error("Image input config height doesn't match ImageBitmap height");if(s.height=r,void 0!==e.width&&e.width!==o)throw new Error("Image input config width doesn't match ImageBitmap width");s.width=o}else s.height=r,s.width=o;return f.bufferToTensor(a,s)}throw new Error("Can not access image data")}if(i)return new Promise(((n,r)=>{const o=document.createElement("canvas"),i=o.getContext("2d");if(!t||!i)return r();const a=new Image;a.crossOrigin="Anonymous",a.src=t,a.onload=()=>{o.width=a.width,o.height=a.height,i.drawImage(a,0,0,o.width,o.height);const t=i.getImageData(0,0,o.width,o.height);if(void 0!==e){if(void 0!==e.height&&e.height!==o.height)throw new Error("Image input config height doesn't match ImageBitmap height");if(s.height=o.height,void 0!==e.width&&e.width!==o.width)throw new Error("Image input config width doesn't match ImageBitmap width");s.width=o.width}else s.height=o.height,s.width=o.width;n(f.bufferToTensor(t.data,s))}}));throw new Error("Input data provided is not supported - aborted tensor creation")}{const n="RGBA";let r,o;if(void 0!==e&&void 0!==e.resizedWidth&&void 0!==e.resizedHeight?(r=e.resizedHeight,o=e.resizedWidth):(r=t.height,o=t.width),void 0!==e){if(s=e,void 0!==e.bitmapFormat&&e.bitmapFormat!==n)throw new Error("Image input config format must be RGBA for ImageData");s.bitmapFormat="RGBA"}else s.bitmapFormat="RGBA";if(s.height=r,s.width=o,void 0!==e){const e=document.createElement("canvas");e.width=o,e.height=r;const n=e.getContext("2d");if(null==n)throw new Error("Can not access image data");n.putImageData(t,0,0),a=n.getImageData(0,0,o,r).data}else a=t.data}}if(void 0!==a)return f.bufferToTensor(a,s);throw new Error("Input data provided is not supported - aborted tensor creation")}toImageData(t){var e,n;const r=document.createElement("canvas").getContext("2d");let o;if(null==r)throw new Error("Can not access image data");{const i=this.dims[3],a=this.dims[2],s=this.dims[1],u=void 0!==t&&void 0!==t.format?t.format:"RGB",c=void 0!==t&&void 0!==(null===(e=t.norm)||void 0===e?void 0:e.mean)?t.norm.mean:255,l=void 0!==t&&void 0!==(null===(n=t.norm)||void 0===n?void 0:n.bias)?t.norm.bias:0,f=a*i;if(void 0!==t){if(void 0!==t.height&&t.height!==a)throw new Error("Image output config height doesn't match tensor height");if(void 0!==t.width&&t.width!==i)throw new Error("Image output config width doesn't match tensor width");if(void 0!==t.format&&4===s&&"RGBA"!==t.format||3===s&&"RGB"!==t.format&&"BGR"!==t.format)throw new Error("Tensor format doesn't match input tensor dims")}const p=4;let h=0,d=1,g=2,b=3,y=0,m=f,v=2*f,_=-1;"RGBA"===u?(y=0,m=f,v=2*f,_=3*f):"RGB"===u?(y=0,m=f,v=2*f):"RBG"===u&&(y=0,v=f,m=2*f),o=r.createImageData(i,a);for(let t=0;t<a*i;h+=p,d+=p,g+=p,b+=p,t++)o.data[h]=(this.data[y++]-l)*c,o.data[d]=(this.data[m++]-l)*c,o.data[g]=(this.data[v++]-l)*c,o.data[b]=-1===_?255:(this.data[_++]-l)*c}return o}reshape(t){return new f(this.type,this.data,t)}}const p=f;class h{constructor(t){this.handler=t}async run(t,e,n){const r={};let o={};if("object"!=typeof t||null===t||t instanceof p||Array.isArray(t))throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");let i=!0;if("object"==typeof e){if(null===e)throw new TypeError("Unexpected argument[1]: cannot be null.");if(e instanceof p)throw new TypeError("'fetches' cannot be a Tensor");if(Array.isArray(e)){if(0===e.length)throw new TypeError("'fetches' cannot be an empty array.");i=!1;for(const t of e){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 n&&null!==n)o=n;else if(void 0!==n)throw new TypeError("'options' must be an object.")}else{let t=!1;const a=Object.getOwnPropertyNames(e);for(const n of this.outputNames)if(-1!==a.indexOf(n)){const o=e[n];(null===o||o instanceof p)&&(t=!0,i=!1,r[n]=o)}if(t){if("object"==typeof n&&null!==n)o=n;else if(void 0!==n)throw new TypeError("'options' must be an object.")}else o=e}}else if(void 0!==e)throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'.");for(const e of this.inputNames)if(void 0===t[e])throw new Error(`input '${e}' is missing in 'feeds'.`);if(i)for(const t of this.outputNames)r[t]=null;const a=await this.handler.run(t,r,o),s={};for(const t in a)Object.hasOwnProperty.call(a,t)&&(s[t]=new p(a[t].type,a[t].data,a[t].dims));return s}static async create(t,e,n,i){let a,s={};if("string"==typeof t){if(a=t,"object"==typeof e&&null!==e)s=e;else if(void 0!==e)throw new TypeError("'options' must be an object.")}else if(t instanceof Uint8Array){if(a=t,"object"==typeof e&&null!==e)s=e;else if(void 0!==e)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 o=0,u=t.byteLength;if("object"==typeof e&&null!==e)s=e;else if("number"==typeof e){if(o=e,!Number.isSafeInteger(o))throw new RangeError("'byteOffset' must be an integer.");if(o<0||o>=r.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${r.byteLength}).`);if(u=t.byteLength-o,"number"==typeof n){if(u=n,!Number.isSafeInteger(u))throw new RangeError("'byteLength' must be an integer.");if(u<=0||o+u>r.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${r.byteLength-o}].`);if("object"==typeof i&&null!==i)s=i;else if(void 0!==i)throw new TypeError("'options' must be an object.")}else if(void 0!==n)throw new TypeError("'byteLength' must be a number.")}else if(void 0!==e)throw new TypeError("'options' must be an object.");a=new Uint8Array(r,o,u)}}const u=(s.executionProviders||[]).map((t=>"string"==typeof t?t:t.name)),c=await(async t=>{const e=0===t.length?o:t,n=[];for(const t of e){const e=r[t];if(e){if(e.initialized)return e.backend;if(e.aborted)continue;const r=!!e.initPromise;try{return r||(e.initPromise=e.backend.init()),await e.initPromise,e.initialized=!0,e.backend}catch(o){r||n.push({name:t,err:o}),e.aborted=!0}finally{delete e.initPromise}}}throw new Error(`no available backend found. ERR: ${n.map((t=>`[${t.name}] ${t.err}`)).join(", ")}`)})(u),l=await c.createSessionHandler(a,s);return new h(l)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}}const d=h},3474:function(t,e,n){var _scriptDir,r=(_scriptDir=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){function e(){return k.buffer!=F&&W(k.buffer),N}function r(){return k.buffer!=F&&W(k.buffer),R}function o(){return k.buffer!=F&&W(k.buffer),L}function i(){return k.buffer!=F&&W(k.buffer),M}function a(){return k.buffer!=F&&W(k.buffer),j}var s,u,c;t=t||{},s||(s=void 0!==t?t:{}),s.ready=new Promise((function(t,e){u=t,c=e}));var l,f,p,h,d,g,b=Object.assign({},s),y="./this.program",m=(t,e)=>{throw e},v="object"==typeof window,_="function"==typeof importScripts,w="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,x=s.ENVIRONMENT_IS_PTHREAD||!1,T="";function S(t){return s.locateFile?s.locateFile(t,T):T+t}if(w){let e;T=_?n(908).dirname(T)+"/":"//",g=()=>{d||(h=n(1384),d=n(908))},l=function(t,e){return g(),t=d.normalize(t),h.readFileSync(t,e?void 0:"utf8")},p=t=>((t=l(t,!0)).buffer||(t=new Uint8Array(t)),t),f=(t,e,n)=>{g(),t=d.normalize(t),h.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1<process.argv.length&&(y=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",(function(t){if(!(t instanceof ut))throw t})),process.on("unhandledRejection",(function(t){throw t})),m=(t,e)=>{if($())throw process.exitCode=t,e;e instanceof ut||P("exiting due to exception: "+e),process.exit(t)},s.inspect=function(){return"[Emscripten Module object]"};try{e=n(9925)}catch(t){throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'),t}n.g.Worker=e.Worker}else(v||_)&&(_?T=self.location.href:"undefined"!=typeof document&&document.currentScript&&(T=document.currentScript.src),_scriptDir&&(T=_scriptDir),T=0!==T.indexOf("blob:")?T.substr(0,T.replace(/[?#].*/,"").lastIndexOf("/")+1):"",w||(l=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},_&&(p=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),f=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)}));w&&"undefined"==typeof performance&&(n.g.performance=n(6953).performance);var O=console.log.bind(console),A=console.warn.bind(console);w&&(g(),O=t=>h.writeSync(1,t+"\n"),A=t=>h.writeSync(2,t+"\n"));var E,I=s.print||O,P=s.printErr||A;Object.assign(s,b),b=null,s.thisProgram&&(y=s.thisProgram),s.quit&&(m=s.quit),s.wasmBinary&&(E=s.wasmBinary);var D=s.noExitRuntime||!1;"object"!=typeof WebAssembly&&ot("no native wasm support detected");var k,C,F,N,R,L,M,j,U=!1,V="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function B(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16<n-e&&t.buffer&&V)return V.decode(t.buffer instanceof SharedArrayBuffer?t.slice(e,n):t.subarray(e,n));for(r="";e<n;){var o=t[e++];if(128&o){var i=63&t[e++];if(192==(224&o))r+=String.fromCharCode((31&o)<<6|i);else{var a=63&t[e++];65536>(o=224==(240&o)?(15&o)<<12|i<<6|a:(7&o)<<18|i<<12|a<<6|63&t[e++])?r+=String.fromCharCode(o):(o-=65536,r+=String.fromCharCode(55296|o>>10,56320|1023&o))}}else r+=String.fromCharCode(o)}return r}function z(t,e){return(t>>>=0)?B(r(),t,e):""}function G(t,e,n,r){if(!(0<r))return 0;var o=n>>>=0;r=n+r-1;for(var i=0;i<t.length;++i){var a=t.charCodeAt(i);if(55296<=a&&57343>=a&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++i)),127>=a){if(n>=r)break;e[n++>>>0]=a}else{if(2047>=a){if(n+1>=r)break;e[n++>>>0]=192|a>>6}else{if(65535>=a){if(n+2>=r)break;e[n++>>>0]=224|a>>12}else{if(n+3>=r)break;e[n++>>>0]=240|a>>18,e[n++>>>0]=128|a>>12&63}e[n++>>>0]=128|a>>6&63}e[n++>>>0]=128|63&a}}return e[n>>>0]=0,n-o}function H(t){for(var e=0,n=0;n<t.length;++n){var r=t.charCodeAt(n);127>=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function W(t){F=t,s.HEAP8=N=new Int8Array(t),s.HEAP16=new Int16Array(t),s.HEAP32=L=new Int32Array(t),s.HEAPU8=R=new Uint8Array(t),s.HEAPU16=new Uint16Array(t),s.HEAPU32=M=new Uint32Array(t),s.HEAPF32=new Float32Array(t),s.HEAPF64=j=new Float64Array(t)}x&&(F=s.buffer);var q=s.INITIAL_MEMORY||16777216;if(x)k=s.wasmMemory,F=s.buffer;else if(s.wasmMemory)k=s.wasmMemory;else if(!((k=new WebAssembly.Memory({initial:q/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw P("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),w&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");k&&(F=k.buffer),q=F.byteLength,W(F);var X,Y=[],K=[],Z=[],J=[];function $(){return D||!1}function Q(){var t=s.preRun.shift();Y.unshift(t)}var tt,et=0,nt=null,rt=null;function ot(t){throw x?postMessage({cmd:"onAbort",arg:t}):s.onAbort&&s.onAbort(t),P(t="Aborted("+t+")"),U=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),c(t),t}function it(){return tt.startsWith("data:application/octet-stream;base64,")}function at(){var t=tt;try{if(t==tt&&E)return new Uint8Array(E);if(p)return p(t);throw"both async and sync fetching of the wasm failed"}catch(t){ot(t)}}tt="ort-wasm-threaded.wasm",it()||(tt=S(tt));var st={};function ut(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function ct(t){(t=ht.Vb[t])||ot(),ht.mc(t)}function lt(t){var e=ht.Cc();if(!e)return 6;ht.ac.push(e),ht.Vb[t.Ub]=e,e.Ub=t.Ub;var n={cmd:"run",start_routine:t.Ic,arg:t.zc,pthread_ptr:t.Ub};return e.$b=()=>{n.time=performance.now(),e.postMessage(n,t.Nc)},e.loaded&&(e.$b(),delete e.$b),0}function ft(t){if(x)return Xt(1,1,t);$()||(ht.oc(),s.onExit&&s.onExit(t),U=!0),m(t,new ut(t))}function pt(t,e){if(!e&&x)throw bt(t),"unwind";$()||x||(ye(),dt(Z),be(0),re[1].length&&oe(1,10),re[2].length&&oe(2,10),ht.oc()),ft(t)}var ht={Yb:[],ac:[],qc:[],Vb:{},fc:function(){x&&ht.Ec()},Pc:function(){},Ec:function(){ht.receiveObjectTransfer=ht.Gc,ht.threadInitTLS=ht.pc,ht.setExitStatus=ht.nc,D=!1},nc:function(){},oc:function(){for(var t of Object.values(ht.Vb))ht.mc(t);for(t of ht.Yb)t.terminate();ht.Yb=[]},mc:function(t){var e=t.Ub;delete ht.Vb[e],ht.Yb.push(t),ht.ac.splice(ht.ac.indexOf(t),1),t.Ub=0,xe(e)},Gc:function(){},pc:function(){ht.qc.forEach((t=>t()))},Fc:function(t,e){t.onmessage=n=>{var r=(n=n.data).cmd;if(t.Ub&&(ht.Bc=t.Ub),n.targetThread&&n.targetThread!=he()){var o=ht.Vb[n.Qc];o?o.postMessage(n,n.transferList):P('Internal error! Worker sent a message "'+r+'" to target pthread '+n.targetThread+", but that thread no longer exists!")}else"processProxyingQueue"===r?Bt(n.queue):"spawnThread"===r?lt(n):"cleanupThread"===r?ct(n.thread):"killThread"===r?(n=n.thread,r=ht.Vb[n],delete ht.Vb[n],r.terminate(),xe(n),ht.ac.splice(ht.ac.indexOf(r),1),r.Ub=0):"cancelThread"===r?ht.Vb[n.thread].postMessage({cmd:"cancel"}):"loaded"===r?(t.loaded=!0,e&&e(t),t.$b&&(t.$b(),delete t.$b)):"print"===r?I("Thread "+n.threadId+": "+n.text):"printErr"===r?P("Thread "+n.threadId+": "+n.text):"alert"===r?alert("Thread "+n.threadId+": "+n.text):"setimmediate"===n.target?t.postMessage(n):"onAbort"===r?s.onAbort&&s.onAbort(n.arg):r&&P("worker sent an unknown command "+r);ht.Bc=void 0},t.onerror=t=>{throw P("worker sent an error! "+t.filename+":"+t.lineno+": "+t.message),t},w&&(t.on("message",(function(e){t.onmessage({data:e})})),t.on("error",(function(e){t.onerror(e)})),t.on("detachedExit",(function(){}))),t.postMessage({cmd:"load",urlOrBlob:s.mainScriptUrlOrBlob||_scriptDir,wasmMemory:k,wasmModule:C})},yc:function(){var t=S("ort-wasm-threaded.worker.js");ht.Yb.push(new Worker(t))},Cc:function(){return 0==ht.Yb.length&&(ht.yc(),ht.Fc(ht.Yb[0])),ht.Yb.pop()}};function dt(t){for(;0<t.length;)t.shift()(s)}function gt(t){var e=Ae();return t=t(),Ee(e),t}function bt(t){if(x)return Xt(2,0,t);try{pt(t)}catch(t){t instanceof ut||"unwind"==t||m(1,t)}}s.PThread=ht,s.establishStackSpace=function(){var t=he(),e=o()[t+44>>2>>>0];t=o()[t+48>>2>>>0],Oe(e,e-t),Ee(e)};var yt=[];function mt(t){var e=yt[t];return e||(t>=yt.length&&(yt.length=t+1),yt[t]=e=X.get(t)),e}s.invokeEntryPoint=function(t,e){t=mt(t)(e),$()?ht.nc(t):Te(t)};var vt,_t,wt=[],xt=0,Tt=0;function St(t){this.Zb=t,this.Sb=t-24,this.xc=function(t){i()[this.Sb+4>>2>>>0]=t},this.bc=function(){return i()[this.Sb+4>>2>>>0]},this.wc=function(t){i()[this.Sb+8>>2>>>0]=t},this.Dc=function(){return i()[this.Sb+8>>2>>>0]},this.rc=function(){o()[this.Sb>>2>>>0]=0},this.hc=function(t){t=t?1:0,e()[this.Sb+12>>0>>>0]=t},this.uc=function(){return 0!=e()[this.Sb+12>>0>>>0]},this.ic=function(t){t=t?1:0,e()[this.Sb+13>>0>>>0]=t},this.kc=function(){return 0!=e()[this.Sb+13>>0>>>0]},this.fc=function(t,e){this.cc(0),this.xc(t),this.wc(e),this.rc(),this.hc(!1),this.ic(!1)},this.sc=function(){Atomics.add(o(),this.Sb>>2,1)},this.Hc=function(){return 1===Atomics.sub(o(),this.Sb>>2,1)},this.cc=function(t){i()[this.Sb+16>>2>>>0]=t},this.tc=function(){return i()[this.Sb+16>>2>>>0]},this.vc=function(){if(De(this.bc()))return i()[this.Zb>>2>>>0];var t=this.tc();return 0!==t?t:this.Zb}}function Ot(t){return ge(new St(t).Sb)}function At(t,e,n,r){return x?Xt(3,1,t,e,n,r):Et(t,e,n,r)}function Et(t,e,n,r){if("undefined"==typeof SharedArrayBuffer)return P("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var o=[];return x&&0===o.length?At(t,e,n,r):(t={Ic:n,Ub:t,zc:r,Nc:o},x?(t.Oc="spawnThread",postMessage(t,o),0):lt(t))}function It(t,e,n){return x?Xt(4,1,t,e,n):0}function Pt(t,e){if(x)return Xt(5,1,t,e)}function Dt(t,e){if(x)return Xt(6,1,t,e)}function kt(t,e,n){if(x)return Xt(7,1,t,e,n)}function Ct(t,e,n){return x?Xt(8,1,t,e,n):0}function Ft(t,e){if(x)return Xt(9,1,t,e)}function Nt(t,e,n){if(x)return Xt(10,1,t,e,n)}function Rt(t,e,n,r){if(x)return Xt(11,1,t,e,n,r)}function Lt(t,e,n,r){if(x)return Xt(12,1,t,e,n,r)}function Mt(t,e,n,r){if(x)return Xt(13,1,t,e,n,r)}function jt(t){if(x)return Xt(14,1,t)}function Ut(t,e){if(x)return Xt(15,1,t,e)}function Vt(t,e,n){if(x)return Xt(16,1,t,e,n)}function Bt(t){Atomics.store(o(),t>>2,1),he()&&we(t),Atomics.compareExchange(o(),t>>2,1,0)}function zt(t){return i()[t>>>2]+4294967296*o()[t+4>>>2]}function Gt(t,e,n,r,o,i){return x?Xt(17,1,t,e,n,r,o,i):-52}function Ht(t,e,n,r,o,i){if(x)return Xt(18,1,t,e,n,r,o,i)}function Wt(t){var n=H(t)+1,r=de(n);return r&&G(t,e(),r,n),r}function qt(t,e,n){function r(t){return(t=t.toTimeString().match(/\(([A-Za-z ]+)\)$/))?t[1]:"GMT"}if(x)return Xt(19,1,t,e,n);var a=(new Date).getFullYear(),s=new Date(a,0,1),u=new Date(a,6,1);a=s.getTimezoneOffset();var c=u.getTimezoneOffset(),l=Math.max(a,c);o()[t>>2>>>0]=60*l,o()[e>>2>>>0]=Number(a!=c),t=r(s),e=r(u),t=Wt(t),e=Wt(e),c<a?(i()[n>>2>>>0]=t,i()[n+4>>2>>>0]=e):(i()[n>>2>>>0]=e,i()[n+4>>2>>>0]=t)}function Xt(t,e){var n=arguments.length-2,r=arguments;return gt((()=>{for(var o=Ie(8*n),i=o>>3,s=0;s<n;s++){var u=r[2+s];a()[i+s>>>0]=u}return _e(t,n,o,e)}))}s.executeNotifiedProxyingQueue=Bt,_t=w?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:x?()=>performance.now()-s.__performance_now_clock_drift:()=>performance.now();var Yt,Kt=[],Zt={};function Jt(){if(!Yt){var t,e={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",_:y||"./this.program"};for(t in Zt)void 0===Zt[t]?delete e[t]:e[t]=Zt[t];var n=[];for(t in e)n.push(t+"="+e[t]);Yt=n}return Yt}function $t(t,n){if(x)return Xt(20,1,t,n);var r=0;return Jt().forEach((function(o,a){var s=n+r;for(a=i()[t+4*a>>2>>>0]=s,s=0;s<o.length;++s)e()[a++>>0>>>0]=o.charCodeAt(s);e()[a>>0>>>0]=0,r+=o.length+1})),0}function Qt(t,e){if(x)return Xt(21,1,t,e);var n=Jt();i()[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),i()[e>>2>>>0]=r,0}function te(t){return x?Xt(22,1,t):52}function ee(t,e,n,r){return x?Xt(23,1,t,e,n,r):52}function ne(t,e,n,r,o){return x?Xt(24,1,t,e,n,r,o):70}var re=[null,[],[]];function oe(t,e){var n=re[t];0===e||10===e?((1===t?I:P)(B(n,0)),n.length=0):n.push(e)}function ie(t,e,n,o){if(x)return Xt(25,1,t,e,n,o);for(var a=0,s=0;s<n;s++){var u=i()[e>>2>>>0],c=i()[e+4>>2>>>0];e+=8;for(var l=0;l<c;l++)oe(t,r()[u+l>>>0]);a+=c}return i()[o>>2>>>0]=a,0}var ae=0;function se(t){return 0==t%4&&(0!=t%100||0==t%400)}var ue=[31,29,31,30,31,30,31,31,30,31,30,31],ce=[31,28,31,30,31,30,31,31,30,31,30,31];function le(t,n,r,i){function a(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.length<e;)t=n[0]+t;return t}function s(t,e){return a(t,e,"0")}function u(t,e){function n(t){return 0>t?-1:0<t?1:0}var r;return 0===(r=n(t.getFullYear()-e.getFullYear()))&&0===(r=n(t.getMonth()-e.getMonth()))&&(r=n(t.getDate()-e.getDate())),r}function c(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 l(t){var e=t.Wb;for(t=new Date(new Date(t.Xb+1900,0,1).getTime());0<e;){var n=t.getMonth(),r=(se(t.getFullYear())?ue:ce)[n];if(!(e>r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=c(new Date(t.getFullYear(),0,4)),n=c(n),0>=u(e,t)?0>=u(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var f=o()[i+40>>2>>>0];for(var p in i={Lc:o()[i>>2>>>0],Kc:o()[i+4>>2>>>0],dc:o()[i+8>>2>>>0],jc:o()[i+12>>2>>>0],ec:o()[i+16>>2>>>0],Xb:o()[i+20>>2>>>0],Tb:o()[i+24>>2>>>0],Wb:o()[i+28>>2>>>0],Rc:o()[i+32>>2>>>0],Jc:o()[i+36>>2>>>0],Mc:f?z(f):""},r=z(r),f={"%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"})r=r.replace(new RegExp(p,"g"),f[p]);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(p in f={"%a":function(t){return h[t.Tb].substring(0,3)},"%A":function(t){return h[t.Tb]},"%b":function(t){return d[t.ec].substring(0,3)},"%B":function(t){return d[t.ec]},"%C":function(t){return s((t.Xb+1900)/100|0,2)},"%d":function(t){return s(t.jc,2)},"%e":function(t){return a(t.jc,2," ")},"%g":function(t){return l(t).toString().substring(2)},"%G":function(t){return l(t)},"%H":function(t){return s(t.dc,2)},"%I":function(t){return 0==(t=t.dc)?t=12:12<t&&(t-=12),s(t,2)},"%j":function(t){for(var e=0,n=0;n<=t.ec-1;e+=(se(t.Xb+1900)?ue:ce)[n++]);return s(t.jc+e,3)},"%m":function(t){return s(t.ec+1,2)},"%M":function(t){return s(t.Kc,2)},"%n":function(){return"\n"},"%p":function(t){return 0<=t.dc&&12>t.dc?"AM":"PM"},"%S":function(t){return s(t.Lc,2)},"%t":function(){return"\t"},"%u":function(t){return t.Tb||7},"%U":function(t){return s(Math.floor((t.Wb+7-t.Tb)/7),2)},"%V":function(t){var e=Math.floor((t.Wb+7-(t.Tb+6)%7)/7);if(2>=(t.Tb+371-t.Wb-2)%7&&e++,e)53==e&&(4==(n=(t.Tb+371-t.Wb)%7)||3==n&&se(t.Xb)||(e=1));else{e=52;var n=(t.Tb+7-t.Wb-1)%7;(4==n||5==n&&se(t.Xb%400-1))&&e++}return s(e,2)},"%w":function(t){return t.Tb},"%W":function(t){return s(Math.floor((t.Wb+7-(t.Tb+6)%7)/7),2)},"%y":function(t){return(t.Xb+1900).toString().substring(2)},"%Y":function(t){return t.Xb+1900},"%z":function(t){var e=0<=(t=t.Jc);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.Mc},"%%":function(){return"%"}},r=r.replace(/%%/g,"\0\0"),f)r.includes(p)&&(r=r.replace(new RegExp(p,"g"),f[p](i)));return p=function(t){var e=Array(H(t)+1);return G(t,e,0,e.length),e}(r=r.replace(/\0\0/g,"%")),p.length>n?0:(function(t,n){e().set(t,n>>>0)}(p,t),p.length-1)}ht.fc();var fe=[null,ft,bt,At,It,Pt,Dt,kt,Ct,Ft,Nt,Rt,Lt,Mt,jt,Ut,Vt,Gt,Ht,qt,$t,Qt,te,ee,ne,ie],pe={b:function(t){return de(t+24)+24},n:function(t){return(t=new St(t)).uc()||(t.hc(!0),xt--),t.ic(!1),wt.push(t),t.sc(),t.vc()},ma:function(t){throw P("Unexpected exception thrown, this is not properly supported - aborting"),U=!0,t},x:function(){Se(0);var t=wt.pop();if(t.Hc()&&!t.kc()){var e=t.Dc();e&&mt(e)(t.Zb),Ot(t.Zb)}Tt=0},e:function(){var t=Tt;if(!t)return ae=0;var e=new St(t);e.cc(t);var n=e.bc();if(!n)return ae=0,t;for(var r=Array.prototype.slice.call(arguments),o=0;o<r.length;o++){var i=r[o];if(0===i||i===n)break;if(Pe(i,n,e.Sb+16))return ae=i,t}return ae=n,t},l:function(){var t=Tt;if(!t)return ae=0;var e=new St(t);e.cc(t);var n=e.bc();if(!n)return ae=0,t;for(var r=Array.prototype.slice.call(arguments),o=0;o<r.length;o++){var i=r[o];if(0===i||i===n)break;if(Pe(i,n,e.Sb+16))return ae=i,t}return ae=n,t},h:function(){var t=Tt;if(!t)return ae=0;var e=new St(t);e.cc(t);var n=e.bc();if(!n)return ae=0,t;for(var r=Array.prototype.slice.call(arguments),o=0;o<r.length;o++){var i=r[o];if(0===i||i===n)break;if(Pe(i,n,e.Sb+16))return ae=i,t}return ae=n,t},t:Ot,M:function(){var t=wt.pop();t||ot("no exception to throw");var e=t.Zb;throw t.kc()||(wt.push(t),t.ic(!0),t.hc(!1),xt++),Tt=e,e},c:function(t,e,n){throw new St(t).fc(e,n),Tt=t,xt++,t},pa:function(){return xt},Fa:function(t){me(t,!_,1,!v),ht.pc()},T:function(t){x?postMessage({cmd:"cleanupThread",thread:t}):ct(t)},xa:Et,j:function(t){throw Tt||(Tt=t),t},H:It,Ma:Pt,ua:Dt,wa:kt,oa:Ct,Ka:Ft,Ca:Nt,Ja:Rt,V:Lt,va:Mt,sa:jt,La:Ut,ta:Vt,Ta:function(){},X:function(){ot("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},Ua:function(){ot("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},W:function(){return Date.now()},ya:function(){return 2097152},Oa:function(){return!0},za:function(t,e,n,r){if(t==e)setTimeout((()=>Bt(r)));else if(x)postMessage({targetThread:t,cmd:"processProxyingQueue",queue:r});else{if(!(t=ht.Vb[t]))return;t.postMessage({cmd:"processProxyingQueue",queue:r})}return 1},Ea:function(){return-1},Pa:function(t,e){t=new Date(1e3*zt(t)),o()[e>>2>>>0]=t.getUTCSeconds(),o()[e+4>>2>>>0]=t.getUTCMinutes(),o()[e+8>>2>>>0]=t.getUTCHours(),o()[e+12>>2>>>0]=t.getUTCDate(),o()[e+16>>2>>>0]=t.getUTCMonth(),o()[e+20>>2>>>0]=t.getUTCFullYear()-1900,o()[e+24>>2>>>0]=t.getUTCDay(),t=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,o()[e+28>>2>>>0]=t},Qa:function(t,e){t=new Date(1e3*zt(t)),o()[e>>2>>>0]=t.getSeconds(),o()[e+4>>2>>>0]=t.getMinutes(),o()[e+8>>2>>>0]=t.getHours(),o()[e+12>>2>>>0]=t.getDate(),o()[e+16>>2>>>0]=t.getMonth(),o()[e+20>>2>>>0]=t.getFullYear()-1900,o()[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1),r=(t.getTime()-n.getTime())/864e5|0;o()[e+28>>2>>>0]=r,o()[e+36>>2>>>0]=-60*t.getTimezoneOffset(),r=new Date(t.getFullYear(),6,1).getTimezoneOffset(),t=0|(r!=(n=n.getTimezoneOffset())&&t.getTimezoneOffset()==Math.min(n,r)),o()[e+32>>2>>>0]=t},Ra:function(t){var e=new Date(o()[t+20>>2>>>0]+1900,o()[t+16>>2>>>0],o()[t+12>>2>>>0],o()[t+8>>2>>>0],o()[t+4>>2>>>0],o()[t>>2>>>0],0),n=o()[t+32>>2>>>0],r=e.getTimezoneOffset(),i=new Date(e.getFullYear(),0,1),a=new Date(e.getFullYear(),6,1).getTimezoneOffset(),s=i.getTimezoneOffset(),u=Math.min(s,a);return 0>n?o()[t+32>>2>>>0]=Number(a!=s&&u==r):0<n!=(u==r)&&(a=Math.max(s,a),e.setTime(e.getTime()+6e4*((0<n?u:a)-r))),o()[t+24>>2>>>0]=e.getDay(),n=(e.getTime()-i.getTime())/864e5|0,o()[t+28>>2>>>0]=n,o()[t>>2>>>0]=e.getSeconds(),o()[t+4>>2>>>0]=e.getMinutes(),o()[t+8>>2>>>0]=e.getHours(),o()[t+12>>2>>>0]=e.getDate(),o()[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},Aa:Gt,Ba:Ht,Sa:function t(e,n,r){t.Ac||(t.Ac=!0,qt(e,n,r))},y:function(){ot("")},U:function(){if(!w&&!_){var t="Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread";vt||(vt={}),vt[t]||(vt[t]=1,w&&(t="warning: "+t),P(t))}},ra:function(){return 4294901760},B:_t,Ia:function(t,e,n){r().copyWithin(t>>>0,e>>>0,e+n>>>0)},F:function(){return w?n(3993).cpus().length:navigator.hardwareConcurrency},Da:function(t,e,n){Kt.length=e,n>>=3;for(var r=0;r<e;r++)Kt[r]=a()[n+r>>>0];return(0>t?st[-t-1]:fe[t]).apply(null,Kt)},qa:function(t){var e=r().length;if((t>>>=0)<=e||4294901760<t)return!1;for(var n=1;4>=n;n*=2){var o=e*(1+.2/n);o=Math.min(o,t+100663296);var i=Math;o=Math.max(t,o),i=i.min.call(i,4294901760,o+(65536-o%65536)%65536);t:{try{k.grow(i-F.byteLength+65535>>>16),W(k.buffer);var a=1;break t}catch(t){}a=void 0}if(a)return!0}return!1},Na:function(){throw"unwind"},Ga:$t,Ha:Qt,J:pt,I:te,S:ee,ga:ne,R:ie,d:function(){return ae},na:function t(r,o){t.lc||(t.lc=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(w)try{var e=n(Object(function(){var t=new Error("Cannot find module 'crypto'");throw t.code="MODULE_NOT_FOUND",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>ot("randomDevice")}());for(var i=0;i<o;i++)e()[r+i>>0>>>0]=t.lc();return 0},ia:function(t,e,n){var r=Ae();try{return mt(t)(e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},ja:function(t,e,n){var r=Ae();try{return mt(t)(e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},K:function(t){var e=Ae();try{return mt(t)()}catch(t){if(Ee(e),t!==t+0)throw t;Se(1,0)}},f:function(t,e){var n=Ae();try{return mt(t)(e)}catch(t){if(Ee(n),t!==t+0)throw t;Se(1,0)}},P:function(t,e,n){var r=Ae();try{return mt(t)(e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},Q:function(t,e,n){var r=Ae();try{return mt(t)(e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},k:function(t,e,n){var r=Ae();try{return mt(t)(e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},p:function(t,e,n,r){var o=Ae();try{return mt(t)(e,n,r)}catch(t){if(Ee(o),t!==t+0)throw t;Se(1,0)}},q:function(t,e,n,r,o){var i=Ae();try{return mt(t)(e,n,r,o)}catch(t){if(Ee(i),t!==t+0)throw t;Se(1,0)}},N:function(t,e,n,r,o,i){var a=Ae();try{return mt(t)(e,n,r,o,i)}catch(t){if(Ee(a),t!==t+0)throw t;Se(1,0)}},s:function(t,e,n,r,o,i){var a=Ae();try{return mt(t)(e,n,r,o,i)}catch(t){if(Ee(a),t!==t+0)throw t;Se(1,0)}},w:function(t,e,n,r,o,i,a){var s=Ae();try{return mt(t)(e,n,r,o,i,a)}catch(t){if(Ee(s),t!==t+0)throw t;Se(1,0)}},L:function(t,e,n,r,o,i,a,s){var u=Ae();try{return mt(t)(e,n,r,o,i,a,s)}catch(t){if(Ee(u),t!==t+0)throw t;Se(1,0)}},E:function(t,e,n,r,o,i,a,s,u,c,l,f){var p=Ae();try{return mt(t)(e,n,r,o,i,a,s,u,c,l,f)}catch(t){if(Ee(p),t!==t+0)throw t;Se(1,0)}},aa:function(t,e,n,r,o,i,a,s){var u=Ae();try{return Ue(t,e,n,r,o,i,a,s)}catch(t){if(Ee(u),t!==t+0)throw t;Se(1,0)}},_:function(t,e,n,r,o,i,a){var s=Ae();try{return Ce(t,e,n,r,o,i,a)}catch(t){if(Ee(s),t!==t+0)throw t;Se(1,0)}},Z:function(t,e,n,r,o){var i=Ae();try{return Ve(t,e,n,r,o)}catch(t){if(Ee(i),t!==t+0)throw t;Se(1,0)}},ca:function(t,e,n,r){var o=Ae();try{return Me(t,e,n,r)}catch(t){if(Ee(o),t!==t+0)throw t;Se(1,0)}},$:function(t){var e=Ae();try{return ke(t)}catch(t){if(Ee(e),t!==t+0)throw t;Se(1,0)}},ba:function(t,e){var n=Ae();try{return je(t,e)}catch(t){if(Ee(n),t!==t+0)throw t;Se(1,0)}},Y:function(t,e,n){var r=Ae();try{return Fe(t,e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},g:function(t){var e=Ae();try{mt(t)()}catch(t){if(Ee(e),t!==t+0)throw t;Se(1,0)}},r:function(t,e){var n=Ae();try{mt(t)(e)}catch(t){if(Ee(n),t!==t+0)throw t;Se(1,0)}},i:function(t,e,n){var r=Ae();try{mt(t)(e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},ha:function(t,e,n,r){var o=Ae();try{mt(t)(e,n,r)}catch(t){if(Ee(o),t!==t+0)throw t;Se(1,0)}},m:function(t,e,n,r){var o=Ae();try{mt(t)(e,n,r)}catch(t){if(Ee(o),t!==t+0)throw t;Se(1,0)}},v:function(t,e,n,r,o){var i=Ae();try{mt(t)(e,n,r,o)}catch(t){if(Ee(i),t!==t+0)throw t;Se(1,0)}},u:function(t,e,n,r,o,i){var a=Ae();try{mt(t)(e,n,r,o,i)}catch(t){if(Ee(a),t!==t+0)throw t;Se(1,0)}},O:function(t,e,n,r,o,i,a){var s=Ae();try{mt(t)(e,n,r,o,i,a)}catch(t){if(Ee(s),t!==t+0)throw t;Se(1,0)}},A:function(t,e,n,r,o,i,a,s){var u=Ae();try{mt(t)(e,n,r,o,i,a,s)}catch(t){if(Ee(u),t!==t+0)throw t;Se(1,0)}},ka:function(t,e,n,r,o,i,a,s,u){var c=Ae();try{mt(t)(e,n,r,o,i,a,s,u)}catch(t){if(Ee(c),t!==t+0)throw t;Se(1,0)}},C:function(t,e,n,r,o,i,a,s,u,c,l){var f=Ae();try{mt(t)(e,n,r,o,i,a,s,u,c,l)}catch(t){if(Ee(f),t!==t+0)throw t;Se(1,0)}},D:function(t,e,n,r,o,i,a,s,u,c,l,f,p,h,d,g){var b=Ae();try{mt(t)(e,n,r,o,i,a,s,u,c,l,f,p,h,d,g)}catch(t){if(Ee(b),t!==t+0)throw t;Se(1,0)}},fa:function(t,e,n,r,o,i,a,s){var u=Ae();try{Ne(t,e,n,r,o,i,a,s)}catch(t){if(Ee(u),t!==t+0)throw t;Se(1,0)}},da:function(t,e,n,r,o,i,a,s,u,c,l,f){var p=Ae();try{Le(t,e,n,r,o,i,a,s,u,c,l,f)}catch(t){if(Ee(p),t!==t+0)throw t;Se(1,0)}},ea:function(t,e,n,r,o,i){var a=Ae();try{Re(t,e,n,r,o,i)}catch(t){if(Ee(a),t!==t+0)throw t;Se(1,0)}},o:function(t){return t},a:k||s.wasmMemory,G:function(t){ae=t},la:le,z:function(t,e,n,r){return le(t,e,n,r)}};!function(){function t(t,e){s.asm=t.exports,ht.qc.push(s.asm.sb),X=s.asm.ub,K.unshift(s.asm.Va),C=e,x||(et--,s.monitorRunDependencies&&s.monitorRunDependencies(et),0==et&&(null!==nt&&(clearInterval(nt),nt=null),rt&&(t=rt,rt=null,t())))}function e(e){t(e.instance,e.module)}function n(t){return function(){if(!E&&(v||_)){if("function"==typeof fetch&&!tt.startsWith("file://"))return fetch(tt,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+tt+"'";return t.arrayBuffer()})).catch((function(){return at()}));if(f)return new Promise((function(t,e){f(tt,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return at()}))}().then((function(t){return WebAssembly.instantiate(t,r)})).then((function(t){return t})).then(t,(function(t){P("failed to asynchronously prepare wasm: "+t),ot(t)}))}var r={a:pe};if(x||(et++,s.monitorRunDependencies&&s.monitorRunDependencies(et)),s.instantiateWasm)try{return s.instantiateWasm(r,t)}catch(t){return P("Module.instantiateWasm callback failed with error: "+t),!1}(E||"function"!=typeof WebAssembly.instantiateStreaming||it()||tt.startsWith("file://")||w||"function"!=typeof fetch?n(e):fetch(tt,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,r).then(e,(function(t){return P("wasm streaming compile failed: "+t),P("falling back to ArrayBuffer instantiation"),n(e)}))}))).catch(c)}(),s.___wasm_call_ctors=function(){return(s.___wasm_call_ctors=s.asm.Va).apply(null,arguments)},s._OrtInit=function(){return(s._OrtInit=s.asm.Wa).apply(null,arguments)},s._OrtCreateSessionOptions=function(){return(s._OrtCreateSessionOptions=s.asm.Xa).apply(null,arguments)},s._OrtAppendExecutionProvider=function(){return(s._OrtAppendExecutionProvider=s.asm.Ya).apply(null,arguments)},s._OrtAddSessionConfigEntry=function(){return(s._OrtAddSessionConfigEntry=s.asm.Za).apply(null,arguments)},s._OrtReleaseSessionOptions=function(){return(s._OrtReleaseSessionOptions=s.asm._a).apply(null,arguments)},s._OrtCreateSession=function(){return(s._OrtCreateSession=s.asm.$a).apply(null,arguments)},s._OrtReleaseSession=function(){return(s._OrtReleaseSession=s.asm.ab).apply(null,arguments)},s._OrtGetInputCount=function(){return(s._OrtGetInputCount=s.asm.bb).apply(null,arguments)},s._OrtGetOutputCount=function(){return(s._OrtGetOutputCount=s.asm.cb).apply(null,arguments)},s._OrtGetInputName=function(){return(s._OrtGetInputName=s.asm.db).apply(null,arguments)},s._OrtGetOutputName=function(){return(s._OrtGetOutputName=s.asm.eb).apply(null,arguments)},s._OrtFree=function(){return(s._OrtFree=s.asm.fb).apply(null,arguments)},s._OrtCreateTensor=function(){return(s._OrtCreateTensor=s.asm.gb).apply(null,arguments)},s._OrtGetTensorData=function(){return(s._OrtGetTensorData=s.asm.hb).apply(null,arguments)},s._OrtReleaseTensor=function(){return(s._OrtReleaseTensor=s.asm.ib).apply(null,arguments)},s._OrtCreateRunOptions=function(){return(s._OrtCreateRunOptions=s.asm.jb).apply(null,arguments)},s._OrtAddRunConfigEntry=function(){return(s._OrtAddRunConfigEntry=s.asm.kb).apply(null,arguments)},s._OrtReleaseRunOptions=function(){return(s._OrtReleaseRunOptions=s.asm.lb).apply(null,arguments)},s._OrtRun=function(){return(s._OrtRun=s.asm.mb).apply(null,arguments)},s._OrtEndProfiling=function(){return(s._OrtEndProfiling=s.asm.nb).apply(null,arguments)};var he=s._pthread_self=function(){return(he=s._pthread_self=s.asm.ob).apply(null,arguments)},de=s._malloc=function(){return(de=s._malloc=s.asm.pb).apply(null,arguments)},ge=s._free=function(){return(ge=s._free=s.asm.qb).apply(null,arguments)},be=s._fflush=function(){return(be=s._fflush=s.asm.rb).apply(null,arguments)};s.__emscripten_tls_init=function(){return(s.__emscripten_tls_init=s.asm.sb).apply(null,arguments)};var ye=s.___funcs_on_exit=function(){return(ye=s.___funcs_on_exit=s.asm.tb).apply(null,arguments)},me=s.__emscripten_thread_init=function(){return(me=s.__emscripten_thread_init=s.asm.vb).apply(null,arguments)};s.__emscripten_thread_crashed=function(){return(s.__emscripten_thread_crashed=s.asm.wb).apply(null,arguments)};var ve,_e=s._emscripten_run_in_main_runtime_thread_js=function(){return(_e=s._emscripten_run_in_main_runtime_thread_js=s.asm.xb).apply(null,arguments)},we=s.__emscripten_proxy_execute_task_queue=function(){return(we=s.__emscripten_proxy_execute_task_queue=s.asm.yb).apply(null,arguments)},xe=s.__emscripten_thread_free_data=function(){return(xe=s.__emscripten_thread_free_data=s.asm.zb).apply(null,arguments)},Te=s.__emscripten_thread_exit=function(){return(Te=s.__emscripten_thread_exit=s.asm.Ab).apply(null,arguments)},Se=s._setThrew=function(){return(Se=s._setThrew=s.asm.Bb).apply(null,arguments)},Oe=s._emscripten_stack_set_limits=function(){return(Oe=s._emscripten_stack_set_limits=s.asm.Cb).apply(null,arguments)},Ae=s.stackSave=function(){return(Ae=s.stackSave=s.asm.Db).apply(null,arguments)},Ee=s.stackRestore=function(){return(Ee=s.stackRestore=s.asm.Eb).apply(null,arguments)},Ie=s.stackAlloc=function(){return(Ie=s.stackAlloc=s.asm.Fb).apply(null,arguments)},Pe=s.___cxa_can_catch=function(){return(Pe=s.___cxa_can_catch=s.asm.Gb).apply(null,arguments)},De=s.___cxa_is_pointer_type=function(){return(De=s.___cxa_is_pointer_type=s.asm.Hb).apply(null,arguments)},ke=s.dynCall_j=function(){return(ke=s.dynCall_j=s.asm.Ib).apply(null,arguments)},Ce=s.dynCall_iiiiij=function(){return(Ce=s.dynCall_iiiiij=s.asm.Jb).apply(null,arguments)},Fe=s.dynCall_jii=function(){return(Fe=s.dynCall_jii=s.asm.Kb).apply(null,arguments)},Ne=s.dynCall_viiiiij=function(){return(Ne=s.dynCall_viiiiij=s.asm.Lb).apply(null,arguments)},Re=s.dynCall_vjji=function(){return(Re=s.dynCall_vjji=s.asm.Mb).apply(null,arguments)},Le=s.dynCall_viiijjjii=function(){return(Le=s.dynCall_viiijjjii=s.asm.Nb).apply(null,arguments)},Me=s.dynCall_iij=function(){return(Me=s.dynCall_iij=s.asm.Ob).apply(null,arguments)},je=s.dynCall_ji=function(){return(je=s.dynCall_ji=s.asm.Pb).apply(null,arguments)},Ue=s.dynCall_iiiiiij=function(){return(Ue=s.dynCall_iiiiiij=s.asm.Qb).apply(null,arguments)},Ve=s.dynCall_iiij=function(){return(Ve=s.dynCall_iiij=s.asm.Rb).apply(null,arguments)};function Be(){function t(){if(!ve&&(ve=!0,s.calledRun=!0,!U)&&(x||dt(K),u(s),s.onRuntimeInitialized&&s.onRuntimeInitialized(),!x)){if(s.postRun)for("function"==typeof s.postRun&&(s.postRun=[s.postRun]);s.postRun.length;){var t=s.postRun.shift();J.unshift(t)}dt(J)}}if(!(0<et))if(x)u(s),x||dt(K),postMessage({cmd:"loaded"});else{if(s.preRun)for("function"==typeof s.preRun&&(s.preRun=[s.preRun]);s.preRun.length;)Q();dt(Y),0<et||(s.setStatus?(s.setStatus("Running..."),setTimeout((function(){setTimeout((function(){s.setStatus("")}),1),t()}),1)):t())}}if(s.UTF8ToString=z,s.stringToUTF8=function(t,e,n){return G(t,r(),e,n)},s.lengthBytesUTF8=H,s.keepRuntimeAlive=$,s.wasmMemory=k,s.stackSave=Ae,s.stackRestore=Ee,s.stackAlloc=Ie,s.ExitStatus=ut,s.PThread=ht,rt=function t(){ve||Be(),ve||(rt=t)},s.preInit)for("function"==typeof s.preInit&&(s.preInit=[s.preInit]);0<s.preInit.length;)s.preInit.pop()();return Be(),t.ready});t.exports=r},932:function(t,e,n){var _scriptDir,r=(_scriptDir=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){var e,r,o;t=t||{},e||(e=void 0!==t?t:{}),e.ready=new Promise((function(t,e){r=t,o=e}));var i,a,s,u,c,l,f=Object.assign({},e),p="./this.program",h=(t,e)=>{throw e},d="object"==typeof window,g="function"==typeof importScripts,b="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,y="";b?(y=g?n(908).dirname(y)+"/":"//",l=()=>{c||(u=n(1384),c=n(908))},i=function(t,e){return l(),t=c.normalize(t),u.readFileSync(t,e?void 0:"utf8")},s=t=>((t=i(t,!0)).buffer||(t=new Uint8Array(t)),t),a=(t,e,n)=>{l(),t=c.normalize(t),u.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1<process.argv.length&&(p=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",(function(t){if(!(t instanceof Z))throw t})),process.on("unhandledRejection",(function(t){throw t})),h=(t,e)=>{if(w||0<V)throw process.exitCode=t,e;e instanceof Z||_("exiting due to exception: "+e),process.exit(t)},e.inspect=function(){return"[Emscripten Module object]"}):(d||g)&&(g?y=self.location.href:"undefined"!=typeof document&&document.currentScript&&(y=document.currentScript.src),_scriptDir&&(y=_scriptDir),y=0!==y.indexOf("blob:")?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf("/")+1):"",i=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},g&&(s=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),a=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)});var m,v=e.print||console.log.bind(console),_=e.printErr||console.warn.bind(console);Object.assign(e,f),f=null,e.thisProgram&&(p=e.thisProgram),e.quit&&(h=e.quit),e.wasmBinary&&(m=e.wasmBinary);var w=e.noExitRuntime||!1;"object"!=typeof WebAssembly&&q("no native wasm support detected");var x,T,S,O,A,E,I=!1,P="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function D(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16<n-e&&t.buffer&&P)return P.decode(t.subarray(e,n));for(r="";e<n;){var o=t[e++];if(128&o){var i=63&t[e++];if(192==(224&o))r+=String.fromCharCode((31&o)<<6|i);else{var a=63&t[e++];65536>(o=224==(240&o)?(15&o)<<12|i<<6|a:(7&o)<<18|i<<12|a<<6|63&t[e++])?r+=String.fromCharCode(o):(o-=65536,r+=String.fromCharCode(55296|o>>10,56320|1023&o))}}else r+=String.fromCharCode(o)}return r}function k(t,e){return(t>>>=0)?D(O,t,e):""}function C(t,e,n,r){if(!(0<r))return 0;var o=n>>>=0;r=n+r-1;for(var i=0;i<t.length;++i){var a=t.charCodeAt(i);if(55296<=a&&57343>=a&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++i)),127>=a){if(n>=r)break;e[n++>>>0]=a}else{if(2047>=a){if(n+1>=r)break;e[n++>>>0]=192|a>>6}else{if(65535>=a){if(n+2>=r)break;e[n++>>>0]=224|a>>12}else{if(n+3>=r)break;e[n++>>>0]=240|a>>18,e[n++>>>0]=128|a>>12&63}e[n++>>>0]=128|a>>6&63}e[n++>>>0]=128|63&a}}return e[n>>>0]=0,n-o}function F(t){for(var e=0,n=0;n<t.length;++n){var r=t.charCodeAt(n);127>=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function N(){var t=x.buffer;T=t,e.HEAP8=S=new Int8Array(t),e.HEAP16=new Int16Array(t),e.HEAP32=A=new Int32Array(t),e.HEAPU8=O=new Uint8Array(t),e.HEAPU16=new Uint16Array(t),e.HEAPU32=E=new Uint32Array(t),e.HEAPF32=new Float32Array(t),e.HEAPF64=new Float64Array(t)}var R,L=[],M=[],j=[],U=[],V=0;function B(){var t=e.preRun.shift();L.unshift(t)}var z,G=0,H=null,W=null;function q(t){throw e.onAbort&&e.onAbort(t),_(t="Aborted("+t+")"),I=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),o(t),t}function X(){return z.startsWith("data:application/octet-stream;base64,")}if(z="ort-wasm.wasm",!X()){var Y=z;z=e.locateFile?e.locateFile(Y,y):y+Y}function K(){var t=z;try{if(t==z&&m)return new Uint8Array(m);if(s)return s(t);throw"both async and sync fetching of the wasm failed"}catch(t){q(t)}}function Z(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function J(t){for(;0<t.length;)t.shift()(e)}var $=[],Q=0,tt=0;function et(t){this.Db=t,this.zb=t-24,this.Ub=function(t){E[this.zb+4>>2>>>0]=t},this.Eb=function(){return E[this.zb+4>>2>>>0]},this.Sb=function(t){E[this.zb+8>>2>>>0]=t},this.Wb=function(){return E[this.zb+8>>2>>>0]},this.Tb=function(){A[this.zb>>2>>>0]=0},this.Ib=function(t){S[this.zb+12>>0>>>0]=t?1:0},this.Pb=function(){return 0!=S[this.zb+12>>0>>>0]},this.Jb=function(t){S[this.zb+13>>0>>>0]=t?1:0},this.Lb=function(){return 0!=S[this.zb+13>>0>>>0]},this.Rb=function(t,e){this.Fb(0),this.Ub(t),this.Sb(e),this.Tb(),this.Ib(!1),this.Jb(!1)},this.Nb=function(){A[this.zb>>2>>>0]+=1},this.Xb=function(){var t=A[this.zb>>2>>>0];return A[this.zb>>2>>>0]=t-1,1===t},this.Fb=function(t){E[this.zb+16>>2>>>0]=t},this.Ob=function(){return E[this.zb+16>>2>>>0]},this.Qb=function(){if(Et(this.Eb()))return E[this.Db>>2>>>0];var t=this.Ob();return 0!==t?t:this.Db}}function nt(t){return vt(new et(t).zb)}var rt=[];function ot(t){var e=rt[t];return e||(t>=rt.length&&(rt.length=t+1),rt[t]=e=R.get(t)),e}function it(t){var e=F(t)+1,n=mt(e);return n&&C(t,S,n,e),n}var at={};function st(){if(!ut){var t,e={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",_:p||"./this.program"};for(t in at)void 0===at[t]?delete e[t]:e[t]=at[t];var n=[];for(t in e)n.push(t+"="+e[t]);ut=n}return ut}var ut,ct=[null,[],[]];function lt(t,e){var n=ct[t];0===e||10===e?((1===t?v:_)(D(n,0)),n.length=0):n.push(e)}var ft=0;function pt(t){return 0==t%4&&(0!=t%100||0==t%400)}var ht=[31,29,31,30,31,30,31,31,30,31,30,31],dt=[31,28,31,30,31,30,31,31,30,31,30,31];function gt(t,e,n,r){function o(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.length<e;)t=n[0]+t;return t}function i(t,e){return o(t,e,"0")}function a(t,e){function n(t){return 0>t?-1:0<t?1:0}var r;return 0===(r=n(t.getFullYear()-e.getFullYear()))&&0===(r=n(t.getMonth()-e.getMonth()))&&(r=n(t.getDate()-e.getDate())),r}function s(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 u(t){var e=t.Bb;for(t=new Date(new Date(t.Cb+1900,0,1).getTime());0<e;){var n=t.getMonth(),r=(pt(t.getFullYear())?ht:dt)[n];if(!(e>r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=s(new Date(t.getFullYear(),0,4)),n=s(n),0>=a(e,t)?0>=a(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var c=A[r+40>>2>>>0];for(var l in r={$b:A[r>>2>>>0],Zb:A[r+4>>2>>>0],Gb:A[r+8>>2>>>0],Kb:A[r+12>>2>>>0],Hb:A[r+16>>2>>>0],Cb:A[r+20>>2>>>0],Ab:A[r+24>>2>>>0],Bb:A[r+28>>2>>>0],bc:A[r+32>>2>>>0],Yb:A[r+36>>2>>>0],ac:c?k(c):""},n=k(n),c={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})n=n.replace(new RegExp(l,"g"),c[l]);var f="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),p="January February March April May June July August September October November December".split(" ");for(l in c={"%a":function(t){return f[t.Ab].substring(0,3)},"%A":function(t){return f[t.Ab]},"%b":function(t){return p[t.Hb].substring(0,3)},"%B":function(t){return p[t.Hb]},"%C":function(t){return i((t.Cb+1900)/100|0,2)},"%d":function(t){return i(t.Kb,2)},"%e":function(t){return o(t.Kb,2," ")},"%g":function(t){return u(t).toString().substring(2)},"%G":function(t){return u(t)},"%H":function(t){return i(t.Gb,2)},"%I":function(t){return 0==(t=t.Gb)?t=12:12<t&&(t-=12),i(t,2)},"%j":function(t){for(var e=0,n=0;n<=t.Hb-1;e+=(pt(t.Cb+1900)?ht:dt)[n++]);return i(t.Kb+e,3)},"%m":function(t){return i(t.Hb+1,2)},"%M":function(t){return i(t.Zb,2)},"%n":function(){return"\n"},"%p":function(t){return 0<=t.Gb&&12>t.Gb?"AM":"PM"},"%S":function(t){return i(t.$b,2)},"%t":function(){return"\t"},"%u":function(t){return t.Ab||7},"%U":function(t){return i(Math.floor((t.Bb+7-t.Ab)/7),2)},"%V":function(t){var e=Math.floor((t.Bb+7-(t.Ab+6)%7)/7);if(2>=(t.Ab+371-t.Bb-2)%7&&e++,e)53==e&&(4==(n=(t.Ab+371-t.Bb)%7)||3==n&&pt(t.Cb)||(e=1));else{e=52;var n=(t.Ab+7-t.Bb-1)%7;(4==n||5==n&&pt(t.Cb%400-1))&&e++}return i(e,2)},"%w":function(t){return t.Ab},"%W":function(t){return i(Math.floor((t.Bb+7-(t.Ab+6)%7)/7),2)},"%y":function(t){return(t.Cb+1900).toString().substring(2)},"%Y":function(t){return t.Cb+1900},"%z":function(t){var e=0<=(t=t.Yb);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.ac},"%%":function(){return"%"}},n=n.replace(/%%/g,"\0\0"),c)n.includes(l)&&(n=n.replace(new RegExp(l,"g"),c[l](r)));return l=function(t){var e=Array(F(t)+1);return C(t,e,0,e.length),e}(n=n.replace(/\0\0/g,"%")),l.length>e?0:(S.set(l,t>>>0),l.length-1)}var bt={a:function(t){return mt(t+24)+24},m:function(t){return(t=new et(t)).Pb()||(t.Ib(!0),Q--),t.Jb(!1),$.push(t),t.Nb(),t.Qb()},ia:function(t){throw _("Unexpected exception thrown, this is not properly supported - aborting"),I=!0,t},w:function(){xt(0);var t=$.pop();if(t.Xb()&&!t.Lb()){var e=t.Wb();e&&ot(e)(t.Db),nt(t.Db)}tt=0},d:function(){var t=tt;if(!t)return ft=0;var e=new et(t);e.Fb(t);var n=e.Eb();if(!n)return ft=0,t;for(var r=Array.prototype.slice.call(arguments),o=0;o<r.length;o++){var i=r[o];if(0===i||i===n)break;if(At(i,n,e.zb+16))return ft=i,t}return ft=n,t},k:function(){var t=tt;if(!t)return ft=0;var e=new et(t);e.Fb(t);var n=e.Eb();if(!n)return ft=0,t;for(var r=Array.prototype.slice.call(arguments),o=0;o<r.length;o++){var i=r[o];if(0===i||i===n)break;if(At(i,n,e.zb+16))return ft=i,t}return ft=n,t},g:function(){var t=tt;if(!t)return ft=0;var e=new et(t);e.Fb(t);var n=e.Eb();if(!n)return ft=0,t;for(var r=Array.prototype.slice.call(arguments),o=0;o<r.length;o++){var i=r[o];if(0===i||i===n)break;if(At(i,n,e.zb+16))return ft=i,t}return ft=n,t},s:nt,L:function(){var t=$.pop();t||q("no exception to throw");var e=t.Db;throw t.Lb()||($.push(t),t.Jb(!0),t.Ib(!1),Q++),tt=e,e},b:function(t,e,n){throw new et(t).Rb(e,n),tt=t,Q++,t},la:function(){return Q},i:function(t){throw tt||(tt=t),t},H:function(){return 0},Ba:function(){},pa:function(){},ra:function(){},ka:function(){return 0},za:function(){},ua:function(){},ya:function(){},R:function(){},qa:function(){},na:function(){},Aa:function(){},oa:function(){},Ha:function(){},Ja:function(){q("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},Ia:function(){q("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},S:function(){return Date.now()},Ca:function(){return!0},Da:function(t,e){t=new Date(1e3*(E[t>>>2]+4294967296*A[t+4>>>2])),A[e>>2>>>0]=t.getUTCSeconds(),A[e+4>>2>>>0]=t.getUTCMinutes(),A[e+8>>2>>>0]=t.getUTCHours(),A[e+12>>2>>>0]=t.getUTCDate(),A[e+16>>2>>>0]=t.getUTCMonth(),A[e+20>>2>>>0]=t.getUTCFullYear()-1900,A[e+24>>2>>>0]=t.getUTCDay(),A[e+28>>2>>>0]=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Ea:function(t,e){t=new Date(1e3*(E[t>>>2]+4294967296*A[t+4>>>2])),A[e>>2>>>0]=t.getSeconds(),A[e+4>>2>>>0]=t.getMinutes(),A[e+8>>2>>>0]=t.getHours(),A[e+12>>2>>>0]=t.getDate(),A[e+16>>2>>>0]=t.getMonth(),A[e+20>>2>>>0]=t.getFullYear()-1900,A[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1);A[e+28>>2>>>0]=(t.getTime()-n.getTime())/864e5|0,A[e+36>>2>>>0]=-60*t.getTimezoneOffset();var r=new Date(t.getFullYear(),6,1).getTimezoneOffset();n=n.getTimezoneOffset(),A[e+32>>2>>>0]=0|(r!=n&&t.getTimezoneOffset()==Math.min(n,r))},Fa:function(t){var e=new Date(A[t+20>>2>>>0]+1900,A[t+16>>2>>>0],A[t+12>>2>>>0],A[t+8>>2>>>0],A[t+4>>2>>>0],A[t>>2>>>0],0),n=A[t+32>>2>>>0],r=e.getTimezoneOffset(),o=new Date(e.getFullYear(),0,1),i=new Date(e.getFullYear(),6,1).getTimezoneOffset(),a=o.getTimezoneOffset(),s=Math.min(a,i);return 0>n?A[t+32>>2>>>0]=Number(i!=a&&s==r):0<n!=(s==r)&&(i=Math.max(a,i),e.setTime(e.getTime()+6e4*((0<n?s:i)-r))),A[t+24>>2>>>0]=e.getDay(),A[t+28>>2>>>0]=(e.getTime()-o.getTime())/864e5|0,A[t>>2>>>0]=e.getSeconds(),A[t+4>>2>>>0]=e.getMinutes(),A[t+8>>2>>>0]=e.getHours(),A[t+12>>2>>>0]=e.getDate(),A[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},sa:function(){return-52},ta:function(){},Ga:function t(e,n,r){t.Vb||(t.Vb=!0,function(t,e,n){function r(t){return(t=t.toTimeString().match(/\(([A-Za-z ]+)\)$/))?t[1]:"GMT"}var o=(new Date).getFullYear(),i=new Date(o,0,1),a=new Date(o,6,1);o=i.getTimezoneOffset();var s=a.getTimezoneOffset();A[t>>2>>>0]=60*Math.max(o,s),A[e>>2>>>0]=Number(o!=s),t=r(i),e=r(a),t=it(t),e=it(e),s<o?(E[n>>2>>>0]=t,E[n+4>>2>>>0]=e):(E[n>>2>>>0]=e,E[n+4>>2>>>0]=t)}(e,n,r))},B:function(){q("")},ma:function(){return 4294901760},I:b?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:()=>performance.now(),xa:function(t,e,n){O.copyWithin(t>>>0,e>>>0,e+n>>>0)},G:function(t){var e=O.length;if(4294901760<(t>>>=0))return!1;for(var n=1;4>=n;n*=2){var r=e*(1+.2/n);r=Math.min(r,t+100663296);var o=Math;r=Math.max(t,r),o=o.min.call(o,4294901760,r+(65536-r%65536)%65536);t:{try{x.grow(o-T.byteLength+65535>>>16),N();var i=1;break t}catch(t){}i=void 0}if(i)return!0}return!1},va:function(t,e){var n=0;return st().forEach((function(r,o){var i=e+n;for(o=E[t+4*o>>2>>>0]=i,i=0;i<r.length;++i)S[o++>>0>>>0]=r.charCodeAt(i);S[o>>0>>>0]=0,n+=r.length+1})),0},wa:function(t,e){var n=st();E[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),E[e>>2>>>0]=r,0},ba:function(t){w||0<V||(wt(),J(j),_t(0),ct[1].length&<(1,10),ct[2].length&<(2,10)),w||0<V||(e.onExit&&e.onExit(t),I=!0),h(t,new Z(t))},E:function(){return 52},Q:function(){return 52},ca:function(){return 70},P:function(t,e,n,r){for(var o=0,i=0;i<n;i++){var a=E[e>>2>>>0],s=E[e+4>>2>>>0];e+=8;for(var u=0;u<s;u++)lt(t,O[a+u>>>0]);o+=s}return E[r>>2>>>0]=o,0},c:function(){return ft},ja:function t(e,r){t.Mb||(t.Mb=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(b)try{var e=n(Object(function(){var t=new Error("Cannot find module 'crypto'");throw t.code="MODULE_NOT_FOUND",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>q("randomDevice")}());for(var o=0;o<r;o++)S[e+o>>0>>>0]=t.Mb();return 0},ea:function(t,e,n){var r=Tt();try{return ot(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;xt(1,0)}},fa:function(t,e,n){var r=Tt();try{return ot(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;xt(1,0)}},J:function(t){var e=Tt();try{return ot(t)()}catch(t){if(St(e),t!==t+0)throw t;xt(1,0)}},e:function(t,e){var n=Tt();try{return ot(t)(e)}catch(t){if(St(n),t!==t+0)throw t;xt(1,0)}},N:function(t,e,n){var r=Tt();try{return ot(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;xt(1,0)}},O:function(t,e,n){var r=Tt();try{return ot(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;xt(1,0)}},j:function(t,e,n){var r=Tt();try{return ot(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;xt(1,0)}},o:function(t,e,n,r){var o=Tt();try{return ot(t)(e,n,r)}catch(t){if(St(o),t!==t+0)throw t;xt(1,0)}},p:function(t,e,n,r,o){var i=Tt();try{return ot(t)(e,n,r,o)}catch(t){if(St(i),t!==t+0)throw t;xt(1,0)}},M:function(t,e,n,r,o,i){var a=Tt();try{return ot(t)(e,n,r,o,i)}catch(t){if(St(a),t!==t+0)throw t;xt(1,0)}},r:function(t,e,n,r,o,i){var a=Tt();try{return ot(t)(e,n,r,o,i)}catch(t){if(St(a),t!==t+0)throw t;xt(1,0)}},v:function(t,e,n,r,o,i,a){var s=Tt();try{return ot(t)(e,n,r,o,i,a)}catch(t){if(St(s),t!==t+0)throw t;xt(1,0)}},K:function(t,e,n,r,o,i,a,s){var u=Tt();try{return ot(t)(e,n,r,o,i,a,s)}catch(t){if(St(u),t!==t+0)throw t;xt(1,0)}},D:function(t,e,n,r,o,i,a,s,u,c,l,f){var p=Tt();try{return ot(t)(e,n,r,o,i,a,s,u,c,l,f)}catch(t){if(St(p),t!==t+0)throw t;xt(1,0)}},X:function(t,e,n,r,o,i,a,s){var u=Tt();try{return Lt(t,e,n,r,o,i,a,s)}catch(t){if(St(u),t!==t+0)throw t;xt(1,0)}},V:function(t,e,n,r,o,i,a){var s=Tt();try{return Pt(t,e,n,r,o,i,a)}catch(t){if(St(s),t!==t+0)throw t;xt(1,0)}},U:function(t,e,n,r,o){var i=Tt();try{return Mt(t,e,n,r,o)}catch(t){if(St(i),t!==t+0)throw t;xt(1,0)}},Z:function(t,e,n,r){var o=Tt();try{return Nt(t,e,n,r)}catch(t){if(St(o),t!==t+0)throw t;xt(1,0)}},W:function(t){var e=Tt();try{return It(t)}catch(t){if(St(e),t!==t+0)throw t;xt(1,0)}},Y:function(t,e){var n=Tt();try{return Rt(t,e)}catch(t){if(St(n),t!==t+0)throw t;xt(1,0)}},T:function(t,e,n){var r=Tt();try{return Dt(t,e,n)}catch(t){if(St(r),t!==t+0)throw t;xt(1,0)}},f:function(t){var e=Tt();try{ot(t)()}catch(t){if(St(e),t!==t+0)throw t;xt(1,0)}},q:function(t,e){var n=Tt();try{ot(t)(e)}catch(t){if(St(n),t!==t+0)throw t;xt(1,0)}},h:function(t,e,n){var r=Tt();try{ot(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;xt(1,0)}},da:function(t,e,n,r){var o=Tt();try{ot(t)(e,n,r)}catch(t){if(St(o),t!==t+0)throw t;xt(1,0)}},l:function(t,e,n,r){var o=Tt();try{ot(t)(e,n,r)}catch(t){if(St(o),t!==t+0)throw t;xt(1,0)}},t:function(t,e,n,r,o){var i=Tt();try{ot(t)(e,n,r,o)}catch(t){if(St(i),t!==t+0)throw t;xt(1,0)}},u:function(t,e,n,r,o,i){var a=Tt();try{ot(t)(e,n,r,o,i)}catch(t){if(St(a),t!==t+0)throw t;xt(1,0)}},x:function(t,e,n,r,o,i,a){var s=Tt();try{ot(t)(e,n,r,o,i,a)}catch(t){if(St(s),t!==t+0)throw t;xt(1,0)}},z:function(t,e,n,r,o,i,a,s){var u=Tt();try{ot(t)(e,n,r,o,i,a,s)}catch(t){if(St(u),t!==t+0)throw t;xt(1,0)}},ga:function(t,e,n,r,o,i,a,s,u){var c=Tt();try{ot(t)(e,n,r,o,i,a,s,u)}catch(t){if(St(c),t!==t+0)throw t;xt(1,0)}},A:function(t,e,n,r,o,i,a,s,u,c,l){var f=Tt();try{ot(t)(e,n,r,o,i,a,s,u,c,l)}catch(t){if(St(f),t!==t+0)throw t;xt(1,0)}},C:function(t,e,n,r,o,i,a,s,u,c,l,f,p,h,d,g){var b=Tt();try{ot(t)(e,n,r,o,i,a,s,u,c,l,f,p,h,d,g)}catch(t){if(St(b),t!==t+0)throw t;xt(1,0)}},aa:function(t,e,n,r,o,i,a,s){var u=Tt();try{kt(t,e,n,r,o,i,a,s)}catch(t){if(St(u),t!==t+0)throw t;xt(1,0)}},_:function(t,e,n,r,o,i,a,s,u,c,l,f){var p=Tt();try{Ft(t,e,n,r,o,i,a,s,u,c,l,f)}catch(t){if(St(p),t!==t+0)throw t;xt(1,0)}},$:function(t,e,n,r,o,i){var a=Tt();try{Ct(t,e,n,r,o,i)}catch(t){if(St(a),t!==t+0)throw t;xt(1,0)}},n:function(t){return t},F:function(t){ft=t},ha:gt,y:function(t,e,n,r){return gt(t,e,n,r)}};!function(){function t(t){e.asm=t.exports,x=e.asm.Ka,N(),R=e.asm.ib,M.unshift(e.asm.La),G--,e.monitorRunDependencies&&e.monitorRunDependencies(G),0==G&&(null!==H&&(clearInterval(H),H=null),W&&(t=W,W=null,t()))}function n(e){t(e.instance)}function r(t){return function(){if(!m&&(d||g)){if("function"==typeof fetch&&!z.startsWith("file://"))return fetch(z,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+z+"'";return t.arrayBuffer()})).catch((function(){return K()}));if(a)return new Promise((function(t,e){a(z,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return K()}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){_("failed to asynchronously prepare wasm: "+t),q(t)}))}var i={a:bt};if(G++,e.monitorRunDependencies&&e.monitorRunDependencies(G),e.instantiateWasm)try{return e.instantiateWasm(i,t)}catch(t){return _("Module.instantiateWasm callback failed with error: "+t),!1}(m||"function"!=typeof WebAssembly.instantiateStreaming||X()||z.startsWith("file://")||b||"function"!=typeof fetch?r(n):fetch(z,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(n,(function(t){return _("wasm streaming compile failed: "+t),_("falling back to ArrayBuffer instantiation"),r(n)}))}))).catch(o)}(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.La).apply(null,arguments)},e._OrtInit=function(){return(e._OrtInit=e.asm.Ma).apply(null,arguments)},e._OrtCreateSessionOptions=function(){return(e._OrtCreateSessionOptions=e.asm.Na).apply(null,arguments)},e._OrtAppendExecutionProvider=function(){return(e._OrtAppendExecutionProvider=e.asm.Oa).apply(null,arguments)},e._OrtAddSessionConfigEntry=function(){return(e._OrtAddSessionConfigEntry=e.asm.Pa).apply(null,arguments)},e._OrtReleaseSessionOptions=function(){return(e._OrtReleaseSessionOptions=e.asm.Qa).apply(null,arguments)},e._OrtCreateSession=function(){return(e._OrtCreateSession=e.asm.Ra).apply(null,arguments)},e._OrtReleaseSession=function(){return(e._OrtReleaseSession=e.asm.Sa).apply(null,arguments)},e._OrtGetInputCount=function(){return(e._OrtGetInputCount=e.asm.Ta).apply(null,arguments)},e._OrtGetOutputCount=function(){return(e._OrtGetOutputCount=e.asm.Ua).apply(null,arguments)},e._OrtGetInputName=function(){return(e._OrtGetInputName=e.asm.Va).apply(null,arguments)},e._OrtGetOutputName=function(){return(e._OrtGetOutputName=e.asm.Wa).apply(null,arguments)},e._OrtFree=function(){return(e._OrtFree=e.asm.Xa).apply(null,arguments)},e._OrtCreateTensor=function(){return(e._OrtCreateTensor=e.asm.Ya).apply(null,arguments)},e._OrtGetTensorData=function(){return(e._OrtGetTensorData=e.asm.Za).apply(null,arguments)},e._OrtReleaseTensor=function(){return(e._OrtReleaseTensor=e.asm._a).apply(null,arguments)},e._OrtCreateRunOptions=function(){return(e._OrtCreateRunOptions=e.asm.$a).apply(null,arguments)},e._OrtAddRunConfigEntry=function(){return(e._OrtAddRunConfigEntry=e.asm.ab).apply(null,arguments)},e._OrtReleaseRunOptions=function(){return(e._OrtReleaseRunOptions=e.asm.bb).apply(null,arguments)},e._OrtRun=function(){return(e._OrtRun=e.asm.cb).apply(null,arguments)},e._OrtEndProfiling=function(){return(e._OrtEndProfiling=e.asm.db).apply(null,arguments)};var yt,mt=e._malloc=function(){return(mt=e._malloc=e.asm.eb).apply(null,arguments)},vt=e._free=function(){return(vt=e._free=e.asm.fb).apply(null,arguments)},_t=e._fflush=function(){return(_t=e._fflush=e.asm.gb).apply(null,arguments)},wt=e.___funcs_on_exit=function(){return(wt=e.___funcs_on_exit=e.asm.hb).apply(null,arguments)},xt=e._setThrew=function(){return(xt=e._setThrew=e.asm.jb).apply(null,arguments)},Tt=e.stackSave=function(){return(Tt=e.stackSave=e.asm.kb).apply(null,arguments)},St=e.stackRestore=function(){return(St=e.stackRestore=e.asm.lb).apply(null,arguments)},Ot=e.stackAlloc=function(){return(Ot=e.stackAlloc=e.asm.mb).apply(null,arguments)},At=e.___cxa_can_catch=function(){return(At=e.___cxa_can_catch=e.asm.nb).apply(null,arguments)},Et=e.___cxa_is_pointer_type=function(){return(Et=e.___cxa_is_pointer_type=e.asm.ob).apply(null,arguments)},It=e.dynCall_j=function(){return(It=e.dynCall_j=e.asm.pb).apply(null,arguments)},Pt=e.dynCall_iiiiij=function(){return(Pt=e.dynCall_iiiiij=e.asm.qb).apply(null,arguments)},Dt=e.dynCall_jii=function(){return(Dt=e.dynCall_jii=e.asm.rb).apply(null,arguments)},kt=e.dynCall_viiiiij=function(){return(kt=e.dynCall_viiiiij=e.asm.sb).apply(null,arguments)},Ct=e.dynCall_vjji=function(){return(Ct=e.dynCall_vjji=e.asm.tb).apply(null,arguments)},Ft=e.dynCall_viiijjjii=function(){return(Ft=e.dynCall_viiijjjii=e.asm.ub).apply(null,arguments)},Nt=e.dynCall_iij=function(){return(Nt=e.dynCall_iij=e.asm.vb).apply(null,arguments)},Rt=e.dynCall_ji=function(){return(Rt=e.dynCall_ji=e.asm.wb).apply(null,arguments)},Lt=e.dynCall_iiiiiij=function(){return(Lt=e.dynCall_iiiiiij=e.asm.xb).apply(null,arguments)},Mt=e.dynCall_iiij=function(){return(Mt=e.dynCall_iiij=e.asm.yb).apply(null,arguments)};function jt(){function t(){if(!yt&&(yt=!0,e.calledRun=!0,!I)){if(J(M),r(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var t=e.postRun.shift();U.unshift(t)}J(U)}}if(!(0<G)){if(e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)B();J(L),0<G||(e.setStatus?(e.setStatus("Running..."),setTimeout((function(){setTimeout((function(){e.setStatus("")}),1),t()}),1)):t())}}if(e.UTF8ToString=k,e.stringToUTF8=function(t,e,n){return C(t,O,e,n)},e.lengthBytesUTF8=F,e.stackSave=Tt,e.stackRestore=St,e.stackAlloc=Ot,W=function t(){yt||jt(),yt||(W=t)},e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);0<e.preInit.length;)e.preInit.pop()();return jt(),t.ready});t.exports=r},4537:function(t){"use strict";t.exports=function(t,e){for(var n=new Array(arguments.length-1),r=0,o=2,i=!0;o<arguments.length;)n[r++]=arguments[o++];return new Promise((function(o,a){n[r]=function(t){if(i)if(i=!1,t)a(t);else{for(var e=new Array(arguments.length-1),n=0;n<e.length;)e[n++]=arguments[n];o.apply(null,e)}};try{t.apply(e||null,n)}catch(t){i&&(i=!1,a(t))}}))}},7419:function(t,e){"use strict";var n=e;n.length=function(t){var e=t.length;if(!e)return 0;for(var n=0;--e%4>1&&"="===t.charAt(e);)++n;return Math.ceil(3*t.length)/4-n};for(var r=new Array(64),o=new Array(123),i=0;i<64;)o[r[i]=i<26?i+65:i<52?i+71:i<62?i-4:i-59|43]=i++;n.encode=function(t,e,n){for(var o,i=null,a=[],s=0,u=0;e<n;){var c=t[e++];switch(u){case 0:a[s++]=r[c>>2],o=(3&c)<<4,u=1;break;case 1:a[s++]=r[o|c>>4],o=(15&c)<<2,u=2;break;case 2:a[s++]=r[o|c>>6],a[s++]=r[63&c],u=0}s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,a)),s=0)}return u&&(a[s++]=r[o],a[s++]=61,1===u&&(a[s++]=61)),i?(s&&i.push(String.fromCharCode.apply(String,a.slice(0,s))),i.join("")):String.fromCharCode.apply(String,a.slice(0,s))};var a="invalid encoding";n.decode=function(t,e,n){for(var r,i=n,s=0,u=0;u<t.length;){var c=t.charCodeAt(u++);if(61===c&&s>1)break;if(void 0===(c=o[c]))throw Error(a);switch(s){case 0:r=c,s=1;break;case 1:e[n++]=r<<2|(48&c)>>4,r=c,s=2;break;case 2:e[n++]=(15&r)<<4|(60&c)>>2,r=c,s=3;break;case 3:e[n++]=(3&r)<<6|c,s=0}}if(1===s)throw Error(a);return n-i},n.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}},9211:function(t){"use strict";function e(){this._listeners={}}t.exports=e,e.prototype.on=function(t,e,n){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:e,ctx:n||this}),this},e.prototype.off=function(t,e){if(void 0===t)this._listeners={};else if(void 0===e)this._listeners[t]=[];else for(var n=this._listeners[t],r=0;r<n.length;)n[r].fn===e?n.splice(r,1):++r;return this},e.prototype.emit=function(t){var e=this._listeners[t];if(e){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<e.length;)e[r].fn.apply(e[r++].ctx,n)}return this}},945:function(t){"use strict";function e(t){return"undefined"!=typeof Float32Array?function(){var e=new Float32Array([-0]),n=new Uint8Array(e.buffer),r=128===n[3];function o(t,r,o){e[0]=t,r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2],r[o+3]=n[3]}function i(t,r,o){e[0]=t,r[o]=n[3],r[o+1]=n[2],r[o+2]=n[1],r[o+3]=n[0]}function a(t,r){return n[0]=t[r],n[1]=t[r+1],n[2]=t[r+2],n[3]=t[r+3],e[0]}function s(t,r){return n[3]=t[r],n[2]=t[r+1],n[1]=t[r+2],n[0]=t[r+3],e[0]}t.writeFloatLE=r?o:i,t.writeFloatBE=r?i:o,t.readFloatLE=r?a:s,t.readFloatBE=r?s:a}():function(){function e(t,e,n,r){var o=e<0?1:0;if(o&&(e=-e),0===e)t(1/e>0?0:2147483648,n,r);else if(isNaN(e))t(2143289344,n,r);else if(e>34028234663852886e22)t((o<<31|2139095040)>>>0,n,r);else if(e<11754943508222875e-54)t((o<<31|Math.round(e/1401298464324817e-60))>>>0,n,r);else{var i=Math.floor(Math.log(e)/Math.LN2);t((o<<31|i+127<<23|8388607&Math.round(e*Math.pow(2,-i)*8388608))>>>0,n,r)}}function a(t,e,n){var r=t(e,n),o=2*(r>>31)+1,i=r>>>23&255,a=8388607&r;return 255===i?a?NaN:o*(1/0):0===i?1401298464324817e-60*o*a:o*Math.pow(2,i-150)*(a+8388608)}t.writeFloatLE=e.bind(null,n),t.writeFloatBE=e.bind(null,r),t.readFloatLE=a.bind(null,o),t.readFloatBE=a.bind(null,i)}(),"undefined"!=typeof Float64Array?function(){var e=new Float64Array([-0]),n=new Uint8Array(e.buffer),r=128===n[7];function o(t,r,o){e[0]=t,r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2],r[o+3]=n[3],r[o+4]=n[4],r[o+5]=n[5],r[o+6]=n[6],r[o+7]=n[7]}function i(t,r,o){e[0]=t,r[o]=n[7],r[o+1]=n[6],r[o+2]=n[5],r[o+3]=n[4],r[o+4]=n[3],r[o+5]=n[2],r[o+6]=n[1],r[o+7]=n[0]}function a(t,r){return n[0]=t[r],n[1]=t[r+1],n[2]=t[r+2],n[3]=t[r+3],n[4]=t[r+4],n[5]=t[r+5],n[6]=t[r+6],n[7]=t[r+7],e[0]}function s(t,r){return n[7]=t[r],n[6]=t[r+1],n[5]=t[r+2],n[4]=t[r+3],n[3]=t[r+4],n[2]=t[r+5],n[1]=t[r+6],n[0]=t[r+7],e[0]}t.writeDoubleLE=r?o:i,t.writeDoubleBE=r?i:o,t.readDoubleLE=r?a:s,t.readDoubleBE=r?s:a}():function(){function e(t,e,n,r,o,i){var a=r<0?1:0;if(a&&(r=-r),0===r)t(0,o,i+e),t(1/r>0?0:2147483648,o,i+n);else if(isNaN(r))t(0,o,i+e),t(2146959360,o,i+n);else if(r>17976931348623157e292)t(0,o,i+e),t((a<<31|2146435072)>>>0,o,i+n);else{var s;if(r<22250738585072014e-324)t((s=r/5e-324)>>>0,o,i+e),t((a<<31|s/4294967296)>>>0,o,i+n);else{var u=Math.floor(Math.log(r)/Math.LN2);1024===u&&(u=1023),t(4503599627370496*(s=r*Math.pow(2,-u))>>>0,o,i+e),t((a<<31|u+1023<<20|1048576*s&1048575)>>>0,o,i+n)}}}function a(t,e,n,r,o){var i=t(r,o+e),a=t(r,o+n),s=2*(a>>31)+1,u=a>>>20&2047,c=4294967296*(1048575&a)+i;return 2047===u?c?NaN:s*(1/0):0===u?5e-324*s*c:s*Math.pow(2,u-1075)*(c+4503599627370496)}t.writeDoubleLE=e.bind(null,n,0,4),t.writeDoubleBE=e.bind(null,r,4,0),t.readDoubleLE=a.bind(null,o,0,4),t.readDoubleBE=a.bind(null,i,4,0)}(),t}function n(t,e,n){e[n]=255&t,e[n+1]=t>>>8&255,e[n+2]=t>>>16&255,e[n+3]=t>>>24}function r(t,e,n){e[n]=t>>>24,e[n+1]=t>>>16&255,e[n+2]=t>>>8&255,e[n+3]=255&t}function o(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}function i(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}t.exports=e(e)},7199:function(module){"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(t){}return null}module.exports=inquire},6662:function(t){"use strict";t.exports=function(t,e,n){var r=n||8192,o=r>>>1,i=null,a=r;return function(n){if(n<1||n>o)return t(n);a+n>r&&(i=t(r),a=0);var s=e.call(i,a,a+=n);return 7&a&&(a=1+(7|a)),s}}},4997:function(t,e){"use strict";var n=e;n.length=function(t){for(var e=0,n=0,r=0;r<t.length;++r)(n=t.charCodeAt(r))<128?e+=1:n<2048?e+=2:55296==(64512&n)&&56320==(64512&t.charCodeAt(r+1))?(++r,e+=4):e+=3;return e},n.read=function(t,e,n){if(n-e<1)return"";for(var r,o=null,i=[],a=0;e<n;)(r=t[e++])<128?i[a++]=r:r>191&&r<224?i[a++]=(31&r)<<6|63&t[e++]:r>239&&r<365?(r=((7&r)<<18|(63&t[e++])<<12|(63&t[e++])<<6|63&t[e++])-65536,i[a++]=55296+(r>>10),i[a++]=56320+(1023&r)):i[a++]=(15&r)<<12|(63&t[e++])<<6|63&t[e++],a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,i)),a=0);return o?(a&&o.push(String.fromCharCode.apply(String,i.slice(0,a))),o.join("")):String.fromCharCode.apply(String,i.slice(0,a))},n.write=function(t,e,n){for(var r,o,i=n,a=0;a<t.length;++a)(r=t.charCodeAt(a))<128?e[n++]=r:r<2048?(e[n++]=r>>6|192,e[n++]=63&r|128):55296==(64512&r)&&56320==(64512&(o=t.charCodeAt(a+1)))?(r=65536+((1023&r)<<10)+(1023&o),++a,e[n++]=r>>18|240,e[n++]=r>>12&63|128,e[n++]=r>>6&63|128,e[n++]=63&r|128):(e[n++]=r>>12|224,e[n++]=r>>6&63|128,e[n++]=63&r|128);return n-i}},3442:function(t,e){"use strict";e.__esModule=!0;var n=function(){function t(e){if(!e)throw new TypeError("Invalid argument; `value` has no value.");this.value=t.EMPTY,e&&t.isGuid(e)&&(this.value=e)}return t.isGuid=function(e){var n=e.toString();return e&&(e instanceof t||t.validator.test(n))},t.create=function(){return new t([t.gen(2),t.gen(1),t.gen(1),t.gen(1),t.gen(3)].join("-"))},t.createEmpty=function(){return new t("emptyguid")},t.parse=function(e){return new t(e)},t.raw=function(){return[t.gen(2),t.gen(1),t.gen(1),t.gen(1),t.gen(3)].join("-")},t.gen=function(t){for(var e="",n=0;n<t;n++)e+=(65536*(1+Math.random())|0).toString(16).substring(1);return e},t.prototype.equals=function(e){return t.isGuid(e)&&this.value===e.toString()},t.prototype.isEmpty=function(){return this.value===t.EMPTY},t.prototype.toString=function(){return this.value},t.prototype.toJSON=function(){return{value:this.value}},t.validator=new RegExp("^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$","i"),t.EMPTY="00000000-0000-0000-0000-000000000000",t}();e.Guid=n},3720:function(t){t.exports=n;var e=null;try{e=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(t){}function n(t,e,n){this.low=0|t,this.high=0|e,this.unsigned=!!n}function r(t){return!0===(t&&t.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=r;var o={},i={};function a(t,e){var n,r,a;return e?(a=0<=(t>>>=0)&&t<256)&&(r=i[t])?r:(n=u(t,(0|t)<0?-1:0,!0),a&&(i[t]=n),n):(a=-128<=(t|=0)&&t<128)&&(r=o[t])?r:(n=u(t,t<0?-1:0,!1),a&&(o[t]=n),n)}function s(t,e){if(isNaN(t))return e?y:b;if(e){if(t<0)return y;if(t>=h)return x}else{if(t<=-d)return T;if(t+1>=d)return w}return t<0?s(-t,e).neg():u(t%p|0,t/p|0,e)}function u(t,e,r){return new n(t,e,r)}n.fromInt=a,n.fromNumber=s,n.fromBits=u;var c=Math.pow;function l(t,e,n){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return b;if("number"==typeof e?(n=e,e=!1):e=!!e,(n=n||10)<2||36<n)throw RangeError("radix");var r;if((r=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===r)return l(t.substring(1),e,n).neg();for(var o=s(c(n,8)),i=b,a=0;a<t.length;a+=8){var u=Math.min(8,t.length-a),f=parseInt(t.substring(a,a+u),n);if(u<8){var p=s(c(n,u));i=i.mul(p).add(s(f))}else i=(i=i.mul(o)).add(s(f))}return i.unsigned=e,i}function f(t,e){return"number"==typeof t?s(t,e):"string"==typeof t?l(t,e):u(t.low,t.high,"boolean"==typeof e?e:t.unsigned)}n.fromString=l,n.fromValue=f;var p=4294967296,h=p*p,d=h/2,g=a(1<<24),b=a(0);n.ZERO=b;var y=a(0,!0);n.UZERO=y;var m=a(1);n.ONE=m;var v=a(1,!0);n.UONE=v;var _=a(-1);n.NEG_ONE=_;var w=u(-1,2147483647,!1);n.MAX_VALUE=w;var x=u(-1,-1,!0);n.MAX_UNSIGNED_VALUE=x;var T=u(0,-2147483648,!1);n.MIN_VALUE=T;var S=n.prototype;S.toInt=function(){return this.unsigned?this.low>>>0:this.low},S.toNumber=function(){return this.unsigned?(this.high>>>0)*p+(this.low>>>0):this.high*p+(this.low>>>0)},S.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(T)){var e=s(t),n=this.div(e),r=n.mul(e).sub(this);return n.toString(t)+r.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var o=s(c(t,6),this.unsigned),i=this,a="";;){var u=i.div(o),l=(i.sub(u.mul(o)).toInt()>>>0).toString(t);if((i=u).isZero())return l+a;for(;l.length<6;)l="0"+l;a=""+l+a}},S.getHighBits=function(){return this.high},S.getHighBitsUnsigned=function(){return this.high>>>0},S.getLowBits=function(){return this.low},S.getLowBitsUnsigned=function(){return this.low>>>0},S.getNumBitsAbs=function(){if(this.isNegative())return this.eq(T)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&0==(t&1<<e);e--);return 0!=this.high?e+33:e+1},S.isZero=function(){return 0===this.high&&0===this.low},S.eqz=S.isZero,S.isNegative=function(){return!this.unsigned&&this.high<0},S.isPositive=function(){return this.unsigned||this.high>=0},S.isOdd=function(){return 1==(1&this.low)},S.isEven=function(){return 0==(1&this.low)},S.equals=function(t){return r(t)||(t=f(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&this.high===t.high&&this.low===t.low},S.eq=S.equals,S.notEquals=function(t){return!this.eq(t)},S.neq=S.notEquals,S.ne=S.notEquals,S.lessThan=function(t){return this.comp(t)<0},S.lt=S.lessThan,S.lessThanOrEqual=function(t){return this.comp(t)<=0},S.lte=S.lessThanOrEqual,S.le=S.lessThanOrEqual,S.greaterThan=function(t){return this.comp(t)>0},S.gt=S.greaterThan,S.greaterThanOrEqual=function(t){return this.comp(t)>=0},S.gte=S.greaterThanOrEqual,S.ge=S.greaterThanOrEqual,S.compare=function(t){if(r(t)||(t=f(t)),this.eq(t))return 0;var e=this.isNegative(),n=t.isNegative();return e&&!n?-1:!e&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},S.comp=S.compare,S.negate=function(){return!this.unsigned&&this.eq(T)?T:this.not().add(m)},S.neg=S.negate,S.add=function(t){r(t)||(t=f(t));var e=this.high>>>16,n=65535&this.high,o=this.low>>>16,i=65535&this.low,a=t.high>>>16,s=65535&t.high,c=t.low>>>16,l=0,p=0,h=0,d=0;return h+=(d+=i+(65535&t.low))>>>16,p+=(h+=o+c)>>>16,l+=(p+=n+s)>>>16,l+=e+a,u((h&=65535)<<16|(d&=65535),(l&=65535)<<16|(p&=65535),this.unsigned)},S.subtract=function(t){return r(t)||(t=f(t)),this.add(t.neg())},S.sub=S.subtract,S.multiply=function(t){if(this.isZero())return b;if(r(t)||(t=f(t)),e)return u(e.mul(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned);if(t.isZero())return b;if(this.eq(T))return t.isOdd()?T:b;if(t.eq(T))return this.isOdd()?T:b;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(g)&&t.lt(g))return s(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,o=65535&this.high,i=this.low>>>16,a=65535&this.low,c=t.high>>>16,l=65535&t.high,p=t.low>>>16,h=65535&t.low,d=0,y=0,m=0,v=0;return m+=(v+=a*h)>>>16,y+=(m+=i*h)>>>16,m&=65535,y+=(m+=a*p)>>>16,d+=(y+=o*h)>>>16,y&=65535,d+=(y+=i*p)>>>16,y&=65535,d+=(y+=a*l)>>>16,d+=n*h+o*p+i*l+a*c,u((m&=65535)<<16|(v&=65535),(d&=65535)<<16|(y&=65535),this.unsigned)},S.mul=S.multiply,S.divide=function(t){if(r(t)||(t=f(t)),t.isZero())throw Error("division by zero");var n,o,i;if(e)return this.unsigned||-2147483648!==this.high||-1!==t.low||-1!==t.high?u((this.unsigned?e.div_u:e.div_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?y:b;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return y;if(t.gt(this.shru(1)))return v;i=y}else{if(this.eq(T))return t.eq(m)||t.eq(_)?T:t.eq(T)?m:(n=this.shr(1).div(t).shl(1)).eq(b)?t.isNegative()?m:_:(o=this.sub(t.mul(n)),i=n.add(o.div(t)));if(t.eq(T))return this.unsigned?y:b;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();i=b}for(o=this;o.gte(t);){n=Math.max(1,Math.floor(o.toNumber()/t.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),l=a<=48?1:c(2,a-48),p=s(n),h=p.mul(t);h.isNegative()||h.gt(o);)h=(p=s(n-=l,this.unsigned)).mul(t);p.isZero()&&(p=m),i=i.add(p),o=o.sub(h)}return i},S.div=S.divide,S.modulo=function(t){return r(t)||(t=f(t)),e?u((this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},S.mod=S.modulo,S.rem=S.modulo,S.not=function(){return u(~this.low,~this.high,this.unsigned)},S.and=function(t){return r(t)||(t=f(t)),u(this.low&t.low,this.high&t.high,this.unsigned)},S.or=function(t){return r(t)||(t=f(t)),u(this.low|t.low,this.high|t.high,this.unsigned)},S.xor=function(t){return r(t)||(t=f(t)),u(this.low^t.low,this.high^t.high,this.unsigned)},S.shiftLeft=function(t){return r(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?u(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):u(0,this.low<<t-32,this.unsigned)},S.shl=S.shiftLeft,S.shiftRight=function(t){return r(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?u(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):u(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},S.shr=S.shiftRight,S.shiftRightUnsigned=function(t){if(r(t)&&(t=t.toInt()),0==(t&=63))return this;var e=this.high;return t<32?u(this.low>>>t|e<<32-t,e>>>t,this.unsigned):u(32===t?e:e>>>t-32,0,this.unsigned)},S.shru=S.shiftRightUnsigned,S.shr_u=S.shiftRightUnsigned,S.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},S.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},S.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},S.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},S.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,e>>>24,e>>>16&255,e>>>8&255,255&e]},n.fromBytes=function(t,e,r){return r?n.fromBytesLE(t,e):n.fromBytesBE(t,e)},n.fromBytesLE=function(t,e){return new n(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,e)},n.fromBytesBE=function(t,e){return new n(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],e)}},1446:function(t,e,n){"use strict";var r,o,i,a=n(2100),s=a.Reader,u=a.Writer,c=a.util,l=a.roots.default||(a.roots.default={});l.onnx=((i={}).Version=(r={},(o=Object.create(r))[r[0]="_START_VERSION"]=0,o[r[1]="IR_VERSION_2017_10_10"]=1,o[r[2]="IR_VERSION_2017_10_30"]=2,o[r[3]="IR_VERSION_2017_11_3"]=3,o[r[4]="IR_VERSION_2019_1_22"]=4,o[r[5]="IR_VERSION"]=5,o),i.AttributeProto=function(){function t(t){if(this.floats=[],this.ints=[],this.strings=[],this.tensors=[],this.graphs=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return t.prototype.name="",t.prototype.refAttrName="",t.prototype.docString="",t.prototype.type=0,t.prototype.f=0,t.prototype.i=c.Long?c.Long.fromBits(0,0,!1):0,t.prototype.s=c.newBuffer([]),t.prototype.t=null,t.prototype.g=null,t.prototype.floats=c.emptyArray,t.prototype.ints=c.emptyArray,t.prototype.strings=c.emptyArray,t.prototype.tensors=c.emptyArray,t.prototype.graphs=c.emptyArray,t.create=function(e){return new t(e)},t.encode=function(t,e){if(e||(e=u.create()),null!=t.name&&t.hasOwnProperty("name")&&e.uint32(10).string(t.name),null!=t.f&&t.hasOwnProperty("f")&&e.uint32(21).float(t.f),null!=t.i&&t.hasOwnProperty("i")&&e.uint32(24).int64(t.i),null!=t.s&&t.hasOwnProperty("s")&&e.uint32(34).bytes(t.s),null!=t.t&&t.hasOwnProperty("t")&&l.onnx.TensorProto.encode(t.t,e.uint32(42).fork()).ldelim(),null!=t.g&&t.hasOwnProperty("g")&&l.onnx.GraphProto.encode(t.g,e.uint32(50).fork()).ldelim(),null!=t.floats&&t.floats.length){e.uint32(58).fork();for(var n=0;n<t.floats.length;++n)e.float(t.floats[n]);e.ldelim()}if(null!=t.ints&&t.ints.length){for(e.uint32(66).fork(),n=0;n<t.ints.length;++n)e.int64(t.ints[n]);e.ldelim()}if(null!=t.strings&&t.strings.length)for(n=0;n<t.strings.length;++n)e.uint32(74).bytes(t.strings[n]);if(null!=t.tensors&&t.tensors.length)for(n=0;n<t.tensors.length;++n)l.onnx.TensorProto.encode(t.tensors[n],e.uint32(82).fork()).ldelim();if(null!=t.graphs&&t.graphs.length)for(n=0;n<t.graphs.length;++n)l.onnx.GraphProto.encode(t.graphs[n],e.uint32(90).fork()).ldelim();return null!=t.docString&&t.hasOwnProperty("docString")&&e.uint32(106).string(t.docString),null!=t.type&&t.hasOwnProperty("type")&&e.uint32(160).int32(t.type),null!=t.refAttrName&&t.hasOwnProperty("refAttrName")&&e.uint32(170).string(t.refAttrName),e},t.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},t.decode=function(t,e){t instanceof s||(t=s.create(t));for(var n=void 0===e?t.len:t.pos+e,r=new l.onnx.AttributeProto;t.pos<n;){var o=t.uint32();switch(o>>>3){case 1:r.name=t.string();break;case 21:r.refAttrName=t.string();break;case 13:r.docString=t.string();break;case 20:r.type=t.int32();break;case 2:r.f=t.float();break;case 3:r.i=t.int64();break;case 4:r.s=t.bytes();break;case 5:r.t=l.onnx.TensorProto.decode(t,t.uint32());break;case 6:r.g=l.onnx.GraphProto.decode(t,t.uint32());break;case 7:if(r.floats&&r.floats.length||(r.floats=[]),2==(7&o))for(var i=t.uint32()+t.pos;t.pos<i;)r.floats.push(t.float());else r.floats.push(t.float());break;case 8:if(r.ints&&r.ints.length||(r.ints=[]),2==(7&o))for(i=t.uint32()+t.pos;t.pos<i;)r.ints.push(t.int64());else r.ints.push(t.int64());break;case 9:r.strings&&r.strings.length||(r.strings=[]),r.strings.push(t.bytes());break;case 10:r.tensors&&r.tensors.length||(r.tensors=[]),r.tensors.push(l.onnx.TensorProto.decode(t,t.uint32()));break;case 11:r.graphs&&r.graphs.length||(r.graphs=[]),r.graphs.push(l.onnx.GraphProto.decode(t,t.uint32()));break;default:t.skipType(7&o)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.name&&t.hasOwnProperty("name")&&!c.isString(t.name))return"name: string expected";if(null!=t.refAttrName&&t.hasOwnProperty("refAttrName")&&!c.isString(t.refAttrName))return"refAttrName: string expected";if(null!=t.docString&&t.hasOwnProperty("docString")&&!c.isString(t.docString))return"docString: string expected";if(null!=t.type&&t.hasOwnProperty("type"))switch(t.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:}if(null!=t.f&&t.hasOwnProperty("f")&&"number"!=typeof t.f)return"f: number expected";if(null!=t.i&&t.hasOwnProperty("i")&&!(c.isInteger(t.i)||t.i&&c.isInteger(t.i.low)&&c.isInteger(t.i.high)))return"i: integer|Long expected";if(null!=t.s&&t.hasOwnProperty("s")&&!(t.s&&"number"==typeof t.s.length||c.isString(t.s)))return"s: buffer expected";if(null!=t.t&&t.hasOwnProperty("t")&&(n=l.onnx.TensorProto.verify(t.t)))return"t."+n;if(null!=t.g&&t.hasOwnProperty("g")&&(n=l.onnx.GraphProto.verify(t.g)))return"g."+n;if(null!=t.floats&&t.hasOwnProperty("floats")){if(!Array.isArray(t.floats))return"floats: array expected";for(var e=0;e<t.floats.length;++e)if("number"!=typeof t.floats[e])return"floats: number[] expected"}if(null!=t.ints&&t.hasOwnProperty("ints")){if(!Array.isArray(t.ints))return"ints: array expected";for(e=0;e<t.ints.length;++e)if(!(c.isInteger(t.ints[e])||t.ints[e]&&c.isInteger(t.ints[e].low)&&c.isInteger(t.ints[e].high)))return"ints: integer|Long[] expected"}if(null!=t.strings&&t.hasOwnProperty("strings")){if(!Array.isArray(t.strings))return"strings: array expected";for(e=0;e<t.strings.length;++e)if(!(t.strings[e]&&"number"==typeof t.strings[e].length||c.isString(t.strings[e])))return"strings: buffer[] expected"}if(null!=t.tensors&&t.hasOwnProperty("tensors")){if(!Array.isArray(t.tensors))return"tensors: array expected";for(e=0;e<t.tensors.length;++e)if(n=l.onnx.TensorProto.verify(t.tensors[e]))return"tensors."+n}if(null!=t.graphs&&t.hasOwnProperty("graphs")){if(!Array.isArray(t.graphs))return"graphs: array expected";for(e=0;e<t.graphs.length;++e){var n;if(n=l.onnx.GraphProto.verify(t.graphs[e]))return"graphs."+n}}return null},t.fromObject=function(t){if(t instanceof l.onnx.AttributeProto)return t;var e=new l.onnx.AttributeProto;switch(null!=t.name&&(e.name=String(t.name)),null!=t.refAttrName&&(e.refAttrName=String(t.refAttrName)),null!=t.docString&&(e.docString=String(t.docString)),t.type){case"UNDEFINED":case 0:e.type=0;break;case"FLOAT":case 1:e.type=1;break;case"INT":case 2:e.type=2;break;case"STRING":case 3:e.type=3;break;case"TENSOR":case 4:e.type=4;break;case"GRAPH":case 5:e.type=5;break;case"FLOATS":case 6:e.type=6;break;case"INTS":case 7:e.type=7;break;case"STRINGS":case 8:e.type=8;break;case"TENSORS":case 9:e.type=9;break;case"GRAPHS":case 10:e.type=10}if(null!=t.f&&(e.f=Number(t.f)),null!=t.i&&(c.Long?(e.i=c.Long.fromValue(t.i)).unsigned=!1:"string"==typeof t.i?e.i=parseInt(t.i,10):"number"==typeof t.i?e.i=t.i:"object"==typeof t.i&&(e.i=new c.LongBits(t.i.low>>>0,t.i.high>>>0).toNumber())),null!=t.s&&("string"==typeof t.s?c.base64.decode(t.s,e.s=c.newBuffer(c.base64.length(t.s)),0):t.s.length&&(e.s=t.s)),null!=t.t){if("object"!=typeof t.t)throw TypeError(".onnx.AttributeProto.t: object expected");e.t=l.onnx.TensorProto.fromObject(t.t)}if(null!=t.g){if("object"!=typeof t.g)throw TypeError(".onnx.AttributeProto.g: object expected");e.g=l.onnx.GraphProto.fromObject(t.g)}if(t.floats){if(!Array.isArray(t.floats))throw TypeError(".onnx.AttributeProto.floats: array expected");e.floats=[];for(var n=0;n<t.floats.length;++n)e.floats[n]=Number(t.floats[n])}if(t.ints){if(!Array.isArray(t.ints))throw TypeError(".onnx.AttributeProto.ints: array expected");for(e.ints=[],n=0;n<t.ints.length;++n)c.Long?(e.ints[n]=c.Long.fromValue(t.ints[n])).unsigned=!1:"string"==typeof t.ints[n]?e.ints[n]=parseInt(t.ints[n],10):"number"==typeof t.ints[n]?e.ints[n]=t.ints[n]:"object"==typeof t.ints[n]&&(e.ints[n]=new c.LongBits(t.ints[n].low>>>0,t.ints[n].high>>>0).toNumber())}if(t.strings){if(!Array.isArray(t.strings))throw TypeError(".onnx.AttributeProto.strings: array expected");for(e.strings=[],n=0;n<t.strings.length;++n)"string"==typeof t.strings[n]?c.base64.decode(t.strings[n],e.strings[n]=c.newBuffer(c.base64.length(t.strings[n])),0):t.strings[n].length&&(e.strings[n]=t.strings[n])}if(t.tensors){if(!Array.isArray(t.tensors))throw TypeError(".onnx.AttributeProto.tensors: array expected");for(e.tensors=[],n=0;n<t.tensors.length;++n){if("object"!=typeof t.tensors[n])throw TypeError(".onnx.AttributeProto.tensors: object expected");e.tensors[n]=l.onnx.TensorProto.fromObject(t.tensors[n])}}if(t.graphs){if(!Array.isArray(t.graphs))throw TypeError(".onnx.AttributeProto.graphs: array expected");for(e.graphs=[],n=0;n<t.graphs.length;++n){if("object"!=typeof t.graphs[n])throw TypeError(".onnx.AttributeProto.graphs: object expected");e.graphs[n]=l.onnx.GraphProto.fromObject(t.graphs[n])}}return e},t.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.floats=[],n.ints=[],n.strings=[],n.tensors=[],n.graphs=[]),e.defaults){if(n.name="",n.f=0,c.Long){var r=new c.Long(0,0,!1);n.i=e.longs===String?r.toString():e.longs===Number?r.toNumber():r}else n.i=e.longs===String?"0":0;e.bytes===String?n.s="":(n.s=[],e.bytes!==Array&&(n.s=c.newBuffer(n.s))),n.t=null,n.g=null,n.docString="",n.type=e.enums===String?"UNDEFINED":0,n.refAttrName=""}if(null!=t.name&&t.hasOwnProperty("name")&&(n.name=t.name),null!=t.f&&t.hasOwnProperty("f")&&(n.f=e.json&&!isFinite(t.f)?String(t.f):t.f),null!=t.i&&t.hasOwnProperty("i")&&("number"==typeof t.i?n.i=e.longs===String?String(t.i):t.i:n.i=e.longs===String?c.Long.prototype.toString.call(t.i):e.longs===Number?new c.LongBits(t.i.low>>>0,t.i.high>>>0).toNumber():t.i),null!=t.s&&t.hasOwnProperty("s")&&(n.s=e.bytes===String?c.base64.encode(t.s,0,t.s.length):e.bytes===Array?Array.prototype.slice.call(t.s):t.s),null!=t.t&&t.hasOwnProperty("t")&&(n.t=l.onnx.TensorProto.toObject(t.t,e)),null!=t.g&&t.hasOwnProperty("g")&&(n.g=l.onnx.GraphProto.toObject(t.g,e)),t.floats&&t.floats.length){n.floats=[];for(var o=0;o<t.floats.length;++o)n.floats[o]=e.json&&!isFinite(t.floats[o])?String(t.floats[o]):t.floats[o]}if(t.ints&&t.ints.length)for(n.ints=[],o=0;o<t.ints.length;++o)"number"==typeof t.ints[o]?n.ints[o]=e.longs===String?String(t.ints[o]):t.ints[o]:n.ints[o]=e.longs===String?c.Long.prototype.toString.call(t.ints[o]):e.longs===Number?new c.LongBits(t.ints[o].low>>>0,t.ints[o].high>>>0).toNumber():t.ints[o];if(t.strings&&t.strings.length)for(n.strings=[],o=0;o<t.strings.length;++o)n.strings[o]=e.bytes===String?c.base64.encode(t.strings[o],0,t.strings[o].length):e.bytes===Array?Array.prototype.slice.call(t.strings[o]):t.strings[o];if(t.tensors&&t.tensors.length)for(n.tensors=[],o=0;o<t.tensors.length;++o)n.tensors[o]=l.onnx.TensorProto.toObject(t.tensors[o],e);if(t.graphs&&t.graphs.length)for(n.graphs=[],o=0;o<t.graphs.length;++o)n.graphs[o]=l.onnx.GraphProto.toObject(t.graphs[o],e);return null!=t.docString&&t.hasOwnProperty("docString")&&(n.docString=t.docString),null!=t.type&&t.hasOwnProperty("type")&&(n.type=e.enums===String?l.onnx.AttributeProto.AttributeType[t.type]:t.type),null!=t.refAttrName&&t.hasOwnProperty("refAttrName")&&(n.refAttrName=t.refAttrName),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t.AttributeType=function(){var t={},e=Object.create(t);return e[t[0]="UNDEFINED"]=0,e[t[1]="FLOAT"]=1,e[t[2]="INT"]=2,e[t[3]="STRING"]=3,e[t[4]="TENSOR"]=4,e[t[5]="GRAPH"]=5,e[t[6]="FLOATS"]=6,e[t[7]="INTS"]=7,e[t[8]="STRINGS"]=8,e[t[9]="TENSORS"]=9,e[t[10]="GRAPHS"]=10,e}(),t}(),i.ValueInfoProto=function(){function t(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return t.prototype.name="",t.prototype.type=null,t.prototype.docString="",t.create=function(e){return new t(e)},t.encode=function(t,e){return e||(e=u.create()),null!=t.name&&t.hasOwnProperty("name")&&e.uint32(10).string(t.name),null!=t.type&&t.hasOwnProperty("type")&&l.onnx.TypeProto.encode(t.type,e.uint32(18).fork()).ldelim(),null!=t.docString&&t.hasOwnProperty("docString")&&e.uint32(26).string(t.docString),e},t.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},t.decode=function(t,e){t instanceof s||(t=s.create(t));for(var n=void 0===e?t.len:t.pos+e,r=new l.onnx.ValueInfoProto;t.pos<n;){var o=t.uint32();switch(o>>>3){case 1:r.name=t.string();break;case 2:r.type=l.onnx.TypeProto.decode(t,t.uint32());break;case 3:r.docString=t.string();break;default:t.skipType(7&o)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.name&&t.hasOwnProperty("name")&&!c.isString(t.name))return"name: string expected";if(null!=t.type&&t.hasOwnProperty("type")){var e=l.onnx.TypeProto.verify(t.type);if(e)return"type."+e}return null!=t.docString&&t.hasOwnProperty("docString")&&!c.isString(t.docString)?"docString: string expected":null},t.fromObject=function(t){if(t instanceof l.onnx.ValueInfoProto)return t;var e=new l.onnx.ValueInfoProto;if(null!=t.name&&(e.name=String(t.name)),null!=t.type){if("object"!=typeof t.type)throw TypeError(".onnx.ValueInfoProto.type: object expected");e.type=l.onnx.TypeProto.fromObject(t.type)}return null!=t.docString&&(e.docString=String(t.docString)),e},t.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.name="",n.type=null,n.docString=""),null!=t.name&&t.hasOwnProperty("name")&&(n.name=t.name),null!=t.type&&t.hasOwnProperty("type")&&(n.type=l.onnx.TypeProto.toObject(t.type,e)),null!=t.docString&&t.hasOwnProperty("docString")&&(n.docString=t.docString),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t}(),i.NodeProto=function(){function t(t){if(this.input=[],this.output=[],this.attribute=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return t.prototype.input=c.emptyArray,t.prototype.output=c.emptyArray,t.prototype.name="",t.prototype.opType="",t.prototype.domain="",t.prototype.attribute=c.emptyArray,t.prototype.docString="",t.create=function(e){return new t(e)},t.encode=function(t,e){if(e||(e=u.create()),null!=t.input&&t.input.length)for(var n=0;n<t.input.length;++n)e.uint32(10).string(t.input[n]);if(null!=t.output&&t.output.length)for(n=0;n<t.output.length;++n)e.uint32(18).string(t.output[n]);if(null!=t.name&&t.hasOwnProperty("name")&&e.uint32(26).string(t.name),null!=t.opType&&t.hasOwnProperty("opType")&&e.uint32(34).string(t.opType),null!=t.attribute&&t.attribute.length)for(n=0;n<t.attribute.length;++n)l.onnx.AttributeProto.encode(t.attribute[n],e.uint32(42).fork()).ldelim();return null!=t.docString&&t.hasOwnProperty("docString")&&e.uint32(50).string(t.docString),null!=t.domain&&t.hasOwnProperty("domain")&&e.uint32(58).string(t.domain),e},t.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},t.decode=function(t,e){t instanceof s||(t=s.create(t));for(var n=void 0===e?t.len:t.pos+e,r=new l.onnx.NodeProto;t.pos<n;){var o=t.uint32();switch(o>>>3){case 1:r.input&&r.input.length||(r.input=[]),r.input.push(t.string());break;case 2:r.output&&r.output.length||(r.output=[]),r.output.push(t.string());break;case 3:r.name=t.string();break;case 4:r.opType=t.string();break;case 7:r.domain=t.string();break;case 5:r.attribute&&r.attribute.length||(r.attribute=[]),r.attribute.push(l.onnx.AttributeProto.decode(t,t.uint32()));break;case 6:r.docString=t.string();break;default:t.skipType(7&o)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.input&&t.hasOwnProperty("input")){if(!Array.isArray(t.input))return"input: array expected";for(var e=0;e<t.input.length;++e)if(!c.isString(t.input[e]))return"input: string[] expected"}if(null!=t.output&&t.hasOwnProperty("output")){if(!Array.isArray(t.output))return"output: array expected";for(e=0;e<t.output.length;++e)if(!c.isString(t.output[e]))return"output: string[] expected"}if(null!=t.name&&t.hasOwnProperty("name")&&!c.isString(t.name))return"name: string expected";if(null!=t.opType&&t.hasOwnProperty("opType")&&!c.isString(t.opType))return"opType: string expected";if(null!=t.domain&&t.hasOwnProperty("domain")&&!c.isString(t.domain))return"domain: string expected";if(null!=t.attribute&&t.hasOwnProperty("attribute")){if(!Array.isArray(t.attribute))return"attribute: array expected";for(e=0;e<t.attribute.length;++e){var n=l.onnx.AttributeProto.verify(t.attribute[e]);if(n)return"attribute."+n}}return null!=t.docString&&t.hasOwnProperty("docString")&&!c.isString(t.docString)?"docString: string expected":null},t.fromObject=function(t){if(t instanceof l.onnx.NodeProto)return t;var e=new l.onnx.NodeProto;if(t.input){if(!Array.isArray(t.input))throw TypeError(".onnx.NodeProto.input: array expected");e.input=[];for(var n=0;n<t.input.length;++n)e.input[n]=String(t.input[n])}if(t.output){if(!Array.isArray(t.output))throw TypeError(".onnx.NodeProto.output: array expected");for(e.output=[],n=0;n<t.output.length;++n)e.output[n]=String(t.output[n])}if(null!=t.name&&(e.name=String(t.name)),null!=t.opType&&(e.opType=String(t.opType)),null!=t.domain&&(e.domain=String(t.domain)),t.attribute){if(!Array.isArray(t.attribute))throw TypeError(".onnx.NodeProto.attribute: array expected");for(e.attribute=[],n=0;n<t.attribute.length;++n){if("object"!=typeof t.attribute[n])throw TypeError(".onnx.NodeProto.attribute: object expected");e.attribute[n]=l.onnx.AttributeProto.fromObject(t.attribute[n])}}return null!=t.docString&&(e.docString=String(t.docString)),e},t.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.input=[],n.output=[],n.attribute=[]),e.defaults&&(n.name="",n.opType="",n.docString="",n.domain=""),t.input&&t.input.length){n.input=[];for(var r=0;r<t.input.length;++r)n.input[r]=t.input[r]}if(t.output&&t.output.length)for(n.output=[],r=0;r<t.output.length;++r)n.output[r]=t.output[r];if(null!=t.name&&t.hasOwnProperty("name")&&(n.name=t.name),null!=t.opType&&t.hasOwnProperty("opType")&&(n.opType=t.opType),t.attribute&&t.attribute.length)for(n.attribute=[],r=0;r<t.attribute.length;++r)n.attribute[r]=l.onnx.AttributeProto.toObject(t.attribute[r],e);return null!=t.docString&&t.hasOwnProperty("docString")&&(n.docString=t.docString),null!=t.domain&&t.hasOwnProperty("domain")&&(n.domain=t.domain),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t}(),i.ModelProto=function(){function t(t){if(this.opsetImport=[],this.metadataProps=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return t.prototype.irVersion=c.Long?c.Long.fromBits(0,0,!1):0,t.prototype.opsetImport=c.emptyArray,t.prototype.producerName="",t.prototype.producerVersion="",t.prototype.domain="",t.prototype.modelVersion=c.Long?c.Long.fromBits(0,0,!1):0,t.prototype.docString="",t.prototype.graph=null,t.prototype.metadataProps=c.emptyArray,t.create=function(e){return new t(e)},t.encode=function(t,e){if(e||(e=u.create()),null!=t.irVersion&&t.hasOwnProperty("irVersion")&&e.uint32(8).int64(t.irVersion),null!=t.producerName&&t.hasOwnProperty("producerName")&&e.uint32(18).string(t.producerName),null!=t.producerVersion&&t.hasOwnProperty("producerVersion")&&e.uint32(26).string(t.producerVersion),null!=t.domain&&t.hasOwnProperty("domain")&&e.uint32(34).string(t.domain),null!=t.modelVersion&&t.hasOwnProperty("modelVersion")&&e.uint32(40).int64(t.modelVersion),null!=t.docString&&t.hasOwnProperty("docString")&&e.uint32(50).string(t.docString),null!=t.graph&&t.hasOwnProperty("graph")&&l.onnx.GraphProto.encode(t.graph,e.uint32(58).fork()).ldelim(),null!=t.opsetImport&&t.opsetImport.length)for(var n=0;n<t.opsetImport.length;++n)l.onnx.OperatorSetIdProto.encode(t.opsetImport[n],e.uint32(66).fork()).ldelim();if(null!=t.metadataProps&&t.metadataProps.length)for(n=0;n<t.metadataProps.length;++n)l.onnx.StringStringEntryProto.encode(t.metadataProps[n],e.uint32(114).fork()).ldelim();return e},t.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},t.decode=function(t,e){t instanceof s||(t=s.create(t));for(var n=void 0===e?t.len:t.pos+e,r=new l.onnx.ModelProto;t.pos<n;){var o=t.uint32();switch(o>>>3){case 1:r.irVersion=t.int64();break;case 8:r.opsetImport&&r.opsetImport.length||(r.opsetImport=[]),r.opsetImport.push(l.onnx.OperatorSetIdProto.decode(t,t.uint32()));break;case 2:r.producerName=t.string();break;case 3:r.producerVersion=t.string();break;case 4:r.domain=t.string();break;case 5:r.modelVersion=t.int64();break;case 6:r.docString=t.string();break;case 7:r.graph=l.onnx.GraphProto.decode(t,t.uint32());break;case 14:r.metadataProps&&r.metadataProps.length||(r.metadataProps=[]),r.metadataProps.push(l.onnx.StringStringEntryProto.decode(t,t.uint32()));break;default:t.skipType(7&o)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.irVersion&&t.hasOwnProperty("irVersion")&&!(c.isInteger(t.irVersion)||t.irVersion&&c.isInteger(t.irVersion.low)&&c.isInteger(t.irVersion.high)))return"irVersion: integer|Long expected";if(null!=t.opsetImport&&t.hasOwnProperty("opsetImport")){if(!Array.isArray(t.opsetImport))return"opsetImport: array expected";for(var e=0;e<t.opsetImport.length;++e)if(n=l.onnx.OperatorSetIdProto.verify(t.opsetImport[e]))return"opsetImport."+n}if(null!=t.producerName&&t.hasOwnProperty("producerName")&&!c.isString(t.producerName))return"producerName: string expected";if(null!=t.producerVersion&&t.hasOwnProperty("producerVersion")&&!c.isString(t.producerVersion))return"producerVersion: string expected";if(null!=t.domain&&t.hasOwnProperty("domain")&&!c.isString(t.domain))return"domain: string expected";if(null!=t.modelVersion&&t.hasOwnProperty("modelVersion")&&!(c.isInteger(t.modelVersion)||t.modelVersion&&c.isInteger(t.modelVersion.low)&&c.isInteger(t.modelVersion.high)))return"modelVersion: integer|Long expected";if(null!=t.docString&&t.hasOwnProperty("docString")&&!c.isString(t.docString))return"docString: string expected";if(null!=t.graph&&t.hasOwnProperty("graph")&&(n=l.onnx.GraphProto.verify(t.graph)))return"graph."+n;if(null!=t.metadataProps&&t.hasOwnProperty("metadataProps")){if(!Array.isArray(t.metadataProps))return"metadataProps: array expected";for(e=0;e<t.metadataProps.length;++e){var n;if(n=l.onnx.StringStringEntryProto.verify(t.metadataProps[e]))return"metadataProps."+n}}return null},t.fromObject=function(t){if(t instanceof l.onnx.ModelProto)return t;var e=new l.onnx.ModelProto;if(null!=t.irVersion&&(c.Long?(e.irVersion=c.Long.fromValue(t.irVersion)).unsigned=!1:"string"==typeof t.irVersion?e.irVersion=parseInt(t.irVersion,10):"number"==typeof t.irVersion?e.irVersion=t.irVersion:"object"==typeof t.irVersion&&(e.irVersion=new c.LongBits(t.irVersion.low>>>0,t.irVersion.high>>>0).toNumber())),t.opsetImport){if(!Array.isArray(t.opsetImport))throw TypeError(".onnx.ModelProto.opsetImport: array expected");e.opsetImport=[];for(var n=0;n<t.opsetImport.length;++n){if("object"!=typeof t.opsetImport[n])throw TypeError(".onnx.ModelProto.opsetImport: object expected");e.opsetImport[n]=l.onnx.OperatorSetIdProto.fromObject(t.opsetImport[n])}}if(null!=t.producerName&&(e.producerName=String(t.producerName)),null!=t.producerVersion&&(e.producerVersion=String(t.producerVersion)),null!=t.domain&&(e.domain=String(t.domain)),null!=t.modelVersion&&(c.Long?(e.modelVersion=c.Long.fromValue(t.modelVersion)).unsigned=!1:"string"==typeof t.modelVersion?e.modelVersion=parseInt(t.modelVersion,10):"number"==typeof t.modelVersion?e.modelVersion=t.modelVersion:"object"==typeof t.modelVersion&&(e.modelVersion=new c.LongBits(t.modelVersion.low>>>0,t.modelVersion.high>>>0).toNumber())),null!=t.docString&&(e.docString=String(t.docString)),null!=t.graph){if("object"!=typeof t.graph)throw TypeError(".onnx.ModelProto.graph: object expected");e.graph=l.onnx.GraphProto.fromObject(t.graph)}if(t.metadataProps){if(!Array.isArray(t.metadataProps))throw TypeError(".onnx.ModelProto.metadataProps: array expected");for(e.metadataProps=[],n=0;n<t.metadataProps.length;++n){if("object"!=typeof t.metadataProps[n])throw TypeError(".onnx.ModelProto.metadataProps: object expected");e.metadataProps[n]=l.onnx.StringStringEntryProto.fromObject(t.metadataProps[n])}}return e},t.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.opsetImport=[],n.metadataProps=[]),e.defaults){if(c.Long){var r=new c.Long(0,0,!1);n.irVersion=e.longs===String?r.toString():e.longs===Number?r.toNumber():r}else n.irVersion=e.longs===String?"0":0;n.producerName="",n.producerVersion="",n.domain="",c.Long?(r=new c.Long(0,0,!1),n.modelVersion=e.longs===String?r.toString():e.longs===Number?r.toNumber():r):n.modelVersion=e.longs===String?"0":0,n.docString="",n.graph=null}if(null!=t.irVersion&&t.hasOwnProperty("irVersion")&&("number"==typeof t.irVersion?n.irVersion=e.longs===String?String(t.irVersion):t.irVersion:n.irVersion=e.longs===String?c.Long.prototype.toString.call(t.irVersion):e.longs===Number?new c.LongBits(t.irVersion.low>>>0,t.irVersion.high>>>0).toNumber():t.irVersion),null!=t.producerName&&t.hasOwnProperty("producerName")&&(n.producerName=t.producerName),null!=t.producerVersion&&t.hasOwnProperty("producerVersion")&&(n.producerVersion=t.producerVersion),null!=t.domain&&t.hasOwnProperty("domain")&&(n.domain=t.domain),null!=t.modelVersion&&t.hasOwnProperty("modelVersion")&&("number"==typeof t.modelVersion?n.modelVersion=e.longs===String?String(t.modelVersion):t.modelVersion:n.modelVersion=e.longs===String?c.Long.prototype.toString.call(t.modelVersion):e.longs===Number?new c.LongBits(t.modelVersion.low>>>0,t.modelVersion.high>>>0).toNumber():t.modelVersion),null!=t.docString&&t.hasOwnProperty("docString")&&(n.docString=t.docString),null!=t.graph&&t.hasOwnProperty("graph")&&(n.graph=l.onnx.GraphProto.toObject(t.graph,e)),t.opsetImport&&t.opsetImport.length){n.opsetImport=[];for(var o=0;o<t.opsetImport.length;++o)n.opsetImport[o]=l.onnx.OperatorSetIdProto.toObject(t.opsetImport[o],e)}if(t.metadataProps&&t.metadataProps.length)for(n.metadataProps=[],o=0;o<t.metadataProps.length;++o)n.metadataProps[o]=l.onnx.StringStringEntryProto.toObject(t.metadataProps[o],e);return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t}(),i.StringStringEntryProto=function(){function t(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return t.prototype.key="",t.prototype.value="",t.create=function(e){return new t(e)},t.encode=function(t,e){return e||(e=u.create()),null!=t.key&&t.hasOwnProperty("key")&&e.uint32(10).string(t.key),null!=t.value&&t.hasOwnProperty("value")&&e.uint32(18).string(t.value),e},t.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},t.decode=function(t,e){t instanceof s||(t=s.create(t));for(var n=void 0===e?t.len:t.pos+e,r=new l.onnx.StringStringEntryProto;t.pos<n;){var o=t.uint32();switch(o>>>3){case 1:r.key=t.string();break;case 2:r.value=t.string();break;default:t.skipType(7&o)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.key&&t.hasOwnProperty("key")&&!c.isString(t.key)?"key: string expected":null!=t.value&&t.hasOwnProperty("value")&&!c.isString(t.value)?"value: string expected":null},t.fromObject=function(t){if(t instanceof l.onnx.StringStringEntryProto)return t;var e=new l.onnx.StringStringEntryProto;return null!=t.key&&(e.key=String(t.key)),null!=t.value&&(e.value=String(t.value)),e},t.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.key="",n.value=""),null!=t.key&&t.hasOwnProperty("key")&&(n.key=t.key),null!=t.value&&t.hasOwnProperty("value")&&(n.value=t.value),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t}(),i.TensorAnnotation=function(){function t(t){if(this.quantParameterTensorNames=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return t.prototype.tensorName="",t.prototype.quantParameterTensorNames=c.emptyArray,t.create=function(e){return new t(e)},t.encode=function(t,e){if(e||(e=u.create()),null!=t.tensorName&&t.hasOwnProperty("tensorName")&&e.uint32(10).string(t.tensorName),null!=t.quantParameterTensorNames&&t.quantParameterTensorNames.length)for(var n=0;n<t.quantParameterTensorNames.length;++n)l.onnx.StringStringEntryProto.encode(t.quantParameterTensorNames[n],e.uint32(18).fork()).ldelim();return e},t.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},t.decode=function(t,e){t instanceof s||(t=s.create(t));for(var n=void 0===e?t.len:t.pos+e,r=new l.onnx.TensorAnnotation;t.pos<n;){var o=t.uint32();switch(o>>>3){case 1:r.tensorName=t.string();break;case 2:r.quantParameterTensorNames&&r.quantParameterTensorNames.length||(r.quantParameterTensorNames=[]),r.quantParameterTensorNames.push(l.onnx.StringStringEntryProto.decode(t,t.uint32()));break;default:t.skipType(7&o)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.tensorName&&t.hasOwnProperty("tensorName")&&!c.isString(t.tensorName))return"tensorName: string expected";if(null!=t.quantParameterTensorNames&&t.hasOwnProperty("quantParameterTensorNames")){if(!Array.isArray(t.quantParameterTensorNames))return"quantParameterTensorNames: array expected";for(var e=0;e<t.quantParameterTensorNames.length;++e){var n=l.onnx.StringStringEntryProto.verify(t.quantParameterTensorNames[e]);if(n)return"quantParameterTensorNames."+n}}return null},t.fromObject=function(t){if(t instanceof l.onnx.TensorAnnotation)return t;var e=new l.onnx.TensorAnnotation;if(null!=t.tensorName&&(e.tensorName=String(t.tensorName)),t.quantParameterTensorNames){if(!Array.isArray(t.quantParameterTensorNames))throw TypeError(".onnx.TensorAnnotation.quantParameterTensorNames: array expected");e.quantParameterTensorNames=[];for(var n=0;n<t.quantParameterTensorNames.length;++n){if("object"!=typeof t.quantParameterTensorNames[n])throw TypeError(".onnx.TensorAnnotation.quantParameterTensorNames: object expected");e.quantParameterTensorNames[n]=l.onnx.StringStringEntryProto.fromObject(t.quantParameterTensorNames[n])}}return e},t.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.quantParameterTensorNames=[]),e.defaults&&(n.tensorName=""),null!=t.tensorName&&t.hasOwnProperty("tensorName")&&(n.tensorName=t.tensorName),t.quantParameterTensorNames&&t.quantParameterTensorNames.length){n.quantParameterTensorNames=[];for(var r=0;r<t.quantParameterTensorNames.length;++r)n.quantParameterTensorNames[r]=l.onnx.StringStringEntryProto.toObject(t.quantParameterTensorNames[r],e)}return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t}(),i.GraphProto=function(){function t(t){if(this.node=[],this.initializer=[],this.input=[],this.output=[],this.valueInfo=[],this.quantizationAnnotation=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return t.prototype.node=c.emptyArray,t.prototype.name="",t.prototype.initializer=c.emptyArray,t.prototype.docString="",t.prototype.input=c.emptyArray,t.prototype.output=c.emptyArray,t.prototype.valueInfo=c.emptyArray,t.prototype.quantizationAnnotation=c.emptyArray,t.create=function(e){return new t(e)},t.encode=function(t,e){if(e||(e=u.create()),null!=t.node&&t.node.length)for(var n=0;n<t.node.length;++n)l.onnx.NodeProto.encode(t.node[n],e.uint32(10).fork()).ldelim();if(null!=t.name&&t.hasOwnProperty("name")&&e.uint32(18).string(t.name),null!=t.initializer&&t.initializer.length)for(n=0;n<t.initializer.length;++n)l.onnx.TensorProto.encode(t.initializer[n],e.uint32(42).fork()).ldelim();if(null!=t.docString&&t.hasOwnProperty("docString")&&e.uint32(82).string(t.docString),null!=t.input&&t.input.length)for(n=0;n<t.input.length;++n)l.onnx.ValueInfoProto.encode(t.input[n],e.uint32(90).fork()).ldelim();if(null!=t.output&&t.output.length)for(n=0;n<t.output.length;++n)l.onnx.ValueInfoProto.encode(t.output[n],e.uint32(98).fork()).ldelim();if(null!=t.valueInfo&&t.valueInfo.length)for(n=0;n<t.valueInfo.length;++n)l.onnx.ValueInfoProto.encode(t.valueInfo[n],e.uint32(106).fork()).ldelim();if(null!=t.quantizationAnnotation&&t.quantizationAnnotation.length)for(n=0;n<t.quantizationAnnotation.length;++n)l.onnx.TensorAnnotation.encode(t.quantizationAnnotation[n],e.uint32(114).fork()).ldelim();return e},t.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},t.decode=function(t,e){t instanceof s||(t=s.create(t));for(var n=void 0===e?t.len:t.pos+e,r=new l.onnx.GraphProto;t.pos<n;){var o=t.uint32();switch(o>>>3){case 1:r.node&&r.node.length||(r.node=[]),r.node.push(l.onnx.NodeProto.decode(t,t.uint32()));break;case 2:r.name=t.string();break;case 5:r.initializer&&r.initializer.length||(r.initializer=[]),r.initializer.push(l.onnx.TensorProto.decode(t,t.uint32()));break;case 10:r.docString=t.string();break;case 11:r.input&&r.input.length||(r.input=[]),r.input.push(l.onnx.ValueInfoProto.decode(t,t.uint32()));break;case 12:r.output&&r.output.length||(r.output=[]),r.output.push(l.onnx.ValueInfoProto.decode(t,t.uint32()));break;case 13:r.valueInfo&&r.valueInfo.length||(r.valueInfo=[]),r.valueInfo.push(l.onnx.ValueInfoProto.decode(t,t.uint32()));break;case 14:r.quantizationAnnotation&&r.quantizationAnnotation.length||(r.quantizationAnnotation=[]),r.quantizationAnnotation.push(l.onnx.TensorAnnotation.decode(t,t.uint32()));break;default:t.skipType(7&o)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.node&&t.hasOwnProperty("node")){if(!Array.isArray(t.node))return"node: array expected";for(var e=0;e<t.node.length;++e)if(n=l.onnx.NodeProto.verify(t.node[e]))return"node."+n}if(null!=t.name&&t.hasOwnProperty("name")&&!c.isString(t.name))return"name: string expected";if(null!=t.initializer&&t.hasOwnProperty("initializer")){if(!Array.isArray(t.initializer))return"initializer: array expected";for(e=0;e<t.initializer.length;++e)if(n=l.onnx.TensorProto.verify(t.initializer[e]))return"initializer."+n}if(null!=t.docString&&t.hasOwnProperty("docString")&&!c.isString(t.docString))return"docString: string expected";if(null!=t.input&&t.hasOwnProperty("input")){if(!Array.isArray(t.input))return"input: array expected";for(e=0;e<t.input.length;++e)if(n=l.onnx.ValueInfoProto.verify(t.input[e]))return"input."+n}if(null!=t.output&&t.hasOwnProperty("output")){if(!Array.isArray(t.output))return"output: array expected";for(e=0;e<t.output.length;++e)if(n=l.onnx.ValueInfoProto.verify(t.output[e]))return"output."+n}if(null!=t.valueInfo&&t.hasOwnProperty("valueInfo")){if(!Array.isArray(t.valueInfo))return"valueInfo: array expected";for(e=0;e<t.valueInfo.length;++e)if(n=l.onnx.ValueInfoProto.verify(t.valueInfo[e]))return"valueInfo."+n}if(null!=t.quantizationAnnotation&&t.hasOwnProperty("quantizationAnnotation")){if(!Array.isArray(t.quantizationAnnotation))return"quantizationAnnotation: array expected";for(e=0;e<t.quantizationAnnotation.length;++e){var n;if(n=l.onnx.TensorAnnotation.verify(t.quantizationAnnotation[e]))return"quantizationAnnotation."+n}}return null},t.fromObject=function(t){if(t instanceof l.onnx.GraphProto)return t;var e=new l.onnx.GraphProto;if(t.node){if(!Array.isArray(t.node))throw TypeError(".onnx.GraphProto.node: array expected");e.node=[];for(var n=0;n<t.node.length;++n){if("object"!=typeof t.node[n])throw TypeError(".onnx.GraphProto.node: object expected");e.node[n]=l.onnx.NodeProto.fromObject(t.node[n])}}if(null!=t.name&&(e.name=String(t.name)),t.initializer){if(!Array.isArray(t.initializer))throw TypeError(".onnx.GraphProto.initializer: array expected");for(e.initializer=[],n=0;n<t.initializer.length;++n){if("object"!=typeof t.initializer[n])throw TypeError(".onnx.GraphProto.initializer: object expected");e.initializer[n]=l.onnx.TensorProto.fromObject(t.initializer[n])}}if(null!=t.docString&&(e.docString=String(t.docString)),t.input){if(!Array.isArray(t.input))throw TypeError(".onnx.GraphProto.input: array expected");for(e.input=[],n=0;n<t.input.length;++n){if("object"!=typeof t.input[n])throw TypeError(".onnx.GraphProto.input: object expected");e.input[n]=l.onnx.ValueInfoProto.fromObject(t.input[n])}}if(t.output){if(!Array.isArray(t.output))throw TypeError(".onnx.GraphProto.output: array expected");for(e.output=[],n=0;n<t.output.length;++n){if("object"!=typeof t.output[n])throw TypeError(".onnx.GraphProto.output: object expected");e.output[n]=l.onnx.ValueInfoProto.fromObject(t.output[n])}}if(t.valueInfo){if(!Array.isArray(t.valueInfo))throw TypeError(".onnx.GraphProto.valueInfo: array expected");for(e.valueInfo=[],n=0;n<t.valueInfo.length;++n){if("object"!=typeof t.valueInfo[n])throw TypeError(".onnx.GraphProto.valueInfo: object expected");e.valueInfo[n]=l.onnx.ValueInfoProto.fromObject(t.valueInfo[n])}}if(t.quantizationAnnotation){if(!Array.isArray(t.quantizationAnnotation))throw TypeError(".onnx.GraphProto.quantizationAnnotation: array expected");for(e.quantizationAnnotation=[],n=0;n<t.quantizationAnnotation.length;++n){if("object"!=typeof t.quantizationAnnotation[n])throw TypeError(".onnx.GraphProto.quantizationAnnotation: object expected");e.quantizationAnnotation[n]=l.onnx.TensorAnnotation.fromObject(t.quantizationAnnotation[n])}}return e},t.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.node=[],n.initializer=[],n.input=[],n.output=[],n.valueInfo=[],n.quantizationAnnotation=[]),e.defaults&&(n.name="",n.docString=""),t.node&&t.node.length){n.node=[];for(var r=0;r<t.node.length;++r)n.node[r]=l.onnx.NodeProto.toObject(t.node[r],e)}if(null!=t.name&&t.hasOwnProperty("name")&&(n.name=t.name),t.initializer&&t.initializer.length)for(n.initializer=[],r=0;r<t.initializer.length;++r)n.initializer[r]=l.onnx.TensorProto.toObject(t.initializer[r],e);if(null!=t.docString&&t.hasOwnProperty("docString")&&(n.docString=t.docString),t.input&&t.input.length)for(n.input=[],r=0;r<t.input.length;++r)n.input[r]=l.onnx.ValueInfoProto.toObject(t.input[r],e);if(t.output&&t.output.length)for(n.output=[],r=0;r<t.output.length;++r)n.output[r]=l.onnx.ValueInfoProto.toObject(t.output[r],e);if(t.valueInfo&&t.valueInfo.length)for(n.valueInfo=[],r=0;r<t.valueInfo.length;++r)n.valueInfo[r]=l.onnx.ValueInfoProto.toObject(t.valueInfo[r],e);if(t.quantizationAnnotation&&t.quantizationAnnotation.length)for(n.quantizationAnnotation=[],r=0;r<t.quantizationAnnotation.length;++r)n.quantizationAnnotation[r]=l.onnx.TensorAnnotation.toObject(t.quantizationAnnotation[r],e);return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t}(),i.TensorProto=function(){function t(t){if(this.dims=[],this.floatData=[],this.int32Data=[],this.stringData=[],this.int64Data=[],this.externalData=[],this.doubleData=[],this.uint64Data=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return t.prototype.dims=c.emptyArray,t.prototype.dataType=0,t.prototype.segment=null,t.prototype.floatData=c.emptyArray,t.prototype.int32Data=c.emptyArray,t.prototype.stringData=c.emptyArray,t.prototype.int64Data=c.emptyArray,t.prototype.name="",t.prototype.docString="",t.prototype.rawData=c.newBuffer([]),t.prototype.externalData=c.emptyArray,t.prototype.dataLocation=0,t.prototype.doubleData=c.emptyArray,t.prototype.uint64Data=c.emptyArray,t.create=function(e){return new t(e)},t.encode=function(t,e){if(e||(e=u.create()),null!=t.dims&&t.dims.length){e.uint32(10).fork();for(var n=0;n<t.dims.length;++n)e.int64(t.dims[n]);e.ldelim()}if(null!=t.dataType&&t.hasOwnProperty("dataType")&&e.uint32(16).int32(t.dataType),null!=t.segment&&t.hasOwnProperty("segment")&&l.onnx.TensorProto.Segment.encode(t.segment,e.uint32(26).fork()).ldelim(),null!=t.floatData&&t.floatData.length){for(e.uint32(34).fork(),n=0;n<t.floatData.length;++n)e.float(t.floatData[n]);e.ldelim()}if(null!=t.int32Data&&t.int32Data.length){for(e.uint32(42).fork(),n=0;n<t.int32Data.length;++n)e.int32(t.int32Data[n]);e.ldelim()}if(null!=t.stringData&&t.stringData.length)for(n=0;n<t.stringData.length;++n)e.uint32(50).bytes(t.stringData[n]);if(null!=t.int64Data&&t.int64Data.length){for(e.uint32(58).fork(),n=0;n<t.int64Data.length;++n)e.int64(t.int64Data[n]);e.ldelim()}if(null!=t.name&&t.hasOwnProperty("name")&&e.uint32(66).string(t.name),null!=t.rawData&&t.hasOwnProperty("rawData")&&e.uint32(74).bytes(t.rawData),null!=t.doubleData&&t.doubleData.length){for(e.uint32(82).fork(),n=0;n<t.doubleData.length;++n)e.double(t.doubleData[n]);e.ldelim()}if(null!=t.uint64Data&&t.uint64Data.length){for(e.uint32(90).fork(),n=0;n<t.uint64Data.length;++n)e.uint64(t.uint64Data[n]);e.ldelim()}if(null!=t.docString&&t.hasOwnProperty("docString")&&e.uint32(98).string(t.docString),null!=t.externalData&&t.externalData.length)for(n=0;n<t.externalData.length;++n)l.onnx.StringStringEntryProto.encode(t.externalData[n],e.uint32(106).fork()).ldelim();return null!=t.dataLocation&&t.hasOwnProperty("dataLocation")&&e.uint32(112).int32(t.dataLocation),e},t.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},t.decode=function(t,e){t instanceof s||(t=s.create(t));for(var n=void 0===e?t.len:t.pos+e,r=new l.onnx.TensorProto;t.pos<n;){var o=t.uint32();switch(o>>>3){case 1:if(r.dims&&r.dims.length||(r.dims=[]),2==(7&o))for(var i=t.uint32()+t.pos;t.pos<i;)r.dims.push(t.int64());else r.dims.push(t.int64());break;case 2:r.dataType=t.int32();break;case 3:r.segment=l.onnx.TensorProto.Segment.decode(t,t.uint32());break;case 4:if(r.floatData&&r.floatData.length||(r.floatData=[]),2==(7&o))for(i=t.uint32()+t.pos;t.pos<i;)r.floatData.push(t.float());else r.floatData.push(t.float());break;case 5:if(r.int32Data&&r.int32Data.length||(r.int32Data=[]),2==(7&o))for(i=t.uint32()+t.pos;t.pos<i;)r.int32Data.push(t.int32());else r.int32Data.push(t.int32());break;case 6:r.stringData&&r.stringData.length||(r.stringData=[]),r.stringData.push(t.bytes());break;case 7:if(r.int64Data&&r.int64Data.length||(r.int64Data=[]),2==(7&o))for(i=t.uint32()+t.pos;t.pos<i;)r.int64Data.push(t.int64());else r.int64Data.push(t.int64());break;case 8:r.name=t.string();break;case 12:r.docString=t.string();break;case 9:r.rawData=t.bytes();break;case 13:r.externalData&&r.externalData.length||(r.externalData=[]),r.externalData.push(l.onnx.StringStringEntryProto.decode(t,t.uint32()));break;case 14:r.dataLocation=t.int32();break;case 10:if(r.doubleData&&r.doubleData.length||(r.doubleData=[]),2==(7&o))for(i=t.uint32()+t.pos;t.pos<i;)r.doubleData.push(t.double());else r.doubleData.push(t.double());break;case 11:if(r.uint64Data&&r.uint64Data.length||(r.uint64Data=[]),2==(7&o))for(i=t.uint32()+t.pos;t.pos<i;)r.uint64Data.push(t.uint64());else r.uint64Data.push(t.uint64());break;default:t.skipType(7&o)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.dims&&t.hasOwnProperty("dims")){if(!Array.isArray(t.dims))return"dims: array expected";for(var e=0;e<t.dims.length;++e)if(!(c.isInteger(t.dims[e])||t.dims[e]&&c.isInteger(t.dims[e].low)&&c.isInteger(t.dims[e].high)))return"dims: integer|Long[] expected"}if(null!=t.dataType&&t.hasOwnProperty("dataType")&&!c.isInteger(t.dataType))return"dataType: integer expected";if(null!=t.segment&&t.hasOwnProperty("segment")&&(n=l.onnx.TensorProto.Segment.verify(t.segment)))return"segment."+n;if(null!=t.floatData&&t.hasOwnProperty("floatData")){if(!Array.isArray(t.floatData))return"floatData: array expected";for(e=0;e<t.floatData.length;++e)if("number"!=typeof t.floatData[e])return"floatData: number[] expected"}if(null!=t.int32Data&&t.hasOwnProperty("int32Data")){if(!Array.isArray(t.int32Data))return"int32Data: array expected";for(e=0;e<t.int32Data.length;++e)if(!c.isInteger(t.int32Data[e]))return"int32Data: integer[] expected"}if(null!=t.stringData&&t.hasOwnProperty("stringData")){if(!Array.isArray(t.stringData))return"stringData: array expected";for(e=0;e<t.stringData.length;++e)if(!(t.stringData[e]&&"number"==typeof t.stringData[e].length||c.isString(t.stringData[e])))return"stringData: buffer[] expected"}if(null!=t.int64Data&&t.hasOwnProperty("int64Data")){if(!Array.isArray(t.int64Data))return"int64Data: array expected";for(e=0;e<t.int64Data.length;++e)if(!(c.isInteger(t.int64Data[e])||t.int64Data[e]&&c.isInteger(t.int64Data[e].low)&&c.isInteger(t.int64Data[e].high)))return"int64Data: integer|Long[] expected"}if(null!=t.name&&t.hasOwnProperty("name")&&!c.isString(t.name))return"name: string expected";if(null!=t.docString&&t.hasOwnProperty("docString")&&!c.isString(t.docString))return"docString: string expected";if(null!=t.rawData&&t.hasOwnProperty("rawData")&&!(t.rawData&&"number"==typeof t.rawData.length||c.isString(t.rawData)))return"rawData: buffer expected";if(null!=t.externalData&&t.hasOwnProperty("externalData")){if(!Array.isArray(t.externalData))return"externalData: array expected";for(e=0;e<t.externalData.length;++e){var n;if(n=l.onnx.StringStringEntryProto.verify(t.externalData[e]))return"externalData."+n}}if(null!=t.dataLocation&&t.hasOwnProperty("dataLocation"))switch(t.dataLocation){default:return"dataLocation: enum value expected";case 0:case 1:}if(null!=t.doubleData&&t.hasOwnProperty("doubleData")){if(!Array.isArray(t.doubleData))return"doubleData: array expected";for(e=0;e<t.doubleData.length;++e)if("number"!=typeof t.doubleData[e])return"doubleData: number[] expected"}if(null!=t.uint64Data&&t.hasOwnProperty("uint64Data")){if(!Array.isArray(t.uint64Data))return"uint64Data: array expected";for(e=0;e<t.uint64Data.length;++e)if(!(c.isInteger(t.uint64Data[e])||t.uint64Data[e]&&c.isInteger(t.uint64Data[e].low)&&c.isInteger(t.uint64Data[e].high)))return"uint64Data: integer|Long[] expected"}return null},t.fromObject=function(t){if(t instanceof l.onnx.TensorProto)return t;var e=new l.onnx.TensorProto;if(t.dims){if(!Array.isArray(t.dims))throw TypeError(".onnx.TensorProto.dims: array expected");e.dims=[];for(var n=0;n<t.dims.length;++n)c.Long?(e.dims[n]=c.Long.fromValue(t.dims[n])).unsigned=!1:"string"==typeof t.dims[n]?e.dims[n]=parseInt(t.dims[n],10):"number"==typeof t.dims[n]?e.dims[n]=t.dims[n]:"object"==typeof t.dims[n]&&(e.dims[n]=new c.LongBits(t.dims[n].low>>>0,t.dims[n].high>>>0).toNumber())}if(null!=t.dataType&&(e.dataType=0|t.dataType),null!=t.segment){if("object"!=typeof t.segment)throw TypeError(".onnx.TensorProto.segment: object expected");e.segment=l.onnx.TensorProto.Segment.fromObject(t.segment)}if(t.floatData){if(!Array.isArray(t.floatData))throw TypeError(".onnx.TensorProto.floatData: array expected");for(e.floatData=[],n=0;n<t.floatData.length;++n)e.floatData[n]=Number(t.floatData[n])}if(t.int32Data){if(!Array.isArray(t.int32Data))throw TypeError(".onnx.TensorProto.int32Data: array expected");for(e.int32Data=[],n=0;n<t.int32Data.length;++n)e.int32Data[n]=0|t.int32Data[n]}if(t.stringData){if(!Array.isArray(t.stringData))throw TypeError(".onnx.TensorProto.stringData: array expected");for(e.stringData=[],n=0;n<t.stringData.length;++n)"string"==typeof t.stringData[n]?c.base64.decode(t.stringData[n],e.stringData[n]=c.newBuffer(c.base64.length(t.stringData[n])),0):t.stringData[n].length&&(e.stringData[n]=t.stringData[n])}if(t.int64Data){if(!Array.isArray(t.int64Data))throw TypeError(".onnx.TensorProto.int64Data: array expected");for(e.int64Data=[],n=0;n<t.int64Data.length;++n)c.Long?(e.int64Data[n]=c.Long.fromValue(t.int64Data[n])).unsigned=!1:"string"==typeof t.int64Data[n]?e.int64Data[n]=parseInt(t.int64Data[n],10):"number"==typeof t.int64Data[n]?e.int64Data[n]=t.int64Data[n]:"object"==typeof t.int64Data[n]&&(e.int64Data[n]=new c.LongBits(t.int64Data[n].low>>>0,t.int64Data[n].high>>>0).toNumber())}if(null!=t.name&&(e.name=String(t.name)),null!=t.docString&&(e.docString=String(t.docString)),null!=t.rawData&&("string"==typeof t.rawData?c.base64.decode(t.rawData,e.rawData=c.newBuffer(c.base64.length(t.rawData)),0):t.rawData.length&&(e.rawData=t.rawData)),t.externalData){if(!Array.isArray(t.externalData))throw TypeError(".onnx.TensorProto.externalData: array expected");for(e.externalData=[],n=0;n<t.externalData.length;++n){if("object"!=typeof t.externalData[n])throw TypeError(".onnx.TensorProto.externalData: object expected");e.externalData[n]=l.onnx.StringStringEntryProto.fromObject(t.externalData[n])}}switch(t.dataLocation){case"DEFAULT":case 0:e.dataLocation=0;break;case"EXTERNAL":case 1:e.dataLocation=1}if(t.doubleData){if(!Array.isArray(t.doubleData))throw TypeError(".onnx.TensorProto.doubleData: array expected");for(e.doubleData=[],n=0;n<t.doubleData.length;++n)e.doubleData[n]=Number(t.doubleData[n])}if(t.uint64Data){if(!Array.isArray(t.uint64Data))throw TypeError(".onnx.TensorProto.uint64Data: array expected");for(e.uint64Data=[],n=0;n<t.uint64Data.length;++n)c.Long?(e.uint64Data[n]=c.Long.fromValue(t.uint64Data[n])).unsigned=!0:"string"==typeof t.uint64Data[n]?e.uint64Data[n]=parseInt(t.uint64Data[n],10):"number"==typeof t.uint64Data[n]?e.uint64Data[n]=t.uint64Data[n]:"object"==typeof t.uint64Data[n]&&(e.uint64Data[n]=new c.LongBits(t.uint64Data[n].low>>>0,t.uint64Data[n].high>>>0).toNumber(!0))}return e},t.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.dims=[],n.floatData=[],n.int32Data=[],n.stringData=[],n.int64Data=[],n.doubleData=[],n.uint64Data=[],n.externalData=[]),e.defaults&&(n.dataType=0,n.segment=null,n.name="",e.bytes===String?n.rawData="":(n.rawData=[],e.bytes!==Array&&(n.rawData=c.newBuffer(n.rawData))),n.docString="",n.dataLocation=e.enums===String?"DEFAULT":0),t.dims&&t.dims.length){n.dims=[];for(var r=0;r<t.dims.length;++r)"number"==typeof t.dims[r]?n.dims[r]=e.longs===String?String(t.dims[r]):t.dims[r]:n.dims[r]=e.longs===String?c.Long.prototype.toString.call(t.dims[r]):e.longs===Number?new c.LongBits(t.dims[r].low>>>0,t.dims[r].high>>>0).toNumber():t.dims[r]}if(null!=t.dataType&&t.hasOwnProperty("dataType")&&(n.dataType=t.dataType),null!=t.segment&&t.hasOwnProperty("segment")&&(n.segment=l.onnx.TensorProto.Segment.toObject(t.segment,e)),t.floatData&&t.floatData.length)for(n.floatData=[],r=0;r<t.floatData.length;++r)n.floatData[r]=e.json&&!isFinite(t.floatData[r])?String(t.floatData[r]):t.floatData[r];if(t.int32Data&&t.int32Data.length)for(n.int32Data=[],r=0;r<t.int32Data.length;++r)n.int32Data[r]=t.int32Data[r];if(t.stringData&&t.stringData.length)for(n.stringData=[],r=0;r<t.stringData.length;++r)n.stringData[r]=e.bytes===String?c.base64.encode(t.stringData[r],0,t.stringData[r].length):e.bytes===Array?Array.prototype.slice.call(t.stringData[r]):t.stringData[r];if(t.int64Data&&t.int64Data.length)for(n.int64Data=[],r=0;r<t.int64Data.length;++r)"number"==typeof t.int64Data[r]?n.int64Data[r]=e.longs===String?String(t.int64Data[r]):t.int64Data[r]:n.int64Data[r]=e.longs===String?c.Long.prototype.toString.call(t.int64Data[r]):e.longs===Number?new c.LongBits(t.int64Data[r].low>>>0,t.int64Data[r].high>>>0).toNumber():t.int64Data[r];if(null!=t.name&&t.hasOwnProperty("name")&&(n.name=t.name),null!=t.rawData&&t.hasOwnProperty("rawData")&&(n.rawData=e.bytes===String?c.base64.encode(t.rawData,0,t.rawData.length):e.bytes===Array?Array.prototype.slice.call(t.rawData):t.rawData),t.doubleData&&t.doubleData.length)for(n.doubleData=[],r=0;r<t.doubleData.length;++r)n.doubleData[r]=e.json&&!isFinite(t.doubleData[r])?String(t.doubleData[r]):t.doubleData[r];if(t.uint64Data&&t.uint64Data.length)for(n.uint64Data=[],r=0;r<t.uint64Data.length;++r)"number"==typeof t.uint64Data[r]?n.uint64Data[r]=e.longs===String?String(t.uint64Data[r]):t.uint64Data[r]:n.uint64Data[r]=e.longs===String?c.Long.prototype.toString.call(t.uint64Data[r]):e.longs===Number?new c.LongBits(t.uint64Data[r].low>>>0,t.uint64Data[r].high>>>0).toNumber(!0):t.uint64Data[r];if(null!=t.docString&&t.hasOwnProperty("docString")&&(n.docString=t.docString),t.externalData&&t.externalData.length)for(n.externalData=[],r=0;r<t.externalData.length;++r)n.externalData[r]=l.onnx.StringStringEntryProto.toObject(t.externalData[r],e);return null!=t.dataLocation&&t.hasOwnProperty("dataLocation")&&(n.dataLocation=e.enums===String?l.onnx.TensorProto.DataLocation[t.dataLocation]:t.dataLocation),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t.DataType=function(){var t={},e=Object.create(t);return e[t[0]="UNDEFINED"]=0,e[t[1]="FLOAT"]=1,e[t[2]="UINT8"]=2,e[t[3]="INT8"]=3,e[t[4]="UINT16"]=4,e[t[5]="INT16"]=5,e[t[6]="INT32"]=6,e[t[7]="INT64"]=7,e[t[8]="STRING"]=8,e[t[9]="BOOL"]=9,e[t[10]="FLOAT16"]=10,e[t[11]="DOUBLE"]=11,e[t[12]="UINT32"]=12,e[t[13]="UINT64"]=13,e[t[14]="COMPLEX64"]=14,e[t[15]="COMPLEX128"]=15,e[t[16]="BFLOAT16"]=16,e}(),t.Segment=function(){function t(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return t.prototype.begin=c.Long?c.Long.fromBits(0,0,!1):0,t.prototype.end=c.Long?c.Long.fromBits(0,0,!1):0,t.create=function(e){return new t(e)},t.encode=function(t,e){return e||(e=u.create()),null!=t.begin&&t.hasOwnProperty("begin")&&e.uint32(8).int64(t.begin),null!=t.end&&t.hasOwnProperty("end")&&e.uint32(16).int64(t.end),e},t.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},t.decode=function(t,e){t instanceof s||(t=s.create(t));for(var n=void 0===e?t.len:t.pos+e,r=new l.onnx.TensorProto.Segment;t.pos<n;){var o=t.uint32();switch(o>>>3){case 1:r.begin=t.int64();break;case 2:r.end=t.int64();break;default:t.skipType(7&o)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.begin&&t.hasOwnProperty("begin")&&!(c.isInteger(t.begin)||t.begin&&c.isInteger(t.begin.low)&&c.isInteger(t.begin.high))?"begin: integer|Long expected":null!=t.end&&t.hasOwnProperty("end")&&!(c.isInteger(t.end)||t.end&&c.isInteger(t.end.low)&&c.isInteger(t.end.high))?"end: integer|Long expected":null},t.fromObject=function(t){if(t instanceof l.onnx.TensorProto.Segment)return t;var e=new l.onnx.TensorProto.Segment;return null!=t.begin&&(c.Long?(e.begin=c.Long.fromValue(t.begin)).unsigned=!1:"string"==typeof t.begin?e.begin=parseInt(t.begin,10):"number"==typeof t.begin?e.begin=t.begin:"object"==typeof t.begin&&(e.begin=new c.LongBits(t.begin.low>>>0,t.begin.high>>>0).toNumber())),null!=t.end&&(c.Long?(e.end=c.Long.fromValue(t.end)).unsigned=!1:"string"==typeof t.end?e.end=parseInt(t.end,10):"number"==typeof t.end?e.end=t.end:"object"==typeof t.end&&(e.end=new c.LongBits(t.end.low>>>0,t.end.high>>>0).toNumber())),e},t.toObject=function(t,e){e||(e={});var n={};if(e.defaults){if(c.Long){var r=new c.Long(0,0,!1);n.begin=e.longs===String?r.toString():e.longs===Number?r.toNumber():r}else n.begin=e.longs===String?"0":0;c.Long?(r=new c.Long(0,0,!1),n.end=e.longs===String?r.toString():e.longs===Number?r.toNumber():r):n.end=e.longs===String?"0":0}return null!=t.begin&&t.hasOwnProperty("begin")&&("number"==typeof t.begin?n.begin=e.longs===String?String(t.begin):t.begin:n.begin=e.longs===String?c.Long.prototype.toString.call(t.begin):e.longs===Number?new c.LongBits(t.begin.low>>>0,t.begin.high>>>0).toNumber():t.begin),null!=t.end&&t.hasOwnProperty("end")&&("number"==typeof t.end?n.end=e.longs===String?String(t.end):t.end:n.end=e.longs===String?c.Long.prototype.toString.call(t.end):e.longs===Number?new c.LongBits(t.end.low>>>0,t.end.high>>>0).toNumber():t.end),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t}(),t.DataLocation=function(){var t={},e=Object.create(t);return e[t[0]="DEFAULT"]=0,e[t[1]="EXTERNAL"]=1,e}(),t}(),i.TensorShapeProto=function(){function t(t){if(this.dim=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return t.prototype.dim=c.emptyArray,t.create=function(e){return new t(e)},t.encode=function(t,e){if(e||(e=u.create()),null!=t.dim&&t.dim.length)for(var n=0;n<t.dim.length;++n)l.onnx.TensorShapeProto.Dimension.encode(t.dim[n],e.uint32(10).fork()).ldelim();return e},t.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},t.decode=function(t,e){t instanceof s||(t=s.create(t));for(var n=void 0===e?t.len:t.pos+e,r=new l.onnx.TensorShapeProto;t.pos<n;){var o=t.uint32();o>>>3==1?(r.dim&&r.dim.length||(r.dim=[]),r.dim.push(l.onnx.TensorShapeProto.Dimension.decode(t,t.uint32()))):t.skipType(7&o)}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.dim&&t.hasOwnProperty("dim")){if(!Array.isArray(t.dim))return"dim: array expected";for(var e=0;e<t.dim.length;++e){var n=l.onnx.TensorShapeProto.Dimension.verify(t.dim[e]);if(n)return"dim."+n}}return null},t.fromObject=function(t){if(t instanceof l.onnx.TensorShapeProto)return t;var e=new l.onnx.TensorShapeProto;if(t.dim){if(!Array.isArray(t.dim))throw TypeError(".onnx.TensorShapeProto.dim: array expected");e.dim=[];for(var n=0;n<t.dim.length;++n){if("object"!=typeof t.dim[n])throw TypeError(".onnx.TensorShapeProto.dim: object expected");e.dim[n]=l.onnx.TensorShapeProto.Dimension.fromObject(t.dim[n])}}return e},t.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.dim=[]),t.dim&&t.dim.length){n.dim=[];for(var r=0;r<t.dim.length;++r)n.dim[r]=l.onnx.TensorShapeProto.Dimension.toObject(t.dim[r],e)}return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t.Dimension=function(){function t(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}var e;return t.prototype.dimValue=c.Long?c.Long.fromBits(0,0,!1):0,t.prototype.dimParam="",t.prototype.denotation="",Object.defineProperty(t.prototype,"value",{get:c.oneOfGetter(e=["dimValue","dimParam"]),set:c.oneOfSetter(e)}),t.create=function(e){return new t(e)},t.encode=function(t,e){return e||(e=u.create()),null!=t.dimValue&&t.hasOwnProperty("dimValue")&&e.uint32(8).int64(t.dimValue),null!=t.dimParam&&t.hasOwnProperty("dimParam")&&e.uint32(18).string(t.dimParam),null!=t.denotation&&t.hasOwnProperty("denotation")&&e.uint32(26).string(t.denotation),e},t.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},t.decode=function(t,e){t instanceof s||(t=s.create(t));for(var n=void 0===e?t.len:t.pos+e,r=new l.onnx.TensorShapeProto.Dimension;t.pos<n;){var o=t.uint32();switch(o>>>3){case 1:r.dimValue=t.int64();break;case 2:r.dimParam=t.string();break;case 3:r.denotation=t.string();break;default:t.skipType(7&o)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";var e={};if(null!=t.dimValue&&t.hasOwnProperty("dimValue")&&(e.value=1,!(c.isInteger(t.dimValue)||t.dimValue&&c.isInteger(t.dimValue.low)&&c.isInteger(t.dimValue.high))))return"dimValue: integer|Long expected";if(null!=t.dimParam&&t.hasOwnProperty("dimParam")){if(1===e.value)return"value: multiple values";if(e.value=1,!c.isString(t.dimParam))return"dimParam: string expected"}return null!=t.denotation&&t.hasOwnProperty("denotation")&&!c.isString(t.denotation)?"denotation: string expected":null},t.fromObject=function(t){if(t instanceof l.onnx.TensorShapeProto.Dimension)return t;var e=new l.onnx.TensorShapeProto.Dimension;return null!=t.dimValue&&(c.Long?(e.dimValue=c.Long.fromValue(t.dimValue)).unsigned=!1:"string"==typeof t.dimValue?e.dimValue=parseInt(t.dimValue,10):"number"==typeof t.dimValue?e.dimValue=t.dimValue:"object"==typeof t.dimValue&&(e.dimValue=new c.LongBits(t.dimValue.low>>>0,t.dimValue.high>>>0).toNumber())),null!=t.dimParam&&(e.dimParam=String(t.dimParam)),null!=t.denotation&&(e.denotation=String(t.denotation)),e},t.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.denotation=""),null!=t.dimValue&&t.hasOwnProperty("dimValue")&&("number"==typeof t.dimValue?n.dimValue=e.longs===String?String(t.dimValue):t.dimValue:n.dimValue=e.longs===String?c.Long.prototype.toString.call(t.dimValue):e.longs===Number?new c.LongBits(t.dimValue.low>>>0,t.dimValue.high>>>0).toNumber():t.dimValue,e.oneofs&&(n.value="dimValue")),null!=t.dimParam&&t.hasOwnProperty("dimParam")&&(n.dimParam=t.dimParam,e.oneofs&&(n.value="dimParam")),null!=t.denotation&&t.hasOwnProperty("denotation")&&(n.denotation=t.denotation),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t}(),t}(),i.TypeProto=function(){function t(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}var e;return t.prototype.tensorType=null,t.prototype.denotation="",Object.defineProperty(t.prototype,"value",{get:c.oneOfGetter(e=["tensorType"]),set:c.oneOfSetter(e)}),t.create=function(e){return new t(e)},t.encode=function(t,e){return e||(e=u.create()),null!=t.tensorType&&t.hasOwnProperty("tensorType")&&l.onnx.TypeProto.Tensor.encode(t.tensorType,e.uint32(10).fork()).ldelim(),null!=t.denotation&&t.hasOwnProperty("denotation")&&e.uint32(50).string(t.denotation),e},t.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},t.decode=function(t,e){t instanceof s||(t=s.create(t));for(var n=void 0===e?t.len:t.pos+e,r=new l.onnx.TypeProto;t.pos<n;){var o=t.uint32();switch(o>>>3){case 1:r.tensorType=l.onnx.TypeProto.Tensor.decode(t,t.uint32());break;case 6:r.denotation=t.string();break;default:t.skipType(7&o)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.tensorType&&t.hasOwnProperty("tensorType")){var e=l.onnx.TypeProto.Tensor.verify(t.tensorType);if(e)return"tensorType."+e}return null!=t.denotation&&t.hasOwnProperty("denotation")&&!c.isString(t.denotation)?"denotation: string expected":null},t.fromObject=function(t){if(t instanceof l.onnx.TypeProto)return t;var e=new l.onnx.TypeProto;if(null!=t.tensorType){if("object"!=typeof t.tensorType)throw TypeError(".onnx.TypeProto.tensorType: object expected");e.tensorType=l.onnx.TypeProto.Tensor.fromObject(t.tensorType)}return null!=t.denotation&&(e.denotation=String(t.denotation)),e},t.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.denotation=""),null!=t.tensorType&&t.hasOwnProperty("tensorType")&&(n.tensorType=l.onnx.TypeProto.Tensor.toObject(t.tensorType,e),e.oneofs&&(n.value="tensorType")),null!=t.denotation&&t.hasOwnProperty("denotation")&&(n.denotation=t.denotation),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t.Tensor=function(){function t(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return t.prototype.elemType=0,t.prototype.shape=null,t.create=function(e){return new t(e)},t.encode=function(t,e){return e||(e=u.create()),null!=t.elemType&&t.hasOwnProperty("elemType")&&e.uint32(8).int32(t.elemType),null!=t.shape&&t.hasOwnProperty("shape")&&l.onnx.TensorShapeProto.encode(t.shape,e.uint32(18).fork()).ldelim(),e},t.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},t.decode=function(t,e){t instanceof s||(t=s.create(t));for(var n=void 0===e?t.len:t.pos+e,r=new l.onnx.TypeProto.Tensor;t.pos<n;){var o=t.uint32();switch(o>>>3){case 1:r.elemType=t.int32();break;case 2:r.shape=l.onnx.TensorShapeProto.decode(t,t.uint32());break;default:t.skipType(7&o)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.elemType&&t.hasOwnProperty("elemType")&&!c.isInteger(t.elemType))return"elemType: integer expected";if(null!=t.shape&&t.hasOwnProperty("shape")){var e=l.onnx.TensorShapeProto.verify(t.shape);if(e)return"shape."+e}return null},t.fromObject=function(t){if(t instanceof l.onnx.TypeProto.Tensor)return t;var e=new l.onnx.TypeProto.Tensor;if(null!=t.elemType&&(e.elemType=0|t.elemType),null!=t.shape){if("object"!=typeof t.shape)throw TypeError(".onnx.TypeProto.Tensor.shape: object expected");e.shape=l.onnx.TensorShapeProto.fromObject(t.shape)}return e},t.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.elemType=0,n.shape=null),null!=t.elemType&&t.hasOwnProperty("elemType")&&(n.elemType=t.elemType),null!=t.shape&&t.hasOwnProperty("shape")&&(n.shape=l.onnx.TensorShapeProto.toObject(t.shape,e)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t}(),t}(),i.OperatorSetIdProto=function(){function t(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return t.prototype.domain="",t.prototype.version=c.Long?c.Long.fromBits(0,0,!1):0,t.create=function(e){return new t(e)},t.encode=function(t,e){return e||(e=u.create()),null!=t.domain&&t.hasOwnProperty("domain")&&e.uint32(10).string(t.domain),null!=t.version&&t.hasOwnProperty("version")&&e.uint32(16).int64(t.version),e},t.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},t.decode=function(t,e){t instanceof s||(t=s.create(t));for(var n=void 0===e?t.len:t.pos+e,r=new l.onnx.OperatorSetIdProto;t.pos<n;){var o=t.uint32();switch(o>>>3){case 1:r.domain=t.string();break;case 2:r.version=t.int64();break;default:t.skipType(7&o)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.domain&&t.hasOwnProperty("domain")&&!c.isString(t.domain)?"domain: string expected":null!=t.version&&t.hasOwnProperty("version")&&!(c.isInteger(t.version)||t.version&&c.isInteger(t.version.low)&&c.isInteger(t.version.high))?"version: integer|Long expected":null},t.fromObject=function(t){if(t instanceof l.onnx.OperatorSetIdProto)return t;var e=new l.onnx.OperatorSetIdProto;return null!=t.domain&&(e.domain=String(t.domain)),null!=t.version&&(c.Long?(e.version=c.Long.fromValue(t.version)).unsigned=!1:"string"==typeof t.version?e.version=parseInt(t.version,10):"number"==typeof t.version?e.version=t.version:"object"==typeof t.version&&(e.version=new c.LongBits(t.version.low>>>0,t.version.high>>>0).toNumber())),e},t.toObject=function(t,e){e||(e={});var n={};if(e.defaults)if(n.domain="",c.Long){var r=new c.Long(0,0,!1);n.version=e.longs===String?r.toString():e.longs===Number?r.toNumber():r}else n.version=e.longs===String?"0":0;return null!=t.domain&&t.hasOwnProperty("domain")&&(n.domain=t.domain),null!=t.version&&t.hasOwnProperty("version")&&("number"==typeof t.version?n.version=e.longs===String?String(t.version):t.version:n.version=e.longs===String?c.Long.prototype.toString.call(t.version):e.longs===Number?new c.LongBits(t.version.low>>>0,t.version.high>>>0).toNumber():t.version),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t}(),i),t.exports=l},2100:function(t,e,n){"use strict";t.exports=n(9482)},9482:function(t,e,n){"use strict";var r=e;function o(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}r.build="minimal",r.Writer=n(1173),r.BufferWriter=n(3155),r.Reader=n(1408),r.BufferReader=n(593),r.util=n(9693),r.rpc=n(5994),r.roots=n(5054),r.configure=o,o()},1408:function(t,e,n){"use strict";t.exports=u;var r,o=n(9693),i=o.LongBits,a=o.utf8;function s(t,e){return RangeError("index out of range: "+t.pos+" + "+(e||1)+" > "+t.len)}function u(t){this.buf=t,this.pos=0,this.len=t.length}var c,l="undefined"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new u(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new u(t);throw Error("illegal buffer")},f=function(){return o.Buffer?function(t){return(u.create=function(t){return o.Buffer.isBuffer(t)?new r(t):l(t)})(t)}:l};function p(){var t=new i(0,0),e=0;if(!(this.len-this.pos>4)){for(;e<3;++e){if(this.pos>=this.len)throw s(this);if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*e)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(127&this.buf[this.pos++])<<7*e)>>>0,t}for(;e<4;++e)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*e)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;if(e=0,this.len-this.pos>4){for(;e<5;++e)if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*e+3)>>>0,this.buf[this.pos++]<128)return t}else for(;e<5;++e){if(this.pos>=this.len)throw s(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*e+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function h(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}function d(){if(this.pos+8>this.len)throw s(this,8);return new i(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}u.create=f(),u.prototype._slice=o.Array.prototype.subarray||o.Array.prototype.slice,u.prototype.uint32=(c=4294967295,function(){if(c=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return c;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return c}),u.prototype.int32=function(){return 0|this.uint32()},u.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)|0},u.prototype.bool=function(){return 0!==this.uint32()},u.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return h(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|h(this.buf,this.pos+=4)},u.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var t=o.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},u.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var t=o.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},u.prototype.bytes=function(){var t=this.uint32(),e=this.pos,n=this.pos+t;if(n>this.len)throw s(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(e,n):e===n?new this.buf.constructor(0):this._slice.call(this.buf,e,n)},u.prototype.string=function(){var t=this.bytes();return a.read(t,0,t.length)},u.prototype.skip=function(t){if("number"==typeof t){if(this.pos+t>this.len)throw s(this,t);this.pos+=t}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},u.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(t=7&this.uint32());)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},u._configure=function(t){r=t,u.create=f(),r._configure();var e=o.Long?"toLong":"toNumber";o.merge(u.prototype,{int64:function(){return p.call(this)[e](!1)},uint64:function(){return p.call(this)[e](!0)},sint64:function(){return p.call(this).zzDecode()[e](!1)},fixed64:function(){return d.call(this)[e](!0)},sfixed64:function(){return d.call(this)[e](!1)}})}},593:function(t,e,n){"use strict";t.exports=i;var r=n(1408);(i.prototype=Object.create(r.prototype)).constructor=i;var o=n(9693);function i(t){r.call(this,t)}i._configure=function(){o.Buffer&&(i.prototype._slice=o.Buffer.prototype.slice)},i.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))},i._configure()},5054:function(t){"use strict";t.exports={}},5994:function(t,e,n){"use strict";e.Service=n(7948)},7948:function(t,e,n){"use strict";t.exports=o;var r=n(9693);function o(t,e,n){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=Boolean(e),this.responseDelimited=Boolean(n)}(o.prototype=Object.create(r.EventEmitter.prototype)).constructor=o,o.prototype.rpcCall=function t(e,n,o,i,a){if(!i)throw TypeError("request must be specified");var s=this;if(!a)return r.asPromise(t,s,e,n,o,i);if(s.rpcImpl)try{return s.rpcImpl(e,n[s.requestDelimited?"encodeDelimited":"encode"](i).finish(),(function(t,n){if(t)return s.emit("error",t,e),a(t);if(null!==n){if(!(n instanceof o))try{n=o[s.responseDelimited?"decodeDelimited":"decode"](n)}catch(t){return s.emit("error",t,e),a(t)}return s.emit("data",n,e),a(null,n)}s.end(!0)}))}catch(t){return s.emit("error",t,e),void setTimeout((function(){a(t)}),0)}else setTimeout((function(){a(Error("already ended"))}),0)},o.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},1945:function(t,e,n){"use strict";t.exports=o;var r=n(9693);function o(t,e){this.lo=t>>>0,this.hi=e>>>0}var i=o.zero=new o(0,0);i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1};var a=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(t){if(0===t)return i;var e=t<0;e&&(t=-t);var n=t>>>0,r=(t-n)/4294967296>>>0;return e&&(r=~r>>>0,n=~n>>>0,++n>4294967295&&(n=0,++r>4294967295&&(r=0))),new o(n,r)},o.from=function(t){if("number"==typeof t)return o.fromNumber(t);if(r.isString(t)){if(!r.Long)return o.fromNumber(parseInt(t,10));t=r.Long.fromString(t)}return t.low||t.high?new o(t.low>>>0,t.high>>>0):i},o.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var e=1+~this.lo>>>0,n=~this.hi>>>0;return e||(n=n+1>>>0),-(e+4294967296*n)}return this.lo+4294967296*this.hi},o.prototype.toLong=function(t){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(t)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(t)}};var s=String.prototype.charCodeAt;o.fromHash=function(t){return t===a?i:new o((s.call(t,0)|s.call(t,1)<<8|s.call(t,2)<<16|s.call(t,3)<<24)>>>0,(s.call(t,4)|s.call(t,5)<<8|s.call(t,6)<<16|s.call(t,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},o.prototype.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},o.prototype.length=function(){var t=this.lo,e=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===e?t<16384?t<128?1:2:t<2097152?3:4:e<16384?e<128?5:6:e<2097152?7:8:n<128?9:10}},9693:function(t,e,n){"use strict";var r=e;function o(t,e,n){for(var r=Object.keys(e),o=0;o<r.length;++o)void 0!==t[r[o]]&&n||(t[r[o]]=e[r[o]]);return t}function i(t){function e(t,n){if(!(this instanceof e))return new e(t,n);Object.defineProperty(this,"message",{get:function(){return t}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),n&&o(this,n)}return(e.prototype=Object.create(Error.prototype)).constructor=e,Object.defineProperty(e.prototype,"name",{get:function(){return t}}),e.prototype.toString=function(){return this.name+": "+this.message},e}r.asPromise=n(4537),r.base64=n(7419),r.EventEmitter=n(9211),r.float=n(945),r.inquire=n(7199),r.utf8=n(4997),r.pool=n(6662),r.LongBits=n(1945),r.isNode=Boolean(void 0!==n.g&&n.g&&n.g.process&&n.g.process.versions&&n.g.process.versions.node),r.global=r.isNode&&n.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},r.isString=function(t){return"string"==typeof t||t instanceof String},r.isObject=function(t){return t&&"object"==typeof t},r.isset=r.isSet=function(t,e){var n=t[e];return!(null==n||!t.hasOwnProperty(e))&&("object"!=typeof n||(Array.isArray(n)?n.length:Object.keys(n).length)>0)},r.Buffer=function(){try{var t=r.inquire("buffer").Buffer;return t.prototype.utf8Write?t:null}catch(t){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(t){return"number"==typeof t?r.Buffer?r._Buffer_allocUnsafe(t):new r.Array(t):r.Buffer?r._Buffer_from(t):"undefined"==typeof Uint8Array?t:new Uint8Array(t)},r.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(t){return t?r.LongBits.from(t).toHash():r.LongBits.zeroHash},r.longFromHash=function(t,e){var n=r.LongBits.fromHash(t);return r.Long?r.Long.fromBits(n.lo,n.hi,e):n.toNumber(Boolean(e))},r.merge=o,r.lcFirst=function(t){return t.charAt(0).toLowerCase()+t.substring(1)},r.newError=i,r.ProtocolError=i("ProtocolError"),r.oneOfGetter=function(t){for(var e={},n=0;n<t.length;++n)e[t[n]]=1;return function(){for(var t=Object.keys(this),n=t.length-1;n>-1;--n)if(1===e[t[n]]&&void 0!==this[t[n]]&&null!==this[t[n]])return t[n]}},r.oneOfSetter=function(t){return function(e){for(var n=0;n<t.length;++n)t[n]!==e&&delete this[t[n]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},r._configure=function(){var t=r.Buffer;t?(r._Buffer_from=t.from!==Uint8Array.from&&t.from||function(e,n){return new t(e,n)},r._Buffer_allocUnsafe=t.allocUnsafe||function(e){return new t(e)}):r._Buffer_from=r._Buffer_allocUnsafe=null}},1173:function(t,e,n){"use strict";t.exports=f;var r,o=n(9693),i=o.LongBits,a=o.base64,s=o.utf8;function u(t,e,n){this.fn=t,this.len=e,this.next=void 0,this.val=n}function c(){}function l(t){this.head=t.head,this.tail=t.tail,this.len=t.len,this.next=t.states}function f(){this.len=0,this.head=new u(c,0,0),this.tail=this.head,this.states=null}var p=function(){return o.Buffer?function(){return(f.create=function(){return new r})()}:function(){return new f}};function h(t,e,n){e[n]=255&t}function d(t,e){this.len=t,this.next=void 0,this.val=e}function g(t,e,n){for(;t.hi;)e[n++]=127&t.lo|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[n++]=127&t.lo|128,t.lo=t.lo>>>7;e[n++]=t.lo}function b(t,e,n){e[n]=255&t,e[n+1]=t>>>8&255,e[n+2]=t>>>16&255,e[n+3]=t>>>24}f.create=p(),f.alloc=function(t){return new o.Array(t)},o.Array!==Array&&(f.alloc=o.pool(f.alloc,o.Array.prototype.subarray)),f.prototype._push=function(t,e,n){return this.tail=this.tail.next=new u(t,e,n),this.len+=e,this},d.prototype=Object.create(u.prototype),d.prototype.fn=function(t,e,n){for(;t>127;)e[n++]=127&t|128,t>>>=7;e[n]=t},f.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new d((t>>>=0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},f.prototype.int32=function(t){return t<0?this._push(g,10,i.fromNumber(t)):this.uint32(t)},f.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)},f.prototype.uint64=function(t){var e=i.from(t);return this._push(g,e.length(),e)},f.prototype.int64=f.prototype.uint64,f.prototype.sint64=function(t){var e=i.from(t).zzEncode();return this._push(g,e.length(),e)},f.prototype.bool=function(t){return this._push(h,1,t?1:0)},f.prototype.fixed32=function(t){return this._push(b,4,t>>>0)},f.prototype.sfixed32=f.prototype.fixed32,f.prototype.fixed64=function(t){var e=i.from(t);return this._push(b,4,e.lo)._push(b,4,e.hi)},f.prototype.sfixed64=f.prototype.fixed64,f.prototype.float=function(t){return this._push(o.float.writeFloatLE,4,t)},f.prototype.double=function(t){return this._push(o.float.writeDoubleLE,8,t)};var y=o.Array.prototype.set?function(t,e,n){e.set(t,n)}:function(t,e,n){for(var r=0;r<t.length;++r)e[n+r]=t[r]};f.prototype.bytes=function(t){var e=t.length>>>0;if(!e)return this._push(h,1,0);if(o.isString(t)){var n=f.alloc(e=a.length(t));a.decode(t,n,0),t=n}return this.uint32(e)._push(y,e,t)},f.prototype.string=function(t){var e=s.length(t);return e?this.uint32(e)._push(s.write,e,t):this._push(h,1,0)},f.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new u(c,0,0),this.len=0,this},f.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new u(c,0,0),this.len=0),this},f.prototype.ldelim=function(){var t=this.head,e=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=t.next,this.tail=e,this.len+=n),this},f.prototype.finish=function(){for(var t=this.head.next,e=this.constructor.alloc(this.len),n=0;t;)t.fn(t.val,e,n),n+=t.len,t=t.next;return e},f._configure=function(t){r=t,f.create=p(),r._configure()}},3155:function(t,e,n){"use strict";t.exports=i;var r=n(1173);(i.prototype=Object.create(r.prototype)).constructor=i;var o=n(9693);function i(){r.call(this)}function a(t,e,n){t.length<40?o.utf8.write(t,e,n):e.utf8Write?e.utf8Write(t,n):e.write(t,n)}i._configure=function(){i.alloc=o._Buffer_allocUnsafe,i.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&"set"===o.Buffer.prototype.set.name?function(t,e,n){e.set(t,n)}:function(t,e,n){if(t.copy)t.copy(e,n,0,t.length);else for(var r=0;r<t.length;)e[n++]=t[r++]}},i.prototype.bytes=function(t){o.isString(t)&&(t=o._Buffer_from(t,"base64"));var e=t.length>>>0;return this.uint32(e),e&&this._push(i.writeBytesBuffer,e,t),this},i.prototype.string=function(t){var e=o.Buffer.byteLength(t);return this.uint32(e),e&&this._push(a,e,t),this},i._configure()},7714:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.onnxjsBackend=void 0;var i=n(6919),a=n(7448),s=function(){function t(){}return t.prototype.init=function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2]}))}))},t.prototype.createSessionHandler=function(t,e){return r(this,void 0,void 0,(function(){var n;return o(this,(function(r){switch(r.label){case 0:return n=new i.Session(e),"string"!=typeof t?[3,2]:[4,n.loadModel(t)];case 1:return r.sent(),[3,4];case 2:return[4,n.loadModel(t)];case 3:r.sent(),r.label=4;case 4:return[2,new a.OnnxjsSessionHandler(n)]}}))}))},t}();e.onnxjsBackend=new s},4200:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.wasmBackend=e.initializeFlags=void 0;var i=n(8453),a=n(5381),s=n(2157),u=n(2306);e.initializeFlags=function(){if(("number"!=typeof i.env.wasm.initTimeout||i.env.wasm.initTimeout<0)&&(i.env.wasm.initTimeout=0),"boolean"!=typeof i.env.wasm.simd&&(i.env.wasm.simd=!0),"boolean"!=typeof i.env.wasm.proxy&&(i.env.wasm.proxy=!1),"number"!=typeof i.env.wasm.numThreads||!Number.isInteger(i.env.wasm.numThreads)||i.env.wasm.numThreads<=0){var t="undefined"==typeof navigator?(0,a.cpus)().length:navigator.hardwareConcurrency;i.env.wasm.numThreads=Math.min(4,Math.ceil((t||1)/2))}};var c=function(){function t(){}return t.prototype.init=function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return(0,e.initializeFlags)(),[4,(0,s.initWasm)()];case 1:return t.sent(),[2]}}))}))},t.prototype.createSessionHandler=function(t,e){return r(this,void 0,void 0,(function(){var n;return o(this,(function(r){switch(r.label){case 0:return[4,(n=new u.OnnxruntimeWebAssemblySessionHandler).loadModel(t,e)];case 1:return r.sent(),[2,Promise.resolve(n)]}}))}))},t}();e.wasmBackend=new c},6018:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(e,n);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,o)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),o(n(8453),e);var i=n(8453),a=n(7714).onnxjsBackend;(0,i.registerBackend)("webgl",a,-10);var s=n(4200).wasmBackend;(0,i.registerBackend)("cpu",s,10),(0,i.registerBackend)("wasm",s,10),(0,i.registerBackend)("xnnpack",s,9)},246:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createAttributeWithCacheKey=void 0;var n=function(){function t(t){Object.assign(this,t)}return Object.defineProperty(t.prototype,"cacheKey",{get:function(){var t=this;return this._cacheKey||(this._cacheKey=Object.getOwnPropertyNames(this).sort().map((function(e){return"".concat(t[e])})).join(";")),this._cacheKey},enumerable:!1,configurable:!0}),t}();e.createAttributeWithCacheKey=function(t){return new n(t)}},7778:function(t,e,n){"use strict";var r=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.Attribute=void 0;var o=n(1446),i=n(9395),a=n(9162),s=n(2517),u=i.onnxruntime.experimental.fbs,c=function(){function t(e){var n,i;if(this._attributes=new Map,null!=e){try{for(var a=r(e),s=a.next();!s.done;s=a.next()){var c=s.value;c instanceof o.onnx.AttributeProto?this._attributes.set(c.name,[t.getValue(c),t.getType(c)]):c instanceof u.Attribute&&this._attributes.set(c.name(),[t.getValue(c),t.getType(c)])}}catch(t){n={error:t}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}if(this._attributes.size<e.length)throw new Error("duplicated attribute names")}}return t.prototype.set=function(t,e,n){this._attributes.set(t,[n,e])},t.prototype.delete=function(t){this._attributes.delete(t)},t.prototype.getFloat=function(t,e){return this.get(t,"float",e)},t.prototype.getInt=function(t,e){return this.get(t,"int",e)},t.prototype.getString=function(t,e){return this.get(t,"string",e)},t.prototype.getTensor=function(t,e){return this.get(t,"tensor",e)},t.prototype.getFloats=function(t,e){return this.get(t,"floats",e)},t.prototype.getInts=function(t,e){return this.get(t,"ints",e)},t.prototype.getStrings=function(t,e){return this.get(t,"strings",e)},t.prototype.getTensors=function(t,e){return this.get(t,"tensors",e)},t.prototype.get=function(t,e,n){var r=this._attributes.get(t);if(void 0===r){if(void 0!==n)return n;throw new Error("required attribute not found: ".concat(t))}if(r[1]!==e)throw new Error("type mismatch: expected ".concat(e," but got ").concat(r[1]));return r[0]},t.getType=function(t){var e=t instanceof o.onnx.AttributeProto?t.type:t.type();switch(e){case o.onnx.AttributeProto.AttributeType.FLOAT:return"float";case o.onnx.AttributeProto.AttributeType.INT:return"int";case o.onnx.AttributeProto.AttributeType.STRING:return"string";case o.onnx.AttributeProto.AttributeType.TENSOR:return"tensor";case o.onnx.AttributeProto.AttributeType.FLOATS:return"floats";case o.onnx.AttributeProto.AttributeType.INTS:return"ints";case o.onnx.AttributeProto.AttributeType.STRINGS:return"strings";case o.onnx.AttributeProto.AttributeType.TENSORS:return"tensors";default:throw new Error("attribute type is not supported yet: ".concat(o.onnx.AttributeProto.AttributeType[e]))}},t.getValue=function(t){var e=t instanceof o.onnx.AttributeProto?t.type:t.type();if(e===o.onnx.AttributeProto.AttributeType.GRAPH||e===o.onnx.AttributeProto.AttributeType.GRAPHS)throw new Error("graph attribute is not supported yet");var n=this.getValueNoCheck(t);if(e===o.onnx.AttributeProto.AttributeType.INT&&s.LongUtil.isLong(n))return s.LongUtil.longToNumber(n);if(e===o.onnx.AttributeProto.AttributeType.INTS){for(var r=n,i=new Array(r.length),c=0;c<r.length;c++){var l=r[c];i[c]=s.LongUtil.longToNumber(l)}return i}if(e===o.onnx.AttributeProto.AttributeType.TENSOR)return t instanceof o.onnx.AttributeProto?a.Tensor.fromProto(n):a.Tensor.fromOrtTensor(n);if(e===o.onnx.AttributeProto.AttributeType.TENSORS){if(t instanceof o.onnx.AttributeProto)return n.map((function(t){return a.Tensor.fromProto(t)}));if(t instanceof u.Attribute)return n.map((function(t){return a.Tensor.fromOrtTensor(t)}))}if(e===o.onnx.AttributeProto.AttributeType.STRING&&t instanceof o.onnx.AttributeProto){var f=n;return(0,s.decodeUtf8String)(f)}return e===o.onnx.AttributeProto.AttributeType.STRINGS&&t instanceof o.onnx.AttributeProto?n.map(s.decodeUtf8String):n},t.getValueNoCheck=function(t){return t instanceof o.onnx.AttributeProto?this.getValueNoCheckFromOnnxFormat(t):this.getValueNoCheckFromOrtFormat(t)},t.getValueNoCheckFromOnnxFormat=function(t){switch(t.type){case o.onnx.AttributeProto.AttributeType.FLOAT:return t.f;case o.onnx.AttributeProto.AttributeType.INT:return t.i;case o.onnx.AttributeProto.AttributeType.STRING:return t.s;case o.onnx.AttributeProto.AttributeType.TENSOR:return t.t;case o.onnx.AttributeProto.AttributeType.GRAPH:return t.g;case o.onnx.AttributeProto.AttributeType.FLOATS:return t.floats;case o.onnx.AttributeProto.AttributeType.INTS:return t.ints;case o.onnx.AttributeProto.AttributeType.STRINGS:return t.strings;case o.onnx.AttributeProto.AttributeType.TENSORS:return t.tensors;case o.onnx.AttributeProto.AttributeType.GRAPHS:return t.graphs;default:throw new Error("unsupported attribute type: ".concat(o.onnx.AttributeProto.AttributeType[t.type]))}},t.getValueNoCheckFromOrtFormat=function(t){switch(t.type()){case u.AttributeType.FLOAT:return t.f();case u.AttributeType.INT:return t.i();case u.AttributeType.STRING:return t.s();case u.AttributeType.TENSOR:return t.t();case u.AttributeType.GRAPH:return t.g();case u.AttributeType.FLOATS:return t.floatsArray();case u.AttributeType.INTS:for(var e=[],n=0;n<t.intsLength();n++)e.push(t.ints(n));return e;case u.AttributeType.STRINGS:var r=[];for(n=0;n<t.stringsLength();n++)r.push(t.strings(n));return r;case u.AttributeType.TENSORS:var o=[];for(n=0;n<t.tensorsLength();n++)o.push(t.tensors(n));return o;default:throw new Error("unsupported attribute type: ".concat(u.AttributeType[t.type()]))}},t}();e.Attribute=c},7091:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}},i=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.resolveBackend=e.backend=void 0;var a=n(5038),s=new Map;function u(t){return r(this,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return void 0!==(n=e.backend)[t]&&(a=n[t],"initialize"in(u=a)&&"function"==typeof u.initialize&&"createSessionHandler"in u&&"function"==typeof u.createSessionHandler&&"dispose"in u&&"function"==typeof u.dispose)?(r=n[t],"object"==typeof(i=r.initialize())&&"then"in i?[4,i]:[3,2]):[3,3];case 1:i=o.sent(),o.label=2;case 2:if(i)return s.set(t,r),[2,r];o.label=3;case 3:return[2,void 0]}var a,u}))}))}e.backend={webgl:new a.WebGLBackend},e.resolveBackend=function t(e){return r(this,void 0,void 0,(function(){var n,r,a,c,l,f,p,h,d;return o(this,(function(o){switch(o.label){case 0:return e?[3,1]:[2,t(["webgl"])];case 1:n="string"==typeof e?[e]:e,o.label=2;case 2:o.trys.push([2,7,8,9]),r=i(n),a=r.next(),o.label=3;case 3:return a.done?[3,6]:(c=a.value,(l=s.get(c))?[2,l]:[4,u(c)]);case 4:if(f=o.sent())return[2,f];o.label=5;case 5:return a=r.next(),[3,3];case 6:return[3,9];case 7:return p=o.sent(),h={error:p},[3,9];case 8:try{a&&!a.done&&(d=r.return)&&d.call(r)}finally{if(h)throw h.error}return[7];case 9:throw new Error("no available backend to use")}}))}))}},5038:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WebGLBackend=void 0;var r=n(8453),o=n(6231),i=n(6416),a=n(7305),s=function(){function t(){}return Object.defineProperty(t.prototype,"contextId",{get:function(){return r.env.webgl.contextId},set:function(t){r.env.webgl.contextId=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"matmulMaxBatchSize",{get:function(){return r.env.webgl.matmulMaxBatchSize},set:function(t){r.env.webgl.matmulMaxBatchSize=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textureCacheMode",{get:function(){return r.env.webgl.textureCacheMode},set:function(t){r.env.webgl.textureCacheMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pack",{get:function(){return r.env.webgl.pack},set:function(t){r.env.webgl.pack=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"async",{get:function(){return r.env.webgl.async},set:function(t){r.env.webgl.async=t},enumerable:!1,configurable:!0}),t.prototype.initialize=function(){try{return this.glContext=(0,a.createWebGLContext)(this.contextId),"number"!=typeof this.matmulMaxBatchSize&&(this.matmulMaxBatchSize=16),"string"!=typeof this.textureCacheMode&&(this.textureCacheMode="full"),"boolean"!=typeof this.pack&&(this.pack=!1),"boolean"!=typeof this.async&&(this.async=!1),o.Logger.setWithEnv(r.env),o.Logger.verbose("WebGLBackend","Created WebGLContext: ".concat(typeof this.glContext," with matmulMaxBatchSize: ").concat(this.matmulMaxBatchSize,"; textureCacheMode: ").concat(this.textureCacheMode,"; pack: ").concat(this.pack,"; async: ").concat(this.async,".")),!0}catch(t){return o.Logger.warning("WebGLBackend","Unable to initialize WebGLBackend. ".concat(t)),!1}},t.prototype.createSessionHandler=function(t){return new i.WebGLSessionHandler(this,t)},t.prototype.dispose=function(){this.glContext.dispose()},t}();e.WebGLBackend=s},5107:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)},a=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(e,"__esModule",{value:!0}),e.CoordsGlslLib=void 0;var s=n(2517),u=n(8520),c=n(5060),l=n(7859),f=n(9390),p=function(t){function e(e){return t.call(this,e)||this}return o(e,t),e.prototype.getFunctions=function(){return i(i(i(i(i(i(i({},this.offsetToCoords()),this.coordsToOffset()),this.toVec()),this.valueFrom()),this.getCommonUtilFuncs()),this.getInputsSamplingSnippets()),this.getOutputSamplingSnippet())},e.prototype.getCustomTypes=function(){return{}},e.prototype.offsetToCoords=function(){return{offsetToCoords:new u.GlslLibRoutine("\n vec2 ".concat("offsetToCoords","(int offset, int width, int height) {\n int t = offset / width;\n int s = offset - t*width;\n vec2 coords = (vec2(s,t) + vec2(0.5,0.5)) / vec2(width, height);\n return coords;\n }\n "))}},e.prototype.coordsToOffset=function(){return{coordsToOffset:new u.GlslLibRoutine("\n int ".concat("coordsToOffset","(vec2 coords, int width, int height) {\n float s = coords.s * float(width);\n float t = coords.t * float(height);\n int offset = int(t) * width + int(s);\n return offset;\n }\n "))}},e.prototype.getOutputSamplingSnippet=function(){var t=this.context.outputTextureLayout;return t.isPacked?this.getPackedOutputSamplingSnippet(t):this.getUnpackedOutputSamplingSnippet(t)},e.prototype.getPackedOutputSamplingSnippet=function(t){var e=t.unpackedShape,n=[t.width,t.height],r={},o="getOutputCoords";switch(e.length){case 0:r[o]=this.getOutputScalarCoords();break;case 1:r[o]=this.getOutputPacked1DCoords(e,n);break;case 2:r[o]=this.getOutputPacked2DCoords(e,n);break;case 3:r[o]=this.getOutputPacked3DCoords(e,n);break;default:r[o]=this.getOutputPackedNDCoords(e,n)}var i=(0,c.getGlsl)(this.context.glContext.version),a="\n void setOutput(vec4 val) {\n ".concat(i.output," = val;\n }\n ");return r.floatTextureSetRGBA=new u.GlslLibRoutine(a),r},e.prototype.getUnpackedOutputSamplingSnippet=function(t){var e=t.unpackedShape,n=[t.width,t.height],r={},o="getOutputCoords";switch(e.length){case 0:r[o]=this.getOutputScalarCoords();break;case 1:r[o]=this.getOutputUnpacked1DCoords(e,n);break;case 2:r[o]=this.getOutputUnpacked2DCoords(e,n);break;case 3:r[o]=this.getOutputUnpacked3DCoords(e,n);break;case 4:r[o]=this.getOutputUnpacked4DCoords(e,n);break;case 5:r[o]=this.getOutputUnpacked5DCoords(e,n);break;case 6:r[o]=this.getOutputUnpacked6DCoords(e,n);break;default:throw new Error("Unsupported output dimensionality: ".concat(e.length))}var i=(0,c.getGlsl)(this.context.glContext.version),a="\n void setOutput(float val) {\n ".concat(i.output," = vec4(val, 0, 0, 0);\n }\n ");return r.floatTextureSetR=new u.GlslLibRoutine(a),r},e.prototype.getOutputScalarCoords=function(){return new u.GlslLibRoutine("\n int getOutputCoords() {\n return 0;\n }\n ")},e.prototype.getOutputPacked1DCoords=function(t,e){var n=e,r="";return 1===n[0]?(r="\n int getOutputCoords() {\n return 2 * int(TexCoords.y * ".concat(n[1],".0);\n }\n "),new u.GlslLibRoutine(r)):1===n[1]?(r="\n int getOutputCoords() {\n return 2 * int(TexCoords.x * ".concat(n[0],".0);\n }\n "),new u.GlslLibRoutine(r)):(r="\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(".concat(n[0],", ").concat(n[1],"));\n return 2 * (resTexRC.y * ").concat(n[0]," + resTexRC.x);\n }\n "),new u.GlslLibRoutine(r))},e.prototype.getOutputPacked2DCoords=function(t,e){var n="";if(s.ArrayUtil.arraysEqual(t,e))return n="\n ivec2 getOutputCoords() {\n return 2 * ivec2(TexCoords.xy * vec2(".concat(e[0],", ").concat(e[1],"));\n }\n "),new u.GlslLibRoutine(n);var r=e,o=Math.ceil(t[1]/2);return n="\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(".concat(r[0],", ").concat(r[1],"));\n\n int index = resTexRC.y * ").concat(r[0]," + resTexRC.x;\n\n // reverse r and c order for packed texture\n int r = imod(index, ").concat(o,") * 2;\n int c = 2 * (index / ").concat(o,");\n\n return ivec2(r, c);\n }\n "),new u.GlslLibRoutine(n)},e.prototype.getOutputPacked3DCoords=function(t,e){var n=[e[0],e[1]],r=Math.ceil(t[2]/2),o=r*Math.ceil(t[1]/2),i="\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(".concat(n[0],", ").concat(n[1],"));\n int index = resTexRC.y * ").concat(n[0]," + resTexRC.x;\n\n int b = index / ").concat(o,";\n index -= b * ").concat(o,";\n\n // reverse r and c order for packed texture\n int r = imod(index, ").concat(r,") * 2;\n int c = 2 * (index / ").concat(r,");\n\n return ivec3(b, r, c);\n }\n ");return new u.GlslLibRoutine(i)},e.prototype.getOutputPackedNDCoords=function(t,e){for(var n=[e[0],e[1]],r=Math.ceil(t[t.length-1]/2),o=r*Math.ceil(t[t.length-2]/2),i=o,a="",s="b, r, c",c=2;c<t.length-1;c++)i*=t[t.length-c-1],a="\n int b".concat(c," = index / ").concat(i,";\n index -= b").concat(c," * ").concat(i,";\n ")+a,s="b".concat(c,", ")+s;var l="\n ivec".concat(t.length," getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(").concat(n[0],", ").concat(n[1],"));\n int index = resTexRC.y * ").concat(n[0]," + resTexRC.x;\n\n ").concat(a,"\n\n int b = index / ").concat(o,";\n index -= b * ").concat(o,";\n\n // reverse r and c order for packed texture\n int r = imod(index, ").concat(r,") * 2;\n int c = 2 * (index / ").concat(r,");\n\n return ivec").concat(t.length,"(").concat(s,");\n }\n ");return new u.GlslLibRoutine(l)},e.prototype.getOutputUnpacked1DCoords=function(t,e){var n="\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(".concat(e[0],", ").concat(e[1],"));\n return resTexRC.y * ").concat(e[0]," + resTexRC.x;\n }\n ");return new u.GlslLibRoutine(n)},e.prototype.getOutputUnpacked2DCoords=function(t,e){var n="\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(".concat(e[0],", ").concat(e[1],"));\n int index = resTexRC.y * ").concat(e[0]," + resTexRC.x;\n int r = index / ").concat(t[1],";\n int c = index - r * ").concat(t[1],";\n return ivec2(r, c);\n }\n ");return new u.GlslLibRoutine(n)},e.prototype.getOutputUnpacked3DCoords=function(t,e){var n,r=t.length,o=null;r<2&&(o=[]),(o=new Array(r-1))[r-2]=t[r-1];for(var i=r-3;i>=0;--i)o[i]=o[i+1]*t[i+1];var a=["r","c","d"],s=o.map((function(t,e){var n="int ".concat(a[e]," = index / ").concat(t),r=e===o.length-1?"int ".concat(a[e+1]," = index - ").concat(a[e]," * ").concat(t):"index -= ".concat(a[e]," * ").concat(t);return"".concat(n,"; ").concat(r,";")})).join("");return n="\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(".concat(e[0],", ").concat(e[1],"));\n int index = resTexRC.y * ").concat(e[0]," + resTexRC.x;\n ").concat(s,"\n return ivec3(r, c, d);\n }\n "),new u.GlslLibRoutine(n)},e.prototype.getOutputUnpacked4DCoords=function(t,e){var n,r=t.length,o=null;r<2&&(o=[]),(o=new Array(r-1))[r-2]=t[r-1];for(var i=r-3;i>=0;--i)o[i]=o[i+1]*t[i+1];var a=["r","c","d","d2"],s=o.map((function(t,e){var n="int ".concat(a[e]," = index / ").concat(t),r=e===o.length-1?"int ".concat(a[e+1]," = index - ").concat(a[e]," * ").concat(t):"index -= ".concat(a[e]," * ").concat(t);return"".concat(n,"; ").concat(r,";")})).join("");return n="\n ivec4 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(".concat(e[0],", ").concat(e[1],"));\n int index = resTexRC.y * ").concat(e[0]," + resTexRC.x;\n ").concat(s,"\n return ivec4(r, c, d, d2);\n }\n "),new u.GlslLibRoutine(n)},e.prototype.getOutputUnpacked5DCoords=function(t,e){var n,r=t.length,o=null;r<2&&(o=[]),(o=new Array(r-1))[r-2]=t[r-1];for(var i=r-3;i>=0;--i)o[i]=o[i+1]*t[i+1];var a=["r","c","d","d2","d3"],s=o.map((function(t,e){var n="int ".concat(a[e]," = index / ").concat(t),r=e===o.length-1?"int ".concat(a[e+1]," = index - ").concat(a[e]," * ").concat(t):"index -= ".concat(a[e]," * ").concat(t);return"".concat(n,"; ").concat(r,";")})).join("");return n="\n ivec5 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(".concat(e[0],", ").concat(e[1],"));\n int index = resTexRC.y * ").concat(e[0]," + resTexRC.x;\n ").concat(s,"\n return ivec5(r, c, d, d2, d3);\n }\n "),new u.GlslLibRoutine(n)},e.prototype.getOutputUnpacked6DCoords=function(t,e){var n,r=t.length,o=null;r<2&&(o=[]),(o=new Array(r-1))[r-2]=t[r-1];for(var i=r-3;i>=0;--i)o[i]=o[i+1]*t[i+1];var a=["r","c","d","d2","d3","d4"],s=o.map((function(t,e){var n="int ".concat(a[e]," = index / ").concat(t),r=e===o.length-1?"int ".concat(a[e+1]," = index - ").concat(a[e]," * ").concat(t):"index -= ".concat(a[e]," * ").concat(t);return"".concat(n,"; ").concat(r,";")})).join("");return n="\n ivec6 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(".concat(e[0],", ").concat(e[1],"));\n int index = resTexRC.y * ").concat(e[0]," + resTexRC.x;\n ").concat(s,"\n return ivec6(r, c, d, d2, d3, d4);\n }\n "),new u.GlslLibRoutine(n)},e.prototype.getCommonUtilFuncs=function(){var t={},e="uvFromFlat";t[e]=new u.GlslLibRoutine("\n vec2 uvFromFlat(int texNumR, int texNumC, int index) {\n int texC = index / texNumR;\n int texR = index - texC * texNumR;\n // TODO: swap texR, texC order in following function so row is corresponding to u and column is corresponding to\n // v.\n return (vec2(texR, texC) + halfCR) / vec2(texNumR, texNumC);\n }\n "),t[e="packedUVfrom1D"]=new u.GlslLibRoutine("\n vec2 packedUVfrom1D(int texNumR, int texNumC, int index) {\n int texelIndex = index / 2;\n int texR = texelIndex / texNumC;\n int texC = texelIndex - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n }\n "),t[e="packedUVfrom2D"]=new u.GlslLibRoutine("\n vec2 packedUVfrom2D(int texNumR, int texNumC, int texelsInLogicalRow, int row, int col) {\n int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2);\n int texR = texelIndex / texNumC;\n int texC = texelIndex - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n }\n "),t[e="packedUVfrom3D"]=new u.GlslLibRoutine("\n vec2 packedUVfrom3D(int texNumR, int texNumC,\n int texelsInBatch, int texelsInLogicalRow, int b,\n int row, int col) {\n int index = b * texelsInBatch + (row / 2) * texelsInLogicalRow + (col / 2);\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n }\n "),e="sampleTexture";var n=(0,c.getGlsl)(this.context.glContext.version);return t[e]=new u.GlslLibRoutine("\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\n return ".concat(n.texture2D,"(textureSampler, uv).r;\n }")),t},e.prototype.getInputsSamplingSnippets=function(){var t=this,e={},n=this.context.outputTextureLayout;return this.context.programInfo.inputNames.forEach((function(r,o){var i=t.context.inputTextureLayouts[o],a=(0,f.generateShaderFuncNameFromInputSamplerName)(r);i.isPacked?e[a]=t.getPackedSamplerFromInput(a,r,i):e[a]=t.getUnpackedSamplerFromInput(a,r,i);var s=(0,f.generateShaderFuncNameFromInputSamplerNameAtOutCoords)(r);i.unpackedShape.length<=n.unpackedShape.length&&(i.isPacked?e[s]=t.getPackedSamplerAtOutputCoords(s,i,n,r):e[s]=t.getUnpackedSamplerAtOutputCoords(s,i,n,r))})),e},e.prototype.getPackedSamplerAtOutputCoords=function(t,e,n,r){var o,i=e.unpackedShape,a=n.unpackedShape,c=r,l=(0,f.generateShaderFuncNameFromInputSamplerName)(c),p=i.length,h=a.length,d=s.BroadcastUtil.getBroadcastDims(i,a),g=(0,f.getCoordsDataType)(h),b=h-p,y=(0,f.getGlChannels)();o=0===p?"":h<2&&d.length>=1?"coords = 0;":d.map((function(t){return"coords.".concat(y[t+b]," = 0;")})).join("\n");var m;m=h<2&&p>0?"coords":i.map((function(t,e){return"coords.".concat(y[e+b])})).join(", ");var v="return outputValue;",_=1===s.ShapeUtil.size(i),w=1===s.ShapeUtil.size(a);if(1!==p||_||w){if(_&&!w)v=1===h?"\n return vec4(outputValue.x, outputValue.x, 0., 0.);\n ":"\n return vec4(outputValue.x);\n ";else if(d.length){var x=p-2,T=p-1;d.indexOf(x)>-1&&d.indexOf(T)>-1?v="return vec4(outputValue.x);":d.indexOf(x)>-1?v="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":d.indexOf(T)>-1&&(v="return vec4(outputValue.xx, outputValue.zz);")}}else v="\n return vec4(outputValue.xy, outputValue.xy);\n ";var S="\n int lastDim = coords.".concat(y[h-1],";\n coords.").concat(y[h-1]," = coords.").concat(y[h-2],";\n coords.").concat(y[h-2]," = lastDim;\n "),O="\n vec4 ".concat(t,"() {\n ").concat(g," coords = getOutputCoords();\n ").concat(S,"\n ").concat(o,"\n vec4 outputValue = ").concat(l,"(").concat(m,");\n ").concat(v,"\n }\n ");return new u.GlslLibRoutine(O,["coordinates.getOutputCoords"])},e.prototype.getUnpackedSamplerAtOutputCoords=function(t,e,n,r){var o=[n.width,n.height],i=[e.width,e.height],a=e.unpackedShape.length,c=n.unpackedShape.length,l=e.unpackedShape,p=n.unpackedShape,h=(0,f.generateShaderFuncNameFromInputSamplerName)(r);if(a===c&&s.ArrayUtil.arraysEqual(i,o)){var d="\n float ".concat(t,"() {\n return sampleTexture(").concat(r,", TexCoords);\n }\n ");return new u.GlslLibRoutine(d,["coordinates.sampleTexture"])}var g,b=(0,f.getCoordsDataType)(c),y=s.BroadcastUtil.getBroadcastDims(l,p),m=c-a,v=(0,f.getGlChannels)();g=0===a?"":c<2&&y.length>=1?"coords = 0;":y.map((function(t){return"coords.".concat(v[t+m]," = 0;")})).join("\n");var _;_=c<2&&a>0?"coords":e.unpackedShape.map((function(t,e){return"coords.".concat(v[e+m])})).join(", ");var w="\n float ".concat(t,"() {\n ").concat(b," coords = getOutputCoords();\n ").concat(g,"\n return ").concat(h,"(").concat(_,");\n }\n ");return new u.GlslLibRoutine(w,["coordinates.getOutputCoords"])},e.prototype.getPackedSamplerFromInput=function(t,e,n){switch(n.unpackedShape.length){case 0:return this.getPackedSamplerScalar(t,e);case 1:return this.getPackedSampler1D(t,e,n);case 2:return this.getPackedSampler2D(t,e,n);case 3:return this.getPackedSampler3D(t,e,n);default:return this.getPackedSamplerND(t,e,n)}},e.prototype.getUnpackedSamplerFromInput=function(t,e,n){var r=n.unpackedShape;switch(r.length){case 0:return this.getUnpackedSamplerScalar(t,e,n);case 1:return this.getUnpackedSampler1D(t,e,n);case 2:return this.getUnpackedSampler2D(t,e,n);case 3:return this.getUnpackedSampler3D(t,e,n);case 4:return this.getUnpackedSampler4D(t,e,n);case 5:return this.getUnpackedSampler5D(t,e,n);case 6:return this.getUnpackedSampler6D(t,e,n);default:throw new Error("Unsupported dimension ".concat(r.length,"-D"))}},e.prototype.getPackedSamplerScalar=function(t,e){var n=(0,c.getGlsl)(this.context.glContext.version),r="\n vec4 ".concat(t,"() {\n return ").concat(n.texture2D,"(").concat(e,", halfCR);\n }\n ");return new u.GlslLibRoutine(r)},e.prototype.getPackedSampler1D=function(t,e,n){var r=[n.width,n.height],o=[r[1],r[0]],i=(0,c.getGlsl)(this.context.glContext.version),a="vec4 ".concat(t,"(int index) {\n vec2 uv = packedUVfrom1D(\n ").concat(o[0],", ").concat(o[1],", index);\n return ").concat(i.texture2D,"(").concat(e,", uv);\n }");return new u.GlslLibRoutine(a,["coordinates.packedUVfrom1D"])},e.prototype.getPackedSampler2D=function(t,e,n){var r=n.unpackedShape,o=[n.width,n.height],i=(0,c.getGlsl)(this.context.glContext.version),a=o[0],l=o[1];if(null!=o&&s.ArrayUtil.arraysEqual(r,o)){var f="vec4 ".concat(t,"(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2(").concat(l,".0, ").concat(a,".0);\n return ").concat(i.texture2D,"(").concat(e,", uv);\n }");return new u.GlslLibRoutine(f)}var p=o,h=Math.ceil(r[1]/2),d="vec4 ".concat(t,"(int row, int col) {\n vec2 uv = packedUVfrom2D(").concat(p[1],", ").concat(p[0],", ").concat(h,", row, col);\n return ").concat(i.texture2D,"(").concat(e,", uv);\n }");return new u.GlslLibRoutine(d,["coordinates.packedUVfrom2D"])},e.prototype.getPackedSampler3D=function(t,e,n){var r=n.unpackedShape,o=[n.width,n.height],i=[o[0],o[1]],a=(0,c.getGlsl)(this.context.glContext.version);if(1===r[0]){var s=r.slice(1),l=(0,f.squeezeInputShape)(r,s),p=JSON.parse(JSON.stringify(n));p.unpackedShape=l;var h=this.getPackedSamplerFromInput(t,e,p),d="".concat(h.routineBody,"\n vec4 ").concat(t,"(int b, int row, int col) {\n return ").concat(t,"(").concat((0,f.getSqueezedParams)(["b","row","col"],[1,2]),");\n } ");return new u.GlslLibRoutine(d,h.dependencies)}var g=i[0],b=i[1],y=Math.ceil(r[2]/2),m=y*Math.ceil(r[1]/2),v="vec4 ".concat(t,"(int b, int row, int col) {\n vec2 uv = packedUVfrom3D(\n ").concat(b,", ").concat(g,", ").concat(m,", ").concat(y,", b, row, col);\n return ").concat(a.texture2D,"(").concat(e,", uv);}");return new u.GlslLibRoutine(v,["coordinates.packedUVfrom3D"])},e.prototype.getPackedSamplerND=function(t,e,n){for(var r=n.unpackedShape,o=r.length,i=[n.width,n.height],a=(0,c.getGlsl)(this.context.glContext.version),s=[i[0],i[1]],l=s[1],f=s[0],p=Math.ceil(r[o-1]/2),h=p*Math.ceil(r[o-2]/2),d="int b, int row, int col",g="b * ".concat(h," + (row / 2) * ").concat(p," + (col / 2)"),b=2;b<o-1;b++)d="int b".concat(b,", ")+d,h*=r[o-b-1],g="b".concat(b," * ").concat(h," + ")+g;var y="vec4 ".concat(t,"(").concat(d,") {\n int index = ").concat(g,";\n int texR = index / ").concat(f,";\n int texC = index - texR * ").concat(f,";\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(").concat(f,", ").concat(l,");\n return ").concat(a.texture2D,"(").concat(e,", uv);\n }");return new u.GlslLibRoutine(y)},e.prototype.getUnpackedSamplerScalar=function(t,e,n){var r=a([n.width,n.height],2),o=r[0],i=r[1];if(1===o&&1===i){var s="\n float ".concat(t,"() {\n return sampleTexture(").concat(e,", halfCR);\n }\n ");return new u.GlslLibRoutine(s,["coordinates.sampleTexture"])}var c="\n float ".concat(t,"() {\n int offset_").concat(e," = coordsToOffset(TexCoords, ").concat(o,", ").concat(i,");\n vec2 uv = uvFromFlat(").concat(o,", ").concat(i,", offset_").concat(e,");\n return sampleTexture(").concat(e,", uv);\n }\n ");return new u.GlslLibRoutine(c,["coordinates.uvFromFlat","coordinates.sampleTexture","coordinates.coordsToOffset"])},e.prototype.getUnpackedSampler1D=function(t,e,n){var r=n.width,o=n.height;if(1===o&&1===r){var i="\n float ".concat(t,"(int index) {\n return sampleTexture(").concat(e,", halfCR);\n }\n ");return new u.GlslLibRoutine(i,["coordinates.sampleTexture"])}if(1===o){var a="\n float ".concat(t,"(int index) {\n vec2 uv = vec2((float(index) + 0.5) / ").concat(r,".0, 0.5);\n return sampleTexture(").concat(e,", uv);\n }\n ");return new u.GlslLibRoutine(a,["coordinates.sampleTexture"])}if(1===r){var s="\n float ".concat(t,"(int index) {\n vec2 uv = vec2(0.5, (float(index) + 0.5) / ").concat(o,".0);\n return sampleTexture(").concat(e,", uv);\n }\n ");return new u.GlslLibRoutine(s,["coordinates.sampleTexture"])}var c="\n float ".concat(t,"(int index) {\n vec2 uv = uvFromFlat(").concat(r,", ").concat(o,", index);\n return sampleTexture(").concat(e,", uv);\n }\n ");return new u.GlslLibRoutine(c,["coordinates.uvFromFlat","coordinates.sampleTexture"])},e.prototype.getUnpackedSampler2D=function(t,e,n){var r=n.unpackedShape,o=[n.height,n.width];if(null!=o&&s.ArrayUtil.arraysEqual(r,o)){var i=o[1],a=o[0],c="\n float ".concat(t,"(int row, int col) {\n vec2 uv = (vec2(row, col) + halfCR) / vec2(").concat(i,".0, ").concat(a,".0);\n return sampleTexture(").concat(e,", uv);\n }\n ");return new u.GlslLibRoutine(c,["coordinates.sampleTexture"])}var p=(0,l.squeezeShape)(r),h=p.newShape,d=p.keptDims,g=h;if(g.length<r.length){var b=(0,f.squeezeInputShape)(r,g),y=JSON.parse(JSON.stringify(n));y.unpackedShape=b;var m="\n ".concat(this.getUnpackedSamplerFromInput(t,e,y).routineBody,"\n float ").concat(t,"(int row, int col) {\n return ").concat(t,"(").concat((0,f.getSqueezedParams)(["col","row"],d),");\n }\n ");return new u.GlslLibRoutine(m,["coordinates.sampleTexture"])}var v=o[1],_=o[0];if(1===_){var w="\n float ".concat(t,"(int row, int col) {\n int offset_").concat(e," = coordsToOffset(TexCoords, ").concat(v,", ").concat(_,");\n float index = dot(vec3(row, col, offset_").concat(e,"), vec3(").concat(r[1],", 1, 1));\n vec2 uv = vec2(0.5, (index + 0.5) / ").concat(v,".0);\n return sampleTexture(").concat(e,", uv);\n }\n ");return new u.GlslLibRoutine(w,["coordinates.sampleTexture","coordinates.coordsToOffset"])}if(1===v){var x="\n float ".concat(t,"(int row, int col) {\n int offset_").concat(e," = coordsToOffset(TexCoords, ").concat(v,", ").concat(_,");\n float index = dot(vec3(row, col, offset_").concat(e,"), vec3(").concat(r[1],", 1, 1));\n vec2 uv = vec2((index + 0.5) / ").concat(_,".0, 0.5);\n return sampleTexture(").concat(e,", uv);\n }\n ");return new u.GlslLibRoutine(x,["coordinates.sampleTexture","coordinates.coordsToOffset"])}var T="\n float ".concat(t,"(int row, int col) {\n int index = col * ").concat(r[1]," + row;\n vec2 uv = uvFromFlat(").concat(v,", ").concat(_,", index);\n return sampleTexture(").concat(e,", uv);\n }\n ");return new u.GlslLibRoutine(T,["coordinates.uvFromFlat","coordinates.sampleTexture","coordinates.coordsToOffset"])},e.prototype.getUnpackedSampler3D=function(t,e,n){var r=n.unpackedShape,o=r[1]*r[2],i=r[2],a=(0,l.squeezeShape)(r),s=a.newShape,c=a.keptDims,p=s;if(p.length<r.length){var h=(0,f.squeezeInputShape)(r,p),d=JSON.parse(JSON.stringify(n));d.unpackedShape=h;var g=this.getUnpackedSamplerFromInput(t,e,d),b=c.reverse(),y="\n ".concat(g.routineBody,"\n float ").concat(t,"(int batch, int row, int col) {\n return ").concat(t,"(").concat((0,f.getSqueezedParams)(["batch","col","row"],b),");\n }\n ");return new u.GlslLibRoutine(y,g.dependencies)}var m=n.width,v=n.height,_="\n float ".concat(t,"(int depth, int row, int col) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = depth * ").concat(o," + col * ").concat(i," + row;\n vec2 uv = uvFromFlat(").concat(m,", ").concat(v,", index);\n return sampleTexture(").concat(e,", uv);\n }\n ");return new u.GlslLibRoutine(_,["coordinates.uvFromFlat","coordinates.sampleTexture","coordinates.coordsToOffset"])},e.prototype.getUnpackedSampler4D=function(t,e,n){var r=n.unpackedShape,o=r[3],i=r[2]*o,a=r[1]*i,s=n.width,c=n.height,l="\n float ".concat(t,"(int row, int col, int depth, int depth2) {\n int index = row * ").concat(a," + col * ").concat(i," +\n depth2 * ").concat(o," + depth;\n vec2 uv = uvFromFlat(").concat(s,", ").concat(c,", index);\n return sampleTexture(").concat(e,", uv);\n }\n ");return new u.GlslLibRoutine(l,["coordinates.uvFromFlat","coordinates.sampleTexture"])},e.prototype.getUnpackedSampler5D=function(t,e,n){var r=n.unpackedShape,o=r[4],i=r[3]*o,a=r[2]*i,s=r[1]*a,c=(0,l.squeezeShape)(r),p=c.newShape,h=c.keptDims;if(p.length<r.length){var d=(0,f.squeezeInputShape)(r,p),g=JSON.parse(JSON.stringify(n));g.unpackedShape=d;var b="\n ".concat(this.getUnpackedSamplerFromInput(t,e,g).routineBody,"\n float ").concat(t,"(int row, int col, int depth, int depth2, int depth3) {\n return ").concat(t,"(").concat((0,f.getSqueezedParams)(["row","col","depth","depth2","depth3"],h),");\n }\n ");return new u.GlslLibRoutine(b,["coordinates.sampleTexture","coordinates.uvFromFlat"])}var y=n.width,m=n.height,v="\n float ".concat(t,"(int row, int col, int depth, int depth2, int depth3) {\n int index = row * ").concat(s," + col * ").concat(a," + depth * ").concat(i," +\n depth3 * ").concat(o," + depth2;\n vec2 uv = uvFromFlat(").concat(y,", ").concat(m,", index);\n return sampleTexture(").concat(e,", uv);\n }\n ");return new u.GlslLibRoutine(v,["coordinates.sampleTexture","coordinates.uvFromFlat"])},e.prototype.getUnpackedSampler6D=function(t,e,n){var r=n.unpackedShape,o=r[5],i=r[4]*o,a=r[3]*i,s=r[2]*a,c=r[1]*s,p=(0,l.squeezeShape)(r),h=p.newShape,d=p.keptDims;if(h.length<r.length){var g=(0,f.squeezeInputShape)(r,h),b=JSON.parse(JSON.stringify(n));b.unpackedShape=g;var y="\n ".concat(this.getUnpackedSamplerFromInput(t,e,b).routineBody,"\n float ").concat(t,"(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n return ").concat(t,"(").concat((0,f.getSqueezedParams)(["row","col","depth","depth2","depth3","depth4"],d),");\n }\n ");return new u.GlslLibRoutine(y,["coordinates.sampleTexture","coordinates.uvFromFlat"])}var m=n.width,v=n.height,_="\n float ".concat(t,"(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n int index = row * ").concat(c," + col * ").concat(s," + depth * ").concat(a," +\n depth2 * ").concat(i," + depth3 * ").concat(o," + depth4;\n vec2 uv = uvFromFlat(").concat(m,", ").concat(v,", index);\n return sampleTexture(").concat(e,", uv);\n }\n ");return new u.GlslLibRoutine(_,["coordinates.uvFromFlat","coordinates.sampleTexture","coordinates.coordsToOffset"])},e.prototype.toVec=function(){for(var t=this.context.outputTextureLayout,e=t.shape.length,n=t.strides,r=t.width,o=t.height,i=[],a=0;a<e-1;++a)i.push("\n c[".concat(a,"] = offset / ").concat(n[a],";")),i.push("\n offset -= c[".concat(a,"] * ").concat(n[a],";"));i.push("\n c[".concat(e-1,"] = offset;"));var s="\n void toVec(vec2 texCoords, out int c[".concat(e,"]) {\n int offset = coordsToOffset(texCoords, ").concat(r,", ").concat(o,");\n ").concat(i.join(""),"\n }\n void toVec(int offset, out int c[").concat(e,"]) {\n ").concat(i.join(""),"\n }\n ");return{toVec:new u.GlslLibRoutine(s,["coordinates.coordsToOffset"])}},e.prototype.valueFrom=function(){var t=this,e={};return this.context.programInfo.inputNames.forEach((function(n,r){var o=t.context.inputTextureLayouts[r],i=(o.unpackedShape.length>0?o.unpackedShape:o.shape).length,a="_".concat(n);e[a]=new u.GlslLibRoutine(t.getValueFromSingle(n,i,o.width,o.height,!1),["shapeUtils.indicesToOffset".concat(a),"coordinates.offsetToCoords","fragcolor.getColorAsFloat"]),e[a+="_T"]=new u.GlslLibRoutine(t.getValueFromSingle(n,i,o.width,o.height,!0),["shapeUtils.indicesToOffset".concat(a),"coordinates.offsetToCoords","fragcolor.getColorAsFloat"])})),e},e.prototype.getValueFromSingle=function(t,e,n,r,o){var i="_".concat(t);o&&(i+="_T");var a=(0,c.getGlsl)(this.context.glContext.version);return"\n float ".concat(i,"(int m[").concat(e,"]) {\n int offset = indicesToOffset").concat(i,"(m);\n vec2 coords = offsetToCoords(offset, ").concat(n,", ").concat(r,");\n float value = getColorAsFloat(").concat(a.texture2D,"(").concat(t,", coords));\n return value;\n }\n ")},e.prototype.getPackedValueFrom=function(t,e,n,r,o){var i="_".concat(t,"_Pack");o&&(i+="_T");var a=(0,c.getGlsl)(this.context.glContext.version);return"\n vec4 ".concat(i,"(int m[").concat(e,"]) {\n int offset = indicesToOffset_").concat(t,"(m);\n vec2 coords = offsetToCoords(offset, ").concat(n,", ").concat(r,");\n return ").concat(a.texture2D,"(").concat(t,", coords);\n }\n ")},e}(u.GlslLib);e.CoordsGlslLib=p},8520:function(t,e){"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.TopologicalSortGlslRoutines=e.GlslLibRoutineNode=e.GlslLibRoutine=e.GlslLib=e.GlslContext=e.FunctionType=void 0,(n=e.FunctionType||(e.FunctionType={}))[n.ValueBased=0]="ValueBased",n[n.Positional=1]="Positional";e.GlslContext=function(t,e,n,r){this.glContext=t,this.programInfo=e,this.inputTextureLayouts=n,this.outputTextureLayout=r};e.GlslLib=function(t){this.context=t};e.GlslLibRoutine=function(t,e){this.routineBody=t,this.dependencies=e};var r=function(){function t(t,e,n){this.name=t,this.dependencies=n||[],e&&(this.routineBody=e)}return t.prototype.addDependency=function(t){t&&this.dependencies.push(t)},t}();e.GlslLibRoutineNode=r;var o=function(){function t(){}return t.returnOrderedNodes=function(t){if(!t||0===t.length)return[];if(1===t.length)return t;var e=new Set,n=new Set,r=new Array;return this.createOrderedNodes(t,e,n,r),r},t.createOrderedNodes=function(t,e,n,r){for(var o=0;o<t.length;++o)this.dfsTraverse(t[o],e,n,r)},t.dfsTraverse=function(t,e,n,r){if(t&&!n.has(t.name)){if(e.has(t.name))throw new Error("Cyclic dependency detected. Can't topologically sort routines needed for shader.");e.add(t.name);var o=t.dependencies;if(o&&o.length>0)for(var i=0;i<o.length;++i)this.dfsTraverse(o[i],e,n,r);r.push(t),n.add(t.name),e.delete(t.name)}},t}();e.TopologicalSortGlslRoutines=o},7341:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.EncodingGlslLib=void 0;var a=n(8520),s=function(t){function e(e){return t.call(this,e)||this}return o(e,t),e.prototype.getFunctions=function(){return i(i({},this.encodeFloat32()),this.decodeFloat32())},e.prototype.getCustomTypes=function(){return{}},e.prototype.encodeFloat32=function(){return{encode:new a.GlslLibRoutine("highp vec4 encode(highp float f) {\n return vec4(f, 0.0, 0.0, 0.0);\n }\n ")}},e.prototype.decodeFloat32=function(){return{decode:new a.GlslLibRoutine("highp float decode(highp vec4 rgba) {\n return rgba.r;\n }\n ")}},e.prototype.encodeUint8=function(){var t=e.isLittleEndian()?"rgba.rgba=rgba.abgr;":"";return{encode:new a.GlslLibRoutine("\n highp vec4 encode(highp float f) {\n highp float F = abs(f);\n highp float Sign = step(0.0,-f);\n highp float Exponent = floor(log2(F));\n highp float Mantissa = (exp2(- Exponent) * F);\n Exponent = floor(log2(F) + 127.0) + floor(log2(Mantissa));\n highp vec4 rgba;\n rgba[0] = 128.0 * Sign + floor(Exponent*exp2(-1.0));\n rgba[1] = 128.0 * mod(Exponent,2.0) + mod(floor(Mantissa*128.0),128.0);\n rgba[2] = floor(mod(floor(Mantissa*exp2(23.0 -8.0)),exp2(8.0)));\n rgba[3] = floor(exp2(23.0)*mod(Mantissa,exp2(-15.0)));\n ".concat(t,"\n rgba = rgba / 255.0; // values need to be normalized to [0,1]\n return rgba;\n }\n "))}},e.prototype.decodeUint8=function(){var t=e.isLittleEndian()?"rgba.rgba=rgba.abgr;":"";return{decode:new a.GlslLibRoutine("\n highp float decode(highp vec4 rgba) {\n rgba = rgba * 255.0; // values need to be de-normalized from [0,1] to [0,255]\n ".concat(t,"\n highp float Sign = 1.0 - step(128.0,rgba[0])*2.0;\n highp float Exponent = 2.0 * mod(rgba[0],128.0) + step(128.0,rgba[1]) - 127.0;\n highp float Mantissa = mod(rgba[1],128.0)*65536.0 + rgba[2]*256.0 +rgba[3] + float(0x800000);\n highp float Result = Sign * exp2(Exponent) * (Mantissa * exp2(-23.0 ));\n return Result;\n }\n "))}},e.isLittleEndian=function(){var t=new ArrayBuffer(4),e=new Uint32Array(t),n=new Uint8Array(t);if(e[0]=3735928559,239===n[0])return!0;if(222===n[0])return!1;throw new Error("unknown endianness")},e}(a.GlslLib);e.EncodingGlslLib=s},9894:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.FragColorGlslLib=void 0;var a=n(8520),s=n(5060),u=function(t){function e(e){return t.call(this,e)||this}return o(e,t),e.prototype.getFunctions=function(){return i(i({},this.setFragColor()),this.getColorAsFloat())},e.prototype.getCustomTypes=function(){return{}},e.prototype.setFragColor=function(){var t=(0,s.getGlsl)(this.context.glContext.version);return{setFragColor:new a.GlslLibRoutine("\n void setFragColor(float value) {\n ".concat(t.output," = encode(value);\n }\n "),["encoding.encode"])}},e.prototype.getColorAsFloat=function(){return{getColorAsFloat:new a.GlslLibRoutine("\n float getColorAsFloat(vec4 color) {\n return decode(color);\n }\n ",["encoding.decode"])}},e}(a.GlslLib);e.FragColorGlslLib=u},2848:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.replaceInlines=void 0;var n=/@inline[\s\n\r]+(\w+)[\s\n\r]+([0-9a-zA-Z_]+)\s*\(([^)]*)\)\s*{(([^}]|[\n\r])*)}/gm;e.replaceInlines=function(t){for(var e,r={};null!==(e=n.exec(t));){var o=e[3].split(",").map((function(t){var e=t.trim().split(" ");return e&&2===e.length?{type:e[0],name:e[1]}:null})).filter((function(t){return null!==t}));r[e[2]]={params:o,body:e[4]}}for(var i in r)for(var a="(\\w+)?\\s+([_0-9a-zA-Z]+)\\s+=\\s+__FUNC__\\((.*)\\)\\s*;".replace("__FUNC__",i),s=new RegExp(a,"gm"),u=function(){var n=e[1],o=e[2],a=e[3].split(","),s=n?"".concat(n," ").concat(o,";"):"",u=r[i].body,c="";r[i].params.forEach((function(t,e){t&&(c+="".concat(t.type," ").concat(t.name," = ").concat(a[e],";\n"))})),u=(u="".concat(c,"\n ").concat(u)).replace("return","".concat(o," = "));var l="\n ".concat(s,"\n {\n ").concat(u,"\n }\n ");t=t.replace(e[0],l)};null!==(e=s.exec(t));)u();return t=t.replace(n,"")}},8879:function(t,e,n){"use strict";var r=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.GlslPreprocessor=void 0;var o=n(8520),i=n(2848),a=n(5483),s=n(5060),u=function(){function t(t,e,n,r){var i=this;this.libs={},this.glslLibRoutineDependencyGraph={},this.context=new o.GlslContext(t,e,n,r),Object.keys(a.glslRegistry).forEach((function(t){var e=new a.glslRegistry[t](i.context);i.libs[t]=e}));var s=this.glslLibRoutineDependencyGraph;for(var u in this.libs){var c=this.libs[u].getFunctions();for(var l in c){var f=u+"."+l,p=void 0;s[f]?(p=s[f]).routineBody=c[l].routineBody:(p=new o.GlslLibRoutineNode(f,c[l].routineBody),s[f]=p);var h=c[l].dependencies;if(h)for(var d=0;d<h.length;++d)if(s[h[d]])p.addDependency(s[h[d]]);else{var g=new o.GlslLibRoutineNode(h[d]);s[h[d]]=g,p.addDependency(g)}}}}return t.prototype.preprocess=function(){var t=this.context.programInfo,e=t.shaderSource;return this.context.programInfo.hasMain||(e="".concat(e,"\n ").concat((0,s.getDefaultFragShaderMain)(this.context.glContext.version,this.context.outputTextureLayout.shape.length))),e=(0,i.replaceInlines)(e),"".concat((0,s.getFragShaderPreamble)(this.context.glContext.version),"\n ").concat(this.getUniforms(t.inputNames,t.variables),"\n ").concat(this.getImports(e),"\n ").concat(e)},t.prototype.getImports=function(t){var e=this.selectGlslLibRoutinesToBeIncluded(t);if(0===e.length)return"";for(var n="",r=0;r<e.length;++r){if(!e[r].routineBody)throw new Error("Missing body for the Glsl Library routine: ".concat(e[r].name));n+=e[r].routineBody+"\n"}return n},t.prototype.selectGlslLibRoutinesToBeIncluded=function(t){var e=this,n=[];return Object.keys(this.glslLibRoutineDependencyGraph).forEach((function(r){var o=r.split(".")[1];-1!==t.indexOf(o)&&n.push(e.glslLibRoutineDependencyGraph[r])})),o.TopologicalSortGlslRoutines.returnOrderedNodes(n)},t.prototype.getUniforms=function(t,e){var n,o,i,a,s=[];if(t)try{for(var u=r(t),c=u.next();!c.done;c=u.next()){var l=c.value;s.push("uniform sampler2D ".concat(l,";"))}}catch(t){n={error:t}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(n)throw n.error}}if(e)try{for(var f=r(e),p=f.next();!p.done;p=f.next()){var h=p.value;s.push("uniform ".concat(h.type," ").concat(h.name).concat(h.arrayLength?"[".concat(h.arrayLength,"]"):"",";"))}}catch(t){i={error:t}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}return s.join("\n")},t}();e.GlslPreprocessor=u},5483:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.glslRegistry=void 0;var r=n(5107),o=n(7341),i=n(9894),a=n(2655),s=n(3891);e.glslRegistry={encoding:o.EncodingGlslLib,fragcolor:i.FragColorGlslLib,vec:s.VecGlslLib,shapeUtils:a.ShapeUtilsGlslLib,coordinates:r.CoordsGlslLib}},2655:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeUtilsGlslLib=void 0;var a=n(8520),s=function(t){function e(e){return t.call(this,e)||this}return o(e,t),e.prototype.getFunctions=function(){return i(i(i(i(i({},this.bcastIndex()),this.bcastMatmulIndex()),this.offsetToIndices()),this.indicesToOffset()),this.incrementIndices())},e.prototype.getCustomTypes=function(){return{}},e.prototype.bcastIndex=function(){var t=this,e=this.context.outputTextureLayout.shape.length,n={};return this.context.programInfo.inputNames.forEach((function(r,o){var i=t.context.inputTextureLayouts[o].unpackedShape;if(i.length<=e){for(var s=i.length,u=e-s,c="bcastIndices_".concat(r),l="",f=0;f<s;++f)l+="\n realIndices[".concat(f,"] = int( mod(float(bcastedIndices[").concat(u+f,"]), ").concat(i[f],".0) );\n ");var p="\n void ".concat(c," (int bcastedIndices[").concat(e,"], out int realIndices[").concat(s,"]) {\n ").concat(l,"\n }\n ");n[c]=new a.GlslLibRoutine(p)}})),n},e.prototype.bcastMatmulIndex=function(){var t=this,e=this.context.outputTextureLayout.shape.length,n={};return this.context.programInfo.inputNames.forEach((function(r,o){var i=t.context.inputTextureLayouts[o].shape;if(!(i.length<2||i.length>e)){for(var s=i.length,u=e-s,c="bcastMatmulIndices_".concat(r),l="",f=0;f<s-2;++f)l+="\n realIndices[".concat(f,"] = int( mod(float(bcastedIndices[").concat(u+f,"]), ").concat(i[f],".0) );\n ");var p="\n void ".concat(c,"(int bcastedIndices[").concat(e,"], out int realIndices[").concat(s,"]) {\n ").concat(l,"\n realIndices[").concat(s-1,"] = bcastedIndices[").concat(e-1,"];\n realIndices[").concat(s-2,"] = bcastedIndices[").concat(e-2,"];\n }\n ");n[c]=new a.GlslLibRoutine(p)}})),n},e.prototype.indicesToOffset=function(){var t=this,n={};return this.context.programInfo.inputNames.forEach((function(r,o){var i=t.context.inputTextureLayouts[o].shape,s=t.context.inputTextureLayouts[o].strides,u=i.length,c="indicesToOffset_".concat(r);n[c]=new a.GlslLibRoutine(e.indexToOffsetSingle(c,u,s)),c="indicesToOffset_".concat(r,"_T"),n[c]=new a.GlslLibRoutine(e.indexToOffsetSingle(c,u,s.slice().reverse()))})),n},e.indexToOffsetSingle=function(t,e,n){for(var r="",o=e-1;o>=0;--o)r+="\n offset += indices[".concat(o,"] * ").concat(n[o],";\n ");return"\n int ".concat(t,"(int indices[").concat(e,"]) {\n int offset = 0;\n ").concat(r,"\n return offset;\n }\n ")},e.prototype.offsetToIndices=function(){var t=this,n={};return this.context.programInfo.inputNames.forEach((function(r,o){var i=t.context.inputTextureLayouts[o].shape,s=t.context.inputTextureLayouts[o].strides,u=i.length,c="offsetToIndices_".concat(r);n[c]=new a.GlslLibRoutine(e.offsetToIndicesSingle(c,u,s)),c="offsetToIndices_".concat(r,"_T"),n[c]=new a.GlslLibRoutine(e.offsetToIndicesSingle(c,u,s.slice().reverse()))})),n},e.offsetToIndicesSingle=function(t,e,n){for(var r=[],o=0;o<e-1;++o)r.push("\n indices[".concat(o,"] = offset / ").concat(n[o],";")),r.push("\n offset -= indices[".concat(o,"] * ").concat(n[o],";"));return r.push("\n indices[".concat(e-1,"] = offset;")),"\n void ".concat(t,"(int offset, out int indices[").concat(e,"]) {\n ").concat(r.join(""),"\n }\n ")},e.prototype.incrementIndices=function(){var t=this,e={};return this.context.programInfo.inputNames.forEach((function(n,r){for(var o=t.context.inputTextureLayouts[r].shape,i=o.length,s="incrementIndices_".concat(n),u="",c=0;c<i;++c)u+="\n shape[".concat(c,"] = ").concat(o[c],";");var l="\n void ".concat(s,"(int axis, out int indices[").concat(i,"]) {\n int shape[").concat(i,"];\n ").concat(u,";\n for(int i = ").concat(i," -1 ; i >= 0; --i) {\n if(i > axis) continue;\n indices[i] += 1;\n if(indices[i] < shape[i]) {\n break;\n }\n indices[i] = 0;\n }\n }\n ");e[s]=new a.GlslLibRoutine(l)})),e},e}(a.GlslLib);e.ShapeUtilsGlslLib=s},5060:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getDefaultFragShaderMain=e.getFragShaderPreamble=e.getVertexShaderSource=e.getGlsl=void 0;var n={version:"",attribute:"attribute",varyingVertex:"varying",varyingFrag:"varying",texture2D:"texture2D",output:"gl_FragColor",outputDeclaration:""},r={version:"#version 300 es",attribute:"in",varyingVertex:"out",varyingFrag:"in",texture2D:"texture",output:"outputColor",outputDeclaration:"out vec4 outputColor;"};function o(t){return 1===t?n:r}e.getGlsl=o,e.getVertexShaderSource=function(t){var e=o(t);return"".concat(e.version,"\n precision highp float;\n ").concat(e.attribute," vec3 position;\n ").concat(e.attribute," vec2 textureCoord;\n\n ").concat(e.varyingVertex," vec2 TexCoords;\n\n void main()\n {\n gl_Position = vec4(position, 1.0);\n TexCoords = textureCoord;\n }")},e.getFragShaderPreamble=function(t){var e=o(t);return"".concat(e.version,"\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n ").concat(e.varyingFrag," vec2 TexCoords;\n ").concat(e.outputDeclaration,"\n const vec2 halfCR = vec2(0.5, 0.5);\n\n // Custom vector types to handle higher dimenalities.\n struct ivec5\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n };\n\n struct ivec6\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n int v;\n };\n\n int imod(int x, int y) {\n return x - y * (x / y);\n }\n\n ")},e.getDefaultFragShaderMain=function(t,e){var n=o(t);return"\n void main() {\n int indices[".concat(e,"];\n toVec(TexCoords, indices);\n vec4 result = vec4(process(indices));\n ").concat(n.output," = result;\n }\n ")}},3891:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.VecGlslLib=void 0;var a=n(8520),s=function(t){function e(e){return t.call(this,e)||this}return o(e,t),e.prototype.getCustomTypes=function(){return{}},e.prototype.getFunctions=function(){return i(i(i(i({},this.binaryVecFunctions()),this.copyVec()),this.setVecItem()),this.getVecItem())},e.prototype.binaryVecFunctions=function(){var t=this.context.outputTextureLayout.shape.length,e={add:"+=",sub:"-=",mul:"*=",div:"/="},n={};for(var r in e){for(var o="".concat(r,"Vec"),i="",s=0;s<t;++s)i+="\n dest[".concat(s,"] ").concat(e[r]," src[").concat(s,"];\n ");var u="\n void ".concat(o,"(int src[").concat(t,"], out int dest[").concat(t,"]) {\n ").concat(i,"\n }\n ");n[o]=new a.GlslLibRoutine(u)}return n},e.prototype.copyVec=function(){for(var t=this.context.outputTextureLayout.shape.length,e="",n=0;n<t;++n)e+="\n dest[".concat(n,"] = src[").concat(n,"];\n ");var r="\n void copyVec(int src[".concat(t,"], out int dest[").concat(t,"]) {\n ").concat(e,"\n }\n ");return{copyVec:new a.GlslLibRoutine(r)}},e.prototype.setVecItem=function(){for(var t=this.context.outputTextureLayout.shape.length,e="\n if(index < 0)\n index =".concat(t," + index;\n if (index == 0)\n m[0] = value;\n "),n=1;n<t-1;++n)e+="\n else if (index == ".concat(n,")\n m[").concat(n,"] = value;\n ");e+="\n else\n m[".concat(t-1,"] = value;\n ");var r="\n void setVecItem(out int m[".concat(t,"], int index, int value) {\n ").concat(e,"\n }\n ");return{setVecItem:new a.GlslLibRoutine(r)}},e.prototype.getVecItem=function(){for(var t=this.context.outputTextureLayout.shape.length,e="\n if(index < 0)\n index = ".concat(t," + index;\n if (index == 0)\n return m[0];\n "),n=1;n<t-1;++n)e+="\n else if (index == ".concat(n,")\n return m[").concat(n,"];\n ");e+="\n else\n return m[".concat(t-1,"];\n ");var r="\n int getVecItem(int m[".concat(t,"], int index) {\n ").concat(e,"\n }\n ");return{getVecItem:new a.GlslLibRoutine(r)}},e}(a.GlslLib);e.VecGlslLib=s},8316:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)},o=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.WebGLInferenceHandler=void 0;var a=n(6231),s=n(9162),u=n(2517),c=n(2403),l=n(7019),f=n(8710),p=n(5611),h=n(4057),d=n(2039),g=function(){function t(t){this.session=t,this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map}return t.prototype.calculateTextureWidthAndHeight=function(t,e){return(0,h.calculateTextureWidthAndHeight)(this.session.layoutStrategy,t,e)},t.prototype.executeProgram=function(t,e){if(e.length<t.inputNames.length)throw new Error("Input size mustn't be less than ".concat(t.inputNames.length,"."));if(t.inputNames.length!==t.inputTypes.length)throw new Error("input names size does not match input types");for(var n=[],r=0;r<t.inputNames.length;++r)n[r]=this.getOrCreateTextureData(e[r],t.inputTypes[r]);var o=function(t,e){var n=e.map((function(t){return"".concat(t.unpackedShape.join(","),";").concat(t.width,"x").concat(t.height)})).join("_"),r=t.name;return t.cacheHint&&(r+="["+t.cacheHint+"]"),r+":"+n}(t,n),i=this.session.programManager.getArtifact(o),a=i?i.programInfo:"function"==typeof t.get?t.get():t,s=(0,h.createTextureLayoutFromTextureType)(this.session.layoutStrategy,a.output.dims,a.output.textureType),u=this.createTextureData(s,a.output.type);return i||(i=this.session.programManager.build(a,n,u),this.session.programManager.setArtifact(o,i)),this.runProgram(i,n,u),u},t.prototype.run=function(t,e){return this.executeProgram(t,e).tensor},t.prototype.runProgram=function(t,e,n){for(var r=0;r<e.length;++r)if(!!e[r].isPacked!=(t.programInfo.inputTypes[r]===d.TextureType.packed))throw new Error("input[".concat(r,"] property packed inconsistent"));if(!!n.isPacked!=(t.programInfo.output.textureType===d.TextureType.packed))throw new Error("output property packed inconsistent");this.session.programManager.run(t,e,n)},t.prototype.getOrCreateTextureData=function(t,e){var n=this.getTextureData(t.dataId,e===d.TextureType.packed);if(!n&&(n=this.getTextureData(t.dataId,e!==d.TextureType.packed)))return e===d.TextureType.packed?this.pack(n):this.unpack(n);if(!n){var r=(0,h.createTextureLayoutFromTextureType)(this.session.layoutStrategy,t.dims,e);if(e===d.TextureType.packedLastDimension){var o=t.dims;if(4===o.length){var i=[o[0],Math.ceil(o[1]*o[2]*o[3]/4)],a=(0,h.createTextureLayoutFromTextureType)(this.session.layoutStrategy,i,e),s=t.numberData;if(o[1]*o[2]*o[3]%4!=0){var u=o[0],c=o[1]*o[2]*o[3],l=4*Math.ceil(1*c/4);s=new Float32Array(u*l);for(var f=0;f<u;++f){var p=f*c,g=f*l+f%1*c;s.set(t.numberData.subarray(p,p+c),g)}}return this.createTextureData(a,t.type,s,t,1)}}if(e===d.TextureType.packed){var b=(0,h.createTextureLayoutFromShape)(this.session.layoutStrategy,t.dims,1,[],{reverseWH:!0}),y=this.createTextureData(b,t.type,t.numberData,t,1);n=this.pack(y)}else n=this.createTextureData(r,t.type,t.numberData,t,1)}return n},t.prototype.createTextureDataFromLayoutBindTensor=function(t,e,n,r){return this.createTextureData(t,e,n,r,1)},t.prototype.createTextureData=function(t,e,n,r,o){a.Logger.verbose("InferenceHandler","Creating TextureData: layout:[".concat(JSON.stringify(t),"]"));var i=this.session.textureManager.createTextureFromLayout(e,t,n,o);return this.createTextureDataFromTexture(t,e,i,r)},t.prototype.reshapeUnpacked=function(t,e){var n=this.getOrCreateTextureData(t,d.TextureType.unpacked),r={channels:n.channels,height:n.height,width:n.width,shape:0!==e.length?e:[1],strides:u.ShapeUtil.computeStrides(e),unpackedShape:e};return this.createTextureDataFromTexture(r,t.type,n.texture).tensor},t.prototype.reshapePacked=function(t,e){var n=this.getOrCreateTextureData(t,d.TextureType.packed);if((0,l.isReshapeCheap)(t.dims,e)){var r={channels:n.channels,height:n.height,width:n.width,shape:0!==e.length?e:[1],strides:u.ShapeUtil.computeStrides(e),unpackedShape:e,isPacked:!0};return this.createTextureDataFromTexture(r,t.type,n.texture).tensor}var o=(0,l.processDims3D)(t.dims),i=(0,l.processDims3D)(e),a=this.reshapePacked(t,o),s=this.run((0,l.createPackedReshape3DProgramInfoLoader)(this,a,i),[a]);return this.reshapePacked(s,e)},t.prototype.cast=function(t,e){var n=this.getOrCreateTextureData(t,d.TextureType.unpacked);return this.createTextureDataFromTexture(n,e,n.texture).tensor},t.prototype.createTextureDataFromTexture=function(t,e,n,a,u){var c=this,l=r(r({},t),{tensor:a||new s.Tensor(t.unpackedShape,e,(function(t){return c.readTexture(l)}),(function(t){return o(c,void 0,void 0,(function(){return i(this,(function(t){return[2,this.readTextureAsync(l)]}))}))}),void 0,u),texture:n});return this.setTextureData(l.tensor.dataId,l,t.isPacked),l},t.prototype.getTextureData=function(t,e){return void 0===e&&(e=!1),this.session.isInitializer(t)?this.session.getTextureData(t,e):e?this.packedTextureDataCache.get(t):this.unpackedTextureDataCache.get(t)},t.prototype.setTextureData=function(t,e,n){void 0===n&&(n=!1),this.session.isInitializer(t)?this.session.setTextureData(t,e,n):(n?this.packedTextureDataCache:this.unpackedTextureDataCache).set(t,e)},t.prototype.isTextureLayoutCached=function(t,e){return void 0===e&&(e=!1),!!this.getTextureData(t.dataId,e)},t.prototype.dispose=function(){var t=this;this.session.textureManager.clearActiveTextures(),this.packedTextureDataCache.forEach((function(e){return t.session.textureManager.releaseTexture(e)})),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache.forEach((function(e){return t.session.textureManager.releaseTexture(e)})),this.unpackedTextureDataCache=new Map},t.prototype.readTexture=function(t){return t.isPacked?this.readTexture(this.unpack(t)):this.session.backend.glContext.isFloat32DownloadSupported?this.session.textureManager.readTexture(t,t.tensor.type,t.channels):this.session.textureManager.readUint8TextureAsFloat((0,f.encodeAsUint8)(this,t))},t.prototype.readTextureAsync=function(t){return o(this,void 0,void 0,(function(){return i(this,(function(e){return t.isPacked?[2,this.readTextureAsync(this.unpack(t))]:this.session.backend.glContext.isFloat32DownloadSupported?[2,this.session.textureManager.readTextureAsync(t,t.tensor.type,t.channels)]:[2,this.session.textureManager.readUint8TextureAsFloat((0,f.encodeAsUint8)(this,t))]}))}))},t.prototype.pack=function(t){return this.executeProgram((0,c.createPackProgramInfoLoader)(this,t.tensor),[t.tensor])},t.prototype.unpack=function(t){return this.executeProgram((0,p.createUnpackProgramInfoLoader)(this,t.tensor),[t.tensor])},t}();e.WebGLInferenceHandler=g},1640:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(e,n);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,o)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.WEBGL_OP_RESOLVE_RULES=void 0;var a=n(2898),s=i(n(7839)),u=n(4196),c=n(2069),l=n(8138),f=n(9663),p=n(5193),h=n(7992),d=n(1253),g=n(4776),b=n(6572),y=n(3346),m=n(5623),v=n(2870),_=n(2143),w=n(4939),x=n(718),T=n(2268),S=n(8117),O=n(2278),A=n(5524),E=n(5975),I=n(3933),P=n(6558),D=n(5723),k=n(3738),C=i(n(4909)),F=n(8428),N=n(9793);e.WEBGL_OP_RESOLVE_RULES=[["Abs","","6+",C.abs],["Acos","","7+",C.acos],["Add","","7+",s.add],["And","","7+",s.and],["Asin","","7+",C.asin],["Atan","","7+",C.atan],["AveragePool","","7+",_.averagePool,_.parseAveragePoolAttributes],["BatchNormalization","","7+",a.batchNormalization,a.parseBatchNormalizationAttributes],["Cast","","6+",u.cast,u.parseCastAttributes],["Ceil","","6+",C.ceil],["Clip","","6-10",C.clip,C.parseClipAttributes],["Clip","","11+",C.clipV11],["Concat","","4+",c.concat,c.parseConcatAttributes],["Conv","","1+",l.conv,l.parseConvAttributes],["ConvTranspose","","1+",f.convTranspose,f.parseConvTransposeAttributes],["Cos","","7+",C.cos],["Div","","7+",s.div],["Dropout","","7+",C.identity],["DepthToSpace","","1+",p.depthToSpace,p.parseDepthToSpaceAttributes],["Equal","","7+",s.equal],["Elu","","6+",C.elu,C.parseEluAttributes],["Exp","","6+",C.exp],["Flatten","","1+",h.flatten,h.parseFlattenAttributes],["Floor","","6+",C.floor],["FusedConv","com.microsoft","1+",l.conv,l.parseConvAttributes],["Gather","","1+",d.gather,d.parseGatherAttributes],["Gemm","","7-10",g.gemm,g.parseGemmAttributesV7],["Gemm","","11+",g.gemm,g.parseGemmAttributesV11],["GlobalAveragePool","","1+",_.globalAveragePool,_.parseGlobalAveragePoolAttributes],["GlobalMaxPool","","1+",_.globalMaxPool],["Greater","","7+",s.greater],["Identity","","1+",C.identity],["ImageScaler","","1+",b.imageScaler,b.parseImageScalerAttributes],["InstanceNormalization","","6+",y.instanceNormalization,y.parseInstanceNormalizationAttributes],["LeakyRelu","","6+",C.leakyRelu,C.parseLeakyReluAttributes],["Less","","7+",s.less],["Log","","6+",C.log],["MatMul","","1+",m.matMul,m.parseMatMulAttributes],["MaxPool","","1+",_.maxPool,_.parseMaxPoolAttributes],["Mul","","7+",s.mul],["Neg","","6+",C.neg],["Not","","1+",C.not],["Or","","7+",s.or],["Pad","","2-10",v.padV2,v.parsePadAttributesV2],["Pad","","11+",v.padV11,v.parsePadAttributesV11],["Pow","","7+",s.pow],["PRelu","","7+",s.pRelu],["ReduceLogSum","","1+",w.reduceLogSum,w.parseReduceAttributes],["ReduceMax","","1+",w.reduceMax,w.parseReduceAttributes],["ReduceMean","","1+",w.reduceMean,w.parseReduceAttributes],["ReduceMin","","1+",w.reduceMin,w.parseReduceAttributes],["ReduceProd","","1+",w.reduceProd,w.parseReduceAttributes],["ReduceSum","","1-12",w.reduceSum,w.parseReduceAttributes],["ReduceSumSquare","","1+",w.reduceLogSumSquare,w.parseReduceAttributes],["Relu","","6+",C.relu],["Reshape","","5+",x.reshape],["Resize","","10",T.resize,T.parseResizeAttributesV10],["Resize","","11+",T.resize,T.parseResizeAttributesV11],["Shape","","1+",S.shape],["Sigmoid","","6+",C.sigmoid],["Sin","","7+",C.sin],["Slice","","10+",O.sliceV10],["Slice","","1-9",O.slice,O.parseSliceAttributes],["Softmax","","1-12",A.softmax,A.parseSoftmaxAttributes],["Softmax","","13+",A.softmaxV13,A.parseSoftmaxAttributesV13],["Split","","2-12",E.split,E.parseSplitAttributes],["Sqrt","","6+",C.sqrt],["Squeeze","","1-12",I.squeeze,I.parseSqueezeAttributes],["Squeeze","","13+",I.squeezeV13],["Sub","","7+",s.sub],["Sum","","6+",P.sum],["Tan","","7+",C.tan],["Tanh","","6+",C.tanh],["Tile","","6+",D.tile],["Transpose","","1+",k.transpose,k.parseTransposeAttributes],["Upsample","","7-8",N.upsample,N.parseUpsampleAttributesV7],["Upsample","","9",N.upsample,N.parseUpsampleAttributesV9],["Unsqueeze","","1-12",F.unsqueeze,F.parseUnsqueezeAttributes],["Unsqueeze","","13+",F.unsqueezeV13],["Xor","","7+",s.xor]]},2898:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)},o=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(e,"__esModule",{value:!0}),e.parseBatchNormalizationAttributes=e.batchNormalization=void 0;var i=n(246),a=n(5060),s=n(2039),u={name:"BatchNormalization",inputNames:["A","Scale","B","Mean","Variance"],inputTypes:[s.TextureType.unpacked,s.TextureType.unpacked,s.TextureType.unpacked,s.TextureType.unpacked,s.TextureType.unpacked]};e.batchNormalization=function(t,e,n){return l(e),[t.run(r(r({},u),{cacheHint:n.cacheKey,get:function(){return c(t,e,n)}}),e)]},e.parseBatchNormalizationAttributes=function(t){var e=t.attributes.getFloat("epsilon",1e-5),n=t.attributes.getFloat("momentum",.9),r=t.attributes.getInt("spatial",1);return(0,i.createAttributeWithCacheKey)({epsilon:e,momentum:n,spatial:r})};var c=function(t,e,n){var i=(0,a.getGlsl)(t.session.backend.glContext.version),c=e[0].dims.length,l=o(t.calculateTextureWidthAndHeight(e[1].dims,s.TextureType.unpacked),2),f=l[0],p=l[1],h="\n float process(int[".concat(c,"] indices) {\n vec2 position = offsetToCoords(indices[1], ").concat(f,", ").concat(p,");\n float scale = getColorAsFloat(").concat(i.texture2D,"(Scale, position));\n float mean = getColorAsFloat(").concat(i.texture2D,"(Mean, position));\n float variance = getColorAsFloat(").concat(i.texture2D,"(Variance, position));\n float b = getColorAsFloat(").concat(i.texture2D,"(B, position));\n\n return scale * ( (_A(indices) - mean) / sqrt(variance + float(").concat(n.epsilon,")) ) + b;\n }");return r(r({},u),{output:{dims:e[0].dims,type:e[0].type,textureType:s.TextureType.unpacked},shaderSource:h})},l=function(t){if(!t||5!==t.length)throw new Error("BatchNormalization requires 5 inputs.");var e=t[0],n=t[1],r=t[2],o=t[3],i=t[4];if(e.dims.length<3||1!==n.dims.length||1!==r.dims.length||1!==o.dims.length||1!==i.dims.length)throw new Error("invalid input shape.");if(n.dims[0]!==e.dims[1]||r.dims[0]!==e.dims[1]||o.dims[0]!==e.dims[1]||i.dims[0]!==e.dims[1])throw new Error("invalid input shape.");if("float32"!==e.type&&"float64"!==e.type||"float32"!==n.type&&"float64"!==n.type||"float32"!==r.type&&"float64"!==r.type||"float32"!==o.type&&"float64"!==o.type||"float32"!==i.type&&"float64"!==i.type)throw new Error("invalid input tensor types.")}},7839:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.xor=e.sub=e.pRelu=e.pow=e.or=e.mul=e.less=e.greater=e.equal=e.div=e.and=e.add=e.glslPRelu=e.glslPow=e.glslXor=e.glslOr=e.glslAnd=e.glslLess=e.glslGreater=e.glslEqual=e.glslSub=e.glslMul=e.glslDiv=e.glslAdd=void 0;var r=n(2517),o=n(8520),i=n(5060),a=n(2039);function s(){var t="add_";return{body:"\n float ".concat(t,"(float a, float b) {\n return a + b;\n }\n vec4 ").concat(t,"(vec4 v1, vec4 v2) {\n return v1 + v2;\n }\n "),name:t,type:o.FunctionType.ValueBased}}function u(){var t="div_";return{body:"\n float ".concat(t,"(float a, float b) {\n return a / b;\n }\n vec4 ").concat(t,"(vec4 v1, vec4 v2) {\n return v1 / v2;\n }\n "),name:t,type:o.FunctionType.ValueBased}}function c(){var t="mul_";return{body:"\n float ".concat(t,"(float a, float b) {\n return a * b;\n }\n vec4 ").concat(t,"(vec4 v1, vec4 v2) {\n return v1 * v2;\n }\n "),name:t,type:o.FunctionType.ValueBased}}function l(){var t="sub_";return{body:"\n float ".concat(t,"(float a, float b) {\n return a - b;\n }\n vec4 ").concat(t,"(vec4 v1, vec4 v2) {\n return v1 - v2;\n }\n "),name:t,type:o.FunctionType.ValueBased}}function f(){var t="equal_";return{body:"\n float ".concat(t,"(float a, float b) {\n return float(a == b);\n }\n vec4 ").concat(t,"(vec4 v1, vec4 v2) {\n return vec4(equal(v1, v2));\n }\n "),name:t,type:o.FunctionType.ValueBased}}function p(){var t="greater_";return{body:"\n float ".concat(t,"(float a, float b) {\n return float(a > b);\n }\n vec4 ").concat(t,"(vec4 v1, vec4 v2) {\n return vec4( v1.r > v2.r ,\n v1.g > v2.g,\n v1.b > v2.b,\n v1.a > v2.a );\n }\n "),name:t,type:o.FunctionType.ValueBased}}function h(){var t="less_";return{body:"\n float ".concat(t,"(float a, float b) {\n return float(a < b);\n }\n vec4 ").concat(t,"(vec4 v1, vec4 v2) {\n return vec4( v1.r < v2.r ,\n v1.g < v2.g,\n v1.b < v2.b,\n v1.a < v2.a );\n }\n "),name:t,type:o.FunctionType.ValueBased}}function d(){var t="and_";return{body:"\n float ".concat(t,"(float a, float b) {\n return float( bool(a) && bool(b) );\n }\n vec4 ").concat(t,"(vec4 v1, vec4 v2) {\n bvec4 b1 = bvec4(v1);\n bvec4 b2 = bvec4(v2);\n return vec4( b1.r && b2.r ,\n b1.g && b2.g,\n b1.b && b2.b,\n b1.a && b2.a );\n }\n "),name:t,type:o.FunctionType.ValueBased}}function g(){var t="or_";return{body:"\n float ".concat(t,"(float a, float b) {\n return float( bool(a) || bool(b) );\n }\n vec4 ").concat(t,"(vec4 v1, vec4 v2) {\n bvec4 b1 = bvec4(v1);\n bvec4 b2 = bvec4(v2);\n return vec4( b1.r || b2.r ,\n b1.g || b2.g,\n b1.b || b2.b,\n b1.a || b2.a );\n }\n "),name:t,type:o.FunctionType.ValueBased}}function b(){var t="xor_";return{body:"\n float ".concat(t,"(float a, float b) {\n return float( bool(a) ^^ bool(b) );\n }\n vec4 ").concat(t,"(vec4 v1, vec4 v2) {\n bvec4 b1 = bvec4(v1);\n bvec4 b2 = bvec4(v2);\n return vec4( b1.r ^^ b2.r ,\n b1.g ^^ b2.g,\n b1.b ^^ b2.b,\n b1.a ^^ b2.a );\n }\n "),name:t,type:o.FunctionType.ValueBased}}function y(){return function(t){var e="".concat(t,"_");return{body:"\n float ".concat(e,"(float a, float b) {\n return ").concat(t,"(a, b);\n }\n vec4 ").concat(e,"(vec4 v1, vec4 v2) {\n return ").concat(t,"(v1, v2);\n }\n "),name:e,type:o.FunctionType.ValueBased}}("pow")}function m(){var t="prelu_";return{body:"\n float ".concat(t,"(float a, float b) {\n return a < 0.0 ? a * b: a;\n }\n vec4 ").concat(t,"(vec4 v1, vec4 v2) {\n return vec4(\n v1.r < 0.0 ? v1.r * v2.r: v1.r,\n v1.g < 0.0 ? v1.g * v2.g: v1.g,\n v1.b < 0.0 ? v1.b * v2.b: v1.b,\n v1.a < 0.0 ? v1.a * v2.a: v1.a\n );\n }\n "),name:t,type:o.FunctionType.ValueBased}}e.glslAdd=s,e.glslDiv=u,e.glslMul=c,e.glslSub=l,e.glslEqual=f,e.glslGreater=p,e.glslLess=h,e.glslAnd=d,e.glslOr=g,e.glslXor=b,e.glslPow=y,e.glslPRelu=m;var v=function(t,e,n,r,o){void 0===r&&(r=e[0].type);var i=t.session.pack?a.TextureType.packed:a.TextureType.unpacked;return{name:n.name,inputNames:["A","B"],inputTypes:[i,i],cacheHint:o,get:function(){return _(t,e,n,r)}}},_=function(t,e,n,o){void 0===o&&(o=e[0].type);var s=t.session.pack?a.TextureType.packed:a.TextureType.unpacked,u=!r.ShapeUtil.areEqual(e[0].dims,e[1].dims),c=e[0].dims,l=t.session.pack;if(u){var f=r.BroadcastUtil.calcShape(e[0].dims,e[1].dims,!1);if(!f)throw new Error("Can't perform binary op on the given tensors");var p=(c=f).length,h=0!==e[0].dims.length?e[0].dims.length:1,d=0!==e[1].dims.length?e[1].dims.length:1,g=0!==e[0].dims.length?"bcastIndices_A(indices, aindices);":"aindices[0] = 0;",b=0!==e[1].dims.length?"bcastIndices_B(indices, bindices);":"bindices[0] = 0;",y=(0,i.getGlsl)(t.session.backend.glContext.version),m=l?"\n ".concat(n.body,"\n void main() {\n vec4 a = getAAtOutCoords();\n vec4 b = getBAtOutCoords();\n vec4 result = ").concat(n.name,"(a, b);\n ").concat(y.output," = result;\n }"):"\n ".concat(n.body,"\n float process(int indices[").concat(p,"]) {\n int aindices[").concat(h,"];\n int bindices[").concat(d,"];\n ").concat(g,"\n ").concat(b,"\n return ").concat(n.name,"(_A(aindices), _B(bindices));\n }");return{name:n.name,inputNames:["A","B"],inputTypes:[s,s],output:{dims:c,type:o,textureType:s},shaderSource:m,hasMain:l}}var v=(0,i.getGlsl)(t.session.backend.glContext.version),_="\n ".concat(n.body,"\n void main() {\n vec4 v1 = ").concat(v.texture2D,"(A, TexCoords);\n vec4 v2 = ").concat(v.texture2D,"(B, TexCoords);\n vec4 result = ").concat(n.name,"(v1, v2);\n ").concat(v.output," = result;\n }\n ");return{name:n.name,inputNames:["A","B"],inputTypes:[s,s],output:{dims:e[0].dims,type:o,textureType:s},shaderSource:_,hasMain:!0}};e.add=function(t,e){return[t.run(v(t,e,s()),e)]},e.and=function(t,e){return[t.run(v(t,e,d(),"bool"),e)]},e.div=function(t,e){return[t.run(v(t,e,u()),e)]},e.equal=function(t,e){return[t.run(v(t,e,f(),"bool"),e)]},e.greater=function(t,e){return[t.run(v(t,e,p(),"bool"),e)]},e.less=function(t,e){return[t.run(v(t,e,h(),"bool"),e)]},e.mul=function(t,e){return[t.run(v(t,e,c()),e)]},e.or=function(t,e){return[t.run(v(t,e,g(),"bool"),e)]},e.pow=function(t,e){return[t.run(v(t,e,y()),e)]},e.pRelu=function(t,e){return[t.run(v(t,e,m()),e)]},e.sub=function(t,e){return[t.run(v(t,e,l()),e)]},e.xor=function(t,e){return[t.run(v(t,e,b(),"bool"),e)]}},4196:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseCastAttributes=e.cast=void 0;var r=n(2517);e.cast=function(t,e,n){return o(e),[t.cast(e[0],n)]},e.parseCastAttributes=function(t){return r.ProtoUtil.tensorDataTypeFromProto(t.attributes.getInt("to"))};var o=function(t){if(!t||1!==t.length)throw new Error("Cast requires 1 input.");if("string"===t[0].type)throw new Error("Invalid input type.")}},1163:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.createPackedConcatProgramInfoLoader=void 0;var o=n(5060),i=n(2039),a=n(9390),s=n(2827);e.createPackedConcatProgramInfoLoader=function(t,e,n){var c,l,f=(c=e.length,l=n.cacheKey,{name:"Concat (packed)",inputNames:Array.from({length:c},(function(t,e){return"X".concat(e)})),inputTypes:Array(c).fill(i.TextureType.packed),cacheHint:l});return r(r({},f),{get:function(){return function(t,e,n,c){var l=n[0].dims.slice();if(c>=l.length||c<-1*l.length)throw new Error("axis specified for concat doesn't match input dimensionality");c<0&&(c=l.length+c);for(var f=l.slice(0),p=1;p<n.length;p++)for(var h=n[p].dims.slice(),d=0;d<l.length;d++)if(d===c)f[c]+=h[d];else if(l[d]!==h[d])throw new Error("non concat dimensions must match");var g=f.length,b=(0,s.getChannels)("coords",g),y=(0,a.getCoordsDataType)(g),m=(0,s.unpackFromChannel)(),v=n.map((function(t){return t.dims})),_=(0,a.getGlChannels)(g),w=new Array(v.length-1);for(w[0]=v[0][c],p=1;p<w.length;p++)w[p]=w[p-1]+v[p][c];var x=_[c],T=_.slice(-2),S=_.join(),O="if (".concat(x," < ").concat(w[0],") {\n return getChannel(\n getX0(").concat(S,"), vec2(").concat(T.join(),"));\n }");for(p=1;p<w.length;p++){var A=w[p-1];O+="\n if (".concat(x," < ").concat(w[p]," && ").concat(x," >= ").concat(w[p-1],") {\n return getChannel(\n getX").concat(p,"(").concat(u(_,x,A),"),\n vec2(").concat(u(T,x,A),"));\n }")}var E=w.length,I=w[w.length-1];O+="\n return getChannel(\n getX".concat(E,"(").concat(u(_,x,I),"),\n vec2(").concat(u(T,x,I),"));");var P=(0,o.getGlsl)(t.session.backend.glContext.version),D="\n ".concat(m,"\n float getValue(").concat(_.map((function(t){return"int "+t})),") {\n ").concat(O,"\n }\n\n void main() {\n ").concat(y," coords = getOutputCoords();\n int lastDim = coords.").concat(_[g-1],";\n coords.").concat(_[g-1]," = coords.").concat(_[g-2],";\n coords.").concat(_[g-2]," = lastDim;\n\n vec4 result = vec4(getValue(").concat(b,"), 0., 0., 0.);\n\n ").concat(b[g-1]," = ").concat(b[g-1]," + 1;\n if (").concat(b[g-1]," < ").concat(f[g-1],") {\n result.g = getValue(").concat(b,");\n }\n\n ").concat(b[g-2]," = ").concat(b[g-2]," + 1;\n if (").concat(b[g-2]," < ").concat(f[g-2],") {\n result.a = getValue(").concat(b,");\n }\n\n ").concat(b[g-1]," = ").concat(b[g-1]," - 1;\n if (").concat(b[g-2]," < ").concat(f[g-2]," &&\n ").concat(b[g-1]," < ").concat(f[g-1],") {\n result.b = getValue(").concat(b,");\n }\n ").concat(P.output," = result;\n }\n ");return r(r({},e),{output:{dims:f,type:n[0].type,textureType:i.TextureType.packed},shaderSource:D,hasMain:!0})}(t,f,e,n.axis)}})};var u=function(t,e,n){var r=t.indexOf(e);return t.map((function(t,e){return e===r?"".concat(t," - ").concat(n):t})).join()}},2069:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)},o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.parseConcatAttributes=e.concat=void 0;var i=n(246),a=n(2039),s=n(1163);e.concat=function(t,e,n){return h(e),t.session.pack&&e[0].dims.length>1?[t.run((0,s.createPackedConcatProgramInfoLoader)(t,e,n),e)]:[t.run(u(t,e,n),e)]};var u=function(t,e,n){var o,i,s=(o=e.length,i=n.cacheKey,{name:"Concat",inputNames:Array.from({length:o},(function(t,e){return"X".concat(e)})),inputTypes:Array(o).fill(a.TextureType.unpacked),cacheHint:i});return r(r({},s),{get:function(){return function(t,e,n,o){var i=n[0].dims.slice();if(o>=i.length||o<-1*i.length)throw new Error("axis specified for concat doesn't match input dimensionality");o<0&&(o=i.length+o);for(var s=i.slice(0),u=1;u<n.length;u++)for(var h=n[u].dims.slice(),d=0;d<i.length;d++)if(d===o)s[o]+=h[d];else if(i[d]!==h[d])throw new Error("non concat dimensions must match");var g=s.length,b=new Array(n.length),y=0;for(u=0;u<b.length;++u)y+=n[u].dims[o],b[u]=y;var m;m=n.length<5?c(b):l(b);var v=f(n.length,g),_=p(b),w="\n ".concat(v,"\n ").concat(_,"\n ").concat(m,"\n float process(int indices[").concat(g,"]) {\n int textureIndex = getTextureWhereDataResides (indices[").concat(o,"]);\n\n if(textureIndex != 0) {\n indices[").concat(o,"] = indices[").concat(o,"] - int(getSizeInConcatAxisValueFromIndex(textureIndex-int(1)));\n }\n\n return fetchDataFromCorrectTexture(textureIndex, indices);\n }");return r(r({},e),{output:{dims:s,type:n[0].type,textureType:a.TextureType.unpacked},shaderSource:w})}(0,s,e,n.axis)}})},c=function(t){var e=t.map((function(t,e){return"if(index<".concat(t,") {return ").concat(e,";}\n")}));return"int getTextureWhereDataResides(int index) {\n ".concat(e.join(""),"\n }")},l=function(t){return c(t)},f=function(t,e){for(var n=["float fetchDataFromCorrectTexture(int textureIndex, int indices[".concat(e,"]) {")],r=0;r<t;++r)0===r?n.push("\t"+"if (textureIndex == ".concat(r,") { return _X").concat(r,"(indices); }")):r===t-1?n.push("\t"+"else { return _X".concat(r,"(indices); }")):n.push("\t"+"else if (textureIndex == ".concat(r,") { return _X").concat(r,"(indices); }"));return n.push("\t}"),n.join("\n")},p=function(t){for(var e=["int getSizeInConcatAxisValueFromIndex(int index) {"],n=0;n<t.length;++n)0===n?e.push("\t"+"if (index == ".concat(n,") { return ").concat(t[n],"; }")):n===t.length-1?e.push("\t"+"else { return ".concat(t[n],"; }")):e.push("\t"+"else if (index == ".concat(n,") { return ").concat(t[n],"; }"));return e.push("\t}"),e.join("\n")};e.parseConcatAttributes=function(t){return(0,i.createAttributeWithCacheKey)({axis:t.attributes.getInt("axis")})};var h=function(t){var e,n;if(!t||t.length<1)throw new Error("too few inputs");var r=t[0].type,i=t[0].dims.length;if("string"===r)throw new Error("string tensor is not supported yet");try{for(var a=o(t),s=a.next();!s.done;s=a.next()){var u=s.value;if(u.type!==r)throw new Error("input tensors should be one type");if(u.dims.length!==i)throw new Error("input tensors should have the same shape")}}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}}},4770:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.createUnpackedGroupedConvProgramInfoLoader=void 0;var o=n(6231),i=n(5060),a=n(2039),s=n(8138),u=n(2823);e.createUnpackedGroupedConvProgramInfoLoader=function(t,e,n){var c,l,f=(c=e.length>2,l=n.cacheKey,{name:"GroupedConv",inputNames:c?["X","W","Bias"]:["X","W"],inputTypes:c?[a.TextureType.unpacked,a.TextureType.unpacked,a.TextureType.unpacked]:[a.TextureType.unpacked,a.TextureType.unpacked],cacheHint:l});return r(r({},f),{get:function(){return function(t,e,n,c){var l=e.length>2?"value += getBias(output_channel);":"",f=e[0].dims.slice(),p=e[1].dims.slice(),h=p[0]/c.group;o.Logger.verbose("GroupedConv","autpPad:".concat(c.autoPad,", dilations:").concat(c.dilations,", group:").concat(c.group,", kernelShape:").concat(c.kernelShape,", pads:").concat(c.pads,", strides:").concat(c.strides));var d=(0,s.calculateOutputShape)(f,p,c.dilations,c.pads,c.strides),g=(0,i.getGlsl)(t.session.backend.glContext.version),b=(0,u.getActivationSnippet)(c),y=b.activationFunction,m=b.applyActivation,v="\n const ivec2 strides = ivec2(".concat(c.strides[0],", ").concat(c.strides[1],");\n const ivec2 pads = ivec2(").concat(c.pads[0],", ").concat(c.pads[1],");\n ").concat(y,"\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n int output_channel = coords.y;\n ivec2 xRCCorner = coords.zw * strides - pads;\n int group_id = output_channel / ").concat(h,";\n\n float value = 0.0;\n for (int wInChannel = 0; wInChannel < ").concat(p[1],"; wInChannel++) {\n int input_channel = group_id * ").concat(p[1]," + wInChannel;\n for (int wHeight = 0; wHeight < ").concat(p[2],"; wHeight++) {\n int xHeight = xRCCorner.x + wHeight * ").concat(c.dilations[0],";\n\n if (xHeight < 0 || xHeight >= ").concat(f[2],") {\n continue;\n }\n\n for (int wWidth = 0; wWidth < ").concat(p[3],"; wWidth++) {\n int xWidth = xRCCorner.y + wWidth * ").concat(c.dilations[1],";\n if (xWidth < 0 || xWidth >= ").concat(f[3],") {\n continue;\n }\n\n float xVal = getX(batch, input_channel, xWidth, xHeight);\n float wVal = getW(output_channel, wInChannel, wWidth, wHeight);\n value += xVal*wVal;\n }\n }\n }\n ").concat(l,"\n ").concat(m,"\n ").concat(g.output," = vec4(value, .0, .0, .0);\n }\n");return r(r({},n),{output:{dims:d,type:e[0].type,textureType:a.TextureType.unpacked},shaderSource:v,hasMain:!0})}(t,e,f,n)}})}},1386:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.conv2DPacked=e.conv2DPackedPointwise=void 0;var r=n(8138),o=n(8555),i=n(708);e.conv2DPackedPointwise=function(t,e,n){var o=e[0].dims,a=e[1].dims,s=(0,r.calculateOutputShape)(o,a,n.dilations,n.pads,n.strides),u=t.reshapePacked(e[0],[o[1],o[2]*o[3]]),c=t.reshapePacked(e[1],[a[0],a[1]]),l=e.length>2?[c,u,e[2]]:[c,u],f=t.run((0,i.createPackedMatmulProgramInfoLoader)(t,l,n),l);return t.reshapePacked(f,s)},e.conv2DPacked=function(t,e,n){var a=e[0].dims,s=e[1].dims,u=(0,r.calculateOutputShape)(a,s,n.dilations,n.pads,n.strides),c=t.run((0,o.createPackedIm2ColProgramInfoLoader)(t,e[0],e[1],u,n),[e[0]]),l=t.reshapePacked(e[1],[s[0],s[1]*s[2]*s[3]]),f=3===e.length?[l,c,e[2]]:[l,c],p=t.run((0,i.createPackedMatmulProgramInfoLoader)(t,f,n),f);return t.reshapePacked(p,u)}},9663:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)},o=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},i=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.parseConvTransposeAttributes=e.convTranspose=void 0;var a=n(246),s=n(5060),u=n(2039),c=n(2823),l=function(t,e,n,r,o,i){return(t-1)*e+n+(r-1)*o+1-i},f=function(t,e,n,r,o){var i=Math.floor(t/2);"SAME_UPPER"===e?(n[r]=i,n[o]=t-i):"SAME_LOWER"===e&&(n[r]=t-i,n[o]=i)};e.convTranspose=function(t,e,n){return g(e,n),p(t,e,n)};var p=function(t,e,n){var r=d(n,e);return[h(t,e,r)]},h=function(t,e,n){return t.run(function(t,e,n){var a,l,f=(a=e.length>2,l=n.cacheKey,{name:"ConvTranspose",inputNames:a?["X","W","B"]:["X","W"],inputTypes:a?[u.TextureType.unpacked,u.TextureType.unpacked,u.TextureType.unpacked]:[u.TextureType.unpacked,u.TextureType.unpacked],cacheHint:l});return r(r({},f),{get:function(){return function(t,e,n,a){var l=e.length>2?"getB(output_channel)":"0.0",f=e[0].dims,p=e[1].dims,h=p[1],d=p[0]/a.group,g=i([e[0].dims[0],e[1].dims[1]*a.group],o(a.outputShape),!1),b=(0,s.getGlsl)(t.session.backend.glContext.version),y=(0,c.getActivationSnippet)(a),m=y.activationFunction,v=y.applyActivation,_="\n const ivec2 strides = ivec2(".concat(a.strides[0],", ").concat(a.strides[1],");\n const ivec2 pads = ivec2(").concat(a.pads[0],", ").concat(a.pads[1],");\n ").concat(m,"\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n int output_channel = coords.y;\n\n ivec2 loc = coords.zw + pads;\n\n int group_id = output_channel / ").concat(h,";\n int wOutChannel = output_channel - group_id * ").concat(h,";\n\n float value = ").concat(l,";\n for (int inChannelOffset = 0; inChannelOffset < ").concat(d,"; inChannelOffset++) {\n int input_channel = group_id * ").concat(d," + inChannelOffset;\n for (int wWOff = 0; wWOff < ").concat(p[2],"; wWOff++) {\n for (int wHOff = 0; wHOff < ").concat(p[3],"; wHOff++) {\n ivec2 wOff = ivec2(wWOff * ").concat(a.dilations[0],", wHOff * ").concat(a.dilations[1],");\n ivec2 wLoc = loc - wOff;\n ivec2 wLocIn = wLoc / strides;\n if (\n wLocIn * strides == wLoc &&\n wLocIn.x >= 0 && wLocIn.x < ").concat(f[2]," &&\n wLocIn.y >= 0 && wLocIn.y < ").concat(f[3],"\n ) {\n float xVal = getX(batch, input_channel, wLocIn.y, wLocIn.x);\n float wVal = getW(input_channel, wOutChannel, wHOff, wWOff);\n value += xVal * wVal;\n }\n }\n }\n }\n ").concat(v,"\n ").concat(b.output," = vec4(value, .0, .0, .0);\n }\n");return r(r({},n),{output:{dims:g,type:e[0].type,textureType:u.TextureType.unpacked},shaderSource:_,hasMain:!0})}(t,e,f,n)}})}(t,e,n),e)},d=function(t,e){var n=t.kernelShape.slice();if(0===t.kernelShape.length)for(var r=2;r<e[1].dims.length;++r)n.push(e[1].dims[r]);var o=t.pads.slice(),i=t.outputShape.slice();!function(t,e,n,r,o,i,a,s){for(var u=t.length-2,c=0===s.length,p=0;p<u;++p){var h=c?t[p+2]*i[p]:s[p],d=l(t[p+2],i[p],o[p],e[p],n[p],h);f(d,r,o,p,p+u),c&&s.push(i[p]*(t[p+2]-1)+a[p]+(e[p]-1)*n[p]+1-o[p]-o[p+u])}}(e[0].dims,n,t.dilations,t.autoPad,o,t.strides,t.outputPadding,i);var a=Object.assign({},t);return Object.assign(a,{kernelShape:n,pads:o,outputShape:i,cacheKey:t.cacheKey}),a};e.parseConvTransposeAttributes=function(t){var e=t.attributes,n=(0,c.parseInternalActivationAttributes)(e),o=e.getString("auto_pad","NOTSET"),i=e.getInts("dilations",[1,1]),s=e.getInt("group",1),u=e.getInts("kernel_shape",[]),l=e.getInts("output_padding",[0,0]),f=e.getInts("output_shape",[]),p=e.getInts("pads",[0,0,0,0]),h=e.getInts("strides",[1,1]);return(0,a.createAttributeWithCacheKey)(r({autoPad:o,dilations:i,group:s,kernelShape:u,outputPadding:l,outputShape:f,pads:p,strides:h},n))};var g=function(t,e){if(!t||2!==t.length&&3!==t.length)throw new Error("Conv requires 2 or 3 inputs");if(4!==t[0].dims.length||4!==t[1].dims.length)throw new Error("currently only support 2-dimensional conv");if(t[0].dims[1]!==t[1].dims[0])throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");var n=t[1].dims[1]*e.group;if(3===t.length&&(1!==t[2].dims.length||t[2].dims[0]!==n))throw new Error("invalid bias");var r=t[0].dims.length-2;if(e.dilations.length!==r)throw new Error("dilations should be ".concat(r,"D"));if(e.strides.length!==r)throw new Error("strides should be ".concat(r,"D"));if(e.pads.length!==2*r)throw new Error("pads should be ".concat(2*r,"D"));if(e.outputPadding.length!==r)throw new Error("output_padding should be ".concat(r,"D"));if(0!==e.kernelShape.length&&e.kernelShape.length!==t[1].dims.length-2)throw new Error("invalid kernel shape");if(0!==e.outputShape.length&&e.outputShape.length!==t[0].dims.length-2)throw new Error("invalid output shape");if("float32"!==t[0].type||"float32"!==t[1].type)throw new Error("ConvTranspose input(X,W) should be float tensor");if(3===t.length&&"float32"!==t[2].type)throw new Error("ConvTranspose input(bias) should be float tensor")}},8138:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)},o=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},i=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.parseConvAttributes=e.conv=e.calculateOutputShape=void 0;var a=n(246),s=n(2517),u=n(4770),c=n(1386),l=n(9828),f=n(2823),p=n(3248),h=n(5623);e.calculateOutputShape=function(t,e,n,r,a){var s,u=t[0],c=t.slice(2),l=c.length,f=e[0],p=e.slice(2).map((function(t,e){return t+(t-1)*(n[e]-1)})),h=c.map((function(t,e){return t+r[e]+r[e+l]})).map((function(t,e){return Math.floor((t-p[e]+a[e])/a[e])}));return(s=[u,f]).concat.apply(s,i([],o(h),!1))},e.conv=function(t,e,n){return m(e,n),d(t,e,n)};var d=function(t,e,n){var r=y(n,e),o=t.session.pack,i=1===r.kernelShape[0]&&1===r.kernelShape[1];return r.group>1?[t.run((0,u.createUnpackedGroupedConvProgramInfoLoader)(t,e,r),e)]:i&&o?[g(t,e,r)]:o&&4===e[0].dims.length&&1===e[0].dims[0]&&!i?[(0,c.conv2DPacked)(t,e,r)]:[b(t,e,r)]},g=function(t,n,r){var o=n[0].dims,i=n[1].dims,a=(0,e.calculateOutputShape)(o,i,r.dilations,r.pads,r.strides),s=t.reshapeUnpacked(n[0],[o[1],o[2]*o[3]]),u=t.reshapeUnpacked(n[1],[i[0],i[1]]),c=n.length>2?[u,s,n[2]]:[u,s],l=t.run((0,h.createMatmulProgramInfoLoader)(c,r),c);return t.reshapeUnpacked(l,a)},b=function(t,n,r){var o=n[0].dims,i=n[1].dims,a=(0,e.calculateOutputShape)(o,i,r.dilations,r.pads,r.strides),s=t.run((0,p.createIm2ColProgramInfoLoader)(t,n[0],n[1],a,r),[n[0]]),u=3===n.length?[s,n[1],n[2]]:[s,n[1]];return t.run((0,l.createDotProductProgramInfoLoader)(t,n,a,r),u)},y=function(t,e){var n=t.kernelShape.slice();if(0===t.kernelShape.length)for(var r=2;r<e[1].dims.length;++r)n.push(e[1].dims[r]);var o=t.pads.slice();s.PoolConvUtil.adjustPadsBasedOnAutoPad(e[0].dims,t.strides,t.dilations,n,o,t.autoPad);var i=Object.assign({},t);return Object.assign(i,{kernelShape:n,pads:o,cacheKey:t.cacheKey}),i};e.parseConvAttributes=function(t){var e=t.attributes,n=(0,f.parseInternalActivationAttributes)(e),o=e.getString("auto_pad","NOTSET"),i=e.getInts("dilations",[1,1]),s=e.getInt("group",1),u=e.getInts("kernel_shape",[]),c=e.getInts("pads",[0,0,0,0]),l=e.getInts("strides",[1,1]);return(0,a.createAttributeWithCacheKey)(r({autoPad:o,dilations:i,group:s,kernelShape:u,pads:c,strides:l},n))};var m=function(t,e){if(!t||2!==t.length&&3!==t.length)throw new Error("Conv requires 2 or 3 inputs");if(4!==t[0].dims.length||4!==t[1].dims.length)throw new Error("currently only support 2-dimensional conv");if(t[0].dims[1]!==t[1].dims[1]*e.group)throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");if(3===t.length&&(1!==t[2].dims.length||t[1].dims[0]!==t[2].dims[0]))throw new Error("invalid bias");var n=t[0].dims.length-2;if(e.dilations.length!==n)throw new Error("dilations should be ".concat(n,"D"));if(e.strides.length!==n)throw new Error("strides should be ".concat(n,"D"));if(e.pads.length!==2*n)throw new Error("pads should be ".concat(2*n,"D"));if(0!==e.kernelShape.length&&e.kernelShape.length!==t[1].dims.length-2)throw new Error("invalid kernel shape");if("float32"!==t[0].type||"float32"!==t[1].type)throw new Error("Conv input(X,W) should be float tensor");if(3===t.length&&"float32"!==t[2].type)throw new Error("Conv input(bias) should be float tensor")}},5193:function(t,e,n){"use strict";var r=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(e,"__esModule",{value:!0}),e.parseDepthToSpaceAttributes=e.depthToSpace=void 0;var o=n(3738);e.depthToSpace=function(t,e,n){i(e);var a=n.blocksize,s=a*a,u="DCR"===n.mode?[0,3,4,1,5,2]:[0,1,4,2,5,3],c="DCR"===n.mode?[e[0].dims[0],a,a,e[0].dims[1]/s,e[0].dims[2],e[0].dims[3]]:[e[0].dims[0],e[0].dims[1]/s,a,a,e[0].dims[2],e[0].dims[3]],l=t.reshapeUnpacked(e[0],c),f={perm:u,cacheKey:"".concat(u)},p=r((0,o.transpose)(t,[l],f),1)[0],h=[e[0].dims[0],e[0].dims[1]/s,e[0].dims[2]*a,e[0].dims[3]*a];return[t.reshapeUnpacked(p,h)]},e.parseDepthToSpaceAttributes=function(t){var e=t.attributes.getInt("blocksize");if(e<1)throw new Error("blocksize must be >= 1, but got : ".concat(e," for DepthToSpace"));var n=t.attributes.getString("mode","DCR");if("DCR"!==n&&"CRD"!==n)throw new Error("unrecognized mode: ".concat(n," for DepthToSpace"));return{mode:n,blocksize:e}};var i=function(t){if(1!==t.length)throw new Error("DepthToSpace expect 1 inputs, but got ".concat(t.length));if("string"===t[0].type||4!==t[0].dims.length)throw new TypeError("DepthToSpace input should be a 4-D numeric tensor")}},9828:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)},o=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(e,"__esModule",{value:!0}),e.createDotProductProgramInfoLoader=void 0;var i=n(2517),a=n(5060),s=n(2039),u=n(2823),c=n(3248);e.createDotProductProgramInfoLoader=function(t,e,n,l){var f=function(t,e){return{name:"ConvDotProduct",inputNames:t?["Im2Col","K","B"]:["Im2Col","K"],inputTypes:t?[s.TextureType.unpacked,s.TextureType.packedLastDimension,s.TextureType.unpacked]:[s.TextureType.unpacked,s.TextureType.packedLastDimension],cacheKey:e.activationCacheKey}}(e.length>2,l);return r(r({},f),{get:function(){return function(t,e,n,l,f){var p=n[0].dims,h=n[1].dims,d=[h[0],Math.ceil(p[1]*h[2]*h[3]/4)],g=(0,c.calculateIm2ColDims)(p,h,l),b=o(t.calculateTextureWidthAndHeight(d,s.TextureType.packedLastDimension),2),y=b[0],m=b[1],v=i.ShapeUtil.computeStrides(g),_=o(t.calculateTextureWidthAndHeight(g,s.TextureType.packedLastDimension),2),w=_[0],x=_[1],T=l.length,S=n.length<3?"0.0":"_B(b)",O=Math.ceil(p[1]*h[2]*h[3]/4),A=(0,u.getActivationSnippet)(f),E=A.activationFunction,I=A.applyActivation,P=(0,a.getGlsl)(t.session.backend.glContext.version),D="\n".concat(E,"\nfloat process(int indices[").concat(T,"]) {\n int b[1];\n b[0] = indices[1];\n int im2col[4];\n im2col[0] = indices[0];\n im2col[1] = indices[2];\n im2col[2] = indices[3];\n int im2colOffset = im2col[0] * ").concat(v[0]," + im2col[1] * ").concat(v[1]," + im2col[2] * ").concat(v[2],";\n int kernelOffset = indices[1] * ").concat(d[1],";\n float value = ").concat(S,";\n for (int i = 0; i < ").concat(O,"; ++i) {\n vec2 im2colCoords = offsetToCoords(im2colOffset, ").concat(w,", ").concat(x,");\n vec2 kernelCoords = offsetToCoords(kernelOffset, ").concat(y,", ").concat(m,");\n value += dot(").concat(P.texture2D,"(Im2Col, im2colCoords), ").concat(P.texture2D,"(K, kernelCoords));\n ++im2colOffset;\n ++kernelOffset;\n }\n ").concat(I,"\n return value;\n}");return r(r({},e),{output:{dims:l,type:n[0].type,textureType:s.TextureType.unpacked},shaderSource:D})}(t,f,e,n,l)}})}},7992:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseFlattenAttributes=e.flatten=void 0;var r=n(2517);e.flatten=function(t,e,n){o(e,n);var i=r.ShapeUtil.flattenShape(e[0].dims,n);return[t.reshapeUnpacked(e[0],i)]},e.parseFlattenAttributes=function(t){return t.attributes.getInt("axis",1)};var o=function(t,e){if(!t||1!==t.length)throw new Error("Flatten requires 1 input.");var n=t[0].dims.length;if(0===n)throw new Error("scalar tensor is not supported.");if(e<-n||e>n)throw new Error("Invalid axis");if("string"===t[0].type)throw new Error("string tensor is not supported.")}},2823:function(t,e,n){"use strict";var r=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(e,"__esModule",{value:!0}),e.parseInternalActivationAttributes=e.getActivationSnippet=void 0;var o=n(2517),i=n(4909);e.getActivationSnippet=function(t){var e;switch(t.activation){case"Relu":e=(0,i.glslRelu)();break;case"Sigmoid":e=(0,i.glslSigmoid)();break;case"Clip":e=(0,i.glslClip)(t.clipMin,t.clipMax);break;default:return{activationFunction:"",applyActivation:""}}var n=e.name;return{activationFunction:e.body,applyActivation:"value = ".concat(n,"_(value);")}},e.parseInternalActivationAttributes=function(t){var e=t.getString("activation","");if("Clip"===e){var n=r(t.getFloats("activation_params",[o.MIN_CLIP,o.MAX_CLIP]),2),i=n[0],a=n[1];return{activation:e,clipMax:a,clipMin:i,activationCacheKey:"".concat(e,":").concat(i,",").concat(a)}}return{activation:e,activationCacheKey:e}}},1253:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.parseGatherAttributes=e.gather=void 0;var o=n(246),i=n(782),a=n(2517),s=n(2039);e.gather=function(t,e,n){return l(e,n.axis),[t.run(c(t,e,n),e)]},e.parseGatherAttributes=function(t){return(0,o.createAttributeWithCacheKey)({axis:t.attributes.getInt("axis",0)})};var u={name:"Gather",inputNames:["A","B"],inputTypes:[s.TextureType.unpacked,s.TextureType.unpacked]},c=function(t,e,n){var o=r(r({},u),{cacheHint:n.cacheKey});return r(r({},o),{get:function(){return function(t,e,n,o){var i=n[0].dims.slice(),u=n[1].dims.slice(),c=new Array(i.length+u.length-1);o=a.ShapeUtil.normalizeAxis(o,i.length);for(var l=[],f=0;f<c.length;f++)f<o?(c[f]=i[f],l.push("inputIdx[".concat(f,"] = outputIdx[").concat(f,"];"))):f<o+u.length?(c[f]=u[f-o],l.push("indexDataIdx[".concat(f-o,"] = outputIdx[").concat(f,"];"))):(c[f]=i[f-u.length+1],l.push("inputIdx[".concat(f-u.length+1,"] = outputIdx[").concat(f,"];")));var p=c.length||1,h=i.length,d=u.length||1,g="\n float process(int outputIdx[".concat(p,"]) {\n int inputIdx[").concat(h,"];\n int indexDataIdx[").concat(d,"];\n indexDataIdx[0] = 0;\n ").concat(l.join("\n "),"\n int idx = int(_B(indexDataIdx));\n inputIdx[").concat(o,"] = idx < 0 ? idx + ").concat(i[o]," : idx;\n return _A(inputIdx);\n }");return r(r({},e),{output:{dims:c,type:n[0].type,textureType:s.TextureType.unpacked},shaderSource:g})}(0,o,e,n.axis)}})},l=function(t,e){if(!t||2!==t.length)throw new Error("Gather requires 2 inputs.");var n=t[0].dims.length;if(n<1)throw new Error("Invalid input shape.");if(e<-n||e>n-1)throw new Error("Invalid axis.");if(-1===i.NUMBER_TYPES.indexOf(t[0].type))throw new Error("Invaid input type.");if("int32"!==t[1].type&&"int16"!==t[1].type)throw new Error("Invaid input type.")}},4776:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)},o=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(e,"__esModule",{value:!0}),e.parseGemmAttributesV11=e.parseGemmAttributesV7=e.gemm=void 0;var i=n(246),a=n(2517),s=n(2039);e.gemm=function(t,e,n){return f(e,n),[t.run(c(e,n),e)]};var u=function(t,e){var n=0!==t.attributes.getInt("transA",0),r=0!==t.attributes.getInt("transB",0),o=t.attributes.getFloat("alpha",1),a=t.attributes.getFloat("beta",1);return(0,i.createAttributeWithCacheKey)({transA:n,transB:r,alpha:o,beta:a,isOptionalC:e})};e.parseGemmAttributesV7=function(t){return u(t,!1)},e.parseGemmAttributesV11=function(t){return u(t,!0)};var c=function(t,e){var n={name:"Gemm",inputNames:3===t.length?["A","B","C"]:["A","B"],inputTypes:3===t.length?[s.TextureType.unpacked,s.TextureType.unpacked,s.TextureType.unpacked]:[s.TextureType.unpacked,s.TextureType.unpacked],key:e.cacheKey};return r(r({},n),{get:function(){return l(n,t,e)}})},l=function(t,e,n){var i=e[0].dims.slice(),u=e[1].dims.slice(),c=o(a.GemmUtil.getShapeOfGemmResult(i,n.transA,u,n.transB,3===e.length?e[2].dims:void 0),2),l=[c[0],c[1]];if(!l)throw new Error("Can't use gemm on the given tensors");var f=i[i.length-1],p="";n.transA&&(f=i[0]),n.transA&&n.transB?p="value += _A_T(a) * _B_T(b);":n.transA&&!n.transB?p="value += _A_T(a) * _B(b);":!n.transA&&n.transB?p="value += _A(a) * _B_T(b);":n.transA||n.transB||(p="value += _A(a) * _B(b);");var h=l.length,d=3===e.length?"int c[".concat(e[2].dims.length,"];"):"",g=3===e.length?"bcastIndices_C(indices, c);":"",b=3===e.length?"value += beta * _C(c);":"",y="\n float process(int indices[".concat(h,"]) {\n int a[").concat(h,"];\n int b[").concat(h,"];\n ").concat(d,"\n\n copyVec(indices, a);\n copyVec(indices, b);\n ").concat(g,"\n\n float value = 0.0;\n for (int k=0; k<").concat(f,"; ++k) {\n a[").concat(h-1,"] = k;\n b[").concat(h-2,"] = k;\n ").concat(p,"\n }\n\n value = value * alpha;\n ").concat(b,"\n return value;\n }");return r(r({},t),{output:{dims:l,type:e[0].type,textureType:s.TextureType.unpacked},variables:[{name:"alpha",type:"float",data:n.alpha},{name:"beta",type:"float",data:n.beta}],shaderSource:y})},f=function(t,e){if(!t)throw new Error("Input is missing");if(e.isOptionalC&&(t.length<2||t.length>3))throw new Error("Invaid input shape.");if(!e.isOptionalC&&3!==t.length)throw new Error("Gemm requires 3 inputs");if(3===t.length&&1!==t[2].dims.length&&2!==t[2].dims.length)throw new Error("Invalid input shape of C");if("float32"!==t[0].type&&"float64"!==t[0].type||"float32"!==t[1].type&&"float64"!==t[1].type||3===t.length&&"float32"!==t[2].type&&"float64"!==t[2].type)throw new Error("Invalid input type.");if(t[0].type!==t[1].type||3===t.length&&t[0].type!==t[2].type)throw new Error("Input types are mismatched")}},8555:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.createPackedIm2ColProgramInfoLoader=void 0;var o=n(5060),i=n(2039),a=n(2827);e.createPackedIm2ColProgramInfoLoader=function(t,e,n,s,u){var c,l=(c=u.cacheKey,{name:"Im2Col (packed)",inputNames:["A"],inputTypes:[i.TextureType.packed],cacheHint:c});return r(r({},l),{get:function(){return function(t,e,n,s,u,c){for(var l=n.dims,f=s.dims,p=u.length,h=[f[1]*f[2]*f[3],u[2]*u[3]],d=f[2]*f[3],g=(0,a.unpackFromChannel)(),b=(0,o.getGlsl)(t.session.backend.glContext.version),y="",m=0;m<=1;m++)for(var v=0;v<=1;v++)y+="\n blockIndex = rc.x + ".concat(v,";\n pos = rc.y + ").concat(m,";\n\n if(blockIndex < ").concat(h[1]," && pos < ").concat(h[0],") {\n offsetY = int(blockIndex / (").concat(u[p-1],")) * ").concat(c.strides[0]," -\n ").concat(c.pads[0],";\n d0 = offsetY + ").concat(c.dilations[0]," * (imod(pos, ").concat(d,") / ").concat(f[2],");\n\n if(d0 < ").concat(l[2]," && d0 >= 0) {\n offsetX = imod(blockIndex, ").concat(u[p-1],") * ").concat(c.strides[1]," -\n ").concat(c.pads[1],";\n d1 = offsetX + ").concat(c.dilations[1]," * imod(imod(pos, ").concat(d,"), ").concat(f[2],");\n\n if(d1 < ").concat(l[3]," && d1 >= 0) {\n\n ch = int(float(pos)/ ").concat(d,".);\n innerDims = vec2(d0, d1);\n result[").concat(2*m+v,"] = getChannel(\n getA(0, ch, int(innerDims.x),\n int(innerDims.y)), innerDims);\n }\n }\n }\n\n ");var _="\n ".concat(g,"\n\n void main() {\n ivec2 rc = getOutputCoords();\n vec4 result = vec4(0.0);\n int blockIndex, pos, offsetY, d0, offsetX, d1, ch;\n vec2 innerDims;\n ").concat(y,"\n ").concat(b.output," = result;\n }\n ");return r(r({},e),{output:{dims:h,type:n.type,textureType:i.TextureType.packed},shaderSource:_,hasMain:!0})}(t,l,e,n,s,u)}})}},3248:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.calculateIm2ColDims=e.createIm2ColProgramInfoLoader=void 0;var o=n(2039);e.createIm2ColProgramInfoLoader=function(t,n,i,a,s){var u,c=(u=s.cacheKey,{name:"Im2Col",inputNames:["X"],inputTypes:[o.TextureType.unpacked],cacheHint:u});return r(r({},c),{get:function(){return function(t,n,i,a,s,u){var c=i.dims,l=a.dims,f=s.length,p=(0,e.calculateIm2ColDims)(c,l,s,4),h="\n const int XC = ".concat(c[1],";\n const int XH = ").concat(c[2],";\n const int XW = ").concat(c[3],";\n const int KH = ").concat(u.kernelShape[0],";\n const int KW = ").concat(u.kernelShape[1],";\n const int dilationH = ").concat(u.dilations[0],";\n const int dilationW = ").concat(u.dilations[1],";\n const int strideH = ").concat(u.strides[0],";\n const int strideW = ").concat(u.strides[1],";\n const int padH = ").concat(u.pads[0],";\n const int padW = ").concat(u.pads[1],";\n const int KHKW = KH*KW;\n const int XCKHKW = XC * KHKW;\n const int outputChannels = 4;\n vec4 process(int indices[").concat(f,"]) {\n int b = indices[0]; // batch size\n int oh = indices[1] * strideH - padH; //output height\n int ow = indices[2] * strideW - padW; //output width\n int p = indices[3] * outputChannels; //patch\n vec4 value = vec4(0.0);\n for(int i=0; i < outputChannels; ++i) {\n if(p < XCKHKW) {\n int patchC = p / KHKW;\n int patchH = (p - patchC*KHKW) / KW;\n int patchW = (p - patchC*KHKW) - patchH * KW;\n int xh2 = oh + patchH * dilationH;\n int xw2 = ow + patchW * dilationW;\n int x[").concat(c.length,"];\n x[0] = b;\n x[1] = patchC;\n x[2] = xh2;\n x[3] = xw2;\n if(xh2 >= 0 &&\n xh2 < XH &&\n xw2 >= 0 &&\n xw2 < XW) {\n value[i] = _X(x);\n }\n }\n ++p;\n }\n return value;\n }\n ");return r(r({},n),{output:{dims:p,type:i.type,textureType:o.TextureType.packedLastDimension},shaderSource:h})}(0,c,n,i,a,s)}})},e.calculateIm2ColDims=function(t,e,n,r){return void 0===r&&(r=4),[n[0],n[2],n[3],Math.ceil(t[1]*e[2]*e[3]/r)]}},6572:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.parseImageScalerAttributes=e.imageScaler=void 0;var o=n(246),i=n(2039);e.imageScaler=function(t,e,n){return c(e),[t.run(s(t,e,n),e)]},e.parseImageScalerAttributes=function(t){var e=t.attributes.getFloat("scale"),n=t.attributes.getFloats("bias");return(0,o.createAttributeWithCacheKey)({scale:e,bias:n})};var a={name:"ImageScaler",inputNames:["X"],inputTypes:[i.TextureType.unpacked]},s=function(t,e,n){var o=r(r({},a),{cacheHint:n.cacheKey});return r(r({},o),{get:function(){return function(t,e,n,o){var a=n[0].dims.slice(),s=a.length,c=u(o.bias.length),l="\n ".concat(c,"\n float process(int indices[").concat(s,"]) {\n return _X(indices) * scale + getBias(bias, indices[1]);\n }");return r(r({},e),{output:{dims:a,type:n[0].type,textureType:i.TextureType.unpacked},variables:[{name:"bias",type:"float",arrayLength:o.bias.length,data:o.bias},{name:"scale",type:"float",data:o.scale}],shaderSource:l})}(0,o,e,n)}})},u=function(t){for(var e=["float getBias(float bias[".concat(t,"], int channel) {")],n=0;n<t;++n)0===n?e.push("\t"+"if (channel == ".concat(n,") { return bias[").concat(n,"]; }")):n===t-1?e.push("\t"+"else { return bias[".concat(n,"]; }")):e.push("\t"+"else if (channel == ".concat(n,") { return bias[").concat(n,"]; }"));return e.push("\t}"),e.join("\n")},c=function(t){if(!t||1!==t.length)throw new Error("ImageScaler requires 1 input.");if(4!==t[0].dims.length)throw new Error("Invalid input shape.");if("float32"!==t[0].type&&"float64"!==t[0].type)throw new Error("Invalid input type.")}},3346:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)},o=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(e,"__esModule",{value:!0}),e.parseInstanceNormalizationAttributes=e.instanceNormalization=void 0;var i=n(5060),a=n(2039);e.instanceNormalization=function(t,e,n){f(e);var r=t.run(u(e[0]),e);return[t.run(l(t,e[0],n,r.dims),[e[0],r,e[1],e[2]])]},e.parseInstanceNormalizationAttributes=function(t){return t.attributes.getFloat("epsilon",1e-5)};var s={name:"InstanceNormalization_MeanAndVariance",inputNames:["X"],inputTypes:[a.TextureType.unpacked]},u=function(t){return r(r({},s),{get:function(){return function(t,e){var n=e.dims.slice(),o=n[1],i=n[2]*n[3],s=[n[0],o],u="\n vec4 process(int[2] indices) {\n vec4 v = vec4(0.0);\n int a[4];\n a[0] = indices[0];\n a[1] = indices[1];\n float temp = 0.0;\n for(int a2=0; a2<".concat(n[2],"; a2++) {\n a[2] = a2;\n for(int a3=0; a3<").concat(n[3],"; a3++) {\n a[3] = a3;\n float x = _X(a);\n temp += x;\n }\n }\n float mean = temp / float(").concat(i,");\n temp = 0.0;\n for(int a2=0; a2<").concat(n[2],"; a2++) {\n a[2] = a2;\n for(int a3=0; a3<").concat(n[3],"; a3++) {\n a[3] = a3;\n float x = _X(a);\n temp += (x - mean) * (x - mean);\n }\n }\n v.r = mean;\n v.g = temp / float(").concat(i,");\n\n return v;\n }");return r(r({},t),{output:{dims:s,type:e.type,textureType:a.TextureType.packedLastDimension},shaderSource:u})}(s,t)}})},c={name:"InstanceNormalization_ComputeOutput",inputNames:["X","MeanAndVariance","Scale","B"],inputTypes:[a.TextureType.unpacked,a.TextureType.packedLastDimension,a.TextureType.unpacked,a.TextureType.unpacked]},l=function(t,e,n,s){var u=r(r({},c),{cacheHint:"".concat(n)});return r(r({},u),{get:function(){return function(t,e,n,s,u){var c=(0,i.getGlsl)(t.session.backend.glContext.version),l=o(t.calculateTextureWidthAndHeight(u,a.TextureType.packedLastDimension),2),f=l[0],p=l[1],h=o([f/4,p],2),d=h[0],g=h[1],b="\n vec4 get_MeanAndVariance(int[2] mv) {\n int offset = indicesToOffset_MeanAndVariance(mv);\n vec2 coords = offsetToCoords(offset, ".concat(d,", ").concat(g,");\n return ").concat(c.texture2D,"(MeanAndVariance, coords);\n }\n\n float process(int[4] indices) {\n int mv[2];\n mv[0] = indices[0];\n mv[1] = indices[1];\n vec4 mean_and_variance = get_MeanAndVariance(mv);\n float mean = mean_and_variance.r;\n float variance = mean_and_variance.g;\n\n int sb[1];\n sb[0] = indices[1];\n float scale = _Scale(sb);\n float b = _B(sb);\n\n return scale * (_X(indices) - mean) / sqrt(variance + epsilon) + b;\n }");return r(r({},e),{output:{dims:n.dims,type:n.type,textureType:a.TextureType.unpacked},variables:[{name:"epsilon",type:"float",data:s}],shaderSource:b})}(t,u,e,n,s)}})},f=function(t){if(!t||3!==t.length)throw new Error("InstanceNormalization requires 3 inputs.");var e=t[0],n=t[1],r=t[2];if(e.dims.length<3||1!==n.dims.length||1!==r.dims.length)throw new Error("Invalid input shape.");if(n.dims[0]!==e.dims[1]||r.dims[0]!==e.dims[1])throw new Error("Input shapes are mismatched.");if("float32"!==e.type&&"float64"!==e.type||"float32"!==n.type&&"float64"!==n.type||"float32"!==r.type&&"float64"!==r.type)throw new Error("Invalid input type.");if(4!==t[0].dims.length)throw new Error("Only support 4-D input shape.")}},708:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.createPackedMatmulProgramInfoLoader=void 0;var o=n(2517),i=n(5060),a=n(2039),s=n(9390),u=n(2823),c=n(5623);e.createPackedMatmulProgramInfoLoader=function(t,e,n){var l,f,p=(l=e.length>2,f=n.activationCacheKey,{name:"MatMul (packed)",inputNames:l?["A","B","Bias"]:["A","B"],inputTypes:l?[a.TextureType.packed,a.TextureType.packed,a.TextureType.packed]:[a.TextureType.packed,a.TextureType.packed],cacheHint:f});return r(r({},p),{get:function(){return function(t,e,n,l){var f=n.length>2,p=f?"value += getBiasForMatmul();":"",h=n[0].dims,d=n[1].dims,g=o.BroadcastUtil.calcShape(h,d,!0),b=!o.ShapeUtil.areEqual(n[0].dims,n[1].dims);if(!g)throw new Error("Can't use matmul on the given tensors");var y=h[h.length-1],m=Math.ceil(y/2),v=h.length,_=d.length,w=(0,i.getGlsl)(t.session.backend.glContext.version),x=(0,s.getCoordsDataType)(g.length),T=g.length,S=(0,s.getGlChannels)(),O=(0,u.getActivationSnippet)(l),A=O.activationFunction,E=O.applyActivation,I=f?"".concat((0,c.getBiasForMatmul)(x,S,n[2].dims,g,!0)):"",P=b?"".concat(function(t,e,n,r){var i=[],a=[],s=n[0].dims,u=n[1].dims,c=s.length,l=u.length,f=r.length,p=f-c,h=f-l;(i=s.map((function(t,n){return"coords.".concat(e[n+p])})))[c-1]="i*2",i.join(", "),(a=u.map((function(t,n){return"coords.".concat(e[n+h])})))[l-2]="i*2",a.join(", ");var d=o.BroadcastUtil.getBroadcastDims(s,r),g=o.BroadcastUtil.getBroadcastDims(u,r),b=d.map((function(t){return"coords.".concat(e[t+p]," = 0;")})).join("\n"),y=g.map((function(t){return"coords.".concat(e[t+h]," = 0;")})).join("\n"),m="int lastDim = coords.".concat(e[f-1],";\n coords.").concat(e[f-1]," = coords.").concat(e[f-2],";\n coords.").concat(e[f-2]," = lastDim;");return"\nvec4 getAAtOutCoordsMatmul(int i) {\n ".concat(t," coords = getOutputCoords();\n ").concat(m,"\n ").concat(b,"\n vec4 outputValue = getA(").concat(i,");\n return outputValue;\n}\n\nvec4 getBAtOutCoordsMatmul(int i) {\n ").concat(t," coords = getOutputCoords();\n ").concat(m,"\n ").concat(y,"\n vec4 outputValue = getB(").concat(a,");\n return outputValue;\n}")}(x,S,n,g)):"",D=b?"getAAtOutCoordsMatmul(i)":"getA(".concat(function(t,e){for(var n="",r=0;r<e-2;r++)n+="rc.".concat(t[r],", ");return n+("rc.".concat(t[e-2],", ")+"i*2")}(S,v),")"),k=b?"getBAtOutCoordsMatmul(i)":"getB(".concat(function(t,e){for(var n="",r=0;r<e-2;r++)n+="rc.".concat(t[r],", ");return n+"i*2, "+"rc.".concat(t[e-1])}(S,_),")"),C=b?"":"".concat(x," rc =\n getOutputCoords(); int lastDim = rc.").concat(S[T-1],"; rc.").concat(S[T-1]," =\n rc.").concat(S[T-2],"; rc.").concat(S[T-2]," = lastDim;\n "),F="\n ".concat(P,"\n ").concat(I,"\n ").concat(A,"\n void main() {\n ").concat(C,"\n\n vec4 value = vec4(0);\n for (int i = 0; i < ").concat(m,"; i++) {\n vec4 a = ").concat(D,";\n vec4 b = ").concat(k,";\n\n value += (a.rrbb * b.rgrg);\n value += (a.ggaa * b.baba);\n }\n ").concat(p,"\n ").concat(E,"\n ").concat(w.output," = value;\n }");return r(r({},e),{output:{dims:g,type:n[0].type,textureType:a.TextureType.packed},shaderSource:F,hasMain:!0})}(t,p,e,n)}})}},5623:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.getBiasForMatmul=e.createMatmulProgramInfoLoader=e.parseMatMulAttributes=e.matMul=void 0;var o=n(2517),i=n(2039),a=n(9390),s=n(2823),u=n(708);function c(t,e){var n,u,c=(n=t.length>2,u=e.activationCacheKey,{name:"MatMul",inputNames:n?["A","B","Bias"]:["A","B"],inputTypes:n?[i.TextureType.unpacked,i.TextureType.unpacked,i.TextureType.unpacked]:[i.TextureType.unpacked,i.TextureType.unpacked],cacheHint:u});return r(r({},c),{get:function(){return function(t,e,n){var u=e[0].dims,c=e[1].dims,l=o.BroadcastUtil.calcShape(u,c,!0);if(!l)throw new Error("Can't use matmul on the given tensors");var p=(0,a.getCoordsDataType)(l.length),h=(0,a.getGlChannels)(),d=(0,s.getActivationSnippet)(n),g=d.activationFunction,b=d.applyActivation,y=e.length>2,m=y?"value += getBiasForMatmul();":"",v=y?"".concat(f(p,h,e[2].dims,l,!1)):"",_=l.length,w=u.length,x=c.length,T=u[u.length-1],S="\n ".concat(g,"\n ").concat(v,"\n float process(int indices[").concat(_,"]) {\n int a[").concat(w,"];\n int b[").concat(x,"];\n bcastMatmulIndices_A(indices, a);\n bcastMatmulIndices_B(indices, b);\n\n float value;\n for (int k=0; k<").concat(T,"; ++k) {\n a[").concat(w-1,"] = k;\n b[").concat(x-2,"] = k;\n value += _A(a) * _B(b);\n }\n ").concat(m,"\n ").concat(b,"\n return value;\n }");return r(r({},t),{output:{dims:l,type:e[0].type,textureType:i.TextureType.unpacked},shaderSource:S})}(c,t,e)}})}e.matMul=function(t,e,n){return l(e),t.session.pack?[t.run((0,u.createPackedMatmulProgramInfoLoader)(t,e,n),e)]:[t.run(c(e,n),e)]},e.parseMatMulAttributes=function(t){return(0,s.parseInternalActivationAttributes)(t.attributes)},e.createMatmulProgramInfoLoader=c;var l=function(t){if(!t||2!==t.length)throw new Error("MatMul requires 2 inputs.");if(t[0].dims[t[0].dims.length-1]!==t[1].dims[t[1].dims.length-2])throw new Error("shared dimension does not match.");if("float32"!==t[0].type&&"float64"!==t[0].type||"float32"!==t[1].type&&"float64"!==t[1].type)throw new Error("inputs should be float type");if(t[0].type!==t[1].type)throw new Error("inputs types should match")};function f(t,e,n,r,i){var a,s=n.length,u=r.length,c=u-s;a=u<2&&s>0?"coords":n.map((function(t,n){return"coords.".concat(e[n+c])})).join(", ");var l=o.BroadcastUtil.getBroadcastDims(n,r).map((function(t){return"coords.".concat(e[t+c]," = 0;")})).join("\n"),f="vec4(outputValue.xx, outputValue.yy)";return 1===o.ShapeUtil.size(n)&&(f="vec4(outputValue.x)"),i?"\nvec4 getBiasForMatmul() {\n ".concat(t," coords = getOutputCoords();\n ").concat(l,"\n vec4 outputValue = getBias(").concat(a,");\n return ").concat(f,";\n}"):"\nfloat getBiasForMatmul() {\n ".concat(t," coords = getOutputCoords();\n ").concat(l,"\n return getBias(coords.x);\n}")}e.getBiasForMatmul=f},2403:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.createPackProgramInfoLoader=void 0;var o=n(5060),i=n(2039),a=n(9390),s=n(2827),u={name:"pack",inputNames:["A"],inputTypes:[i.TextureType.unpackedReversed]};e.createPackProgramInfoLoader=function(t,e){return r(r({},u),{get:function(){return function(t,e){var n,c,l,f,p=(0,o.getGlsl)(t.session.backend.glContext.version),h=e.dims,d=h.length,g=e.dims.length,b=(0,a.getCoordsDataType)(g),y=(0,s.getChannels)("rc",g),m=(n=g,c=y,l=h[h.length-2],f=h[h.length-1],0===n||1===n?"":"\n int r = ".concat(c[n-2],";\n int c = ").concat(c[n-1],";\n int rp1 = ").concat(c[n-2]," + 1;\n int cp1 = ").concat(c[n-1]," + 1;\n bool rEdge = rp1 >= ").concat(f,";\n bool cEdge = cp1 >= ").concat(l,";\n ")),v=function(t,e,n){if(0===t)return"false";if(1===t)return"rc > ".concat(e[0]);for(var r="",o=t-2;o<t;o++)r+="".concat(n[o]," >= ").concat(e[o-t+2]),o<t-1&&(r+="||");return r}(g,0===d?[1,1]:1===d?[h[0],1]:[h[g-1],h[g-2]],y),_=function(t,e){var n=t.length;if(0===n)return"getA(), 0, 0, 0";if(1===n)return"getA(rc),\n rc + 1 >= ".concat(t[0]," ? 0. : getA(rc + 1),\n 0, 0");var r="";if(n>2)for(var o=0;o<n-2;++o)r+="".concat(e[o],",");return"getA(".concat(r).concat("r, c","),\n rEdge ? 0. : getA(").concat(r).concat("rp1, c","),\n cEdge ? 0. : getA(").concat(r).concat("r, cp1","),\n rEdge || cEdge ? 0. : getA(").concat(r).concat("rp1, cp1",")")}(h,y),w="\n void main() {\n ".concat(b," rc = getOutputCoords();\n\n if(").concat(v,") {\n ").concat(p.output," = vec4(0);\n } else {\n ").concat(m,"\n\n ").concat(p.output," = vec4(").concat(_,");\n }\n }\n ");return r(r({},u),{hasMain:!0,output:{dims:e.dims,type:e.type,textureType:i.TextureType.packed},shaderSource:w})}(t,e)}})}},2827:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.unpackFromChannel=e.getChannels=e.getVecChannels=void 0;var r=n(9390);function o(t,e){return(0,r.getGlChannels)(e).map((function(e){return"".concat(t,".").concat(e)}))}e.getVecChannels=o,e.getChannels=function(t,e){return 1===e?[t]:o(t,e)},e.unpackFromChannel=function(){return"\n float getChannel(vec4 frag, int dim) {\n int modCoord = imod(dim, 2);\n return modCoord == 0 ? frag.r : frag.g;\n }\n\n float getChannel(vec4 frag, vec2 innerDims) {\n vec2 modCoord = mod(innerDims, 2.);\n return modCoord.x == 0. ?\n (modCoord.y == 0. ? frag.r : frag.g) :\n (modCoord.y == 0. ? frag.b : frag.a);\n }\n "}},2870:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)},o=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(e,"__esModule",{value:!0}),e.parsePadAttributesV11=e.padV11=e.parsePadAttributesV2=e.padV2=void 0;var i=n(246),a=n(2517),s=n(5060),u=n(2039),c={name:"Pad",inputNames:["A"],inputTypes:[u.TextureType.unpacked]};e.padV2=function(t,e,n){return p(e),[t.run(r(r({},c),{cacheHint:n.cacheKey,get:function(){return f(t,e[0],n)}}),e)]},e.parsePadAttributesV2=function(t){var e=t.attributes.getString("mode","constant"),n=t.attributes.getFloat("value",0),r=t.attributes.getInts("pads");return(0,i.createAttributeWithCacheKey)({mode:e,value:n,pads:r})},e.padV11=function(t,n,r){h(n);var o=l(t,n,r);return(0,e.padV2)(t,[n[0]],o)},e.parsePadAttributesV11=function(t){return t.attributes.getString("mode","constant")};var l=function(t,e,n){if(!t.session.isInitializer(e[1].dataId)||e.length>=3&&!t.session.isInitializer(e[2].dataId))throw new Error("dynamic pad attributes are not allowed");var r=Array.from(e[1].integerData),o=e.length>=3?e[2].floatData[0]:0;return(0,i.createAttributeWithCacheKey)({mode:n,pads:r,value:o})},f=function(t,e,n){var r=a.ShapeUtil.padShape(e.dims.slice(),n.pads),o=r.length,i=d(t,e,n),s="\n ".concat(i,"\n float process(int[").concat(o,"] indices) {\n return padA(indices);\n }");return{name:"Pad",inputNames:["A"],inputTypes:[u.TextureType.unpacked],output:{dims:r,type:e.type,textureType:u.TextureType.unpacked},shaderSource:s}},p=function(t){if(!t||1!==t.length)throw new Error("Pad requires 1 input");if("float32"!==t[0].type&&"float64"!==t[0].type)throw new Error("Invalid input type.")},h=function(t){if(!t||2!==t.length&&3!==t.length)throw new Error("Pad requires 2 or 3 inputs");if("int32"!==t[1].type)throw new Error("Invalid input type.");if(t.length>=3&&"string"===t[2].type)throw new Error("Invalid input type.")},d=function(t,e,n){var r=(0,s.getGlsl)(t.session.backend.glContext.version),i=o(t.calculateTextureWidthAndHeight(e.dims,u.TextureType.unpacked),2),c=i[0],l=i[1],f=a.ShapeUtil.computeStrides(e.dims);switch(n.mode){case"constant":return g(r,e.dims,f,c,l,n.pads,n.value);case"reflect":return b(r,e.dims,f,c,l,n.pads);case"edge":return y(r,e.dims,f,c,l,n.pads);default:throw new Error("Invalid mode")}},g=function(t,e,n,r,o,i,a){for(var s=e.length,u="",c=s-1;c>=0;--c)u+="\n k = m[".concat(c,"] - ").concat(i[c],";\n if (k < 0) return constant;\n if (k >= ").concat(e[c],") return constant;\n offset += k * ").concat(n[c],";\n ");return"\n float padA(int m[".concat(s,"]) {\n const float constant = float(").concat(a,");\n int offset = 0;\n int k = 0;\n ").concat(u,"\n vec2 coords = offsetToCoords(offset, ").concat(r,", ").concat(o,");\n float value = getColorAsFloat(").concat(t.texture2D,"(A, coords));\n return value;\n }\n ")},b=function(t,e,n,r,o,i){for(var a=e.length,s="",u=a-1;u>=0;--u)s+="\n k = m[".concat(u,"] - ").concat(i[u],";\n if (k < 0) { k = -k; }\n {\n const int _2n_1 = ").concat(2*(e[u]-1),";\n k = int( mod( float(k), float(_2n_1) ) ) ;\n if(k >= ").concat(e[u],") { k = _2n_1 - k; }\n }\n offset += k * ").concat(n[u],";\n ");return"\n float padA(int m[".concat(a,"]) {\n int offset = 0;\n int k = 0;\n ").concat(s,"\n vec2 coords = offsetToCoords(offset, ").concat(r,", ").concat(o,");\n float value = getColorAsFloat(").concat(t.texture2D,"(A, coords));\n return value;\n }\n ")},y=function(t,e,n,r,o,i){for(var a=e.length,s="",u=a-1;u>=0;--u)s+="\n k = m[".concat(u,"] - ").concat(i[u],";\n if (k < 0) k = 0;\n if (k >= ").concat(e[u],") k = ").concat(e[u]-1,";\n offset += k * ").concat(n[u],";\n ");return"\n float padA(int m[".concat(a,"]) {\n int offset = 0;\n int k = 0;\n ").concat(s,"\n vec2 coords = offsetToCoords(offset, ").concat(r,", ").concat(o,");\n float value = getColorAsFloat(").concat(t.texture2D,"(A, coords));\n return value;\n }\n ")}},2143:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)},o=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(e,"__esModule",{value:!0}),e.globalMaxPool=e.parseMaxPoolAttributes=e.maxPool=e.parseGlobalAveragePoolAttributes=e.globalAveragePool=e.parseAveragePoolAttributes=e.averagePool=void 0;var i=n(246),a=n(2517),s=n(2039);e.averagePool=function(t,e,n){h(e);var o={name:"AveragePool",inputNames:["X"],inputTypes:[s.TextureType.unpacked],cacheHint:n.cacheKey};return[t.run(r(r({},o),{get:function(){return u(e,o,!1,n)}}),e)]},e.parseAveragePoolAttributes=function(t){var e=t.attributes.getString("auto_pad","NOTSET"),n=t.attributes.getInt("ceil_mode",0),r=0!==t.attributes.getInt("count_include_pad",0),o=t.attributes.getInts("kernel_shape"),a=t.attributes.getInts("strides",[]),s=t.attributes.getInts("pads",[]);if(0!==n)throw new Error("using ceil() in shape computation is not yet supported for AveragePool");return(0,i.createAttributeWithCacheKey)({autoPad:e,ceilMode:n,countIncludePad:r,kernelShape:o,strides:a,pads:s})};var u=function(t,e,n,i){var u=o(l(t,i,n),2),c=u[0],f=u[1],p=a.ShapeUtil.size(c.kernelShape),h="";c.countIncludePad?h+="value /= float(".concat(p,");"):h+="value /= float(".concat(p," - pad);");var g=d(t[0].dims,c,"value += _X(x);",h,"0.0"),b="\n ".concat(g,"\n ");return r(r({},e),{output:{dims:f,type:t[0].type,textureType:s.TextureType.unpacked},shaderSource:b})};e.globalAveragePool=function(t,e,n){h(e);var o={name:"GlobalAveragePool",inputNames:["X"],inputTypes:[s.TextureType.unpacked],cacheHint:"".concat(n.countIncludePad)};return[t.run(r(r({},o),{get:function(){return u(e,o,!0,n)}}),e)]},e.parseGlobalAveragePoolAttributes=function(t){var e=0!==t.attributes.getInt("count_include_pad",0);return(0,i.createAttributeWithCacheKey)({autoPad:"",ceilMode:0,countIncludePad:e,kernelShape:[],strides:[],pads:[]})},e.maxPool=function(t,e,n){h(e);var o={name:"MaxPool",inputNames:["X"],inputTypes:[s.TextureType.unpacked],cacheHint:n.cacheKey};return[t.run(r(r({},o),{get:function(){return c(e,o,!1,n)}}),e)]},e.parseMaxPoolAttributes=function(t){var e=t.attributes.getString("auto_pad","NOTSET"),n=t.attributes.getInt("ceil_mode",0),r=t.attributes.getInts("kernel_shape"),o=t.attributes.getInts("strides",[]),a=t.attributes.getInts("pads",[]),s=t.attributes.getInt("storage_order",0),u=t.attributes.getInts("dilations",[]);if(0!==s)throw new Error("column major storage order is not yet supported for MaxPool");if(0!==n)throw new Error("using ceil() in shape computation is not yet supported for MaxPool");return(0,i.createAttributeWithCacheKey)({autoPad:e,ceilMode:n,countIncludePad:!1,kernelShape:r,strides:o,pads:a,storageOrder:s,dilations:u})};var c=function(t,e,n,i){var a=o(l(t,i,n),2),u=a[0],c=a[1],f=d(t[0].dims,u,"\n value = max(_X(x), value);\n ","","-1e5"),p="\n ".concat(f,"\n ");return r(r({},e),{output:{dims:c,type:t[0].type,textureType:s.TextureType.unpacked},shaderSource:p})},l=function(t,e,n){var r=t[0].dims.slice(),o=Object.hasOwnProperty.call(e,"dilations"),i=e.kernelShape.slice(),s=e.strides.slice(),u=o?e.dilations.slice():[],c=e.pads.slice();a.PoolConvUtil.adjustPoolAttributes(n,r,i,s,u,c);var l=a.PoolConvUtil.computePoolOutputShape(n,r,s,u,i,c,e.autoPad),f=Object.assign({},e);return o?Object.assign(f,{kernelShape:i,strides:s,pads:c,dilations:u,cacheKey:e.cacheKey}):Object.assign(f,{kernelShape:i,strides:s,pads:c,cacheKey:e.cacheKey}),[f,l]},f={autoPad:"",ceilMode:0,countIncludePad:!1,kernelShape:[],strides:[],pads:[],storageOrder:0,dilations:[],cacheKey:""},p={name:"GlobalMaxPool",inputNames:["X"],inputTypes:[s.TextureType.unpacked]};e.globalMaxPool=function(t,e){return h(e),[t.run(r(r({},p),{get:function(){return c(e,p,!0,f)}}),e)]};var h=function(t){if(!t||1!==t.length)throw new Error("Pool ops requires 1 input.");if("float32"!==t[0].type&&"float64"!==t[0].type)throw new Error("Invalid input type.")},d=function(t,e,n,r,o){var i=t.length;if(e.kernelShape.length<=2){var s,u=e.kernelShape[e.kernelShape.length-1],c=e.strides[e.strides.length-1],l=e.pads[e.pads.length/2-1],f=e.pads[e.pads.length-1],p=t[i-1],h="",d="";if(s=l+f!==0?"\n for (int i = 0; i < ".concat(u,"; i++) {\n x[").concat(i," - 1] = indices[").concat(i," - 1] * ").concat(c," - ").concat(l," + i;\n if (x[").concat(i," - 1] < 0 || x[").concat(i," - 1] >= ").concat(p,") {\n pad++;\n continue;\n }\n ").concat(n,"\n }"):"\n for (int i = 0; i < ".concat(u,"; i++) {\n x[").concat(i," - 1] = indices[").concat(i," - 1] * ").concat(c," - ").concat(l," + i;\n ").concat(n,"\n }"),2===e.kernelShape.length){var y=e.kernelShape[e.kernelShape.length-2],m=e.strides[e.strides.length-2],v=e.pads[e.pads.length/2-2],_=e.pads[e.pads.length-2],w=t[i-2];h=v+_!==0?"\n for (int j = 0; j < ".concat(y,"; j++) {\n x[").concat(i," - 2] = indices[").concat(i," - 2] * ").concat(m," - ").concat(v," + j;\n if (x[").concat(i," - 2] < 0 || x[").concat(i," - 2] >= ").concat(w,") {\n pad+= ").concat(u,";\n continue;\n }\n "):"\n for (int j = 0; j < ".concat(y,"; j++) {\n x[").concat(i," - 2] = indices[").concat(i," - 2] * ").concat(m," - ").concat(v," + j;\n "),d="\n }\n "}return"\n float process(int indices[".concat(i,"]) {\n int x[").concat(i,"];\n copyVec(indices, x);\n\n float value = ").concat(o,";\n int pad = 0;\n ").concat(h,"\n ").concat(s,"\n ").concat(d,"\n ").concat(r,"\n return value;\n }\n ")}var x,T=a.ShapeUtil.size(e.kernelShape),S=a.ShapeUtil.computeStrides(e.kernelShape),O=S.length,A=e.pads.length,E=b(O),I=g(t,"inputDims"),P=g(e.pads,"pads"),D=g(S,"kernelStrides"),k=g(e.strides,"strides");return x=e.pads.reduce((function(t,e){return t+e}))?"\n if (x[j] >= inputDims[j] || x[j] < 0) {\n pad++;\n isPad = true;\n break;\n }\n }\n if (!isPad) {\n ".concat(n,"\n }"):"\n }\n ".concat(n,"\n "),"\n ".concat(E,"\n float process(int indices[").concat(i,"]) {\n int x[").concat(i,"];\n copyVec(indices, x);\n int offset[").concat(O,"];\n int pads[").concat(A,"];\n int inputDims[").concat(i,"];\n int kernelStrides[").concat(O,"];\n int strides[").concat(O,"];\n ").concat(P,"\n ").concat(I,"\n ").concat(k,"\n ").concat(D,"\n\n float value = ").concat(o,";\n int pad = 0;\n bool isPad = false;\n for (int i = 0; i < ").concat(T,"; i++) {\n offsetToIndices(i, kernelStrides, offset);\n isPad = false;\n for (int j = ").concat(i," - ").concat(O,"; j < ").concat(i,"; j++) {\n x[j] = indices[j] * strides[j - ").concat(i," + ").concat(O,"]\n + offset[j - ").concat(i," + ").concat(O,"] - pads[j - 2];\n ").concat(x,"\n }\n ").concat(r,"\n\n return value;\n }\n ")},g=function(t,e){for(var n="",r=0;r<t.length;r++)n+="\n ".concat(e,"[").concat(r,"] = ").concat(t[r],";\n ");return n},b=function(t){return"\n void offsetToIndices(int offset, int[".concat(t,"] strides, out int[").concat(t,"] indices) {\n if (").concat(t," == 0) {\n return;\n }\n for (int i = 0; i < ").concat(t," - 1; ++i) {\n indices[i] = offset / strides[i];\n offset -= indices[i] * strides[i];\n }\n indices[").concat(t," - 1] = offset;\n }")}},4939:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.reduceLogSumSquare=e.reduceLogSum=e.reduceProd=e.reduceMin=e.reduceMax=e.reduceMean=e.reduceSum=e.parseReduceAttributes=void 0;var o=n(246),i=n(782),a=n(2517),s=n(2039),u=function(t,e,n,o,i){l(e);var a={name:o,inputNames:["A"],inputTypes:[s.TextureType.unpacked]};return[t.run(r(r({},a),{cacheHint:n.cacheKey,get:function(){return c(t,e,n,o,i,a)}}),e)]};e.parseReduceAttributes=function(t){var e=t.attributes.getInts("axes",[]),n=1===t.attributes.getInt("keepdims",1);return(0,o.createAttributeWithCacheKey)({axes:e,keepDims:n})};var c=function(t,e,n,o,i,u){for(var c=[],l=e[0].dims.length||1,f=[],p=a.ShapeUtil.normalizeAxes(n.axes,e[0].dims.length),h=i(e,p),d=h[1],g=0;g<e[0].dims.length;g++)p.indexOf(g)>=0||0===p.length?(n.keepDims&&c.push(1),d="\n for(int j".concat(g," = 0; j").concat(g," < ").concat(e[0].dims[g],"; j").concat(g,"++) {\n inputIdx[").concat(g,"] = j").concat(g,";\n ").concat(d,"\n }")):(f.push("inputIdx[".concat(g,"] = outputIdx[").concat(c.length,"];")),c.push(e[0].dims[g]));var b=c.length||1,y="\n float process(int outputIdx[".concat(b,"]) {\n float value; // final result\n int inputIdx[").concat(l,"]; // addressing input data\n ").concat(f.join("\n"),"\n ").concat(h[0]," // init ops for reduce max/min\n ").concat(d,"\n ").concat(h[2]," // final computation for reduce mean\n return value;\n }");return r(r({},u),{output:{dims:c,type:e[0].type,textureType:s.TextureType.unpacked},shaderSource:y})},l=function(t){if(!t||1!==t.length)throw new Error("Reduce op requires 1 input.");if(-1===i.NUMBER_TYPES.indexOf(t[0].type))throw new Error("Invalid input type.")};e.reduceSum=function(t,e,n){return u(t,e,n,"ReduceSum",(function(){return["value = 0.0;","value += _A(inputIdx);",""]}))},e.reduceMean=function(t,e,n){return u(t,e,n,"ReduceMean",(function(t,e){for(var n=1,r=0;r<t[0].dims.length;r++)(e.indexOf(r)>=0||0===e.length)&&(n*=t[0].dims[r]);return["value = 0.0;","value += _A(inputIdx);","value /= ".concat(n,".;")]}))},e.reduceMax=function(t,e,n){return u(t,e,n,"ReduceMax",(function(t,e){for(var n=[],r=0;r<t[0].dims.length;r++)(e.indexOf(r)>=0||0===e.length)&&n.push("inputIdx[".concat(r,"] = 0;"));return["".concat(n.join("\n"),"\nvalue = _A(inputIdx);"),"value = max(value, _A(inputIdx));",""]}))},e.reduceMin=function(t,e,n){return u(t,e,n,"ReduceMin",(function(t,e){for(var n=[],r=0;r<t[0].dims.length;r++)(e.indexOf(r)>=0||0===e.length)&&n.push("inputIdx[".concat(r,"] = 0;"));return["".concat(n.join("\n"),"\nvalue = _A(inputIdx);"),"value = min(value, _A(inputIdx));",""]}))},e.reduceProd=function(t,e,n){return u(t,e,n,"ReduceProd",(function(){return["value = 1.0;","value *= _A(inputIdx);",""]}))},e.reduceLogSum=function(t,e,n){return u(t,e,n,"ReduceLogSum",(function(){return["value = 0.0;","value += _A(inputIdx);","value = log(value);"]}))},e.reduceLogSumSquare=function(t,e,n){return u(t,e,n,"ReduceLogSumSquare",(function(){return["float t; value = 0.0;","t = _A(inputIdx); value += t * t;",""]}))}},7019:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.isReshapeCheap=e.processDims3D=e.createPackedReshape3DProgramInfoLoader=void 0;var o=n(2517),i=n(5060),a=n(2039),s=n(2827);e.createPackedReshape3DProgramInfoLoader=function(t,e,n){var u=function(t){return{name:"Reshape (packed)",inputTypes:[a.TextureType.packed],inputNames:["A"],cacheHint:"".concat(t)}}(n);return r(r({},u),{get:function(){return function(t,e,n,u){for(var c=e.dims,l=u,f="",p=0;p<4;p++){var h="";switch(p){case 0:h="outputCoords = rc;";break;case 1:h="outputCoords = ivec3(rc.x, rc.y+1, rc.z);";break;case 2:h="outputCoords = ivec3(rc.x, rc.y, rc.z+1);";break;case 3:h="outputCoords = ivec3(rc.x, rc.y+1, rc.z+1);";break;default:throw new Error}f+="\n ".concat(h,"\n ").concat(p>0?"if(outputCoords.y < rows && outputCoords.z < cols){":"","\n int flattenedIndex = getFlattenedIndex(outputCoords);\n\n ivec3 inputRC = inputCoordsFromReshapedOutCoords(flattenedIndex);\n vec2 innerDims = vec2(float(inputRC.y),float(inputRC.z));\n\n result[").concat(p,"] = getChannel(getA(inputRC.x, inputRC.y, inputRC.z), innerDims);\n\n ").concat(p>0?"}":"","\n ")}var d,g,b,y,m,v=(0,i.getGlsl)(t.session.backend.glContext.version),_="\n ".concat((d=c,g=o.ShapeUtil.computeStrides(d),b=["b","r","c"],y="index",m=g.map((function(t,e){var n="int ".concat(b[e]," = ").concat(y," / ").concat(t),r=e===g.length-1?"int ".concat(b[e+1]," = ").concat(y," - ").concat(b[e]," * ").concat(t):"index -= ".concat(b[e]," * ").concat(t);return"".concat(n,"; ").concat(r,";")})).join(""),"\n ivec3 inputCoordsFromReshapedOutCoords(int index) {\n ".concat(m,"\n return ivec3(b, r, c);\n }\n ")),"\n ").concat(function(t){var e=o.ShapeUtil.computeStrides(t);return"\n int getFlattenedIndex(ivec3 coords) {\n // reverse y, z order\n return coords.x * ".concat(e[0]," + coords.z * ").concat(e[1]," + coords.y;\n }\n")}(l),"\n ").concat((0,s.unpackFromChannel)(),"\n\n void main() {\n ivec3 rc = getOutputCoords();\n\n vec4 result = vec4(0.0);\n\n ivec3 outputCoords;\n int rows = ").concat(l[2],";\n int cols = ").concat(l[1],";\n\n ").concat(f,"\n ").concat(v.output," = result;\n }\n ");return r(r({},n),{output:{dims:l,type:e.type,textureType:a.TextureType.packed},shaderSource:_,hasMain:!0})}(t,e,u,n)}})},e.processDims3D=function(t){if(0===t.length)return[1,1,1];for(var e=1,n=0;n<t.length-2;++n)e*=t[n];return[e,t.length>1?t[t.length-2]:1,t[t.length-1]]},e.isReshapeCheap=function(t,e){return 0===t.length||0===e.length||(t.length<2||e.length<2?t[t.length-1]===e[e.length-1]:t[t.length-1]===e[e.length-1]&&t[t.length-2]===e[e.length-2])}},718:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.reshape=void 0;var r=n(2517);e.reshape=function(t,e){var n=r.ShapeUtil.calculateReshapedDims(e[0].dims,e[1].integerData);return t.session.pack?[t.reshapePacked(e[0],n)]:[t.reshapeUnpacked(e[0],n)]}},2268:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)},o=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(e,"__esModule",{value:!0}),e.parseResizeAttributesV11=e.parseResizeAttributesV10=e.resize=void 0;var i=n(5060),a=n(2039),s=n(9390),u=n(2827),c=n(9793),l={name:"Resize",inputNames:["A"],inputTypes:[a.TextureType.packed]};e.resize=function(t,e,n){return(0,c.validateInputs)(e,n),[t.run(r(r({},l),{cacheHint:n.cacheKey,get:function(){return f(t,e,n)}}),e)]},e.parseResizeAttributesV10=function(t){return(0,c.parseUpsampleAttributes)(t,10)},e.parseResizeAttributesV11=function(t){return(0,c.parseUpsampleAttributes)(t,11)};var f=function(t,e,n){var c=(0,i.getGlsl)(t.session.backend.glContext.version),f=o(p(e,n),2),h=f[0],d=f[1];if(h.every((function(t){return 1===t}))&&"tf_crop_and_resize"!==n.coordinateTransformMode)return r(r({},l),{output:{dims:d,type:e[0].type,textureType:a.TextureType.packed},hasMain:!0,shaderSource:"void main() {\n vec4 v = ".concat(c.texture2D,"(X, TexCoords);\n ").concat(c.output," = v;\n }")});var g=d.length;if(g<2)throw new Error("output dimension should be at least 2, but got ".concat(g));var b=d[g-2],y=d[g-1],m=e[0].dims;if(g!==m.length)throw new Error("output dimension should match input ".concat(m.length,", but got ").concat(g));var v=m[g-2],_=m[g-1],w=h[g-2],x=h[g-1],T="";if("linear"!==n.mode)throw new Error("resize (packed) does not support mode: '".concat(n.mode,"'"));switch(n.coordinateTransformMode){case"asymmetric":T="\n vec4 getSourceFracIndex(ivec4 coords) {\n return vec4(coords) / scaleWHWH;\n }\n ";break;case"half_pixel":T="\n vec4 getSourceFracIndex(ivec4 coords) {\n return (vec4(coords) + 0.5) / scaleWHWH - 0.5;\n }\n ";break;case"pytorch_half_pixel":T="\n vec4 getSourceFracIndex(ivec4 coords) {\n vec4 fcoords = vec4(coords);\n return vec4(\n ".concat(y,".0 > 1.0 ? (fcoords.x + 0.5) / scaleWHWH.x - 0.5 : 0.0,\n ").concat(b,".0 > 1.0 ? (fcoords.y + 0.5) / scaleWHWH.y - 0.5 : 0.0,\n ").concat(y,".0 > 1.0 ? (fcoords.z + 0.5) / scaleWHWH.z - 0.5 : 0.0,\n ").concat(b,".0 > 1.0 ? (fcoords.w + 0.5) / scaleWHWH.w - 0.5 : 0.0\n );\n }\n ");break;case"align_corners":T="\n vec4 getSourceFracIndex(ivec4 coords) {\n vec4 resized = vec4(".concat(y,".0 - 1.0, ").concat(b,".0 - 1.0, ").concat(y,".0 - 1.0,\n ").concat(b,".0 - 1.0);\n vec4 original = vec4(").concat(_,".0 - 1.0, ").concat(v,".0 - 1.0, ").concat(_,".0 - 1.0,\n ").concat(v,".0 - 1.0);\n vec4 new_scale = original / resized;\n return vec4(coords) * new_scale;\n }\n ");break;default:throw new Error("resize (packed) does not support coordinateTransformMode: '".concat(n.coordinateTransformMode,"'"))}var S=(0,s.getCoordsDataType)(g),O=(0,u.unpackFromChannel)(),A="\n const vec2 inputWH = vec2(".concat(v,".0, ").concat(_,".0);\n const vec4 scaleWHWH = vec4(float(").concat(w,"), float(").concat(x,"), float(").concat(w,"), float(").concat(x,"));\n ").concat(O,"\n ").concat(T,"\n float getAValue(int x10, int r, int c, int d) {\n return getChannel(getA(x10, r, c, d), vec2(c, d));\n }\n void main() {\n ").concat(S," rc = getOutputCoords();\n\n int batch = rc[0];\n int depth = rc[1];\n\n // retrieve the 4 coordinates that is used in the 4 packed output values.\n ivec4 coords = ivec4(rc.wz, rc.w + 1, rc.z + 1);\n\n // calculate the source index in fraction\n vec4 sourceFrac = getSourceFracIndex(coords);\n\n // get the lower and upper bound of the 4 values that will be packed into one texel.\n ivec4 x00 = ivec4(max(sourceFrac.xy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xy)));\n ivec4 x01 = ivec4(max(sourceFrac.xw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xw)));\n ivec4 x10 = ivec4(max(sourceFrac.zy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zy)));\n ivec4 x11 = ivec4(max(sourceFrac.zw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zw)));\n\n bool hasNextRow = rc.w < ").concat(b-1,";\n bool hasNextCol = rc.z < ").concat(y-1,";\n\n // pack x00, x01, x10, x11's top-left corner into one vec4 structure\n vec4 topLeft = vec4(\n getAValue(batch, depth, x00.x, x00.y),\n hasNextCol ? getAValue(batch, depth, x01.x, x01.y) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.x, x10.y) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.y) : 0.0);\n\n // pack x00, x01, x10, x11's top-right corner into one vec4 structure\n vec4 topRight = vec4(\n getAValue(batch, depth, x00.x, x00.w),\n hasNextCol ? getAValue(batch, depth, x01.x, x01.w) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.x, x10.w) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.w) : 0.0);\n\n // pack x00, x01, x10, x11's bottom-left corner into one vec4 structure\n vec4 bottomLeft = vec4(\n getAValue(batch, depth, x00.z, x00.y),\n hasNextCol ? getAValue(batch, depth, x01.z, x01.y) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.z, x10.y) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.y) : 0.0);\n\n // pack x00, x01, x10, x11's bottom-right corner into one vec4 structure\n vec4 bottomRight = vec4(\n getAValue(batch, depth, x00.z, x00.w),\n hasNextCol ? getAValue(batch, depth, x01.z, x01.w) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.z, x10.w) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.w) : 0.0);\n\n // calculate the interpolation fraction on u and v direction\n vec4 frac = vec4(sourceFrac) - floor(sourceFrac);\n vec4 clampFrac = clamp(frac, vec4(0.0), vec4(1.0));\n\n vec4 top = mix(topLeft, topRight, clampFrac.ywyw);\n vec4 bottom = mix(bottomLeft, bottomRight, clampFrac.ywyw);\n vec4 newValue = mix(top, bottom, clampFrac.xxzz);\n\n ").concat(c.output," = vec4(newValue);\n }\n ");return r(r({},l),{output:{dims:d,type:e[0].type,textureType:a.TextureType.packed},hasMain:!0,shaderSource:A})},p=function(t,e){var n,r=t[0].dims,o=e.scales;if(0===o.length){var i=t[e.scalesInputIdx];if(i&&0!==i.size){if(t[e.sizesInputIdx])throw new Error("Only one of scales or sizes must be provided as input.");o=h(i,e.mode,e.isResize)}else{var a=t[e.sizesInputIdx];if(!a||0===a.size)throw new Error("Either scales or sizes MUST be provided as input.");n=Array.from(a.integerData),o=d(n,r,e.mode,e.isResize)}}else if(t[e.sizesInputIdx])throw new Error("Only one of scales or sizes must be provided as input.");var s=n||r.map((function(t,e){return Math.floor(t*o[e])}));return[o,s]},h=function(t,e,n){var r=Array.from(t.floatData);return(0,c.scalesValidation)(r,e,n),r},d=function(t,e,n,r){for(var o=e.length,i=new Array(o),a=0,s=o;a<s;a++)if(0===e[a]){if(0!==t[a])throw new Error("Input dim is zero but required output dim is non-zero.");i[a]=1}else i[a]=t[a]/e[a];return(0,c.scalesValidation)(i,n,r),i}},8117:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.shape=void 0;var r=n(9162);e.shape=function(t,e){return o(e),[new r.Tensor([e[0].dims.length],"int32",void 0,void 0,new Int32Array(e[0].dims))]};var o=function(t){if(!t||1!==t.length)throw new Error("Shape requires 1 input.")}},2278:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.sliceV10=e.parseSliceAttributes=e.slice=void 0;var o=n(246),i=n(782),a=n(2517),s=n(2039),u={name:"Slice",inputNames:["A"],inputTypes:[s.TextureType.unpacked]};e.slice=function(t,e,n){return l(e),[t.run(r(r({},u),{cacheHint:n.cacheKey,get:function(){return c(t,e[0],n)}}),e)]},e.parseSliceAttributes=function(t){var e=t.attributes.getInts("starts"),n=t.attributes.getInts("ends"),r=t.attributes.getInts("axes",[]);return(0,o.createAttributeWithCacheKey)({starts:e,ends:n,axes:r})};var c=function(t,e,n){for(var o=0===n.axes.length?e.dims.slice(0).map((function(t,e){return e})):n.axes,i=a.ShapeUtil.normalizeAxes(o,e.dims.length),c=n.starts.map((function(t,n){return t>e.dims[i[n]]-1?e.dims[i[n]]:a.ShapeUtil.normalizeAxis(t,e.dims[i[n]])})),l=n.ends.map((function(t,n){return t>e.dims[i[n]]-1?e.dims[i[n]]:a.ShapeUtil.normalizeAxis(t,e.dims[i[n]])})),f=e.dims.slice(),p=[],h=0;h<i.length;h++)f[i[h]]=l[h]-c[h],c[h]>0&&p.push("outputIdx[".concat(i[h],"] += ").concat(c[h],";"));var d=f.length,g="\n float process(int outputIdx[".concat(d,"]) {\n ").concat(p.join("\n "),"\n return _A(outputIdx);\n }");return r(r({},u),{output:{dims:f,type:e.type,textureType:s.TextureType.unpacked},shaderSource:g})},l=function(t){if(!t||1!==t.length)throw new Error("Slice requires 1 input.");if(-1===i.NUMBER_TYPES.indexOf(t[0].type))throw new Error("Invalid input type.")};e.sliceV10=function(t,e){p(e);var n=f(t,e);return[t.run(r(r({},u),{cacheHint:n.cacheKey,get:function(){return c(t,e[0],n)}}),[e[0]])]};var f=function(t,e){if(!t.session.isInitializer(e[1].dataId)||!t.session.isInitializer(e[2].dataId)||e.length>=4&&!t.session.isInitializer(e[3].dataId)||e.length>=5&&!t.session.isInitializer(e[4].dataId))throw new Error("dynamic slice attributes are not allowed");if(e.length>=5&&e[4].integerData.some((function(t){return 1!==t})))throw new Error("currently non-1 steps is not supported for Slice");var n=Array.from(e[1].integerData),r=Array.from(e[2].integerData),o=e.length>=4?Array.from(e[3].integerData):[];return{starts:n,ends:r,axes:o,cacheKey:"".concat(o,";").concat(n,";").concat(r)}},p=function(t){if(!t||t.length<3||t.length>5)throw new Error("Invalid input number.");if("int32"!==t[1].type||1!==t[1].dims.length)throw new Error("Invalid input type.");if("int32"!==t[2].type||1!==t[2].dims.length)throw new Error("Invalid input type.");if(t.length>=4&&("int32"!==t[3].type||1!==t[3].dims.length))throw new Error("Invalid input type.");if(t.length>=5&&("int32"!==t[4].type||1!==t[4].dims.length))throw new Error("Invalid input type.")}},5524:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)},o=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(e,"__esModule",{value:!0}),e.softmaxV13=e.parseSoftmaxAttributesV13=e.parseSoftmaxAttributes=e.softmax=void 0;var i=n(246),a=n(2517),s=n(5060),u=n(2039),c=n(3738),l={name:"SoftmaxComputeMax",inputNames:["A"],inputTypes:[u.TextureType.unpacked]},f={name:"SoftmaxComputeScale",inputNames:["A","Max"],inputTypes:[u.TextureType.unpacked,u.TextureType.unpacked]},p={name:"SoftMax",inputNames:["A","Max","Norm"],inputTypes:[u.TextureType.unpacked,u.TextureType.unpacked,u.TextureType.unpacked]};e.softmax=function(t,e,n){y(e);var r=e[0].dims.slice(),o=a.ShapeUtil.normalizeAxis(n.axis,r.length),i=a.ShapeUtil.sizeToDimension(r,o),s=a.ShapeUtil.sizeFromDimension(r,o);return h(t,e,n,i,s)},e.parseSoftmaxAttributes=function(t){return(0,i.createAttributeWithCacheKey)({axis:t.attributes.getInt("axis",1)})},e.parseSoftmaxAttributesV13=function(t){return(0,i.createAttributeWithCacheKey)({axis:t.attributes.getInt("axis",-1)})},e.softmaxV13=function(t,e,n){y(e);var r,o=e[0].dims.slice(),s=a.ShapeUtil.normalizeAxis(n.axis,o.length),u=o.length,l=s!==u-1,f=[],p=[],d=[];l&&((p=Array.from({length:u}).map((function(t,e){return e})))[s]=u-1,p[u-1]=s,p.map((function(t){return f.push(o[t])})),r=(0,i.createAttributeWithCacheKey)({perm:p}),d=(0,c.transpose)(t,e,r));var g=l?a.ShapeUtil.sizeToDimension(f,u-1):a.ShapeUtil.sizeToDimension(o,u-1),b=l?a.ShapeUtil.sizeFromDimension(f,u-1):a.ShapeUtil.sizeFromDimension(o,u-1),m=h(t,l?d:e,n,g,b);return l?(0,c.transpose)(t,m,r):m};var h=function(t,e,n,o,i){var a=d(t,e[0],o,i,[o]),s=t.run(r(r({},l),{cacheHint:n.cacheKey,get:function(){return a}}),e),u=g(t,e[0],o,i,a.output.dims,[o]),c=t.run(r(r({},f),{cacheHint:n.cacheKey,get:function(){return u}}),[e[0],s]),h=b(t,e[0],o,i,a.output.dims,u.output.dims);return[t.run(r(r({},p),{cacheHint:n.cacheKey,get:function(){return h}}),[e[0],s,c])]},d=function(t,e,n,i,a){var c=o(t.calculateTextureWidthAndHeight(e.dims,u.TextureType.unpacked),2),f=c[0],p=c[1],h=a.length;if(n<1||i<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(1!==a.length)throw new Error("Dimensionality of the output should be 1");if(a[0]!==n)throw new Error("Shape of the output should be equal to logical row count");var d=(0,s.getGlsl)(t.session.backend.glContext.version),g="\n float process(int[".concat(h,"] indices) {\n int logical_row_start_offset = indices[0] * ").concat(i,";\n\n float max = getColorAsFloat(").concat(d.texture2D,"(A, offsetToCoords(logical_row_start_offset, ").concat(f,",\n ").concat(p," )));\n for(int i=1; i<").concat(i,"; ++i)\n {\n float current = getColorAsFloat(").concat(d.texture2D,"(A, offsetToCoords(logical_row_start_offset + i,\n ").concat(f,", ").concat(p,")));\n if(current > max)\n max = current;\n }\n\n return max;\n }");return r(r({},l),{output:{dims:a,type:e.type,textureType:u.TextureType.unpacked},shaderSource:g})},g=function(t,e,n,i,a,c){var l=o(t.calculateTextureWidthAndHeight(e.dims,u.TextureType.unpacked),2),p=l[0],h=l[1],d=c.length;if(n<1||i<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(1!==c.length)throw new Error("Dimensionality of the output should be 1");if(c[0]!==n)throw new Error("Shape of the output should be equal to logical row count");if(1!==a.length)throw new Error("Dimensionality of the intermediate results should be 1");if(a[0]!==n)throw new Error("Shape of the intermediate results should be equal to logical row count");var g=(0,s.getGlsl)(t.session.backend.glContext.version),b="\n float process(int[".concat(d,"] indices) {\n int logical_row_start_offset = indices[0] * ").concat(i,";\n\n float norm_factor = 0.0;\n float max = _Max(indices);\n for(int i=0; i<").concat(i,"; ++i)\n {\n norm_factor += exp(getColorAsFloat(").concat(g.texture2D,"(A, offsetToCoords(logical_row_start_offset + i,\n ").concat(p,", ").concat(h,"))) - max);\n }\n\n return norm_factor;\n }");return r(r({},f),{output:{dims:c,type:e.type,textureType:u.TextureType.unpacked},shaderSource:b})},b=function(t,e,n,i,a,s){var c=o(t.calculateTextureWidthAndHeight(e.dims,u.TextureType.unpacked),2),l=c[0],f=c[1],h=e.dims.length;if(n<1||i<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(1!==a.length||1!==s.length)throw new Error("Dimensionality of the intermediate results should be 1");if(a[0]!==n||s[0]!==n)throw new Error("Shape of the intermediate results should be equal to logical row count");var d="\n float process(int[".concat(h,"] indices) {\n\n // get offset of current logical tensor index from the 2-D texture coordinates (TexCoords)\n int offset = coordsToOffset(TexCoords, ").concat(l,", ").concat(f,");\n\n //determine the logical row for this index\n int logical_row_index[1];\n logical_row_index[0] = offset / ").concat(i,";\n\n float norm_factor = _Norm(logical_row_index);\n\n // avoid possible division by 0\n // if norm_facor is 0, all elements are zero\n // if so, return 0\n if(norm_factor == 0.0)\n return 0.0;\n\n return exp(_A(indices) - _Max(logical_row_index)) / norm_factor;\n }");return r(r({},p),{output:{dims:e.dims,type:e.type,textureType:u.TextureType.unpacked},shaderSource:d})},y=function(t){if(!t||1!==t.length)throw new Error("Softmax requires 1 input.");if("float32"!==t[0].type&&"float64"!==t[0].type)throw new Error("Invalid input type")}},5975:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)},o=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(e,"__esModule",{value:!0}),e.parseSplitAttributes=e.split=void 0;var i=n(246),a=n(2517),s=n(2039),u={name:"Split",inputNames:["A"],inputTypes:[s.TextureType.unpacked]};e.split=function(t,e,n){f(e);for(var o=a.ShapeUtil.normalizeAxis(n.axis,e[0].dims.length),i=c(t,e,o,n),s=[],p=function(i){s.push(t.run(r(r({},u),{cacheHint:"".concat(n.cacheKey,";").concat(i),get:function(){return l(t,e[0],n,o,i)}}),e))},h=0;h<i;++h)p(h);return s},e.parseSplitAttributes=function(t){var e=t.attributes.getInt("axis",0),n=t.attributes.getInts("split",[]),r=t.outputs.length;return(0,i.createAttributeWithCacheKey)({axis:e,split:n,numOutputs:r})};var c=function(t,e,n,r){return o(a.SplitUtil.splitShape(e[0].dims,n,r.split,r.numOutputs),2)[1].length},l=function(t,e,n,i,c){var l=o(a.SplitUtil.splitShape(e.dims,i,n.split,n.numOutputs),2),f=l[0],p=l[1][c],h=f[c],d=h.length,g="\n float process(int indices[".concat(d,"]) {\n indices[").concat(i,"] += ").concat(p,";\n return _A(indices);\n }\n ");return r(r({},u),{cacheHint:"".concat(n.cacheKey,":").concat(c),output:{dims:h,type:e.type,textureType:s.TextureType.unpacked},shaderSource:g})},f=function(t){if(!t||1!==t.length)throw new Error("Split requires one input.");if("int8"!==t[0].type&&"uint8"!==t[0].type&&"int16"!==t[0].type&&"uint16"!==t[0].type&&"int32"!==t[0].type&&"uint32"!==t[0].type&&"float32"!==t[0].type&&"float64"!==t[0].type&&"bool"!==t[0].type)throw new Error("Invalid input type.")}},3933:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseSqueezeAttributes=e.squeezeV13=e.squeeze=void 0;var r=n(2517);e.squeeze=function(t,e,n){o(e);var i=r.ShapeUtil.squeezeShape(e[0].dims,n);return[t.reshapeUnpacked(e[0],i)]},e.squeezeV13=function(t,n){return i(n),(0,e.squeeze)(t,[n[0]],Array.from(n[1].integerData))},e.parseSqueezeAttributes=function(t){return t.attributes.getInts("axes")};var o=function(t){if(!t||1!==t.length)throw new Error("Squeeze requires 1 input.");if("string"===t[0].type)throw new Error("invalid input tensor types.")},i=function(t){if(!t||2!==t.length)throw new Error("Squeeze requires 2 inputs.");if("int32"!==t[1].type)throw new Error("Invalid input type.")}},6558:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.sum=void 0;var o=n(5060),i=n(2039);e.sum=function(t,e){s(e);var n={name:"Sum",inputNames:e.map((function(t,e){return"X".concat(e)})),inputTypes:new Array(e.length).fill(i.TextureType.unpacked)};return[t.run(r(r({},n),{get:function(){return a(t,e,n)}}),e)]};var a=function(t,e,n){var a=(0,o.getGlsl)(t.session.backend.glContext.version),s=e[0].dims.slice(),u=e.map((function(t,e){return"".concat(a.texture2D,"(X").concat(e,",TexCoords)")})).join(" + "),c="\n void main() {\n vec4 result = ".concat(u,";\n ").concat(a.output," = result;\n }\n ");return r(r({},n),{output:{dims:s,type:e[0].type,textureType:i.TextureType.unpacked},hasMain:!0,shaderSource:c})},s=function(t){if(!t||0===t.length)throw new Error("Sum requires inputs.");for(var e=t[0].dims.length,n=1;n<t.length;n++){if(e!==t[n].dims.length)throw new Error("Input shapes are mismatched.");for(var r=0;r<e;r++)if(t[0].dims[r]!==t[n].dims[r])throw new Error("Input shapes are not matched.")}if("float32"!==t[0].type&&"float64"!==t[0].type)throw new Error("Invalid input type.");for(n=1;n<t.length;n++)if(t[0].type!==t[n].type)throw new Error("Input types are not matched.")}},5723:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.tile=void 0;var o=n(782),i=n(2039);e.tile=function(t,e){s(e);var n={name:"Tile",inputNames:["A"],inputTypes:[i.TextureType.unpacked]};return[t.run(r(r({},n),{get:function(){return a(t,e,n)}}),e)]};var a=function(t,e,n){for(var o=e[0].dims.slice(),a=new Array(o.length),s=[],u=0;u<o.length;u++)a[u]=o[u]*e[1].numberData[u],s.push("inputIdx[".concat(u,"] = int(mod(float(outputIdx[").concat(u,"]), ").concat(o[u],".));"));var c=a.length,l="\n float process(int outputIdx[".concat(c,"]) {\n int inputIdx[").concat(c,"];\n ").concat(s.join("\n"),"\n return _A(inputIdx);\n }\n ");return r(r({},n),{output:{dims:a,type:e[0].type,textureType:i.TextureType.unpacked},shaderSource:l})},s=function(t){if(!t||2!==t.length)throw new Error("Tile requires 2 input.");if(1!==t[1].dims.length)throw new Error("The second input shape must 1 dimension.");if(t[1].dims[0]!==t[0].dims.length)throw new Error("Invalid input shape.");if(-1===o.NUMBER_TYPES.indexOf(t[0].type))throw new Error("Invalid input type.");if("int32"!==t[1].type&&"int16"!==t[1].type)throw new Error("Invalid repeat type.")}},3738:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)},o=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},i=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.parseTransposeAttributes=e.transpose=void 0;var a=n(246),s=n(2517),u=n(2039),c={name:"Transpose",inputNames:["A"],inputTypes:[u.TextureType.unpacked]};e.transpose=function(t,e,n){return d(e),[t.run(r(r({},c),{cacheHint:n.cacheKey,get:function(){return l(t,e[0],n.perm)}}),e)]},e.parseTransposeAttributes=function(t){return(0,a.createAttributeWithCacheKey)({perm:t.attributes.getInts("perm",[])})};var l=function(t,e,n){var o=e.dims;n=f(o,n);var i=p(o,n),a=o.length,s="\n ".concat(h("perm",n,a),"\n float process(int indices[").concat(a,"]) {\n int a[").concat(a,"];\n perm(a, indices);\n return _A(a);\n }");return r(r({},c),{output:{dims:i,type:e.type,textureType:u.TextureType.unpacked},shaderSource:s})},f=function(t,e){return e&&e.length!==t.length&&(e=i([],o(t.keys()),!1).reverse()),e},p=function(t,e){return e=f(t,e),s.ShapeUtil.sortBasedOnPerm(t,e)},h=function(t,e,n){var r=[];r.push("void ".concat(t,"(out int a[").concat(n,"], int src[").concat(n,"]) {"));for(var o=0;o<n;++o)r.push("\ta[".concat(e[o],"]=src[").concat(o,"];"));return r.push("\t}"),r.join("\n")},d=function(t){if(!t||1!==t.length)throw new Error("Transpose requires 1 input.");if("float32"!==t[0].type&&"float64"!==t[0].type)throw new Error("input should be float tensor")}},8710:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.encodeAsUint8=void 0;var r=n(5060),o=n(2039);e.encodeAsUint8=function(t,e){var n=e.shape,i=(0,r.getGlsl)(t.session.backend.glContext.version),a="\n const float FLOAT_MAX = 1.70141184e38;\n const float FLOAT_MIN = 1.17549435e-38;\n\n bool isNaN(float val) {\n return (val < 1.0 || 0.0 < val || val == 0.0) ? false : true;\n }\n\n highp vec4 encodeAsUint8(highp float v) {\n if (isNaN(v)) {\n return vec4(255, 255, 255, 255);\n }\n\n highp float av = abs(v);\n\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 255.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n highp float e = floor(log2(av));\n highp float m = exp2(fract(log2(av))) - 1.0;\n\n c[2] = floor(128.0 * m);\n m -= c[2] / 128.0;\n c[1] = floor(32768.0 * m);\n m -= c[1] / 32768.0;\n c[0] = floor(8388608.0 * m);\n\n highp float ebias = e + 127.0;\n c[3] = floor(ebias / 2.0);\n ebias -= c[3] * 2.0;\n c[2] += floor(ebias) * 128.0;\n\n c[3] += 128.0 * step(0.0, -v);\n\n return c / 255.0;\n }\n\n void main() {\n float value = ".concat(i.texture2D,"(X,TexCoords).r;\n ").concat(i.output," = encodeAsUint8(value);\n }"),s={name:"Uint8Encode",inputTypes:[o.TextureType.unpacked],inputNames:["X"],output:{dims:n,type:e.tensor.type,textureType:o.TextureType.downloadUint8AsFloat},shaderSource:a,hasMain:!0};return t.executeProgram(s,[e.tensor])}},4909:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.tanh=e.tan=e.sqrt=e.sin=e.sigmoid=e.relu=e.not=e.neg=e.log=e.parseLeakyReluAttributes=e.leakyRelu=e.identity=e.floor=e.exp=e.parseEluAttributes=e.elu=e.cos=e.ceil=e.clipV11=e.parseClipAttributes=e.clip=e.atan=e.asin=e.acos=e.abs=e.glslTanh=e.glslTan=e.glslSqrt=e.glslSigmoid=e.glslRelu=e.glslSin=e.glslNot=e.glslNeg=e.glslLog=e.glslLeakyRelu=e.glslIdentity=e.glslClip=e.glslFloor=e.glslExp=e.glslElu=e.glslCos=e.glslCeil=e.glslAtan=e.glslAsin=e.glslAcos=e.glslAbs=void 0;var o=n(246),i=n(2517),a=n(8520),s=n(5060),u=n(2039);function c(){return D("abs")}function l(){return D("acos")}function f(){return D("asin")}function p(){return D("atan")}function h(){return D("ceil")}function d(){return D("cos")}function g(t){var e="elu";return{body:"\n const float alpha = float(".concat(t,");\n\n float ").concat(e,"_(float a) {\n return a >= 0.0 ? a: (exp(a) - 1.0) * alpha;\n }\n vec4 ").concat(e,"_(vec4 v) {\n return vec4(").concat(e,"_(v.x), ").concat(e,"_(v.y), ").concat(e,"_(v.z), ").concat(e,"_(v.w));\n }\n "),name:e,type:a.FunctionType.ValueBased}}function b(){return D("exp")}function y(){return D("floor")}function m(t,e){var n="clip";return{body:"\n const float min = float(".concat(t,");\n const float max = float(").concat(e,");\n\n float ").concat(n,"_(float a) {\n return clamp(a, min, max);\n }\n vec4 ").concat(n,"_(vec4 v) {\n return clamp(v, min, max);\n }\n "),name:n,type:a.FunctionType.ValueBased}}function v(){var t="indentity";return{body:"\n float ".concat(t,"_(float a) {\n return a;\n }\n vec4 ").concat(t,"_(vec4 v) {\n return v;\n }\n "),name:t,type:a.FunctionType.ValueBased}}function _(t){var e="leakyRelu";return{body:"\n const float alpha = float(".concat(t,");\n\n float ").concat(e,"_(float a) {\n return a < 0.0 ? a * alpha : a;\n }\n vec4 ").concat(e,"_(vec4 v) {\n return vec4(").concat(e,"_(v.x), ").concat(e,"_(v.y), ").concat(e,"_(v.z), ").concat(e,"_(v.w));\n }\n "),name:e,type:a.FunctionType.ValueBased}}function w(){return D("log")}function x(){var t="neg";return{body:"\n float ".concat(t,"_(float a) {\n return -a;\n }\n vec4 ").concat(t,"_(vec4 v) {\n return -v;\n }\n "),name:t,type:a.FunctionType.ValueBased}}function T(){var t="not";return{body:"\n float ".concat(t,"_(float a) {\n return float( ! bool(a) );\n }\n bool ").concat(t,"_(bool a) {\n return !a;\n }\n vec4 ").concat(t,"_(vec4 v) {\n return vec4(!bool(v.x), !bool(v.y), !bool(v.z), !bool(v.w));\n }\n bvec4 ").concat(t,"_(bvec4 v) {\n return bvec4(!v.x, !v.y, !v.z, !v.w);\n }\n "),name:t,type:a.FunctionType.ValueBased}}function S(){return D("sin")}function O(){var t="relu";return{body:"\n float ".concat(t,"_(float a) {\n return max( a, 0.0 );\n }\n vec4 ").concat(t,"_(vec4 v) {\n return max( v, 0.0 );\n }\n "),name:t,type:a.FunctionType.ValueBased}}function A(){var t="sigmoid";return{body:"\n float ".concat(t,"_(float a) {\n return 1.0 / (1.0 + exp(-a));\n }\n vec4 ").concat(t,"_(vec4 v) {\n return 1.0 / (1.0 + exp(-v));\n }\n "),name:t,type:a.FunctionType.ValueBased}}function E(){return D("sqrt")}function I(){return D("tan")}function P(){var t="tanh";return{body:"\n float ".concat(t,"_(float a) {\n a = clamp(a, -10., 10.);\n a = exp(2.*a);\n return (a - 1.) / (a + 1.);\n }\n vec4 ").concat(t,"_(vec4 v) {\n v = clamp(v, -10., 10.);\n v = exp(2.*v);\n return (v - 1.) / (v + 1.);\n }\n "),name:t,type:a.FunctionType.ValueBased}}function D(t){return{body:"\n float ".concat(t,"_(float a) {\n return ").concat(t,"(a);\n }\n vec4 ").concat(t,"_(vec4 v) {\n return ").concat(t,"(v);\n }\n "),name:t,type:a.FunctionType.ValueBased}}e.glslAbs=c,e.glslAcos=l,e.glslAsin=f,e.glslAtan=p,e.glslCeil=h,e.glslCos=d,e.glslElu=g,e.glslExp=b,e.glslFloor=y,e.glslClip=m,e.glslIdentity=v,e.glslLeakyRelu=_,e.glslLog=w,e.glslNeg=x,e.glslNot=T,e.glslSin=S,e.glslRelu=O,e.glslSigmoid=A,e.glslSqrt=E,e.glslTan=I,e.glslTanh=P;var k=function(t,e,n,o){var i=t.session.pack?u.TextureType.packed:u.TextureType.unpacked,a={name:n.name,inputTypes:[i],inputNames:["A"],cacheHint:o};return r(r({},a),{get:function(){return function(t,e,n,o){var i=t.session.pack?u.TextureType.packed:u.TextureType.unpacked,a=(0,s.getGlsl)(t.session.backend.glContext.version);return r(r({},e),{output:{dims:n.dims,type:n.type,textureType:i},shaderSource:"\n ".concat(o.body,"\n void main() {\n vec4 v = ").concat(a.texture2D,"(A, TexCoords);\n v = ").concat(o.name,"_(v);\n ").concat(a.output," = v;\n }\n "),hasMain:!0})}(t,a,e,n)}})};e.abs=function(t,e){return[t.run(k(t,e[0],c()),e)]},e.acos=function(t,e){return[t.run(k(t,e[0],l()),e)]},e.asin=function(t,e){return[t.run(k(t,e[0],f()),e)]},e.atan=function(t,e){return[t.run(k(t,e[0],p()),e)]},e.clip=function(t,e,n){return[t.run(k(t,e[0],m(n.min,n.max),n.cacheKey),e)]},e.parseClipAttributes=function(t){return(0,o.createAttributeWithCacheKey)({min:t.attributes.getFloat("min",i.MIN_CLIP),max:t.attributes.getFloat("max",i.MAX_CLIP)})},e.clipV11=function(t,n){var r=C(t,n);return(0,e.clip)(t,[n[0]],r)};var C=function(t,e){if(e.length>=3&&(!t.session.isInitializer(e[1].dataId)||!t.session.isInitializer(e[2].dataId)))throw new Error("dynamic clip attributes are not allowed");var n=e.length>=3?e[1].numberData[0]:i.MIN_CLIP,r=e.length>=3?e[2].numberData[0]:i.MAX_CLIP;return(0,o.createAttributeWithCacheKey)({min:n,max:r})};e.ceil=function(t,e){return[t.run(k(t,e[0],h()),e)]},e.cos=function(t,e){return[t.run(k(t,e[0],d()),e)]},e.elu=function(t,e,n){return[t.run(k(t,e[0],g(n.alpha),n.cacheKey),e)]},e.parseEluAttributes=function(t){return(0,o.createAttributeWithCacheKey)({alpha:t.attributes.getFloat("alpha",1)})},e.exp=function(t,e){return[t.run(k(t,e[0],b()),e)]},e.floor=function(t,e){return[t.run(k(t,e[0],y()),e)]},e.identity=function(t,e){return[t.run(k(t,e[0],v()),e)]},e.leakyRelu=function(t,e,n){return[t.run(k(t,e[0],_(n.alpha),n.cacheKey),e)]},e.parseLeakyReluAttributes=function(t){return(0,o.createAttributeWithCacheKey)({alpha:t.attributes.getFloat("alpha",.01)})},e.log=function(t,e){return[t.run(k(t,e[0],w()),e)]},e.neg=function(t,e){return[t.run(k(t,e[0],x()),e)]},e.not=function(t,e){return[t.run(k(t,e[0],T()),e)]},e.relu=function(t,e){return[t.run(k(t,e[0],O()),e)]},e.sigmoid=function(t,e){return[t.run(k(t,e[0],A()),e)]},e.sin=function(t,e){return[t.run(k(t,e[0],S()),e)]},e.sqrt=function(t,e){return[t.run(k(t,e[0],E()),e)]},e.tan=function(t,e){return[t.run(k(t,e[0],I()),e)]},e.tanh=function(t,e){return[t.run(k(t,e[0],P()),e)]}},5611:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.createUnpackProgramInfoLoader=e.createUnpackProgramInfo=void 0;var o=n(5060),i=n(2039),a=n(9390),s=n(2827),u={name:"unpack",inputNames:["A"],inputTypes:[i.TextureType.packed]};e.createUnpackProgramInfo=function(t,e){var n=e.dims.length,c=(0,s.getChannels)("rc",n),l=c.slice(-2),f=(0,a.getCoordsDataType)(n),p=(0,s.unpackFromChannel)(),h=0===e.dims.length?"":function(t,e){if(1===t)return"rc";for(var n="",r=0;r<t;r++)n+=e[r],r<t-1&&(n+=",");return n}(n,c),d=n<=1?"rc":"vec2(".concat(l.join(","),")"),g=(0,o.getGlsl)(t.session.backend.glContext.version),b="\n ".concat(p,"\n void main() {\n ").concat(f," rc = getOutputCoords();\n\n // Sample the texture with the coords to get the rgba channel value.\n vec4 packedInput = getA(").concat(h,");\n\n ").concat(g.output," = vec4(getChannel(packedInput, ").concat(d,"), 0, 0, 0);\n }\n ");return r(r({},u),{hasMain:!0,output:{dims:e.dims,type:e.type,textureType:i.TextureType.unpacked},shaderSource:b})},e.createUnpackProgramInfoLoader=function(t,n){return r(r({},u),{get:function(){return(0,e.createUnpackProgramInfo)(t,n)}})}},8428:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseUnsqueezeAttributes=e.unsqueezeV13=e.unsqueeze=void 0;var r=n(2517);e.unsqueeze=function(t,e,n){o(e);var i=r.ShapeUtil.unsqueezeShape(e[0].dims,n);return[t.reshapeUnpacked(e[0],i)]},e.unsqueezeV13=function(t,n){return i(n),(0,e.unsqueeze)(t,[n[0]],Array.from(n[1].integerData))},e.parseUnsqueezeAttributes=function(t){return t.attributes.getInts("axes")};var o=function(t){if(!t||1!==t.length)throw new Error("Unsqueeze requires 1 input.");if("string"===t[0].type)throw new Error("invalid input tensor types.")},i=function(t){if(!t||2!==t.length)throw new Error("Unsqueeze requires 2 inputs.");if("int32"!==t[1].type)throw new Error("Invalid input type.")}},9793:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)},o=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},i=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.scalesValidation=e.validateInputs=e.parseUpsampleAttributes=e.parseUpsampleAttributesV9=e.parseUpsampleAttributesV7=e.upsample=void 0;var a=n(246),s=n(5060),u=n(2039),c={name:"Upsample",inputNames:["X"],inputTypes:[u.TextureType.unpacked]};e.upsample=function(t,n,o){return(0,e.validateInputs)(n,o),[t.run(r(r({},c),{cacheHint:o.cacheKey,get:function(){return l(t,n,o)}}),n)]},e.parseUpsampleAttributesV7=function(t){return(0,e.parseUpsampleAttributes)(t,7)},e.parseUpsampleAttributesV9=function(t){return(0,e.parseUpsampleAttributes)(t,9)},e.parseUpsampleAttributes=function(t,n){var r=n>=10,o=t.attributes.getString("mode","nearest");if("nearest"!==o&&"linear"!==o&&(n<11||"cubic"!==o))throw new Error("unrecognized mode: ".concat(o));var i=[];n<9&&(i=t.attributes.getFloats("scales"),(0,e.scalesValidation)(i,o,r));var s=t.attributes.getFloat("extrapolation_value",0),u=n>10?t.attributes.getString("coordinate_transformation_mode","half_pixel"):"asymmetric";if(-1===["asymmetric","pytorch_half_pixel","tf_half_pixel_for_nn","align_corners","tf_crop_and_resize","half_pixel"].indexOf(u))throw new Error("coordinate_transform_mode '".concat(u,"' is not supported"));var c="tf_crop_and_resize"===u,l=c,f="nearest"===o&&n>=11?t.attributes.getString("nearest_mode","round_prefer_floor"):"";if(-1===["round_prefer_floor","round_prefer_ceil","floor","ceil",""].indexOf(f))throw new Error("nearest_mode '".concat(f,"' is not supported"));var p=t.attributes.getFloat("cubic_coeff_a",-.75),h=0!==t.attributes.getInt("exclude_outside",0);if(h&&"cubic"!==o)throw new Error("exclude_outside can be set to 1 only when mode is CUBIC.");var d=n<11||"nearest"===o&&"asymmetric"===u&&"floor"===f,g=0,b=0,y=0;return n>10?t.inputs.length>2?(g=1,b=2,y=3):(b=1,y=2):9===n&&(b=1),(0,a.createAttributeWithCacheKey)({opset:n,isResize:r,mode:o,scales:i,extrapolationValue:s,coordinateTransformMode:u,useExtrapolation:l,needRoiInput:c,nearestMode:f,cubicCoefficientA:p,excludeOutside:h,useNearest2xOptimization:d,roiInputIdx:g,scalesInputIdx:b,sizesInputIdx:y})};var l=function(t,e,n){for(var i=(0,s.getGlsl)(t.session.backend.glContext.version),a=o(t.calculateTextureWidthAndHeight(e[0].dims,u.TextureType.unpacked),2),l=a[0],f=a[1],p=e[0].dims.map((function(t,e){return Math.floor(t*n.scales[e])})),h=o(t.calculateTextureWidthAndHeight(p,u.TextureType.unpacked),2),d=h[0],g=h[1],b=p.length,y=new Array(b),m=new Array(b),v="\n int output_pitches[".concat(b,"];\n int input_pitches[").concat(b,"];\n "),_=b-1;_>=0;_--)y[_]=_===b-1?1:y[_+1]*p[_+1],m[_]=_===b-1?1:m[_+1]*e[0].dims[_+1],v+="\n output_pitches[".concat(_,"] = ").concat(y[_],";\n input_pitches[").concat(_,"] = ").concat(m[_],";\n ");var w="\n float getInputFloat(int index) {\n vec2 coords = offsetToCoords(index, ".concat(l,", ").concat(f,");\n float value = getColorAsFloat(").concat(i.texture2D,"(X, coords));\n return value;\n }\n "),x="nearest"===n.mode?"\n ".concat(w,"\n float process(int indices[").concat(b,"]) {\n int input_index = 0;\n int output_index = coordsToOffset(TexCoords, ").concat(d,", ").concat(g,");\n\n ").concat(v,"\n\n int d, m;\n for (int dim = 0; dim < ").concat(b,"; ++dim) {\n d = output_index / output_pitches[dim];\n m = output_index - d * output_pitches[dim];\n output_index = m;\n\n if (scales[dim] != 1 && d > 0) {\n int d2 = d / scales[dim];\n m = d - d2 * scales[dim];\n d = d2;\n }\n input_index += input_pitches[dim] * d;\n }\n\n return getInputFloat(input_index);\n }"):4===b?"\n ".concat(w,"\n float process(int indices[4]) {\n int input_index = 0;\n int output_index = coordsToOffset(TexCoords, ").concat(d,", ").concat(g,");\n\n ").concat(v,"\n\n int m;\n int index_of_dim0, index_of_dim1, index_of_dim2, index_of_dim3;\n index_of_dim0 = output_index / output_pitches[0];\n m = output_index - index_of_dim0 * output_pitches[0];\n index_of_dim1 = m / output_pitches[1];\n m = m - index_of_dim1 * output_pitches[1];\n index_of_dim2 = m / output_pitches[2];\n m = m - index_of_dim2 * output_pitches[2];\n index_of_dim3 = m;\n\n int index_of_input_dim2, index_of_input_dim3, x_offset, y_offset;\n index_of_input_dim2 = index_of_dim2 / scales[2];\n y_offset = index_of_dim2 - index_of_input_dim2 * scales[2];\n index_of_input_dim3 = index_of_dim3 / scales[3];\n x_offset = index_of_dim3 - index_of_input_dim3 * scales[3];\n\n input_index = index_of_dim0 * input_pitches[0] +\n index_of_dim1 * input_pitches[1] +\n index_of_input_dim2 * input_pitches[2] +\n index_of_input_dim3;\n\n float x00 = getInputFloat(input_index);\n float x10, x01, x11;\n\n bool end_of_dim2 = false;\n if (index_of_input_dim2 == (").concat(e[0].dims[2]," - 1)) {\n // It's the end in dimension 2\n x01 = x00;\n end_of_dim2 = true;\n } else {\n x01 = getInputFloat(input_index + input_pitches[2]);\n }\n\n if (index_of_input_dim3 == (input_pitches[2] - 1)) {\n // It's the end in dimension 3\n x10 = x00;\n x11 = x01;\n }\n else {\n x10 = getInputFloat(input_index + 1);\n x11 = end_of_dim2 ? x10 : getInputFloat(input_index + input_pitches[2] + 1);\n }\n\n float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[2]);\n float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[2]);\n return y0 + float(x_offset) * (y1 - y0) / float(scales[3]);\n }"):"\n ".concat(w,"\n float process(int indices[2]) {\n int input_index = 0;\n int output_index = coordsToOffset(TexCoords, ").concat(d,", ").concat(g,");\n\n ").concat(v,"\n\n int m;\n int index_of_dim0, index_of_dim1;\n index_of_dim0 = output_index / output_pitches[0];\n m = output_index - index_of_dim0 * output_pitches[0];\n index_of_dim1 = m;\n\n int index_of_input_dim0, index_of_input_dim1, x_offset, y_offset;\n index_of_input_dim0 = index_of_dim0 / scales[0];\n y_offset = index_of_dim0 - index_of_input_dim0 * scales[0];\n index_of_input_dim1 = index_of_dim1 / scales[1];\n x_offset = index_of_dim1 - index_of_input_dim1 * scales[1];\n\n input_index = index_of_input_dim0 * input_pitches[0] + index_of_input_dim1;\n\n float x00 = getInputFloat(input_index);\n float x10, x01, x11;\n\n bool end_of_dim0 = false;\n if (index_of_input_dim0 == (").concat(e[0].dims[0]," - 1)) {\n // It's the end in dimension 0\n x01 = x00;\n end_of_dim0 = true;\n } else {\n x01 = getInputFloat(input_index + input_pitches[0]);\n }\n\n if (index_of_input_dim1 == (input_pitches[0] - 1)) {\n // It's the end in dimension 1\n x10 = x00;\n x11 = x01;\n }\n else {\n x10 = getInputFloat(input_index + 1);\n x11 = end_of_dim0 ? x10 : getInputFloat(input_index + input_pitches[0] + 1);\n }\n\n float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[0]);\n float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[0]);\n return y0 + float(x_offset) * (y1 - y0) / float(scales[1]);\n }");return r(r({},c),{output:{dims:p,type:e[0].type,textureType:u.TextureType.unpacked},shaderSource:x,variables:[{name:"scales",type:"int",arrayLength:n.scales.length,data:n.scales.map((function(t){return Math.ceil(t)}))}]})};e.validateInputs=function(t,e){if(!t||e.opset<9&&1!==t.length||e.opset>=9&&e.opset<11&&2!==t.length||e.opset>=11&&t.length<2)throw new Error("invalid inputs.");if(e.scales.length>0&&t[0].dims.length!==e.scales.length)throw new Error("Invalid input shape.");if("string"===t[0].type)throw new Error("Invalid input tensor types.")},e.scalesValidation=function(t,e,n){var r,o,a,s;if(n)try{for(var u=i(t),c=u.next();!c.done;c=u.next())if(c.value<=0)throw new Error("Scale value should be greater than 0.")}catch(t){a={error:t}}finally{try{c&&!c.done&&(s=u.return)&&s.call(u)}finally{if(a)throw a.error}}else try{for(var l=i(t),f=l.next();!f.done;f=l.next())if(f.value<1)throw new Error("Scale value should be greater than or equal to 1.")}catch(t){r={error:t}}finally{try{f&&!f.done&&(o=l.return)&&o.call(l)}finally{if(r)throw r.error}}if(!("linear"!==e&&"cubic"!==e||2===t.length||4===t.length&&1===t[0]&&1===t[1]))throw new Error("'Linear' mode and 'Cubic' mode only support 2-D inputs ('Bilinear', 'Bicubic') or 4-D inputs with the corresponding outermost 2 scale values being 1 in the ".concat(n?"Resize":"Upsample"," opeartor."))}},1958:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)},o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.ProgramManager=void 0;var i=n(8453),a=n(6231),s=n(8879),u=n(5060),c=function(){function t(t,e,n){this.profiler=t,this.glContext=e,this.textureLayoutStrategy=n,this.repo=new Map,this.attributesBound=!1}return t.prototype.getArtifact=function(t){return this.repo.get(t)},t.prototype.setArtifact=function(t,e){this.repo.set(t,e)},t.prototype.run=function(t,e,n){var r,o=this;this.profiler.event("op","ProgramManager.run ".concat(null!==(r=t.programInfo.name)&&void 0!==r?r:"unknown kernel"),(function(){var r,i=o.glContext.gl,s=t.program;i.useProgram(s);try{o.bindOutput(n),o.attributesBound||o.bindAttributes(t.attribLocations),o.bindUniforms(t.uniformLocations,null!==(r=t.programInfo.variables)&&void 0!==r?r:[],e)}catch(e){throw a.Logger.error("ProgramManager",t.programInfo.shaderSource),e}o.profiler.event("backend","GlContext.draw()",(function(){o.glContext.draw()}))}),this.glContext)},t.prototype.dispose=function(){var t=this;this.vertexShader&&this.glContext.deleteShader(this.vertexShader),this.repo.forEach((function(e){return t.glContext.deleteProgram(e.program)}))},t.prototype.build=function(t,e,n){var r=this;return this.profiler.event("backend","ProgramManager.build",(function(){var o=new s.GlslPreprocessor(r.glContext,t,e,n),i=o.preprocess(),a=r.compile(i);return{programInfo:t,program:a,uniformLocations:r.getUniformLocations(a,o.context.programInfo.inputNames,o.context.programInfo.variables),attribLocations:r.getAttribLocations(a)}}))},t.prototype.compile=function(t){if(!this.vertexShader){a.Logger.verbose("ProrgramManager","Compiling and caching Vertex shader for the first time");var e=(0,u.getVertexShaderSource)(this.glContext.version);this.vertexShader=this.glContext.compileShader(e,this.glContext.gl.VERTEX_SHADER)}i.env.debug&&a.Logger.verbose("ProrgramManager","FragShader:\n".concat(t,"\n"));var n=this.glContext.compileShader(t,this.glContext.gl.FRAGMENT_SHADER),r=this.glContext.createProgram(this.vertexShader,n);return this.glContext.deleteShader(n),r},t.prototype.bindOutput=function(t){var e=t.width,n=t.height;a.Logger.verbose("ProrgramManager","Binding output texture to Framebuffer: w/h=".concat(e,"/").concat(n,", shape=").concat(t.shape,", type=").concat(t.tensor.type)),this.glContext.attachFramebuffer(t.texture,e,n)},t.prototype.bindAttributes=function(t){var e=t.position,n=t.textureCoord;this.glContext.setVertexAttributes(e,n),this.attributesBound=!0},t.prototype.bindUniforms=function(t,e,n){var r,i,a,s=this.glContext.gl,u=0,c=function(t,r,o,i){var c=null===(a=e.find((function(e){return e.name===t})))||void 0===a?void 0:a.data;if("sampler2D"!==r&&!c)throw new Error("variable '".concat(t,"' does not have data defined in program info"));switch(r){case"sampler2D":l.bindTexture(n[u],o,u),u++;break;case"float":i?s.uniform1fv(o,c):s.uniform1f(o,c);break;case"int":i?s.uniform1iv(o,c):s.uniform1i(o,c);break;default:throw new Error("Uniform not implemented: ".concat(r))}},l=this;try{for(var f=o(t),p=f.next();!p.done;p=f.next()){var h=p.value;c(h.name,h.type,h.location,h.arrayLength)}}catch(t){r={error:t}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}},t.prototype.bindTexture=function(t,e,n){this.glContext.bindTextureToUniform(t.texture,n,e)},t.prototype.getAttribLocations=function(t){return{position:this.getAttribLocation(t,"position"),textureCoord:this.getAttribLocation(t,"textureCoord")}},t.prototype.getUniformLocations=function(t,e,n){var i,a,s,u,c=[];if(e)try{for(var l=o(e),f=l.next();!f.done;f=l.next()){var p=f.value;c.push({name:p,type:"sampler2D",location:this.getUniformLocation(t,p)})}}catch(t){i={error:t}}finally{try{f&&!f.done&&(a=l.return)&&a.call(l)}finally{if(i)throw i.error}}if(n)try{for(var h=o(n),d=h.next();!d.done;d=h.next()){var g=d.value;c.push(r(r({},g),{location:this.getUniformLocation(t,g.name)}))}}catch(t){s={error:t}}finally{try{d&&!d.done&&(u=h.return)&&u.call(h)}finally{if(s)throw s.error}}return c},t.prototype.getUniformLocation=function(t,e){var n=this.glContext.gl.getUniformLocation(t,e);if(null===n)throw new Error("Uniform ".concat(e," not found."));return n},t.prototype.getAttribLocation=function(t,e){return this.glContext.gl.getAttribLocation(t,e)},t}();e.ProgramManager=c},6416:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WebGLSessionHandler=void 0;var r=n(6231),o=n(1047),i=n(8316),a=n(1640),s=n(1958),u=n(7859),c=n(5702),l=function(){function t(t,e){this.backend=t,this.context=e,this.layoutStrategy=new u.PreferLogicalStrategy(t.glContext.maxTextureSize),this.programManager=new s.ProgramManager(this.context.profiler,t.glContext,this.layoutStrategy),this.textureManager=new c.TextureManager(t.glContext,this.layoutStrategy,this.context.profiler,{reuseTextures:"full"===t.textureCacheMode}),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map,this.pack=t.pack,this.pack2unpackMap=new Map,this.unpack2packMap=new Map}return t.prototype.createInferenceHandler=function(){return new i.WebGLInferenceHandler(this)},t.prototype.onGraphInitialized=function(t){var e=t.getValues().filter((function(t){return-1===t.from&&t.tensor})).map((function(t){return t.tensor.dataId}));this.initializers=new Set(e)},t.prototype.isInitializer=function(t){return!!this.initializers&&this.initializers.has(t)},t.prototype.addInitializer=function(t){this.initializers.add(t)},t.prototype.getTextureData=function(t,e){return e?this.packedTextureDataCache.get(t):this.unpackedTextureDataCache.get(t)},t.prototype.setTextureData=function(t,e,n){void 0===n&&(n=!1),r.Logger.verbose("WebGLSessionHandler","Storing Texture data in cache"),n?this.packedTextureDataCache.set(t,e):this.unpackedTextureDataCache.set(t,e)},t.prototype.dispose=function(){var t=this;this.programManager.dispose(),this.textureManager.clearActiveTextures(),this.packedTextureDataCache.forEach((function(e){return t.textureManager.releaseTexture(e,!0)})),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache.forEach((function(e){return t.textureManager.releaseTexture(e,!0)})),this.unpackedTextureDataCache=new Map},t.prototype.resolve=function(t,e,n){var r=(0,o.resolveOperator)(t,e,a.WEBGL_OP_RESOLVE_RULES);return{impl:r.opImpl,context:r.opInit?r.opInit(t,n):t}},t}();e.WebGLSessionHandler=l},7769:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Uint8DataEncoder=e.RGBAFloatDataEncoder=e.RedFloat32DataEncoder=void 0;var r=n(6231),o=function(){function t(t,e){if(void 0===e&&(e=1),1===e)this.internalFormat=t.R32F,this.format=t.RED,this.textureType=t.FLOAT,this.channelSize=e;else{if(4!==e)throw new Error("Invalid number of channels: ".concat(e));this.internalFormat=t.RGBA32F,this.format=t.RGBA,this.textureType=t.FLOAT,this.channelSize=e}}return t.prototype.encode=function(t,e){var n,o;return t.constructor!==Float32Array&&(r.Logger.warning("Encoder","data was not of type Float32; creating new Float32Array"),o=new Float32Array(t)),e*this.channelSize>t.length?(r.Logger.warning("Encoder","Source data too small. Allocating larger array"),o=t,n=this.allocate(e*this.channelSize),o.forEach((function(t,e){return n[e]=t}))):n=o=t,n},t.prototype.allocate=function(t){return new Float32Array(4*t)},t.prototype.decode=function(t,e){return 1===this.channelSize?t.filter((function(t,e){return e%4==0})).subarray(0,e):t.subarray(0,e)},t}();e.RedFloat32DataEncoder=o;var i=function(){function t(t,e,n){if(void 0===e&&(e=1),1!==e&&4!==e)throw new Error("Invalid number of channels: ".concat(e));this.internalFormat=t.RGBA,this.format=t.RGBA,this.channelSize=e,this.textureType=n||t.FLOAT}return t.prototype.encode=function(t,e){var n=t;return 1===this.channelSize&&(r.Logger.verbose("Encoder","Exploding into a larger array"),n=this.allocate(e),t.forEach((function(t,e){return n[4*e]=t}))),n},t.prototype.allocate=function(t){return new Float32Array(4*t)},t.prototype.decode=function(t,e){return 1===this.channelSize?t.filter((function(t,e){return e%4==0})).subarray(0,e):t.subarray(0,e)},t}();e.RGBAFloatDataEncoder=i;var a=function(){function t(t,e){if(void 0===e&&(e=1),this.channelSize=4,1===e)this.internalFormat=t.ALPHA,this.format=t.ALPHA,this.textureType=t.UNSIGNED_BYTE,this.channelSize=e;else{if(4!==e)throw new Error("Invalid number of channels: ".concat(e));this.internalFormat=t.RGBA,this.format=t.RGBA,this.textureType=t.UNSIGNED_BYTE,this.channelSize=e}}return t.prototype.encode=function(t,e){return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)},t.prototype.allocate=function(t){return new Uint8Array(t*this.channelSize)},t.prototype.decode=function(t,e){if(t instanceof Uint8Array)return t.subarray(0,e);throw new Error("Invalid array type: ".concat(t.constructor))},t}();e.Uint8DataEncoder=a},7859:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getBatchDim=e.sizeToSquarishShape=e.getRowsCols=e.sizeFromShape=e.isInt=e.parseAxisParam=e.squeezeShape=e.PreferLogicalStrategy=e.AlwaysKeepOriginalSizeStrategy=void 0;var r=n(6231),o=n(2517),i=function(){function t(t){this.maxTextureSize=t}return t.prototype.computeTextureWH=function(t,e){if(0===t.length)return[1,1];var n=this.maxTextureSize;if(e&&void 0!==e.breakAxis){var o=e.breakAxis>=t.length?1:t.slice(e.breakAxis).reduce((function(t,e){return t*e})),i=e.breakAxis<=0?1:t.slice(0,e.breakAxis).reduce((function(t,e){return t*e}));if(!(o>n||i>n))return[o,i];r.Logger.verbose("TextureLayout","Given width/height preferences were unattainable: shape:".concat(t,", breakAxis:").concat(e.breakAxis))}for(var a=t.reduce((function(t,e){return t*e})),s=Math.floor(Math.sqrt(a));s<n&&s<a&&a%s!=0;s++);if(s>=n||a%s!=0)throw new Error("The given dimensions are outside this GPU's boundaries: ".concat(t));return[s,a/s]},t}();e.AlwaysKeepOriginalSizeStrategy=i;var a=function(){function t(t){this.maxTextureSize=t}return t.prototype.computeTextureWH=function(t,e){var n=this.computeTexture(t,e);return e&&e.isPacked&&(n[0]/=2,n[1]/=2),e&&e.reverseWH?[n[1],n[0]]:n},t.prototype.computeTexture=function(t,e){var n=e&&e.isPacked;if(0===t.length)return n?[2,2]:[1,1];var o=this.maxTextureSize;if(e&&void 0!==e.breakAxis){var i=e.breakAxis>=t.length?1:t.slice(e.breakAxis).reduce((function(t,e){return t*e})),a=e.breakAxis<=0?1:t.slice(0,e.breakAxis).reduce((function(t,e){return t*e}));if(!(i>o||a>o))return[i,a];r.Logger.verbose("TextureLayout","Given width/height preferences were unattainable: shape:".concat(t,", breakAxis:").concat(e.breakAxis))}var u=t.slice(0);if(n&&(o*=2,1===(u=u.map((function(t,e){return e>=u.length-2?u[e]%2==0?u[e]:u[e]+1:u[e]}))).length&&(u=[2,u[0]])),2!==u.length){var c=s(u);u=c.newShape}var p=l(u);return u.length<=1&&p<=o?[1,p]:2===u.length&&u[0]<=o&&u[1]<=o?u:3===u.length&&u[0]*u[1]<=o&&u[2]<=o?[u[0]*u[1],u[2]]:3===u.length&&u[0]<=o&&u[1]*u[2]<=o?[u[0],u[1]*u[2]]:4===u.length&&u[0]*u[1]*u[2]<=o&&u[3]<=o?[u[0]*u[1]*u[2],u[3]]:4===u.length&&u[0]<=o&&u[1]*u[2]*u[3]<=o?[u[0],u[1]*u[2]*u[3]]:n?f(p/4).map((function(t){return 2*t})):f(p)},t}();function s(t,e){for(var n=[],r=[],o=null!=e&&Array.isArray(e)&&0===e.length,i=null==e||o?null:u(e,t).sort(),a=0,s=0;s<t.length;++s){if(null!=i){if(i[a]===s&&1!==t[s])throw new Error("Can't squeeze axis ".concat(s," since its dim '").concat(t[s],"' is not 1"));(null==i[a]||i[a]>s)&&1===t[s]&&(n.push(t[s]),r.push(s)),i[a]<=s&&a++}1!==t[s]&&(n.push(t[s]),r.push(s))}return{newShape:n,keptDims:r}}function u(t,e){var n=e.length;return t=null==t?e.map((function(t,e){return e})):[].concat(t),(0,o.assert)(t.every((function(t){return t>=-n&&t<n})),(function(){return"All values in axis param must be in range [-".concat(n,", ").concat(n,") but ")+"got axis ".concat(t)})),(0,o.assert)(t.every(c),(function(){return"All values in axis param must be integers but "+"got axis ".concat(t)})),t.map((function(t){return t<0?n+t:t}))}function c(t){return t%1==0}function l(t){if(0===t.length)return 1;for(var e=t[0],n=1;n<t.length;n++)e*=t[n];return e}function f(t){var e=Math.ceil(Math.sqrt(t));return[e,Math.ceil(t/e)]}e.PreferLogicalStrategy=a,e.squeezeShape=s,e.parseAxisParam=u,e.isInt=c,e.sizeFromShape=l,e.getRowsCols=function(t){if(0===t.length)throw Error("Cannot get rows and columns of an empty shape array.");return[t.length>1?t[t.length-2]:1,t[t.length-1]]},e.sizeToSquarishShape=f,e.getBatchDim=function(t,e){return void 0===e&&(e=2),l(t.slice(0,t.length-e))}},4057:function(t,e,n){"use strict";var r=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(e,"__esModule",{value:!0}),e.createTextureLayoutFromShape=e.calculateTextureWidthAndHeight=e.createTextureLayoutFromTextureType=void 0;var o=n(2517),i=n(2039);e.createTextureLayoutFromTextureType=function(t,n,r){var o=r===i.TextureType.unpacked||r===i.TextureType.unpackedReversed?1:4,a=r===i.TextureType.packed,s=r===i.TextureType.unpackedReversed||r===i.TextureType.packed,u=r===i.TextureType.packedLastDimension?n.length-1:void 0,c=r===i.TextureType.packedLastDimension?n.map((function(t,e){return e===n.length-1?4*t:t})):void 0;return(0,e.createTextureLayoutFromShape)(t,n,o,c,{isPacked:a,reverseWH:s,breakAxis:u})},e.calculateTextureWidthAndHeight=function(t,n,r){var o=(0,e.createTextureLayoutFromTextureType)(t,n,r);return[o.width,o.height]},e.createTextureLayoutFromShape=function(t,e,n,i,a){void 0===n&&(n=1);var s=!(!a||!a.isPacked),u=r(t.computeTextureWH(s&&i||e,a),2),c=u[0],l=u[1],f=e.length,p=e.slice(0);if(0===f&&(p=[1]),1===n)i=e;else if(s){if(4!==n)throw new Error("a packed texture must be 4-channel");i=e,f>0&&(p[f-1]=Math.ceil(p[f-1]/2)),f>1&&(p[f-2]=Math.ceil(p[f-2]/2))}else if(!i)throw new Error("Unpacked shape is needed when using channels > 1");return{width:c,height:l,channels:n,isPacked:s,shape:p,strides:o.ShapeUtil.computeStrides(p),unpackedShape:i,reversedWH:a&&a.reverseWH}}},5702:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.TextureManager=void 0;var i=n(6231),a=function(){function t(t,e,n,r){this.glContext=t,this.layoutStrategy=e,this.profiler=n,this.config=r,this.pendingRead=new Map,r.reuseTextures&&(this.inUseTextures=new Map,this.idleTextures=new Map,this.textureLookup=new Map)}return t.prototype.createTextureFromLayout=function(t,e,n,r){var o=this.toEncoderType(t),a=this.glContext.getEncoder(o,e.channels||1,r);if(e.isPacked&&1===r)throw new Error("not implemented");var s,u,c=e.width,l=e.height;if(this.config.reuseTextures){s="".concat(c,"x").concat(l,"_").concat(a.format,"_").concat(a.internalFormat,"_").concat(a.textureType),(u=this.inUseTextures.get(s))||(u=[],this.inUseTextures.set(s,u));var f=this.idleTextures.get(s);if(f&&f.length>0){var p=f.pop();return u.push(p),1===r&&this.glContext.updateTexture(p,c,l,a,this.toTextureData(t,n)),p}}i.Logger.verbose("TextureManager","Creating new texture of size ".concat(e.width,"x").concat(e.height));var h=this.glContext.allocateTexture(c,l,a,this.toTextureData(t,n));return this.config.reuseTextures&&(u.push(h),this.textureLookup.set(h,s)),h},t.prototype.readTexture=function(t,e,n){var r=this;return n||(n=1),this.profiler.event("backend","TextureManager.readTexture",(function(){var o=t.shape.reduce((function(t,e){return t*e}))*n,i=r.glContext.readTexture(t.texture,t.width,t.height,o,r.toEncoderType(e),n);return r.toTensorData(e,i)}))},t.prototype.readTextureAsync=function(t,e,n){return r(this,void 0,void 0,(function(){var i,a,s=this;return o(this,(function(u){return i=t.tensor.dataId,n||(n=1),this.pendingRead.has(i)?(a=this.pendingRead.get(i),[2,new Promise((function(t){return null==a?void 0:a.push(t)}))]):[2,this.profiler.event("backend","TextureManager.readTextureAsync",(function(){return r(s,void 0,void 0,(function(){var r,a,s,u;return o(this,(function(o){switch(o.label){case 0:return this.pendingRead.set(i,[]),r=t.shape.reduce((function(t,e){return t*e}))*n,[4,this.glContext.createAndWaitForFence()];case 1:return o.sent(),a=this.glContext.readTexture(t.texture,t.width,t.height,r,this.toEncoderType(e),n),s=this.toTensorData(e,a),u=this.pendingRead.get(i),this.pendingRead.delete(i),null==u||u.forEach((function(t){return t(s)})),[2,s]}}))}))}))]}))}))},t.prototype.readUint8TextureAsFloat=function(t){var e=this;return this.profiler.event("backend","TextureManager.readUint8TextureAsFloat",(function(){var n=t.shape.reduce((function(t,e){return t*e})),r=e.glContext.readTexture(t.texture,t.width,t.height,4*n,"byte",4);return new Float32Array(r.buffer,r.byteOffset,n)}))},t.prototype.releaseTexture=function(t,e){var n;if(this.config.reuseTextures&&(n=this.textureLookup.get(t.texture))){e&&this.textureLookup.delete(n);var r=this.inUseTextures.get(n);if(r){var o=r.indexOf(t.texture);if(-1!==o){r.splice(o,1);var a=this.idleTextures.get(n);a||(a=[],this.idleTextures.set(n,a)),a.push(t.texture)}}}n&&!e||(i.Logger.verbose("TextureManager","Deleting texture of size ".concat(t.width,"x").concat(t.height)),this.glContext.deleteTexture(t.texture))},t.prototype.toTensorData=function(t,e){switch(t){case"int16":return e instanceof Int16Array?e:Int16Array.from(e);case"int32":return e instanceof Int32Array?e:Int32Array.from(e);case"int8":return e instanceof Int8Array?e:Int8Array.from(e);case"uint16":return e instanceof Uint16Array?e:Uint16Array.from(e);case"uint32":return e instanceof Uint32Array?e:Uint32Array.from(e);case"uint8":case"bool":return e instanceof Uint8Array?e:Uint8Array.from(e);case"float32":return e instanceof Float32Array?e:Float32Array.from(e);case"float64":return e instanceof Float64Array?e:Float64Array.from(e);default:throw new Error("TensorData type ".concat(t," is not supported"))}},t.prototype.toTextureData=function(t,e){if(e)return e instanceof Float32Array?e:new Float32Array(e)},t.prototype.toEncoderType=function(t){return"float"},t.prototype.clearActiveTextures=function(){this.glContext.clearActiveTextures()},t}();e.TextureManager=a},2039:function(t,e){"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.TextureType=void 0,(n=e.TextureType||(e.TextureType={}))[n.unpacked=0]="unpacked",n[n.unpackedReversed=1]="unpackedReversed",n[n.packed=2]="packed",n[n.downloadUint8AsFloat=3]="downloadUint8AsFloat",n[n.packedLastDimension=4]="packedLastDimension"},9390:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.getGlChannels=e.getCoordsDataType=e.getSqueezedParams=e.squeezeInputShape=e.generateShaderFuncNameFromInputSamplerNameAtOutCoords=e.generateShaderFuncNameFromInputSamplerName=e.repeatedTry=e.getPackedShape=void 0;var i=n(2517);e.getPackedShape=function(t){var e=t.length;return t.slice(0,e-1).concat(t[e-1]/4)},e.repeatedTry=function(t,e,n){return void 0===e&&(e=function(t){return 0}),r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,new Promise((function(r,o){var i=0,a=function(){if(t())r();else{i++;var s=e(i);null!=n&&i>=n?o():setTimeout(a,s)}};a()}))]}))}))},e.generateShaderFuncNameFromInputSamplerName=function(t){return(0,i.assert)(void 0!==t&&0!==t.length,(function(){return"empty string found for sampler name"})),"get"+t.charAt(0).toUpperCase()+t.slice(1)},e.generateShaderFuncNameFromInputSamplerNameAtOutCoords=function(t){return(0,i.assert)(void 0!==t&&0!==t.length,(function(){return"empty string found for sampler name"})),"get"+t.charAt(0).toUpperCase()+t.slice(1)+"AtOutCoords"},e.squeezeInputShape=function(t,e){return JSON.parse(JSON.stringify(t)),e},e.getSqueezedParams=function(t,e){return e.map((function(e){return t[e]})).join(", ")},e.getCoordsDataType=function(t){if(t<=1)return"int";if(2===t)return"ivec2";if(3===t)return"ivec3";if(4===t)return"ivec4";if(5===t)return"ivec5";if(6===t)return"ivec6";throw Error("GPU for rank ".concat(t," is not yet supported"))},e.getGlChannels=function(t){return void 0===t&&(t=6),["x","y","z","w","u","v"].slice(0,t)}},7305:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createNewWebGLContext=e.createWebGLContext=void 0;var r=n(6231),o=n(1713),i={};function a(t){var e,n=function(){if("undefined"==typeof document){if("undefined"==typeof OffscreenCanvas)throw new TypeError("failed to create canvas: OffscreenCanvas is not supported");return new OffscreenCanvas(1,1)}var t=document.createElement("canvas");return t.width=1,t.height=1,t}(),i={alpha:!1,depth:!1,antialias:!1,stencil:!1,preserveDrawingBuffer:!1,premultipliedAlpha:!1,failIfMajorPerformanceCaveat:!1};if((!t||"webgl2"===t)&&(e=n.getContext("webgl2",i)))try{return new o.WebGLContext(e,2)}catch(t){r.Logger.warning("GlContextFactory","failed to create WebGLContext using contextId 'webgl2'. Error: ".concat(t))}if((!t||"webgl"===t)&&(e=n.getContext("webgl",i)||n.getContext("experimental-webgl",i)))try{return new o.WebGLContext(e,1)}catch(t){r.Logger.warning("GlContextFactory","failed to create WebGLContext using contextId 'webgl' or 'experimental-webgl'. Error: ".concat(t))}throw new Error("WebGL is not supported")}e.createWebGLContext=function t(e){var n;e&&"webgl2"!==e||!("webgl2"in i)?e&&"webgl"!==e||!("webgl"in i)||(n=i.webgl):n=i.webgl2,n=n||a(e),e=e||1===n.version?"webgl":"webgl2";var r=n.gl;return i[e]=n,r.isContextLost()?(delete i[e],t(e)):(r.disable(r.DEPTH_TEST),r.disable(r.STENCIL_TEST),r.disable(r.BLEND),r.disable(r.DITHER),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SAMPLE_COVERAGE),r.enable(r.SCISSOR_TEST),r.enable(r.CULL_FACE),r.cullFace(r.BACK),n)},e.createNewWebGLContext=a},1713:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(e,n);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,o)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return o(e,t),e},a=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.WebGLContext=e.linearSearchLastTrue=void 0;var u=n(8453),c=i(n(7769)),l=n(9390);function f(t){for(var e=0;e<t.length&&t[e]();++e);return e-1}e.linearSearchLastTrue=f;var p=function(){function t(t,e){this.frameBufferBound=!1,this.itemsToPoll=[],this.gl=t,this.version=e,this.getExtensions(),this.vertexbuffer=this.createVertexbuffer(),this.framebuffer=this.createFramebuffer(),this.queryVitalParameters()}return t.prototype.allocateTexture=function(t,e,n,r){var o=this.gl,i=o.createTexture();o.bindTexture(o.TEXTURE_2D,i),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.NEAREST),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.NEAREST),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE);var a=r?n.encode(r,t*e):null;return o.texImage2D(o.TEXTURE_2D,0,n.internalFormat,t,e,0,n.format,n.textureType,a),this.checkError(),i},t.prototype.updateTexture=function(t,e,n,r,o){var i=this.gl;i.bindTexture(i.TEXTURE_2D,t);var a=r.encode(o,e*n);i.texSubImage2D(i.TEXTURE_2D,0,0,0,e,n,r.format,r.textureType,a),this.checkError()},t.prototype.attachFramebuffer=function(t,e,n){var r=this.gl;r.bindTexture(r.TEXTURE_2D,t),r.bindFramebuffer(r.FRAMEBUFFER,this.framebuffer),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,t,0),this.checkError(),r.viewport(0,0,e,n),r.scissor(0,0,e,n)},t.prototype.readTexture=function(t,e,n,r,o,i){var a=this.gl;i||(i=1),this.frameBufferBound||this.attachFramebuffer(t,e,n);var s=this.getEncoder(o,i),u=s.allocate(e*n);return a.bindTexture(a.TEXTURE_2D,t),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,t,0),a.readPixels(0,0,e,n,a.RGBA,s.textureType,u),this.checkError(),s.decode(u,r)},t.prototype.isFramebufferReady=function(){return!0},t.prototype.getActiveTexture=function(){var t=this.gl,e=t.getParameter(this.gl.ACTIVE_TEXTURE);return"TEXTURE".concat(e-t.TEXTURE0)},t.prototype.getTextureBinding=function(){return this.gl.getParameter(this.gl.TEXTURE_BINDING_2D)},t.prototype.getFramebufferBinding=function(){return this.gl.getParameter(this.gl.FRAMEBUFFER_BINDING)},t.prototype.setVertexAttributes=function(t,e){var n=this.gl;n.vertexAttribPointer(t,3,n.FLOAT,!1,20,0),n.enableVertexAttribArray(t),-1!==e&&(n.vertexAttribPointer(e,2,n.FLOAT,!1,20,12),n.enableVertexAttribArray(e)),this.checkError()},t.prototype.createProgram=function(t,e){var n=this.gl,r=n.createProgram();return n.attachShader(r,t),n.attachShader(r,e),n.linkProgram(r),r},t.prototype.compileShader=function(t,e){var n=this.gl,r=n.createShader(e);if(!r)throw new Error("createShader() returned null with type ".concat(e));if(n.shaderSource(r,t),n.compileShader(r),!1===n.getShaderParameter(r,n.COMPILE_STATUS))throw new Error("Failed to compile shader: ".concat(n.getShaderInfoLog(r),"\nShader source:\n").concat(t));return r},t.prototype.deleteShader=function(t){this.gl.deleteShader(t)},t.prototype.bindTextureToUniform=function(t,e,n){var r=this.gl;r.activeTexture(r.TEXTURE0+e),this.checkError(),r.bindTexture(r.TEXTURE_2D,t),this.checkError(),r.uniform1i(n,e),this.checkError()},t.prototype.draw=function(){this.gl.drawArrays(this.gl.TRIANGLE_STRIP,0,4),this.checkError()},t.prototype.checkError=function(){if(u.env.debug){var t=this.gl,e=t.getError(),n="";switch(e){case t.NO_ERROR:return;case t.INVALID_ENUM:n="INVALID_ENUM";break;case t.INVALID_VALUE:n="INVALID_VALUE";break;case t.INVALID_OPERATION:n="INVALID_OPERATION";break;case t.INVALID_FRAMEBUFFER_OPERATION:n="INVALID_FRAMEBUFFER_OPERATION";break;case t.OUT_OF_MEMORY:n="OUT_OF_MEMORY";break;case t.CONTEXT_LOST_WEBGL:n="CONTEXT_LOST_WEBGL";break;default:n="Unknown WebGL Error: ".concat(e.toString(16))}throw new Error(n)}},t.prototype.deleteTexture=function(t){this.gl.deleteTexture(t)},t.prototype.deleteProgram=function(t){this.gl.deleteProgram(t)},t.prototype.getEncoder=function(t,e,n){if(void 0===n&&(n=0),2===this.version)return new c.RedFloat32DataEncoder(this.gl,e);switch(t){case"float":return 1===n||this.isRenderFloat32Supported?new c.RGBAFloatDataEncoder(this.gl,e):new c.RGBAFloatDataEncoder(this.gl,e,this.textureHalfFloatExtension.HALF_FLOAT_OES);case"int":throw new Error("not implemented");case"byte":return new c.Uint8DataEncoder(this.gl,e);default:throw new Error("Invalid dataType: ".concat(t))}},t.prototype.clearActiveTextures=function(){for(var t=this.gl,e=0;e<this.maxTextureImageUnits;++e)t.activeTexture(t.TEXTURE0+e),t.bindTexture(t.TEXTURE_2D,null)},t.prototype.dispose=function(){if(!this.disposed){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,null),t.deleteFramebuffer(this.framebuffer),t.bindBuffer(t.ARRAY_BUFFER,null),t.deleteBuffer(this.vertexbuffer),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null),t.finish(),this.disposed=!0}},t.prototype.createDefaultGeometry=function(){return new Float32Array([-1,1,0,0,1,-1,-1,0,0,0,1,1,0,1,1,1,-1,0,1,0])},t.prototype.createVertexbuffer=function(){var t=this.gl,e=t.createBuffer();if(!e)throw new Error("createBuffer() returned null");var n=this.createDefaultGeometry();return t.bindBuffer(t.ARRAY_BUFFER,e),t.bufferData(t.ARRAY_BUFFER,n,t.STATIC_DRAW),this.checkError(),e},t.prototype.createFramebuffer=function(){var t=this.gl.createFramebuffer();if(!t)throw new Error("createFramebuffer returned null");return t},t.prototype.queryVitalParameters=function(){var t=this.gl;if(this.isFloatTextureAttachableToFrameBuffer=this.checkFloatTextureAttachableToFrameBuffer(),this.isRenderFloat32Supported=this.checkRenderFloat32(),this.isFloat32DownloadSupported=this.checkFloat32Download(),1===this.version&&!this.textureHalfFloatExtension&&!this.isRenderFloat32Supported)throw new Error("both float32 and float16 TextureType are not supported");this.isBlendSupported=!this.isRenderFloat32Supported||this.checkFloat32Blend(),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),this.maxTextureImageUnits=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),this.version},t.prototype.getExtensions=function(){2===this.version?(this.colorBufferFloatExtension=this.gl.getExtension("EXT_color_buffer_float"),this.disjointTimerQueryWebgl2Extension=this.gl.getExtension("EXT_disjoint_timer_query_webgl2")):(this.textureFloatExtension=this.gl.getExtension("OES_texture_float"),this.textureHalfFloatExtension=this.gl.getExtension("OES_texture_half_float"))},t.prototype.checkFloatTextureAttachableToFrameBuffer=function(){var t=this.gl,e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);var n=2===this.version?t.RGBA32F:t.RGBA;t.texImage2D(t.TEXTURE_2D,0,n,1,1,0,t.RGBA,t.FLOAT,null);var r=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,r),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0);var o=t.checkFramebufferStatus(t.FRAMEBUFFER)===t.FRAMEBUFFER_COMPLETE;return t.bindTexture(t.TEXTURE_2D,null),t.bindFramebuffer(t.FRAMEBUFFER,null),t.deleteTexture(e),t.deleteFramebuffer(r),o},t.prototype.checkRenderFloat32=function(){if(2===this.version){if(!this.colorBufferFloatExtension)return!1}else if(!this.textureFloatExtension)return!1;return this.isFloatTextureAttachableToFrameBuffer},t.prototype.checkFloat32Download=function(){if(2===this.version){if(!this.colorBufferFloatExtension)return!1}else{if(!this.textureFloatExtension)return!1;if(!this.gl.getExtension("WEBGL_color_buffer_float"))return!1}return this.isFloatTextureAttachableToFrameBuffer},t.prototype.checkFloat32Blend=function(){var t,e,n,r,o,i=this.gl;try{t=i.createTexture(),e=i.createFramebuffer(),i.bindTexture(i.TEXTURE_2D,t);var a=2===this.version?i.RGBA32F:i.RGBA;return i.texImage2D(i.TEXTURE_2D,0,a,1,1,0,i.RGBA,i.FLOAT,null),i.bindFramebuffer(i.FRAMEBUFFER,e),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,t,0),i.enable(i.BLEND),!!(n=i.createShader(i.VERTEX_SHADER))&&(i.shaderSource(n,"void main(){}"),i.compileShader(n),!!(r=i.createShader(i.FRAGMENT_SHADER))&&(i.shaderSource(r,"precision highp float;void main(){gl_FragColor=vec4(0.5);}"),i.compileShader(r),!!(o=i.createProgram())&&(i.attachShader(o,n),i.attachShader(o,r),i.linkProgram(o),i.useProgram(o),i.drawArrays(i.POINTS,0,1),i.getError()===i.NO_ERROR)))}finally{i.disable(i.BLEND),o&&i.deleteProgram(o),n&&i.deleteShader(n),r&&i.deleteShader(r),e&&(i.bindFramebuffer(i.FRAMEBUFFER,null),i.deleteFramebuffer(e)),t&&(i.bindTexture(i.TEXTURE_2D,null),i.deleteTexture(t))}},t.prototype.beginTimer=function(){if(2===this.version&&this.disjointTimerQueryWebgl2Extension){var t=this.gl,e=this.disjointTimerQueryWebgl2Extension,n=t.createQuery();return t.beginQuery(e.TIME_ELAPSED_EXT,n),n}throw new Error("WebGL1 profiling currently not supported.")},t.prototype.endTimer=function(){if(2!==this.version||!this.disjointTimerQueryWebgl2Extension)throw new Error("WebGL1 profiling currently not supported");var t=this.gl,e=this.disjointTimerQueryWebgl2Extension;t.endQuery(e.TIME_ELAPSED_EXT)},t.prototype.isTimerResultAvailable=function(t){var e,n;if(2!==this.version||!this.disjointTimerQueryWebgl2Extension)throw new Error("WebGL1 profiling currently not supported");var r=this.gl,o=this.disjointTimerQueryWebgl2Extension;return e=r.getQueryParameter(t,r.QUERY_RESULT_AVAILABLE),n=r.getParameter(o.GPU_DISJOINT_EXT),e&&!n},t.prototype.getTimerResult=function(t){var e;if(2!==this.version)throw new Error("WebGL1 profiling currently not supported");var n=this.gl;return e=n.getQueryParameter(t,n.QUERY_RESULT),n.deleteQuery(t),e/1e6},t.prototype.waitForQueryAndGetTime=function(t){return a(this,void 0,void 0,(function(){var e=this;return s(this,(function(n){switch(n.label){case 0:return[4,(0,l.repeatedTry)((function(){return e.isTimerResultAvailable(t)}))];case 1:return n.sent(),[2,this.getTimerResult(t)]}}))}))},t.prototype.createAndWaitForFence=function(){return a(this,void 0,void 0,(function(){var t;return s(this,(function(e){return t=this.createFence(this.gl),[2,this.pollFence(t)]}))}))},t.prototype.createFence=function(t){var e=t,n=e.fenceSync(e.SYNC_GPU_COMMANDS_COMPLETE,0);return t.flush(),{query:n,isFencePassed:null===n?function(){return!0}:function(){var t=e.clientWaitSync(n,0,0);return t===e.ALREADY_SIGNALED||t===e.CONDITION_SATISFIED}}},t.prototype.pollFence=function(t){return a(this,void 0,void 0,(function(){var e=this;return s(this,(function(n){return[2,new Promise((function(n){e.addItemToPoll((function(){return t.isFencePassed()}),(function(){return n()}))}))]}))}))},t.prototype.pollItems=function(){for(var t=f(this.itemsToPoll.map((function(t){return t.isDoneFn}))),e=0;e<=t;++e)(0,this.itemsToPoll[e].resolveFn)();this.itemsToPoll=this.itemsToPoll.slice(t+1)},t.prototype.addItemToPoll=function(t,e){return a(this,void 0,void 0,(function(){var n=this;return s(this,(function(r){switch(r.label){case 0:return this.itemsToPoll.push({isDoneFn:t,resolveFn:e}),this.itemsToPoll.length>1?[2]:[4,(0,l.repeatedTry)((function(){return n.pollItems(),0===n.itemsToPoll.length}))];case 1:return r.sent(),[2]}}))}))},t}();e.WebGLContext=p},1036:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}},i=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},s=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.ExecutionPlan=void 0;var u=n(6231),c=function(t,e){this.op=t,this.node=e},l=function(){function t(t,e,n){this.graph=t,this.profiler=n,this.initialize(e)}return t.prototype.initialize=function(t){var e=this;this.profiler.event("session","ExecutionPlan.initialize",(function(){var n=e.graph.getNodes();if(n.length!==t.length)throw new Error("The size of nodes and OPs do not match.");e._ops=t.map((function(t,e){return new c(t,n[e])})),e.reset(),e._starter=[],e._ops.forEach((function(t,n){var r,o,a=!0;try{for(var s=i(t.node.inputs),u=s.next();!u.done;u=s.next()){var c=u.value;if(!e._values[c]&&-1===e.graph.getInputIndices().indexOf(c)){a=!1;break}}}catch(t){r={error:t}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}a&&e._starter.push(n)}))}))},t.prototype.reset=function(){this._values=this.graph.getValues().map((function(t){return t.tensor}))},t.prototype.execute=function(t,e){return r(this,void 0,void 0,(function(){var n=this;return o(this,(function(c){return[2,this.profiler.event("session","ExecutionPlan.execute",(function(){return r(n,void 0,void 0,(function(){var n,c,l,f,p,h,d,g,b,y,m,v,_=this;return o(this,(function(w){switch(w.label){case 0:if(this.reset(),n=t.createInferenceHandler(),c=this.graph.getInputIndices(),e.length!==c.length)throw new Error("number of input tensors don't match the number of inputs to the model: actual: ".concat(e.length," expected: ").concat(c.length));e.forEach((function(t,e){var n=c[e];_._values[n]=t})),l=this._starter.slice(0),f=this.graph.getValues(),p=this.graph.getNodes(),h=0,d=function(){var t,e,c,d,b,y;return o(this,(function(m){switch(m.label){case 0:if(t=l[h++],e=g._ops[t],c=e.node.inputs.map((function(t){return _._values[t]})),-1!==c.indexOf(void 0))throw new Error("unresolved input detected: op: ".concat(e.node));return d=c,u.Logger.verbose("ExecPlan","Runing op:".concat(e.node.name," (").concat(d.map((function(t,n){return"'".concat(e.node.inputs[n],"': ").concat(t.type,"[").concat(t.dims.join(","),"]")})).join(", "),")")),[4,g.profiler.event("node",e.node.name,(function(){return r(_,void 0,void 0,(function(){return o(this,(function(t){return[2,e.op.impl(n,d,e.op.context)]}))}))}))];case 1:if((b=m.sent()).length!==e.node.outputs.length)throw new Error("the size of output does not match model definition.");return b.forEach((function(t,n){var r=e.node.outputs[n];if(_._values[r])throw new Error("output [".concat(r,"] already has value: op:").concat(e.node.name));_._values[r]=t})),y=new Set,b.forEach((function(t,n){var r,o,a,s,u=e.node.outputs[n];try{for(var c=(r=void 0,i(f[u].to)),l=c.next();!l.done;l=c.next()){var h=l.value,d=p[h],g=!0;try{for(var b=(a=void 0,i(d.inputs)),m=b.next();!m.done;m=b.next()){var v=m.value;if(!_._values[v]){g=!1;break}}}catch(t){a={error:t}}finally{try{m&&!m.done&&(s=b.return)&&s.call(b)}finally{if(a)throw a.error}}g&&y.add(h)}}catch(t){r={error:t}}finally{try{l&&!l.done&&(o=c.return)&&o.call(c)}finally{if(r)throw r.error}}})),l.push.apply(l,s([],a(y),!1)),[2]}}))},g=this,w.label=1;case 1:return h<l.length?[5,d()]:[3,3];case 2:return w.sent(),[3,1];case 3:b=[],y=0,w.label=4;case 4:if(!(y<this.graph.getOutputIndices().length))return[3,9];if(m=this.graph.getOutputIndices()[y],void 0===(v=this._values[m]))throw new Error("required output [".concat(m,"] does not have value"));return 0!==m?[3,6]:[4,v.getData()];case 5:return w.sent(),[3,7];case 6:v.data,w.label=7;case 7:b.push(v),w.label=8;case 8:return y++,[3,4];case 9:return u.Logger.verbose("ExecPlan","disposing of inferenceHandler"),n.dispose(),[2,b]}}))}))}))]}))}))},t}();e.ExecutionPlan=l},7070:function(t,e,n){"use strict";var r=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.Graph=void 0;var o=n(1446),i=n(7778),a=n(9395),s=n(9162),u=n(2517),c=a.onnxruntime.experimental.fbs;e.Graph={from:function(t,e){return new p(t,e)}};var l=function(){function t(t){this._from=void 0,this._to=[],this.tensor=void 0,this.type=void 0,t&&(this.type=u.ProtoUtil.tensorValueTypeFromProto(t.type.tensorType))}return Object.defineProperty(t.prototype,"from",{get:function(){return this._from},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"to",{get:function(){return this._to},enumerable:!1,configurable:!0}),t}(),f=function(t,e){t instanceof o.onnx.NodeProto?(this.name=t.name,this.opType=t.opType,this.attributes=new i.Attribute(t.attribute)):t instanceof c.Node&&(this.name=null!=e?e:t.name(),this.opType=t.opType(),this.attributes=new i.Attribute(u.ProtoUtil.tensorAttributesFromORTFormat(t))),this.inputs=[],this.outputs=[],this.executeNode=!0},p=function(){function t(t,e){if(!t)throw new TypeError("graph is empty");this.buildGraph(t),this.transformGraph(e),this.checkIsAcyclic()}return t.prototype.getInputIndices=function(){return this._allInputIndices},t.prototype.getInputNames=function(){return this._allInputNames},t.prototype.getOutputIndices=function(){return this._allOutputIndices},t.prototype.getOutputNames=function(){return this._allOutputNames},t.prototype.getValues=function(){return this._allData},t.prototype.getNodes=function(){return this._nodes},t.prototype.buildGraph=function(t){if(t instanceof o.onnx.GraphProto)this.buildGraphFromOnnxFormat(t);else{if(!(t instanceof c.Graph))throw new TypeError("Graph type is not supported.");this.buildGraphFromOrtFormat(t)}},t.prototype.buildGraphFromOnnxFormat=function(t){var e,n,o,i,a,c,p,h,d,g,b,y,m=new Map;this._allData=[],this._allInputIndices=[],this._allInputNames=[],this._allOutputIndices=[],this._allOutputNames=[],this._nodes=[];var v=new Map;if(!t.input)throw new Error("missing information in graph: input");var _=[];try{for(var w=r(t.input),x=w.next();!x.done;x=w.next()){var T=x.value;if(m.has(T.name))throw new Error("duplicated input name: ".concat(T.name));var S=this._allData.push(new l(T))-1;m.set(T.name,S),_.push(T.name)}}catch(t){e={error:t}}finally{try{x&&!x.done&&(n=w.return)&&n.call(w)}finally{if(e)throw e.error}}if(!t.initializer)throw new Error("missing information in graph: initializer");try{for(var O=r(t.initializer),A=O.next();!A.done;A=O.next()){T=A.value;var E=m.get(T.name);if(void 0===E){var I=new l;I.type={shape:{dims:u.ProtoUtil.tensorDimsFromProto(T.dims)},tensorType:u.ProtoUtil.tensorDataTypeFromProto(T.dataType)},E=this._allData.push(I)-1,m.set(T.name,E)}this._allData[E]._from=-1,this._allData[E].tensor=s.Tensor.fromProto(T)}}catch(t){o={error:t}}finally{try{A&&!A.done&&(i=O.return)&&i.call(O)}finally{if(o)throw o.error}}for(T=0;T<this._allData.length;T++)this._allData[T].tensor||(this._allInputIndices.push(T),this._allInputNames.push(_[T]));if(!t.output)throw new Error("missing information in graph: output");try{for(var P=r(t.output),D=P.next();!D.done;D=P.next()){if(T=D.value,m.has(T.name))throw new Error("duplicated output name: ".concat(T.name));S=this._allData.push(new l(T))-1,m.set(T.name,S),this._allOutputIndices.push(S),this._allOutputNames.push(T.name)}}catch(t){a={error:t}}finally{try{D&&!D.done&&(c=P.return)&&c.call(P)}finally{if(a)throw a.error}}if(!t.node)throw new Error("missing information in graph: node");try{for(var k=r(t.node),C=k.next();!C.done;C=k.next()){if(!(U=C.value).name)for(var F=0;;F++){var N="unnamed_".concat(U.opType,"_").concat(F);if(!v.has(N)){U.name=N;break}}if(v.has(U.name))throw new Error("duplicated node name: ".concat(U.name));S=this._nodes.push(new f(U))-1,v.set(U.name,S)}}catch(t){p={error:t}}finally{try{C&&!C.done&&(h=k.return)&&h.call(k)}finally{if(p)throw p.error}}for(T=0;T<this._nodes.length;T++){var R=this._nodes[T];if(!(U=t.node[T]).output)throw new Error("missing output for node: ".concat(U.name));try{for(var L=(d=void 0,r(U.output)),M=L.next();!M.done;M=L.next()){var j=M.value;if(void 0===(z=m.get(j))&&(z=this._allData.push(new l)-1,m.set(j,z)),R.outputs.push(z),void 0!==this._allData[z]._from)throw new Error("multiple nodes output to one data value: ".concat(z));if(this._allData[z]._from=T,"Constant"===U.opType){if(!U.attribute||1!==U.attribute.length||!U.attribute[0].t)throw new Error("missing attributes or missing tensor value in attributes for this Constant operator");if(!U.output||1!==U.output.length)throw new Error("missing output or incorrect number of outputs for this Constant operator");R.outputs.pop(),R.executeNode=!1,this._allData[z]._from=-1,this._allData[z].tensor=s.Tensor.fromProto(U.attribute[0].t)}}}catch(t){d={error:t}}finally{try{M&&!M.done&&(g=L.return)&&g.call(L)}finally{if(d)throw d.error}}}for(T=0;T<this._nodes.length;T++){var U;if(R=this._nodes[T],!(U=t.node[T]).input)throw new Error("missing input for node: ".concat(U.name));try{for(var V=(b=void 0,r(U.input)),B=V.next();!B.done;B=V.next()){var z,G=B.value;if(void 0===(z=m.get(G))){if(""===G&&3===U.input.length&&"Resize"===U.opType)continue;throw new Error("unrecognized input '".concat(G,"' for node: ").concat(U.name))}R.inputs.push(z),this._allData[z]._to.push(T)}}catch(t){b={error:t}}finally{try{B&&!B.done&&(y=V.return)&&y.call(V)}finally{if(b)throw b.error}}}return!0},t.prototype.buildGraphFromOrtFormat=function(t){var e,n,r,o=new Map;this._allData=[],this._allInputIndices=[],this._allInputNames=[],this._allOutputIndices=[],this._allOutputNames=[],this._nodes=[];for(var i=new Map,a=[],p=0;p<t.inputsLength();p++){var h=t.inputs(p);if(o.has(h))throw new Error("duplicated input name: ".concat(h));for(var d=0;d<t.nodeArgsLength();d++)if((null===(e=t.nodeArgs(d))||void 0===e?void 0:e.name())===h){var g=new l;if((null===(r=null===(n=t.nodeArgs(d))||void 0===n?void 0:n.type())||void 0===r?void 0:r.valueType())!==c.TypeInfoValue.tensor_type)throw new Error("Unexpected value type for the nodeArg.");for(var b=t.nodeArgs(d).type().value(new c.TensorTypeAndShape),y=u.ProtoUtil.tensorDataTypeFromProto(b.elemType()),m=b.shape(),v=[],_=0;_<m.dimLength();_++)v.push(u.LongUtil.longToNumber(m.dim(_).value().dimValue()));g.type={shape:{dims:v},tensorType:y};var w=this._allData.push(g)-1;o.set(h,w),a.push(h)}}for(p=0;p<t.initializersLength();p++){var x=t.initializers(p),T=o.get(x.name());void 0===T&&(g=new l,v=u.ProtoUtil.tensorDimsFromORTFormat(x),y=u.ProtoUtil.tensorDataTypeFromProto(x.dataType()),g.type={shape:{dims:v},tensorType:y},T=this._allData.push(g)-1,o.set(x.name(),T)),this._allData[T]._from=-1,this._allData[T].tensor=s.Tensor.fromOrtTensor(x)}for(p=0;p<this._allData.length;p++)this._allData[p].tensor||(this._allInputIndices.push(p),this._allInputNames.push(a[p]));for(p=0;p<t.outputsLength();p++){var S=t.outputs(p);if(o.has(S))throw new Error("duplicated output name: ".concat(S));w=this._allData.push(new l)-1,o.set(S,w),this._allOutputIndices.push(w),this._allOutputNames.push(S)}if(!t.nodes)throw new Error("missing information in graph: node");for(p=0;p<t.nodesLength();p++){var O=(P=t.nodes(p)).name();if(!O)for(var A=0;O="unnamed_".concat(P.opType(),"_").concat(A),i.has(O);A++);if(i.has(O))throw new Error("duplicated node name: ".concat(O));w=this._nodes.push(new f(P,O))-1,i.set(O,w)}for(p=0;p<this._nodes.length;p++){var E=this._nodes[p];if(null==(P=t.nodes(p)))throw new Error("No node exists at index ".concat(p));if(0===(null==P?void 0:P.outputsLength()))throw new Error("missing output for node: ".concat(P.name));for(d=0;d<(null==P?void 0:P.outputsLength());d++){var I=null==P?void 0:P.outputs(d);if(void 0===(D=o.get(I))&&(D=this._allData.push(new l)-1,o.set(I,D)),E.outputs.push(D),void 0!==this._allData[D]._from)throw new Error("multiple nodes output to one data value: ".concat(D));if(this._allData[D]._from=p,"Constant"===P.opType()){if(1!==P.attributesLength()||!P.attributes(0).t())throw new Error("missing attributes or missing tensor value in attributes for this Constant operator");if(1!==P.outputsLength())throw new Error("missing output or incorrect number of outputs for this Constant operator");E.outputs.pop(),E.executeNode=!1,this._allData[D]._from=-1,this._allData[D].tensor=s.Tensor.fromOrtTensor(P.attributes(0).t())}}}for(p=0;p<this._nodes.length;p++){var P;if(E=this._nodes[p],0===(P=t.nodes(p)).inputsLength())throw new Error("missing input for node: ".concat(P.name));for(d=0;d<P.inputsLength();d++){var D,k=P.inputs(d);if(void 0===(D=o.get(k)))throw new Error("unrecognized input '".concat(k,"' for node: ").concat(P.name()));E.inputs.push(D),this._allData[D]._to.push(p)}}},t.prototype.checkIsAcyclic=function(){var t=this,e=new Set;this._allInputIndices.forEach((function(n){t._allData[n]._to.forEach((function(t){e.add(t)}))}));for(var n=Array.from(e),r=new Array(this._nodes.length).fill("white"),o=function(){var e=n.pop();"gray"===r[e]?r[e]="black":(n.push(e),r[e]="gray",i._nodes[e].outputs.forEach((function(o){var i=t._allData[o];if(void 0!==i.tensor)throw new Error("node outputs should not be initialized");if(i._from!==e)throw new Error("from property of the Value object doesn't match index of Node being processed");i._to.forEach((function(t){if("gray"===r[t])throw new Error("model graph is cyclic");"white"===r[t]&&n.push(t)}))})))},i=this;n.length>0;)o()},t.prototype.transformGraph=function(t){this.removeAllIdentityNodes(),this.removeAllDropoutNodes(),this.fuseConvActivationNodes(),t&&t.transformGraph(this),this.finalizeGraph()},t.prototype.finalizeGraph=function(){for(var t,e=this,n=0,r=function(r){if(!o._nodes[r].executeNode)return n++,o._nodes[r].outputs.forEach((function(t){e._allData[t]._from=-2})),o._nodes.splice(r,1),r--,t=r,"continue";n>0&&(o._nodes[r].inputs.forEach((function(t){var o=e._allData[t]._to.indexOf(r+n);-1!==o&&(e._allData[t]._to[o]=r)})),o._nodes[r].outputs.forEach((function(t){e._allData[t]._from&&e._allData[t]._from===r+n&&(e._allData[t]._from=r)}))),t=r},o=this,i=0;i<this._nodes.length;i++)r(i),i=t;n=0;var a,s=function(t){if(-2===u._allData[t].from&&-1===u._allOutputIndices.indexOf(t+n))return n++,u._allData.splice(t,1),t--,a=t,"continue";if(n>0){var r=-1;void 0!==u._allData[t].from&&-1!==u._allData[t].from?-1!==(r=u._nodes[u._allData[t].from].outputs.indexOf(t+n))&&(u._nodes[u._allData[t].from].outputs[r]=t):-1!==(r=u._allInputIndices.indexOf(t+n))&&(u._allInputIndices[r]=t),u._allData[t].to.forEach((function(o){-1!==(r=e._nodes[o].inputs.indexOf(t+n))&&(e._nodes[o].inputs[r]=t)})),0===u._allData[t].to.length&&-1!==(r=u._allOutputIndices.indexOf(t+n))&&(u._allOutputIndices[r]=t)}a=t},u=this;for(i=0;i<this._allData.length;i++)s(i),i=a},t.prototype.deleteNode=function(t){var e,n,o=this._nodes[t];if(o.outputs.length>1)for(var i=1;i<o.outputs.length;i++)if(this._allData[o.outputs[i]].to.length>0)throw new Error("Node deletion with more than one output connected to other nodes is not supported. ");o.executeNode=!1;var a=o.inputs[0],s=o.outputs[0],u=this._allData[s].to,c=this._allData[a].to.indexOf(t);if(-1===c)throw new Error("The Value object doesn't have the current Node in it's 'to' property ");this._allData[a].to.splice(c,1),this._allData[s]._to=[];var l=this._allOutputIndices.indexOf(s);if(-1!==l&&(this._allOutputIndices[l]=a),u&&u.length>0)try{for(var f=r(u),p=f.next();!p.done;p=f.next()){var h=p.value,d=this._nodes[h].inputs.indexOf(s);if(-1===d)throw new Error("The Node object doesn't have the output Value in it's 'inputs' property ");this._nodes[h].inputs[d]=a,this._allData[a].to.push(h)}}catch(t){e={error:t}}finally{try{p&&!p.done&&(n=f.return)&&n.call(f)}finally{if(e)throw e.error}}},t.prototype.removeAllDropoutNodes=function(){var t,e,n=0;try{for(var o=r(this._nodes),i=o.next();!i.done;i=o.next()){var a=i.value;if("Dropout"===a.opType){if(1!==a.inputs.length)throw new Error("Dropout nodes should only contain one input. ");if(1!==a.outputs.length&&2!==a.outputs.length)throw new Error("Dropout nodes should contain either 1 or 2 output(s)");if(2===a.outputs.length&&0!==this._allData[a.outputs[1]]._to.length)throw new Error("Dropout nodes's second output should not be referenced by other nodes");this.deleteNode(n)}n++}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}},t.prototype.removeAllIdentityNodes=function(){var t,e,n=0;try{for(var o=r(this._nodes),i=o.next();!i.done;i=o.next())"Identity"===i.value.opType&&this.deleteNode(n),n++}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}},t.prototype.isActivation=function(t){switch(t.opType){case"Relu":case"Sigmoid":case"Clip":return!0;default:return!1}},t.prototype.fuseConvActivationNodes=function(){var t,e;try{for(var n=r(this._nodes),o=n.next();!o.done;o=n.next()){var i=o.value;if("Conv"===i.opType){var a=this._allData[i.outputs[0]]._to;if(1===a.length&&this.isActivation(this._nodes[a[0]])){var s=this._nodes[a[0]];if("Clip"===s.opType)if(1===s.inputs.length)try{i.attributes.set("activation_params","floats",[s.attributes.getFloat("min"),s.attributes.getFloat("max")])}catch(t){i.attributes.set("activation_params","floats",[u.MIN_CLIP,u.MAX_CLIP])}else{if(!(s.inputs.length>=3&&void 0!==this._allData[s.inputs[1]].tensor&&void 0!==this._allData[s.inputs[2]].tensor))continue;i.attributes.set("activation_params","floats",[this._allData[s.inputs[1]].tensor.floatData[0],this._allData[s.inputs[2]].tensor.floatData[0]])}i.attributes.set("activation","string",s.opType),this.deleteNode(a[0])}}}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},t}()},6231:function(t,e){"use strict";var n,r,o=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.now=e.Profiler=e.Logger=void 0;var a=function(){function t(){}return t.prototype.log=function(t,e,n){},t}(),s=function(){function t(){}return t.prototype.log=function(t,e,n){console.log("".concat(this.color(t)," ").concat(n?"[35m"+n+"[0m ":"").concat(e))},t.prototype.color=function(t){switch(t){case"verbose":return"[34;40mv[0m";case"info":return"[32mi[0m";case"warning":return"[30;43mw[0m";case"error":return"[31;40me[0m";case"fatal":return"[101mf[0m";default:throw new Error("unsupported severity: ".concat(t))}},t}(),u={verbose:1e3,info:2e3,warning:4e3,error:5e3,fatal:6e3},c=((n={}).none=new a,n.console=new s,n),l={provider:"console",minimalSeverity:"warning",logDateTime:!0,logSourceLocation:!1},f=((r={})[""]=l,r);function p(t,e,n,r){if(void 0===e)return o=t,{verbose:p.verbose.bind(null,o),info:p.info.bind(null,o),warning:p.warning.bind(null,o),error:p.error.bind(null,o),fatal:p.fatal.bind(null,o)};if(void 0===n)h(t,e);else if("number"==typeof n&&void 0===r)h(t,e);else if("string"==typeof n&&void 0===r)h(t,n,0,e);else{if("string"!=typeof n||"number"!=typeof r)throw new TypeError("input is valid");h(t,n,0,e)}var o}function h(t,e,n,r){var o=f[r||""]||f[""];u[t]<u[o.minimalSeverity]||(o.logDateTime&&(e="".concat((new Date).toISOString(),"|").concat(e)),o.logSourceLocation,c[o.provider].log(t,e,r))}!function(t){function e(t){f={},n("",t||{})}function n(t,n){if("*"===t)e(n);else{var r=f[t]||l;f[t]={provider:n.provider||r.provider,minimalSeverity:n.minimalSeverity||r.minimalSeverity,logDateTime:void 0===n.logDateTime?r.logDateTime:n.logDateTime,logSourceLocation:void 0===n.logSourceLocation?r.logSourceLocation:n.logSourceLocation}}}t.verbose=function(e,n){t("verbose",e,n)},t.info=function(e,n){t("info",e,n)},t.warning=function(e,n){t("warning",e,n)},t.error=function(e,n){t("error",e,n)},t.fatal=function(e,n){t("fatal",e,n)},t.reset=e,t.set=n,t.setWithEnv=function(t){var e={};t.logLevel&&(e.minimalSeverity=t.logLevel),n("",e)}}(p||(p={})),e.Logger=p;var d=function(){function t(t,e,n,r,o,i){this.category=t,this.name=e,this.startTime=n,this.endCallback=r,this.timer=o,this.ctx=i}return t.prototype.end=function(){return this.endCallback(this)},t.prototype.checkTimer=function(){return o(this,void 0,void 0,(function(){return i(this,(function(t){if(void 0===this.ctx||void 0===this.timer)throw new Error("No webgl timer found");return this.ctx.endTimer(),[2,this.ctx.waitForQueryAndGetTime(this.timer)]}))}))},t}(),g=function(t,e,n,r){this.category=t,this.name=e,this.startTime=n,this.endTime=r},b=function(){function t(t,e,n){this._started=!1,this._flushPointer=0,this._started=!1,this._maxNumberEvents=void 0===t?1e4:t,this._flushBatchSize=void 0===e?10:e,this._flushIntervalInMilliseconds=void 0===n?5e3:n}return t.create=function(t){return void 0===t?new this:new this(t.maxNumberEvents,t.flushBatchSize,t.flushIntervalInMilliseconds)},t.prototype.start=function(){this._started=!0,this._timingEvents=[],this._flushTime=(0,e.now)(),this._flushPointer=0},t.prototype.stop=function(){for(this._started=!1;this._flushPointer<this._timingEvents.length;this._flushPointer++)this.logOneEvent(this._timingEvents[this._flushPointer])},t.prototype.event=function(t,e,n,r){var a=this,s=this._started?this.begin(t,e,r):void 0,u=!1,c=n();if(c&&"function"==typeof c.then)return u=!0,new Promise((function(t,e){c.then((function(e){return o(a,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return s?[4,s.end()]:[3,2];case 1:n.sent(),n.label=2;case 2:return t(e),[2]}}))}))}),(function(t){return o(a,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return s?[4,s.end()]:[3,2];case 1:n.sent(),n.label=2;case 2:return e(t),[2]}}))}))}))}));if(!u&&s){var l=s.end();if(l&&"function"==typeof l.then)return new Promise((function(t,e){l.then((function(){t(c)}),(function(t){e(t)}))}))}return c},t.prototype.begin=function(t,n,r){var a=this;if(!this._started)throw new Error("profiler is not started yet");if(void 0===r){var s=(0,e.now)();return this.flush(s),new d(t,n,s,(function(t){return a.endSync(t)}))}var u=r.beginTimer();return new d(t,n,0,(function(t){return o(a,void 0,void 0,(function(){return i(this,(function(e){return[2,this.end(t)]}))}))}),u,r)},t.prototype.end=function(t){return o(this,void 0,void 0,(function(){var e;return i(this,(function(n){switch(n.label){case 0:return[4,t.checkTimer()];case 1:return e=n.sent(),this._timingEvents.length<this._maxNumberEvents&&(this._timingEvents.push(new g(t.category,t.name,t.startTime,e)),this.flush(e)),[2]}}))}))},t.prototype.endSync=function(t){var n=(0,e.now)();this._timingEvents.length<this._maxNumberEvents&&(this._timingEvents.push(new g(t.category,t.name,t.startTime,n)),this.flush(n))},t.prototype.logOneEvent=function(t){e.Logger.verbose("Profiler.".concat(t.category),"".concat((t.endTime-t.startTime).toFixed(2),"ms on event '").concat(t.name,"' at ").concat(t.endTime.toFixed(2)))},t.prototype.flush=function(t){if(this._timingEvents.length-this._flushPointer>=this._flushBatchSize||t-this._flushTime>=this._flushIntervalInMilliseconds){for(var n=this._flushPointer;this._flushPointer<n+this._flushBatchSize&&this._flushPointer<this._timingEvents.length;this._flushPointer++)this.logOneEvent(this._timingEvents[this._flushPointer]);this._flushTime=(0,e.now)()}},Object.defineProperty(t.prototype,"started",{get:function(){return this._started},enumerable:!1,configurable:!0}),t}();e.Profiler=b,e.now="undefined"!=typeof performance&&performance.now?function(){return performance.now()}:Date.now},2644:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Model=void 0;var r=n(5686),o=n(1446),i=n(7070),a=n(9395),s=n(2517),u=a.onnxruntime.experimental.fbs,c=function(){function t(){}return t.prototype.load=function(t,e,n){if(!n)try{return void this.loadFromOnnxFormat(t,e)}catch(t){if(void 0!==n)throw t}this.loadFromOrtFormat(t,e)},t.prototype.loadFromOnnxFormat=function(t,e){var n=o.onnx.ModelProto.decode(t);if(s.LongUtil.longToNumber(n.irVersion)<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=n.opsetImport.map((function(t){return{domain:t.domain,version:s.LongUtil.longToNumber(t.version)}})),this._graph=i.Graph.from(n.graph,e)},t.prototype.loadFromOrtFormat=function(t,e){var n=new r.flatbuffers.ByteBuffer(t),o=u.InferenceSession.getRootAsInferenceSession(n).model();if(s.LongUtil.longToNumber(o.irVersion())<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=[];for(var a=0;a<o.opsetImportLength();a++){var c=o.opsetImport(a);this._opsets.push({domain:null==c?void 0:c.domain(),version:s.LongUtil.longToNumber(c.version())})}this._graph=i.Graph.from(o.graph(),e)},Object.defineProperty(t.prototype,"graph",{get:function(){return this._graph},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"opsets",{get:function(){return this._opsets},enumerable:!1,configurable:!0}),t}();e.Model=c},782:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FLOAT_TYPES=e.INT_TYPES=e.NUMBER_TYPES=void 0,e.NUMBER_TYPES=["float32","float64","int32","int16","int8","uint16","uint32","uint8"],e.INT_TYPES=["int32","int16","int8","uint16","uint32","uint8"],e.FLOAT_TYPES=["float32","float64"]},1047:function(t,e){"use strict";var n=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};function r(t,e){if(e.endsWith("+")){var n=Number.parseInt(e.substring(0,e.length-1),10);return!isNaN(n)&&n<=t}if(2===e.split("-").length){var r=e.split("-"),o=(n=Number.parseInt(r[0],10),Number.parseInt(r[1],10));return!isNaN(n)&&!isNaN(o)&&n<=t&&t<=o}return Number.parseInt(e,10)===t}Object.defineProperty(e,"__esModule",{value:!0}),e.resolveOperator=void 0,e.resolveOperator=function(t,e,o){var i,a,s,u;try{for(var c=n(o),l=c.next();!l.done;l=c.next()){var f=l.value,p=f[0],h=f[1],d=f[2],g=f[3],b=f[4];if(t.opType===p)try{for(var y=(s=void 0,n(e)),m=y.next();!m.done;m=y.next()){var v=m.value;if((v.domain===h||"ai.onnx"===v.domain&&""===h)&&r(v.version,d))return{opImpl:g,opInit:b}}}catch(t){s={error:t}}finally{try{m&&!m.done&&(u=y.return)&&u.call(y)}finally{if(s)throw s.error}}}}catch(t){i={error:t}}finally{try{l&&!l.done&&(a=c.return)&&a.call(c)}finally{if(i)throw i.error}}throw new TypeError("cannot resolve operator '".concat(t.opType,"' with opsets: ").concat(e.map((function(t){return"".concat(t.domain||"ai.onnx"," v").concat(t.version)})).join(", ")))}},9395:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.onnxruntime=void 0;var r,o,i,a,s=n(5686);r=e.onnxruntime||(e.onnxruntime={}),o=r.experimental||(r.experimental={}),i=o.fbs||(o.fbs={}),(a=i.AttributeType||(i.AttributeType={}))[a.UNDEFINED=0]="UNDEFINED",a[a.FLOAT=1]="FLOAT",a[a.INT=2]="INT",a[a.STRING=3]="STRING",a[a.TENSOR=4]="TENSOR",a[a.GRAPH=5]="GRAPH",a[a.FLOATS=6]="FLOATS",a[a.INTS=7]="INTS",a[a.STRINGS=8]="STRINGS",a[a.TENSORS=9]="TENSORS",a[a.GRAPHS=10]="GRAPHS",a[a.SPARSE_TENSOR=11]="SPARSE_TENSOR",a[a.SPARSE_TENSORS=12]="SPARSE_TENSORS",function(t){!function(t){!function(t){var e;(e=t.DimensionValueType||(t.DimensionValueType={}))[e.UNKNOWN=0]="UNKNOWN",e[e.VALUE=1]="VALUE",e[e.PARAM=2]="PARAM"}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(t){!function(t){var e;(e=t.TensorDataType||(t.TensorDataType={}))[e.UNDEFINED=0]="UNDEFINED",e[e.FLOAT=1]="FLOAT",e[e.UINT8=2]="UINT8",e[e.INT8=3]="INT8",e[e.UINT16=4]="UINT16",e[e.INT16=5]="INT16",e[e.INT32=6]="INT32",e[e.INT64=7]="INT64",e[e.STRING=8]="STRING",e[e.BOOL=9]="BOOL",e[e.FLOAT16=10]="FLOAT16",e[e.DOUBLE=11]="DOUBLE",e[e.UINT32=12]="UINT32",e[e.UINT64=13]="UINT64",e[e.COMPLEX64=14]="COMPLEX64",e[e.COMPLEX128=15]="COMPLEX128",e[e.BFLOAT16=16]="BFLOAT16"}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(t){!function(t){var e;(e=t.NodeType||(t.NodeType={}))[e.Primitive=0]="Primitive",e[e.Fused=1]="Fused"}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(t){!function(t){var e;(e=t.TypeInfoValue||(t.TypeInfoValue={}))[e.NONE=0]="NONE",e[e.tensor_type=1]="tensor_type",e[e.sequence_type=2]="sequence_type",e[e.map_type=3]="map_type"}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){var n=function(){function e(){this.bb=null,this.bb_pos=0}return e.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.getRootAsShape=function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.getSizePrefixedRootAsShape=function(t,n){return t.setPosition(t.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.prototype.dim=function(e,n){var r=this.bb.__offset(this.bb_pos,4);return r?(n||new t.experimental.fbs.Dimension).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null},e.prototype.dimLength=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0},e.startShape=function(t){t.startObject(1)},e.addDim=function(t,e){t.addFieldOffset(0,e,0)},e.createDimVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},e.startDimVector=function(t,e){t.startVector(4,e,4)},e.endShape=function(t){return t.endObject()},e.createShape=function(t,n){return e.startShape(t),e.addDim(t,n),e.endShape(t)},e}();e.Shape=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){var n=function(){function e(){this.bb=null,this.bb_pos=0}return e.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.getRootAsDimension=function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.getSizePrefixedRootAsDimension=function(t,n){return t.setPosition(t.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.prototype.value=function(e){var n=this.bb.__offset(this.bb_pos,4);return n?(e||new t.experimental.fbs.DimensionValue).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null},e.prototype.denotation=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null},e.startDimension=function(t){t.startObject(2)},e.addValue=function(t,e){t.addFieldOffset(0,e,0)},e.addDenotation=function(t,e){t.addFieldOffset(1,e,0)},e.endDimension=function(t){return t.endObject()},e.createDimension=function(t,n,r){return e.startDimension(t),e.addValue(t,n),e.addDenotation(t,r),e.endDimension(t)},e}();e.Dimension=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){var n=function(){function e(){this.bb=null,this.bb_pos=0}return e.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.getRootAsDimensionValue=function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.getSizePrefixedRootAsDimensionValue=function(t,n){return t.setPosition(t.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.prototype.dimType=function(){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt8(this.bb_pos+e):t.experimental.fbs.DimensionValueType.UNKNOWN},e.prototype.dimValue=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)},e.prototype.dimParam=function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null},e.startDimensionValue=function(t){t.startObject(3)},e.addDimType=function(e,n){e.addFieldInt8(0,n,t.experimental.fbs.DimensionValueType.UNKNOWN)},e.addDimValue=function(t,e){t.addFieldInt64(1,e,t.createLong(0,0))},e.addDimParam=function(t,e){t.addFieldOffset(2,e,0)},e.endDimensionValue=function(t){return t.endObject()},e.createDimensionValue=function(t,n,r,o){return e.startDimensionValue(t),e.addDimType(t,n),e.addDimValue(t,r),e.addDimParam(t,o),e.endDimensionValue(t)},e}();e.DimensionValue=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){var n=function(){function e(){this.bb=null,this.bb_pos=0}return e.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.getRootAsTensorTypeAndShape=function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.getSizePrefixedRootAsTensorTypeAndShape=function(t,n){return t.setPosition(t.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.prototype.elemType=function(){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):t.experimental.fbs.TensorDataType.UNDEFINED},e.prototype.shape=function(e){var n=this.bb.__offset(this.bb_pos,6);return n?(e||new t.experimental.fbs.Shape).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null},e.startTensorTypeAndShape=function(t){t.startObject(2)},e.addElemType=function(e,n){e.addFieldInt32(0,n,t.experimental.fbs.TensorDataType.UNDEFINED)},e.addShape=function(t,e){t.addFieldOffset(1,e,0)},e.endTensorTypeAndShape=function(t){return t.endObject()},e.createTensorTypeAndShape=function(t,n,r){return e.startTensorTypeAndShape(t),e.addElemType(t,n),e.addShape(t,r),e.endTensorTypeAndShape(t)},e}();e.TensorTypeAndShape=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){var n=function(){function e(){this.bb=null,this.bb_pos=0}return e.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.getRootAsMapType=function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.getSizePrefixedRootAsMapType=function(t,n){return t.setPosition(t.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.prototype.keyType=function(){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):t.experimental.fbs.TensorDataType.UNDEFINED},e.prototype.valueType=function(e){var n=this.bb.__offset(this.bb_pos,6);return n?(e||new t.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null},e.startMapType=function(t){t.startObject(2)},e.addKeyType=function(e,n){e.addFieldInt32(0,n,t.experimental.fbs.TensorDataType.UNDEFINED)},e.addValueType=function(t,e){t.addFieldOffset(1,e,0)},e.endMapType=function(t){return t.endObject()},e.createMapType=function(t,n,r){return e.startMapType(t),e.addKeyType(t,n),e.addValueType(t,r),e.endMapType(t)},e}();e.MapType=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){var n=function(){function e(){this.bb=null,this.bb_pos=0}return e.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.getRootAsSequenceType=function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.getSizePrefixedRootAsSequenceType=function(t,n){return t.setPosition(t.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.prototype.elemType=function(e){var n=this.bb.__offset(this.bb_pos,4);return n?(e||new t.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null},e.startSequenceType=function(t){t.startObject(1)},e.addElemType=function(t,e){t.addFieldOffset(0,e,0)},e.endSequenceType=function(t){return t.endObject()},e.createSequenceType=function(t,n){return e.startSequenceType(t),e.addElemType(t,n),e.endSequenceType(t)},e}();e.SequenceType=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(t){!function(t){var e=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.prototype.nodeIndex=function(){return this.bb.readUint32(this.bb_pos)},t.prototype.srcArgIndex=function(){return this.bb.readInt32(this.bb_pos+4)},t.prototype.dstArgIndex=function(){return this.bb.readInt32(this.bb_pos+8)},t.createEdgeEnd=function(t,e,n,r){return t.prep(4,12),t.writeInt32(r),t.writeInt32(n),t.writeInt32(e),t.offset()},t}();t.EdgeEnd=e}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){var n=function(){function e(){this.bb=null,this.bb_pos=0}return e.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.getRootAsNodeEdge=function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.getSizePrefixedRootAsNodeEdge=function(t,n){return t.setPosition(t.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.prototype.nodeIndex=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readUint32(this.bb_pos+t):0},e.prototype.inputEdges=function(e,n){var r=this.bb.__offset(this.bb_pos,6);return r?(n||new t.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+r)+12*e,this.bb):null},e.prototype.inputEdgesLength=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0},e.prototype.outputEdges=function(e,n){var r=this.bb.__offset(this.bb_pos,8);return r?(n||new t.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+r)+12*e,this.bb):null},e.prototype.outputEdgesLength=function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0},e.startNodeEdge=function(t){t.startObject(3)},e.addNodeIndex=function(t,e){t.addFieldInt32(0,e,0)},e.addInputEdges=function(t,e){t.addFieldOffset(1,e,0)},e.startInputEdgesVector=function(t,e){t.startVector(12,e,4)},e.addOutputEdges=function(t,e){t.addFieldOffset(2,e,0)},e.startOutputEdgesVector=function(t,e){t.startVector(12,e,4)},e.endNodeEdge=function(t){return t.endObject()},e.createNodeEdge=function(t,n,r,o){return e.startNodeEdge(t),e.addNodeIndex(t,n),e.addInputEdges(t,r),e.addOutputEdges(t,o),e.endNodeEdge(t)},e}();e.NodeEdge=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){var n=function(){function e(){this.bb=null,this.bb_pos=0}return e.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.getRootAsNode=function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.getSizePrefixedRootAsNode=function(t,n){return t.setPosition(t.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.prototype.name=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.docString=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.domain=function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.sinceVersion=function(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt32(this.bb_pos+t):0},e.prototype.index=function(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readUint32(this.bb_pos+t):0},e.prototype.opType=function(t){var e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.type=function(){var e=this.bb.__offset(this.bb_pos,16);return e?this.bb.readInt32(this.bb_pos+e):t.experimental.fbs.NodeType.Primitive},e.prototype.executionProviderType=function(t){var e=this.bb.__offset(this.bb_pos,18);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.inputs=function(t,e){var n=this.bb.__offset(this.bb_pos,20);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null},e.prototype.inputsLength=function(){var t=this.bb.__offset(this.bb_pos,20);return t?this.bb.__vector_len(this.bb_pos+t):0},e.prototype.outputs=function(t,e){var n=this.bb.__offset(this.bb_pos,22);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null},e.prototype.outputsLength=function(){var t=this.bb.__offset(this.bb_pos,22);return t?this.bb.__vector_len(this.bb_pos+t):0},e.prototype.attributes=function(e,n){var r=this.bb.__offset(this.bb_pos,24);return r?(n||new t.experimental.fbs.Attribute).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null},e.prototype.attributesLength=function(){var t=this.bb.__offset(this.bb_pos,24);return t?this.bb.__vector_len(this.bb_pos+t):0},e.prototype.inputArgCounts=function(t){var e=this.bb.__offset(this.bb_pos,26);return e?this.bb.readInt32(this.bb.__vector(this.bb_pos+e)+4*t):0},e.prototype.inputArgCountsLength=function(){var t=this.bb.__offset(this.bb_pos,26);return t?this.bb.__vector_len(this.bb_pos+t):0},e.prototype.inputArgCountsArray=function(){var t=this.bb.__offset(this.bb_pos,26);return t?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null},e.prototype.implicitInputs=function(t,e){var n=this.bb.__offset(this.bb_pos,28);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null},e.prototype.implicitInputsLength=function(){var t=this.bb.__offset(this.bb_pos,28);return t?this.bb.__vector_len(this.bb_pos+t):0},e.startNode=function(t){t.startObject(13)},e.addName=function(t,e){t.addFieldOffset(0,e,0)},e.addDocString=function(t,e){t.addFieldOffset(1,e,0)},e.addDomain=function(t,e){t.addFieldOffset(2,e,0)},e.addSinceVersion=function(t,e){t.addFieldInt32(3,e,0)},e.addIndex=function(t,e){t.addFieldInt32(4,e,0)},e.addOpType=function(t,e){t.addFieldOffset(5,e,0)},e.addType=function(e,n){e.addFieldInt32(6,n,t.experimental.fbs.NodeType.Primitive)},e.addExecutionProviderType=function(t,e){t.addFieldOffset(7,e,0)},e.addInputs=function(t,e){t.addFieldOffset(8,e,0)},e.createInputsVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},e.startInputsVector=function(t,e){t.startVector(4,e,4)},e.addOutputs=function(t,e){t.addFieldOffset(9,e,0)},e.createOutputsVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},e.startOutputsVector=function(t,e){t.startVector(4,e,4)},e.addAttributes=function(t,e){t.addFieldOffset(10,e,0)},e.createAttributesVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},e.startAttributesVector=function(t,e){t.startVector(4,e,4)},e.addInputArgCounts=function(t,e){t.addFieldOffset(11,e,0)},e.createInputArgCountsVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addInt32(e[n]);return t.endVector()},e.startInputArgCountsVector=function(t,e){t.startVector(4,e,4)},e.addImplicitInputs=function(t,e){t.addFieldOffset(12,e,0)},e.createImplicitInputsVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},e.startImplicitInputsVector=function(t,e){t.startVector(4,e,4)},e.endNode=function(t){return t.endObject()},e.createNode=function(t,n,r,o,i,a,s,u,c,l,f,p,h,d){return e.startNode(t),e.addName(t,n),e.addDocString(t,r),e.addDomain(t,o),e.addSinceVersion(t,i),e.addIndex(t,a),e.addOpType(t,s),e.addType(t,u),e.addExecutionProviderType(t,c),e.addInputs(t,l),e.addOutputs(t,f),e.addAttributes(t,p),e.addInputArgCounts(t,h),e.addImplicitInputs(t,d),e.endNode(t)},e}();e.Node=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){var n=function(){function e(){this.bb=null,this.bb_pos=0}return e.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.getRootAsValueInfo=function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.getSizePrefixedRootAsValueInfo=function(t,n){return t.setPosition(t.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.prototype.name=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.docString=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.type=function(e){var n=this.bb.__offset(this.bb_pos,8);return n?(e||new t.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null},e.startValueInfo=function(t){t.startObject(3)},e.addName=function(t,e){t.addFieldOffset(0,e,0)},e.addDocString=function(t,e){t.addFieldOffset(1,e,0)},e.addType=function(t,e){t.addFieldOffset(2,e,0)},e.endValueInfo=function(t){return t.endObject()},e.createValueInfo=function(t,n,r,o){return e.startValueInfo(t),e.addName(t,n),e.addDocString(t,r),e.addType(t,o),e.endValueInfo(t)},e}();e.ValueInfo=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){var n=function(){function e(){this.bb=null,this.bb_pos=0}return e.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.getRootAsTypeInfo=function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.getSizePrefixedRootAsTypeInfo=function(t,n){return t.setPosition(t.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.prototype.denotation=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.valueType=function(){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):t.experimental.fbs.TypeInfoValue.NONE},e.prototype.value=function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__union(t,this.bb_pos+e):null},e.startTypeInfo=function(t){t.startObject(3)},e.addDenotation=function(t,e){t.addFieldOffset(0,e,0)},e.addValueType=function(e,n){e.addFieldInt8(1,n,t.experimental.fbs.TypeInfoValue.NONE)},e.addValue=function(t,e){t.addFieldOffset(2,e,0)},e.endTypeInfo=function(t){return t.endObject()},e.createTypeInfo=function(t,n,r,o){return e.startTypeInfo(t),e.addDenotation(t,n),e.addValueType(t,r),e.addValue(t,o),e.endTypeInfo(t)},e}();e.TypeInfo=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(t){!function(t){var e=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsOperatorSetId=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsOperatorSetId=function(e,n){return e.setPosition(e.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.domain=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null},t.prototype.version=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)},t.startOperatorSetId=function(t){t.startObject(2)},t.addDomain=function(t,e){t.addFieldOffset(0,e,0)},t.addVersion=function(t,e){t.addFieldInt64(1,e,t.createLong(0,0))},t.endOperatorSetId=function(t){return t.endObject()},t.createOperatorSetId=function(e,n,r){return t.startOperatorSetId(e),t.addDomain(e,n),t.addVersion(e,r),t.endOperatorSetId(e)},t}();t.OperatorSetId=e}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){var n=function(){function e(){this.bb=null,this.bb_pos=0}return e.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.getRootAsTensor=function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.getSizePrefixedRootAsTensor=function(t,n){return t.setPosition(t.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.prototype.name=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.docString=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.dims=function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)},e.prototype.dimsLength=function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0},e.prototype.dataType=function(){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt32(this.bb_pos+e):t.experimental.fbs.TensorDataType.UNDEFINED},e.prototype.rawData=function(t){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readUint8(this.bb.__vector(this.bb_pos+e)+t):0},e.prototype.rawDataLength=function(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0},e.prototype.rawDataArray=function(){var t=this.bb.__offset(this.bb_pos,12);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null},e.prototype.stringData=function(t,e){var n=this.bb.__offset(this.bb_pos,14);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null},e.prototype.stringDataLength=function(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0},e.startTensor=function(t){t.startObject(6)},e.addName=function(t,e){t.addFieldOffset(0,e,0)},e.addDocString=function(t,e){t.addFieldOffset(1,e,0)},e.addDims=function(t,e){t.addFieldOffset(2,e,0)},e.createDimsVector=function(t,e){t.startVector(8,e.length,8);for(var n=e.length-1;n>=0;n--)t.addInt64(e[n]);return t.endVector()},e.startDimsVector=function(t,e){t.startVector(8,e,8)},e.addDataType=function(e,n){e.addFieldInt32(3,n,t.experimental.fbs.TensorDataType.UNDEFINED)},e.addRawData=function(t,e){t.addFieldOffset(4,e,0)},e.createRawDataVector=function(t,e){t.startVector(1,e.length,1);for(var n=e.length-1;n>=0;n--)t.addInt8(e[n]);return t.endVector()},e.startRawDataVector=function(t,e){t.startVector(1,e,1)},e.addStringData=function(t,e){t.addFieldOffset(5,e,0)},e.createStringDataVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},e.startStringDataVector=function(t,e){t.startVector(4,e,4)},e.endTensor=function(t){return t.endObject()},e.createTensor=function(t,n,r,o,i,a,s){return e.startTensor(t),e.addName(t,n),e.addDocString(t,r),e.addDims(t,o),e.addDataType(t,i),e.addRawData(t,a),e.addStringData(t,s),e.endTensor(t)},e}();e.Tensor=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){var n=function(){function e(){this.bb=null,this.bb_pos=0}return e.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.getRootAsSparseTensor=function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.getSizePrefixedRootAsSparseTensor=function(t,n){return t.setPosition(t.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.prototype.values=function(e){var n=this.bb.__offset(this.bb_pos,4);return n?(e||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null},e.prototype.indices=function(e){var n=this.bb.__offset(this.bb_pos,6);return n?(e||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null},e.prototype.dims=function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)},e.prototype.dimsLength=function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0},e.startSparseTensor=function(t){t.startObject(3)},e.addValues=function(t,e){t.addFieldOffset(0,e,0)},e.addIndices=function(t,e){t.addFieldOffset(1,e,0)},e.addDims=function(t,e){t.addFieldOffset(2,e,0)},e.createDimsVector=function(t,e){t.startVector(8,e.length,8);for(var n=e.length-1;n>=0;n--)t.addInt64(e[n]);return t.endVector()},e.startDimsVector=function(t,e){t.startVector(8,e,8)},e.endSparseTensor=function(t){return t.endObject()},e.createSparseTensor=function(t,n,r,o){return e.startSparseTensor(t),e.addValues(t,n),e.addIndices(t,r),e.addDims(t,o),e.endSparseTensor(t)},e}();e.SparseTensor=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){var n=function(){function e(){this.bb=null,this.bb_pos=0}return e.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.getRootAsAttribute=function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.getSizePrefixedRootAsAttribute=function(t,n){return t.setPosition(t.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.prototype.name=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.docString=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.type=function(){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt32(this.bb_pos+e):t.experimental.fbs.AttributeType.UNDEFINED},e.prototype.f=function(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readFloat32(this.bb_pos+t):0},e.prototype.i=function(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)},e.prototype.s=function(t){var e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.t=function(e){var n=this.bb.__offset(this.bb_pos,16);return n?(e||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null},e.prototype.g=function(e){var n=this.bb.__offset(this.bb_pos,18);return n?(e||new t.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null},e.prototype.floats=function(t){var e=this.bb.__offset(this.bb_pos,20);return e?this.bb.readFloat32(this.bb.__vector(this.bb_pos+e)+4*t):0},e.prototype.floatsLength=function(){var t=this.bb.__offset(this.bb_pos,20);return t?this.bb.__vector_len(this.bb_pos+t):0},e.prototype.floatsArray=function(){var t=this.bb.__offset(this.bb_pos,20);return t?new Float32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null},e.prototype.ints=function(t){var e=this.bb.__offset(this.bb_pos,22);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)},e.prototype.intsLength=function(){var t=this.bb.__offset(this.bb_pos,22);return t?this.bb.__vector_len(this.bb_pos+t):0},e.prototype.strings=function(t,e){var n=this.bb.__offset(this.bb_pos,24);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null},e.prototype.stringsLength=function(){var t=this.bb.__offset(this.bb_pos,24);return t?this.bb.__vector_len(this.bb_pos+t):0},e.prototype.tensors=function(e,n){var r=this.bb.__offset(this.bb_pos,26);return r?(n||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null},e.prototype.tensorsLength=function(){var t=this.bb.__offset(this.bb_pos,26);return t?this.bb.__vector_len(this.bb_pos+t):0},e.prototype.graphs=function(e,n){var r=this.bb.__offset(this.bb_pos,28);return r?(n||new t.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null},e.prototype.graphsLength=function(){var t=this.bb.__offset(this.bb_pos,28);return t?this.bb.__vector_len(this.bb_pos+t):0},e.startAttribute=function(t){t.startObject(13)},e.addName=function(t,e){t.addFieldOffset(0,e,0)},e.addDocString=function(t,e){t.addFieldOffset(1,e,0)},e.addType=function(e,n){e.addFieldInt32(2,n,t.experimental.fbs.AttributeType.UNDEFINED)},e.addF=function(t,e){t.addFieldFloat32(3,e,0)},e.addI=function(t,e){t.addFieldInt64(4,e,t.createLong(0,0))},e.addS=function(t,e){t.addFieldOffset(5,e,0)},e.addT=function(t,e){t.addFieldOffset(6,e,0)},e.addG=function(t,e){t.addFieldOffset(7,e,0)},e.addFloats=function(t,e){t.addFieldOffset(8,e,0)},e.createFloatsVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addFloat32(e[n]);return t.endVector()},e.startFloatsVector=function(t,e){t.startVector(4,e,4)},e.addInts=function(t,e){t.addFieldOffset(9,e,0)},e.createIntsVector=function(t,e){t.startVector(8,e.length,8);for(var n=e.length-1;n>=0;n--)t.addInt64(e[n]);return t.endVector()},e.startIntsVector=function(t,e){t.startVector(8,e,8)},e.addStrings=function(t,e){t.addFieldOffset(10,e,0)},e.createStringsVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},e.startStringsVector=function(t,e){t.startVector(4,e,4)},e.addTensors=function(t,e){t.addFieldOffset(11,e,0)},e.createTensorsVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},e.startTensorsVector=function(t,e){t.startVector(4,e,4)},e.addGraphs=function(t,e){t.addFieldOffset(12,e,0)},e.createGraphsVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},e.startGraphsVector=function(t,e){t.startVector(4,e,4)},e.endAttribute=function(t){return t.endObject()},e.createAttribute=function(t,n,r,o,i,a,s,u,c,l,f,p,h,d){return e.startAttribute(t),e.addName(t,n),e.addDocString(t,r),e.addType(t,o),e.addF(t,i),e.addI(t,a),e.addS(t,s),e.addT(t,u),e.addG(t,c),e.addFloats(t,l),e.addInts(t,f),e.addStrings(t,p),e.addTensors(t,h),e.addGraphs(t,d),e.endAttribute(t)},e}();e.Attribute=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){var n=function(){function e(){this.bb=null,this.bb_pos=0}return e.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.getRootAsGraph=function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.getSizePrefixedRootAsGraph=function(t,n){return t.setPosition(t.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.prototype.initializers=function(e,n){var r=this.bb.__offset(this.bb_pos,4);return r?(n||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null},e.prototype.initializersLength=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0},e.prototype.nodeArgs=function(e,n){var r=this.bb.__offset(this.bb_pos,6);return r?(n||new t.experimental.fbs.ValueInfo).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null},e.prototype.nodeArgsLength=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0},e.prototype.nodes=function(e,n){var r=this.bb.__offset(this.bb_pos,8);return r?(n||new t.experimental.fbs.Node).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null},e.prototype.nodesLength=function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0},e.prototype.maxNodeIndex=function(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readUint32(this.bb_pos+t):0},e.prototype.nodeEdges=function(e,n){var r=this.bb.__offset(this.bb_pos,12);return r?(n||new t.experimental.fbs.NodeEdge).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null},e.prototype.nodeEdgesLength=function(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0},e.prototype.inputs=function(t,e){var n=this.bb.__offset(this.bb_pos,14);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null},e.prototype.inputsLength=function(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0},e.prototype.outputs=function(t,e){var n=this.bb.__offset(this.bb_pos,16);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null},e.prototype.outputsLength=function(){var t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0},e.prototype.sparseInitializers=function(e,n){var r=this.bb.__offset(this.bb_pos,18);return r?(n||new t.experimental.fbs.SparseTensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null},e.prototype.sparseInitializersLength=function(){var t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0},e.startGraph=function(t){t.startObject(8)},e.addInitializers=function(t,e){t.addFieldOffset(0,e,0)},e.createInitializersVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},e.startInitializersVector=function(t,e){t.startVector(4,e,4)},e.addNodeArgs=function(t,e){t.addFieldOffset(1,e,0)},e.createNodeArgsVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},e.startNodeArgsVector=function(t,e){t.startVector(4,e,4)},e.addNodes=function(t,e){t.addFieldOffset(2,e,0)},e.createNodesVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},e.startNodesVector=function(t,e){t.startVector(4,e,4)},e.addMaxNodeIndex=function(t,e){t.addFieldInt32(3,e,0)},e.addNodeEdges=function(t,e){t.addFieldOffset(4,e,0)},e.createNodeEdgesVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},e.startNodeEdgesVector=function(t,e){t.startVector(4,e,4)},e.addInputs=function(t,e){t.addFieldOffset(5,e,0)},e.createInputsVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},e.startInputsVector=function(t,e){t.startVector(4,e,4)},e.addOutputs=function(t,e){t.addFieldOffset(6,e,0)},e.createOutputsVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},e.startOutputsVector=function(t,e){t.startVector(4,e,4)},e.addSparseInitializers=function(t,e){t.addFieldOffset(7,e,0)},e.createSparseInitializersVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},e.startSparseInitializersVector=function(t,e){t.startVector(4,e,4)},e.endGraph=function(t){return t.endObject()},e.createGraph=function(t,n,r,o,i,a,s,u,c){return e.startGraph(t),e.addInitializers(t,n),e.addNodeArgs(t,r),e.addNodes(t,o),e.addMaxNodeIndex(t,i),e.addNodeEdges(t,a),e.addInputs(t,s),e.addOutputs(t,u),e.addSparseInitializers(t,c),e.endGraph(t)},e}();e.Graph=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){var n=function(){function e(){this.bb=null,this.bb_pos=0}return e.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.getRootAsModel=function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.getSizePrefixedRootAsModel=function(t,n){return t.setPosition(t.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.prototype.irVersion=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)},e.prototype.opsetImport=function(e,n){var r=this.bb.__offset(this.bb_pos,6);return r?(n||new t.experimental.fbs.OperatorSetId).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null},e.prototype.opsetImportLength=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0},e.prototype.producerName=function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.producerVersion=function(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.domain=function(t){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.modelVersion=function(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)},e.prototype.docString=function(t){var e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.graph=function(e){var n=this.bb.__offset(this.bb_pos,18);return n?(e||new t.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null},e.prototype.graphDocString=function(t){var e=this.bb.__offset(this.bb_pos,20);return e?this.bb.__string(this.bb_pos+e,t):null},e.startModel=function(t){t.startObject(9)},e.addIrVersion=function(t,e){t.addFieldInt64(0,e,t.createLong(0,0))},e.addOpsetImport=function(t,e){t.addFieldOffset(1,e,0)},e.createOpsetImportVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},e.startOpsetImportVector=function(t,e){t.startVector(4,e,4)},e.addProducerName=function(t,e){t.addFieldOffset(2,e,0)},e.addProducerVersion=function(t,e){t.addFieldOffset(3,e,0)},e.addDomain=function(t,e){t.addFieldOffset(4,e,0)},e.addModelVersion=function(t,e){t.addFieldInt64(5,e,t.createLong(0,0))},e.addDocString=function(t,e){t.addFieldOffset(6,e,0)},e.addGraph=function(t,e){t.addFieldOffset(7,e,0)},e.addGraphDocString=function(t,e){t.addFieldOffset(8,e,0)},e.endModel=function(t){return t.endObject()},e.createModel=function(t,n,r,o,i,a,s,u,c,l){return e.startModel(t),e.addIrVersion(t,n),e.addOpsetImport(t,r),e.addProducerName(t,o),e.addProducerVersion(t,i),e.addDomain(t,a),e.addModelVersion(t,s),e.addDocString(t,u),e.addGraph(t,c),e.addGraphDocString(t,l),e.endModel(t)},e}();e.Model=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(t){!function(t){var e=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsKernelCreateInfos=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsKernelCreateInfos=function(e,n){return e.setPosition(e.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.nodeIndices=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readUint32(this.bb.__vector(this.bb_pos+e)+4*t):0},t.prototype.nodeIndicesLength=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0},t.prototype.nodeIndicesArray=function(){var t=this.bb.__offset(this.bb_pos,4);return t?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null},t.prototype.kernelDefHashes=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)},t.prototype.kernelDefHashesLength=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0},t.startKernelCreateInfos=function(t){t.startObject(2)},t.addNodeIndices=function(t,e){t.addFieldOffset(0,e,0)},t.createNodeIndicesVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addInt32(e[n]);return t.endVector()},t.startNodeIndicesVector=function(t,e){t.startVector(4,e,4)},t.addKernelDefHashes=function(t,e){t.addFieldOffset(1,e,0)},t.createKernelDefHashesVector=function(t,e){t.startVector(8,e.length,8);for(var n=e.length-1;n>=0;n--)t.addInt64(e[n]);return t.endVector()},t.startKernelDefHashesVector=function(t,e){t.startVector(8,e,8)},t.endKernelCreateInfos=function(t){return t.endObject()},t.createKernelCreateInfos=function(e,n,r){return t.startKernelCreateInfos(e),t.addNodeIndices(e,n),t.addKernelDefHashes(e,r),t.endKernelCreateInfos(e)},t}();t.KernelCreateInfos=e}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){var n=function(){function e(){this.bb=null,this.bb_pos=0}return e.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.getRootAsSubGraphSessionState=function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.getSizePrefixedRootAsSubGraphSessionState=function(t,n){return t.setPosition(t.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.prototype.graphId=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.sessionState=function(e){var n=this.bb.__offset(this.bb_pos,6);return n?(e||new t.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null},e.startSubGraphSessionState=function(t){t.startObject(2)},e.addGraphId=function(t,e){t.addFieldOffset(0,e,0)},e.addSessionState=function(t,e){t.addFieldOffset(1,e,0)},e.endSubGraphSessionState=function(t){var e=t.endObject();return t.requiredField(e,4),e},e.createSubGraphSessionState=function(t,n,r){return e.startSubGraphSessionState(t),e.addGraphId(t,n),e.addSessionState(t,r),e.endSubGraphSessionState(t)},e}();e.SubGraphSessionState=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){var n=function(){function e(){this.bb=null,this.bb_pos=0}return e.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.getRootAsSessionState=function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.getSizePrefixedRootAsSessionState=function(t,n){return t.setPosition(t.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.prototype.kernels=function(e){var n=this.bb.__offset(this.bb_pos,4);return n?(e||new t.experimental.fbs.KernelCreateInfos).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null},e.prototype.subGraphSessionStates=function(e,n){var r=this.bb.__offset(this.bb_pos,6);return r?(n||new t.experimental.fbs.SubGraphSessionState).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null},e.prototype.subGraphSessionStatesLength=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0},e.startSessionState=function(t){t.startObject(2)},e.addKernels=function(t,e){t.addFieldOffset(0,e,0)},e.addSubGraphSessionStates=function(t,e){t.addFieldOffset(1,e,0)},e.createSubGraphSessionStatesVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},e.startSubGraphSessionStatesVector=function(t,e){t.startVector(4,e,4)},e.endSessionState=function(t){return t.endObject()},e.createSessionState=function(t,n,r){return e.startSessionState(t),e.addKernels(t,n),e.addSubGraphSessionStates(t,r),e.endSessionState(t)},e}();e.SessionState=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){var n=function(){function e(){this.bb=null,this.bb_pos=0}return e.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.getRootAsInferenceSession=function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.getSizePrefixedRootAsInferenceSession=function(t,n){return t.setPosition(t.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.bufferHasIdentifier=function(t){return t.__has_identifier("ORTM")},e.prototype.ortVersion=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.model=function(e){var n=this.bb.__offset(this.bb_pos,6);return n?(e||new t.experimental.fbs.Model).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null},e.prototype.sessionState=function(e){var n=this.bb.__offset(this.bb_pos,8);return n?(e||new t.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null},e.startInferenceSession=function(t){t.startObject(3)},e.addOrtVersion=function(t,e){t.addFieldOffset(0,e,0)},e.addModel=function(t,e){t.addFieldOffset(1,e,0)},e.addSessionState=function(t,e){t.addFieldOffset(2,e,0)},e.endInferenceSession=function(t){return t.endObject()},e.finishInferenceSessionBuffer=function(t,e){t.finish(e,"ORTM")},e.finishSizePrefixedInferenceSessionBuffer=function(t,e){t.finish(e,"ORTM",!0)},e.createInferenceSession=function(t,n,r,o){return e.startInferenceSession(t),e.addOrtVersion(t,n),e.addModel(t,r),e.addSessionState(t,o),e.endInferenceSession(t)},e}();e.InferenceSession=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={}))},7448:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.OnnxjsSessionHandler=void 0;var i=n(8453),a=n(9162),s=function(){function t(t){this.session=t,this.inputNames=this.session.inputNames,this.outputNames=this.session.outputNames}return t.prototype.dispose=function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2]}))}))},t.prototype.run=function(t,e,n){return r(this,void 0,void 0,(function(){var e,n,r,s,u;return o(this,(function(o){switch(o.label){case 0:for(n in e=new Map,t)Object.hasOwnProperty.call(t,n)&&(r=t[n],e.set(n,new a.Tensor(r.dims,r.type,void 0,void 0,r.data)));return[4,this.session.run(e)];case 1:return s=o.sent(),u={},s.forEach((function(t,e){u[e]=new i.Tensor(t.type,t.data,t.dims)})),[2,u]}}))}))},t.prototype.startProfiling=function(){this.session.startProfiling()},t.prototype.endProfiling=function(){this.session.endProfiling()},t}();e.OnnxjsSessionHandler=s},6919:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.Session=void 0;var i=n(7067),a=n(1296),s=n(7091),u=n(1036),c=n(6231),l=n(2644),f=function(){function t(t){void 0===t&&(t={}),this._initialized=!1,this.backendHint=t.backendHint,this.profiler=c.Profiler.create(t.profiler),this.context={profiler:this.profiler,graphInputTypes:[],graphInputDims:[]}}return Object.defineProperty(t.prototype,"inputNames",{get:function(){return this._model.graph.getInputNames()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"outputNames",{get:function(){return this._model.graph.getOutputNames()},enumerable:!1,configurable:!0}),t.prototype.startProfiling=function(){this.profiler.start()},t.prototype.endProfiling=function(){this.profiler.stop()},t.prototype.loadModel=function(t,e,n){return r(this,void 0,void 0,(function(){var u=this;return o(this,(function(c){switch(c.label){case 0:return[4,this.profiler.event("session","Session.loadModel",(function(){return r(u,void 0,void 0,(function(){var r,u,c,f;return o(this,(function(o){switch(o.label){case 0:return[4,(0,s.resolveBackend)(this.backendHint)];case 1:return r=o.sent(),this.sessionHandler=r.createSessionHandler(this.context),this._model=new l.Model,"string"!=typeof t?[3,7]:(u=t.endsWith(".ort"),"undefined"!=typeof fetch?[3,3]:[4,(0,a.promisify)(i.readFile)(t)]);case 2:return c=o.sent(),this.initialize(c,u),[3,6];case 3:return[4,fetch(t)];case 4:return[4,o.sent().arrayBuffer()];case 5:c=o.sent(),this.initialize(new Uint8Array(c),u),o.label=6;case 6:return[3,8];case 7:ArrayBuffer.isView(t)?this.initialize(t):(f=new Uint8Array(t,e||0,n||t.byteLength),this.initialize(f)),o.label=8;case 8:return[2]}}))}))}))];case 1:return c.sent(),[2]}}))}))},t.prototype.initialize=function(t,e){var n=this;if(this._initialized)throw new Error("already initialized");this.profiler.event("session","Session.initialize",(function(){var r=n.sessionHandler.transformGraph?n.sessionHandler:void 0;n._model.load(t,r,e),n.sessionHandler.onGraphInitialized&&n.sessionHandler.onGraphInitialized(n._model.graph),n.initializeOps(n._model.graph),n._executionPlan=new u.ExecutionPlan(n._model.graph,n._ops,n.profiler)})),this._initialized=!0},t.prototype.run=function(t){return r(this,void 0,void 0,(function(){var e=this;return o(this,(function(n){if(!this._initialized)throw new Error("session not initialized yet");return[2,this.profiler.event("session","Session.run",(function(){return r(e,void 0,void 0,(function(){var e,n;return o(this,(function(r){switch(r.label){case 0:return e=this.normalizeAndValidateInputs(t),[4,this._executionPlan.execute(this.sessionHandler,e)];case 1:return n=r.sent(),[2,this.createOutput(n)]}}))}))}))]}))}))},t.prototype.normalizeAndValidateInputs=function(t){var e=this._model.graph.getInputNames();if(Array.isArray(t)){if(t.length!==e.length)throw new Error("incorrect input array length: expected ".concat(e.length," but got ").concat(t.length))}else{if(t.size!==e.length)throw new Error("incorrect input map size: expected ".concat(e.length," but got ").concat(t.size));for(var n=new Array(t.size),r=0,o=0;o<e.length;++o){var i=t.get(e[o]);if(!i)throw new Error("missing input tensor for: '".concat(name,"'"));n[r++]=i}t=n}if(this.context.graphInputTypes&&0!==this.context.graphInputTypes.length&&this.context.graphInputDims&&0!==this.context.graphInputDims.length)this.validateInputTensorDims(this.context.graphInputDims,t,!1);else{var a=this._model.graph.getInputIndices(),s=this._model.graph.getValues(),u=new Array(a.length);for(o=0;o<a.length;++o){var c=s[a[o]];u[o]=c.type.shape.dims,this.context.graphInputTypes.push(c.type.tensorType),this.context.graphInputDims.push(t[o].dims)}this.validateInputTensorDims(u,t,!0)}return this.validateInputTensorTypes(this.context.graphInputTypes,t),t},t.prototype.validateInputTensorTypes=function(t,e){for(var n=0;n<e.length;n++){var r=t[n],o=e[n].type;if(r!==o)throw new Error("input tensor[".concat(n,"] check failed: expected type '").concat(r,"' but got ").concat(o))}},t.prototype.validateInputTensorDims=function(t,e,n){for(var r=0;r<e.length;r++){var o=t[r],i=e[r].dims;if(!this.compareTensorDims(o,i,n))throw new Error("input tensor[".concat(r,"] check failed: expected shape '[").concat(o.join(","),"]' but got [").concat(i.join(","),"]"))}},t.prototype.compareTensorDims=function(t,e,n){if(t.length!==e.length)return!1;for(var r=0;r<t.length;++r)if(t[r]!==e[r]&&(!n||0!==t[r]))return!1;return!0},t.prototype.createOutput=function(t){var e=this._model.graph.getOutputNames();if(t.length!==e.length)throw new Error("expected number of outputs do not match number of generated outputs");for(var n=new Map,r=0;r<e.length;++r)n.set(e[r],t[r]);return n},t.prototype.initializeOps=function(t){var e=t.getNodes();this._ops=new Array(e.length);for(var n=0;n<e.length;n++)this._ops[n]=this.sessionHandler.resolve(e[n],this._model.opsets,t)},t}();e.Session=f},9162:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Tensor=void 0;var a=n(3442),s=i(n(3720)),u=n(1446),c=n(9395),l=n(2517),f=c.onnxruntime.experimental.fbs,p=function(){function t(t,e,n,r,o,i){void 0===i&&(i=a.Guid.create()),this.dims=t,this.type=e,this.dataProvider=n,this.asyncDataProvider=r,this.cache=o,this.dataId=i,this.size=l.ShapeUtil.validateDimsAndCalcSize(t);var s=this.size,u=void 0===n&&void 0===r&&void 0===o;if(void 0!==o&&o.length!==s)throw new RangeError("Input dims doesn't match data length.");if("string"===e){if(!(void 0===o||Array.isArray(o)&&o.every((function(t){return"string"==typeof t}))))throw new TypeError("cache should be a string array");u&&(this.cache=new Array(s))}else{if(void 0!==o){var c=d(e);if(!(o instanceof c))throw new TypeError("cache should be type ".concat(c.name))}if(u){var f=new ArrayBuffer(s*function(t){switch(t){case"bool":case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;case"float64":return 8;default:throw new Error("cannot calculate sizeof() on type ".concat(t))}}(e));this.cache=function(t,e){return new(d(e))(t)}(f,e)}}}return Object.defineProperty(t.prototype,"data",{get:function(){if(void 0===this.cache){var t=this.dataProvider(this.dataId);if(t.length!==this.size)throw new Error("Length of data provided by the Data Provider is inconsistent with the dims of this Tensor.");this.cache=t}return this.cache},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stringData",{get:function(){if("string"!==this.type)throw new TypeError("data type is not string");return this.data},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"integerData",{get:function(){switch(this.type){case"uint8":case"int8":case"uint16":case"int16":case"int32":case"uint32":case"bool":return this.data;default:throw new TypeError("data type is not integer (uint8, int8, uint16, int16, int32, uint32, bool)")}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"floatData",{get:function(){switch(this.type){case"float32":case"float64":return this.data;default:throw new TypeError("data type is not float (float32, float64)")}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"numberData",{get:function(){if("string"!==this.type)return this.data;throw new TypeError("type cannot be non-number (string)")},enumerable:!1,configurable:!0}),t.prototype.get=function(t){return this.data[l.ShapeUtil.indicesToOffset(t,this.strides)]},t.prototype.set=function(t,e){this.data[l.ShapeUtil.indicesToOffset(t,this.strides)]=e},t.prototype.getData=function(){return r(this,void 0,void 0,(function(){var t;return o(this,(function(e){switch(e.label){case 0:return void 0!==this.cache?[3,2]:(t=this,[4,this.asyncDataProvider(this.dataId)]);case 1:t.cache=e.sent(),e.label=2;case 2:return[2,this.cache]}}))}))},Object.defineProperty(t.prototype,"strides",{get:function(){return this._strides||(this._strides=l.ShapeUtil.computeStrides(this.dims)),this._strides},enumerable:!1,configurable:!0}),t.fromProto=function(e){if(!e)throw new Error("cannot construct Value from an empty tensor");var n=l.ProtoUtil.tensorDataTypeFromProto(e.dataType),r=new t(l.ProtoUtil.tensorDimsFromProto(e.dims),n);if("string"===n)e.stringData.forEach((function(t,e){r.data[e]=(0,l.decodeUtf8String)(t)}));else if(e.rawData&&"number"==typeof e.rawData.byteLength&&e.rawData.byteLength>0){var o=r.data,i=new DataView(e.rawData.buffer,e.rawData.byteOffset,e.rawData.byteLength),a=h(e.dataType),c=e.rawData.byteLength/a;if(e.rawData.byteLength%a!=0)throw new Error("invalid buffer length");if(o.length!==c)throw new Error("buffer length mismatch");for(var f=0;f<c;f++){var p=b(i,e.dataType,f*a);o[f]=p}}else{var d=void 0;switch(e.dataType){case u.onnx.TensorProto.DataType.FLOAT:d=e.floatData;break;case u.onnx.TensorProto.DataType.INT32:case u.onnx.TensorProto.DataType.INT16:case u.onnx.TensorProto.DataType.UINT16:case u.onnx.TensorProto.DataType.INT8:case u.onnx.TensorProto.DataType.UINT8:case u.onnx.TensorProto.DataType.BOOL:d=e.int32Data;break;case u.onnx.TensorProto.DataType.INT64:d=e.int64Data;break;case u.onnx.TensorProto.DataType.DOUBLE:d=e.doubleData;break;case u.onnx.TensorProto.DataType.UINT32:case u.onnx.TensorProto.DataType.UINT64:d=e.uint64Data;break;default:throw new Error("unspecific error")}if(null==d)throw new Error("failed to populate data from a tensorproto value");var y=r.data;if(y.length!==d.length)throw new Error("array length mismatch");for(f=0;f<d.length;f++){var m=d[f];s.default.isLong(m)?y[f]=g(m,e.dataType):y[f]=m}}return r},t.fromData=function(e,n,r){return new t(n,r,void 0,void 0,e)},t.fromOrtTensor=function(e){if(!e)throw new Error("cannot construct Value from an empty tensor");var n=l.ProtoUtil.tensorDimsFromORTFormat(e),r=l.ProtoUtil.tensorDataTypeFromProto(e.dataType()),o=new t(n,r);if("string"===r)for(var i=0;i<e.stringDataLength();i++)o.data[i]=e.stringData(i);else if(e.rawDataArray()&&"number"==typeof e.rawDataLength()&&e.rawDataLength()>0){var a=o.data,s=new DataView(e.rawDataArray().buffer,e.rawDataArray().byteOffset,e.rawDataLength()),u=h(e.dataType()),c=e.rawDataLength()/u;if(e.rawDataLength()%u!=0)throw new Error("invalid buffer length");if(a.length!==c)throw new Error("buffer length mismatch");for(i=0;i<c;i++){var f=b(s,e.dataType(),i*u);a[i]=f}}return o},t}();function h(t){switch(t){case u.onnx.TensorProto.DataType.UINT8:case u.onnx.TensorProto.DataType.INT8:case u.onnx.TensorProto.DataType.BOOL:return 1;case u.onnx.TensorProto.DataType.UINT16:case u.onnx.TensorProto.DataType.INT16:return 2;case u.onnx.TensorProto.DataType.FLOAT:case u.onnx.TensorProto.DataType.INT32:case u.onnx.TensorProto.DataType.UINT32:return 4;case u.onnx.TensorProto.DataType.INT64:case u.onnx.TensorProto.DataType.DOUBLE:case u.onnx.TensorProto.DataType.UINT64:return 8;default:throw new Error("cannot calculate sizeof() on type ".concat(u.onnx.TensorProto.DataType[t]))}}function d(t){switch(t){case"bool":case"uint8":return Uint8Array;case"int8":return Int8Array;case"int16":return Int16Array;case"uint16":return Uint16Array;case"int32":return Int32Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;default:throw new Error("unspecified error")}}function g(t,e){if(e===u.onnx.TensorProto.DataType.INT64||e===f.TensorDataType.INT64){if(t.greaterThanOrEqual(2147483648)||t.lessThan(-2147483648))throw new TypeError("int64 is not supported")}else{if(e!==u.onnx.TensorProto.DataType.UINT32&&e!==f.TensorDataType.UINT32&&e!==u.onnx.TensorProto.DataType.UINT64&&e!==f.TensorDataType.UINT64)throw new TypeError("not a LONG type: ".concat(u.onnx.TensorProto.DataType[e]));if(t.greaterThanOrEqual(4294967296)||t.lessThan(0))throw new TypeError("uint64 is not supported")}return t.toNumber()}function b(t,e,n){switch(e){case u.onnx.TensorProto.DataType.BOOL:case u.onnx.TensorProto.DataType.UINT8:return t.getUint8(n);case u.onnx.TensorProto.DataType.INT8:return t.getInt8(n);case u.onnx.TensorProto.DataType.UINT16:return t.getUint16(n,!0);case u.onnx.TensorProto.DataType.INT16:return t.getInt16(n,!0);case u.onnx.TensorProto.DataType.FLOAT:return t.getFloat32(n,!0);case u.onnx.TensorProto.DataType.INT32:return t.getInt32(n,!0);case u.onnx.TensorProto.DataType.UINT32:return t.getUint32(n,!0);case u.onnx.TensorProto.DataType.INT64:return g(s.default.fromBits(t.getUint32(n,!0),t.getUint32(n+4,!0),!1),e);case u.onnx.TensorProto.DataType.DOUBLE:return t.getFloat64(n,!0);case u.onnx.TensorProto.DataType.UINT64:return g(s.default.fromBits(t.getUint32(n,!0),t.getUint32(n+4,!0),!0),e);default:throw new Error("cannot read from DataView for type ".concat(u.onnx.TensorProto.DataType[e]))}}e.Tensor=p},2517:function(t,e,n){"use strict";var r=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.decodeUtf8String=e.MAX_CLIP=e.MIN_CLIP=e.PoolConvUtil=e.ReduceUtil=e.SplitUtil=e.MathUtil=e.ShapeUtil=e.LongUtil=e.ProtoUtil=e.GemmUtil=e.arrayCopyHelper=e.BroadcastUtil=e.MatMulUtil=e.ArrayUtil=e.assert=e.checkInputsShape=void 0;var a=n(5686),s=i(n(3720)),u=n(1446),c=n(9162);e.checkInputsShape=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(!t||t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(!t[r].dims||t[r].dims.length!==e[r])return!1;return!0},e.assert=function(t,e){if(!t)throw new Error("string"==typeof e?e:e())};var l=function(){function t(){}return t.arraysEqual=function(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0},t}();e.ArrayUtil=l;var f=function(){function t(){}return t.preprocessInputShapes=function(t,e){return[1===t.length?[1,t[0]]:t,1===e.length?[e[0],1]:e]},t.postprocessOutputShape=function(t,e,n){1===e&&t.splice(t.length-2,1),1===n&&t.pop()},t.calcMatMulShape=function(t,e){return t[1]!==e[0]?void 0:[t[0],e[1]]},t}();e.MatMulUtil=f;var p=function(){function t(){}return t.calcShape=function(t,e,n){var o;void 0===n&&(n=!1);var i=t.length,a=e.length;if(0===i)return e;if(0===a)return t;var s=Math.max(t.length,e.length),u=new Array(s);if(n){if(i<2||a<2)return;var c=f.calcMatMulShape([t[i-2],t[i-1]],[e[a-2],e[a-1]]);if(void 0===c)return;o=r(c,2),u[s-2]=o[0],u[s-1]=o[1]}for(var l=n?3:1;l<=s;l++){var p=i-l<0?1:t[i-l],h=a-l<0?1:e[a-l];if(p!==h&&p>1&&h>1)return;u[s-l]=Math.max(p,h)}return u},t.index=function(e,n){var r=new Array(n.length);return t.fillIndex(e,n,r),r},t.fillIndex=function(t,e,n){for(var r=t.length-e.length,o=0;o<e.length;o++)n[o]=t[r+o]%e[o]},t.calc=function(e,n,r,o,i){var a=t.calcShape(e.dims,n.dims);if(a){if(o&&!b.areEqual(a,e.dims))return;var s=b.size(a),u=o?e:new c.Tensor(a,i||e.type);if(0===a.length)u.set([],r(e.get([]),n.get([])));else{var l=new Array(a.length),f=new Array(e.dims.length),p=new Array(n.dims.length),h=0,d=0,g=!1,y=!1;0===e.dims.length&&(h=e.get([]),g=!0),0===n.dims.length&&(d=n.get([]),y=!0);for(var m=void 0,v=0;v<s;v++){m=v;for(var _=a.length-1;_>=0;_--)l[_]=m%a[_],m=Math.floor(m/a[_]);g||(t.fillIndex(l,e.dims,f),h=e.get(f)),y||(t.fillIndex(l,n.dims,p),d=n.get(p)),u.set(l,r(h,d))}}return u}},t.isValidBroadcast=function(t,e){var n=t.length,r=e.length;if(n>r)return!1;for(var o=1;o<=n;o++)if(1!==t[n-o]&&t[n-o]!==e[r-o])return!1;return!0},t.getBroadcastDims=function(t,e){for(var n=t.length,r=[],o=0;o<n;o++){var i=n-1-o,a=t[i]||1;(e[e.length-1-o]||1)>1&&1===a&&r.unshift(i)}return r},t}();e.BroadcastUtil=p,e.arrayCopyHelper=function(t,e,n,r,o){if(r<0||r>=e.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=t.length)throw new Error("targetIndex out of bounds");if(r+o>e.length)throw new Error("source indices to be copied are outside bounds");if(n+o>t.length)throw new Error("target array is too small to hold result");for(var i=0;i<o;i++)t[n+i]=e[r+i]};var h=function(){function t(){}return t.getShapeOfGemmResult=function(t,e,n,r,o){if(2!==t.length||2!==n.length)throw new Error("shape need to be of size 2");var i,a,s;e?(i=t[1],a=t[0]):(i=t[0],a=t[1]);var u=-1;if(r?(s=n[0],u=1):(s=n[1],u=0),n[u]!==a)throw new Error("dimension mismatch");if(i<=0||s<=0||a<=0)throw new Error("invalid shape specified");if(o&&!p.isValidBroadcast(o,[i,s]))throw new Error("gemm: invalid bias shape for broadcast");return[i,s,a]},t}();e.GemmUtil=h;var d=function(){function t(){}return t.tensorDataTypeFromProto=function(t){switch(t){case u.onnx.TensorProto.DataType.INT8:return"int8";case u.onnx.TensorProto.DataType.UINT8:return"uint8";case u.onnx.TensorProto.DataType.BOOL:return"bool";case u.onnx.TensorProto.DataType.INT16:return"int16";case u.onnx.TensorProto.DataType.UINT16:return"uint16";case u.onnx.TensorProto.DataType.INT32:return"int32";case u.onnx.TensorProto.DataType.UINT32:return"uint32";case u.onnx.TensorProto.DataType.FLOAT:return"float32";case u.onnx.TensorProto.DataType.DOUBLE:return"float64";case u.onnx.TensorProto.DataType.STRING:return"string";case u.onnx.TensorProto.DataType.INT64:return"int32";case u.onnx.TensorProto.DataType.UINT64:return"uint32";default:throw new Error("unsupported data type: ".concat(u.onnx.TensorProto.DataType[t]))}},t.tensorDataTypeStringToEnum=function(t){switch(t){case"int8":return u.onnx.TensorProto.DataType.INT8;case"uint8":return u.onnx.TensorProto.DataType.UINT8;case"bool":return u.onnx.TensorProto.DataType.BOOL;case"int16":return u.onnx.TensorProto.DataType.INT16;case"uint16":return u.onnx.TensorProto.DataType.UINT16;case"int32":return u.onnx.TensorProto.DataType.INT32;case"uint32":return u.onnx.TensorProto.DataType.UINT32;case"float32":return u.onnx.TensorProto.DataType.FLOAT;case"float64":return u.onnx.TensorProto.DataType.DOUBLE;case"string":return u.onnx.TensorProto.DataType.STRING;case"int64":return u.onnx.TensorProto.DataType.INT64;case"uint64":return u.onnx.TensorProto.DataType.UINT64;default:throw new Error("unsupported data type: ".concat(t))}},t.tensorDimsFromProto=function(t){return t.map((function(t){return s.default.isLong(t)?t.toNumber():t}))},t.tensorValueTypeFromProto=function(e){return{tensorType:t.tensorDataTypeFromProto(e.elemType),shape:{dims:t.tensorDimsFromProto(e.shape.dim.map((function(t){return t.dimValue})))}}},t.tensorDimsFromORTFormat=function(t){for(var e=[],n=0;n<t.dimsLength();n++)e.push(g.longToNumber(t.dims(n)));return e},t.tensorAttributesFromORTFormat=function(t){for(var e=[],n=0;n<t.attributesLength();n++)e.push(t.attributes(n));return e},t}();e.ProtoUtil=d;var g=function(){function t(){}return t.longToNumber=function(t,e){return s.default.isLong(t)?t.toNumber():t instanceof a.flatbuffers.Long?s.default.fromValue({low:t.low,high:t.high,unsigned:null!=e&&e}).toNumber():t},t.isLong=function(t){return s.default.isLong(t)||t instanceof a.flatbuffers.Long},t}();e.LongUtil=g;var b=function(){function t(){}return t.size=function(e){return t.getSizeFromDimensionRange(e,0,e.length)},t.sizeFromDimension=function(e,n){if(n<0||n>e.length)throw new Error("invalid dimension of ".concat(n," for sizeFromDimension as Tensor has ").concat(e.length," dimensions."));return t.getSizeFromDimensionRange(e,n,e.length)},t.sizeToDimension=function(e,n){if(n<0||n>e.length)throw new Error("invalid dimension of ".concat(n," for sizeToDimension as Tensor has ").concat(e.length," dimensions."));return t.getSizeFromDimensionRange(e,0,n)},t.getSizeFromDimensionRange=function(t,e,n){for(var r=1,o=e;o<n;o++){if(t[o]<=0)throw new Error("cannot get valid size from specified dimension range. Most likely the range contains 0 or negative values in them.");r*=t[o]}return r},t.computeStrides=function(t){var e=t.length;if(0===e)return[];if(1===e)return[1];var n=new Array(e);n[e-1]=1,n[e-2]=t[e-1];for(var r=e-3;r>=0;--r)n[r]=n[r+1]*t[r+1];return n},t.transpose=function(t){return t.slice().reverse()},t.indicesToOffset=function(t,e,n){void 0===n&&(n=t.length);for(var r=0,o=0;o<n;++o)r+=e[o]*t[o];return r},t.offsetToIndices=function(t,e){var n=e.length;if(0===n)return[];if(1===n)return[t*e[0]];for(var r=new Array(e.length),o=0;o<r.length-1;++o)r[o]=Math.floor(t/e[o]),t-=r[o]*e[o];return r[r.length-1]=t,r},t.normalizeAxis=function(t,e){if(t<-e&&t>=e)throw new Error("unsupported axis for this operation.");return t<0?t+e:t},t.normalizeAxes=function(t,e){var n=this;return t.map((function(t){return n.normalizeAxis(t,e)}))},t.incrementIndex=function(t,e,n){if(0===e.length||0===t.length)throw new Error("Index incrementing unsupported for scalar Tensor");if(void 0===n)n=e.length;else if(n<=0||n>e.length)throw new Error("Incorrect axis to increment on");for(var r=n-1;r>=0&&(t[r]++,!(t[r]<e[r]));--r)t[r]=0},t.calculateReshapedDims=function(e,n){if(0===n.length){if(0===e.length||1===t.size(e))return[];throw new Error("cannot reshape to a scalar Tensor")}for(var r=n.length,o=new Array(r),i=-1,a=1,s=0;s<r;s++){if(n[s]<-1)throw new Error("a dimension in shape hints cannot be less than -1");if(-1===n[s]){if(-1!==i)throw new Error("at most one dimension in shape hints can be -1");i=s}else{if(0===n[s]){if(s>=e.length)throw new Error("the dimension with value zero exceeds the dimension size of the input tensor");o[s]=e[s]}else o[s]=n[s];a*=o[s]}}var u=t.size(e);if(-1!==i){if(u%a!=0)throw new Error("the input tensor cannot be reshaped to the requested shape. Input shape: [".concat(e,"] Output shape: [").concat(n,"]"));o[i]=u/a}else if(a!==u)throw new Error("reshapedDims and originalDims don't have matching sizes");return o},t.sortBasedOnPerm=function(t,e){return e?e.map((function(e){return t[e]})):t.slice().reverse()},t.padShape=function(t,e){var n=t.length;return t.map((function(t,r){return t+e[r]+e[r+n]}))},t.areEqual=function(t,e){return t.length===e.length&&t.every((function(t,n){return t===e[n]}))},t.validateDimsAndCalcSize=function(t){var e,n;if(t.length>6)throw new TypeError("Only rank 0 to 6 is supported for tensor shape.");var r=1;try{for(var i=o(t),a=i.next();!a.done;a=i.next()){var s=a.value;if(!Number.isInteger(s))throw new TypeError("Invalid shape: ".concat(s," is not an integer"));if(s<0||s>2147483647)throw new TypeError("Invalid shape: length ".concat(s," is not allowed"));r*=s}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r},t.flattenShape=function(t,e){e<0&&(e+=t.length);var n=t.reduce((function(t,e){return t*e}),1),r=t.slice(e).reduce((function(t,e){return t*e}),1);return[n/r,r]},t.squeezeShape=function(e,n){var r=new Array;n=t.normalizeAxes(n,e.length);for(var o=0;o<e.length;o++){var i=n.indexOf(o)>=0;if(i&&1!==e[o])throw new Error("squeeze an axis of size different than 1");(0===n.length&&e[o]>1||n.length>0&&!i)&&r.push(e[o])}return r},t.unsqueezeShape=function(e,n){var r=new Array(e.length+n.length);r.fill(0);for(var o=0;o<n.length;o++){var i=t.normalizeAxis(n[o],r.length);if(i>=r.length)throw new Error("'axes' has an out of range axis");if(0!==r[i])throw new Error("'axes' has a duplicate axis");r[i]=1}var a=0;for(o=0;o<r.length;o++)0===r[o]&&(r[o]=e[a++]);if(a!==e.length)throw new Error("the unsqueezed dimension could not be established");return r},t}();e.ShapeUtil=b;var y=function(){function t(){}return t.sqr=function(t,e,n,r,o){if(r<0||r>=e.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=t.length)throw new Error("targetIndex out of bounds");if(r+o>e.length)throw new Error("source indices to be copied are outside bounds");if(n+o>t.length)throw new Error("target array is too small to hold result");for(var i=0;i<o;i++)t[n+i]+=Math.pow(e[r+i],2)},t.axpy=function(t,e,n,r,o,i){if(r<0||r>=e.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=t.length)throw new Error("targetIndex out of bounds");if(r+o>e.length)throw new Error("source indices to be copied are outside bounds");if(n+o>t.length)throw new Error("target array is too small to hold result");for(var a=0;a<o;a++)t[n+a]+=i*e[r+a]},t.powx=function(t,e,n,r,o,i){if(r<0||r>=e.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=t.length)throw new Error("targetIndex out of bounds");if(r+o>e.length)throw new Error("source indices to be copied are outside bounds");if(n+o>t.length)throw new Error("target array is too small to hold result");for(var a=0;a<o;a++)t[n+a]=Math.pow(e[r+a],i)},t.mul=function(t,e,n,r,o){if(r<0||r>=e.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=t.length)throw new Error("targetIndex out of bounds");if(r+o>e.length)throw new Error("source indices to be copied are outside bounds");if(n+o>t.length)throw new Error("target array is too small to hold result");for(var i=0;i<o;i++)t[n+i]=e[r+i]*t[n+i]},t}();e.MathUtil=y;var m=function(){function t(){}return t.splitShape=function(e,n,r,o){if(0===r.length){if(!o)throw new Error("need to know number of outputs when the 'split' attribute is not specified");t.determineSplit(e[n],o,r)}for(var i=[],a=[0],s=0;s<r.length;++s){0!==s&&a.push(a[s-1]+r[s-1]);var u=e.slice();u[n]=r[s],i.push(u)}return[i,a]},t.determineSplit=function(t,e,n){if(t%e!=0)throw new Error("cannot split tensor to equal sized parts");for(var r=0;r<e;++r)n.push(t/e)},t}();e.SplitUtil=m;var v=function(){function t(){}return t.calcReduce=function(e,n,r,o,i){var a=e.dims.slice(0);0===n.length&&a.forEach((function(t,e){return n.push(e)}));for(var s=t.calcReduceShape(a,n,!0),u=b.size(s),l=new c.Tensor(s,e.type),f=b.computeStrides(s),h=b.computeStrides(a),d=new Array(a.length),g=0;g<u;g++){var y=b.offsetToIndices(g,f);p.fillIndex(y,a,d),l.set(y,t.calcReduceByAxis(e.numberData,n,a,0,b.indicesToOffset(d,h),o,i))}return r?l:new c.Tensor(t.calcReduceShape(a,n,r),l.type,void 0,void 0,l.data,l.dataId)},t.calcReduceByAxis=function(e,n,r,o,i,a,s){var u=0;if(o>=n.length)return a(e[i]);for(var c=n[o],l=c>=r.length?1:b.size(r.slice(c+1)),f=0;f<r[c];f++)u=0===f?t.calcReduceByAxis(e,n,r,o+1,i,a,s):s(u,t.calcReduceByAxis(e,n,r,o+1,i,a,s)),i+=l;return u},t.calcReduceShape=function(t,e,n){for(var r=t.slice(),o=0;o<e.length;o++)r[e[o]]=n?1:0;return r.filter((function(t){return 0!==t}))},t}();e.ReduceUtil=v;var _=function(){function t(){}return t.adjustPoolAttributes=function(t,e,n,r,o,i){if(!t&&n.length!==e.length-2)throw new Error("length of specified kernel shapes should be 2 less than length of input dimensions");if(t)for(var a=0;a<e.length-2;a++)a>=n.length?n.push(e[a+2]):n[a]=e[a+2];for(a=0;a<n.length;a++)if(a<r.length){if(r[a]<0)throw new Error("strides should be greater than or equal to 1")}else r.push(1);for(a=0;a<n.length;a++)if(a<o.length){if(o[a]<0)throw new Error("dilations should be greater than or equal to 1")}else o.push(1);for(a=0;a<2*n.length;a++)if(a<i.length){if(i[a]<0)throw new Error("pad should be greater than or equal to 1")}else i.push(0);for(a=0;a<n.length;a++){if(n[a]<=0)throw new Error("kernel shapes need to be greater than 0");if(i[a]>=n[a]||i[a+n.length]>=n[a])throw new Error("pads should be smaller than kernel")}},t.adjustPadsBasedOnAutoPad=function(e,n,r,o,i,a){if(a){if(i.length!==2*(e.length-2))throw new Error("length of pads should be twice the length of data dimensions");if(n.length!==e.length-2)throw new Error("length of strides should be the length of data dimensions");if(o.length!==e.length-2)throw new Error("length of kernel shapes should be the length of data dimensions");for(var s=0;s<e.length-2;s++)t.adjustPadAndReturnShape(e[s+2],n[s],r[s],o[s],i,s,s+e.length-2,a)}},t.computePoolOutputShape=function(e,n,r,o,i,a,s){if(n.length<=0)throw new Error("input shape must be of size greater than 0");var u=[n[0],n[1]];return t.computeShapeHelper(e,n,u,r,o,i,a,s),u},t.computeConvOutputShape=function(e,n,r,o,i,a,s){if(e.length<=0||n.length<=0)throw new Error("invalid input tensor dims or invalid filter tensor dims");var u=[e[0],n[0]];return t.computeShapeHelper(!1,e,u,r,o,i,a,s),u},t.computeShapeHelper=function(e,n,r,o,i,a,s,u){if(e)for(var c=0;c<n.length-2;c++)r.push(1);else for(c=0;c<n.length-2;c++)r.push(t.adjustPadAndReturnShape(n[c+2],o[c],i[c],a[c],s,c,c+n.length-2,u))},t.adjustPadAndReturnShape=function(t,e,n,r,o,i,a,s){var u=n*(r-1)+1;if(!s||"NOTSET"===s)return Math.floor((t+o[i]+o[a]-u)/e+1);switch(s){case"VALID":return o[i]=0,o[a]=0,Math.floor((t-u)/e+1);case"SAME_LOWER":case"SAME_UPPER":if(1!==n)throw new Error("Dilation not supported for SAME_UPPER or SAME_LOWER");var c=((t+e-1)/e-1)*e+r-t;return o[i]="SAME_LOWER"===s?Math.floor((c+1)/2):Math.floor(c/2),o[a]=c-o[i],Math.floor((t+c-r)/e+1);default:throw new Error("Unsupported AutoPad type")}},t}();e.PoolConvUtil=_,e.MIN_CLIP=-34028234663852886e22,e.MAX_CLIP=34028234663852886e22,e.decodeUtf8String=function(t){return(new TextDecoder).decode(t)}},7967:function(t,e){"use strict";var n=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(e,"__esModule",{value:!0}),e.iterateExtraOptions=void 0,e.iterateExtraOptions=function(t,r,o,i){if("object"==typeof t&&null!==t){if(o.has(t))throw new Error("Circular reference in options");o.add(t)}Object.entries(t).forEach((function(t){var a=n(t,2),s=a[0],u=a[1],c=r?r+s:s;if("object"==typeof u)(0,e.iterateExtraOptions)(u,c+".",o,i);else if("string"==typeof u||"number"==typeof u)i(c,u.toString());else{if("boolean"!=typeof u)throw new Error("Can't handle extra config type: ".concat(typeof u));i(c,u?"1":"0")}}))}},2157:function(t,e,n){"use strict";var r,o=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(e,n);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,o)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&o(e,t,n);return i(e,t),e},s=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},u=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.endProfiling=e.run=e.releaseSession=e.createSession=e.createSessionFinalize=e.createSessionAllocate=e.initOrt=e.initWasm=void 0;var c,l,f,p=n(8453),h=a(n(349)),d=n(6361),g=function(){return!!p.env.wasm.proxy&&"undefined"!=typeof document},b=!1,y=!1,m=!1,v=[],_=[],w=[],x=[],T=[],S=[],O=function(){if(b||!y||m||!c)throw new Error("worker not ready")},A=function(t){switch(t.data.type){case"init-wasm":b=!1,t.data.err?(m=!0,l[1](t.data.err)):(y=!0,l[0]());break;case"init-ort":t.data.err?f[1](t.data.err):f[0]();break;case"create_allocate":t.data.err?v.shift()[1](t.data.err):v.shift()[0](t.data.out);break;case"create_finalize":t.data.err?_.shift()[1](t.data.err):_.shift()[0](t.data.out);break;case"create":t.data.err?w.shift()[1](t.data.err):w.shift()[0](t.data.out);break;case"release":t.data.err?x.shift()[1](t.data.err):x.shift()[0]();break;case"run":t.data.err?T.shift()[1](t.data.err):T.shift()[0](t.data.out);break;case"end-profiling":t.data.err?S.shift()[1](t.data.err):S.shift()[0]()}},E="undefined"!=typeof document?null===(r=null===document||void 0===document?void 0:document.currentScript)||void 0===r?void 0:r.src:void 0;e.initWasm=function(){return s(void 0,void 0,void 0,(function(){return u(this,(function(t){if(g()){if(y)return[2];if(b)throw new Error("multiple calls to 'initWasm()' detected.");if(m)throw new Error("previous call to 'initWasm()' failed.");return b=!0,void 0===p.env.wasm.wasmPaths&&E&&0!==E.indexOf("blob:")&&(p.env.wasm.wasmPaths=E.substr(0,+E.lastIndexOf("/")+1)),[2,new Promise((function(t,e){null==c||c.terminate(),(c=n(9710).Z()).onmessage=A,l=[t,e];var r={type:"init-wasm",in:p.env.wasm};c.postMessage(r)}))]}return[2,(0,d.initializeWebAssembly)(p.env.wasm)]}))}))},e.initOrt=function(t,e){return s(void 0,void 0,void 0,(function(){return u(this,(function(n){return g()?(O(),[2,new Promise((function(n,r){f=[n,r];var o={type:"init-ort",in:{numThreads:t,loggingLevel:e}};c.postMessage(o)}))]):(h.initOrt(t,e),[2])}))}))},e.createSessionAllocate=function(t){return s(void 0,void 0,void 0,(function(){return u(this,(function(e){return g()?(O(),[2,new Promise((function(e,n){v.push([e,n]);var r={type:"create_allocate",in:{model:t}};c.postMessage(r,[t.buffer])}))]):[2,h.createSessionAllocate(t)]}))}))},e.createSessionFinalize=function(t,e){return s(void 0,void 0,void 0,(function(){return u(this,(function(n){return g()?(O(),[2,new Promise((function(n,r){_.push([n,r]);var o={type:"create_finalize",in:{modeldata:t,options:e}};c.postMessage(o)}))]):[2,h.createSessionFinalize(t,e)]}))}))},e.createSession=function(t,e){return s(void 0,void 0,void 0,(function(){return u(this,(function(n){return g()?(O(),[2,new Promise((function(n,r){w.push([n,r]);var o={type:"create",in:{model:t,options:e}};c.postMessage(o,[t.buffer])}))]):[2,h.createSession(t,e)]}))}))},e.releaseSession=function(t){return s(void 0,void 0,void 0,(function(){return u(this,(function(e){return g()?(O(),[2,new Promise((function(e,n){x.push([e,n]);var r={type:"release",in:t};c.postMessage(r)}))]):(h.releaseSession(t),[2])}))}))},e.run=function(t,e,n,r,o){return s(void 0,void 0,void 0,(function(){return u(this,(function(i){return g()?(O(),[2,new Promise((function(i,a){T.push([i,a]);var s={type:"run",in:{sessionId:t,inputIndices:e,inputs:n,outputIndices:r,options:o}};c.postMessage(s,h.extractTransferableBuffers(n))}))]):[2,h.run(t,e,n,r,o)]}))}))},e.endProfiling=function(t){return s(void 0,void 0,void 0,(function(){return u(this,(function(e){return g()?(O(),[2,new Promise((function(e,n){S.push([e,n]);var r={type:"end-profiling",in:t};c.postMessage(r)}))]):(h.endProfiling(t),[2])}))}))}},586:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setRunOptions=void 0;var r=n(7967),o=n(4983),i=n(6361);e.setRunOptions=function(t){var e=(0,i.getInstance)(),n=0,a=[],s=t||{};try{if(void 0===(null==t?void 0:t.logSeverityLevel))s.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: ".concat(t.logSeverityLevel));if(void 0===(null==t?void 0:t.logVerbosityLevel))s.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error("log verbosity level is not valid: ".concat(t.logVerbosityLevel));void 0===(null==t?void 0:t.terminate)&&(s.terminate=!1);var u=0;if(void 0!==(null==t?void 0:t.tag)&&(u=(0,o.allocWasmString)(t.tag,a)),0===(n=e._OrtCreateRunOptions(s.logSeverityLevel,s.logVerbosityLevel,!!s.terminate,u)))throw new Error("Can't create run options");return void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,"",new WeakSet,(function(t,r){var i=(0,o.allocWasmString)(t,a),s=(0,o.allocWasmString)(r,a);if(0!==e._OrtAddRunConfigEntry(n,i,s))throw new Error("Can't set a run config entry: ".concat(t," - ").concat(r))})),[n,a]}catch(t){throw 0!==n&&e._OrtReleaseRunOptions(n),a.forEach(e._free),t}}},2306:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}},i=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(e,"__esModule",{value:!0}),e.OnnxruntimeWebAssemblySessionHandler=void 0;var a,s=n(2806),u=n(8453),c=n(2850),l=n(2157),f=function(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: ".concat(t))}},p=function(){function t(){}return t.prototype.createSessionAllocate=function(t){return r(this,void 0,void 0,(function(){var e;return o(this,(function(n){switch(n.label){case 0:return[4,fetch(t)];case 1:return[4,n.sent().arrayBuffer()];case 2:return e=n.sent(),[2,(0,l.createSessionAllocate)(new Uint8Array(e))]}}))}))},t.prototype.loadModel=function(t,e){return r(this,void 0,void 0,(function(){var n,r,p,h,d;return o(this,(function(o){switch(o.label){case 0:return a?[3,2]:[4,(0,l.initOrt)(u.env.wasm.numThreads,f(u.env.logLevel))];case 1:o.sent(),a=!0,o.label=2;case 2:return"string"!=typeof t?[3,9]:"undefined"!=typeof fetch?[3,5]:[4,(0,c.promisify)(s.readFile)(t)];case 3:return n=o.sent(),[4,(0,l.createSession)(n,e)];case 4:return p=i.apply(void 0,[o.sent(),3]),this.sessionId=p[0],this.inputNames=p[1],this.outputNames=p[2],[3,8];case 5:return[4,this.createSessionAllocate(t)];case 6:return r=o.sent(),[4,(0,l.createSessionFinalize)(r,e)];case 7:h=i.apply(void 0,[o.sent(),3]),this.sessionId=h[0],this.inputNames=h[1],this.outputNames=h[2],o.label=8;case 8:return[3,11];case 9:return[4,(0,l.createSession)(t,e)];case 10:d=i.apply(void 0,[o.sent(),3]),this.sessionId=d[0],this.inputNames=d[1],this.outputNames=d[2],o.label=11;case 11:return[2]}}))}))},t.prototype.dispose=function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,(0,l.releaseSession)(this.sessionId)]}))}))},t.prototype.run=function(t,e,n){return r(this,void 0,void 0,(function(){var r,i,a,s,c,f,p=this;return o(this,(function(o){switch(o.label){case 0:return r=[],i=[],Object.entries(t).forEach((function(t){var e=t[0],n=t[1],o=p.inputNames.indexOf(e);if(-1===o)throw new Error("invalid input '".concat(e,"'"));r.push(n),i.push(o)})),a=[],Object.entries(e).forEach((function(t){var e=t[0],n=p.outputNames.indexOf(e);if(-1===n)throw new Error("invalid output '".concat(e,"'"));a.push(n)})),[4,(0,l.run)(this.sessionId,i,r.map((function(t){return[t.type,t.dims,t.data]})),a,n)];case 1:for(s=o.sent(),c={},f=0;f<s.length;f++)c[this.outputNames[a[f]]]=new u.Tensor(s[f][0],s[f][2],s[f][1]);return[2,c]}}))}))},t.prototype.startProfiling=function(){},t.prototype.endProfiling=function(){(0,l.endProfiling)(this.sessionId)},t}();e.OnnxruntimeWebAssemblySessionHandler=p},4919:function(t,e,n){"use strict";var r=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.setSessionOptions=void 0;var o=n(7967),i=n(4983),a=n(6361);e.setSessionOptions=function(t){var e=(0,a.getInstance)(),n=0,s=[],u=t||{};!function(t){t.extra||(t.extra={}),t.extra.session||(t.extra.session={});var e=t.extra.session;e.use_ort_model_bytes_directly||(e.use_ort_model_bytes_directly="1")}(u);try{void 0===(null==t?void 0:t.graphOptimizationLevel)&&(u.graphOptimizationLevel="all");var c=function(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: ".concat(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");var l=function(t){switch(t){case"sequential":return 0;case"parallel":return 1;default:throw new Error("unsupported execution mode: ".concat(t))}}(u.executionMode),f=0;if(void 0!==(null==t?void 0:t.logId)&&(f=(0,i.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: ".concat(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: ".concat(t.logVerbosityLevel));if(void 0===(null==t?void 0:t.enableProfiling)&&(u.enableProfiling=!1),0===(n=e._OrtCreateSessionOptions(c,!!u.enableCpuMemArena,!!u.enableMemPattern,l,!!u.enableProfiling,0,f,u.logSeverityLevel,u.logVerbosityLevel)))throw new Error("Can't create session options");return(null==t?void 0:t.executionProviders)&&function(t,e,n){var o,s;try{for(var u=r(e),c=u.next();!c.done;c=u.next()){var l=c.value,f="string"==typeof l?l:l.name;switch(f){case"xnnpack":f="XNNPACK";break;case"wasm":case"cpu":continue;default:throw new Error("not supported EP: ".concat(f))}var p=(0,i.allocWasmString)(f,n);if(0!==(0,a.getInstance)()._OrtAppendExecutionProvider(t,p))throw new Error("Can't append execution provider: ".concat(f))}}catch(t){o={error:t}}finally{try{c&&!c.done&&(s=u.return)&&s.call(u)}finally{if(o)throw o.error}}}(n,t.executionProviders,s),void 0!==(null==t?void 0:t.extra)&&(0,o.iterateExtraOptions)(t.extra,"",new WeakSet,(function(t,r){var o=(0,i.allocWasmString)(t,s),a=(0,i.allocWasmString)(r,s);if(0!==e._OrtAddSessionConfigEntry(n,o,a))throw new Error("Can't set a session config entry: ".concat(t," - ").concat(r))})),[n,s]}catch(t){throw 0!==n&&e._OrtReleaseSessionOptions(n),s.forEach(e._free),t}}},4983:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.allocWasmString=void 0;var r=n(6361);e.allocWasmString=function(t,e){var n=(0,r.getInstance)(),o=n.lengthBytesUTF8(t)+1,i=n._malloc(o);return n.stringToUTF8(t,i,o),e.push(i),i}},349:function(t,e,n){"use strict";var r=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.extractTransferableBuffers=e.endProfiling=e.run=e.releaseSession=e.createSession=e.createSessionFinalize=e.createSessionAllocate=e.initOrt=void 0;var i=n(586),a=n(4919),s=n(4983),u=n(6361);e.initOrt=function(t,e){var n=(0,u.getInstance)()._OrtInit(t,e);if(0!==n)throw new Error("Can't initialize onnxruntime. error code = ".concat(n))};var c=new Map;e.createSessionAllocate=function(t){var e=(0,u.getInstance)(),n=e._malloc(t.byteLength);return e.HEAPU8.set(t,n),[n,t.byteLength]},e.createSessionFinalize=function(t,e){var n,o=(0,u.getInstance)(),i=0,s=0,l=[];try{if(s=(n=r((0,a.setSessionOptions)(e),2))[0],l=n[1],0===(i=o._OrtCreateSession(t[0],t[1],s)))throw new Error("Can't create a session")}finally{o._free(t[0]),o._OrtReleaseSessionOptions(s),l.forEach(o._free)}for(var f=o._OrtGetInputCount(i),p=o._OrtGetOutputCount(i),h=[],d=[],g=[],b=[],y=0;y<f;y++){var m=o._OrtGetInputName(i,y);if(0===m)throw new Error("Can't get an input name");d.push(m),h.push(o.UTF8ToString(m))}for(y=0;y<p;y++){var v=o._OrtGetOutputName(i,y);if(0===v)throw new Error("Can't get an output name");b.push(v),g.push(o.UTF8ToString(v))}return c.set(i,[i,d,b]),[i,h,g]},e.createSession=function(t,n){var r=(0,e.createSessionAllocate)(t);return(0,e.createSessionFinalize)(r,n)},e.releaseSession=function(t){var e=(0,u.getInstance)(),n=c.get(t);if(!n)throw new Error("invalid session id");var r=n[0],o=n[1],i=n[2];o.forEach(e._OrtFree),i.forEach(e._OrtFree),e._OrtReleaseSession(r),c.delete(t)};var l=function(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: ".concat(t))}},f=function(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: ".concat(t))}};e.run=function(t,e,n,o,a){var p,h=(0,u.getInstance)(),d=c.get(t);if(!d)throw new Error("invalid session id");var g=d[0],b=d[1],y=d[2],m=e.length,v=o.length,_=0,w=[],x=[],T=[];try{_=(p=r((0,i.setRunOptions)(a),2))[0],w=p[1];for(var S=function(t){var e=n[t][0],r=n[t][1],o=n[t][2],i=void 0,a=void 0;if(Array.isArray(o)){a=4*o.length,i=h._malloc(a),T.push(i);for(var u=i/4,c=0;c<o.length;c++){if("string"!=typeof o[c])throw new TypeError("tensor data at index ".concat(c," is not a string"));h.HEAPU32[u++]=(0,s.allocWasmString)(o[c],T)}}else a=o.byteLength,i=h._malloc(a),T.push(i),h.HEAPU8.set(new Uint8Array(o.buffer,o.byteOffset,a),i);var l=h.stackSave(),f=h.stackAlloc(4*r.length);try{var p=f/4;r.forEach((function(t){return h.HEAP32[p++]=t}));var d=h._OrtCreateTensor(function(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: ".concat(t))}}(e),i,a,f,r.length);if(0===d)throw new Error("Can't create a tensor");x.push(d)}finally{h.stackRestore(l)}},O=0;O<m;O++)S(O);var A=h.stackSave(),E=h.stackAlloc(4*m),I=h.stackAlloc(4*m),P=h.stackAlloc(4*v),D=h.stackAlloc(4*v);try{var k=E/4,C=I/4,F=P/4,N=D/4;for(O=0;O<m;O++)h.HEAPU32[k++]=x[O],h.HEAPU32[C++]=b[e[O]];for(O=0;O<v;O++)h.HEAPU32[F++]=0,h.HEAPU32[N++]=y[o[O]];var R=h._OrtRun(g,I,E,m,D,v,P,_),L=[];if(0===R)for(O=0;O<v;O++){var M=h.HEAPU32[P/4+O],j=h.stackSave(),U=h.stackAlloc(16),V=void 0,B=0;try{if(0!==(R=h._OrtGetTensorData(M,U,U+4,U+8,U+12)))throw new Error("Can't access output tensor data. error code = ".concat(R));var z=U/4,G=h.HEAPU32[z++];B=h.HEAPU32[z++];for(var H=h.HEAPU32[z++],W=h.HEAPU32[z++],q=[],X=0;X<W;X++)q.push(h.HEAPU32[H/4+X]);h._OrtFree(H);var Y=0===q.length?1:q.reduce((function(t,e){return t*e}));if("string"===(V=l(G))){for(var K=[],Z=B/4,J=0;J<Y;J++){var $=h.HEAPU32[Z++],Q=J===Y-1?void 0:h.HEAPU32[Z]-$;K.push(h.UTF8ToString($,Q))}L.push([V,q,K])}else{var tt=new(f(V))(Y);new Uint8Array(tt.buffer,tt.byteOffset,tt.byteLength).set(h.HEAPU8.subarray(B,B+tt.byteLength)),L.push([V,q,tt])}}finally{h.stackRestore(j),"string"===V&&B&&h._free(B),h._OrtReleaseTensor(M)}}if(0===R)return L;throw new Error("failed to call OrtRun(). error code = ".concat(R,"."))}finally{h.stackRestore(A)}}finally{x.forEach(h._OrtReleaseTensor),T.forEach(h._free),h._OrtReleaseRunOptions(_),w.forEach(h._free)}},e.endProfiling=function(t){var e=(0,u.getInstance)(),n=c.get(t);if(!n)throw new Error("invalid session id");var r=n[0],o=e._OrtEndProfiling(r);if(0===o)throw new Error("Can't get an profile file name");e._OrtFree(o)},e.extractTransferableBuffers=function(t){var e,n,r=[];try{for(var i=o(t),a=i.next();!a.done;a=i.next()){var s=a.value[2];!Array.isArray(s)&&s.buffer&&r.push(s.buffer)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}},6361:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(e,n);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,o)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return o(e,t),e},a=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}},u=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.dispose=e.getInstance=e.initializeWebAssembly=void 0;var c,l=i(n(6449)),f=u(n(932)),p=n(3474),h=!1,d=!1,g=!1,b=function(t,e){return e?t?"ort-wasm-simd-threaded.wasm":"ort-wasm-threaded.wasm":t?"ort-wasm-simd.wasm":"ort-wasm.wasm"};e.initializeWebAssembly=function(t){return a(void 0,void 0,void 0,(function(){var e,r,o,i,a,u,y,m,v,_,w;return s(this,(function(s){switch(s.label){case 0:if(h)return[2,Promise.resolve()];if(d)throw new Error("multiple calls to 'initializeWebAssembly()' detected.");if(g)throw new Error("previous call to 'initializeWebAssembly()' failed.");return d=!0,e=t.initTimeout,r=t.numThreads,o=t.simd,i=r>1&&function(){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}}(),a=o&&function(){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}}(),u="string"==typeof t.wasmPaths?t.wasmPaths:void 0,y=b(!1,i),m=b(a,i),v="object"==typeof t.wasmPaths?t.wasmPaths[m]:void 0,_=!1,w=[],e>0&&w.push(new Promise((function(t){setTimeout((function(){_=!0,t()}),e)}))),w.push(new Promise((function(t,e){var r=i?p:f.default,o={locateFile:function(t,e){return i&&t.endsWith(".worker.js")&&"undefined"!=typeof Blob?URL.createObjectURL(new Blob([n(4154)],{type:"text/javascript"})):t===y?null!=v?v:(null!=u?u:e)+m:e+t}};if(i)if("undefined"==typeof Blob)o.mainScriptUrlOrBlob=l.join("/","ort-wasm-threaded.js");else{var a="var ortWasmThreaded=(function(){var _scriptDir;return ".concat(r.toString(),"})();");o.mainScriptUrlOrBlob=new Blob([a],{type:"text/javascript"})}r(o).then((function(e){d=!1,h=!0,c=e,t()}),(function(t){d=!1,g=!0,e(t)}))}))),[4,Promise.race(w)];case 1:if(s.sent(),_)throw new Error("WebAssembly backend initializing failed due to timeout: ".concat(e,"ms"));return[2]}}))}))},e.getInstance=function(){if(h&&c)return c;throw new Error("WebAssembly is not initialized yet.")},e.dispose=function(){var t;!h||d||g||(d=!0,null===(t=c.PThread)||void 0===t||t.terminateAllThreads(),c=void 0,d=!1,h=!1,g=!0)}},9710:function(t,e,n){"use strict";n.d(e,{Z:function(){return i}});var r=n(477),o=n.n(r);function i(){return o()('/*!\n* ONNX Runtime Web v1.14.0\n* Copyright (c) Microsoft Corporation. All rights reserved.\n* Licensed under the MIT License.\n*/\n!function(){var t={474:function(t,e,n){var _scriptDir,r=(_scriptDir=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){function e(){return j.buffer!=D&&N(j.buffer),P}function r(){return j.buffer!=D&&N(j.buffer),U}function a(){return j.buffer!=D&&N(j.buffer),F}function i(){return j.buffer!=D&&N(j.buffer),I}function o(){return j.buffer!=D&&N(j.buffer),W}var u,c,s;t=t||{},u||(u=void 0!==t?t:{}),u.ready=new Promise((function(t,e){c=t,s=e}));var f,l,p,h,d,y,b=Object.assign({},u),m="./this.program",v=(t,e)=>{throw e},g="object"==typeof window,w="function"==typeof importScripts,_="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,O=u.ENVIRONMENT_IS_PTHREAD||!1,S="";function A(t){return u.locateFile?u.locateFile(t,S):S+t}if(_){let e;S=w?n(908).dirname(S)+"/":"//",y=()=>{d||(h=n(384),d=n(908))},f=function(t,e){return y(),t=d.normalize(t),h.readFileSync(t,e?void 0:"utf8")},p=t=>((t=f(t,!0)).buffer||(t=new Uint8Array(t)),t),l=(t,e,n)=>{y(),t=d.normalize(t),h.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1<process.argv.length&&(m=process.argv[1].replace(/\\\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",(function(t){if(!(t instanceof ct))throw t})),process.on("unhandledRejection",(function(t){throw t})),v=(t,e)=>{if($())throw process.exitCode=t,e;e instanceof ct||x("exiting due to exception: "+e),process.exit(t)},u.inspect=function(){return"[Emscripten Module object]"};try{e=n(925)}catch(t){throw console.error(\'The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?\'),t}n.g.Worker=e.Worker}else(g||w)&&(w?S=self.location.href:"undefined"!=typeof document&&document.currentScript&&(S=document.currentScript.src),_scriptDir&&(S=_scriptDir),S=0!==S.indexOf("blob:")?S.substr(0,S.replace(/[?#].*/,"").lastIndexOf("/")+1):"",_||(f=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},w&&(p=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),l=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)}));_&&"undefined"==typeof performance&&(n.g.performance=n(953).performance);var T=console.log.bind(console),E=console.warn.bind(console);_&&(y(),T=t=>h.writeSync(1,t+"\\n"),E=t=>h.writeSync(2,t+"\\n"));var M,C=u.print||T,x=u.printErr||E;Object.assign(u,b),b=null,u.thisProgram&&(m=u.thisProgram),u.quit&&(v=u.quit),u.wasmBinary&&(M=u.wasmBinary);var R=u.noExitRuntime||!1;"object"!=typeof WebAssembly&&at("no native wasm support detected");var j,k,D,P,U,F,I,W,H=!1,L="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function z(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16<n-e&&t.buffer&&L)return L.decode(t.buffer instanceof SharedArrayBuffer?t.slice(e,n):t.subarray(e,n));for(r="";e<n;){var a=t[e++];if(128&a){var i=63&t[e++];if(192==(224&a))r+=String.fromCharCode((31&a)<<6|i);else{var o=63&t[e++];65536>(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&t[e++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function Y(t,e){return(t>>>=0)?z(r(),t,e):""}function B(t,e,n,r){if(!(0<r))return 0;var a=n>>>=0;r=n+r-1;for(var i=0;i<t.length;++i){var o=t.charCodeAt(i);if(55296<=o&&57343>=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i)),127>=o){if(n>=r)break;e[n++>>>0]=o}else{if(2047>=o){if(n+1>=r)break;e[n++>>>0]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;e[n++>>>0]=224|o>>12}else{if(n+3>=r)break;e[n++>>>0]=240|o>>18,e[n++>>>0]=128|o>>12&63}e[n++>>>0]=128|o>>6&63}e[n++>>>0]=128|63&o}}return e[n>>>0]=0,n-a}function G(t){for(var e=0,n=0;n<t.length;++n){var r=t.charCodeAt(n);127>=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function N(t){D=t,u.HEAP8=P=new Int8Array(t),u.HEAP16=new Int16Array(t),u.HEAP32=F=new Int32Array(t),u.HEAPU8=U=new Uint8Array(t),u.HEAPU16=new Uint16Array(t),u.HEAPU32=I=new Uint32Array(t),u.HEAPF32=new Float32Array(t),u.HEAPF64=W=new Float64Array(t)}O&&(D=u.buffer);var V=u.INITIAL_MEMORY||16777216;if(O)j=u.wasmMemory,D=u.buffer;else if(u.wasmMemory)j=u.wasmMemory;else if(!((j=new WebAssembly.Memory({initial:V/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw x("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),_&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");j&&(D=j.buffer),V=D.byteLength,N(D);var q,X=[],J=[],Z=[],Q=[];function $(){return R||!1}function K(){var t=u.preRun.shift();X.unshift(t)}var tt,et=0,nt=null,rt=null;function at(t){throw O?postMessage({cmd:"onAbort",arg:t}):u.onAbort&&u.onAbort(t),x(t="Aborted("+t+")"),H=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),s(t),t}function it(){return tt.startsWith("data:application/octet-stream;base64,")}function ot(){var t=tt;try{if(t==tt&&M)return new Uint8Array(M);if(p)return p(t);throw"both async and sync fetching of the wasm failed"}catch(t){at(t)}}tt="ort-wasm-threaded.wasm",it()||(tt=A(tt));var ut={};function ct(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function st(t){(t=ht.Vb[t])||at(),ht.mc(t)}function ft(t){var e=ht.Cc();if(!e)return 6;ht.ac.push(e),ht.Vb[t.Ub]=e,e.Ub=t.Ub;var n={cmd:"run",start_routine:t.Ic,arg:t.zc,pthread_ptr:t.Ub};return e.$b=()=>{n.time=performance.now(),e.postMessage(n,t.Nc)},e.loaded&&(e.$b(),delete e.$b),0}function lt(t){if(O)return qt(1,1,t);$()||(ht.oc(),u.onExit&&u.onExit(t),H=!0),v(t,new ct(t))}function pt(t,e){if(!e&&O)throw bt(t),"unwind";$()||O||(me(),dt(Z),be(0),re[1].length&&ae(1,10),re[2].length&&ae(2,10),ht.oc()),lt(t)}var ht={Yb:[],ac:[],qc:[],Vb:{},fc:function(){O&&ht.Ec()},Pc:function(){},Ec:function(){ht.receiveObjectTransfer=ht.Gc,ht.threadInitTLS=ht.pc,ht.setExitStatus=ht.nc,R=!1},nc:function(){},oc:function(){for(var t of Object.values(ht.Vb))ht.mc(t);for(t of ht.Yb)t.terminate();ht.Yb=[]},mc:function(t){var e=t.Ub;delete ht.Vb[e],ht.Yb.push(t),ht.ac.splice(ht.ac.indexOf(t),1),t.Ub=0,Oe(e)},Gc:function(){},pc:function(){ht.qc.forEach((t=>t()))},Fc:function(t,e){t.onmessage=n=>{var r=(n=n.data).cmd;if(t.Ub&&(ht.Bc=t.Ub),n.targetThread&&n.targetThread!=he()){var a=ht.Vb[n.Qc];a?a.postMessage(n,n.transferList):x(\'Internal error! Worker sent a message "\'+r+\'" to target pthread \'+n.targetThread+", but that thread no longer exists!")}else"processProxyingQueue"===r?zt(n.queue):"spawnThread"===r?ft(n):"cleanupThread"===r?st(n.thread):"killThread"===r?(n=n.thread,r=ht.Vb[n],delete ht.Vb[n],r.terminate(),Oe(n),ht.ac.splice(ht.ac.indexOf(r),1),r.Ub=0):"cancelThread"===r?ht.Vb[n.thread].postMessage({cmd:"cancel"}):"loaded"===r?(t.loaded=!0,e&&e(t),t.$b&&(t.$b(),delete t.$b)):"print"===r?C("Thread "+n.threadId+": "+n.text):"printErr"===r?x("Thread "+n.threadId+": "+n.text):"alert"===r?alert("Thread "+n.threadId+": "+n.text):"setimmediate"===n.target?t.postMessage(n):"onAbort"===r?u.onAbort&&u.onAbort(n.arg):r&&x("worker sent an unknown command "+r);ht.Bc=void 0},t.onerror=t=>{throw x("worker sent an error! "+t.filename+":"+t.lineno+": "+t.message),t},_&&(t.on("message",(function(e){t.onmessage({data:e})})),t.on("error",(function(e){t.onerror(e)})),t.on("detachedExit",(function(){}))),t.postMessage({cmd:"load",urlOrBlob:u.mainScriptUrlOrBlob||_scriptDir,wasmMemory:j,wasmModule:k})},yc:function(){var t=A("ort-wasm-threaded.worker.js");ht.Yb.push(new Worker(t))},Cc:function(){return 0==ht.Yb.length&&(ht.yc(),ht.Fc(ht.Yb[0])),ht.Yb.pop()}};function dt(t){for(;0<t.length;)t.shift()(u)}function yt(t){var e=Ee();return t=t(),Me(e),t}function bt(t){if(O)return qt(2,0,t);try{pt(t)}catch(t){t instanceof ct||"unwind"==t||v(1,t)}}u.PThread=ht,u.establishStackSpace=function(){var t=he(),e=a()[t+44>>2>>>0];t=a()[t+48>>2>>>0],Te(e,e-t),Me(e)};var mt=[];function vt(t){var e=mt[t];return e||(t>=mt.length&&(mt.length=t+1),mt[t]=e=q.get(t)),e}u.invokeEntryPoint=function(t,e){t=vt(t)(e),$()?ht.nc(t):Se(t)};var gt,wt,_t=[],Ot=0,St=0;function At(t){this.Zb=t,this.Sb=t-24,this.xc=function(t){i()[this.Sb+4>>2>>>0]=t},this.bc=function(){return i()[this.Sb+4>>2>>>0]},this.wc=function(t){i()[this.Sb+8>>2>>>0]=t},this.Dc=function(){return i()[this.Sb+8>>2>>>0]},this.rc=function(){a()[this.Sb>>2>>>0]=0},this.hc=function(t){t=t?1:0,e()[this.Sb+12>>0>>>0]=t},this.uc=function(){return 0!=e()[this.Sb+12>>0>>>0]},this.ic=function(t){t=t?1:0,e()[this.Sb+13>>0>>>0]=t},this.kc=function(){return 0!=e()[this.Sb+13>>0>>>0]},this.fc=function(t,e){this.cc(0),this.xc(t),this.wc(e),this.rc(),this.hc(!1),this.ic(!1)},this.sc=function(){Atomics.add(a(),this.Sb>>2,1)},this.Hc=function(){return 1===Atomics.sub(a(),this.Sb>>2,1)},this.cc=function(t){i()[this.Sb+16>>2>>>0]=t},this.tc=function(){return i()[this.Sb+16>>2>>>0]},this.vc=function(){if(Re(this.bc()))return i()[this.Zb>>2>>>0];var t=this.tc();return 0!==t?t:this.Zb}}function Tt(t){return ye(new At(t).Sb)}function Et(t,e,n,r){return O?qt(3,1,t,e,n,r):Mt(t,e,n,r)}function Mt(t,e,n,r){if("undefined"==typeof SharedArrayBuffer)return x("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var a=[];return O&&0===a.length?Et(t,e,n,r):(t={Ic:n,Ub:t,zc:r,Nc:a},O?(t.Oc="spawnThread",postMessage(t,a),0):ft(t))}function Ct(t,e,n){return O?qt(4,1,t,e,n):0}function xt(t,e){if(O)return qt(5,1,t,e)}function Rt(t,e){if(O)return qt(6,1,t,e)}function jt(t,e,n){if(O)return qt(7,1,t,e,n)}function kt(t,e,n){return O?qt(8,1,t,e,n):0}function Dt(t,e){if(O)return qt(9,1,t,e)}function Pt(t,e,n){if(O)return qt(10,1,t,e,n)}function Ut(t,e,n,r){if(O)return qt(11,1,t,e,n,r)}function Ft(t,e,n,r){if(O)return qt(12,1,t,e,n,r)}function It(t,e,n,r){if(O)return qt(13,1,t,e,n,r)}function Wt(t){if(O)return qt(14,1,t)}function Ht(t,e){if(O)return qt(15,1,t,e)}function Lt(t,e,n){if(O)return qt(16,1,t,e,n)}function zt(t){Atomics.store(a(),t>>2,1),he()&&_e(t),Atomics.compareExchange(a(),t>>2,1,0)}function Yt(t){return i()[t>>>2]+4294967296*a()[t+4>>>2]}function Bt(t,e,n,r,a,i){return O?qt(17,1,t,e,n,r,a,i):-52}function Gt(t,e,n,r,a,i){if(O)return qt(18,1,t,e,n,r,a,i)}function Nt(t){var n=G(t)+1,r=de(n);return r&&B(t,e(),r,n),r}function Vt(t,e,n){function r(t){return(t=t.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?t[1]:"GMT"}if(O)return qt(19,1,t,e,n);var o=(new Date).getFullYear(),u=new Date(o,0,1),c=new Date(o,6,1);o=u.getTimezoneOffset();var s=c.getTimezoneOffset(),f=Math.max(o,s);a()[t>>2>>>0]=60*f,a()[e>>2>>>0]=Number(o!=s),t=r(u),e=r(c),t=Nt(t),e=Nt(e),s<o?(i()[n>>2>>>0]=t,i()[n+4>>2>>>0]=e):(i()[n>>2>>>0]=e,i()[n+4>>2>>>0]=t)}function qt(t,e){var n=arguments.length-2,r=arguments;return yt((()=>{for(var a=Ce(8*n),i=a>>3,u=0;u<n;u++){var c=r[2+u];o()[i+u>>>0]=c}return we(t,n,a,e)}))}u.executeNotifiedProxyingQueue=zt,wt=_?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:O?()=>performance.now()-u.__performance_now_clock_drift:()=>performance.now();var Xt,Jt=[],Zt={};function Qt(){if(!Xt){var t,e={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",_:m||"./this.program"};for(t in Zt)void 0===Zt[t]?delete e[t]:e[t]=Zt[t];var n=[];for(t in e)n.push(t+"="+e[t]);Xt=n}return Xt}function $t(t,n){if(O)return qt(20,1,t,n);var r=0;return Qt().forEach((function(a,o){var u=n+r;for(o=i()[t+4*o>>2>>>0]=u,u=0;u<a.length;++u)e()[o++>>0>>>0]=a.charCodeAt(u);e()[o>>0>>>0]=0,r+=a.length+1})),0}function Kt(t,e){if(O)return qt(21,1,t,e);var n=Qt();i()[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),i()[e>>2>>>0]=r,0}function te(t){return O?qt(22,1,t):52}function ee(t,e,n,r){return O?qt(23,1,t,e,n,r):52}function ne(t,e,n,r,a){return O?qt(24,1,t,e,n,r,a):70}var re=[null,[],[]];function ae(t,e){var n=re[t];0===e||10===e?((1===t?C:x)(z(n,0)),n.length=0):n.push(e)}function ie(t,e,n,a){if(O)return qt(25,1,t,e,n,a);for(var o=0,u=0;u<n;u++){var c=i()[e>>2>>>0],s=i()[e+4>>2>>>0];e+=8;for(var f=0;f<s;f++)ae(t,r()[c+f>>>0]);o+=s}return i()[a>>2>>>0]=o,0}var oe=0;function ue(t){return 0==t%4&&(0!=t%100||0==t%400)}var ce=[31,29,31,30,31,30,31,31,30,31,30,31],se=[31,28,31,30,31,30,31,31,30,31,30,31];function fe(t,n,r,i){function o(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.length<e;)t=n[0]+t;return t}function u(t,e){return o(t,e,"0")}function c(t,e){function n(t){return 0>t?-1:0<t?1:0}var r;return 0===(r=n(t.getFullYear()-e.getFullYear()))&&0===(r=n(t.getMonth()-e.getMonth()))&&(r=n(t.getDate()-e.getDate())),r}function s(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 f(t){var e=t.Wb;for(t=new Date(new Date(t.Xb+1900,0,1).getTime());0<e;){var n=t.getMonth(),r=(ue(t.getFullYear())?ce:se)[n];if(!(e>r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=s(new Date(t.getFullYear(),0,4)),n=s(n),0>=c(e,t)?0>=c(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var l=a()[i+40>>2>>>0];for(var p in i={Lc:a()[i>>2>>>0],Kc:a()[i+4>>2>>>0],dc:a()[i+8>>2>>>0],jc:a()[i+12>>2>>>0],ec:a()[i+16>>2>>>0],Xb:a()[i+20>>2>>>0],Tb:a()[i+24>>2>>>0],Wb:a()[i+28>>2>>>0],Rc:a()[i+32>>2>>>0],Jc:a()[i+36>>2>>>0],Mc:l?Y(l):""},r=Y(r),l={"%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"})r=r.replace(new RegExp(p,"g"),l[p]);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(p in l={"%a":function(t){return h[t.Tb].substring(0,3)},"%A":function(t){return h[t.Tb]},"%b":function(t){return d[t.ec].substring(0,3)},"%B":function(t){return d[t.ec]},"%C":function(t){return u((t.Xb+1900)/100|0,2)},"%d":function(t){return u(t.jc,2)},"%e":function(t){return o(t.jc,2," ")},"%g":function(t){return f(t).toString().substring(2)},"%G":function(t){return f(t)},"%H":function(t){return u(t.dc,2)},"%I":function(t){return 0==(t=t.dc)?t=12:12<t&&(t-=12),u(t,2)},"%j":function(t){for(var e=0,n=0;n<=t.ec-1;e+=(ue(t.Xb+1900)?ce:se)[n++]);return u(t.jc+e,3)},"%m":function(t){return u(t.ec+1,2)},"%M":function(t){return u(t.Kc,2)},"%n":function(){return"\\n"},"%p":function(t){return 0<=t.dc&&12>t.dc?"AM":"PM"},"%S":function(t){return u(t.Lc,2)},"%t":function(){return"\\t"},"%u":function(t){return t.Tb||7},"%U":function(t){return u(Math.floor((t.Wb+7-t.Tb)/7),2)},"%V":function(t){var e=Math.floor((t.Wb+7-(t.Tb+6)%7)/7);if(2>=(t.Tb+371-t.Wb-2)%7&&e++,e)53==e&&(4==(n=(t.Tb+371-t.Wb)%7)||3==n&&ue(t.Xb)||(e=1));else{e=52;var n=(t.Tb+7-t.Wb-1)%7;(4==n||5==n&&ue(t.Xb%400-1))&&e++}return u(e,2)},"%w":function(t){return t.Tb},"%W":function(t){return u(Math.floor((t.Wb+7-(t.Tb+6)%7)/7),2)},"%y":function(t){return(t.Xb+1900).toString().substring(2)},"%Y":function(t){return t.Xb+1900},"%z":function(t){var e=0<=(t=t.Jc);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.Mc},"%%":function(){return"%"}},r=r.replace(/%%/g,"\\0\\0"),l)r.includes(p)&&(r=r.replace(new RegExp(p,"g"),l[p](i)));return p=function(t){var e=Array(G(t)+1);return B(t,e,0,e.length),e}(r=r.replace(/\\0\\0/g,"%")),p.length>n?0:(function(t,n){e().set(t,n>>>0)}(p,t),p.length-1)}ht.fc();var le=[null,lt,bt,Et,Ct,xt,Rt,jt,kt,Dt,Pt,Ut,Ft,It,Wt,Ht,Lt,Bt,Gt,Vt,$t,Kt,te,ee,ne,ie],pe={b:function(t){return de(t+24)+24},n:function(t){return(t=new At(t)).uc()||(t.hc(!0),Ot--),t.ic(!1),_t.push(t),t.sc(),t.vc()},ma:function(t){throw x("Unexpected exception thrown, this is not properly supported - aborting"),H=!0,t},x:function(){Ae(0);var t=_t.pop();if(t.Hc()&&!t.kc()){var e=t.Dc();e&&vt(e)(t.Zb),Tt(t.Zb)}St=0},e:function(){var t=St;if(!t)return oe=0;var e=new At(t);e.cc(t);var n=e.bc();if(!n)return oe=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a<r.length;a++){var i=r[a];if(0===i||i===n)break;if(xe(i,n,e.Sb+16))return oe=i,t}return oe=n,t},l:function(){var t=St;if(!t)return oe=0;var e=new At(t);e.cc(t);var n=e.bc();if(!n)return oe=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a<r.length;a++){var i=r[a];if(0===i||i===n)break;if(xe(i,n,e.Sb+16))return oe=i,t}return oe=n,t},h:function(){var t=St;if(!t)return oe=0;var e=new At(t);e.cc(t);var n=e.bc();if(!n)return oe=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a<r.length;a++){var i=r[a];if(0===i||i===n)break;if(xe(i,n,e.Sb+16))return oe=i,t}return oe=n,t},t:Tt,M:function(){var t=_t.pop();t||at("no exception to throw");var e=t.Zb;throw t.kc()||(_t.push(t),t.ic(!0),t.hc(!1),Ot++),St=e,e},c:function(t,e,n){throw new At(t).fc(e,n),St=t,Ot++,t},pa:function(){return Ot},Fa:function(t){ve(t,!w,1,!g),ht.pc()},T:function(t){O?postMessage({cmd:"cleanupThread",thread:t}):st(t)},xa:Mt,j:function(t){throw St||(St=t),t},H:Ct,Ma:xt,ua:Rt,wa:jt,oa:kt,Ka:Dt,Ca:Pt,Ja:Ut,V:Ft,va:It,sa:Wt,La:Ht,ta:Lt,Ta:function(){},X:function(){at("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},Ua:function(){at("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},W:function(){return Date.now()},ya:function(){return 2097152},Oa:function(){return!0},za:function(t,e,n,r){if(t==e)setTimeout((()=>zt(r)));else if(O)postMessage({targetThread:t,cmd:"processProxyingQueue",queue:r});else{if(!(t=ht.Vb[t]))return;t.postMessage({cmd:"processProxyingQueue",queue:r})}return 1},Ea:function(){return-1},Pa:function(t,e){t=new Date(1e3*Yt(t)),a()[e>>2>>>0]=t.getUTCSeconds(),a()[e+4>>2>>>0]=t.getUTCMinutes(),a()[e+8>>2>>>0]=t.getUTCHours(),a()[e+12>>2>>>0]=t.getUTCDate(),a()[e+16>>2>>>0]=t.getUTCMonth(),a()[e+20>>2>>>0]=t.getUTCFullYear()-1900,a()[e+24>>2>>>0]=t.getUTCDay(),t=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,a()[e+28>>2>>>0]=t},Qa:function(t,e){t=new Date(1e3*Yt(t)),a()[e>>2>>>0]=t.getSeconds(),a()[e+4>>2>>>0]=t.getMinutes(),a()[e+8>>2>>>0]=t.getHours(),a()[e+12>>2>>>0]=t.getDate(),a()[e+16>>2>>>0]=t.getMonth(),a()[e+20>>2>>>0]=t.getFullYear()-1900,a()[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1),r=(t.getTime()-n.getTime())/864e5|0;a()[e+28>>2>>>0]=r,a()[e+36>>2>>>0]=-60*t.getTimezoneOffset(),r=new Date(t.getFullYear(),6,1).getTimezoneOffset(),t=0|(r!=(n=n.getTimezoneOffset())&&t.getTimezoneOffset()==Math.min(n,r)),a()[e+32>>2>>>0]=t},Ra:function(t){var e=new Date(a()[t+20>>2>>>0]+1900,a()[t+16>>2>>>0],a()[t+12>>2>>>0],a()[t+8>>2>>>0],a()[t+4>>2>>>0],a()[t>>2>>>0],0),n=a()[t+32>>2>>>0],r=e.getTimezoneOffset(),i=new Date(e.getFullYear(),0,1),o=new Date(e.getFullYear(),6,1).getTimezoneOffset(),u=i.getTimezoneOffset(),c=Math.min(u,o);return 0>n?a()[t+32>>2>>>0]=Number(o!=u&&c==r):0<n!=(c==r)&&(o=Math.max(u,o),e.setTime(e.getTime()+6e4*((0<n?c:o)-r))),a()[t+24>>2>>>0]=e.getDay(),n=(e.getTime()-i.getTime())/864e5|0,a()[t+28>>2>>>0]=n,a()[t>>2>>>0]=e.getSeconds(),a()[t+4>>2>>>0]=e.getMinutes(),a()[t+8>>2>>>0]=e.getHours(),a()[t+12>>2>>>0]=e.getDate(),a()[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},Aa:Bt,Ba:Gt,Sa:function t(e,n,r){t.Ac||(t.Ac=!0,Vt(e,n,r))},y:function(){at("")},U:function(){if(!_&&!w){var t="Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread";gt||(gt={}),gt[t]||(gt[t]=1,_&&(t="warning: "+t),x(t))}},ra:function(){return 4294901760},B:wt,Ia:function(t,e,n){r().copyWithin(t>>>0,e>>>0,e+n>>>0)},F:function(){return _?n(993).cpus().length:navigator.hardwareConcurrency},Da:function(t,e,n){Jt.length=e,n>>=3;for(var r=0;r<e;r++)Jt[r]=o()[n+r>>>0];return(0>t?ut[-t-1]:le[t]).apply(null,Jt)},qa:function(t){var e=r().length;if((t>>>=0)<=e||4294901760<t)return!1;for(var n=1;4>=n;n*=2){var a=e*(1+.2/n);a=Math.min(a,t+100663296);var i=Math;a=Math.max(t,a),i=i.min.call(i,4294901760,a+(65536-a%65536)%65536);t:{try{j.grow(i-D.byteLength+65535>>>16),N(j.buffer);var o=1;break t}catch(t){}o=void 0}if(o)return!0}return!1},Na:function(){throw"unwind"},Ga:$t,Ha:Kt,J:pt,I:te,S:ee,ga:ne,R:ie,d:function(){return oe},na:function t(r,a){t.lc||(t.lc=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(_)try{var e=n(Object(function(){var t=new Error("Cannot find module \'crypto\'");throw t.code="MODULE_NOT_FOUND",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>at("randomDevice")}());for(var i=0;i<a;i++)e()[r+i>>0>>>0]=t.lc();return 0},ia:function(t,e,n){var r=Ee();try{return vt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Ae(1,0)}},ja:function(t,e,n){var r=Ee();try{return vt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Ae(1,0)}},K:function(t){var e=Ee();try{return vt(t)()}catch(t){if(Me(e),t!==t+0)throw t;Ae(1,0)}},f:function(t,e){var n=Ee();try{return vt(t)(e)}catch(t){if(Me(n),t!==t+0)throw t;Ae(1,0)}},P:function(t,e,n){var r=Ee();try{return vt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Ae(1,0)}},Q:function(t,e,n){var r=Ee();try{return vt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Ae(1,0)}},k:function(t,e,n){var r=Ee();try{return vt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Ae(1,0)}},p:function(t,e,n,r){var a=Ee();try{return vt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Ae(1,0)}},q:function(t,e,n,r,a){var i=Ee();try{return vt(t)(e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Ae(1,0)}},N:function(t,e,n,r,a,i){var o=Ee();try{return vt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Ae(1,0)}},s:function(t,e,n,r,a,i){var o=Ee();try{return vt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Ae(1,0)}},w:function(t,e,n,r,a,i,o){var u=Ee();try{return vt(t)(e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Ae(1,0)}},L:function(t,e,n,r,a,i,o,u){var c=Ee();try{return vt(t)(e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Ae(1,0)}},E:function(t,e,n,r,a,i,o,u,c,s,f,l){var p=Ee();try{return vt(t)(e,n,r,a,i,o,u,c,s,f,l)}catch(t){if(Me(p),t!==t+0)throw t;Ae(1,0)}},aa:function(t,e,n,r,a,i,o,u){var c=Ee();try{return He(t,e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Ae(1,0)}},_:function(t,e,n,r,a,i,o){var u=Ee();try{return ke(t,e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Ae(1,0)}},Z:function(t,e,n,r,a){var i=Ee();try{return Le(t,e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Ae(1,0)}},ca:function(t,e,n,r){var a=Ee();try{return Ie(t,e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Ae(1,0)}},$:function(t){var e=Ee();try{return je(t)}catch(t){if(Me(e),t!==t+0)throw t;Ae(1,0)}},ba:function(t,e){var n=Ee();try{return We(t,e)}catch(t){if(Me(n),t!==t+0)throw t;Ae(1,0)}},Y:function(t,e,n){var r=Ee();try{return De(t,e,n)}catch(t){if(Me(r),t!==t+0)throw t;Ae(1,0)}},g:function(t){var e=Ee();try{vt(t)()}catch(t){if(Me(e),t!==t+0)throw t;Ae(1,0)}},r:function(t,e){var n=Ee();try{vt(t)(e)}catch(t){if(Me(n),t!==t+0)throw t;Ae(1,0)}},i:function(t,e,n){var r=Ee();try{vt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Ae(1,0)}},ha:function(t,e,n,r){var a=Ee();try{vt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Ae(1,0)}},m:function(t,e,n,r){var a=Ee();try{vt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Ae(1,0)}},v:function(t,e,n,r,a){var i=Ee();try{vt(t)(e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Ae(1,0)}},u:function(t,e,n,r,a,i){var o=Ee();try{vt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Ae(1,0)}},O:function(t,e,n,r,a,i,o){var u=Ee();try{vt(t)(e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Ae(1,0)}},A:function(t,e,n,r,a,i,o,u){var c=Ee();try{vt(t)(e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Ae(1,0)}},ka:function(t,e,n,r,a,i,o,u,c){var s=Ee();try{vt(t)(e,n,r,a,i,o,u,c)}catch(t){if(Me(s),t!==t+0)throw t;Ae(1,0)}},C:function(t,e,n,r,a,i,o,u,c,s,f){var l=Ee();try{vt(t)(e,n,r,a,i,o,u,c,s,f)}catch(t){if(Me(l),t!==t+0)throw t;Ae(1,0)}},D:function(t,e,n,r,a,i,o,u,c,s,f,l,p,h,d,y){var b=Ee();try{vt(t)(e,n,r,a,i,o,u,c,s,f,l,p,h,d,y)}catch(t){if(Me(b),t!==t+0)throw t;Ae(1,0)}},fa:function(t,e,n,r,a,i,o,u){var c=Ee();try{Pe(t,e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Ae(1,0)}},da:function(t,e,n,r,a,i,o,u,c,s,f,l){var p=Ee();try{Fe(t,e,n,r,a,i,o,u,c,s,f,l)}catch(t){if(Me(p),t!==t+0)throw t;Ae(1,0)}},ea:function(t,e,n,r,a,i){var o=Ee();try{Ue(t,e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Ae(1,0)}},o:function(t){return t},a:j||u.wasmMemory,G:function(t){oe=t},la:fe,z:function(t,e,n,r){return fe(t,e,n,r)}};!function(){function t(t,e){u.asm=t.exports,ht.qc.push(u.asm.sb),q=u.asm.ub,J.unshift(u.asm.Va),k=e,O||(et--,u.monitorRunDependencies&&u.monitorRunDependencies(et),0==et&&(null!==nt&&(clearInterval(nt),nt=null),rt&&(t=rt,rt=null,t())))}function e(e){t(e.instance,e.module)}function n(t){return function(){if(!M&&(g||w)){if("function"==typeof fetch&&!tt.startsWith("file://"))return fetch(tt,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at \'"+tt+"\'";return t.arrayBuffer()})).catch((function(){return ot()}));if(l)return new Promise((function(t,e){l(tt,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return ot()}))}().then((function(t){return WebAssembly.instantiate(t,r)})).then((function(t){return t})).then(t,(function(t){x("failed to asynchronously prepare wasm: "+t),at(t)}))}var r={a:pe};if(O||(et++,u.monitorRunDependencies&&u.monitorRunDependencies(et)),u.instantiateWasm)try{return u.instantiateWasm(r,t)}catch(t){return x("Module.instantiateWasm callback failed with error: "+t),!1}(M||"function"!=typeof WebAssembly.instantiateStreaming||it()||tt.startsWith("file://")||_||"function"!=typeof fetch?n(e):fetch(tt,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,r).then(e,(function(t){return x("wasm streaming compile failed: "+t),x("falling back to ArrayBuffer instantiation"),n(e)}))}))).catch(s)}(),u.___wasm_call_ctors=function(){return(u.___wasm_call_ctors=u.asm.Va).apply(null,arguments)},u._OrtInit=function(){return(u._OrtInit=u.asm.Wa).apply(null,arguments)},u._OrtCreateSessionOptions=function(){return(u._OrtCreateSessionOptions=u.asm.Xa).apply(null,arguments)},u._OrtAppendExecutionProvider=function(){return(u._OrtAppendExecutionProvider=u.asm.Ya).apply(null,arguments)},u._OrtAddSessionConfigEntry=function(){return(u._OrtAddSessionConfigEntry=u.asm.Za).apply(null,arguments)},u._OrtReleaseSessionOptions=function(){return(u._OrtReleaseSessionOptions=u.asm._a).apply(null,arguments)},u._OrtCreateSession=function(){return(u._OrtCreateSession=u.asm.$a).apply(null,arguments)},u._OrtReleaseSession=function(){return(u._OrtReleaseSession=u.asm.ab).apply(null,arguments)},u._OrtGetInputCount=function(){return(u._OrtGetInputCount=u.asm.bb).apply(null,arguments)},u._OrtGetOutputCount=function(){return(u._OrtGetOutputCount=u.asm.cb).apply(null,arguments)},u._OrtGetInputName=function(){return(u._OrtGetInputName=u.asm.db).apply(null,arguments)},u._OrtGetOutputName=function(){return(u._OrtGetOutputName=u.asm.eb).apply(null,arguments)},u._OrtFree=function(){return(u._OrtFree=u.asm.fb).apply(null,arguments)},u._OrtCreateTensor=function(){return(u._OrtCreateTensor=u.asm.gb).apply(null,arguments)},u._OrtGetTensorData=function(){return(u._OrtGetTensorData=u.asm.hb).apply(null,arguments)},u._OrtReleaseTensor=function(){return(u._OrtReleaseTensor=u.asm.ib).apply(null,arguments)},u._OrtCreateRunOptions=function(){return(u._OrtCreateRunOptions=u.asm.jb).apply(null,arguments)},u._OrtAddRunConfigEntry=function(){return(u._OrtAddRunConfigEntry=u.asm.kb).apply(null,arguments)},u._OrtReleaseRunOptions=function(){return(u._OrtReleaseRunOptions=u.asm.lb).apply(null,arguments)},u._OrtRun=function(){return(u._OrtRun=u.asm.mb).apply(null,arguments)},u._OrtEndProfiling=function(){return(u._OrtEndProfiling=u.asm.nb).apply(null,arguments)};var he=u._pthread_self=function(){return(he=u._pthread_self=u.asm.ob).apply(null,arguments)},de=u._malloc=function(){return(de=u._malloc=u.asm.pb).apply(null,arguments)},ye=u._free=function(){return(ye=u._free=u.asm.qb).apply(null,arguments)},be=u._fflush=function(){return(be=u._fflush=u.asm.rb).apply(null,arguments)};u.__emscripten_tls_init=function(){return(u.__emscripten_tls_init=u.asm.sb).apply(null,arguments)};var me=u.___funcs_on_exit=function(){return(me=u.___funcs_on_exit=u.asm.tb).apply(null,arguments)},ve=u.__emscripten_thread_init=function(){return(ve=u.__emscripten_thread_init=u.asm.vb).apply(null,arguments)};u.__emscripten_thread_crashed=function(){return(u.__emscripten_thread_crashed=u.asm.wb).apply(null,arguments)};var ge,we=u._emscripten_run_in_main_runtime_thread_js=function(){return(we=u._emscripten_run_in_main_runtime_thread_js=u.asm.xb).apply(null,arguments)},_e=u.__emscripten_proxy_execute_task_queue=function(){return(_e=u.__emscripten_proxy_execute_task_queue=u.asm.yb).apply(null,arguments)},Oe=u.__emscripten_thread_free_data=function(){return(Oe=u.__emscripten_thread_free_data=u.asm.zb).apply(null,arguments)},Se=u.__emscripten_thread_exit=function(){return(Se=u.__emscripten_thread_exit=u.asm.Ab).apply(null,arguments)},Ae=u._setThrew=function(){return(Ae=u._setThrew=u.asm.Bb).apply(null,arguments)},Te=u._emscripten_stack_set_limits=function(){return(Te=u._emscripten_stack_set_limits=u.asm.Cb).apply(null,arguments)},Ee=u.stackSave=function(){return(Ee=u.stackSave=u.asm.Db).apply(null,arguments)},Me=u.stackRestore=function(){return(Me=u.stackRestore=u.asm.Eb).apply(null,arguments)},Ce=u.stackAlloc=function(){return(Ce=u.stackAlloc=u.asm.Fb).apply(null,arguments)},xe=u.___cxa_can_catch=function(){return(xe=u.___cxa_can_catch=u.asm.Gb).apply(null,arguments)},Re=u.___cxa_is_pointer_type=function(){return(Re=u.___cxa_is_pointer_type=u.asm.Hb).apply(null,arguments)},je=u.dynCall_j=function(){return(je=u.dynCall_j=u.asm.Ib).apply(null,arguments)},ke=u.dynCall_iiiiij=function(){return(ke=u.dynCall_iiiiij=u.asm.Jb).apply(null,arguments)},De=u.dynCall_jii=function(){return(De=u.dynCall_jii=u.asm.Kb).apply(null,arguments)},Pe=u.dynCall_viiiiij=function(){return(Pe=u.dynCall_viiiiij=u.asm.Lb).apply(null,arguments)},Ue=u.dynCall_vjji=function(){return(Ue=u.dynCall_vjji=u.asm.Mb).apply(null,arguments)},Fe=u.dynCall_viiijjjii=function(){return(Fe=u.dynCall_viiijjjii=u.asm.Nb).apply(null,arguments)},Ie=u.dynCall_iij=function(){return(Ie=u.dynCall_iij=u.asm.Ob).apply(null,arguments)},We=u.dynCall_ji=function(){return(We=u.dynCall_ji=u.asm.Pb).apply(null,arguments)},He=u.dynCall_iiiiiij=function(){return(He=u.dynCall_iiiiiij=u.asm.Qb).apply(null,arguments)},Le=u.dynCall_iiij=function(){return(Le=u.dynCall_iiij=u.asm.Rb).apply(null,arguments)};function ze(){function t(){if(!ge&&(ge=!0,u.calledRun=!0,!H)&&(O||dt(J),c(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),!O)){if(u.postRun)for("function"==typeof u.postRun&&(u.postRun=[u.postRun]);u.postRun.length;){var t=u.postRun.shift();Q.unshift(t)}dt(Q)}}if(!(0<et))if(O)c(u),O||dt(J),postMessage({cmd:"loaded"});else{if(u.preRun)for("function"==typeof u.preRun&&(u.preRun=[u.preRun]);u.preRun.length;)K();dt(X),0<et||(u.setStatus?(u.setStatus("Running..."),setTimeout((function(){setTimeout((function(){u.setStatus("")}),1),t()}),1)):t())}}if(u.UTF8ToString=Y,u.stringToUTF8=function(t,e,n){return B(t,r(),e,n)},u.lengthBytesUTF8=G,u.keepRuntimeAlive=$,u.wasmMemory=j,u.stackSave=Ee,u.stackRestore=Me,u.stackAlloc=Ce,u.ExitStatus=ct,u.PThread=ht,rt=function t(){ge||ze(),ge||(rt=t)},u.preInit)for("function"==typeof u.preInit&&(u.preInit=[u.preInit]);0<u.preInit.length;)u.preInit.pop()();return ze(),t.ready});t.exports=r},932:function(t,e,n){var _scriptDir,r=(_scriptDir=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){var e,r,a;t=t||{},e||(e=void 0!==t?t:{}),e.ready=new Promise((function(t,e){r=t,a=e}));var i,o,u,c,s,f,l=Object.assign({},e),p="./this.program",h=(t,e)=>{throw e},d="object"==typeof window,y="function"==typeof importScripts,b="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,m="";b?(m=y?n(908).dirname(m)+"/":"//",f=()=>{s||(c=n(384),s=n(908))},i=function(t,e){return f(),t=s.normalize(t),c.readFileSync(t,e?void 0:"utf8")},u=t=>((t=i(t,!0)).buffer||(t=new Uint8Array(t)),t),o=(t,e,n)=>{f(),t=s.normalize(t),c.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1<process.argv.length&&(p=process.argv[1].replace(/\\\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",(function(t){if(!(t instanceof Z))throw t})),process.on("unhandledRejection",(function(t){throw t})),h=(t,e)=>{if(_||0<L)throw process.exitCode=t,e;e instanceof Z||w("exiting due to exception: "+e),process.exit(t)},e.inspect=function(){return"[Emscripten Module object]"}):(d||y)&&(y?m=self.location.href:"undefined"!=typeof document&&document.currentScript&&(m=document.currentScript.src),_scriptDir&&(m=_scriptDir),m=0!==m.indexOf("blob:")?m.substr(0,m.replace(/[?#].*/,"").lastIndexOf("/")+1):"",i=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},y&&(u=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),o=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)});var v,g=e.print||console.log.bind(console),w=e.printErr||console.warn.bind(console);Object.assign(e,l),l=null,e.thisProgram&&(p=e.thisProgram),e.quit&&(h=e.quit),e.wasmBinary&&(v=e.wasmBinary);var _=e.noExitRuntime||!1;"object"!=typeof WebAssembly&&V("no native wasm support detected");var O,S,A,T,E,M,C=!1,x="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function R(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16<n-e&&t.buffer&&x)return x.decode(t.subarray(e,n));for(r="";e<n;){var a=t[e++];if(128&a){var i=63&t[e++];if(192==(224&a))r+=String.fromCharCode((31&a)<<6|i);else{var o=63&t[e++];65536>(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&t[e++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function j(t,e){return(t>>>=0)?R(T,t,e):""}function k(t,e,n,r){if(!(0<r))return 0;var a=n>>>=0;r=n+r-1;for(var i=0;i<t.length;++i){var o=t.charCodeAt(i);if(55296<=o&&57343>=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i)),127>=o){if(n>=r)break;e[n++>>>0]=o}else{if(2047>=o){if(n+1>=r)break;e[n++>>>0]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;e[n++>>>0]=224|o>>12}else{if(n+3>=r)break;e[n++>>>0]=240|o>>18,e[n++>>>0]=128|o>>12&63}e[n++>>>0]=128|o>>6&63}e[n++>>>0]=128|63&o}}return e[n>>>0]=0,n-a}function D(t){for(var e=0,n=0;n<t.length;++n){var r=t.charCodeAt(n);127>=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function P(){var t=O.buffer;S=t,e.HEAP8=A=new Int8Array(t),e.HEAP16=new Int16Array(t),e.HEAP32=E=new Int32Array(t),e.HEAPU8=T=new Uint8Array(t),e.HEAPU16=new Uint16Array(t),e.HEAPU32=M=new Uint32Array(t),e.HEAPF32=new Float32Array(t),e.HEAPF64=new Float64Array(t)}var U,F=[],I=[],W=[],H=[],L=0;function z(){var t=e.preRun.shift();F.unshift(t)}var Y,B=0,G=null,N=null;function V(t){throw e.onAbort&&e.onAbort(t),w(t="Aborted("+t+")"),C=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),a(t),t}function q(){return Y.startsWith("data:application/octet-stream;base64,")}if(Y="ort-wasm.wasm",!q()){var X=Y;Y=e.locateFile?e.locateFile(X,m):m+X}function J(){var t=Y;try{if(t==Y&&v)return new Uint8Array(v);if(u)return u(t);throw"both async and sync fetching of the wasm failed"}catch(t){V(t)}}function Z(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function Q(t){for(;0<t.length;)t.shift()(e)}var $=[],K=0,tt=0;function et(t){this.Db=t,this.zb=t-24,this.Ub=function(t){M[this.zb+4>>2>>>0]=t},this.Eb=function(){return M[this.zb+4>>2>>>0]},this.Sb=function(t){M[this.zb+8>>2>>>0]=t},this.Wb=function(){return M[this.zb+8>>2>>>0]},this.Tb=function(){E[this.zb>>2>>>0]=0},this.Ib=function(t){A[this.zb+12>>0>>>0]=t?1:0},this.Pb=function(){return 0!=A[this.zb+12>>0>>>0]},this.Jb=function(t){A[this.zb+13>>0>>>0]=t?1:0},this.Lb=function(){return 0!=A[this.zb+13>>0>>>0]},this.Rb=function(t,e){this.Fb(0),this.Ub(t),this.Sb(e),this.Tb(),this.Ib(!1),this.Jb(!1)},this.Nb=function(){E[this.zb>>2>>>0]+=1},this.Xb=function(){var t=E[this.zb>>2>>>0];return E[this.zb>>2>>>0]=t-1,1===t},this.Fb=function(t){M[this.zb+16>>2>>>0]=t},this.Ob=function(){return M[this.zb+16>>2>>>0]},this.Qb=function(){if(Mt(this.Eb()))return M[this.Db>>2>>>0];var t=this.Ob();return 0!==t?t:this.Db}}function nt(t){return gt(new et(t).zb)}var rt=[];function at(t){var e=rt[t];return e||(t>=rt.length&&(rt.length=t+1),rt[t]=e=U.get(t)),e}function it(t){var e=D(t)+1,n=vt(e);return n&&k(t,A,n,e),n}var ot={};function ut(){if(!ct){var t,e={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",_:p||"./this.program"};for(t in ot)void 0===ot[t]?delete e[t]:e[t]=ot[t];var n=[];for(t in e)n.push(t+"="+e[t]);ct=n}return ct}var ct,st=[null,[],[]];function ft(t,e){var n=st[t];0===e||10===e?((1===t?g:w)(R(n,0)),n.length=0):n.push(e)}var lt=0;function pt(t){return 0==t%4&&(0!=t%100||0==t%400)}var ht=[31,29,31,30,31,30,31,31,30,31,30,31],dt=[31,28,31,30,31,30,31,31,30,31,30,31];function yt(t,e,n,r){function a(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.length<e;)t=n[0]+t;return t}function i(t,e){return a(t,e,"0")}function o(t,e){function n(t){return 0>t?-1:0<t?1:0}var r;return 0===(r=n(t.getFullYear()-e.getFullYear()))&&0===(r=n(t.getMonth()-e.getMonth()))&&(r=n(t.getDate()-e.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 e=t.Bb;for(t=new Date(new Date(t.Cb+1900,0,1).getTime());0<e;){var n=t.getMonth(),r=(pt(t.getFullYear())?ht:dt)[n];if(!(e>r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=u(new Date(t.getFullYear(),0,4)),n=u(n),0>=o(e,t)?0>=o(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var s=E[r+40>>2>>>0];for(var f in r={$b:E[r>>2>>>0],Zb:E[r+4>>2>>>0],Gb:E[r+8>>2>>>0],Kb:E[r+12>>2>>>0],Hb:E[r+16>>2>>>0],Cb:E[r+20>>2>>>0],Ab:E[r+24>>2>>>0],Bb:E[r+28>>2>>>0],bc:E[r+32>>2>>>0],Yb:E[r+36>>2>>>0],ac:s?j(s):""},n=j(n),s={"%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"})n=n.replace(new RegExp(f,"g"),s[f]);var l="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),p="January February March April May June July August September October November December".split(" ");for(f in s={"%a":function(t){return l[t.Ab].substring(0,3)},"%A":function(t){return l[t.Ab]},"%b":function(t){return p[t.Hb].substring(0,3)},"%B":function(t){return p[t.Hb]},"%C":function(t){return i((t.Cb+1900)/100|0,2)},"%d":function(t){return i(t.Kb,2)},"%e":function(t){return a(t.Kb,2," ")},"%g":function(t){return c(t).toString().substring(2)},"%G":function(t){return c(t)},"%H":function(t){return i(t.Gb,2)},"%I":function(t){return 0==(t=t.Gb)?t=12:12<t&&(t-=12),i(t,2)},"%j":function(t){for(var e=0,n=0;n<=t.Hb-1;e+=(pt(t.Cb+1900)?ht:dt)[n++]);return i(t.Kb+e,3)},"%m":function(t){return i(t.Hb+1,2)},"%M":function(t){return i(t.Zb,2)},"%n":function(){return"\\n"},"%p":function(t){return 0<=t.Gb&&12>t.Gb?"AM":"PM"},"%S":function(t){return i(t.$b,2)},"%t":function(){return"\\t"},"%u":function(t){return t.Ab||7},"%U":function(t){return i(Math.floor((t.Bb+7-t.Ab)/7),2)},"%V":function(t){var e=Math.floor((t.Bb+7-(t.Ab+6)%7)/7);if(2>=(t.Ab+371-t.Bb-2)%7&&e++,e)53==e&&(4==(n=(t.Ab+371-t.Bb)%7)||3==n&&pt(t.Cb)||(e=1));else{e=52;var n=(t.Ab+7-t.Bb-1)%7;(4==n||5==n&&pt(t.Cb%400-1))&&e++}return i(e,2)},"%w":function(t){return t.Ab},"%W":function(t){return i(Math.floor((t.Bb+7-(t.Ab+6)%7)/7),2)},"%y":function(t){return(t.Cb+1900).toString().substring(2)},"%Y":function(t){return t.Cb+1900},"%z":function(t){var e=0<=(t=t.Yb);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.ac},"%%":function(){return"%"}},n=n.replace(/%%/g,"\\0\\0"),s)n.includes(f)&&(n=n.replace(new RegExp(f,"g"),s[f](r)));return f=function(t){var e=Array(D(t)+1);return k(t,e,0,e.length),e}(n=n.replace(/\\0\\0/g,"%")),f.length>e?0:(A.set(f,t>>>0),f.length-1)}var bt={a:function(t){return vt(t+24)+24},m:function(t){return(t=new et(t)).Pb()||(t.Ib(!0),K--),t.Jb(!1),$.push(t),t.Nb(),t.Qb()},ia:function(t){throw w("Unexpected exception thrown, this is not properly supported - aborting"),C=!0,t},w:function(){Ot(0);var t=$.pop();if(t.Xb()&&!t.Lb()){var e=t.Wb();e&&at(e)(t.Db),nt(t.Db)}tt=0},d:function(){var t=tt;if(!t)return lt=0;var e=new et(t);e.Fb(t);var n=e.Eb();if(!n)return lt=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a<r.length;a++){var i=r[a];if(0===i||i===n)break;if(Et(i,n,e.zb+16))return lt=i,t}return lt=n,t},k:function(){var t=tt;if(!t)return lt=0;var e=new et(t);e.Fb(t);var n=e.Eb();if(!n)return lt=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a<r.length;a++){var i=r[a];if(0===i||i===n)break;if(Et(i,n,e.zb+16))return lt=i,t}return lt=n,t},g:function(){var t=tt;if(!t)return lt=0;var e=new et(t);e.Fb(t);var n=e.Eb();if(!n)return lt=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a<r.length;a++){var i=r[a];if(0===i||i===n)break;if(Et(i,n,e.zb+16))return lt=i,t}return lt=n,t},s:nt,L:function(){var t=$.pop();t||V("no exception to throw");var e=t.Db;throw t.Lb()||($.push(t),t.Jb(!0),t.Ib(!1),K++),tt=e,e},b:function(t,e,n){throw new et(t).Rb(e,n),tt=t,K++,t},la:function(){return K},i:function(t){throw tt||(tt=t),t},H:function(){return 0},Ba:function(){},pa:function(){},ra:function(){},ka:function(){return 0},za:function(){},ua:function(){},ya:function(){},R:function(){},qa:function(){},na:function(){},Aa:function(){},oa:function(){},Ha:function(){},Ja:function(){V("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},Ia:function(){V("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},S:function(){return Date.now()},Ca:function(){return!0},Da:function(t,e){t=new Date(1e3*(M[t>>>2]+4294967296*E[t+4>>>2])),E[e>>2>>>0]=t.getUTCSeconds(),E[e+4>>2>>>0]=t.getUTCMinutes(),E[e+8>>2>>>0]=t.getUTCHours(),E[e+12>>2>>>0]=t.getUTCDate(),E[e+16>>2>>>0]=t.getUTCMonth(),E[e+20>>2>>>0]=t.getUTCFullYear()-1900,E[e+24>>2>>>0]=t.getUTCDay(),E[e+28>>2>>>0]=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Ea:function(t,e){t=new Date(1e3*(M[t>>>2]+4294967296*E[t+4>>>2])),E[e>>2>>>0]=t.getSeconds(),E[e+4>>2>>>0]=t.getMinutes(),E[e+8>>2>>>0]=t.getHours(),E[e+12>>2>>>0]=t.getDate(),E[e+16>>2>>>0]=t.getMonth(),E[e+20>>2>>>0]=t.getFullYear()-1900,E[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1);E[e+28>>2>>>0]=(t.getTime()-n.getTime())/864e5|0,E[e+36>>2>>>0]=-60*t.getTimezoneOffset();var r=new Date(t.getFullYear(),6,1).getTimezoneOffset();n=n.getTimezoneOffset(),E[e+32>>2>>>0]=0|(r!=n&&t.getTimezoneOffset()==Math.min(n,r))},Fa:function(t){var e=new Date(E[t+20>>2>>>0]+1900,E[t+16>>2>>>0],E[t+12>>2>>>0],E[t+8>>2>>>0],E[t+4>>2>>>0],E[t>>2>>>0],0),n=E[t+32>>2>>>0],r=e.getTimezoneOffset(),a=new Date(e.getFullYear(),0,1),i=new Date(e.getFullYear(),6,1).getTimezoneOffset(),o=a.getTimezoneOffset(),u=Math.min(o,i);return 0>n?E[t+32>>2>>>0]=Number(i!=o&&u==r):0<n!=(u==r)&&(i=Math.max(o,i),e.setTime(e.getTime()+6e4*((0<n?u:i)-r))),E[t+24>>2>>>0]=e.getDay(),E[t+28>>2>>>0]=(e.getTime()-a.getTime())/864e5|0,E[t>>2>>>0]=e.getSeconds(),E[t+4>>2>>>0]=e.getMinutes(),E[t+8>>2>>>0]=e.getHours(),E[t+12>>2>>>0]=e.getDate(),E[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},sa:function(){return-52},ta:function(){},Ga:function t(e,n,r){t.Vb||(t.Vb=!0,function(t,e,n){function r(t){return(t=t.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?t[1]:"GMT"}var a=(new Date).getFullYear(),i=new Date(a,0,1),o=new Date(a,6,1);a=i.getTimezoneOffset();var u=o.getTimezoneOffset();E[t>>2>>>0]=60*Math.max(a,u),E[e>>2>>>0]=Number(a!=u),t=r(i),e=r(o),t=it(t),e=it(e),u<a?(M[n>>2>>>0]=t,M[n+4>>2>>>0]=e):(M[n>>2>>>0]=e,M[n+4>>2>>>0]=t)}(e,n,r))},B:function(){V("")},ma:function(){return 4294901760},I:b?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:()=>performance.now(),xa:function(t,e,n){T.copyWithin(t>>>0,e>>>0,e+n>>>0)},G:function(t){var e=T.length;if(4294901760<(t>>>=0))return!1;for(var n=1;4>=n;n*=2){var r=e*(1+.2/n);r=Math.min(r,t+100663296);var a=Math;r=Math.max(t,r),a=a.min.call(a,4294901760,r+(65536-r%65536)%65536);t:{try{O.grow(a-S.byteLength+65535>>>16),P();var i=1;break t}catch(t){}i=void 0}if(i)return!0}return!1},va:function(t,e){var n=0;return ut().forEach((function(r,a){var i=e+n;for(a=M[t+4*a>>2>>>0]=i,i=0;i<r.length;++i)A[a++>>0>>>0]=r.charCodeAt(i);A[a>>0>>>0]=0,n+=r.length+1})),0},wa:function(t,e){var n=ut();M[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),M[e>>2>>>0]=r,0},ba:function(t){_||0<L||(_t(),Q(W),wt(0),st[1].length&&ft(1,10),st[2].length&&ft(2,10)),_||0<L||(e.onExit&&e.onExit(t),C=!0),h(t,new Z(t))},E:function(){return 52},Q:function(){return 52},ca:function(){return 70},P:function(t,e,n,r){for(var a=0,i=0;i<n;i++){var o=M[e>>2>>>0],u=M[e+4>>2>>>0];e+=8;for(var c=0;c<u;c++)ft(t,T[o+c>>>0]);a+=u}return M[r>>2>>>0]=a,0},c:function(){return lt},ja:function t(e,r){t.Mb||(t.Mb=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(b)try{var e=n(Object(function(){var t=new Error("Cannot find module \'crypto\'");throw t.code="MODULE_NOT_FOUND",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>V("randomDevice")}());for(var a=0;a<r;a++)A[e+a>>0>>>0]=t.Mb();return 0},ea:function(t,e,n){var r=St();try{return at(t)(e,n)}catch(t){if(At(r),t!==t+0)throw t;Ot(1,0)}},fa:function(t,e,n){var r=St();try{return at(t)(e,n)}catch(t){if(At(r),t!==t+0)throw t;Ot(1,0)}},J:function(t){var e=St();try{return at(t)()}catch(t){if(At(e),t!==t+0)throw t;Ot(1,0)}},e:function(t,e){var n=St();try{return at(t)(e)}catch(t){if(At(n),t!==t+0)throw t;Ot(1,0)}},N:function(t,e,n){var r=St();try{return at(t)(e,n)}catch(t){if(At(r),t!==t+0)throw t;Ot(1,0)}},O:function(t,e,n){var r=St();try{return at(t)(e,n)}catch(t){if(At(r),t!==t+0)throw t;Ot(1,0)}},j:function(t,e,n){var r=St();try{return at(t)(e,n)}catch(t){if(At(r),t!==t+0)throw t;Ot(1,0)}},o:function(t,e,n,r){var a=St();try{return at(t)(e,n,r)}catch(t){if(At(a),t!==t+0)throw t;Ot(1,0)}},p:function(t,e,n,r,a){var i=St();try{return at(t)(e,n,r,a)}catch(t){if(At(i),t!==t+0)throw t;Ot(1,0)}},M:function(t,e,n,r,a,i){var o=St();try{return at(t)(e,n,r,a,i)}catch(t){if(At(o),t!==t+0)throw t;Ot(1,0)}},r:function(t,e,n,r,a,i){var o=St();try{return at(t)(e,n,r,a,i)}catch(t){if(At(o),t!==t+0)throw t;Ot(1,0)}},v:function(t,e,n,r,a,i,o){var u=St();try{return at(t)(e,n,r,a,i,o)}catch(t){if(At(u),t!==t+0)throw t;Ot(1,0)}},K:function(t,e,n,r,a,i,o,u){var c=St();try{return at(t)(e,n,r,a,i,o,u)}catch(t){if(At(c),t!==t+0)throw t;Ot(1,0)}},D:function(t,e,n,r,a,i,o,u,c,s,f,l){var p=St();try{return at(t)(e,n,r,a,i,o,u,c,s,f,l)}catch(t){if(At(p),t!==t+0)throw t;Ot(1,0)}},X:function(t,e,n,r,a,i,o,u){var c=St();try{return Ft(t,e,n,r,a,i,o,u)}catch(t){if(At(c),t!==t+0)throw t;Ot(1,0)}},V:function(t,e,n,r,a,i,o){var u=St();try{return xt(t,e,n,r,a,i,o)}catch(t){if(At(u),t!==t+0)throw t;Ot(1,0)}},U:function(t,e,n,r,a){var i=St();try{return It(t,e,n,r,a)}catch(t){if(At(i),t!==t+0)throw t;Ot(1,0)}},Z:function(t,e,n,r){var a=St();try{return Pt(t,e,n,r)}catch(t){if(At(a),t!==t+0)throw t;Ot(1,0)}},W:function(t){var e=St();try{return Ct(t)}catch(t){if(At(e),t!==t+0)throw t;Ot(1,0)}},Y:function(t,e){var n=St();try{return Ut(t,e)}catch(t){if(At(n),t!==t+0)throw t;Ot(1,0)}},T:function(t,e,n){var r=St();try{return Rt(t,e,n)}catch(t){if(At(r),t!==t+0)throw t;Ot(1,0)}},f:function(t){var e=St();try{at(t)()}catch(t){if(At(e),t!==t+0)throw t;Ot(1,0)}},q:function(t,e){var n=St();try{at(t)(e)}catch(t){if(At(n),t!==t+0)throw t;Ot(1,0)}},h:function(t,e,n){var r=St();try{at(t)(e,n)}catch(t){if(At(r),t!==t+0)throw t;Ot(1,0)}},da:function(t,e,n,r){var a=St();try{at(t)(e,n,r)}catch(t){if(At(a),t!==t+0)throw t;Ot(1,0)}},l:function(t,e,n,r){var a=St();try{at(t)(e,n,r)}catch(t){if(At(a),t!==t+0)throw t;Ot(1,0)}},t:function(t,e,n,r,a){var i=St();try{at(t)(e,n,r,a)}catch(t){if(At(i),t!==t+0)throw t;Ot(1,0)}},u:function(t,e,n,r,a,i){var o=St();try{at(t)(e,n,r,a,i)}catch(t){if(At(o),t!==t+0)throw t;Ot(1,0)}},x:function(t,e,n,r,a,i,o){var u=St();try{at(t)(e,n,r,a,i,o)}catch(t){if(At(u),t!==t+0)throw t;Ot(1,0)}},z:function(t,e,n,r,a,i,o,u){var c=St();try{at(t)(e,n,r,a,i,o,u)}catch(t){if(At(c),t!==t+0)throw t;Ot(1,0)}},ga:function(t,e,n,r,a,i,o,u,c){var s=St();try{at(t)(e,n,r,a,i,o,u,c)}catch(t){if(At(s),t!==t+0)throw t;Ot(1,0)}},A:function(t,e,n,r,a,i,o,u,c,s,f){var l=St();try{at(t)(e,n,r,a,i,o,u,c,s,f)}catch(t){if(At(l),t!==t+0)throw t;Ot(1,0)}},C:function(t,e,n,r,a,i,o,u,c,s,f,l,p,h,d,y){var b=St();try{at(t)(e,n,r,a,i,o,u,c,s,f,l,p,h,d,y)}catch(t){if(At(b),t!==t+0)throw t;Ot(1,0)}},aa:function(t,e,n,r,a,i,o,u){var c=St();try{jt(t,e,n,r,a,i,o,u)}catch(t){if(At(c),t!==t+0)throw t;Ot(1,0)}},_:function(t,e,n,r,a,i,o,u,c,s,f,l){var p=St();try{Dt(t,e,n,r,a,i,o,u,c,s,f,l)}catch(t){if(At(p),t!==t+0)throw t;Ot(1,0)}},$:function(t,e,n,r,a,i){var o=St();try{kt(t,e,n,r,a,i)}catch(t){if(At(o),t!==t+0)throw t;Ot(1,0)}},n:function(t){return t},F:function(t){lt=t},ha:yt,y:function(t,e,n,r){return yt(t,e,n,r)}};!function(){function t(t){e.asm=t.exports,O=e.asm.Ka,P(),U=e.asm.ib,I.unshift(e.asm.La),B--,e.monitorRunDependencies&&e.monitorRunDependencies(B),0==B&&(null!==G&&(clearInterval(G),G=null),N&&(t=N,N=null,t()))}function n(e){t(e.instance)}function r(t){return function(){if(!v&&(d||y)){if("function"==typeof fetch&&!Y.startsWith("file://"))return fetch(Y,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at \'"+Y+"\'";return t.arrayBuffer()})).catch((function(){return J()}));if(o)return new Promise((function(t,e){o(Y,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return J()}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){w("failed to asynchronously prepare wasm: "+t),V(t)}))}var i={a:bt};if(B++,e.monitorRunDependencies&&e.monitorRunDependencies(B),e.instantiateWasm)try{return e.instantiateWasm(i,t)}catch(t){return w("Module.instantiateWasm callback failed with error: "+t),!1}(v||"function"!=typeof WebAssembly.instantiateStreaming||q()||Y.startsWith("file://")||b||"function"!=typeof fetch?r(n):fetch(Y,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(n,(function(t){return w("wasm streaming compile failed: "+t),w("falling back to ArrayBuffer instantiation"),r(n)}))}))).catch(a)}(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.La).apply(null,arguments)},e._OrtInit=function(){return(e._OrtInit=e.asm.Ma).apply(null,arguments)},e._OrtCreateSessionOptions=function(){return(e._OrtCreateSessionOptions=e.asm.Na).apply(null,arguments)},e._OrtAppendExecutionProvider=function(){return(e._OrtAppendExecutionProvider=e.asm.Oa).apply(null,arguments)},e._OrtAddSessionConfigEntry=function(){return(e._OrtAddSessionConfigEntry=e.asm.Pa).apply(null,arguments)},e._OrtReleaseSessionOptions=function(){return(e._OrtReleaseSessionOptions=e.asm.Qa).apply(null,arguments)},e._OrtCreateSession=function(){return(e._OrtCreateSession=e.asm.Ra).apply(null,arguments)},e._OrtReleaseSession=function(){return(e._OrtReleaseSession=e.asm.Sa).apply(null,arguments)},e._OrtGetInputCount=function(){return(e._OrtGetInputCount=e.asm.Ta).apply(null,arguments)},e._OrtGetOutputCount=function(){return(e._OrtGetOutputCount=e.asm.Ua).apply(null,arguments)},e._OrtGetInputName=function(){return(e._OrtGetInputName=e.asm.Va).apply(null,arguments)},e._OrtGetOutputName=function(){return(e._OrtGetOutputName=e.asm.Wa).apply(null,arguments)},e._OrtFree=function(){return(e._OrtFree=e.asm.Xa).apply(null,arguments)},e._OrtCreateTensor=function(){return(e._OrtCreateTensor=e.asm.Ya).apply(null,arguments)},e._OrtGetTensorData=function(){return(e._OrtGetTensorData=e.asm.Za).apply(null,arguments)},e._OrtReleaseTensor=function(){return(e._OrtReleaseTensor=e.asm._a).apply(null,arguments)},e._OrtCreateRunOptions=function(){return(e._OrtCreateRunOptions=e.asm.$a).apply(null,arguments)},e._OrtAddRunConfigEntry=function(){return(e._OrtAddRunConfigEntry=e.asm.ab).apply(null,arguments)},e._OrtReleaseRunOptions=function(){return(e._OrtReleaseRunOptions=e.asm.bb).apply(null,arguments)},e._OrtRun=function(){return(e._OrtRun=e.asm.cb).apply(null,arguments)},e._OrtEndProfiling=function(){return(e._OrtEndProfiling=e.asm.db).apply(null,arguments)};var mt,vt=e._malloc=function(){return(vt=e._malloc=e.asm.eb).apply(null,arguments)},gt=e._free=function(){return(gt=e._free=e.asm.fb).apply(null,arguments)},wt=e._fflush=function(){return(wt=e._fflush=e.asm.gb).apply(null,arguments)},_t=e.___funcs_on_exit=function(){return(_t=e.___funcs_on_exit=e.asm.hb).apply(null,arguments)},Ot=e._setThrew=function(){return(Ot=e._setThrew=e.asm.jb).apply(null,arguments)},St=e.stackSave=function(){return(St=e.stackSave=e.asm.kb).apply(null,arguments)},At=e.stackRestore=function(){return(At=e.stackRestore=e.asm.lb).apply(null,arguments)},Tt=e.stackAlloc=function(){return(Tt=e.stackAlloc=e.asm.mb).apply(null,arguments)},Et=e.___cxa_can_catch=function(){return(Et=e.___cxa_can_catch=e.asm.nb).apply(null,arguments)},Mt=e.___cxa_is_pointer_type=function(){return(Mt=e.___cxa_is_pointer_type=e.asm.ob).apply(null,arguments)},Ct=e.dynCall_j=function(){return(Ct=e.dynCall_j=e.asm.pb).apply(null,arguments)},xt=e.dynCall_iiiiij=function(){return(xt=e.dynCall_iiiiij=e.asm.qb).apply(null,arguments)},Rt=e.dynCall_jii=function(){return(Rt=e.dynCall_jii=e.asm.rb).apply(null,arguments)},jt=e.dynCall_viiiiij=function(){return(jt=e.dynCall_viiiiij=e.asm.sb).apply(null,arguments)},kt=e.dynCall_vjji=function(){return(kt=e.dynCall_vjji=e.asm.tb).apply(null,arguments)},Dt=e.dynCall_viiijjjii=function(){return(Dt=e.dynCall_viiijjjii=e.asm.ub).apply(null,arguments)},Pt=e.dynCall_iij=function(){return(Pt=e.dynCall_iij=e.asm.vb).apply(null,arguments)},Ut=e.dynCall_ji=function(){return(Ut=e.dynCall_ji=e.asm.wb).apply(null,arguments)},Ft=e.dynCall_iiiiiij=function(){return(Ft=e.dynCall_iiiiiij=e.asm.xb).apply(null,arguments)},It=e.dynCall_iiij=function(){return(It=e.dynCall_iiij=e.asm.yb).apply(null,arguments)};function Wt(){function t(){if(!mt&&(mt=!0,e.calledRun=!0,!C)){if(Q(I),r(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var t=e.postRun.shift();H.unshift(t)}Q(H)}}if(!(0<B)){if(e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)z();Q(F),0<B||(e.setStatus?(e.setStatus("Running..."),setTimeout((function(){setTimeout((function(){e.setStatus("")}),1),t()}),1)):t())}}if(e.UTF8ToString=j,e.stringToUTF8=function(t,e,n){return k(t,T,e,n)},e.lengthBytesUTF8=D,e.stackSave=St,e.stackRestore=At,e.stackAlloc=Tt,N=function t(){mt||Wt(),mt||(N=t)},e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);0<e.preInit.length;)e.preInit.pop()();return Wt(),t.ready});t.exports=r},967:function(t,e){"use strict";var n=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,a,i=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)o.push(r.value)}catch(t){a={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return o};Object.defineProperty(e,"__esModule",{value:!0}),e.iterateExtraOptions=void 0,e.iterateExtraOptions=function(t,r,a,i){if("object"==typeof t&&null!==t){if(a.has(t))throw new Error("Circular reference in options");a.add(t)}Object.entries(t).forEach((function(t){var o=n(t,2),u=o[0],c=o[1],s=r?r+u:u;if("object"==typeof c)(0,e.iterateExtraOptions)(c,s+".",a,i);else if("string"==typeof c||"number"==typeof c)i(s,c.toString());else{if("boolean"!=typeof c)throw new Error("Can\'t handle extra config type: ".concat(typeof c));i(s,c?"1":"0")}}))}},586:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setRunOptions=void 0;var r=n(967),a=n(983),i=n(361);e.setRunOptions=function(t){var e=(0,i.getInstance)(),n=0,o=[],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: ".concat(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: ".concat(t.logVerbosityLevel));void 0===(null==t?void 0:t.terminate)&&(u.terminate=!1);var c=0;if(void 0!==(null==t?void 0:t.tag)&&(c=(0,a.allocWasmString)(t.tag,o)),0===(n=e._OrtCreateRunOptions(u.logSeverityLevel,u.logVerbosityLevel,!!u.terminate,c)))throw new Error("Can\'t create run options");return void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,"",new WeakSet,(function(t,r){var i=(0,a.allocWasmString)(t,o),u=(0,a.allocWasmString)(r,o);if(0!==e._OrtAddRunConfigEntry(n,i,u))throw new Error("Can\'t set a run config entry: ".concat(t," - ").concat(r))})),[n,o]}catch(t){throw 0!==n&&e._OrtReleaseRunOptions(n),o.forEach(e._free),t}}},919:function(t,e,n){"use strict";var r=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.setSessionOptions=void 0;var a=n(967),i=n(983),o=n(361);e.setSessionOptions=function(t){var e=(0,o.getInstance)(),n=0,u=[],c=t||{};!function(t){t.extra||(t.extra={}),t.extra.session||(t.extra.session={});var e=t.extra.session;e.use_ort_model_bytes_directly||(e.use_ort_model_bytes_directly="1")}(c);try{void 0===(null==t?void 0:t.graphOptimizationLevel)&&(c.graphOptimizationLevel="all");var s=function(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: ".concat(t))}}(c.graphOptimizationLevel);void 0===(null==t?void 0:t.enableCpuMemArena)&&(c.enableCpuMemArena=!0),void 0===(null==t?void 0:t.enableMemPattern)&&(c.enableMemPattern=!0),void 0===(null==t?void 0:t.executionMode)&&(c.executionMode="sequential");var f=function(t){switch(t){case"sequential":return 0;case"parallel":return 1;default:throw new Error("unsupported execution mode: ".concat(t))}}(c.executionMode),l=0;if(void 0!==(null==t?void 0:t.logId)&&(l=(0,i.allocWasmString)(t.logId,u)),void 0===(null==t?void 0:t.logSeverityLevel))c.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: ".concat(t.logSeverityLevel));if(void 0===(null==t?void 0:t.logVerbosityLevel))c.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error("log verbosity level is not valid: ".concat(t.logVerbosityLevel));if(void 0===(null==t?void 0:t.enableProfiling)&&(c.enableProfiling=!1),0===(n=e._OrtCreateSessionOptions(s,!!c.enableCpuMemArena,!!c.enableMemPattern,f,!!c.enableProfiling,0,l,c.logSeverityLevel,c.logVerbosityLevel)))throw new Error("Can\'t create session options");return(null==t?void 0:t.executionProviders)&&function(t,e,n){var a,u;try{for(var c=r(e),s=c.next();!s.done;s=c.next()){var f=s.value,l="string"==typeof f?f:f.name;switch(l){case"xnnpack":l="XNNPACK";break;case"wasm":case"cpu":continue;default:throw new Error("not supported EP: ".concat(l))}var p=(0,i.allocWasmString)(l,n);if(0!==(0,o.getInstance)()._OrtAppendExecutionProvider(t,p))throw new Error("Can\'t append execution provider: ".concat(l))}}catch(t){a={error:t}}finally{try{s&&!s.done&&(u=c.return)&&u.call(c)}finally{if(a)throw a.error}}}(n,t.executionProviders,u),void 0!==(null==t?void 0:t.extra)&&(0,a.iterateExtraOptions)(t.extra,"",new WeakSet,(function(t,r){var a=(0,i.allocWasmString)(t,u),o=(0,i.allocWasmString)(r,u);if(0!==e._OrtAddSessionConfigEntry(n,a,o))throw new Error("Can\'t set a session config entry: ".concat(t," - ").concat(r))})),[n,u]}catch(t){throw 0!==n&&e._OrtReleaseSessionOptions(n),u.forEach(e._free),t}}},983:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.allocWasmString=void 0;var r=n(361);e.allocWasmString=function(t,e){var n=(0,r.getInstance)(),a=n.lengthBytesUTF8(t)+1,i=n._malloc(a);return n.stringToUTF8(t,i,a),e.push(i),i}},349:function(t,e,n){"use strict";var r=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,a,i=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)o.push(r.value)}catch(t){a={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return o},a=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.extractTransferableBuffers=e.endProfiling=e.run=e.releaseSession=e.createSession=e.createSessionFinalize=e.createSessionAllocate=e.initOrt=void 0;var i=n(586),o=n(919),u=n(983),c=n(361);e.initOrt=function(t,e){var n=(0,c.getInstance)()._OrtInit(t,e);if(0!==n)throw new Error("Can\'t initialize onnxruntime. error code = ".concat(n))};var s=new Map;e.createSessionAllocate=function(t){var e=(0,c.getInstance)(),n=e._malloc(t.byteLength);return e.HEAPU8.set(t,n),[n,t.byteLength]},e.createSessionFinalize=function(t,e){var n,a=(0,c.getInstance)(),i=0,u=0,f=[];try{if(u=(n=r((0,o.setSessionOptions)(e),2))[0],f=n[1],0===(i=a._OrtCreateSession(t[0],t[1],u)))throw new Error("Can\'t create a session")}finally{a._free(t[0]),a._OrtReleaseSessionOptions(u),f.forEach(a._free)}for(var l=a._OrtGetInputCount(i),p=a._OrtGetOutputCount(i),h=[],d=[],y=[],b=[],m=0;m<l;m++){var v=a._OrtGetInputName(i,m);if(0===v)throw new Error("Can\'t get an input name");d.push(v),h.push(a.UTF8ToString(v))}for(m=0;m<p;m++){var g=a._OrtGetOutputName(i,m);if(0===g)throw new Error("Can\'t get an output name");b.push(g),y.push(a.UTF8ToString(g))}return s.set(i,[i,d,b]),[i,h,y]},e.createSession=function(t,n){var r=(0,e.createSessionAllocate)(t);return(0,e.createSessionFinalize)(r,n)},e.releaseSession=function(t){var e=(0,c.getInstance)(),n=s.get(t);if(!n)throw new Error("invalid session id");var r=n[0],a=n[1],i=n[2];a.forEach(e._OrtFree),i.forEach(e._OrtFree),e._OrtReleaseSession(r),s.delete(t)};var f=function(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: ".concat(t))}},l=function(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: ".concat(t))}};e.run=function(t,e,n,a,o){var p,h=(0,c.getInstance)(),d=s.get(t);if(!d)throw new Error("invalid session id");var y=d[0],b=d[1],m=d[2],v=e.length,g=a.length,w=0,_=[],O=[],S=[];try{w=(p=r((0,i.setRunOptions)(o),2))[0],_=p[1];for(var A=function(t){var e=n[t][0],r=n[t][1],a=n[t][2],i=void 0,o=void 0;if(Array.isArray(a)){o=4*a.length,i=h._malloc(o),S.push(i);for(var c=i/4,s=0;s<a.length;s++){if("string"!=typeof a[s])throw new TypeError("tensor data at index ".concat(s," is not a string"));h.HEAPU32[c++]=(0,u.allocWasmString)(a[s],S)}}else o=a.byteLength,i=h._malloc(o),S.push(i),h.HEAPU8.set(new Uint8Array(a.buffer,a.byteOffset,o),i);var f=h.stackSave(),l=h.stackAlloc(4*r.length);try{var p=l/4;r.forEach((function(t){return h.HEAP32[p++]=t}));var d=h._OrtCreateTensor(function(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: ".concat(t))}}(e),i,o,l,r.length);if(0===d)throw new Error("Can\'t create a tensor");O.push(d)}finally{h.stackRestore(f)}},T=0;T<v;T++)A(T);var E=h.stackSave(),M=h.stackAlloc(4*v),C=h.stackAlloc(4*v),x=h.stackAlloc(4*g),R=h.stackAlloc(4*g);try{var j=M/4,k=C/4,D=x/4,P=R/4;for(T=0;T<v;T++)h.HEAPU32[j++]=O[T],h.HEAPU32[k++]=b[e[T]];for(T=0;T<g;T++)h.HEAPU32[D++]=0,h.HEAPU32[P++]=m[a[T]];var U=h._OrtRun(y,C,M,v,R,g,x,w),F=[];if(0===U)for(T=0;T<g;T++){var I=h.HEAPU32[x/4+T],W=h.stackSave(),H=h.stackAlloc(16),L=void 0,z=0;try{if(0!==(U=h._OrtGetTensorData(I,H,H+4,H+8,H+12)))throw new Error("Can\'t access output tensor data. error code = ".concat(U));var Y=H/4,B=h.HEAPU32[Y++];z=h.HEAPU32[Y++];for(var G=h.HEAPU32[Y++],N=h.HEAPU32[Y++],V=[],q=0;q<N;q++)V.push(h.HEAPU32[G/4+q]);h._OrtFree(G);var X=0===V.length?1:V.reduce((function(t,e){return t*e}));if("string"===(L=f(B))){for(var J=[],Z=z/4,Q=0;Q<X;Q++){var $=h.HEAPU32[Z++],K=Q===X-1?void 0:h.HEAPU32[Z]-$;J.push(h.UTF8ToString($,K))}F.push([L,V,J])}else{var tt=new(l(L))(X);new Uint8Array(tt.buffer,tt.byteOffset,tt.byteLength).set(h.HEAPU8.subarray(z,z+tt.byteLength)),F.push([L,V,tt])}}finally{h.stackRestore(W),"string"===L&&z&&h._free(z),h._OrtReleaseTensor(I)}}if(0===U)return F;throw new Error("failed to call OrtRun(). error code = ".concat(U,"."))}finally{h.stackRestore(E)}}finally{O.forEach(h._OrtReleaseTensor),S.forEach(h._free),h._OrtReleaseRunOptions(w),_.forEach(h._free)}},e.endProfiling=function(t){var e=(0,c.getInstance)(),n=s.get(t);if(!n)throw new Error("invalid session id");var r=n[0],a=e._OrtEndProfiling(r);if(0===a)throw new Error("Can\'t get an profile file name");e._OrtFree(a)},e.extractTransferableBuffers=function(t){var e,n,r=[];try{for(var i=a(t),o=i.next();!o.done;o=i.next()){var u=o.value[2];!Array.isArray(u)&&u.buffer&&r.push(u.buffer)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}},361:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(e,n);a&&!("get"in a?!e.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,a)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),a=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return a(e,t),e},o=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(a,i){function o(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?a(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,u)}c((r=r.apply(t,e||[])).next())}))},u=this&&this.__generator||function(t,e){var n,r,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(u){return function(c){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&u[0]?r.return:u[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;switch(r=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(6===u[0]&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=e.call(t,o)}catch(t){u=[6,t],r=0}finally{n=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}},c=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.dispose=e.getInstance=e.initializeWebAssembly=void 0;var s,f=i(n(449)),l=c(n(932)),p=n(474),h=!1,d=!1,y=!1,b=function(t,e){return e?t?"ort-wasm-simd-threaded.wasm":"ort-wasm-threaded.wasm":t?"ort-wasm-simd.wasm":"ort-wasm.wasm"};e.initializeWebAssembly=function(t){return o(void 0,void 0,void 0,(function(){var e,r,a,i,o,c,m,v,g,w,_;return u(this,(function(u){switch(u.label){case 0:if(h)return[2,Promise.resolve()];if(d)throw new Error("multiple calls to \'initializeWebAssembly()\' detected.");if(y)throw new Error("previous call to \'initializeWebAssembly()\' failed.");return d=!0,e=t.initTimeout,r=t.numThreads,a=t.simd,i=r>1&&function(){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}}(),o=a&&function(){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}}(),c="string"==typeof t.wasmPaths?t.wasmPaths:void 0,m=b(!1,i),v=b(o,i),g="object"==typeof t.wasmPaths?t.wasmPaths[v]:void 0,w=!1,_=[],e>0&&_.push(new Promise((function(t){setTimeout((function(){w=!0,t()}),e)}))),_.push(new Promise((function(t,e){var r=i?p:l.default,a={locateFile:function(t,e){return i&&t.endsWith(".worker.js")&&"undefined"!=typeof Blob?URL.createObjectURL(new Blob([n(154)],{type:"text/javascript"})):t===m?null!=g?g:(null!=c?c:e)+v:e+t}};if(i)if("undefined"==typeof Blob)a.mainScriptUrlOrBlob=f.join("/","ort-wasm-threaded.js");else{var o="var ortWasmThreaded=(function(){var _scriptDir;return ".concat(r.toString(),"})();");a.mainScriptUrlOrBlob=new Blob([o],{type:"text/javascript"})}r(a).then((function(e){d=!1,h=!0,s=e,t()}),(function(t){d=!1,y=!0,e(t)}))}))),[4,Promise.race(_)];case 1:if(u.sent(),w)throw new Error("WebAssembly backend initializing failed due to timeout: ".concat(e,"ms"));return[2]}}))}))},e.getInstance=function(){if(h&&s)return s;throw new Error("WebAssembly is not initialized yet.")},e.dispose=function(){var t;!h||d||y||(d=!0,null===(t=s.PThread)||void 0===t||t.terminateAllThreads(),s=void 0,d=!1,h=!1,y=!0)}},154:function(t){"use strict";t.exports=\'"use strict";var e={},t="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node;if(t){var r=require("worker_threads"),a=r.parentPort;a.on("message",(e=>onmessage({data:e})));var o=require("fs");Object.assign(global,{self:global,require:require,Module:e,location:{href:__filename},Worker:r.Worker,importScripts:function(e){(0,eval)(o.readFileSync(e,"utf8"))},postMessage:function(e){a.postMessage(e)},performance:global.performance||{now:function(){return Date.now()}}})}var s=!1,n=[],i=function(){var e=Array.prototype.slice.call(arguments).join(" ");t?o.writeSync(2,e+"\\\\n"):console.error(e)};self.alert=function(){var t=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:t,threadId:e._pthread_self()})},e.instantiateWasm=(t,r)=>{var a=new WebAssembly.Instance(e.wasmModule,t);return r(a),e.wasmModule=null,a.exports},self.onunhandledrejection=e=>{throw e.reason??e},self.onmessage=t=>{try{if("load"===t.data.cmd){if(e.wasmModule=t.data.wasmModule,e.wasmMemory=t.data.wasmMemory,e.buffer=e.wasmMemory.buffer,e.ENVIRONMENT_IS_PTHREAD=!0,"string"==typeof t.data.urlOrBlob)importScripts(t.data.urlOrBlob);else{var r=URL.createObjectURL(t.data.urlOrBlob);importScripts(r),URL.revokeObjectURL(r)}ortWasmThreaded(e).then((function(t){e=t}))}else if("run"===t.data.cmd){e.__performance_now_clock_drift=performance.now()-t.data.time,e.__emscripten_thread_init(t.data.pthread_ptr,0,0,1),e.establishStackSpace(),e.PThread.receiveObjectTransfer(t.data),e.PThread.threadInitTLS(),s||(n.forEach((t=>{e.executeNotifiedProxyingQueue(t)})),n=[],s=!0);try{e.invokeEntryPoint(t.data.start_routine,t.data.arg)}catch(t){if("unwind"!=t){if(!(t instanceof e.ExitStatus))throw t;e.keepRuntimeAlive()||e.__emscripten_thread_exit(t.status)}}}else"cancel"===t.data.cmd?e._pthread_self()&&e.__emscripten_thread_exit(-1):"setimmediate"===t.data.target||("processProxyingQueue"===t.data.cmd?s?e.executeNotifiedProxyingQueue(t.data.queue):n.push(t.data.queue):(i("worker.js received unknown command "+t.data.cmd),i(t.data)))}catch(t){throw i("worker.js onmessage() captured an uncaught exception: "+t),t&&t.stack&&i(t.stack),e.__emscripten_thread_crashed&&e.__emscripten_thread_crashed(),t}};\\n\'},384:function(){},993:function(){},908:function(){},953:function(){},925:function(){},449:function(){}},e={};function n(r){var a=e[r];if(void 0!==a)return a.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),function(){"use strict";var t=n(349),e=n(361);self.onmessage=function(n){switch(n.data.type){case"init-wasm":(0,e.initializeWebAssembly)(n.data.in).then((function(){return postMessage({type:"init-wasm"})}),(function(t){return postMessage({type:"init-wasm",err:t})}));break;case"init-ort":try{var r=n.data.in,a=r.numThreads,i=r.loggingLevel;(0,t.initOrt)(a,i),postMessage({type:"init-ort"})}catch(t){postMessage({type:"init-ort",err:t})}break;case"create_allocate":try{var o=n.data.in.model,u=(0,t.createSessionAllocate)(o);postMessage({type:"create_allocate",out:u})}catch(t){postMessage({type:"create_allocate",err:t})}break;case"create_finalize":try{var c=n.data.in,s=(u=c.modeldata,c.options),f=(0,t.createSessionFinalize)(u,s);postMessage({type:"create_finalize",out:f})}catch(t){postMessage({type:"create_finalize",err:t})}break;case"create":try{var l=n.data.in;o=l.model,s=l.options,f=(0,t.createSession)(o,s),postMessage({type:"create",out:f})}catch(t){postMessage({type:"create",err:t})}break;case"release":try{var p=n.data.in;(0,t.releaseSession)(p),postMessage({type:"release"})}catch(t){postMessage({type:"release",err:t})}break;case"run":try{var h=n.data.in,d=h.sessionId,y=h.inputIndices,b=h.inputs,m=h.outputIndices,v=(s=h.options,(0,t.run)(d,y,b,m,s));postMessage({type:"run",out:v},(0,t.extractTransferableBuffers)(v))}catch(t){postMessage({type:"run",err:t})}break;case"end-profiling":try{p=n.data.in,(0,t.endProfiling)(p),postMessage({type:"end-profiling"})}catch(t){postMessage({type:"end-profiling",err:t})}}}}()}();\n',"Worker",void 0,void 0)}},477:function(t){"use strict";t.exports=function(t,e,n,r){var o=self||window;try{try{var i;try{i=new o.Blob([t])}catch(e){(i=new(o.BlobBuilder||o.WebKitBlobBuilder||o.MozBlobBuilder||o.MSBlobBuilder)).append(t),i=i.getBlob()}var a=o.URL||o.webkitURL,s=a.createObjectURL(i),u=new o[e](s,n);return a.revokeObjectURL(s),u}catch(r){return new o[e]("data:application/javascript,".concat(encodeURIComponent(t)),n)}}catch(t){if(!r)throw Error("Inline worker is not supported");return new o[e](r,n)}}},4154:function(t){"use strict";t.exports='"use strict";var e={},t="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node;if(t){var r=require("worker_threads"),a=r.parentPort;a.on("message",(e=>onmessage({data:e})));var o=require("fs");Object.assign(global,{self:global,require:require,Module:e,location:{href:__filename},Worker:r.Worker,importScripts:function(e){(0,eval)(o.readFileSync(e,"utf8"))},postMessage:function(e){a.postMessage(e)},performance:global.performance||{now:function(){return Date.now()}}})}var s=!1,n=[],i=function(){var e=Array.prototype.slice.call(arguments).join(" ");t?o.writeSync(2,e+"\\n"):console.error(e)};self.alert=function(){var t=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:t,threadId:e._pthread_self()})},e.instantiateWasm=(t,r)=>{var a=new WebAssembly.Instance(e.wasmModule,t);return r(a),e.wasmModule=null,a.exports},self.onunhandledrejection=e=>{throw e.reason??e},self.onmessage=t=>{try{if("load"===t.data.cmd){if(e.wasmModule=t.data.wasmModule,e.wasmMemory=t.data.wasmMemory,e.buffer=e.wasmMemory.buffer,e.ENVIRONMENT_IS_PTHREAD=!0,"string"==typeof t.data.urlOrBlob)importScripts(t.data.urlOrBlob);else{var r=URL.createObjectURL(t.data.urlOrBlob);importScripts(r),URL.revokeObjectURL(r)}ortWasmThreaded(e).then((function(t){e=t}))}else if("run"===t.data.cmd){e.__performance_now_clock_drift=performance.now()-t.data.time,e.__emscripten_thread_init(t.data.pthread_ptr,0,0,1),e.establishStackSpace(),e.PThread.receiveObjectTransfer(t.data),e.PThread.threadInitTLS(),s||(n.forEach((t=>{e.executeNotifiedProxyingQueue(t)})),n=[],s=!0);try{e.invokeEntryPoint(t.data.start_routine,t.data.arg)}catch(t){if("unwind"!=t){if(!(t instanceof e.ExitStatus))throw t;e.keepRuntimeAlive()||e.__emscripten_thread_exit(t.status)}}}else"cancel"===t.data.cmd?e._pthread_self()&&e.__emscripten_thread_exit(-1):"setimmediate"===t.data.target||("processProxyingQueue"===t.data.cmd?s?e.executeNotifiedProxyingQueue(t.data.queue):n.push(t.data.queue):(i("worker.js received unknown command "+t.data.cmd),i(t.data)))}catch(t){throw i("worker.js onmessage() captured an uncaught exception: "+t),t&&t.stack&&i(t.stack),e.__emscripten_thread_crashed&&e.__emscripten_thread_crashed(),t}};\n'},7067:function(){},1296:function(){},1384:function(){},3993:function(){},908:function(){},6953:function(){},9925:function(){},2806:function(){},6449:function(){},2850:function(){},5381:function(){},5686:function(t,e,n){"use strict";n.r(e),n.d(e,{flatbuffers:function(){return r}});var r={};r.Offset,r.Table,r.SIZEOF_SHORT=2,r.SIZEOF_INT=4,r.FILE_IDENTIFIER_LENGTH=4,r.SIZE_PREFIX_LENGTH=4,r.Encoding={UTF8_BYTES:1,UTF16_STRING:2},r.int32=new Int32Array(2),r.float32=new Float32Array(r.int32.buffer),r.float64=new Float64Array(r.int32.buffer),r.isLittleEndian=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0],r.Long=function(t,e){this.low=0|t,this.high=0|e},r.Long.create=function(t,e){return 0==t&&0==e?r.Long.ZERO:new r.Long(t,e)},r.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},r.Long.prototype.equals=function(t){return this.low==t.low&&this.high==t.high},r.Long.ZERO=new r.Long(0,0),r.Builder=function(t){if(t)e=t;else var e=1024;this.bb=r.ByteBuffer.allocate(e),this.space=e,this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},r.Builder.prototype.clear=function(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},r.Builder.prototype.forceDefaults=function(t){this.force_defaults=t},r.Builder.prototype.dataBuffer=function(){return this.bb},r.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},r.Builder.prototype.prep=function(t,e){t>this.minalign&&(this.minalign=t);for(var n=1+~(this.bb.capacity()-this.space+e)&t-1;this.space<n+t+e;){var o=this.bb.capacity();this.bb=r.Builder.growByteBuffer(this.bb),this.space+=this.bb.capacity()-o}this.pad(n)},r.Builder.prototype.pad=function(t){for(var e=0;e<t;e++)this.bb.writeInt8(--this.space,0)},r.Builder.prototype.writeInt8=function(t){this.bb.writeInt8(this.space-=1,t)},r.Builder.prototype.writeInt16=function(t){this.bb.writeInt16(this.space-=2,t)},r.Builder.prototype.writeInt32=function(t){this.bb.writeInt32(this.space-=4,t)},r.Builder.prototype.writeInt64=function(t){this.bb.writeInt64(this.space-=8,t)},r.Builder.prototype.writeFloat32=function(t){this.bb.writeFloat32(this.space-=4,t)},r.Builder.prototype.writeFloat64=function(t){this.bb.writeFloat64(this.space-=8,t)},r.Builder.prototype.addInt8=function(t){this.prep(1,0),this.writeInt8(t)},r.Builder.prototype.addInt16=function(t){this.prep(2,0),this.writeInt16(t)},r.Builder.prototype.addInt32=function(t){this.prep(4,0),this.writeInt32(t)},r.Builder.prototype.addInt64=function(t){this.prep(8,0),this.writeInt64(t)},r.Builder.prototype.addFloat32=function(t){this.prep(4,0),this.writeFloat32(t)},r.Builder.prototype.addFloat64=function(t){this.prep(8,0),this.writeFloat64(t)},r.Builder.prototype.addFieldInt8=function(t,e,n){(this.force_defaults||e!=n)&&(this.addInt8(e),this.slot(t))},r.Builder.prototype.addFieldInt16=function(t,e,n){(this.force_defaults||e!=n)&&(this.addInt16(e),this.slot(t))},r.Builder.prototype.addFieldInt32=function(t,e,n){(this.force_defaults||e!=n)&&(this.addInt32(e),this.slot(t))},r.Builder.prototype.addFieldInt64=function(t,e,n){!this.force_defaults&&e.equals(n)||(this.addInt64(e),this.slot(t))},r.Builder.prototype.addFieldFloat32=function(t,e,n){(this.force_defaults||e!=n)&&(this.addFloat32(e),this.slot(t))},r.Builder.prototype.addFieldFloat64=function(t,e,n){(this.force_defaults||e!=n)&&(this.addFloat64(e),this.slot(t))},r.Builder.prototype.addFieldOffset=function(t,e,n){(this.force_defaults||e!=n)&&(this.addOffset(e),this.slot(t))},r.Builder.prototype.addFieldStruct=function(t,e,n){e!=n&&(this.nested(e),this.slot(t))},r.Builder.prototype.nested=function(t){if(t!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")},r.Builder.prototype.notNested=function(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")},r.Builder.prototype.slot=function(t){this.vtable[t]=this.offset()},r.Builder.prototype.offset=function(){return this.bb.capacity()-this.space},r.Builder.growByteBuffer=function(t){var e=t.capacity();if(3221225472&e)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");var n=e<<1,o=r.ByteBuffer.allocate(n);return o.setPosition(n-e),o.bytes().set(t.bytes(),n-e),o},r.Builder.prototype.addOffset=function(t){this.prep(r.SIZEOF_INT,0),this.writeInt32(this.offset()-t+r.SIZEOF_INT)},r.Builder.prototype.startObject=function(t){this.notNested(),null==this.vtable&&(this.vtable=[]),this.vtable_in_use=t;for(var e=0;e<t;e++)this.vtable[e]=0;this.isNested=!0,this.object_start=this.offset()},r.Builder.prototype.endObject=function(){if(null==this.vtable||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);for(var t=this.offset(),e=this.vtable_in_use-1;e>=0&&0==this.vtable[e];e--);for(var n=e+1;e>=0;e--)this.addInt16(0!=this.vtable[e]?t-this.vtable[e]:0);this.addInt16(t-this.object_start);var o=(n+2)*r.SIZEOF_SHORT;this.addInt16(o);var i=0,a=this.space;t:for(e=0;e<this.vtables.length;e++){var s=this.bb.capacity()-this.vtables[e];if(o==this.bb.readInt16(s)){for(var u=r.SIZEOF_SHORT;u<o;u+=r.SIZEOF_SHORT)if(this.bb.readInt16(a+u)!=this.bb.readInt16(s+u))continue t;i=this.vtables[e];break}}return i?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,i-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t},r.Builder.prototype.finish=function(t,e,n){var o=n?r.SIZE_PREFIX_LENGTH:0;if(e){var i=e;if(this.prep(this.minalign,r.SIZEOF_INT+r.FILE_IDENTIFIER_LENGTH+o),i.length!=r.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+r.FILE_IDENTIFIER_LENGTH);for(var a=r.FILE_IDENTIFIER_LENGTH-1;a>=0;a--)this.writeInt8(i.charCodeAt(a))}this.prep(this.minalign,r.SIZEOF_INT+o),this.addOffset(t),o&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},r.Builder.prototype.finishSizePrefixed=function(t,e){this.finish(t,e,!0)},r.Builder.prototype.requiredField=function(t,e){var n=this.bb.capacity()-t,r=n-this.bb.readInt32(n);if(0==this.bb.readInt16(r+e))throw new Error("FlatBuffers: field "+e+" must be set")},r.Builder.prototype.startVector=function(t,e,n){this.notNested(),this.vector_num_elems=e,this.prep(r.SIZEOF_INT,t*e),this.prep(n,t*e)},r.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},r.Builder.prototype.createString=function(t){if(t instanceof Uint8Array)var e=t;else{e=[];for(var n=0;n<t.length;){var r,o=t.charCodeAt(n++);(r=o<55296||o>=56320?o:(o<<10)+t.charCodeAt(n++)+-56613888)<128?e.push(r):(r<2048?e.push(r>>6&31|192):(r<65536?e.push(r>>12&15|224):e.push(r>>18&7|240,r>>12&63|128),e.push(r>>6&63|128)),e.push(63&r|128))}}this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),n=0;for(var i=this.space,a=this.bb.bytes();n<e.length;n++)a[i++]=e[n];return this.endVector()},r.Builder.prototype.createLong=function(t,e){return r.Long.create(t,e)},r.ByteBuffer=function(t){this.bytes_=t,this.position_=0},r.ByteBuffer.allocate=function(t){return new r.ByteBuffer(new Uint8Array(t))},r.ByteBuffer.prototype.clear=function(){this.position_=0},r.ByteBuffer.prototype.bytes=function(){return this.bytes_},r.ByteBuffer.prototype.position=function(){return this.position_},r.ByteBuffer.prototype.setPosition=function(t){this.position_=t},r.ByteBuffer.prototype.capacity=function(){return this.bytes_.length},r.ByteBuffer.prototype.readInt8=function(t){return this.readUint8(t)<<24>>24},r.ByteBuffer.prototype.readUint8=function(t){return this.bytes_[t]},r.ByteBuffer.prototype.readInt16=function(t){return this.readUint16(t)<<16>>16},r.ByteBuffer.prototype.readUint16=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8},r.ByteBuffer.prototype.readInt32=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24},r.ByteBuffer.prototype.readUint32=function(t){return this.readInt32(t)>>>0},r.ByteBuffer.prototype.readInt64=function(t){return new r.Long(this.readInt32(t),this.readInt32(t+4))},r.ByteBuffer.prototype.readUint64=function(t){return new r.Long(this.readUint32(t),this.readUint32(t+4))},r.ByteBuffer.prototype.readFloat32=function(t){return r.int32[0]=this.readInt32(t),r.float32[0]},r.ByteBuffer.prototype.readFloat64=function(t){return r.int32[r.isLittleEndian?0:1]=this.readInt32(t),r.int32[r.isLittleEndian?1:0]=this.readInt32(t+4),r.float64[0]},r.ByteBuffer.prototype.writeInt8=function(t,e){this.bytes_[t]=e},r.ByteBuffer.prototype.writeUint8=function(t,e){this.bytes_[t]=e},r.ByteBuffer.prototype.writeInt16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},r.ByteBuffer.prototype.writeUint16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},r.ByteBuffer.prototype.writeInt32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},r.ByteBuffer.prototype.writeUint32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},r.ByteBuffer.prototype.writeInt64=function(t,e){this.writeInt32(t,e.low),this.writeInt32(t+4,e.high)},r.ByteBuffer.prototype.writeUint64=function(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)},r.ByteBuffer.prototype.writeFloat32=function(t,e){r.float32[0]=e,this.writeInt32(t,r.int32[0])},r.ByteBuffer.prototype.writeFloat64=function(t,e){r.float64[0]=e,this.writeInt32(t,r.int32[r.isLittleEndian?0:1]),this.writeInt32(t+4,r.int32[r.isLittleEndian?1:0])},r.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+r.SIZEOF_INT+r.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var t="",e=0;e<r.FILE_IDENTIFIER_LENGTH;e++)t+=String.fromCharCode(this.readInt8(this.position_+r.SIZEOF_INT+e));return t},r.ByteBuffer.prototype.__offset=function(t,e){var n=t-this.readInt32(t);return e<this.readInt16(n)?this.readInt16(n+e):0},r.ByteBuffer.prototype.__union=function(t,e){return t.bb_pos=e+this.readInt32(e),t.bb=this,t},r.ByteBuffer.prototype.__string=function(t,e){t+=this.readInt32(t);var n=this.readInt32(t),o="",i=0;if(t+=r.SIZEOF_INT,e===r.Encoding.UTF8_BYTES)return this.bytes_.subarray(t,t+n);for(;i<n;){var a,s=this.readUint8(t+i++);if(s<192)a=s;else{var u=this.readUint8(t+i++);if(s<224)a=(31&s)<<6|63&u;else{var c=this.readUint8(t+i++);a=s<240?(15&s)<<12|(63&u)<<6|63&c:(7&s)<<18|(63&u)<<12|(63&c)<<6|63&this.readUint8(t+i++)}}a<65536?o+=String.fromCharCode(a):(a-=65536,o+=String.fromCharCode(55296+(a>>10),56320+(1023&a)))}return o},r.ByteBuffer.prototype.__indirect=function(t){return t+this.readInt32(t)},r.ByteBuffer.prototype.__vector=function(t){return t+this.readInt32(t)+r.SIZEOF_INT},r.ByteBuffer.prototype.__vector_len=function(t){return this.readInt32(t+this.readInt32(t))},r.ByteBuffer.prototype.__has_identifier=function(t){if(t.length!=r.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+r.FILE_IDENTIFIER_LENGTH);for(var e=0;e<r.FILE_IDENTIFIER_LENGTH;e++)if(t.charCodeAt(e)!=this.readInt8(this.position_+r.SIZEOF_INT+e))return!1;return!0},r.ByteBuffer.prototype.createLong=function(t,e){return r.Long.create(t,e)}}},__webpack_module_cache__={};function __webpack_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var n=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t].call(n.exports,n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return __webpack_require__.d(e,{a:e}),e},__webpack_require__.d=function(t,e){for(var n in e)__webpack_require__.o(e,n)&&!__webpack_require__.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),__webpack_require__.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},__webpack_require__.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var __webpack_exports__=__webpack_require__(6018);return __webpack_exports__}()}));
|
||
//# sourceMappingURL=ort.es5.min.js.map
|