scanbot-web-sdk 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/ScanbotSDK.min.js +1 -1
- package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
- package/bundle/bin/barcode-scanner/ScanbotSDK.Asm.wasm +0 -0
- package/bundle/bin/barcode-scanner/ScanbotSDK.Asm.wasm-webpack-file-loader +0 -0
- package/bundle/bin/barcode-scanner/ScanbotSDK.Core-simd.js +1 -1
- package/bundle/bin/barcode-scanner/ScanbotSDK.Core.js +1 -1
- package/bundle/bin/complete/ScanbotSDK.Asm-simd.wasm +0 -0
- package/bundle/bin/complete/ScanbotSDK.Asm-simd.wasm-webpack-file-loader +0 -0
- package/bundle/bin/complete/ScanbotSDK.Asm.wasm +0 -0
- package/bundle/bin/complete/ScanbotSDK.Asm.wasm-webpack-file-loader +0 -0
- package/bundle/bin/complete/ScanbotSDK.Core-simd.js +1 -1
- package/bundle/bin/complete/ScanbotSDK.Core.js +1 -1
- package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
- package/bundle/bin/document-scanner/ScanbotSDK.Asm.wasm +0 -0
- package/bundle/bin/document-scanner/ScanbotSDK.Asm.wasm-webpack-file-loader +0 -0
- package/bundle/bin/document-scanner/ScanbotSDK.Core-simd.js +1 -1
- package/bundle/bin/document-scanner/ScanbotSDK.Core.js +1 -1
- package/package.json +2 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see ScanbotSDK.Core-simd.js.LICENSE.txt */
|
|
2
|
-
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=124)}([function(e,t,n){"use strict";n.d(t,"d",(function(){return a})),n.d(t,"e",(function(){return s})),n.d(t,"f",(function(){return o})),n.d(t,"b",(function(){return i})),n.d(t,"g",(function(){return c})),n.d(t,"c",(function(){return l})),n.d(t,"a",(function(){return d}));var r=n(5);function a(e,t,n,a,o){const i=t.inputParams[e];if(i&&void 0!==i.inputIndexStart){const e=i.inputIndexStart,u=0===i.inputIndexEnd?void 0:void 0===i.inputIndexEnd?e+1:i.inputIndexEnd,c=e<0?t.inputNames.length+e:e;if("tensor"===i.type)return s(t.inputNames[c],n,a,o);if("tensors"===i.type){const r=t.inputs.slice(e,u);return t.inputNames.slice(e,u).filter(((e,t)=>{var n;return"NoOp"!==(null===(n=r[t])||void 0===n?void 0:n.op)})).map((e=>s(e,n,a,o)))}const l=s(t.inputNames[c],n,a,o),d=l.dataSync();return"number"===i.type?d[0]:r.util.toNestedArray(l.shape,d)}const u=t.attrParams[e];return u&&u.value}function s(e,t,n,r){const[a,s]=c(e,n);if(null!=r){const e=r.getHashTableHandleByName(a);if(null!=e)return e}const o=n.currentContextIds.find((e=>!!t[u(a,e)]));return void 0!==o?t[u(a,o)][s]:void 0}function o(e,t,n){return t[u(e,n.currentContextId)]}function i(e,t){const[n,r,a]=c(e,t);return[u(n,t&&t.currentContextId),r,a]}function u(e,t){return t?`${e}-${t}`:e}function c(e,t){if(""===e)return["",0,void 0];const n=null!=t&&null!=t.parseNodeNameCache;if(n){const n=t.parseNodeNameCache.get(e);if(null!=n)return n}const r=e.split(":");let a;if(1===r.length)a=[e,0,void 0];else{const e=r[0],t=3===r.length?r[1]:void 0;a=[e,Number(r[r.length-1]),t]}return n&&t.parseNodeNameCache.set(e,a),a}function l(e,t,n){let r=a("pad",e,t,n);if("explicit"===r){r=a("explicitPaddings",e,t,n);const s=[[0,0],[0,0],[0,0],[0,0]];for(let e=0;e<4;e++)s[e][0]=r[2*e],s[e][1]=r[2*e+1];return s}return r}function d(e){return e.kept?e:Object(r.clone)(e)}},function(e,t,n){"use strict";n.d(t,"c",(function(){return c})),n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return f}));var r=n(3),a=n(11),s=n(17),o=n(32),i=n(6),u=n(8);function c(e,t){let n=e;if(Object(i.isTypedArray)(e))return"string"===t?[]:[e.length];if(Object(o.b)(e)){const t=e.channels||"RGBA";return[e.height,e.width*t.length]}if(Object(o.c)(e))return[e.buffer.size/(null==t?4:Object(u.h)(t))];if(!Array.isArray(e))return[];const r=[];for(;Array.isArray(n)||Object(i.isTypedArray)(n)&&"string"!==t;)r.push(n.length),n=n[0];return Array.isArray(e)&&Object(a.c)().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&l(e,r,[]),r}function l(e,t,n){if(n=n||[],!Array.isArray(e)&&!Object(i.isTypedArray)(e))return void Object(u.c)(0===t.length,(()=>`Element arr[${n.join("][")}] is a primitive, but should be an array/TypedArray of ${t[0]} elements`));Object(u.c)(t.length>0,(()=>`Element arr[${n.join("][")}] should be a primitive, but is an array of ${e.length} elements`)),Object(u.c)(e.length===t[0],(()=>`Element arr[${n.join("][")}] should have ${t[0]} elements, but has ${e.length} elements`));const r=t.slice(1);for(let t=0;t<e.length;++t)l(e[t],r,n.concat(t))}function d(e,t,n,r){if("string_or_numeric"!==e){if(null==e)throw new Error("Expected dtype cannot be null.");if("numeric"!==e&&e!==t||"numeric"===e&&"string"===t)throw new Error(`Argument '${n}' passed to '${r}' must be ${e} tensor, but got ${t} tensor`)}}function p(e,t,n,a="numeric"){if(e instanceof s.a)return d(a,e.dtype,t,n),e;let o=Object(u.s)(e);if("string"!==o&&["bool","int32","float32"].indexOf(a)>=0&&(o=a),d(a,o,t,n),null==e||!Object(i.isTypedArray)(e)&&!Array.isArray(e)&&"number"!=typeof e&&"boolean"!=typeof e&&"string"!=typeof e){const r=null==e?"null":e.constructor.name;throw new Error(`Argument '${t}' passed to '${n}' must be a Tensor or TensorLike, but got '${r}'`)}const l=c(e,o);Object(i.isTypedArray)(e)||Array.isArray(e)||(e=[e]);const p="string"!==o?Object(i.toTypedArray)(e,o):Object(i.flatten)(e,[],!0);return r.a.makeTensor(p,l,o)}function f(e,t,n,r="numeric"){if(!Array.isArray(e))throw new Error(`Argument ${t} passed to ${n} must be a \`Tensor[]\` or \`TensorLike[]\``);return e.map(((e,a)=>p(e,`${t}[${a}]`,n,r)))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return o}));var r=n(3),a=n(8);const s="__op";function o(e){const t=Object.keys(e);if(1!==t.length)throw new Error(`Please provide an object with a single key (operation name) mapping to a function. Got an object with ${t.length} keys.`);let n=t[0];const o=e[n];n.endsWith("_")&&(n=n.substring(0,n.length-1)),n+=s;const i=(...e)=>{r.a.startScope(n);try{const t=o(...e);return Object(a.y)(t)&&console.error("Cannot return a Promise inside of tidy."),r.a.endScope(t),t}catch(e){throw r.a.endScope(null),e}};return Object.defineProperty(i,"name",{value:n,configurable:!0}),i}},function(e,t,n){"use strict";n.d(t,"b",(function(){return g})),n.d(t,"a",(function(){return y}));var r=n(64),a=n(11),s=n(56),o=n(4),i=n(38),u=n(41),c=n(89),l=n(8);var d=n(17),p=n(12),f=n(6);function h(e){return null!=e.kernelName}class m{constructor(){this.registeredVariables={},this.nextTapeNodeId=0,this.numBytes=0,this.numTensors=0,this.numStringTensors=0,this.numDataBuffers=0,this.gradientDepth=0,this.kernelDepth=0,this.scopeStack=[],this.numDataMovesStack=[],this.nextScopeId=0,this.tensorInfo=new WeakMap,this.profiling=!1,this.activeProfile={newBytes:0,newTensors:0,peakBytes:0,kernels:[],result:null,get kernelNames(){return Array.from(new Set(this.kernels.map((e=>e.name))))}}}dispose(){for(const e in this.registeredVariables)this.registeredVariables[e].dispose()}}class b{constructor(e){this.ENV=e,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new m}async ready(){if(null!=this.pendingBackendInit)return this.pendingBackendInit.then((()=>{}));if(null!=this.backendInstance)return;const e=this.getSortedBackends();for(let t=0;t<e.length;t++){const n=e[t];if(await this.initializeBackend(n).success)return void await this.setBackend(n)}throw new Error("Could not initialize any backends, all backend initializations failed.")}get backend(){if(null!=this.pendingBackendInit)throw new Error(`Backend '${this.backendName}' has not yet been initialized. Make sure to await tf.ready() or await tf.setBackend() before calling other methods`);if(null==this.backendInstance){const{name:e,asyncInit:t}=this.initializeBackendsAndReturnBest();if(t)throw new Error(`The highest priority backend '${e}' has not yet been initialized. Make sure to await tf.ready() or await tf.setBackend() before calling other methods`);this.setBackend(e)}return this.backendInstance}backendNames(){return Object.keys(this.registryFactory)}findBackend(e){if(!(e in this.registry)){if(!(e in this.registryFactory))return null;{const{asyncInit:t}=this.initializeBackend(e);if(t)return null}}return this.registry[e]}findBackendFactory(e){return e in this.registryFactory?this.registryFactory[e].factory:null}registerBackend(e,t,n=1){return e in this.registryFactory?(u.b(`${e} backend was already registered. Reusing existing backend factory.`),!1):(this.registryFactory[e]={factory:t,priority:n},!0)}async setBackend(e){if(null==this.registryFactory[e])throw new Error(`Backend name '${e}' not found in registry`);if(this.backendName=e,null==this.registry[e]){this.backendInstance=null;const{success:t,asyncInit:n}=this.initializeBackend(e);if(!(n?await t:t))return!1}return this.backendInstance=this.registry[e],this.setupRegisteredKernels(),this.profiler=new c.Profiler(this.backendInstance),!0}setupRegisteredKernels(){Object(i.d)(this.backendName).forEach((e=>{null!=e.setupFunc&&e.setupFunc(this.backendInstance)}))}disposeRegisteredKernels(e){Object(i.d)(e).forEach((t=>{null!=t.disposeFunc&&t.disposeFunc(this.registry[e])}))}initializeBackend(e){const t=this.registryFactory[e];if(null==t)throw new Error(`Cannot initialize backend ${e}, no registration found.`);try{const n=t.factory();if(!n||n instanceof r.b||"function"!=typeof n.then)return this.registry[e]=n,{success:!0,asyncInit:!1};{const t=++this.pendingBackendInitId,r=n.then((n=>!(t<this.pendingBackendInitId)&&(this.registry[e]=n,this.pendingBackendInit=null,!0))).catch((n=>(t<this.pendingBackendInitId||(this.pendingBackendInit=null,u.b(`Initialization of backend ${e} failed`),u.b(n.stack||n.message)),!1)));return this.pendingBackendInit=r,{success:r,asyncInit:!0}}}catch(t){return u.b(`Initialization of backend ${e} failed`),u.b(t.stack||t.message),{success:!1,asyncInit:!1}}}removeBackend(e){if(!(e in this.registryFactory))throw new Error(`${e} backend not found in registry`);this.backendName===e&&null!=this.pendingBackendInit&&this.pendingBackendInitId++,e in this.registry&&(this.disposeRegisteredKernels(e),this.registry[e].dispose(),delete this.registry[e]),delete this.registryFactory[e],this.backendName===e&&(this.pendingBackendInit=null,this.backendName=null,this.backendInstance=null)}getSortedBackends(){if(0===Object.keys(this.registryFactory).length)throw new Error("No backend found in registry.");return Object.keys(this.registryFactory).sort(((e,t)=>this.registryFactory[t].priority-this.registryFactory[e].priority))}initializeBackendsAndReturnBest(){const e=this.getSortedBackends();for(let t=0;t<e.length;t++){const n=e[t],{success:r,asyncInit:a}=this.initializeBackend(n);if(a||r)return{name:n,asyncInit:a}}throw new Error("Could not initialize any backends, all backend initializations failed.")}moveData(e,t){const n=this.state.tensorInfo.get(t),r=n.backend,a=this.readSync(t),s=r.refCount(t);r.disposeData(t,!0),n.backend=e,e.move(t,a,n.shape,n.dtype,s),this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack[this.state.numDataMovesStack.length-1]++}tidy(e,t){let n,r=null;if(null==t){if("function"!=typeof e)throw new Error("Please provide a function to tidy()");t=e}else{if("string"!=typeof e&&!(e instanceof String))throw new Error("When calling with two arguments, the first argument to tidy() must be a string");if("function"!=typeof t)throw new Error("When calling with two arguments, the 2nd argument to tidy() must be a function");r=e}return this.scopedRun((()=>this.startScope(r)),(()=>this.endScope(n)),(()=>(n=t(),n instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),n)))}scopedRun(e,t,n){e();try{const e=n();return t(),e}catch(e){throw t(),e}}nextTensorId(){return b.nextTensorId++}nextVariableId(){return b.nextVariableId++}clone(e){const t=y.runKernel(o.vb,{x:e}),n={x:e};return this.addTapeNode(this.state.activeScope.name,n,[t],(e=>({x:()=>{const t={x:e},n={dtype:"float32"};return y.runKernel(o.y,t,n)}})),[],{}),t}runKernel(e,t,n){null==this.backendName&&this.backend;if(!(null!=Object(i.c)(e,this.backendName)))throw new Error(`Kernel '${e}' not registered for backend '${this.backendName}'`);return this.runKernelFunc({kernelName:e,inputs:t,attrs:n})}shouldCheckForMemLeaks(){return this.ENV.getBool("IS_TEST")}checkKernelForMemLeak(e,t,n){const r=this.backend.numDataIds();let a=0;n.forEach((e=>{a+="complex64"===e.dtype?3:1}));const s=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],o=r-t-a-s;if(o>0)throw new Error(`Backend '${this.backendName}' has an internal memory leak (${o} data ids) after running '${e}'`)}runKernelFunc(e){let t,n=[];const r=this.isTapeOn(),a=this.state.numBytes,s=this.state.numTensors;let o,u;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0),null==this.backendName&&this.backend;const c=h(e)?e.kernelName:null!=this.state.activeScope?this.state.activeScope.name:"";if(h(e)){const{kernelName:t,inputs:a,attrs:s}=e;null==this.backendName&&this.backend;const c=Object(i.c)(t,this.backendName);l.c(null!=c,(()=>`Cannot find registered kernel '${t}' for backend '${this.backendName}'`)),o=()=>{const e=this.backend.numDataIds();u=c.kernelFunc({inputs:a,attrs:s,backend:this.backend});const o=Array.isArray(u)?u:[u];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(t,e,o);const i=o.map((e=>null!=e.rank?e:this.makeTensorFromTensorInfo(e)));if(r){const e=this.getTensorsForGradient(t,a,i);n=this.saveTensorsForBackwardMode(e)}return i}}else{const{forwardFunc:t}=e,a=e=>{r&&(n=e.map((e=>this.keep(this.clone(e)))))};o=()=>{const e=this.backend.numDataIds();u=this.tidy((()=>t(this.backend,a)));const n=Array.isArray(u)?u:[u];return this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(c,e,n),n}}const{inputs:d,attrs:p}=e,f=h(e)?null:e.backwardsFunc;let m;return this.scopedRun((()=>this.state.kernelDepth++),(()=>this.state.kernelDepth--),(()=>{this.ENV.getBool("DEBUG")||this.state.profiling?(m=this.profiler.profileKernel(c,d,(()=>o())),this.ENV.getBool("DEBUG")&&this.profiler.logKernelProfile(m),t=m.outputs):t=o()})),r&&this.addTapeNode(c,d,t,f,n,p),this.state.profiling&&this.state.activeProfile.kernels.push({name:c,bytesAdded:this.state.numBytes-a,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-s,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(d).map((e=>null!=d[e]?d[e].shape:null)),outputShapes:t.map((e=>e.shape)),kernelTimeMs:m.timeMs,extraInfo:m.extraInfo}),Array.isArray(u)?t:t[0]}saveTensorsForBackwardMode(e){const t=e.map((e=>this.keep(this.clone(e))));return t}getTensorsForGradient(e,t,n){const r=Object(i.b)(e);if(null!=r){const e=r.inputsToSave||[],a=r.outputsToSave||[];let s;r.saveAllInputs?(l.c(Array.isArray(t),(()=>"saveAllInputs is true, expected inputs to be an array.")),s=Object.keys(t).map((e=>t[e]))):s=e.map((e=>t[e]));const o=n.filter(((e,t)=>a[t]));return s.concat(o)}return[]}makeTensor(e,t,n,r){if(null==e)throw new Error("Values passed to engine.makeTensor() are null");n=n||"float32",r=r||this.backend;let a=e;"string"===n&&l.A(e[0])&&(a=e.map((e=>f.encodeString(e))));const s=r.write(a,t,n),o=new d.a(t,n,s,this.nextTensorId());if(this.trackTensor(o,r),"string"===n){const e=this.state.tensorInfo.get(s),t=Object(l.g)(a);this.state.numBytes+=t-e.bytes,e.bytes=t}return o}makeTensorFromDataId(e,t,n,r){const a={dataId:e,shape:t,dtype:n=n||"float32"};return this.makeTensorFromTensorInfo(a,r)}makeTensorFromTensorInfo(e,t){const{dataId:n,shape:r,dtype:a}=e,s=new d.a(r,a,n,this.nextTensorId());return this.trackTensor(s,t),s}makeVariable(e,t=!0,n,r){n=n||this.nextVariableId().toString(),null!=r&&r!==e.dtype&&(e=e.cast(r));const a=new d.c(e,t,n,this.nextTensorId());if(null!=this.state.registeredVariables[a.name])throw new Error(`Variable with name ${a.name} was already registered`);return this.state.registeredVariables[a.name]=a,this.incRef(a,this.backend),a}trackTensor(e,t){this.state.numTensors++,"string"===e.dtype&&this.state.numStringTensors++;let n=0;"complex64"!==e.dtype&&"string"!==e.dtype&&(n=e.size*l.h(e.dtype)),this.state.numBytes+=n,this.state.tensorInfo.has(e.dataId)||(this.state.numDataBuffers++,this.state.tensorInfo.set(e.dataId,{backend:t||this.backend,dtype:e.dtype,shape:e.shape,bytes:n})),e instanceof d.c||this.track(e)}incRef(e,t){this.trackTensor(e,t),this.backend.incRef(e.dataId)}removeDataId(e,t){this.state.tensorInfo.has(e)&&this.state.tensorInfo.get(e).backend===t&&(this.state.tensorInfo.delete(e),this.state.numDataBuffers--)}disposeTensor(e){if(!this.state.tensorInfo.has(e.dataId))return;const t=this.state.tensorInfo.get(e.dataId);if(this.state.numTensors--,"string"===e.dtype&&(this.state.numStringTensors--,this.state.numBytes-=t.bytes),"complex64"!==e.dtype&&"string"!==e.dtype){const t=e.size*l.h(e.dtype);this.state.numBytes-=t}t.backend.disposeData(e.dataId)&&this.removeDataId(e.dataId,t.backend)}disposeVariables(){for(const e in this.state.registeredVariables){const t=this.state.registeredVariables[e];this.disposeVariable(t)}}disposeVariable(e){this.disposeTensor(e),null!=this.state.registeredVariables[e.name]&&delete this.state.registeredVariables[e.name]}memory(){const e=this.backend.memory();return e.numTensors=this.state.numTensors,e.numDataBuffers=this.state.numDataBuffers,e.numBytes=this.state.numBytes,this.state.numStringTensors>0&&(e.unreliable=!0,null==e.reasons&&(e.reasons=[]),e.reasons.push("Memory usage by string tensors is approximate (2 bytes per character)")),e}async profile(e){this.state.profiling=!0;const t=this.state.numBytes,n=this.state.numTensors;this.state.activeProfile.kernels=[],this.state.activeProfile.result=await e(),this.state.profiling=!1,this.state.activeProfile.peakBytes=Math.max(...this.state.activeProfile.kernels.map((e=>e.totalBytesSnapshot))),this.state.activeProfile.newBytes=this.state.numBytes-t,this.state.activeProfile.newTensors=this.state.numTensors-n;for(const e of this.state.activeProfile.kernels)e.kernelTimeMs=await e.kernelTimeMs,e.extraInfo=await e.extraInfo;return this.state.activeProfile}isTapeOn(){return this.state.gradientDepth>0&&0===this.state.kernelDepth}addTapeNode(e,t,n,r,a,s){const o={id:this.state.nextTapeNodeId++,kernelName:e,inputs:t,outputs:n,saved:a},u=Object(i.b)(e);null!=u&&(r=u.gradFunc),null!=r&&(o.gradient=e=>(e=e.map(((e,t)=>{if(null==e){const e=n[t],r=l.F(e.size,e.dtype);return this.makeTensor(r,e.shape,e.dtype)}return e})),r(e.length>1?e:e[0],a,s))),this.state.activeTape.push(o)}keep(e){return e.kept=!0,e}startTape(){0===this.state.gradientDepth&&(this.state.activeTape=[]),this.state.gradientDepth++}endTape(){this.state.gradientDepth--}startScope(e){const t={track:[],name:"unnamed scope",id:this.state.nextScopeId++};e&&(t.name=e),this.state.scopeStack.push(t),this.state.activeScope=t}endScope(e){const t=Object(p.getTensorsInContainer)(e),n=new Set(t.map((e=>e.id)));for(let e=0;e<this.state.activeScope.track.length;e++){const t=this.state.activeScope.track[e];t.kept||n.has(t.id)||t.dispose()}const r=this.state.scopeStack.pop();this.state.activeScope=0===this.state.scopeStack.length?null:this.state.scopeStack[this.state.scopeStack.length-1],t.forEach((e=>{e.kept||e.scopeId!==r.id||this.track(e)}))}gradients(e,t,n,r=!1){if(l.c(t.length>0,(()=>"gradients() received an empty list of xs.")),null!=n&&"float32"!==n.dtype)throw new Error(`dy must have 'float32' dtype, but has '${n.dtype}'`);const a=this.scopedRun((()=>this.startTape()),(()=>this.endTape()),(()=>this.tidy("forward",e)));l.c(a instanceof d.a,(()=>"The result y returned by f() must be a tensor."));const s=function(e,t,n){const r={},a={};for(let e=0;e<t.length;e++)r[t[e].id]=!0;for(let n=0;n<e.length;n++){const s=e[n],o=s.inputs;for(const e in o){const n=o[e];let i=!1;for(let e=0;e<t.length;e++)if(r[n.id]){s.outputs.forEach((e=>r[e.id]=!0)),i=!0,a[s.id]=!0;break}if(i)break}}const s={};s[n.id]=!0;const o={};for(let t=e.length-1;t>=0;t--){const n=e[t],r=n.inputs;for(let e=0;e<n.outputs.length;e++)if(s[n.outputs[e].id]){for(const e in r)s[r[e].id]=!0,o[n.id]=!0;break}}const i=[];for(let t=0;t<e.length;t++){const n=e[t];if(a[n.id]&&o[n.id]){const e={};for(const t in n.inputs){const a=n.inputs[t];r[a.id]&&(e[t]=a)}const t=Object.assign({},n);t.inputs=e,t.outputs=n.outputs,i.push(t)}}return i}(this.state.activeTape,t,a);if(!r&&0===s.length&&t.length>0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.");return this.tidy("backward",(()=>{const e={};e[a.id]=null==n?function(e){const t=Object(l.D)(Object(l.O)(e),"float32");return y.makeTensor(t,e,"float32")}(a.shape):n,function(e,t,n,r){for(let a=t.length-1;a>=0;a--){const s=t[a],o=[];if(s.outputs.forEach((t=>{const n=e[t.id];null!=n?o.push(n):o.push(null)})),null==s.gradient)throw new Error(`Cannot compute gradient: gradient function not found for ${s.kernelName}.`);const i=s.gradient(o);for(const t in s.inputs){if(!(t in i))throw new Error(`Cannot backprop through input ${t}. Available gradients found: ${Object.keys(i)}.`);const a=n((()=>i[t]()));if("float32"!==a.dtype)throw new Error(`Error in gradient for op ${s.kernelName}. The gradient of input ${t} must have 'float32' dtype, but has '${a.dtype}'`);const o=s.inputs[t];if(!l.a(a.shape,o.shape))throw new Error(`Error in gradient for op ${s.kernelName}. The gradient of input '${t}' has shape '${a.shape}', which does not match the shape of the input '${o.shape}'`);if(null==e[o.id])e[o.id]=a;else{const t=e[o.id];e[o.id]=r(t,a),t.dispose()}}}}(e,s,(e=>this.tidy(e)),w);const r=t.map((t=>e[t.id]));return 0===this.state.gradientDepth&&(this.state.activeTape.forEach((e=>{for(const t of e.saved)t.dispose()})),this.state.activeTape=null),{value:a,grads:r}}))}customGrad(e){return l.c(l.v(e),(()=>"The f passed in customGrad(f) must be a function.")),(...t)=>{let n;l.c(t.every((e=>e instanceof d.a)),(()=>"The args passed in customGrad(f)(x1, x2,...) must all be tensors"));const r={};t.forEach(((e,t)=>{r[t]=e}));return this.runKernelFunc({forwardFunc:(r,a)=>(n=e(...t,a),l.c(n.value instanceof d.a,(()=>"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor")),l.c(l.v(n.gradFunc),(()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function.")),n.value),backwardsFunc:(e,r)=>{const a=n.gradFunc(e,r),s=Array.isArray(a)?a:[a];l.c(s.length===t.length,(()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns the same number of tensors as inputs passed to f(...).")),l.c(s.every((e=>e instanceof d.a)),(()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns a list of only tensors."));const o={};return s.forEach(((e,t)=>{o[t]=()=>e})),o},inputs:r})}}readSync(e){return this.state.tensorInfo.get(e).backend.readSync(e)}read(e){return this.state.tensorInfo.get(e).backend.read(e)}readToGPU(e,t){return this.state.tensorInfo.get(e).backend.readToGPU(e,t)}async time(e){const t=Object(f.now)(),n=await this.backend.time(e);return n.wallMs=Object(f.now)()-t,n}track(e){return null!=this.state.activeScope&&(e.scopeId=this.state.activeScope.id,this.state.activeScope.track.push(e)),e}get registeredVariables(){return this.state.registeredVariables}reset(){this.pendingBackendInitId++,this.state.dispose(),this.ENV.reset(),this.state=new m;for(const e in this.registry)this.disposeRegisteredKernels(e),this.registry[e].dispose(),delete this.registry[e];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null}}function g(){const e=Object(s.b)();if(null==e._tfengine){const t=new a.b(e);e._tfengine=new b(t)}return Object(a.d)(e._tfengine.ENV),Object(d.f)((()=>e._tfengine)),e._tfengine}b.nextTensorId=0,b.nextVariableId=0;const y=g();function w(e,t){const n={a:e,b:t};return y.runKernel(o.d,n)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return s})),n.d(t,"d",(function(){return o})),n.d(t,"e",(function(){return i})),n.d(t,"f",(function(){return u})),n.d(t,"g",(function(){return c})),n.d(t,"h",(function(){return l})),n.d(t,"i",(function(){return d})),n.d(t,"j",(function(){return p})),n.d(t,"k",(function(){return f})),n.d(t,"l",(function(){return h})),n.d(t,"n",(function(){return m})),n.d(t,"m",(function(){return b})),n.d(t,"o",(function(){return g})),n.d(t,"r",(function(){return y})),n.d(t,"p",(function(){return w})),n.d(t,"q",(function(){return O})),n.d(t,"s",(function(){return v})),n.d(t,"t",(function(){return j})),n.d(t,"u",(function(){return _})),n.d(t,"v",(function(){return x})),n.d(t,"x",(function(){return S})),n.d(t,"w",(function(){return k})),n.d(t,"y",(function(){return E})),n.d(t,"z",(function(){return T})),n.d(t,"A",(function(){return N})),n.d(t,"B",(function(){return A})),n.d(t,"C",(function(){return M})),n.d(t,"D",(function(){return I})),n.d(t,"E",(function(){return D})),n.d(t,"F",(function(){return $})),n.d(t,"G",(function(){return C})),n.d(t,"H",(function(){return R})),n.d(t,"I",(function(){return P})),n.d(t,"J",(function(){return F})),n.d(t,"K",(function(){return B})),n.d(t,"L",(function(){return L})),n.d(t,"N",(function(){return z})),n.d(t,"O",(function(){return W})),n.d(t,"M",(function(){return U})),n.d(t,"P",(function(){return V})),n.d(t,"Q",(function(){return G})),n.d(t,"R",(function(){return q})),n.d(t,"S",(function(){return H})),n.d(t,"T",(function(){return K})),n.d(t,"U",(function(){return Y})),n.d(t,"V",(function(){return J})),n.d(t,"X",(function(){return X})),n.d(t,"W",(function(){return Z})),n.d(t,"Y",(function(){return Q})),n.d(t,"vc",(function(){return ee})),n.d(t,"Z",(function(){return te})),n.d(t,"ab",(function(){return ne})),n.d(t,"bb",(function(){return re})),n.d(t,"db",(function(){return ae})),n.d(t,"cb",(function(){return se})),n.d(t,"eb",(function(){return oe})),n.d(t,"fb",(function(){return ie})),n.d(t,"gb",(function(){return ue})),n.d(t,"hb",(function(){return ce})),n.d(t,"ib",(function(){return le})),n.d(t,"jb",(function(){return de})),n.d(t,"kb",(function(){return pe})),n.d(t,"lb",(function(){return fe})),n.d(t,"nb",(function(){return he})),n.d(t,"rb",(function(){return me})),n.d(t,"qb",(function(){return be})),n.d(t,"sb",(function(){return ge})),n.d(t,"tb",(function(){return ye})),n.d(t,"vb",(function(){return we})),n.d(t,"ub",(function(){return Oe})),n.d(t,"wb",(function(){return ve})),n.d(t,"xb",(function(){return je})),n.d(t,"yb",(function(){return _e})),n.d(t,"zb",(function(){return xe})),n.d(t,"Cb",(function(){return Se})),n.d(t,"Db",(function(){return ke})),n.d(t,"Eb",(function(){return Ee})),n.d(t,"Fb",(function(){return Te})),n.d(t,"Gb",(function(){return Ne})),n.d(t,"Hb",(function(){return Ae})),n.d(t,"Jb",(function(){return Me})),n.d(t,"Kb",(function(){return Ie})),n.d(t,"Lb",(function(){return De})),n.d(t,"Mb",(function(){return $e})),n.d(t,"Ib",(function(){return Ce})),n.d(t,"Nb",(function(){return Re})),n.d(t,"Ab",(function(){return Pe})),n.d(t,"Bb",(function(){return Fe})),n.d(t,"Ob",(function(){return Be})),n.d(t,"Pb",(function(){return Le})),n.d(t,"Vb",(function(){return ze})),n.d(t,"Qb",(function(){return We})),n.d(t,"Tb",(function(){return Ue})),n.d(t,"Rb",(function(){return Ve})),n.d(t,"Sb",(function(){return Ge})),n.d(t,"Ub",(function(){return qe})),n.d(t,"Wb",(function(){return He})),n.d(t,"Xb",(function(){return Ke})),n.d(t,"Yb",(function(){return Ye})),n.d(t,"Zb",(function(){return Je})),n.d(t,"ac",(function(){return Xe})),n.d(t,"bc",(function(){return Ze})),n.d(t,"cc",(function(){return Qe})),n.d(t,"dc",(function(){return et})),n.d(t,"hc",(function(){return tt})),n.d(t,"ec",(function(){return nt})),n.d(t,"fc",(function(){return rt})),n.d(t,"gc",(function(){return at})),n.d(t,"jc",(function(){return st})),n.d(t,"ic",(function(){return ot})),n.d(t,"kc",(function(){return it})),n.d(t,"lc",(function(){return ut})),n.d(t,"mc",(function(){return ct})),n.d(t,"nc",(function(){return lt})),n.d(t,"oc",(function(){return dt})),n.d(t,"pc",(function(){return pt})),n.d(t,"qc",(function(){return ft})),n.d(t,"rc",(function(){return ht})),n.d(t,"sc",(function(){return mt})),n.d(t,"tc",(function(){return bt})),n.d(t,"uc",(function(){return gt})),n.d(t,"wc",(function(){return yt})),n.d(t,"xc",(function(){return wt})),n.d(t,"zc",(function(){return Ot})),n.d(t,"Cc",(function(){return vt})),n.d(t,"Dc",(function(){return jt})),n.d(t,"Ac",(function(){return _t})),n.d(t,"Bc",(function(){return xt})),n.d(t,"yc",(function(){return St})),n.d(t,"Ec",(function(){return kt})),n.d(t,"Gc",(function(){return Et})),n.d(t,"Hc",(function(){return Tt})),n.d(t,"Ic",(function(){return Nt})),n.d(t,"nd",(function(){return At})),n.d(t,"Jc",(function(){return Mt})),n.d(t,"Kc",(function(){return It})),n.d(t,"Lc",(function(){return Dt})),n.d(t,"Qc",(function(){return $t})),n.d(t,"Oc",(function(){return Ct})),n.d(t,"Pc",(function(){return Rt})),n.d(t,"Nc",(function(){return Pt})),n.d(t,"Mc",(function(){return Ft})),n.d(t,"Sc",(function(){return Bt})),n.d(t,"ad",(function(){return Lt})),n.d(t,"kd",(function(){return zt})),n.d(t,"Tc",(function(){return Wt})),n.d(t,"Zc",(function(){return Ut})),n.d(t,"Rc",(function(){return Vt})),n.d(t,"Uc",(function(){return Gt})),n.d(t,"Vc",(function(){return qt})),n.d(t,"Wc",(function(){return Ht})),n.d(t,"Xc",(function(){return Kt})),n.d(t,"Yc",(function(){return Yt})),n.d(t,"cd",(function(){return Jt})),n.d(t,"bd",(function(){return Xt})),n.d(t,"dd",(function(){return Zt})),n.d(t,"fd",(function(){return Qt})),n.d(t,"gd",(function(){return en})),n.d(t,"hd",(function(){return tn})),n.d(t,"id",(function(){return nn})),n.d(t,"jd",(function(){return rn})),n.d(t,"ld",(function(){return an})),n.d(t,"md",(function(){return sn})),n.d(t,"od",(function(){return on})),n.d(t,"pd",(function(){return un})),n.d(t,"qd",(function(){return cn})),n.d(t,"rd",(function(){return ln})),n.d(t,"sd",(function(){return dn})),n.d(t,"td",(function(){return pn})),n.d(t,"ud",(function(){return fn})),n.d(t,"vd",(function(){return hn})),n.d(t,"wd",(function(){return mn})),n.d(t,"ed",(function(){return bn})),n.d(t,"mb",(function(){return gn})),n.d(t,"Fc",(function(){return yn})),n.d(t,"xd",(function(){return wn})),n.d(t,"ob",(function(){return On})),n.d(t,"pb",(function(){return vn}));const r="Abs",a="Acos",s="Acosh",o="Add",i="AddN",u="All",c="Any",l="ArgMax",d="ArgMin",p="Asin",f="Asinh",h="Atan",m="Atanh",b="Atan2",g="AvgPool",y="AvgPoolGrad",w="AvgPool3D",O="AvgPool3DGrad",v="BatchMatMul",j="BatchToSpaceND",_="Bincount",x="BitwiseAnd",S="BroadcastTo",k="BroadcastArgs",E="Cast",T="Ceil",N="ClipByValue",A="Complex",M="ComplexAbs",I="Concat",D="Conv2D",$="Conv2DBackpropFilter",C="Conv2DBackpropInput",R="Conv3D",P="Conv3DBackpropFilterV2",F="Conv3DBackpropInputV2",B="Cos",L="Cosh",z="Cumprod",W="Cumsum",U="CropAndResize",V="DenseBincount",G="DepthToSpace",q="DepthwiseConv2dNative",H="DepthwiseConv2dNativeBackpropFilter",K="DepthwiseConv2dNativeBackpropInput",Y="Diag",J="Dilation2D",X="Dilation2DBackpropInput",Z="Dilation2DBackpropFilter",Q="Draw",ee="RealDiv",te="Einsum",ne="Elu",re="EluGrad",ae="Erf",se="Equal",oe="Exp",ie="ExpandDims",ue="Expm1",ce="FFT",le="Fill",de="FlipLeftRight",pe="Floor",fe="FloorDiv",he="FusedBatchNorm",me="GatherV2",be="GatherNd",ge="Greater",ye="GreaterEqual",we="Identity",Oe="IFFT",ve="Imag",je="IsFinite",_e="IsInf",xe="IsNan",Se="LeakyRelu",ke="Less",Ee="LessEqual",Te="LinSpace",Ne="Log",Ae="Log1p",Me="LogicalAnd",Ie="LogicalNot",De="LogicalOr",$e="LogicalXor",Ce="LogSoftmax",Re="LowerBound",Pe="LRN",Fe="LRNGrad",Be="MatrixBandPart",Le="Max",ze="Maximum",We="MaxPool",Ue="MaxPoolGrad",Ve="MaxPool3D",Ge="MaxPool3DGrad",qe="MaxPoolWithArgmax",He="Mean",Ke="Min",Ye="Minimum",Je="MirrorPad",Xe="Mod",Ze="Multinomial",Qe="Multiply",et="Neg",tt="NotEqual",nt="NonMaxSuppressionV3",rt="NonMaxSuppressionV4",at="NonMaxSuppressionV5",st="OnesLike",ot="OneHot",it="Pack",ut="PadV2",ct="Pool",lt="Pow",dt="Prelu",pt="Prod",ft="RaggedGather",ht="RaggedRange",mt="RaggedTensorToTensor",bt="Range",gt="Real",yt="Reciprocal",wt="Relu",Ot="Reshape",vt="ResizeNearestNeighbor",jt="ResizeNearestNeighborGrad",_t="ResizeBilinear",xt="ResizeBilinearGrad",St="Relu6",kt="Reverse",Et="Round",Tt="Rsqrt",Nt="ScatterNd",At="TensorScatterUpdate",Mt="SearchSorted",It="Select",Dt="Selu",$t="Slice",Ct="Sin",Rt="Sinh",Pt="Sign",Ft="Sigmoid",Bt="Softplus",Lt="Sqrt",zt="Sum",Wt="SpaceToBatchND",Ut="SplitV",Vt="Softmax",Gt="SparseFillEmptyRows",qt="SparseReshape",Ht="SparseSegmentMean",Kt="SparseSegmentSum",Yt="SparseToDense",Jt="SquaredDifference",Xt="Square",Zt="StaticRegexReplace",Qt="StridedSlice",en="StringNGrams",tn="StringSplit",nn="StringToHashBucketFast",rn="Sub",an="Tan",sn="Tanh",on="Tile",un="TopK",cn="Transform",ln="Transpose",dn="Unique",pn="Unpack",fn="UnsortedSegmentSum",hn="UpperBound",mn="ZerosLike",bn="Step",gn="FromPixels",yn="RotateWithOffset",wn="_FusedMatMul",On="FusedConv2D",vn="FusedDepthwiseConv2D"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(100);Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})})),n(102)},function(e,t,n){"use strict";n.r(t),n.d(t,"shuffle",(function(){return s.M})),n.d(t,"shuffleCombo",(function(){return s.N})),n.d(t,"clamp",(function(){return s.j})),n.d(t,"nearestLargerEven",(function(){return s.H})),n.d(t,"swap",(function(){return s.S})),n.d(t,"sum",(function(){return s.R})),n.d(t,"randUniform",(function(){return s.J})),n.d(t,"distSquared",(function(){return s.n})),n.d(t,"assert",(function(){return s.c})),n.d(t,"assertShapesMatch",(function(){return s.f})),n.d(t,"assertNonNull",(function(){return s.e})),n.d(t,"sizeFromShape",(function(){return s.O})),n.d(t,"isScalarShape",(function(){return s.z})),n.d(t,"arraysEqualWithNull",(function(){return s.b})),n.d(t,"arraysEqual",(function(){return s.a})),n.d(t,"isInt",(function(){return s.w})),n.d(t,"tanh",(function(){return s.T})),n.d(t,"sizeToSquarishShape",(function(){return s.P})),n.d(t,"createShuffledIndices",(function(){return s.m})),n.d(t,"rightPad",(function(){return s.L})),n.d(t,"repeatedTry",(function(){return s.K})),n.d(t,"inferFromImplicitShape",(function(){return s.t})),n.d(t,"parseAxisParam",(function(){return s.I})),n.d(t,"squeezeShape",(function(){return s.Q})),n.d(t,"getTypedArrayFromDType",(function(){return s.p})),n.d(t,"getArrayFromDType",(function(){return s.o})),n.d(t,"checkConversionForErrors",(function(){return s.i})),n.d(t,"isValidDtype",(function(){return s.B})),n.d(t,"hasEncodingLoss",(function(){return s.q})),n.d(t,"bytesPerElement",(function(){return s.h})),n.d(t,"bytesFromStringArray",(function(){return s.g})),n.d(t,"isString",(function(){return s.A})),n.d(t,"isBoolean",(function(){return s.u})),n.d(t,"isNumber",(function(){return s.x})),n.d(t,"inferDtype",(function(){return s.s})),n.d(t,"isFunction",(function(){return s.v})),n.d(t,"nearestDivisor",(function(){return s.G})),n.d(t,"computeStrides",(function(){return s.k})),n.d(t,"toNestedArray",(function(){return s.U})),n.d(t,"convertBackendValuesAndArrayBuffer",(function(){return s.l})),n.d(t,"makeOnesTypedArray",(function(){return s.D})),n.d(t,"makeZerosTypedArray",(function(){return s.F})),n.d(t,"makeZerosNestedTypedArray",(function(){return s.E})),n.d(t,"assertNonNegativeIntegerDimensions",(function(){return s.d})),n.d(t,"locToIndex",(function(){return s.C})),n.d(t,"indexToLoc",(function(){return s.r})),n.d(t,"isPromise",(function(){return s.y})),n.d(t,"hexToLong",(function(){return u})),n.d(t,"fingerPrint64",(function(){return w})),n.d(t,"createScalarValue",(function(){return O})),n.d(t,"toTypedArray",(function(){return v})),n.d(t,"now",(function(){return j})),n.d(t,"fetch",(function(){return _})),n.d(t,"encodeString",(function(){return x})),n.d(t,"decodeString",(function(){return S})),n.d(t,"isTypedArray",(function(){return k})),n.d(t,"flatten",(function(){return E}));var r=n(11),a=n(78),s=n(8),o=n(93);const i=n.n(o).a||o;function u(e){return i.fromString(e,!0,16)}const c=u("c3a5c85c97cb3127"),l=u("b492b66fbe98f273"),d=u("9ae16a3b2f90404f");function p(e){return e.xor(e.shru(47))}function f(e,t,n){const r=e.slice(t,t+n);return i.fromBytes(Array.from(r),!0,!0)}function h(e,t){return f(e,t,8)}function m(e,t){return f(e,t,4)}function b(e,t){return 0===t?e:e.shru(t).or(e.shl(64-t))}function g(e,t,n=u("9ddfea08eb382d69")){let r=e.xor(t).mul(n);r=r.xor(r.shru(47));let a=t.xor(r).mul(n);return a=a.xor(a.shru(47)),a=a.mul(n),a}function y(e,t,n,r){return function(e,t,n,r,a,s){a=a.add(e),s=b(s.add(a).add(r),21);const o=a;return a=(a=a.add(t)).add(n),s=s.add(b(a,44)),[a.add(r),s.add(o)]}(h(e,t),h(e,t+8),h(e,t+16),h(e,t+24),n,r)}function w(e,t=e.length){const n=i.fromNumber(81,!0);if(t<=32)return t<=16?function(e,t=e.length){if(t>=8){const n=d.add(2*t),r=h(e,0).add(d),a=h(e,t-8);return g(b(a,37).mul(n).add(r),b(r,25).add(a).mul(n),n)}if(t>=4){const n=d.add(2*t);return g(m(e,0).shl(3).add(t),m(e,t-4),n)}if(t>0){const n=e[0]+(e[t>>1]<<8),r=t+(e[t-1]<<2);return p(d.mul(n).xor(c.mul(r))).mul(d)}return d}(e,t):function(e,t=e.length){const n=d.add(2*t),r=h(e,0).mul(l),a=h(e,8),s=h(e,t-8).mul(n),o=h(e,t-16).mul(d);return g(b(r.add(a),43).add(b(s,30)).add(o),r.add(b(a.add(d),18)).add(s),n)}(e,t);if(t<=64)return function(e,t=e.length){const n=d.add(2*t),r=h(e,0).mul(d),a=h(e,8),s=h(e,t-8).mul(n),o=h(e,t-16).mul(d),i=b(r.add(a),43).add(b(s,30)).add(o),u=g(i,r.add(b(a.add(d),18)).add(s),n),c=h(e,16).mul(n),l=h(e,24),p=i.add(h(e,t-32)).mul(n),f=u.add(h(e,t-24)).mul(n);return g(b(c.add(l),43).add(b(p,30)).add(f),c.add(b(l.add(r),18)).add(p),n)}(e,t);let r=n,a=n.mul(l).add(113),s=p(a.mul(d).add(113)).mul(d),o=[i.UZERO,i.UZERO],u=[i.UZERO,i.UZERO];r=r.mul(d).add(h(e,0));let f=0;const w=64*(t-1>>6),O=w+(t-1&63)-63;do{r=b(r.add(a).add(o[0]).add(h(e,f+8)),37).mul(l),a=b(a.add(o[1]).add(h(e,f+48)),42).mul(l),r=r.xor(u[1]),a=a.add(o[0]).add(h(e,f+40)),s=b(s.add(u[0]),33).mul(l),o=y(e,f,o[1].mul(l),r.add(u[0])),u=y(e,f+32,s.add(u[1]),a.add(h(e,f+16))),[s,r]=[r,s],f+=64}while(f!==w);const v=l.add(s.and(255).shl(1));return f=O,u[0]=u[0].add(t-1&63),o[0]=o[0].add(u[0]),u[0]=u[0].add(o[0]),r=b(r.add(a).add(o[0]).add(h(e,f+8)),37).mul(v),a=b(a.add(o[1]).add(h(e,f+48)),42).mul(v),r=r.xor(u[1].mul(9)),a=a.add(o[0].mul(9).add(h(e,f+40))),s=b(s.add(u[0]),33).mul(v),o=y(e,f,o[1].mul(v),r.add(u[0])),u=y(e,f+32,s.add(u[1]),a.add(h(e,f+16))),[s,r]=[r,s],g(g(o[0],u[0],v).add(p(a).mul(c)).add(s),g(o[1],u[1],v).add(r),v)}function O(e,t){return"string"===t?x(e):v([e],t)}function v(e,t){if("string"===t)throw new Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(e)&&(e=E(e)),Object(r.c)().getBool("DEBUG")&&s.i(e,t),function(e,t){return e instanceof Float32Array&&"float32"===t||e instanceof Int32Array&&"int32"===t||e instanceof Uint8Array&&"bool"===t}(e,t))return e;if(null==t||"float32"===t||"complex64"===t)return new Float32Array(e);if("int32"===t)return new Int32Array(e);if("bool"===t){const t=new Uint8Array(e.length);for(let n=0;n<t.length;++n)0!==Math.round(e[n])&&(t[n]=1);return t}throw new Error(`Unknown data type ${t}`)}function j(){return Object(r.c)().platform.now()}function _(e,t){return Object(r.c)().platform.fetch(e,t)}function x(e,t="utf-8"){return t=t||"utf-8",Object(r.c)().platform.encode(e,t)}function S(e,t="utf-8"){return t=t||"utf-8",Object(r.c)().platform.decode(e,t)}function k(e){return null!=Object(r.c)().platform.isTypedArray?Object(r.c)().platform.isTypedArray(e):Object(a.a)(e)}function E(e,t=[],n=!1){if(null==t&&(t=[]),"boolean"==typeof e||"number"==typeof e||"string"==typeof e||s.y(e)||null==e||k(e)&&n)t.push(e);else if(Array.isArray(e)||k(e))for(let r=0;r<e.length;++r)E(e[r],t,n);else{let r=-1;for(const t of Object.keys(e))/^([1-9]+[0-9]*|0)$/.test(t)&&(r=Math.max(r,Number(t)));for(let a=0;a<=r;a++)E(e[a],t,n)}return t}},function(e,t,n){"use strict";n.r(t),n.d(t,"reshape",(function(){return i}));var r=n(3),a=n(4),s=n(1),o=n(2);const i=Object(o.b)({reshape_:function(e,t){const n={x:Object(s.a)(e,"x","reshape","string_or_numeric")},o={shape:t};return r.a.runKernel(a.zc,n,o)}})},function(e,t,n){"use strict";function r(e){let t=e.length,n=0;for(;t>0;)n=Math.random()*t|0,t--,i(e,t,n)}function a(e,t){if(e.length!==t.length)throw new Error(`Array sizes must match to be shuffled together First array length was ${e.length}Second array length was ${t.length}`);let n=e.length,r=0;for(;n>0;)r=Math.random()*n|0,n--,i(e,n,r),i(t,n,r)}function s(e,t,n){return Math.max(e,Math.min(t,n))}function o(e){return e%2==0?e:e+1}function i(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function u(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n];return t}function c(e,t){const n=Math.random();return t*n+(1-n)*e}function l(e,t){let n=0;for(let r=0;r<e.length;r++){const a=Number(e[r])-Number(t[r]);n+=a*a}return n}function d(e,t){if(!e)throw new Error("string"==typeof t?t:t())}function p(e,t,n=""){d(g(e,t),(()=>n+` Shapes ${e} and ${t} must match`))}function f(e){d(null!=e,(()=>"The input to the tensor constructor must be a non-null value."))}function h(e){if(0===e.length)return 1;let t=e[0];for(let n=1;n<e.length;n++)t*=e[n];return t}function m(e){return 0===e.length}function b(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(null!==e[n]&&null!==t[n]&&e[n]!==t[n])return!1;return!0}function g(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function y(e){return e%1==0}function w(e){if(null!=Math.tanh)return Math.tanh(e);if(e===1/0)return 1;if(e===-1/0)return-1;{const t=Math.exp(2*e);return(t-1)/(t+1)}}function O(e){const t=Math.ceil(Math.sqrt(e));return[t,Math.ceil(e/t)]}function v(e){const t=new Uint32Array(e);for(let n=0;n<e;++n)t[n]=n;return r(t),t}function j(e,t){return t<=e.length?e:e+" ".repeat(t-e.length)}function _(e,t=(e=>0),n,r){return new Promise(((a,s)=>{let o=0;const i=()=>{if(e())return void a();o++;const u=t(o);null!=n&&o>=n?s():null!=r?r(i,u):setTimeout(i,u)};i()}))}function x(e,t){let n=1,r=-1;for(let t=0;t<e.length;++t)if(e[t]>=0)n*=e[t];else if(-1===e[t]){if(-1!==r)throw Error(`Shapes can only have 1 implicit size. Found -1 at dim ${r} and dim ${t}`);r=t}else if(e[t]<0)throw Error(`Shapes can not be < 0. Found ${e[t]} at dim ${t}`);if(-1===r){if(t>0&&t!==n)throw Error(`Size(${t}) must match the product of shape ${e}`);return e}if(0===n)throw Error(`Cannot infer the missing size in [${e}] when there are 0 elements`);if(t%n!=0)throw Error(`The implicit shape can't be a fractional number. Got ${t} / ${n}`);const a=e.slice();return a[r]=t/n,a}function S(e,t){const n=t.length;return d((e=null==e?t.map(((e,t)=>t)):[].concat(e)).every((e=>e>=-n&&e<n)),(()=>`All values in axis param must be in range [-${n}, ${n}) but got axis ${e}`)),d(e.every((e=>y(e))),(()=>`All values in axis param must be integers but got axis ${e}`)),e.map((e=>e<0?n+e:e))}function k(e,t){const n=[],r=[],a=null!=t&&Array.isArray(t)&&0===t.length,s=null==t||a?null:S(t,e).sort();let o=0;for(let t=0;t<e.length;++t){if(null!=s){if(s[o]===t&&1!==e[t])throw new Error(`Can't squeeze axis ${t} since its dim '${e[t]}' is not 1`);(null==s[o]||s[o]>t)&&1===e[t]&&(n.push(e[t]),r.push(t)),s[o]<=t&&o++}1!==e[t]&&(n.push(e[t]),r.push(t))}return{newShape:n,keptDims:r}}function E(e,t){return T(e,t)}function T(e,t){let n=null;if(null==e||"float32"===e)n=new Float32Array(t);else if("int32"===e)n=new Int32Array(t);else if("bool"===e)n=new Uint8Array(t);else{if("string"!==e)throw new Error(`Unknown data type ${e}`);n=new Array(t)}return n}function N(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(isNaN(r)||!isFinite(r))throw Error(`A tensor of type ${t} being uploaded contains ${r}.`)}}function A(e){return"bool"===e||"complex64"===e||"float32"===e||"int32"===e||"string"===e}function M(e,t){return"complex64"!==t&&(("float32"!==t||"complex64"===e)&&(("int32"!==t||"float32"===e||"complex64"===e)&&("bool"!==t||"bool"!==e)))}function I(e){if("float32"===e||"int32"===e)return 4;if("complex64"===e)return 8;if("bool"===e)return 1;throw new Error(`Unknown dtype ${e}`)}function D(e){if(null==e)return 0;let t=0;return e.forEach((e=>t+=e.length)),t}function $(e){return"string"==typeof e||e instanceof String}function C(e){return"boolean"==typeof e}function R(e){return"number"==typeof e}function P(e){return Array.isArray(e)?P(e[0]):e instanceof Float32Array?"float32":e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray?"int32":R(e)?"float32":$(e)?"string":C(e)?"bool":"float32"}function F(e){return!!(e&&e.constructor&&e.call&&e.apply)}function B(e,t){for(let n=t;n<e;++n)if(e%n==0)return n;return e}function L(e){const t=e.length;if(t<2)return[];const n=new Array(t-1);n[t-2]=e[t-1];for(let r=t-3;r>=0;--r)n[r]=n[r+1]*e[r+1];return n}function z(e,t,n,r=!1){const a=new Array;if(1===t.length){const s=t[0]*(r?2:1);for(let t=0;t<s;t++)a[t]=n[e+t]}else{const s=t[0],o=t.slice(1),i=o.reduce(((e,t)=>e*t))*(r?2:1);for(let t=0;t<s;t++)a[t]=z(e+t*i,o,n,r)}return a}function W(e,t,n=!1){if(0===e.length)return t[0];const r=e.reduce(((e,t)=>e*t))*(n?2:1);if(0===r)return[];if(r!==t.length)throw new Error(`[${e}] does not match the input size ${t.length}${n?" for a complex tensor":""}.`);return z(0,e,t,n)}function U(e,t){if(Array.isArray(e))return e;if("float32"===t)return e instanceof Float32Array?e:new Float32Array(e);if("int32"===t)return e instanceof Int32Array?e:new Int32Array(e);if("bool"===t||"string"===t)return Uint8Array.from(new Int32Array(e));throw new Error(`Unknown dtype ${t}`)}function V(e,t){const n=G(e,t);for(let e=0;e<n.length;e++)n[e]=1;return n}function G(e,t){if(null==t||"float32"===t||"complex64"===t)return new Float32Array(e);if("int32"===t)return new Int32Array(e);if("bool"===t)return new Uint8Array(e);throw new Error(`Unknown data type ${t}`)}function q(e,t){const n=e.reduce(((e,t)=>e*t),1);if(null==t||"float32"===t)return W(e,new Float32Array(n));if("int32"===t)return W(e,new Int32Array(n));if("bool"===t)return W(e,new Uint8Array(n));throw new Error(`Unknown data type ${t}`)}function H(e){e.forEach((t=>{d(Number.isInteger(t)&&t>=0,(()=>`Tensor must have a shape comprised of positive integers but got shape [${e}].`))}))}function K(e,t,n){if(0===t)return 0;if(1===t)return e[0];let r=e[e.length-1];for(let t=0;t<e.length-1;++t)r+=n[t]*e[t];return r}function Y(e,t,n){if(0===t)return[];if(1===t)return[e];const r=new Array(t);for(let t=0;t<r.length-1;++t)r[t]=Math.floor(e/n[t]),e-=r[t]*n[t];return r[r.length-1]=e,r}function J(e){return e&&e.then&&"function"==typeof e.then}n.d(t,"M",(function(){return r})),n.d(t,"N",(function(){return a})),n.d(t,"j",(function(){return s})),n.d(t,"H",(function(){return o})),n.d(t,"S",(function(){return i})),n.d(t,"R",(function(){return u})),n.d(t,"J",(function(){return c})),n.d(t,"n",(function(){return l})),n.d(t,"c",(function(){return d})),n.d(t,"f",(function(){return p})),n.d(t,"e",(function(){return f})),n.d(t,"O",(function(){return h})),n.d(t,"z",(function(){return m})),n.d(t,"b",(function(){return b})),n.d(t,"a",(function(){return g})),n.d(t,"w",(function(){return y})),n.d(t,"T",(function(){return w})),n.d(t,"P",(function(){return O})),n.d(t,"m",(function(){return v})),n.d(t,"L",(function(){return j})),n.d(t,"K",(function(){return _})),n.d(t,"t",(function(){return x})),n.d(t,"I",(function(){return S})),n.d(t,"Q",(function(){return k})),n.d(t,"p",(function(){return E})),n.d(t,"o",(function(){return T})),n.d(t,"i",(function(){return N})),n.d(t,"B",(function(){return A})),n.d(t,"q",(function(){return M})),n.d(t,"h",(function(){return I})),n.d(t,"g",(function(){return D})),n.d(t,"A",(function(){return $})),n.d(t,"u",(function(){return C})),n.d(t,"x",(function(){return R})),n.d(t,"s",(function(){return P})),n.d(t,"v",(function(){return F})),n.d(t,"G",(function(){return B})),n.d(t,"k",(function(){return L})),n.d(t,"U",(function(){return W})),n.d(t,"l",(function(){return U})),n.d(t,"D",(function(){return V})),n.d(t,"F",(function(){return G})),n.d(t,"E",(function(){return q})),n.d(t,"d",(function(){return H})),n.d(t,"C",(function(){return K})),n.d(t,"r",(function(){return Y})),n.d(t,"y",(function(){return J}))},function(e,t,n){"use strict";n.r(t),n.d(t,"mul",(function(){return u}));var r=n(3),a=n(4),s=n(12),o=n(1),i=n(2);const u=Object(i.b)({mul_:function(e,t){let n=Object(o.a)(e,"a","mul"),i=Object(o.a)(t,"b","mul");[n,i]=Object(s.makeTypesMatch)(n,i);const u={a:n,b:i};return r.a.runKernel(a.cc,u)}})},function(e,t,n){"use strict";n.r(t),n.d(t,"add",(function(){return u}));var r=n(3),a=n(4),s=n(12),o=n(1),i=n(2);const u=Object(i.b)({add_:function(e,t){let n=Object(o.a)(e,"a","add"),i=Object(o.a)(t,"b","add");[n,i]=Object(s.makeTypesMatch)(n,i);const u={a:n,b:i};return r.a.runKernel(a.d,u)}})},function(e,t,n){"use strict";n.d(t,"b",(function(){return s})),n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return u})),n.d(t,"d",(function(){return c}));var r=n(8);const a="tfjsflags";class s{constructor(e){this.global=e,this.flags={},this.flagRegistry={},this.urlFlags={},this.getQueryParams=o,this.populateURLFlags()}setPlatform(e,t){null!=this.platform&&(i().getBool("IS_TEST")||i().getBool("PROD")||console.warn(`Platform ${this.platformName} has already been set. Overwriting the platform with ${e}.`)),this.platformName=e,this.platform=t}registerFlag(e,t,n){if(this.flagRegistry[e]={evaluationFn:t,setHook:n},null!=this.urlFlags[e]){const t=this.urlFlags[e];i().getBool("IS_TEST")||i().getBool("PROD")||console.warn(`Setting feature override from URL ${e}: ${t}.`),this.set(e,t)}}async getAsync(e){return e in this.flags||(this.flags[e]=await this.evaluateFlag(e)),this.flags[e]}get(e){if(e in this.flags)return this.flags[e];const t=this.evaluateFlag(e);if(Object(r.y)(t))throw new Error(`Flag ${e} cannot be synchronously evaluated. Please use getAsync() instead.`);return this.flags[e]=t,this.flags[e]}getNumber(e){return this.get(e)}getBool(e){return this.get(e)}getString(e){return this.get(e)}getFlags(){return this.flags}get features(){return this.flags}set(e,t){if(null==this.flagRegistry[e])throw new Error(`Cannot set flag ${e} as it has not been registered.`);this.flags[e]=t,null!=this.flagRegistry[e].setHook&&this.flagRegistry[e].setHook(t)}evaluateFlag(e){if(null==this.flagRegistry[e])throw new Error(`Cannot evaluate flag '${e}': no evaluation function found.`);return this.flagRegistry[e].evaluationFn()}setFlags(e){this.flags=Object.assign({},e)}reset(){this.flags={},this.urlFlags={},this.populateURLFlags()}populateURLFlags(){if("undefined"==typeof this.global||"undefined"==typeof this.global.location||"undefined"==typeof this.global.location.search)return;const e=this.getQueryParams(this.global.location.search);if(a in e){e.tfjsflags.split(",").forEach((e=>{const[t,n]=e.split(":");this.urlFlags[t]=function(e,t){const n=t.toLowerCase();return"true"===n||"false"===n?"true"===n:""+ +n===n?+n:t}(0,n)}))}}}function o(e){const t={};return e.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,((e,...n)=>(function(e,t,n){e[decodeURIComponent(t)]=decodeURIComponent(n||"")}(t,n[0],n[1]),n.join("=")))),t}function i(){return u}let u=null;function c(e){u=e}},function(e,t,n){"use strict";n.r(t),n.d(t,"makeTypesMatch",(function(){return o})),n.d(t,"assertTypesMatch",(function(){return i})),n.d(t,"isTensorInList",(function(){return u})),n.d(t,"getTensorsInContainer",(function(){return c}));var r=n(17),a=n(32),s=n(8);function o(e,t){if(e.dtype===t.dtype)return[e,t];const n=Object(a.e)(e.dtype,t.dtype);return[e.cast(n),t.cast(n)]}function i(e,t){Object(s.c)(e.dtype===t.dtype,(()=>`The dtypes of the first(${e.dtype}) and second(${t.dtype}) input must match`))}function u(e,t){return t.some((t=>t.id===e.id))}function c(e){const t=[];return l(e,t,new Set),t}function l(e,t,n){if(null==e)return;if(e instanceof r.a)return void t.push(e);if(a=e,!Array.isArray(a)&&"object"!=typeof a)return;var a;const s=e;for(const e in s){const r=s[e];n.has(r)||(n.add(r),l(r,t,n))}}},function(e,t,n){"use strict";n.d(t,"g",(function(){return i})),n.d(t,"f",(function(){return u})),n.d(t,"c",(function(){return c})),n.d(t,"b",(function(){return l})),n.d(t,"e",(function(){return d})),n.d(t,"h",(function(){return p})),n.d(t,"m",(function(){return f})),n.d(t,"n",(function(){return h})),n.d(t,"t",(function(){return m})),n.d(t,"d",(function(){return b})),n.d(t,"l",(function(){return g})),n.d(t,"u",(function(){return y})),n.d(t,"r",(function(){return w})),n.d(t,"o",(function(){return O})),n.d(t,"k",(function(){return v})),n.d(t,"q",(function(){return j})),n.d(t,"i",(function(){return _})),n.d(t,"j",(function(){return x})),n.d(t,"p",(function(){return S})),n.d(t,"a",(function(){return k})),n.d(t,"s",(function(){return E}));var r=n(3),a=n(11),s=n(17),o=n(12);function i(){Object(a.c)().set("PROD",!0)}function u(){Object(a.c)().set("DEBUG",!0)}function c(){Object(a.c)().set("DEPRECATION_WARNINGS_ENABLED",!1),console.warn("TensorFlow.js deprecation warnings have been disabled.")}function l(e){Object(a.c)().getBool("DEPRECATION_WARNINGS_ENABLED")&&console.warn(e+" You can disable deprecation warnings with tf.disableDeprecationWarnings().")}function d(){r.a.disposeVariables()}function p(){return r.a}function f(){return r.a.memory()}function h(e){return r.a.profile(e)}function m(e,t){return r.a.tidy(e,t)}function b(e){Object(o.getTensorsInContainer)(e).forEach((e=>e.dispose()))}function g(e){return r.a.keep(e)}function y(e){return r.a.time(e)}function w(e){return r.a.setBackend(e)}function O(){return r.a.ready()}function v(){return r.a.backendName}function j(e){r.a.removeBackend(e)}function _(e){return r.a.findBackend(e)}function x(e){return r.a.findBackendFactory(e)}function S(e,t,n=1){return r.a.registerBackend(e,t,n)}function k(){return r.a.backend}function E(e,t){Object(a.c)().setPlatform(e,t)}Object(s.d)(l)},function(e,t,n){"use strict";n.d(t,"e",(function(){return a})),n.d(t,"f",(function(){return s})),n.d(t,"g",(function(){return o})),n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return u})),n.d(t,"d",(function(){return c})),n.d(t,"k",(function(){return h})),n.d(t,"i",(function(){return m})),n.d(t,"j",(function(){return b})),n.d(t,"h",(function(){return g})),n.d(t,"a",(function(){return y}));var r=n(8);function a(e,t,n,r,a="NHWC",s){return i(e,[...t,e[3]],n,s,r,null,null,g(a))}function s(e,t,n,r,a,s,o="channelsLast"){const[u,c]=l(t);let d;if("channelsLast"===o)d=[u,c,e[3],e[3]];else{if("channelsFirst"!==o)throw new Error(`Unknown dataFormat ${o}`);d=[u,c,e[1],e[1]]}return i(e,d,n,r,a,s,!1,o)}function o(e,t,n,r,a,s,o="NDHWC"){const[i,c,l]=d(t);let p,f;if("NDHWC"===o)f="channelsLast",p=[i,c,l,e[4],e[4]];else{if("NCDHW"!==o)throw new Error(`Unknown dataFormat ${o}`);f="channelsFirst",p=[i,c,l,e[1],e[1]]}return u(e,p,n,r,a,!1,f,s)}function i(e,t,n,r,a,s,o=!1,i="channelsLast"){let[u,d,h,m]=[-1,-1,-1,-1];if("channelsLast"===i)[u,d,h,m]=e;else{if("channelsFirst"!==i)throw new Error(`Unknown dataFormat ${i}`);[u,m,d,h]=e}const[b,g,,y]=t,[w,O]=l(n),[v,j]=l(r),_=p(b,v),x=p(g,j),{padInfo:S,outHeight:k,outWidth:E}=function(e,t,n,r,a,s,o,i,u){let l,d,p;if("number"==typeof e){l={top:e,bottom:e,left:e,right:e,type:0===e?"VALID":"NUMBER"};const a=function(e,t,n,r,a){null==r&&(r=c(e,t,n));const s=e[0],o=e[1],i=f((s-t+2*r)/n+1,a),u=f((o-t+2*r)/n+1,a);return[i,u]}([t,n],s,r,e,i);d=a[0],p=a[1]}else if("same"===e){d=Math.ceil(t/r),p=Math.ceil(n/a);const e=Math.max(0,(d-1)*r+s-t),i=Math.max(0,(p-1)*a+o-n),u=Math.floor(e/2),c=e-u,f=Math.floor(i/2);l={top:u,bottom:c,left:f,right:i-f,type:"SAME"}}else if("valid"===e)l={top:0,bottom:0,left:0,right:0,type:"VALID"},d=Math.ceil((t-s+1)/r),p=Math.ceil((n-o+1)/a);else{if("object"!=typeof e)throw Error(`Unknown padding parameter: ${e}`);{const c="channelsLast"===u?e[1][0]:e[2][0],h="channelsLast"===u?e[1][1]:e[2][1],m="channelsLast"===u?e[2][0]:e[3][0],b="channelsLast"===u?e[2][1]:e[3][1];l={top:c,bottom:h,left:m,right:b,type:0===c&&0===h&&0===m&&0===b?"VALID":"EXPLICIT"},d=f((t-s+c+h)/r+1,i),p=f((n-o+m+b)/a+1,i)}}return{padInfo:l,outHeight:d,outWidth:p}}(a,d,h,w,O,_,x,s,i),T=o?y*m:y;let N;return"channelsFirst"===i?N=[u,T,k,E]:"channelsLast"===i&&(N=[u,k,E,T]),{batchSize:u,dataFormat:i,inHeight:d,inWidth:h,inChannels:m,outHeight:k,outWidth:E,outChannels:T,padInfo:S,strideHeight:w,strideWidth:O,filterHeight:b,filterWidth:g,effectiveFilterHeight:_,effectiveFilterWidth:x,dilationHeight:v,dilationWidth:j,inShape:e,outShape:N,filterShape:t}}function u(e,t,n,r,a,s=!1,o="channelsLast",i){let[u,l,h,m,b]=[-1,-1,-1,-1,-1];if("channelsLast"===o)[u,l,h,m,b]=e;else{if("channelsFirst"!==o)throw new Error(`Unknown dataFormat ${o}`);[u,b,l,h,m]=e}const[g,y,w,,O]=t,[v,j,_]=d(n),[x,S,k]=d(r),E=p(g,x),T=p(y,S),N=p(w,k),{padInfo:A,outDepth:M,outHeight:I,outWidth:D}=function(e,t,n,r,a,s,o,i,u,l,d){let p,h,m,b;"valid"===e&&(e=0);if("number"==typeof e){p={top:e,bottom:e,left:e,right:e,front:e,back:e,type:0===e?"VALID":"NUMBER"};const g=function(e,t,n,r,a,s){null==a&&(a=c(e,t[0],r[0]));const o=[0,0,0,n];for(let n=0;n<3;n++)e[n]+2*a>=t[n]&&(o[n]=f((e[n]-t[n]+2*a)/r[n]+1,s));return o}([t,n,r,1],[i,u,l],1,[a,s,o],e,d);h=g[0],m=g[1],b=g[2]}else{if("same"!==e)throw Error(`Unknown padding parameter: ${e}`);{h=Math.ceil(t/a),m=Math.ceil(n/s),b=Math.ceil(r/o);const e=(h-1)*a+i-t,c=(m-1)*s+u-n,d=(b-1)*o+l-r,f=Math.floor(e/2),g=e-f,y=Math.floor(c/2),w=c-y,O=Math.floor(d/2);p={top:y,bottom:w,left:O,right:d-O,front:f,back:g,type:"SAME"}}}return{padInfo:p,outDepth:h,outHeight:m,outWidth:b}}(a,l,h,m,v,j,_,E,T,N,i),$=s?O*b:O;let C;return"channelsFirst"===o?C=[u,$,M,I,D]:"channelsLast"===o&&(C=[u,M,I,D,$]),{batchSize:u,dataFormat:o,inDepth:l,inHeight:h,inWidth:m,inChannels:b,outDepth:M,outHeight:I,outWidth:D,outChannels:$,padInfo:A,strideDepth:v,strideHeight:j,strideWidth:_,filterDepth:g,filterHeight:y,filterWidth:w,effectiveFilterDepth:E,effectiveFilterHeight:T,effectiveFilterWidth:N,dilationDepth:x,dilationHeight:S,dilationWidth:k,inShape:e,outShape:C,filterShape:t}}function c(e,t,n,r=1){const a=p(t,r);return Math.floor((e[0]*(n-1)-n+a)/2)}function l(e){return"number"==typeof e?[e,e,e]:2===e.length?[e[0],e[1],1]:e}function d(e){return"number"==typeof e?[e,e,e]:e}function p(e,t){return t<=1?e:e+(e-1)*(t-1)}function f(e,t){if(!t)return Math.trunc(e);switch(t){case"round":return Math.round(e);case"ceil":return Math.ceil(e);case"floor":return Math.floor(e);default:throw new Error(`Unknown roundingMode ${t}`)}}function h(e){const[t,n,r]=l(e);return 1===t&&1===n&&1===r}function m(e,t){return h(e)||h(t)}function b(e){return l(e).every((e=>e>0))}function g(e){if("NHWC"===e)return"channelsLast";if("NCHW"===e)return"channelsFirst";throw new Error(`Unknown dataFormat ${e}`)}function y(e,t,n){if(null!=n){if("string"==typeof t)throw Error(`Error in ${e}: pad must be an integer when using dimRoundingMode ${n} but got pad ${t}.`);if("number"==typeof t)r.c(r.w(t),(()=>`Error in ${e}: pad must be an integer when using dimRoundingMode ${n} but got pad ${t}.`));else{if("object"!=typeof t)throw Error(`Error in ${e}: Unknown padding parameter: ${t}`);t.forEach((t=>{t.forEach((t=>{r.c(r.w(t),(()=>`Error in ${e}: pad must be an integer when using dimRoundingMode ${n} but got pad ${t}.`))}))}))}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(3),a=n(4),s=n(1),o=n(8),i=n(2);const u=Object(i.b)({cast_:function(e,t){const n=Object(s.a)(e,"x","cast");if(!o.B(t))throw new Error(`Failed to cast to unknown dtype ${t}`);if("string"===t&&"string"!==n.dtype||"string"!==t&&"string"===n.dtype)throw new Error("Only strings can be casted to strings");const i={x:n},u={dtype:t};return r.a.runKernel(a.y,i,u)}})},function(e,t,n){"use strict";function r(e,t){const n=e.length,r=[];for(let a=0;a<n;a++){const s=n-1-a,o=e[s]||1;(t[t.length-1-a]||1)>1&&1===o&&r.unshift(s)}return r}function a(e,t){const n=[];for(let r=0;r<t.length;r++){const a=e[e.length-r-1],s=t.length-r-1,o=t[s];(null==a||1===a&&o>1)&&n.unshift(s)}return n}function s(e,t){const n=Math.max(e.length,t.length),r=new Array(n);for(let a=0;a<n;a++){let s=e[e.length-a-1];null==s&&(s=1);let o=t[t.length-a-1];if(null==o&&(o=1),1===s)r[n-a-1]=o;else if(1===o)r[n-a-1]=s;else{if(s!==o){throw Error(`Operands could not be broadcast together with shapes ${e} and ${t}.`)}r[n-a-1]=s}}return r}n.r(t),n.d(t,"getBroadcastDims",(function(){return r})),n.d(t,"getReductionAxes",(function(){return a})),n.d(t,"assertAndGetBroadcastShape",(function(){return s}))},function(e,t,n){"use strict";n.d(t,"b",(function(){return d})),n.d(t,"f",(function(){return m})),n.d(t,"e",(function(){return b})),n.d(t,"d",(function(){return g})),n.d(t,"a",(function(){return y})),n.d(t,"c",(function(){return w}));var r=n(56),a=n(8);function s(e,t,n,r){const s=Object(a.k)(t),i=function(e,t,n,r){const s=Object(a.O)(t),i=r[r.length-1],u=new Array(i).fill(0),l=t.length,d="complex64"===n?c(e):e;if(l>1)for(let e=0;e<s/i;e++){const t=e*i;for(let e=0;e<i;e++)u[e]=Math.max(u[e],o(d[t+e],0,n).length)}return u}(e,t,n,s),l=t.length,d=u(e,t,n,s,i),p=["Tensor"];return r&&(p.push(` dtype: ${n}`),p.push(` rank: ${l}`),p.push(` shape: [${t}]`),p.push(" values:")),p.push(d.map((e=>" "+e)).join("\n")),p.join("\n")}function o(e,t,n){let r;return r=Array.isArray(e)?`${parseFloat(e[0].toFixed(7))} + ${parseFloat(e[1].toFixed(7))}j`:Object(a.A)(e)?`'${e}'`:"bool"===n?i(e):parseFloat(e.toFixed(7)).toString(),Object(a.L)(r,t)}function i(e){return 0===e?"false":"true"}function u(e,t,n,r,a,s=!0){const l="complex64"===n?2:1,d=t[0],p=t.length;if(0===p){if("complex64"===n){return[o(c(e)[0],0,n)]}return"bool"===n?[i(e[0])]:[e[0].toString()]}if(1===p){if(d>20){const t=3*l;let r=Array.from(e.slice(0,t)),s=Array.from(e.slice((d-3)*l,d*l));return"complex64"===n&&(r=c(r),s=c(s)),["["+r.map(((e,t)=>o(e,a[t],n))).join(", ")+", ..., "+s.map(((e,t)=>o(e,a[d-3+t],n))).join(", ")+"]"]}return["["+("complex64"===n?c(e):Array.from(e)).map(((e,t)=>o(e,a[t],n))).join(", ")+"]"]}const f=t.slice(1),h=r.slice(1),m=r[0]*l,b=[];if(d>20){for(let t=0;t<3;t++){const r=t*m,s=r+m;b.push(...u(e.slice(r,s),f,n,h,a,!1))}b.push("...");for(let t=d-3;t<d;t++){const r=t*m,s=r+m;b.push(...u(e.slice(r,s),f,n,h,a,t===d-1))}}else for(let t=0;t<d;t++){const r=t*m,s=r+m;b.push(...u(e.slice(r,s),f,n,h,a,t===d-1))}const g=2===p?",":"";b[0]="["+(d>0?b[0]+g:"");for(let e=1;e<b.length-1;e++)b[e]=" "+b[e]+g;let y=",\n";for(let e=2;e<p;e++)y+="\n";return b[b.length-1]=" "+b[b.length-1]+"]"+(s?"":y),b}function c(e){const t=[];for(let n=0;n<e.length;n+=2)t.push([e[n],e[n+1]]);return t}var l=n(6);class d{constructor(e,t,n){if(this.dtype=t,this.shape=e.slice(),this.size=a.O(e),null!=n){const e=n.length;a.c(e===this.size,(()=>`Length of values '${e}' does not match the size inferred by the shape '${this.size}'.`))}if("complex64"===t)throw new Error("complex64 dtype TensorBuffers are not supported. Please create a TensorBuffer for the real and imaginary parts separately and call tf.complex(real, imag).");this.values=n||a.o(t,this.size),this.strides=Object(a.k)(e)}set(e,...t){0===t.length&&(t=[0]),a.c(t.length===this.rank,(()=>`The number of provided coordinates (${t.length}) must match the rank (${this.rank})`));const n=this.locToIndex(t);this.values[n]=e}get(...e){0===e.length&&(e=[0]);let t=0;for(const n of e){if(n<0||n>=this.shape[t]){const t=`Requested out of range element at ${e}. Buffer shape=${this.shape}`;throw new Error(t)}t++}let n=e[e.length-1];for(let t=0;t<e.length-1;++t)n+=this.strides[t]*e[t];return this.values[n]}locToIndex(e){if(0===this.rank)return 0;if(1===this.rank)return e[0];let t=e[e.length-1];for(let n=0;n<e.length-1;++n)t+=this.strides[n]*e[n];return t}indexToLoc(e){if(0===this.rank)return[];if(1===this.rank)return[e];const t=new Array(this.shape.length);for(let n=0;n<t.length-1;++n)t[n]=Math.floor(e/this.strides[n]),e-=t[n]*this.strides[n];return t[t.length-1]=e,t}get rank(){return this.shape.length}toTensor(){return p().makeTensor(this.values,this.shape,this.dtype)}}let p=null,f=null,h=null;function m(e){p=e}function b(e){f=e}function g(e){h=e}class y{constructor(e,t,n,r){this.kept=!1,this.isDisposedInternal=!1,this.shape=e.slice(),this.dtype=t||"float32",this.size=a.O(e),this.strides=Object(a.k)(e),this.dataId=n,this.id=r,this.rankType=this.rank<5?this.rank.toString():"higher"}get rank(){return this.shape.length}async buffer(){const e=await this.data();return f.buffer(this.shape,this.dtype,e)}bufferSync(){return f.buffer(this.shape,this.dtype,this.dataSync())}async array(){const e=await this.data();return Object(a.U)(this.shape,e,"complex64"===this.dtype)}arraySync(){return Object(a.U)(this.shape,this.dataSync(),"complex64"===this.dtype)}async data(){this.throwIfDisposed();const e=p().read(this.dataId);if("string"===this.dtype){const t=await e;try{return t.map((e=>l.decodeString(e)))}catch(e){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}}return e}dataToGPU(e){return this.throwIfDisposed(),p().readToGPU(this.dataId,e)}dataSync(){this.throwIfDisposed();const e=p().readSync(this.dataId);if("string"===this.dtype)try{return e.map((e=>l.decodeString(e)))}catch(e){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}return e}async bytes(){this.throwIfDisposed();const e=await p().read(this.dataId);return"string"===this.dtype?e:new Uint8Array(e.buffer)}dispose(){this.isDisposed||(p().disposeTensor(this),this.isDisposedInternal=!0)}get isDisposed(){return this.isDisposedInternal}throwIfDisposed(){if(this.isDisposed)throw new Error("Tensor is disposed.")}print(e=!1){return f.print(this,e)}clone(){return this.throwIfDisposed(),f.clone(this)}toString(e=!1){return s(this.dataSync(),this.shape,this.dtype,e)}cast(e){return this.throwIfDisposed(),f.cast(this,e)}variable(e=!0,t,n){return this.throwIfDisposed(),p().makeVariable(this,e,t,n)}}Object.defineProperty(y,Symbol.hasInstance,{value:e=>!!e&&null!=e.data&&null!=e.dataSync&&null!=e.throwIfDisposed}),Object(r.a)("Tensor",(()=>y));class w extends y{constructor(e,t,n,r){super(e.shape,e.dtype,e.dataId,r),this.trainable=t,this.name=n}assign(e){if(e.dtype!==this.dtype)throw new Error(`dtype of the new value (${e.dtype}) and previous value (${this.dtype}) must match`);if(!a.a(e.shape,this.shape))throw new Error(`shape of the new value (${e.shape}) and previous value (${this.shape}) must match`);p().disposeTensor(this),this.dataId=e.dataId,p().incRef(this,null)}dispose(){p().disposeVariable(this),this.isDisposedInternal=!0}}Object.defineProperty(w,Symbol.hasInstance,{value:e=>e instanceof y&&null!=e.assign&&e.assign instanceof Function})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.softmax=t.pad=t.transpose=t.relu=t.stack=t.reshape=t.squeeze=t.stridedSlice=t.tensor1d=t.maximum=t.minimum=t.mean=t.concat=t.sigmoid=t.avgPool=t.relu6=t.add=t.mul=t.fused=void 0;var r=n(9);Object.defineProperty(t,"mul",{enumerable:!0,get:function(){return r.mul}});var a=n(10);Object.defineProperty(t,"add",{enumerable:!0,get:function(){return a.add}});var s=n(67);Object.defineProperty(t,"relu6",{enumerable:!0,get:function(){return s.relu6}});var o=n(66);Object.defineProperty(t,"avgPool",{enumerable:!0,get:function(){return o.avgPool}});var i=n(40);Object.defineProperty(t,"sigmoid",{enumerable:!0,get:function(){return i.sigmoid}});var u=n(22);Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return u.concat}});var c=n(51);Object.defineProperty(t,"mean",{enumerable:!0,get:function(){return c.mean}});var l=n(52);Object.defineProperty(t,"minimum",{enumerable:!0,get:function(){return l.minimum}});var d=n(65);Object.defineProperty(t,"maximum",{enumerable:!0,get:function(){return d.maximum}});var p=n(24);Object.defineProperty(t,"tensor1d",{enumerable:!0,get:function(){return p.tensor1d}});var f=n(85);Object.defineProperty(t,"stridedSlice",{enumerable:!0,get:function(){return f.stridedSlice}});var h=n(54);Object.defineProperty(t,"squeeze",{enumerable:!0,get:function(){return h.squeeze}});var m=n(7);Object.defineProperty(t,"reshape",{enumerable:!0,get:function(){return m.reshape}});var b=n(43);Object.defineProperty(t,"stack",{enumerable:!0,get:function(){return b.stack}});var g=n(45);Object.defineProperty(t,"relu",{enumerable:!0,get:function(){return g.relu}});var y=n(53);Object.defineProperty(t,"transpose",{enumerable:!0,get:function(){return y.transpose}});var w=n(39);Object.defineProperty(t,"pad",{enumerable:!0,get:function(){return w.pad}});var O=n(84);Object.defineProperty(t,"softmax",{enumerable:!0,get:function(){return O.softmax}});var v=n(88),j=n(87),_=n(86);t.fused={conv2d:v.conv2d,depthwiseConv2d:j.depthwiseConv2d,matMul:_.matMul}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(3),a=n(4),s=n(12),o=n(1),i=n(2);const u=Object(i.b)({matMul_:function(e,t,n=!1,i=!1){let u=Object(o.a)(e,"a","matMul"),c=Object(o.a)(t,"b","matMul");[u,c]=Object(s.makeTypesMatch)(u,c);const l={a:u,b:c},d={transposeA:n,transposeB:i};return r.a.runKernel(a.s,l,d)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(3),a=n(4),s=n(1),o=n(15),i=n(2);const u=Object(i.b)({sum_:function(e,t=null,n=!1){let i=Object(s.a)(e,"x","sum");"bool"===i.dtype&&(i=Object(o.a)(i,"int32"));const u={x:i},c={axis:t,keepDims:n};return r.a.runKernel(a.kd,u,c)}})},function(e,t,n){"use strict";(function(e){n.d(t,"f",(function(){return u})),n.d(t,"e",(function(){return c})),n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return h})),n.d(t,"d",(function(){return m})),n.d(t,"c",(function(){return b})),n.d(t,"j",(function(){return g})),n.d(t,"h",(function(){return y})),n.d(t,"g",(function(){return w})),n.d(t,"i",(function(){return O})),n.d(t,"k",(function(){return v}));var r=n(31),a=n(44),s=n(8),o=n(69),i=n(29);async function u(e,t){const n=[],r=[],a=Array.isArray(e)?e.map((e=>e.name)):Object.keys(e);for(let s=0;s<a.length;++s){const o=a[s],i=Array.isArray(e)?e[s].tensor:e[o];if("float32"!==i.dtype&&"int32"!==i.dtype&&"bool"!==i.dtype&&"string"!==i.dtype&&"complex64"!==i.dtype)throw new Error(`Unsupported dtype in weight '${o}': ${i.dtype}`);const u={name:o,shape:i.shape,dtype:i.dtype};if("string"===i.dtype){const e=new Promise((async e=>{const t=await i.bytes(),n=t.reduce(((e,t)=>e+t.length),0)+4*t.length,r=new Uint8Array(n);let a=0;for(let e=0;e<t.length;e++){const n=t[e],s=new Uint8Array(new Uint32Array([n.length]).buffer);r.set(s,a),a+=4,r.set(n,a),a+=n.length}e(r)}));r.push(e)}else r.push(i.data());null!=t&&(u.group=t),n.push(u)}return{data:l(await Promise.all(r)),specs:n}}function c(e,t){const n=new i.a(e),u={};let c,l=0;for(const e of t){const t=e.name,i=e.dtype,d=e.shape,p=Object(s.O)(d);let f;if("quantization"in e){const r=e.quantization;if("uint8"===r.dtype||"uint16"===r.dtype){if(!("min"in r)||!("scale"in r))throw new Error(`Weight ${e.name} with quantization ${r.dtype} doesn't have corresponding metadata min and scale.`)}else{if("float16"!==r.dtype)throw new Error(`Weight ${e.name} has unknown quantization dtype ${r.dtype}. Supported quantization dtypes are: 'uint8', 'uint16', and 'float16'.`);if("float32"!==i)throw new Error(`Weight ${e.name} is quantized with ${r.dtype} which only supports weights of type float32 not ${i}.`)}const a=o.a[r.dtype],s=n.slice(l,l+p*a),u="uint8"===r.dtype?new Uint8Array(s):new Uint16Array(s);if("float32"===i)if("uint8"===r.dtype||"uint16"===r.dtype){f=new Float32Array(u.length);for(let e=0;e<u.length;e++){const t=u[e];f[e]=t*r.scale+r.min}}else{if("float16"!==r.dtype)throw new Error(`Unsupported quantization type ${r.dtype} for weight type float32.`);void 0===c&&(c=j()),f=c(u)}else{if("int32"!==i)throw new Error(`Unsupported dtype in weight '${t}': ${i}`);if("uint8"!==r.dtype&&"uint16"!==r.dtype)throw new Error(`Unsupported quantization type ${r.dtype} for weight type int32.`);f=new Int32Array(u.length);for(let e=0;e<u.length;e++){const t=u[e];f[e]=Math.round(t*r.scale+r.min)}}l+=p*a}else if("string"===i){const t=Object(s.O)(e.shape);f=[];for(let e=0;e<t;e++){const e=new Uint32Array(n.slice(l,l+4))[0];l+=4;const t=new Uint8Array(n.slice(l,l+e));f.push(t),l+=e}}else{const e=o.a[i],s=n.slice(l,l+p*e);if("float32"===i)f=new Float32Array(s);else if("int32"===i)f=new Int32Array(s);else if("bool"===i)f=new Uint8Array(s);else{if("complex64"!==i)throw new Error(`Unsupported dtype in weight '${t}': ${i}`);{f=new Float32Array(s);const e=new Float32Array(f.length/2),n=new Float32Array(f.length/2);for(let t=0;t<e.length;t++)e[t]=f[2*t],n[t]=f[2*t+1];const o=Object(a.a)(e,d,"float32"),i=Object(a.a)(n,d,"float32");u[t]=Object(r.a)(o,i),o.dispose(),i.dispose()}}l+=p*e}"complex64"!==i&&(u[t]=Object(a.a)(f,d,i))}return u}function l(e){if(null===e)throw new Error(`Invalid input value: ${JSON.stringify(e)}`);let t=0;const n=[];e.forEach((e=>{if(t+=e.byteLength,n.push(e.byteLength===e.buffer.byteLength?e:new e.constructor(e)),!(e instanceof Float32Array||e instanceof Int32Array||e instanceof Uint8Array))throw new Error(`Unsupported TypedArray subtype: ${e.constructor.name}`)}));const r=new Uint8Array(t);let a=0;return n.forEach((e=>{r.set(new Uint8Array(e.buffer),a),a+=e.byteLength})),r.buffer}const d="undefined"!=typeof e&&("undefined"==typeof Blob||"undefined"==typeof atob||"undefined"==typeof btoa);function p(t){return d?e.byteLength(t,"utf8"):new Blob([t]).size}function f(t){if(d)return e.from(t).toString("base64");const n=new Uint8Array(t);let r="";for(let e=0,t=n.length;e<t;e++)r+=String.fromCharCode(n[e]);return btoa(r)}function h(t){if(d){const n=e.from(t,"base64");return n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength)}const n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;++e)r.set([n.charCodeAt(e)],e);return r.buffer}function m(e){return i.a.join(e)}function b(e){for(e=e.trim();e.endsWith("/");)e=e.slice(0,e.length-1);const t=e.split("/");return t[t.length-1]}function g(e,t){const n={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,weightsManifest:t};return null!=e.signature&&(n.signature=e.signature),null!=e.userDefinedMetadata&&(n.userDefinedMetadata=e.userDefinedMetadata),null!=e.modelInitializer&&(n.modelInitializer=e.modelInitializer),null!=e.initializerSignature&&(n.initializerSignature=e.initializerSignature),null!=e.trainingConfig&&(n.trainingConfig=e.trainingConfig),n}function y(e,t,n){const r={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy};if(null!=e.trainingConfig&&(r.trainingConfig=e.trainingConfig),null!=e.weightsManifest){if(!t)throw new Error("modelJSON has weightsManifest but weightSpecs is null");if(!n)throw new Error("modelJSON has weightsManifest but weightData is null");r.weightSpecs=t,r.weightData=n}return null!=e.signature&&(r.signature=e.signature),null!=e.userDefinedMetadata&&(r.userDefinedMetadata=e.userDefinedMetadata),null!=e.modelInitializer&&(r.modelInitializer=e.modelInitializer),null!=e.initializerSignature&&(r.initializerSignature=e.initializerSignature),r}async function w(e,t){let n,r;return null!=e.weightsManifest&&([n,r]=await t(e.weightsManifest)),y(e,n,r)}function O(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("Expected JSON model topology, received ArrayBuffer.");return{dateSaved:new Date,modelTopologyType:"JSON",modelTopologyBytes:null==e.modelTopology?0:p(JSON.stringify(e.modelTopology)),weightSpecsBytes:null==e.weightSpecs?0:p(JSON.stringify(e.weightSpecs)),weightDataBytes:null==e.weightData?0:new i.a(e.weightData).byteLength}}function v(e){const t=[];for(const n of e)t.push(...n.weights);return t}function j(){const e=function(){const e=e=>{let t=e<<13,n=0;for(;0==(8388608&t);)n-=8388608,t<<=1;return t&=-8388609,n+=947912704,t|n},t=new Uint32Array(2048);t[0]=0;for(let n=1;n<1024;n++)t[n]=e(n);for(let e=1024;e<2048;e++)t[e]=939524096+(e-1024<<13);return t}(),t=function(){const e=new Uint32Array(64);e[0]=0,e[31]=1199570944,e[32]=2147483648,e[63]=3347054592;for(let t=1;t<31;t++)e[t]=t<<23;for(let t=33;t<63;t++)e[t]=2147483648+(t-32<<23);return e}(),n=function(){const e=new Uint32Array(64);for(let t=0;t<64;t++)e[t]=1024;return e[0]=e[32]=0,e}();return r=>{const a=new ArrayBuffer(4*r.length),s=new Uint32Array(a);for(let a=0;a<r.length;a++){const o=r[a],i=e[n[o>>10]+(1023&o)]+t[o>>10];s[a]=i}return new Float32Array(a)}}}).call(this,n(96).Buffer)},function(e,t,n){"use strict";n.r(t),n.d(t,"concat",(function(){return c}));var r=n(3),a=n(4),s=n(1),o=n(8),i=n(36),u=n(2);const c=Object(u.b)({concat_:function(e,t=0){Object(o.c)(e.length>=1,(()=>"Pass at least one tensor to concat"));const n=Object(s.b)(e,"tensors","concat","string_or_numeric");if("complex64"===n[0].dtype&&n.forEach((e=>{if("complex64"!==e.dtype)throw new Error(`Cannot concatenate complex64 tensors with a tensor\n with dtype ${e.dtype}. `)})),1===n.length)return Object(i.a)(n[0]);const u=n,c={axis:t};return r.a.runKernel(a.D,u,c)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"f",(function(){return d})),n.d(t,"d",(function(){return c})),n.d(t,"e",(function(){return l})),n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return u}));var r=n(3),a=n(17),s=n(1),o=n(8);function i(e){return o.c(o.v(e),(()=>"The f passed in grad(f) must be a function")),(t,n)=>{const a=Object(s.a)(t,"x","tf.grad","string_or_numeric"),i=null!=n?Object(s.a)(n,"dy","tf.grad"):null;return r.a.tidy((()=>{const{value:t,grads:n}=r.a.gradients((()=>e(a)),[a],i);return null!=i&&o.f(t.shape,i.shape,"The shape of dy passed in grad(f)(x, dy) must match the shape returned by f(x)"),f(n),n[0]}))}}function u(e){return o.c(o.v(e),(()=>"The f passed in grads(f) must be a function")),(t,n)=>{o.c(Array.isArray(t),(()=>"The args passed in grads(f)(args) must be an array of `Tensor`s or `TensorLike`s"));const a=Object(s.b)(t,"args","tf.grads","string_or_numeric"),i=null!=n?Object(s.a)(n,"dy","tf.grads"):null;return r.a.tidy((()=>{const{value:t,grads:n}=r.a.gradients((()=>e(...a)),a,i);return null!=i&&o.f(t.shape,i.shape,"The shape of dy passed in grads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),f(n),n}))}}function c(e){return o.c(o.v(e),(()=>"The f passed in valueAndGrad(f) must be a function")),(t,n)=>{o.c(t instanceof a.a,(()=>"The x passed in valueAndGrad(f)(x) must be a tensor")),o.c(null==n||n instanceof a.a,(()=>"The dy passed in valueAndGrad(f)(x, dy) must be a tensor"));const{grads:s,value:i}=r.a.gradients((()=>e(t)),[t],n);return f(s),{grad:s[0],value:i}}}function l(e){return o.c(o.v(e),(()=>"The f passed in valueAndGrads(f) must be a function")),(t,n)=>{o.c(Array.isArray(t)&&t.every((e=>e instanceof a.a)),(()=>"The args passed in valueAndGrads(f)(args) must be array of tensors")),o.c(null==n||n instanceof a.a,(()=>"The dy passed in valueAndGrads(f)(args, dy) must be a tensor"));const s=r.a.gradients((()=>e(...t)),t,n);return null!=n&&o.f(s.value.shape,n.shape,"The shape of dy passed in valueAndGrads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),f(s.grads),s}}function d(e,t){o.c(o.v(e),(()=>"The f passed in variableGrads(f) must be a function")),o.c(null==t||Array.isArray(t)&&t.every((e=>e instanceof a.c)),(()=>"The varList passed in variableGrads(f, varList) must be an array of variables"));const n=null!=t;if(!n){t=[];for(const e in r.a.registeredVariables)t.push(r.a.registeredVariables[e])}const s=n?t.filter((e=>!e.trainable)):null,i=t.length;t=t.filter((e=>e.trainable)),o.c(t.length>0,(()=>`variableGrads() expects at least one of the input variables to be trainable, but none of the ${i} variables is trainable.`));const{value:u,grads:c}=r.a.gradients(e,t,null,!0);o.c(c.some((e=>null!=e)),(()=>"Cannot find a connection between any variable and the result of the loss function y=f(x). Please make sure the operations that use variables are inside the function f passed to minimize().")),o.c(0===u.rank,(()=>`The f passed in variableGrads(f) must return a scalar, but it returned a rank-${u.rank} tensor`));const l={};return t.forEach(((e,t)=>{null!=c[t]&&(l[e.name]=c[t])})),null!=s&&s.forEach((e=>l[e.name]=null)),{value:u,grads:l}}function p(e){return r.a.customGrad(e)}function f(e){if(e.filter((e=>null==e)).length>0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that\n the f you passed encloses all operations that lead from x to y.")}},function(e,t,n){"use strict";n.r(t),n.d(t,"tensor1d",(function(){return o}));var r=n(1),a=n(8),s=n(30);function o(e,t){Object(a.e)(e);const n=Object(r.c)(e,t);if(1!==n.length)throw new Error("tensor1d() requires values to be a flat/TypedArray");return Object(s.a)(e,null,n,t)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"e",(function(){return a})),n.d(t,"d",(function(){return s})),n.d(t,"c",(function(){return o})),n.d(t,"b",(function(){return i}));class r{constructor(){this.saveRouters=[],this.loadRouters=[]}static getInstance(){return null==r.instance&&(r.instance=new r),r.instance}static registerSaveRouter(e){r.getInstance().saveRouters.push(e)}static registerLoadRouter(e){r.getInstance().loadRouters.push(e)}static getSaveHandlers(e){return r.getHandlers(e,"save")}static getLoadHandlers(e,t){return r.getHandlers(e,"load",t)}static getHandlers(e,t,n){const a=[];return("load"===t?r.getInstance().loadRouters:r.getInstance().saveRouters).forEach((t=>{const r=t(e,n);null!==r&&a.push(r)})),a}}const a=e=>r.registerSaveRouter(e),s=e=>r.registerLoadRouter(e),o=e=>r.getSaveHandlers(e),i=(e,t)=>r.getLoadHandlers(e,t)},function(e,t,n){"use strict";n.d(t,"c",(function(){return h})),n.d(t,"b",(function(){return m})),n.d(t,"a",(function(){return b})),n.d(t,"d",(function(){return g}));var r=n(16),a=n(72),s=n(73),o=n(9),i=n(74),u=n(45),c=n(67),l=n(7),d=n(40),p=n(76),f=n(20);function h(e,t,n){if(null==n||"linear"===n)return e;if("relu"===n)return Object(o.mul)(e,Object(p.a)(t));throw new Error(`Cannot compute gradient for fused activation ${n}.`)}function m(e,t){let n=t;const a=r.getReductionAxes(e.shape,t.shape);return a.length>0&&(n=Object(f.a)(n,a)),Object(l.reshape)(n,e.shape)}function b(e,t,n,r){if("linear"===t)return e;if("relu"===t)return Object(u.relu)(e);if("elu"===t)return Object(a.a)(e);if("relu6"===t)return Object(c.relu6)(e);if("prelu"===t)return Object(i.a)(e,n);if("leakyrelu"===t)return Object(s.a)(e,r);if("sigmoid"===t)return Object(d.sigmoid)(e);throw new Error(`Unknown fused activation ${t}.`)}const g=(e,t)=>!(e>0)||"linear"===t},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(3),a=n(4),s=n(1),o=n(2);const i=Object(o.b)({neg_:function(e){const t={x:Object(s.a)(e,"x","neg")};return r.a.runKernel(a.dc,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(17),a=n(8);function s(e,t="float32",n){return t=t||"float32",a.d(e),new r.b(e,t,n)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(6);class a{static join(e){return new a(e).slice()}constructor(e){if(this.shards=[],this.previousShardIndex=0,null==e)return;if(e instanceof Array||(e=[e]),0===(e=e.map((e=>r.isTypedArray(e)?e.buffer:e))).length)return;this.bufferUniformSize=e[0].byteLength;let t=0;for(let n=0;n<e.length;n++){const r=e[n];n!==e.length-1&&r.byteLength!==this.bufferUniformSize&&(this.bufferUniformSize=void 0);const a=t+r.byteLength;this.shards.push({buffer:r,start:t,end:a}),t=a}0===this.shards.length&&(this.byteLength=0),this.byteLength=this.shards[this.shards.length-1].end}slice(e=0,t=this.byteLength){if(0===this.shards.length)return new ArrayBuffer(0);if(e=isNaN(Number(e))?0:e,t=isNaN(Number(t))?0:t,e=Math.max(0,e),(t=Math.min(this.byteLength,t))<=e)return new ArrayBuffer(0);const n=this.findShardForByte(e);if(-1===n)throw new Error(`Could not find start shard for byte ${e}`);const r=new ArrayBuffer(t-e),a=new Uint8Array(r);let s=0;for(let r=n;r<this.shards.length;r++){const n=this.shards[r],o=e+s-n.start,i=s,u=Math.min(t,n.end)-n.start,c=new Uint8Array(n.buffer,o,u-o);if(a.set(c,i),s+=c.length,t<n.end)break}return r}findShardForByte(e){if(0===this.shards.length||e<0||e>=this.byteLength)return-1;if(null!=this.bufferUniformSize)return this.previousShardIndex=Math.floor(e/this.bufferUniformSize),this.previousShardIndex;function t(t){return e<t.start?-1:e>=t.end?1:0}if(0===t(this.shards[this.previousShardIndex]))return this.previousShardIndex;const n=function(e,t){let n=0,r=e.length;for(;n<=r;){const a=Math.floor((r-n)/2)+n,s=t(e[a]);if(0===s)return a;s<0?r=a:n=a+1}return-1}(this.shards,t);return-1===n?-1:(this.previousShardIndex=n,this.previousShardIndex)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(3),a=n(32),s=n(8),o=n(6);function i(e,t,n,i){if(null==i)i=Object(s.s)(e);else if("complex64"===i)throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");if(Object(a.c)(e)||Object(a.b)(e)){if("float32"!==i&&"int32"!==i)throw new Error(`Creating tensor from GPU data only supports 'float32'|'int32' dtype, while the dtype is ${i}.`);return r.a.backend.createTensorFromGPUData(e,t||n,i)}if(!Object(o.isTypedArray)(e)&&!Array.isArray(e)&&"number"!=typeof e&&"boolean"!=typeof e&&"string"!=typeof e)throw new Error("values passed to tensor(values) must be a number/boolean/string or an array of numbers/booleans/strings, or a TypedArray");if(null!=t){Object(s.d)(t);const e=Object(s.O)(t),r=Object(s.O)(n);Object(s.c)(e===r,(()=>`Based on the provided shape, [${t}], the tensor should have ${e} values but has ${r}`));for(let e=0;e<n.length;++e){const r=n[e],a=e!==n.length-1||r!==Object(s.O)(t.slice(e));Object(s.c)(n[e]===t[e]||!a,(()=>`Error creating a new Tensor. Inferred shape (${n}) does not match the provided shape (${t}). `))}}return Object(o.isTypedArray)(e)||Array.isArray(e)||(e=[e]),t=t||n,e="string"!==i?Object(o.toTypedArray)(e,i):Object(o.flatten)(e,[],!0),r.a.makeTensor(e,t,i)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(3),a=n(4),s=n(1),o=n(8),i=n(2);const u=Object(i.b)({complex_:function(e,t){const n=Object(s.a)(e,"real","complex"),i=Object(s.a)(t,"imag","complex");o.f(n.shape,i.shape,`real and imag shapes, ${n.shape} and ${i.shape}, must match in call to tf.complex().`);const u={real:n,imag:i};return r.a.runKernel(a.B,u)}})},function(e,t,n){"use strict";var r,a,s,o,i;n.d(t,"a",(function(){return r})),n.d(t,"e",(function(){return c})),n.d(t,"d",(function(){return l})),n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return p})),function(e){e.R0="R0",e.R1="R1",e.R2="R2",e.R3="R3",e.R4="R4",e.R5="R5",e.R6="R6"}(r||(r={})),function(e){e.float32="float32",e.int32="int32",e.bool="int32",e.complex64="complex64"}(a||(a={})),function(e){e.float32="float32",e.int32="int32",e.bool="bool",e.complex64="complex64"}(s||(s={})),function(e){e.float32="float32",e.int32="float32",e.bool="float32",e.complex64="complex64"}(o||(o={})),function(e){e.float32="complex64",e.int32="complex64",e.bool="complex64",e.complex64="complex64"}(i||(i={}));const u={float32:o,int32:a,bool:s,complex64:i};function c(e,t){if("string"===e||"string"===t){if("string"===e&&"string"===t)return"string";throw new Error(`Can not upcast ${e} with ${t}`)}return u[e][t]}function l(e){return c(e,"int32")}function d(e){return null!=e&&"object"==typeof e&&"texture"in e&&e.texture instanceof WebGLTexture}function p(e){return"undefined"!=typeof GPUBuffer&&null!=e&&"object"==typeof e&&"buffer"in e&&e.buffer instanceof GPUBuffer}},function(e,t,n){"use strict";var r,a;n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return a})),function(e){e[e.float32=0]="float32",e[e.int32=1]="int32",e[e.bool=2]="bool",e[e.string=3]="string",e[e.complex64=4]="complex64"}(r||(r={})),function(e){e[e.linear=0]="linear",e[e.relu=1]="relu",e[e.relu6=2]="relu6",e[e.prelu=3]="prelu",e[e.leakyrelu=4]="leakyrelu",e[e.sigmoid=5]="sigmoid",e[e.elu=6]="elu"}(a||(a={}))},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return k})),n.d(t,"i",(function(){return T})),n.d(t,"c",(function(){return N})),n.d(t,"f",(function(){return A})),n.d(t,"e",(function(){return D})),n.d(t,"d",(function(){return $})),n.d(t,"k",(function(){return R})),n.d(t,"g",(function(){return P})),n.d(t,"h",(function(){return F})),n.d(t,"j",(function(){return B})),n.d(t,"b",(function(){return L}));var r=n(5),a=n(42),s=n(55),o=n(0),i=n(103),u=n(104),c=n(105),l=n(106),d=n(107),p=n(108),f=n(109),h=n(110),m=n(111),b=n(112),g=n(113),y=n(114),w=n(115),O=n(116),v=n(117),j=n(118),_=n(119),x=n(120),S=n(121);class k{static get Instance(){return this._instance||(this._instance=new this)}constructor(){const e=[].concat(...[i,u,c,l,d,p,f,h,m,b,g,y,w,O,v,j,_,x,S].map((e=>e.json)));this.opMappers=e.reduce(((e,t)=>(e[t.tfOpName]=t,e)),{})}transformGraph(e,t={}){const n=e.node,r=[],a=[],s=[],i=n.reduce(((e,t)=>(e[t.name]=this.mapNode(t),t.op.startsWith("Placeholder")?r.push(e[t.name]):"Const"===t.op?a.push(e[t.name]):null!=t.input&&0!==t.input.length||s.push(e[t.name]),e)),{});let u=[];const c=[];let l={},d={};null!=t&&(l=this.mapSignatureEntries(t.inputs),d=this.mapSignatureEntries(t.outputs));const p=Object.keys(i);p.forEach((e=>{const t=i[e];t.inputNames.forEach(((e,n)=>{const[r,,a]=Object(o.b)(e),s=i[r];if(null!=s.outputs){const e=s.outputs.indexOf(a);if(-1!==e){const a=`${r}:${e}`;t.inputNames[n]=a}}t.inputs.push(s),s.children.push(t)}))})),0===Object.keys(d).length?p.forEach((e=>{const t=i[e];0===t.children.length&&c.push(t)})):Object.keys(d).forEach((e=>{const[t]=Object(o.b)(e),n=i[t];null!=n&&(n.signatureKey=d[e],c.push(n))})),Object.keys(l).length>0?Object.keys(l).forEach((e=>{const[t]=Object(o.b)(e),n=i[t];n&&(n.signatureKey=l[e],u.push(n))})):u=r;let f={};null!=e.library&&null!=e.library.function&&(f=e.library.function.reduce(((e,t)=>(e[t.signature.name]=this.mapFunction(t),e)),{}));const h={nodes:i,inputs:u,outputs:c,weights:a,placeholders:r,signature:t,functions:f};return s.length>0&&(h.initNodes=s),h}mapSignatureEntries(e){return Object.keys(e||{}).reduce(((t,n)=>(t[e[n].name]=n,t)),{})}mapNode(e){const t=Object(s.b)(e.op)||this.opMappers[e.op]||{};null==e.attr&&(e.attr={});const n={name:e.name,op:e.op,category:t.category,inputNames:(e.input||[]).map((e=>e.startsWith("^")?e.slice(1):e)),inputs:[],children:[],inputParams:{},attrParams:{},rawAttrs:e.attr,outputs:t.outputs};return null!=t.inputs&&(n.inputParams=t.inputs.reduce(((e,t)=>(e[t.name]={type:t.type,inputIndexStart:t.start,inputIndexEnd:t.end},e)),{})),null!=t.attrs&&(n.attrParams=t.attrs.reduce(((t,n)=>{const r=n.type;let a;switch(n.type){case"string":a=T(e.attr,n.tfName,n.defaultValue),void 0===a&&n.tfDeprecatedName&&(a=T(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"string[]":a=F(e.attr,n.tfName,n.defaultValue),void 0===a&&n.tfDeprecatedName&&(a=F(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"number":a=A(e.attr,n.tfName,n.defaultValue||0),void 0===a&&n.tfDeprecatedName&&(a=A(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"number[]":a=P(e.attr,n.tfName,n.defaultValue),void 0===a&&n.tfDeprecatedName&&(a=P(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool":a=N(e.attr,n.tfName,n.defaultValue),void 0===a&&n.tfDeprecatedName&&(a=N(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool[]":a=L(e.attr,n.tfName,n.defaultValue),void 0===a&&n.tfDeprecatedName&&(a=L(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape":a=R(e.attr,n.tfName,n.defaultValue),void 0===a&&n.tfDeprecatedName&&(a=R(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape[]":a=B(e.attr,n.tfName,n.defaultValue),void 0===a&&n.tfDeprecatedName&&(a=B(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype":a=D(e.attr,n.tfName,n.defaultValue),void 0===a&&n.tfDeprecatedName&&(a=D(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype[]":a=$(e.attr,n.tfName,n.defaultValue),void 0===a&&n.tfDeprecatedName&&(a=$(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"func":a=I(e.attr,n.tfName,n.defaultValue),void 0===a&&n.tfDeprecatedName&&(a=I(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"tensor":case"tensors":break;default:throw new Error(`Unsupported param type: ${n.type} for op: ${e.op}`)}return t[n.name]={value:a,type:r},t}),{})),n}mapFunction(e){const t=e.nodeDef,n=[];let r={};null!=t&&(r=t.reduce(((e,t)=>(e[t.name]=this.mapNode(t),"Const"===t.op&&n.push(e[t.name]),e)),{}));const a=[],s=[];e.signature.inputArg.forEach((e=>{const[t]=Object(o.b)(e.name),n={name:t,op:"Placeholder",inputs:[],inputNames:[],category:"graph",inputParams:{},attrParams:{dtype:{value:M(e.type),type:"dtype"}},children:[]};n.signatureKey=e.name,a.push(n),r[t]=n}));Object.keys(r).forEach((e=>{const t=r[e];t.inputNames.forEach(((e,n)=>{const[a,,s]=Object(o.b)(e),i=r[a];if(null!=i.outputs){const e=i.outputs.indexOf(s);if(-1!==e){const r=`${a}:${e}`;t.inputNames[n]=r}}t.inputs.push(i),i.children.push(t)}))}));const i=e.ret;e.signature.outputArg.forEach((e=>{const[t,n]=Object(o.b)(i[e.name]),a=r[t];null!=a&&(a.defaultOutput=n,s.push(a))}));const u=this.mapArgsToSignature(e);return{nodes:r,inputs:a,outputs:s,weights:n,placeholders:[],signature:u}}mapArgsToSignature(e){return{methodName:e.signature.name,inputs:e.signature.inputArg.reduce(((e,t)=>(e[t.name]=this.mapArgToTensorInfo(t),e)),{}),outputs:e.signature.outputArg.reduce(((t,n)=>(t[n.name]=this.mapArgToTensorInfo(n,e.ret),t)),{})}}mapArgToTensorInfo(e,t){let n=e.name;return null!=t&&(n=t[n]),{name:n,dtype:e.type}}}function E(t,n){const a=Array.isArray(t)?String.fromCharCode.apply(null,t):function(t){const n=Object(r.env)().global;if("undefined"!=typeof n.atob)return n.atob(t);if("undefined"!=typeof e)return new e(t,"base64").toString();throw new Error("Unable to decode base64 in this environment. Missing built-in atob() or Buffer()")}(t);return n?a:a.toLowerCase()}function T(e,t,n,r=!1){const a=e[t];return null!=a?E(a.s,r):n}function N(e,t,n){const r=e[t];return r?r.b:n}function A(e,t,n){const r=e[t]||{},a=null!=r.i?r.i:null!=r.f?r.f:n;return"number"==typeof a?a:parseInt(a,10)}function M(e){switch("string"==typeof e&&(e=a.a[e]),e){case a.a.DT_FLOAT:case a.a.DT_HALF:return"float32";case a.a.DT_INT32:case a.a.DT_INT64:case a.a.DT_INT8:case a.a.DT_UINT8:return"int32";case a.a.DT_BOOL:return"bool";case a.a.DT_DOUBLE:return"float32";case a.a.DT_STRING:return"string";default:return null}}function I(e,t,n){const r=e[t];return r&&r.func?r.func.name:n}function D(e,t,n){const r=e[t];return r&&r.type?M(r.type):n}function $(e,t,n){const r=e[t];return r&&r.list&&r.list.type?r.list.type.map((e=>M(e))):n}function C(e){if(!e.unknownRank)return null!=e.dim?e.dim.map((e=>"number"==typeof e.size?e.size:parseInt(e.size,10))):[]}function R(e,t,n){const r=e[t];return r&&r.shape?C(r.shape):n}function P(e,t,n){const r=e[t];return r?((r.list.f&&r.list.f.length?r.list.f:r.list.i)||[]).map((e=>"number"==typeof e?e:parseInt(e,10))):n}function F(e,t,n,r=!1){const a=e[t];return a&&a.list&&a.list.s?a.list.s.map((e=>E(e,r))):n}function B(e,t,n){const r=e[t];return r&&r.list&&r.list.shape?r.list.shape.map((e=>C(e))):n}function L(e,t,n){const r=e[t];return r&&r.list&&r.list.b?r.list.b:n}}).call(this,n(96).Buffer)},function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(3),a=n(4),s=n(1),o=n(2);const i=Object(o.b)({clone_:function(e){const t={x:Object(s.a)(e,"x","clone","string_or_numeric")};return r.a.runKernel(a.vb,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(5),a=n(33);function s(e,t,n){let s;return{kernelName:e,backendName:"wasm",setupFunc:function(t){s=t.wasm.cwrap(e,null,["number","array","number","number","array","number","number","number"])},kernelFunc:function(e){const{backend:t,inputs:o}=e,{a:i,b:u}=o,c=t.dataIdMap.get(i.dataId).id,l=t.dataIdMap.get(u.dataId).id,d=null!=n?n:i.dtype,p=r.backend_util.assertAndGetBroadcastShape(i.shape,u.shape),f=t.makeOutput(p,d);if(0===r.util.sizeFromShape(p))return f;const h=new Uint8Array(new Int32Array(i.shape).buffer),m=new Uint8Array(new Int32Array(u.shape).buffer),b=t.dataIdMap.get(f.dataId).id;return s(c,h,i.shape.length,l,m,u.shape.length,a.a[i.dtype],b),f}}}},function(e,t,n){"use strict";n.d(t,"c",(function(){return u})),n.d(t,"b",(function(){return c})),n.d(t,"d",(function(){return l})),n.d(t,"f",(function(){return d})),n.d(t,"e",(function(){return p})),n.d(t,"h",(function(){return f})),n.d(t,"g",(function(){return h})),n.d(t,"a",(function(){return m}));var r=n(11),a=n(56),s=n(41);const o=Object(a.a)("kernelRegistry",(()=>new Map)),i=Object(a.a)("gradRegistry",(()=>new Map));function u(e,t){const n=b(e,t);return o.get(n)}function c(e){return i.get(e)}function l(e){const t=o.entries(),n=[];for(;;){const{done:r,value:a}=t.next();if(r)break;const[s,o]=a,[i]=s.split("_");i===e&&n.push(o)}return n}function d(e){const{kernelName:t,backendName:n}=e,r=b(t,n);o.has(r)&&s.b(`The kernel '${t}' for backend '${n}' is already registered`),o.set(r,e)}function p(e){const{kernelName:t}=e;i.has(t)&&Object(r.c)().getBool("DEBUG")&&s.b(`Overriding the gradient for '${t}'`),i.set(t,e)}function f(e,t){const n=b(e,t);if(!o.has(n))throw new Error(`The kernel '${e}' for backend '${t}' is not registered`);o.delete(n)}function h(e){if(!i.has(e))throw new Error(`The gradient '${e}' for backend is not registered`);i.delete(e)}function m(e,t){l(e).forEach((e=>{d(Object.assign({},e,{backendName:t}))}))}function b(e,t){return`${t}_${e}`}},function(e,t,n){"use strict";n.r(t),n.d(t,"pad",(function(){return i}));var r=n(3),a=n(4),s=n(1),o=n(2);const i=Object(o.b)({pad_:function(e,t,n=0){const o=Object(s.a)(e,"x","pad");if(0===o.rank)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");const i={paddings:t,constantValue:n},u={x:o};return r.a.runKernel(a.lc,u,i)}})},function(e,t,n){"use strict";n.r(t),n.d(t,"sigmoid",(function(){return i}));var r=n(3),a=n(4),s=n(1),o=n(2);const i=Object(o.b)({sigmoid_:function(e){const t={x:Object(s.a)(e,"x","sigmoid","float32")};return r.a.runKernel(a.Mc,t)}})},function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s}));var r=n(11);function a(...e){Object(r.c)().getBool("IS_TEST")||Object(r.c)().getBool("PROD")||console.warn(...e)}function s(...e){Object(r.c)().getBool("IS_TEST")||Object(r.c)().getBool("PROD")||console.log(...e)}},function(e,t,n){"use strict";var r,a;n.d(t,"a",(function(){return r})),function(e){e[e.DT_INVALID=0]="DT_INVALID",e[e.DT_FLOAT=1]="DT_FLOAT",e[e.DT_DOUBLE=2]="DT_DOUBLE",e[e.DT_INT32=3]="DT_INT32",e[e.DT_UINT8=4]="DT_UINT8",e[e.DT_INT16=5]="DT_INT16",e[e.DT_INT8=6]="DT_INT8",e[e.DT_STRING=7]="DT_STRING",e[e.DT_COMPLEX64=8]="DT_COMPLEX64",e[e.DT_INT64=9]="DT_INT64",e[e.DT_BOOL=10]="DT_BOOL",e[e.DT_QINT8=11]="DT_QINT8",e[e.DT_QUINT8=12]="DT_QUINT8",e[e.DT_QINT32=13]="DT_QINT32",e[e.DT_BFLOAT16=14]="DT_BFLOAT16",e[e.DT_QINT16=15]="DT_QINT16",e[e.DT_QUINT16=16]="DT_QUINT16",e[e.DT_UINT16=17]="DT_UINT16",e[e.DT_COMPLEX128=18]="DT_COMPLEX128",e[e.DT_HALF=19]="DT_HALF",e[e.DT_RESOURCE=20]="DT_RESOURCE",e[e.DT_VARIANT=21]="DT_VARIANT",e[e.DT_UINT32=22]="DT_UINT32",e[e.DT_UINT64=23]="DT_UINT64",e[e.DT_FLOAT_REF=101]="DT_FLOAT_REF",e[e.DT_DOUBLE_REF=102]="DT_DOUBLE_REF",e[e.DT_INT32_REF=103]="DT_INT32_REF",e[e.DT_UINT8_REF=104]="DT_UINT8_REF",e[e.DT_INT16_REF=105]="DT_INT16_REF",e[e.DT_INT8_REF=106]="DT_INT8_REF",e[e.DT_STRING_REF=107]="DT_STRING_REF",e[e.DT_COMPLEX64_REF=108]="DT_COMPLEX64_REF",e[e.DT_INT64_REF=109]="DT_INT64_REF",e[e.DT_BOOL_REF=110]="DT_BOOL_REF",e[e.DT_QINT8_REF=111]="DT_QINT8_REF",e[e.DT_QUINT8_REF=112]="DT_QUINT8_REF",e[e.DT_QINT32_REF=113]="DT_QINT32_REF",e[e.DT_BFLOAT16_REF=114]="DT_BFLOAT16_REF",e[e.DT_QINT16_REF=115]="DT_QINT16_REF",e[e.DT_QUINT16_REF=116]="DT_QUINT16_REF",e[e.DT_UINT16_REF=117]="DT_UINT16_REF",e[e.DT_COMPLEX128_REF=118]="DT_COMPLEX128_REF",e[e.DT_HALF_REF=119]="DT_HALF_REF",e[e.DT_RESOURCE_REF=120]="DT_RESOURCE_REF",e[e.DT_VARIANT_REF=121]="DT_VARIANT_REF",e[e.DT_UINT32_REF=122]="DT_UINT32_REF",e[e.DT_UINT64_REF=123]="DT_UINT64_REF"}(r||(r={})),function(e){let t;!function(e){e[e.LEGACY=0]="LEGACY",e[e.V1=1]="V1",e[e.V2=2]="V2"}(t=e.CheckpointFormatVersion||(e.CheckpointFormatVersion={}))}(a||(a={}))},function(e,t,n){"use strict";n.r(t),n.d(t,"stack",(function(){return u}));var r=n(3),a=n(4),s=n(1),o=n(8),i=n(2);const u=Object(i.b)({stack_:function(e,t=0){const n=Object(s.b)(e,"tensors","stack","string_or_numeric");o.c(n.length>=1,(()=>"Pass at least one tensor to tf.stack")),n.length>0&&o.c(t<=n[0].rank,(()=>"Axis must be <= rank of the tensor"));const i=n,u={axis:t};return r.a.runKernel(a.kc,i,u)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(1),a=n(30);function s(e,t,n){const s=Object(r.c)(e,n);return Object(a.a)(e,t,s,n)}},function(e,t,n){"use strict";n.r(t),n.d(t,"relu",(function(){return i}));var r=n(3),a=n(4),s=n(1),o=n(2);const i=Object(o.b)({relu_:function(e){const t={x:Object(s.a)(e,"x","relu")};return r.a.runKernel(a.xc,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(3),a=n(4),s=n(1),o=n(2);const i=Object(o.b)({real_:function(e){const t={input:Object(s.a)(e,"input","real")};return r.a.runKernel(a.uc,t)}})},function(e,t,n){"use strict";n.r(t),n.d(t,"reshape",(function(){return a})),n.d(t,"reshapeConfig",(function(){return s}));var r=n(5);function a(e){const{inputs:t,attrs:n}=e,{x:a}=t,{shape:s}=n,o=r.util.sizeFromShape(a.shape),i=r.util.inferFromImplicitShape(s,o);return r.util.assert(o===r.util.sizeFromShape(i),(()=>`new shape: ${i}, old shape: ${a.shape}. New shape and old shape must have the same number of elements.`)),e.backend.incRef(a.dataId),{dataId:a.dataId,shape:i,dtype:a.dtype}}const s={kernelName:r.Reshape,backendName:"wasm",kernelFunc:a}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"d",(function(){return p})),n.d(t,"b",(function(){return d})),n.d(t,"e",(function(){return l})),n.d(t,"c",(function(){return c}));var r=n(8),a=n(25);const s="://";class o{constructor(){this.managers={}}static getInstance(){return null==o.instance&&(o.instance=new o),o.instance}static registerManager(e,t){Object(r.c)(null!=e,(()=>"scheme must not be undefined or null.")),e.endsWith(s)&&(e=e.slice(0,e.indexOf(s))),Object(r.c)(e.length>0,(()=>"scheme must not be an empty string."));const n=o.getInstance();Object(r.c)(null==n.managers[e],(()=>`A model store manager is already registered for scheme '${e}'.`)),n.managers[e]=t}static getManager(e){const t=o.getInstance().managers[e];if(null==t)throw new Error(`Cannot find model manager for scheme '${e}'`);return t}static getSchemes(){return Object.keys(o.getInstance().managers)}}function i(e){if(-1===e.indexOf(s))throw new Error(`The url string provided does not contain a scheme. Supported schemes are: ${o.getSchemes().join(",")}`);return{scheme:e.split(s)[0],path:e.split(s)[1]}}async function u(e,t,n=!1){Object(r.c)(e!==t,(()=>`Old path and new path are the same: '${e}'`));const s=a.a.getLoadHandlers(e);Object(r.c)(s.length>0,(()=>`Copying failed because no load handler is found for source URL ${e}.`)),Object(r.c)(s.length<2,(()=>`Copying failed because more than one (${s.length}) load handlers for source URL ${e}.`));const u=s[0],c=a.a.getSaveHandlers(t);Object(r.c)(c.length>0,(()=>`Copying failed because no save handler is found for destination URL ${t}.`)),Object(r.c)(c.length<2,(()=>`Copying failed because more than one (${s.length}) save handlers for destination URL ${t}.`));const l=c[0],d=i(e).scheme,p=i(e).path,f=d===i(e).scheme,h=await u.load();n&&f&&await o.getManager(d).removeModel(p);const m=await l.save(h);return n&&!f&&await o.getManager(d).removeModel(p),m.modelArtifactsInfo}async function c(){const e=o.getSchemes(),t={};for(const n of e){const e=await o.getManager(n).listModels();for(const r in e){t[n+s+r]=e[r]}}return t}async function l(e){const t=i(e);return o.getManager(t.scheme).removeModel(t.path)}async function d(e,t){return u(e,t,!1)}async function p(e,t){return u(e,t,!0)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(3),a=n(4),s=n(1),o=n(8),i=n(14),u=n(2),c=n(7);const l=Object(u.b)({conv2d_:function(e,t,n,u,l="NHWC",d=[1,1],p){const f=Object(s.a)(e,"x","conv2d","float32"),h=Object(s.a)(t,"filter","conv2d","float32");let m=f,b=!1;3===f.rank&&(b=!0,m=Object(c.reshape)(f,[1,f.shape[0],f.shape[1],f.shape[2]])),o.c(4===m.rank,(()=>`Error in conv2d: input must be rank 4, but got rank ${m.rank}.`)),o.c(4===h.rank,(()=>`Error in conv2d: filter must be rank 4, but got rank ${h.rank}.`)),i.a("conv2d",u,p);const g="NHWC"===l?m.shape[3]:m.shape[1];o.c(g===h.shape[2],(()=>`Error in conv2d: depth of input (${g}) must match input depth for filter ${h.shape[2]}.`)),o.c(i.i(n,d),(()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${d}'`)),o.c(i.j(d),(()=>"Error in conv2D: Dilated rates should be larger than 0.")),o.c(i.j(n),(()=>"Error in conv2D: Strides should be larger than 0."));const y={x:m,filter:h},w={strides:n,pad:u,dataFormat:l,dilations:d,dimRoundingMode:p},O=r.a.runKernel(a.E,y,w);return b?Object(c.reshape)(O,[O.shape[1],O.shape[2],O.shape[3]]):O}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(3),a=n(4),s=n(1),o=n(2);const i=Object(o.b)({imag_:function(e){const t={input:Object(s.a)(e,"input","imag")};return r.a.runKernel(a.wb,t)}})},function(e,t,n){"use strict";n.r(t),n.d(t,"mean",(function(){return i}));var r=n(3),a=n(4),s=n(1),o=n(2);const i=Object(o.b)({mean_:function(e,t=null,n=!1){const o={x:Object(s.a)(e,"x","mean")},i={axis:t,keepDims:n};return r.a.runKernel(a.Wb,o,i)}})},function(e,t,n){"use strict";n.r(t),n.d(t,"minimum",(function(){return l}));var r=n(3),a=n(4),s=n(12),o=n(1),i=n(16),u=n(15),c=n(2);const l=Object(c.b)({minimum_:function(e,t){let n=Object(o.a)(e,"a","minimum"),c=Object(o.a)(t,"b","minimum");[n,c]=Object(s.makeTypesMatch)(n,c),"bool"===n.dtype&&(n=Object(u.a)(n,"int32"),c=Object(u.a)(c,"int32")),Object(i.assertAndGetBroadcastShape)(n.shape,c.shape);const l={a:n,b:c};return r.a.runKernel(a.Yb,l)}})},function(e,t,n){"use strict";n.r(t),n.d(t,"transpose",(function(){return f}));var r=n(3),a=n(13),s=n(4),o=n(1),i=n(8),u=n(31),c=n(50),l=n(27),d=n(2),p=n(46);const f=Object(d.b)({transpose_:function(e,t,n){const d=Object(o.a)(e,"x","transpose");if(null==t&&(t=d.shape.map(((e,t)=>t)).reverse()),i.c(d.rank===t.length,(()=>`Error in transpose: rank of input ${d.rank} must match length of perm ${t}.`)),t.forEach((e=>{i.c(e>=0&&e<d.rank,(()=>"All entries in 'perm' must be between 0 and "+(d.rank-1)+` but got ${t}`))})),d.rank<=1)return d.clone();const f={x:d},h={perm:t};return"complex64"===d.dtype?Object(a.t)((()=>{let e=Object(p.a)(d),t=Object(c.a)(d);return e=r.a.runKernel(s.rd,{x:e},h),t=r.a.runKernel(s.rd,{x:t},h),n&&(t=Object(l.a)(t)),Object(u.a)(e,t)})):r.a.runKernel(s.rd,f,h)}})},function(e,t,n){"use strict";n.r(t),n.d(t,"squeeze",(function(){return i}));var r=n(1),a=n(8),s=n(2),o=n(7);const i=Object(s.b)({squeeze_:function(e,t){const n=Object(r.a)(e,"x","squeeze","string_or_numeric");return Object(o.reshape)(n,Object(a.Q)(n.shape,t).newShape)}})},function(e,t,n){"use strict";n.d(t,"c",(function(){return a})),n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return o}));const r={};function a(e,t){const n={tfOpName:e,category:"custom",inputs:[],attrs:[],customExecutor:t};r[e]=n}function s(e){return r[e]}function o(e){delete r[e]}},function(e,t,n){"use strict";(function(e,r){let a;function s(){if(null==a){let t;if("undefined"!=typeof window)t=window;else if("undefined"!=typeof e)t=e;else if("undefined"!=typeof r)t=r;else{if("undefined"==typeof self)throw new Error("Could not find a global object");t=self}a=t}return a}function o(e,t){const n=function(){const e=s();return null==e._tfGlobals&&(e._tfGlobals=new Map),e._tfGlobals}();if(n.has(e))return n.get(e);{const r=t();return n.set(e,r),n.get(e)}}n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return o}))}).call(this,n(63),n(58))},,function(e,t){var n,r,a=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(n===setTimeout)return setTimeout(e,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(e){n=s}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var u,c=[],l=!1,d=-1;function p(){l&&u&&(l=!1,u.length?c=u.concat(c):d=-1,c.length&&f())}function f(){if(!l){var e=i(p);l=!0;for(var t=c.length;t;){for(u=c,c=[];++d<t;)u&&u[d].run();d=-1,t=c.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function m(){}a.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new h(e,t)),1!==c.length||l||i(f)},h.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=m,a.addListener=m,a.once=m,a.off=m,a.removeListener=m,a.removeAllListeners=m,a.emit=m,a.prependListener=m,a.prependOnceListener=m,a.listeners=function(e){return[]},a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){(function(t){e.exports=t}).call(this,{})},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(3),a=n(4),s=n(1),o=n(8),i=n(14),u=n(2),c=n(7);const l=Object(u.b)({depthwiseConv2d_:function(e,t,n,u,l="NHWC",d=[1,1],p){const f=Object(s.a)(e,"x","depthwiseConv2d","float32"),h=Object(s.a)(t,"filter","depthwiseConv2d","float32");let m=f,b=!1;3===f.rank&&(b=!0,m=Object(c.reshape)(f,[1,f.shape[0],f.shape[1],f.shape[2]])),o.c(4===m.rank,(()=>`Error in depthwiseConv2d: input must be rank 4, but got rank ${m.rank}.`)),o.c(4===h.rank,(()=>`Error in depthwiseConv2d: filter must be rank 4, but got rank ${h.rank}.`));const g="NHWC"===l?m.shape[3]:m.shape[1];o.c(g===h.shape[2],(()=>`Error in depthwiseConv2d: number of input channels (${g}) must match the inChannels dimension in filter ${h.shape[2]}.`)),i.a("depthwiseConv2d",u,p);const y={x:m,filter:h},w={strides:n,pad:u,dataFormat:l,dilations:d,dimRoundingMode:p},O=r.a.runKernel(a.R,y,w);return b?Object(c.reshape)(O,[O.shape[1],O.shape[2],O.shape[3]]):O}})},function(e,t,n){"use strict";(function(e){n(3);var t=n(71),r=n(11);const a=Object(r.c)();a.registerFlag("DEBUG",(()=>!1),(e=>{e&&console.warn("Debugging mode is ON. The output of every math call will be downloaded to CPU and checked for NaNs. This significantly impacts performance.")})),a.registerFlag("IS_BROWSER",(()=>t.isBrowser())),a.registerFlag("IS_NODE",(()=>"undefined"!=typeof e&&"undefined"!=typeof e.versions&&"undefined"!=typeof e.versions.node)),a.registerFlag("IS_CHROME",(()=>"undefined"!=typeof navigator&&null!=navigator&&null!=navigator.userAgent&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor))),a.registerFlag("IS_SAFARI",(()=>"undefined"!=typeof navigator&&null!=navigator&&null!=navigator.userAgent&&/Safari/.test(navigator.userAgent)&&/Apple/.test(navigator.vendor))),a.registerFlag("PROD",(()=>!1)),a.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY",(()=>a.getBool("DEBUG"))),a.registerFlag("DEPRECATION_WARNINGS_ENABLED",(()=>!0)),a.registerFlag("IS_TEST",(()=>!1)),a.registerFlag("CHECK_COMPUTATION_FOR_ERRORS",(()=>a.getBool("DEBUG"))),a.registerFlag("WRAP_TO_IMAGEBITMAP",(()=>!1)),a.registerFlag("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU",(()=>!1)),a.registerFlag("USE_SETTIMEOUTCUSTOM",(()=>!1))}).call(this,n(58))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return a}));class r{constructor(e,t){this.backend=e,this.dataMover=t,this.data=new WeakMap,this.dataIdsCount=0}get(e){return this.data.has(e)||this.dataMover.moveData(this.backend,e),this.data.get(e)}set(e,t){this.dataIdsCount++,this.data.set(e,t)}has(e){return this.data.has(e)}delete(e){return this.dataIdsCount--,this.data.delete(e)}numDataIds(){return this.dataIdsCount}}class a{refCount(e){return s("refCount")}incRef(e){return s("incRef")}timerAvailable(){return!0}time(e){return s("time")}read(e){return s("read")}readSync(e){return s("readSync")}readToGPU(e,t){return s("readToGPU")}numDataIds(){return s("numDataIds")}disposeData(e,t){return s("disposeData")}write(e,t,n){return s("write")}move(e,t,n,r,a){return s("move")}createTensorFromGPUData(e,t,n){return s("createTensorFromGPUData")}memory(){return s("memory")}floatPrecision(){return s("floatPrecision")}epsilon(){return 32===this.floatPrecision()?1e-7:1e-4}dispose(){return s("dispose")}}function s(e){throw new Error(`'${e}' not yet implemented or not found in the registry. This kernel may not be supported by the tfjs backend you have chosen`)}},function(e,t,n){"use strict";n.r(t),n.d(t,"maximum",(function(){return l}));var r=n(3),a=n(4),s=n(12),o=n(1),i=n(16),u=n(15),c=n(2);const l=Object(c.b)({maximum_:function(e,t){let n=Object(o.a)(e,"a","maximum"),c=Object(o.a)(t,"b","maximum");[n,c]=Object(s.makeTypesMatch)(n,c),"bool"===n.dtype&&(n=Object(u.a)(n,"int32"),c=Object(u.a)(c,"int32")),Object(i.assertAndGetBroadcastShape)(n.shape,c.shape);const l={a:n,b:c};return r.a.runKernel(a.Vb,l)}})},function(e,t,n){"use strict";n.r(t),n.d(t,"avgPool",(function(){return d}));var r=n(3),a=n(4),s=n(1),o=n(8),i=n(15),u=n(14),c=n(2),l=n(7);const d=Object(c.b)({avgPool_:function(e,t,n,c,d){const p=Object(s.a)(e,"x","avgPool","float32");o.c(u.i(n,1),(()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${n} and dilations '1'`));let f=p,h=!1;3===p.rank&&(h=!0,f=Object(l.reshape)(p,[1,p.shape[0],p.shape[1],p.shape[2]])),o.c(4===f.rank,(()=>`Error in avgPool: x must be rank 4 but got rank ${f.rank}.`)),u.a("avgPool",c,d);const m={x:f},b={filterSize:t,strides:n,pad:c,dimRoundingMode:d};let g=r.a.runKernel(a.o,m,b);return g=Object(i.a)(g,p.dtype),h?Object(l.reshape)(g,[g.shape[1],g.shape[2],g.shape[3]]):g}})},function(e,t,n){"use strict";n.r(t),n.d(t,"relu6",(function(){return i}));var r=n(3),a=n(4),s=n(1),o=n(2);const i=Object(o.b)({relu6_:function(e){const t={x:Object(s.a)(e,"x","relu6")};return r.a.runKernel(a.yc,t)}})},function(e,t,n){"use strict";n.r(t),n.d(t,"identity",(function(){return a})),n.d(t,"identityConfig",(function(){return s}));var r=n(5);function a(e){const{inputs:{x:t},backend:n}=e;if("string"===t.dtype)return Object(r.tensor)(n.readSync(t.dataId),t.shape,t.dtype);const a=n.makeOutput(t.shape,t.dtype),s=n.typedArrayFromHeap(t);return n.typedArrayFromHeap(a).set(s),a}const s={kernelName:r.Identity,backendName:"wasm",kernelFunc:a}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r={float32:4,float16:2,int32:4,uint16:2,uint8:1,bool:1,complex64:8}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return s}));var r=n(5);function a(e,t,n,a){const s=r.util.getArrayFromDType(n,r.util.sizeFromShape(t));if(a&&"string"!==n){let t=0;e.forEach((e=>{const n=r.util.sizeFromShape(e.shape);s.set(e.vals,t),t+=n}))}else{let a=0;e.forEach((e=>{const o="string"===n?r.backend_util.fromUint8ToStringArray(e.vals):e.vals;let i=0;for(let n=0;n<e.shape[0];++n){const r=n*t[1]+a;for(let t=0;t<e.shape[1];++t)s[r+t]=o[i++]}a+=e.shape[1]}))}return s}function s(e,t,n,a,s){const o=r.slice_util.isSliceContinous(a,t,n),i=r.util.sizeFromShape(n),u=r.util.computeStrides(a);if(o){const n=r.slice_util.computeFlatOffset(t,u);return"string"===s?e.slice(n,n+i):e.subarray(n,n+i)}const c="string"===s?r.backend_util.fromUint8ToStringArray(e):e,l=Object(r.buffer)(a,s,c),d=Object(r.buffer)(n,s);for(let e=0;e<d.size;++e){const n=d.indexToLoc(e),r=n.map(((e,n)=>e+t[n]));d.set(l.get(...r),...n)}return"string"===s?r.backend_util.fromStringArrayToUint8(d.values):d.values}r.Slice},function(e,t,n){"use strict";let r;function a(e){r=e}function s(e){if(void 0!==r)return r;if(e||"undefined"!=typeof navigator&&null!=navigator){if(e||(e=navigator),"ReactNative"===e.product)return!0;const t=e.userAgent||e.vendor||("undefined"!=typeof window?window.opera:"");if(!t){const t=e;return t.userAgentData&&t.userAgentData.mobile}return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))}return!1}function o(){return"undefined"!=typeof window&&null!=window.document||"undefined"!=typeof WorkerGlobalScope}n.r(t),n.d(t,"mockIsMobile",(function(){return a})),n.d(t,"isMobile",(function(){return s})),n.d(t,"isBrowser",(function(){return o}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(3),a=n(4),s=n(1),o=n(2);const i=Object(o.b)({elu_:function(e){const t={x:Object(s.a)(e,"x","elu","float32")};return r.a.runKernel(a.ab,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(3),a=n(4),s=n(1),o=n(2);const i=Object(o.b)({leakyRelu_:function(e,t=.2){const n={x:Object(s.a)(e,"x","leakyRelu")},o={alpha:t};return r.a.runKernel(a.Cb,n,o)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(3),a=n(4),s=n(1),o=n(2);const i=Object(o.b)({prelu_:function(e,t){const n={x:Object(s.a)(e,"x","prelu"),alpha:Object(s.a)(t,"alpha","prelu")};return r.a.runKernel(a.oc,n)}})},function(e,t,n){"use strict";function r(e,t=!1){console.log(e.toString(t))}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(3),a=n(4),s=n(1),o=n(2);const i=Object(o.b)({step_:function(e,t=0){const n={x:Object(s.a)(e,"x","step")},o={alpha:t};return r.a.runKernel(a.ed,n,o)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return h}));n(62);var r=n(11),a=n(21),s=n(25),o=n(29);const i="tensorflowjs",u="models_store",c="model_info_store";function l(){if(!Object(r.c)().getBool("IS_BROWSER"))throw new Error("Failed to obtain IndexedDB factory because the current environmentis not a web browser.");const e="undefined"==typeof window?self:window,t=e.indexedDB||e.mozIndexedDB||e.webkitIndexedDB||e.msIndexedDB||e.shimIndexedDB;if(null==t)throw new Error("The current browser does not appear to support IndexedDB.");return t}function d(e){const t=e.result;t.createObjectStore(u,{keyPath:"modelPath"}),t.createObjectStore(c,{keyPath:"modelPath"})}class p{constructor(e){if(this.indexedDB=l(),null==e||!e)throw new Error("For IndexedDB, modelPath must not be null, undefined or empty.");this.modelPath=e}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");return this.databaseAction(this.modelPath,e)}async load(){return this.databaseAction(this.modelPath)}databaseAction(e,t){return new Promise(((e,n)=>{const r=this.indexedDB.open(i,1);r.onupgradeneeded=()=>d(r),r.onsuccess=()=>{const s=r.result;if(null==t){const t=s.transaction(u,"readonly"),r=t.objectStore(u).get(this.modelPath);r.onsuccess=()=>{if(null==r.result)return s.close(),n(new Error(`Cannot find model with path '${this.modelPath}' in IndexedDB.`));e(r.result.modelArtifacts)},r.onerror=e=>(s.close(),n(r.error)),t.oncomplete=()=>s.close()}else{t.weightData=o.a.join(t.weightData);const r=Object(a.i)(t),i=s.transaction(c,"readwrite");let l,d,p=i.objectStore(c);try{l=p.put({modelPath:this.modelPath,modelArtifactsInfo:r})}catch(e){return n(e)}l.onsuccess=()=>{d=s.transaction(u,"readwrite");const a=d.objectStore(u);let o;try{o=a.put({modelPath:this.modelPath,modelArtifacts:t,modelArtifactsInfo:r})}catch(e){return n(e)}o.onsuccess=()=>e({modelArtifactsInfo:r}),o.onerror=e=>{p=i.objectStore(c);const t=p.delete(this.modelPath);t.onsuccess=()=>(s.close(),n(o.error)),t.onerror=e=>(s.close(),n(o.error))}},l.onerror=e=>(s.close(),n(l.error)),i.oncomplete=()=>{null==d?s.close():d.oncomplete=()=>s.close()}}},r.onerror=e=>n(r.error)}))}}p.URL_SCHEME="indexeddb://";const f=e=>{return Object(r.c)().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(p.URL_SCHEME)?(t=e.slice(p.URL_SCHEME.length),new p(t)):null;var t};s.a.registerSaveRouter(f),s.a.registerLoadRouter(f);class h{constructor(){this.indexedDB=l()}async listModels(){return new Promise(((e,t)=>{const n=this.indexedDB.open(i,1);n.onupgradeneeded=()=>d(n),n.onsuccess=()=>{const r=n.result,a=r.transaction(c,"readonly"),s=a.objectStore(c).getAll();s.onsuccess=()=>{const t={};for(const e of s.result)t[e.modelPath]=e.modelArtifactsInfo;e(t)},s.onerror=e=>(r.close(),t(s.error)),a.oncomplete=()=>r.close()},n.onerror=e=>t(n.error)}))}async removeModel(e){var t;return e=(t=e).startsWith(p.URL_SCHEME)?t.slice(p.URL_SCHEME.length):t,new Promise(((t,n)=>{const r=this.indexedDB.open(i,1);r.onupgradeneeded=()=>d(r),r.onsuccess=()=>{const a=r.result,s=a.transaction(c,"readwrite"),o=s.objectStore(c),i=o.get(e);let l;i.onsuccess=()=>{if(null==i.result)return a.close(),n(new Error(`Cannot find model with path '${e}' in IndexedDB.`));{const r=o.delete(e),s=()=>{l=a.transaction(u,"readwrite");const r=l.objectStore(u).delete(e);r.onsuccess=()=>t(i.result.modelArtifactsInfo),r.onerror=e=>n(i.error)};r.onsuccess=s,r.onerror=e=>(s(),a.close(),n(i.error))}},i.onerror=e=>(a.close(),n(i.error)),s.oncomplete=()=>{null==l?a.close():l.oncomplete=()=>a.close()}},r.onerror=e=>n(r.error)}))}}},function(e,t,n){"use strict";function r(e){return e instanceof Float32Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return y})),n.d(t,"b",(function(){return O}));n(62);var r=n(11),a=n(8),s=n(21),o=n(29),i=n(25);const u="/",c="tensorflowjs_models",l="info",d="model_topology",p="weight_specs",f="weight_data",h="model_metadata";function m(e){return{info:[c,e,l].join(u),topology:[c,e,d].join(u),weightSpecs:[c,e,p].join(u),weightData:[c,e,f].join(u),modelMetadata:[c,e,h].join(u)}}function b(e){for(const t of Object.values(e))window.localStorage.removeItem(t)}function g(e){const t=e.split(u);if(t.length<3)throw new Error(`Invalid key format: ${e}`);return t.slice(1,t.length-1).join(u)}class y{constructor(e){if(!Object(r.c)().getBool("IS_BROWSER")||"undefined"==typeof window||"undefined"==typeof window.localStorage)throw new Error("The current environment does not support local storage.");if(this.LS=window.localStorage,null==e||!e)throw new Error("For local storage, modelPath must not be null, undefined or empty.");this.modelPath=e,this.keys=m(this.modelPath)}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");{const t=JSON.stringify(e.modelTopology),n=JSON.stringify(e.weightSpecs),r=Object(s.i)(e),a=o.a.join(e.weightData);try{this.LS.setItem(this.keys.info,JSON.stringify(r)),this.LS.setItem(this.keys.topology,t),this.LS.setItem(this.keys.weightSpecs,n),this.LS.setItem(this.keys.weightData,Object(s.a)(a));const o={format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,signature:null!=e.signature?e.signature:void 0,userDefinedMetadata:null!=e.userDefinedMetadata?e.userDefinedMetadata:void 0,modelInitializer:null!=e.modelInitializer?e.modelInitializer:void 0,initializerSignature:null!=e.initializerSignature?e.initializerSignature:void 0,trainingConfig:null!=e.trainingConfig?e.trainingConfig:void 0};return this.LS.setItem(this.keys.modelMetadata,JSON.stringify(o)),{modelArtifactsInfo:r}}catch(e){throw b(this.keys),new Error(`Failed to save model '${this.modelPath}' to local storage: size quota being exceeded is a possible cause of this failure: modelTopologyBytes=${r.modelTopologyBytes}, weightSpecsBytes=${r.weightSpecsBytes}, weightDataBytes=${r.weightDataBytes}.`)}}}async load(){const e=JSON.parse(this.LS.getItem(this.keys.info));if(null==e)throw new Error(`In local storage, there is no model with name '${this.modelPath}'`);if("JSON"!==e.modelTopologyType)throw new Error("BrowserLocalStorage does not support loading non-JSON model topology yet.");const t={},n=JSON.parse(this.LS.getItem(this.keys.topology));if(null==n)throw new Error(`In local storage, the topology of model '${this.modelPath}' is missing.`);t.modelTopology=n;const r=JSON.parse(this.LS.getItem(this.keys.weightSpecs));if(null==r)throw new Error(`In local storage, the weight specs of model '${this.modelPath}' are missing.`);t.weightSpecs=r;const a=this.LS.getItem(this.keys.modelMetadata);if(null!=a){const e=JSON.parse(a);t.format=e.format,t.generatedBy=e.generatedBy,t.convertedBy=e.convertedBy,null!=e.signature&&(t.signature=e.signature),null!=e.userDefinedMetadata&&(t.userDefinedMetadata=e.userDefinedMetadata),null!=e.modelInitializer&&(t.modelInitializer=e.modelInitializer),null!=e.initializerSignature&&(t.initializerSignature=e.initializerSignature),null!=e.trainingConfig&&(t.trainingConfig=e.trainingConfig)}const o=this.LS.getItem(this.keys.weightData);if(null==o)throw new Error(`In local storage, the binary weight values of model '${this.modelPath}' are missing.`);return t.weightData=Object(s.b)(o),t}}y.URL_SCHEME="localstorage://";const w=e=>{return Object(r.c)().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(y.URL_SCHEME)?(t=e.slice(y.URL_SCHEME.length),new y(t)):null;var t};i.a.registerSaveRouter(w),i.a.registerLoadRouter(w);class O{constructor(){Object(a.c)(Object(r.c)().getBool("IS_BROWSER"),(()=>"Current environment is not a web browser")),Object(a.c)("undefined"==typeof window||"undefined"!=typeof window.localStorage,(()=>"Current browser does not appear to support localStorage")),this.LS=window.localStorage}async listModels(){const e={},t=c+u,n=u+l;for(let r=0;r<this.LS.length;++r){const a=this.LS.key(r);if(a.startsWith(t)&&a.endsWith(n)){e[g(a)]=JSON.parse(this.LS.getItem(a))}}return e}async removeModel(e){var t;const n=m(e=(t=e).startsWith(y.URL_SCHEME)?t.slice(y.URL_SCHEME.length):t);if(null==this.LS.getItem(n.info))throw new Error(`Cannot find model at path '${e}'`);const r=JSON.parse(this.LS.getItem(n.info));return b(n),r}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(3),a=n(4),s=n(8),o=n(14),i=n(2),u=n(7);const c=Object(i.b)({conv2DBackpropInput_:function(e,t,n,i,c,l="NHWC",d){s.c(e.length===t.rank,(()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`));let p=e,f=t,h=!1;3===t.rank&&(h=!0,f=Object(u.reshape)(t,[1,t.shape[0],t.shape[1],t.shape[2]]),p=[1,e[0],e[1],e[2]]),s.c(4===p.length,(()=>`Error in conv2dDerInput: inShape must be length 4, but got length ${p.length}.`)),s.c(4===f.rank,(()=>`Error in conv2dDerInput: dy must be rank 4, but got rank ${f.rank}`)),s.c(4===n.rank,(()=>`Error in conv2dDerInput: filter must be rank 4, but got rank ${n.rank}`));const m="NHWC"===l?p[3]:p[1],b="NHWC"===l?f.shape[3]:f.shape[1];s.c(m===n.shape[2],(()=>`Error in conv2dDerInput: depth of input (${m}) must match input depth for filter ${n.shape[2]}.`)),s.c(b===n.shape[3],(()=>`Error in conv2dDerInput: depth of output (${b}) must match output depth for filter ${n.shape[3]}.`)),o.a("conv2dDerInput",c,d);const g={dy:f,filter:n},y={strides:i,pad:c,dataFormat:l,dimRoundingMode:d,inputShape:p},w=r.a.runKernel(a.G,g,y);return h?Object(u.reshape)(w,[w.shape[1],w.shape[2],w.shape[3]]):w}})},function(e,t,n){"use strict";n.r(t),n.d(t,"expandDims",(function(){return s})),n.d(t,"expandDimsConfig",(function(){return o}));var r=n(5),a=n(47);function s(e){const{inputs:t,attrs:n,backend:s}=e,{input:o}=t,{dim:i}=n,u=o.shape.length,c=o.shape.slice();let l=i;return i<0&&(r.util.assert(-(u+1)<=i,(()=>`Axis must be in the interval [${-(u+1)}, ${u}]`)),l=u+i+1),c.splice(l,0,1),Object(a.reshape)({inputs:{x:o},backend:s,attrs:{shape:c}})}const o={kernelName:r.ExpandDims,backendName:"wasm",kernelFunc:s}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(5),a=n(33);function s(e,t){let n;return{kernelName:e,backendName:"wasm",setupFunc:function(t){n=t.wasm.cwrap(e,null,["number","number","number"])},kernelFunc:function(e){const{backend:s,inputs:{x:o}}=e,i=s.dataIdMap.get(o.dataId).id,u=s.makeOutput(o.shape,t||o.dtype),c=s.dataIdMap.get(u.dataId).id;return 0===r.util.sizeFromShape(u.shape)||n(i,a.a[o.dtype],c),u}}}},function(e,t,n){var r=n(131),a=n(132),s=n(133),o=n(134),i=n(135),u=n(136),c=n(137);c.alea=r,c.xor128=a,c.xorwow=s,c.xorshift7=o,c.xor4096=i,c.tychei=u,e.exports=c},function(e,t,n){"use strict";n.r(t),n.d(t,"softmax",(function(){return i}));var r=n(3),a=n(4),s=n(1),o=n(2);const i=Object(o.b)({softmax_:function(e,t=-1){const n=Object(s.a)(e,"logits","softmax","float32");if(-1===t&&(t=n.rank-1),t!==n.rank-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and dim was ${t}`);const o={logits:n},i={dim:t};return r.a.runKernel(a.Rc,o,i)}})},function(e,t,n){"use strict";n.r(t),n.d(t,"stridedSlice",(function(){return i}));var r=n(3),a=n(4),s=n(1),o=n(2);const i=Object(o.b)({stridedSlice_:function(e,t,n,o,i=0,u=0,c=0,l=0,d=0){const p={x:Object(s.a)(e,"x","stridedSlice","string_or_numeric")},f={begin:t,end:n,strides:o,beginMask:i,endMask:u,ellipsisMask:c,newAxisMask:l,shrinkAxisMask:d};return r.a.runKernel(a.fd,p,f)}})},function(e,t,n){"use strict";n.r(t),n.d(t,"matMul",(function(){return m}));var r=n(3),a=n(23),s=n(4),o=n(12),i=n(1),u=n(8),c=n(10),l=n(16),d=n(26),p=n(19),f=n(2),h=n(7);const m=Object(f.b)({fusedMatMul_:function({a:e,b:t,transposeA:n=!1,transposeB:f=!1,bias:m,activation:b="linear",preluActivationWeights:g,leakyreluAlpha:y=.2}){if(!1===Object(d.d)(r.a.state.gradientDepth,b)){let r=Object(p.a)(e,t,n,f);return null!=m&&(r=Object(c.add)(r,m)),Object(d.a)(r,b,g,y)}let w=Object(i.a)(e,"a","fused matMul"),O=Object(i.a)(t,"b","fused matMul");[w,O]=Object(o.makeTypesMatch)(w,O);const v=n?w.shape[w.rank-2]:w.shape[w.rank-1],j=f?O.shape[O.rank-1]:O.shape[O.rank-2],_=n?w.shape[w.rank-1]:w.shape[w.rank-2],x=f?O.shape[O.rank-2]:O.shape[O.rank-1],S=w.shape.slice(0,-2),k=O.shape.slice(0,-2),E=u.O(S),T=u.O(k);u.c(v===j,(()=>`Error in fused matMul: inner shapes (${v}) and (${j}) of Tensors with shapes ${w.shape} and ${O.shape} and transposeA=${n} and transposeB=${f} must match.`));const N=l.assertAndGetBroadcastShape(w.shape.slice(0,-2),O.shape.slice(0,-2)).concat([_,x]),A=n?Object(h.reshape)(w,[E,v,_]):Object(h.reshape)(w,[E,_,v]),M=f?Object(h.reshape)(O,[T,x,j]):Object(h.reshape)(O,[T,j,x]);let I,D;null!=m&&(I=Object(i.a)(m,"bias","fused matMul"),[I]=Object(o.makeTypesMatch)(I,w),l.assertAndGetBroadcastShape(N,I.shape)),null!=g&&(D=Object(i.a)(g,"prelu weights","fused matMul"));const $=(e,t)=>{const[r,a,s,o]=t,i=Object(d.c)(Object(h.reshape)(e,s.shape),s,b);let u,c;if(n||f?!n&&f?(u=Object(p.a)(i,a,!1,!1),c=Object(p.a)(i,r,!0,!1)):n&&!f?(u=Object(p.a)(a,i,!1,!0),c=Object(p.a)(r,i,!1,!1)):(u=Object(p.a)(a,i,!0,!0),c=Object(p.a)(i,r,!0,!0)):(u=Object(p.a)(i,a,!1,!0),c=Object(p.a)(r,i,!0,!1)),null!=m){return[u,c,Object(d.b)(o,i)]}return[u,c]},C={a:A,b:M,bias:I,preluActivationWeights:D},R={transposeA:n,transposeB:f,activation:b,leakyreluAlpha:y};if(null==m){const e=Object(a.a)(((e,t,n)=>{const a=r.a.runKernel(s.xd,C,R);return n([e,t,a]),{value:Object(h.reshape)(a,N),gradFunc:$}}));return e(A,M)}{const e=Object(a.a)(((e,t,n,a)=>{const o=r.a.runKernel(s.xd,C,R);return a([e,t,o,n]),{value:Object(h.reshape)(o,N),gradFunc:$}}));return e(A,M,I)}}})},function(e,t,n){"use strict";n.r(t),n.d(t,"depthwiseConv2d",(function(){return y}));var r=n(3),a=n(23),s=n(4),o=n(12),i=n(1),u=n(8),c=n(10),l=n(16),d=n(14),p=n(61),f=n(2),h=n(7);const m=Object(f.b)({depthwiseConv2dNativeBackpropFilter_:function(e,t,n,a,o,i=[1,1],u){let c=e;3===e.rank&&(c=Object(h.reshape)(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let l=t;3===l.rank&&(l=Object(h.reshape)(t,[1,t.shape[0],t.shape[1],t.shape[2]]));const d={x:c,dy:l},p={strides:a,pad:o,dimRoundingMode:u,dilations:i,filterShape:n};return r.a.runKernel(s.S,d,p)}});const b=Object(f.b)({depthwiseConv2dNativeBackpropInput_:function(e,t,n,a,o,i=[1,1],u){let c=t,l=!1;3===t.rank&&(l=!0,c=Object(h.reshape)(t,[1,t.shape[0],t.shape[1],t.shape[2]]));const d={dy:c,filter:n},p={strides:a,pad:o,dimRoundingMode:u,dilations:i,inputShape:e},f=r.a.runKernel(s.T,d,p);return l?Object(h.reshape)(f,[f.shape[1],f.shape[2],f.shape[3]]):f}});var g=n(26);const y=Object(f.b)({fusedDepthwiseConv2d_:function({x:e,filter:t,strides:n,pad:f,dataFormat:y="NHWC",dilations:w=[1,1],dimRoundingMode:O,bias:v,activation:j="linear",preluActivationWeights:_,leakyreluAlpha:x}){if(!1===Object(g.d)(r.a.state.gradientDepth,j)){let r=Object(p.a)(e,t,n,f,y,w,O);return null!=v&&(r=Object(c.add)(r,v)),Object(g.a)(r,j,_,x)}const S=Object(i.a)(e,"x","depthwiseConv2d","float32"),k=Object(i.a)(t,"filter","depthwiseConv2d","float32");let E=S,T=!1;3===S.rank&&(T=!0,E=Object(h.reshape)(S,[1,S.shape[0],S.shape[1],S.shape[2]])),u.c(4===E.rank,(()=>`Error in fused depthwiseConv2d: input must be rank 4, but got rank ${E.rank}.`)),u.c(4===k.rank,(()=>`Error in fused depthwiseConv2d: filter must be rank 4, but got rank ${k.rank}.`)),u.c(E.shape[3]===k.shape[2],(()=>`Error in fused depthwiseConv2d: number of input channels (${E.shape[3]}) must match the inChannels dimension in filter ${k.shape[2]}.`)),null==w&&(w=[1,1]),u.c(d.i(n,w),(()=>`Error in fused depthwiseConv2d: Either strides or dilations must be 1. Got strides ${n} and dilations '${w}'`)),d.a("fused depthwiseConv2d",f,O);const N=d.b(E.shape,k.shape,n,w,f,O,!0);let A,M;null!=v&&(A=Object(i.a)(v,"bias","fused conv2d"),[A]=Object(o.makeTypesMatch)(A,S),l.assertAndGetBroadcastShape(N.outShape,A.shape)),null!=_&&(M=Object(i.a)(_,"prelu weights","fused depthwiseConv2d"));const I=(e,t)=>{u.c(d.k(w),(()=>`Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '${w}'`));const[r,a,s,o]=t,i=Object(g.c)(e,s,j),c=b(a.shape,i,r,n,f,w,O),l=m(a,i,r.shape,n,f,w,O);if(null!=o){return[c,l,Object(g.b)(A,i)]}return[c,l]},D={x:E,filter:k,bias:A,preluActivationWeights:M},$={strides:n,pad:f,dataFormat:y,dilations:w,dimRoundingMode:O,activation:j,leakyreluAlpha:x};if(null==v){const e=Object(a.a)(((e,t,n)=>{let a=r.a.runKernel(s.pb,D,$);return n([t,e,a]),T&&(a=Object(h.reshape)(a,[a.shape[1],a.shape[2],a.shape[3]])),{value:a,gradFunc:I}}));return e(E,k)}{const e=Object(a.a)(((e,t,n,a)=>{let o=r.a.runKernel(s.pb,D,$);return a([t,e,o,n]),T&&(o=Object(h.reshape)(o,[o.shape[1],o.shape[2],o.shape[3]])),{value:o,gradFunc:I}}));return e(E,k,A)}}})},function(e,t,n){"use strict";n.r(t),n.d(t,"conv2d",(function(){return y}));var r=n(3),a=n(23),s=n(4),o=n(12),i=n(1),u=n(8),c=n(10),l=n(16),d=n(49),p=n(14),f=n(2),h=n(7);const m=Object(f.b)({conv2DBackpropFilter_:function(e,t,n,a,o,i="NHWC",c){let l=e;3===e.rank&&(l=Object(h.reshape)(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let d=t;3===d.rank&&(d=Object(h.reshape)(t,[1,t.shape[0],t.shape[1],t.shape[2]])),u.c(4===l.rank,(()=>`Error in conv2dDerFilter: input must be rank 4, but got shape ${l.shape}.`)),u.c(4===d.rank,(()=>`Error in conv2dDerFilter: dy must be rank 4, but got shape ${d.shape}.`)),u.c(4===n.length,(()=>`Error in conv2dDerFilter: filterShape must be length 4, but got ${n}.`));const f="NHWC"===i?l.shape[3]:l.shape[1],m="NHWC"===i?d.shape[3]:d.shape[1];u.c(f===n[2],(()=>`Error in conv2dDerFilter: depth of input ${f}) must match input depth in filter (${n[2]}.`)),u.c(m===n[3],(()=>`Error in conv2dDerFilter: depth of dy (${m}) must match output depth for filter (${n[3]}).`)),p.a("conv2dDerFilter",o,c);const b={x:l,dy:d},g={strides:a,pad:o,dataFormat:i,dimRoundingMode:c,filterShape:n};return r.a.runKernel(s.F,b,g)}});var b=n(80),g=n(26);const y=Object(f.b)({fusedConv2d_:function({x:e,filter:t,strides:n,pad:f,dataFormat:y="NHWC",dilations:w=[1,1],dimRoundingMode:O,bias:v,activation:j="linear",preluActivationWeights:_,leakyreluAlpha:x}){if(j=j||"linear",!1===Object(g.d)(r.a.state.gradientDepth,j)){u.c("NHWC"===y,(()=>`Error in fused conv2d: got dataFormat of ${y} but only NHWC is currently supported for the case of gradient depth is 0 and the activation is not linear.`));let r=Object(d.a)(e,t,n,f,y,w,O);return null!=v&&(r=Object(c.add)(r,v)),Object(g.a)(r,j,_,x)}const S=Object(i.a)(e,"x","conv2d","float32"),k=Object(i.a)(t,"filter","conv2d","float32");let E=S,T=!1;3===S.rank&&(T=!0,E=Object(h.reshape)(S,[1,S.shape[0],S.shape[1],S.shape[2]])),u.c(4===E.rank,(()=>`Error in fused conv2d: input must be rank 4, but got rank ${E.rank}.`)),u.c(4===k.rank,(()=>`Error in fused conv2d: filter must be rank 4, but got rank ${k.rank}.`)),p.a("fused conv2d",f,O);const N="NHWC"===y?E.shape[3]:E.shape[1];u.c(k.shape[2]===N,(()=>`Error in conv2d: depth of input (${N}) must match input depth for filter ${k.shape[2]}.`)),u.c(p.i(n,w),(()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${w}'`));const A=p.b(E.shape,k.shape,n,w,f,O);let M,I;if(null!=v&&(M=Object(i.a)(v,"bias","fused conv2d"),[M]=Object(o.makeTypesMatch)(M,S),"NHWC"===y?l.assertAndGetBroadcastShape(A.outShape,M.shape):(u.c(M.shape.length<=1,(()=>`Error in fused conv2d: only supports scalar or 1-D Tensor bias for NCHW format but got the bias of rank-${M.shape.length}.`)),u.c(0===M.shape.length||M.shape[0]===A.outChannels||1===M.shape[0],(()=>`Error in fused conv2d: bias shape (${M.shape}) is not compatible with the number of output channels (${A.outChannels})`)))),null!=_){const e=_.shape;if(u.c(e.length<=1||3===e.length,(()=>`Error in fused conv2d: only supports scalar, 1-D Tensor or 3-D Tensor PReLU activation weights but got a tensor of rank-${e.length}.`)),1===e.length)u.c(1===e[0]||e[0]===A.outChannels,(()=>`Error in fused conv2d: PReLU activation weights (${e}) is not compatible with the number of output channels (${A.outChannels}).`));else if(3===e.length)try{l.assertAndGetBroadcastShape(e,A.outShape)}catch(t){const n=`Error in fused conv2d: PReLU activation weights (${e}) is not compatible with the output shape of the conv2d (${A.outShape}).`;throw Error(n)}I=Object(i.a)(_,"prelu weights","fused conv2d")}const D=(e,t)=>{u.c("NHWC"===y,(()=>`Error in gradient of fused conv2D: got dataFormat of ${y} but only NHWC is currently supported.`));const[r,a,s,o]=t,i=Object(g.c)(e,s,j);u.c(p.k(w),(()=>`Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${w}'`));const c=[Object(b.a)(a.shape,i,r,n,f),m(a,i,r.shape,n,f)];if(null!=o){const e=Object(g.b)(o,i);c.push(e)}return c},$={x:E,filter:k,bias:M,preluActivationWeights:I},C={strides:n,pad:f,dataFormat:y,dilations:w,dimRoundingMode:O,activation:j,leakyreluAlpha:x};if(null==v){const e=Object(a.a)(((e,t,n)=>{let a=r.a.runKernel(s.ob,$,C);return n([t,e,a]),T&&(a=Object(h.reshape)(a,[a.shape[1],a.shape[2],a.shape[3]])),{value:a,gradFunc:D}}));return e(E,k)}{const e=Object(a.a)(((e,t,n,a)=>{let o=r.a.runKernel(s.ob,$,C);return a([t,e,o,n]),T&&(o=Object(h.reshape)(o,[o.shape[1],o.shape[2],o.shape[3]])),{value:o,gradFunc:D}}));return e(E,k,M)}}})},function(e,t,n){"use strict";n.r(t),n.d(t,"Profiler",(function(){return o})),n.d(t,"checkComputationForErrors",(function(){return i})),n.d(t,"Logger",(function(){return u}));var r=n(11),a=n(6),s=n(8);class o{constructor(e,t){this.backendTimer=e,this.logger=t,null==t&&(this.logger=new u)}profileKernel(e,t,n){let s;const o=()=>{s=n()};let u;const c=a.now();if(this.backendTimer.timerAvailable())u=this.backendTimer.time(o);else{o();for(const e of s)e.dataSync();u=Promise.resolve({kernelMs:a.now()-c})}if(Object(r.c)().getBool("CHECK_COMPUTATION_FOR_ERRORS"))for(let t=0;t<s.length;t++){const n=s[t];n.data().then((t=>{i(t,n.dtype,e)}))}return{kernelName:e,outputs:s,inputs:t,timeMs:u.then((e=>e.kernelMs)),extraInfo:u.then((e=>null!=e.getExtraProfileInfo?e.getExtraProfileInfo():""))}}logKernelProfile(e){const{kernelName:t,outputs:n,timeMs:r,inputs:a,extraInfo:s}=e;n.forEach((e=>{Promise.all([e.data(),r,s]).then((n=>{this.logger.logKernelProfile(t,e,n[0],n[1],a,n[2])}))}))}}function i(e,t,n){if("float32"!==t)return!1;for(let t=0;t<e.length;t++){const r=e[t];if(isNaN(r)||!isFinite(r))return console.warn(`Found ${r} in the result of '${n}'`),!0}return!1}class u{logKernelProfile(e,t,n,r,a,o){const i="number"==typeof r?s.L(`${r}ms`,9):r.error,u=s.L(e,25),c=t.rank,l=t.size,d=s.L(t.shape.toString(),14);let p="";for(const e in a){const n=a[e];if(null!=n){const r=n.shape||t.shape,a=r.length;p+=`${e}: ${a}D ${a>0?r:""} `}}console.log(`%c${u}\t%c${i}\t%c${c}D ${d}\t%c${l}\t%c${p}\t%c${o}`,"font-weight:bold","color:red","color:blue","color: orange","color: green","color: steelblue")}}},function(e,t,n){"use strict";n.r(t),n.d(t,"cast",(function(){return a})),n.d(t,"castConfig",(function(){return s}));var r=n(5);function a(e){const{inputs:{x:t},attrs:{dtype:n},backend:r}=e,a=r.makeOutput(t.shape,n),s=r.typedArrayFromHeap(t);return r.typedArrayFromHeap(a).set(s),a}const s={kernelName:r.Cast,backendName:"wasm",kernelFunc:a}},function(e,t,n){"use strict";n.r(t),n.d(t,"concat",(function(){return i})),n.d(t,"concatConfig",(function(){return u}));var r=n(5),a=n(70),s=n(68),o=n(47);function i(e){const{inputs:t,backend:n}=e,i=r.util.parseAxisParam(e.attrs.axis,t[0].shape)[0],u=t.map((e=>e.shape));r.backend_util.assertParamsConsistent(u,i);let c=r.backend_util.computeOutShape(t.map((e=>e.shape)),i);const l=t.filter((e=>r.util.sizeFromShape(e.shape)>0));if(1===l.length)return Object(s.identity)({inputs:{x:l[0]},backend:n});const d=n.makeOutput(c,t[0].dtype);if(0===r.util.sizeFromShape(c))return d;if("string"===l[0].dtype){const e=l.map((e=>{const t=[-1,r.util.sizeFromShape(e.shape.slice(i))];return Object(o.reshape)({inputs:{x:e},backend:n,attrs:{shape:t}})})),s=e.map((e=>({vals:n.readSync(e.dataId),shape:e.shape})));c=r.backend_util.computeOutShape(e.map((e=>e.shape)),1);const u=1===e[0].shape[0],p=Object(a.a)(s,c,t[0].dtype,u),f=r.backend_util.computeOutShape(l.map((e=>e.shape)),i);d.shape=f;return n.dataIdMap.get(d.dataId).stringBytes=r.backend_util.fromStringArrayToUint8(p),e.forEach((e=>n.disposeData(e.dataId))),d}const p=r.util.sizeFromShape(l[0].shape.slice(0,i));let f=0;const h=l.map((e=>{const t=r.util.sizeFromShape(e.shape.slice(i));return f+=t,t})),m=l.map((e=>n.typedArrayFromHeap(e))),b=n.typedArrayFromHeap(d);for(let e=0;e<p;e++){let t=e*f;for(let n=0;n<m.length;n++){const r=h[n],a=e*r,s=m[n].subarray(a,a+r);b.set(s,t),t+=r}}return d}const u={kernelName:r.Concat,backendName:"wasm",kernelFunc:i}},function(e,t,n){"use strict";n.r(t),n.d(t,"transpose",(function(){return i})),n.d(t,"transposeConfig",(function(){return u}));var r=n(5),a=n(68),s=n(33);let o;function i(e){const{inputs:t,backend:n,attrs:r}=e,[i,u]=function(e,t){const n=[],r=[];for(let a=0;a<e.length;++a)1!==e[a]&&n.push(e[a]),1!==e[t[a]]&&r.push(t[a]);for(let e=0;e<r.length;++e){let t=-1;for(let n=0;n<r.length;++n)r[n]>=e&&(-1===t||r[t]>r[n])&&(t=n);r[t]=e}return[n,r]}(t.x.shape,r.perm);let c=!0;for(let e=0;e<u.length;e++)u[e]!==e&&(c=!1);const l=function(e,t){const n=new Array(e.length);for(let r=0;r<n.length;r++)n[r]=e[t[r]];return n}(t.x.shape,r.perm),d={dataId:t.x.dataId,shape:i,dtype:t.x.dtype};if(c){const e=Object(a.identity)({inputs:t,backend:n});return e.shape=l,e}const p=n.makeOutput(l,d.dtype),f=n.dataIdMap.get(d.dataId).id,h=n.dataIdMap.get(p.dataId).id,m=new Uint8Array(new Int32Array(u).buffer),b=new Uint8Array(new Int32Array(d.shape).buffer);return o(f,b,d.shape.length,s.a[d.dtype],h,m,u.length),p}const u={kernelName:r.Transpose,backendName:"wasm",kernelFunc:i,setupFunc:function(e){o=e.wasm.cwrap(r.Transpose,null,["number","array","number","number","number","array","number"])}}},function(e,t){e.exports=r;var n=null;try{n=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(e){}function r(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function a(e){return!0===(e&&e.__isLong__)}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0}),r.isLong=a;var s={},o={};function i(e,t){var n,r,a;return t?(a=0<=(e>>>=0)&&e<256)&&(r=o[e])?r:(n=c(e,(0|e)<0?-1:0,!0),a&&(o[e]=n),n):(a=-128<=(e|=0)&&e<128)&&(r=s[e])?r:(n=c(e,e<0?-1:0,!1),a&&(s[e]=n),n)}function u(e,t){if(isNaN(e))return t?y:g;if(t){if(e<0)return y;if(e>=h)return _}else{if(e<=-m)return x;if(e+1>=m)return j}return e<0?u(-e,t).neg():c(e%f|0,e/f|0,t)}function c(e,t,n){return new r(e,t,n)}r.fromInt=i,r.fromNumber=u,r.fromBits=c;var l=Math.pow;function d(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return g;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||36<n)throw RangeError("radix");var r;if((r=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===r)return d(e.substring(1),t,n).neg();for(var a=u(l(n,8)),s=g,o=0;o<e.length;o+=8){var i=Math.min(8,e.length-o),c=parseInt(e.substring(o,o+i),n);if(i<8){var p=u(l(n,i));s=s.mul(p).add(u(c))}else s=(s=s.mul(a)).add(u(c))}return s.unsigned=t,s}function p(e,t){return"number"==typeof e?u(e,t):"string"==typeof e?d(e,t):c(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}r.fromString=d,r.fromValue=p;var f=4294967296,h=f*f,m=h/2,b=i(1<<24),g=i(0);r.ZERO=g;var y=i(0,!0);r.UZERO=y;var w=i(1);r.ONE=w;var O=i(1,!0);r.UONE=O;var v=i(-1);r.NEG_ONE=v;var j=c(-1,2147483647,!1);r.MAX_VALUE=j;var _=c(-1,-1,!0);r.MAX_UNSIGNED_VALUE=_;var x=c(0,-2147483648,!1);r.MIN_VALUE=x;var S=r.prototype;S.toInt=function(){return this.unsigned?this.low>>>0:this.low},S.toNumber=function(){return this.unsigned?(this.high>>>0)*f+(this.low>>>0):this.high*f+(this.low>>>0)},S.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(x)){var t=u(e),n=this.div(t),r=n.mul(t).sub(this);return n.toString(e)+r.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var a=u(l(e,6),this.unsigned),s=this,o="";;){var i=s.div(a),c=(s.sub(i.mul(a)).toInt()>>>0).toString(e);if((s=i).isZero())return c+o;for(;c.length<6;)c="0"+c;o=""+c+o}},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(x)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+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(e){return a(e)||(e=p(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},S.eq=S.equals,S.notEquals=function(e){return!this.eq(e)},S.neq=S.notEquals,S.ne=S.notEquals,S.lessThan=function(e){return this.comp(e)<0},S.lt=S.lessThan,S.lessThanOrEqual=function(e){return this.comp(e)<=0},S.lte=S.lessThanOrEqual,S.le=S.lessThanOrEqual,S.greaterThan=function(e){return this.comp(e)>0},S.gt=S.greaterThan,S.greaterThanOrEqual=function(e){return this.comp(e)>=0},S.gte=S.greaterThanOrEqual,S.ge=S.greaterThanOrEqual,S.compare=function(e){if(a(e)||(e=p(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},S.comp=S.compare,S.negate=function(){return!this.unsigned&&this.eq(x)?x:this.not().add(w)},S.neg=S.negate,S.add=function(e){a(e)||(e=p(e));var t=this.high>>>16,n=65535&this.high,r=this.low>>>16,s=65535&this.low,o=e.high>>>16,i=65535&e.high,u=e.low>>>16,l=0,d=0,f=0,h=0;return f+=(h+=s+(65535&e.low))>>>16,d+=(f+=r+u)>>>16,l+=(d+=n+i)>>>16,l+=t+o,c((f&=65535)<<16|(h&=65535),(l&=65535)<<16|(d&=65535),this.unsigned)},S.subtract=function(e){return a(e)||(e=p(e)),this.add(e.neg())},S.sub=S.subtract,S.multiply=function(e){if(this.isZero())return g;if(a(e)||(e=p(e)),n)return c(n.mul(this.low,this.high,e.low,e.high),n.get_high(),this.unsigned);if(e.isZero())return g;if(this.eq(x))return e.isOdd()?x:g;if(e.eq(x))return this.isOdd()?x:g;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(b)&&e.lt(b))return u(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,r=65535&this.high,s=this.low>>>16,o=65535&this.low,i=e.high>>>16,l=65535&e.high,d=e.low>>>16,f=65535&e.low,h=0,m=0,y=0,w=0;return y+=(w+=o*f)>>>16,m+=(y+=s*f)>>>16,y&=65535,m+=(y+=o*d)>>>16,h+=(m+=r*f)>>>16,m&=65535,h+=(m+=s*d)>>>16,m&=65535,h+=(m+=o*l)>>>16,h+=t*f+r*d+s*l+o*i,c((y&=65535)<<16|(w&=65535),(h&=65535)<<16|(m&=65535),this.unsigned)},S.mul=S.multiply,S.divide=function(e){if(a(e)||(e=p(e)),e.isZero())throw Error("division by zero");var t,r,s;if(n)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?c((this.unsigned?n.div_u:n.div_s)(this.low,this.high,e.low,e.high),n.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?y:g;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return y;if(e.gt(this.shru(1)))return O;s=y}else{if(this.eq(x))return e.eq(w)||e.eq(v)?x:e.eq(x)?w:(t=this.shr(1).div(e).shl(1)).eq(g)?e.isNegative()?w:v:(r=this.sub(e.mul(t)),s=t.add(r.div(e)));if(e.eq(x))return this.unsigned?y:g;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();s=g}for(r=this;r.gte(e);){t=Math.max(1,Math.floor(r.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(t)/Math.LN2),i=o<=48?1:l(2,o-48),d=u(t),f=d.mul(e);f.isNegative()||f.gt(r);)f=(d=u(t-=i,this.unsigned)).mul(e);d.isZero()&&(d=w),s=s.add(d),r=r.sub(f)}return s},S.div=S.divide,S.modulo=function(e){return a(e)||(e=p(e)),n?c((this.unsigned?n.rem_u:n.rem_s)(this.low,this.high,e.low,e.high),n.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},S.mod=S.modulo,S.rem=S.modulo,S.not=function(){return c(~this.low,~this.high,this.unsigned)},S.and=function(e){return a(e)||(e=p(e)),c(this.low&e.low,this.high&e.high,this.unsigned)},S.or=function(e){return a(e)||(e=p(e)),c(this.low|e.low,this.high|e.high,this.unsigned)},S.xor=function(e){return a(e)||(e=p(e)),c(this.low^e.low,this.high^e.high,this.unsigned)},S.shiftLeft=function(e){return a(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?c(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):c(0,this.low<<e-32,this.unsigned)},S.shl=S.shiftLeft,S.shiftRight=function(e){return a(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?c(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):c(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},S.shr=S.shiftRight,S.shiftRightUnsigned=function(e){if(a(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return e<32?c(this.low>>>e|t<<32-e,t>>>e,this.unsigned):c(32===e?t:t>>>e-32,0,this.unsigned)},S.shru=S.shiftRightUnsigned,S.shr_u=S.shiftRightUnsigned,S.toSigned=function(){return this.unsigned?c(this.low,this.high,!1):this},S.toUnsigned=function(){return this.unsigned?this:c(this.low,this.high,!0)},S.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},S.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},S.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},r.fromBytes=function(e,t,n){return n?r.fromBytesLE(e,t):r.fromBytesBE(e,t)},r.fromBytesLE=function(e,t){return new r(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},r.fromBytesBE=function(e,t){return new r(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},function(e,t,n){(function(t,r,a,s){var o,i=(o=(o="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||t,function(e){function t(){return $.buffer!=F&&K($.buffer),B}function i(){return $.buffer!=F&&K($.buffer),L}function u(){return $.buffer!=F&&K($.buffer),z}function c(){return $.buffer!=F&&K($.buffer),W}function l(){return $.buffer!=F&&K($.buffer),U}var d,p,f,h="undefined"!=typeof(e=e||{})?e:{};h.ready=new Promise((function(e,t){d=e,p=t})),"undefined"!=typeof r&&r.listeners&&(f={uncaughtException:r.listeners("uncaughtException"),unhandledRejection:r.listeners("unhandledRejection")});var m,b,g,y=Object.assign({},h),w=[],O=(e,t)=>{throw t},v="object"==typeof window,j="function"==typeof importScripts,_="object"==typeof r&&"object"==typeof r.versions&&"string"==typeof r.versions.node,x=h.ENVIRONMENT_IS_PTHREAD||!1,S="";function k(e){return h.locateFile?h.locateFile(e,S):S+e}if(_){var E=n(98),T=n(99);let e;S=j?T.dirname(S)+"/":a+"/",m=(e,t)=>(e=ue(e)?new URL(e):T.normalize(e),E.readFileSync(e,t?void 0:"utf8")),g=e=>{var t=m(e,!0);return t.buffer||(t=new Uint8Array(t)),t},b=(e,t,n)=>{e=ue(e)?new URL(e):T.normalize(e),E.readFile(e,(function(e,r){e?n(e):t(r.buffer)}))},r.argv.length>1&&r.argv[1].replace(/\\/g,"/"),w=r.argv.slice(2),r.on("uncaughtException",(function(e){if(!(e instanceof de))throw e})),r.on("unhandledRejection",(function(e){throw e})),O=(e,t)=>{if(ee())throw r.exitCode=e,t;var n;(n=t)instanceof de||D("exiting due to exception: "+n),r.exit(e)},h.inspect=function(){return"[Emscripten Module object]"};try{e=n(144)}catch(e){throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'),e}s.Worker=e.Worker}else(v||j)&&(j?S=self.location.href:"undefined"!=typeof document&&document.currentScript&&(S=document.currentScript.src),"undefined"!=typeof o&&o&&(S=o),S=0!==S.indexOf("blob:")?S.substr(0,S.replace(/[?#].*/,"").lastIndexOf("/")+1):"",_||(m=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},j&&(g=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),b=(e,t,n)=>{var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)}));_&&"undefined"==typeof performance&&(s.performance=n(145).performance);var N=console.log.bind(console),A=console.warn.bind(console);_&&(N=e=>E.writeSync(1,e+"\n"),A=e=>E.writeSync(2,e+"\n"));var M,I=h.print||N,D=h.printErr||A;Object.assign(h,y),y=null,h.arguments&&(w=h.arguments),h.thisProgram&&h.thisProgram,h.quit&&(O=h.quit),Atomics.load,Atomics.store,Atomics.compareExchange,h.wasmBinary&&(M=h.wasmBinary);var $,C,R=h.noExitRuntime||!0;"object"!=typeof WebAssembly&&oe("no native wasm support detected");var P,F,B,L,z,W,U,V=!1,G="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function q(e,t,n){for(var r=(t>>>=0)+n,a=t;e[a]&&!(a>=r);)++a;if(a-t>16&&e.buffer&&G)return G.decode(e.buffer instanceof SharedArrayBuffer?e.slice(t,a):e.subarray(t,a));for(var s="";t<a;){var o=e[t++];if(128&o){var i=63&e[t++];if(192!=(224&o)){var u=63&e[t++];if((o=224==(240&o)?(15&o)<<12|i<<6|u:(7&o)<<18|i<<12|u<<6|63&e[t++])<65536)s+=String.fromCharCode(o);else{var c=o-65536;s+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else s+=String.fromCharCode((31&o)<<6|i)}else s+=String.fromCharCode(o)}return s}function H(e,t){return(e>>>=0)?q(i(),e,t):""}function K(e){F=e,h.HEAP8=B=new Int8Array(e),h.HEAP16=new Int16Array(e),h.HEAP32=z=new Int32Array(e),h.HEAPU8=L=new Uint8Array(e),h.HEAPU16=new Uint16Array(e),h.HEAPU32=W=new Uint32Array(e),h.HEAPF32=new Float32Array(e),h.HEAPF64=U=new Float64Array(e)}x&&(F=h.buffer);var Y,J=h.INITIAL_MEMORY||16777216;if(x)$=h.wasmMemory,F=h.buffer;else if(h.wasmMemory)$=h.wasmMemory;else if(!(($=new WebAssembly.Memory({initial:J/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw D("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"),_&&D("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and/or recent version)"),Error("bad memory");$&&(F=$.buffer),J=F.byteLength,K(F);var X=[],Z=[],Q=[];function ee(){return R}function te(){x||ge(Z)}var ne,re=0,ae=null,se=null;function oe(e){h.onAbort&&h.onAbort(e),D(e="Aborted("+e+")"),V=!0,P=1,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw p(t),t}function ie(e){return e.startsWith("data:application/octet-stream;base64,")}function ue(e){return e.startsWith("file://")}function ce(e){try{if(e==ne&&M)return new Uint8Array(M);if(g)return g(e);throw"both async and sync fetching of the wasm failed"}catch(e){oe(e)}}ie(ne="tfjs-backend-wasm-threaded-simd.wasm")||(ne=k(ne));var le={};function de(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function pe(e){var t,n=be.pthreads[e];n||oe(t),be.returnWorkerToPool(n)}function fe(e){var t=be.getNewWorker();if(!t)return 6;be.runningWorkers.push(t),be.pthreads[e.pthread_ptr]=t,t.pthread_ptr=e.pthread_ptr;var n={cmd:"run",start_routine:e.startRoutine,arg:e.arg,pthread_ptr:e.pthread_ptr};return t.runPthread=()=>{_&&t.ref(),t.postMessage(n,e.transferList),delete t.runPthread},t.loaded&&t.runPthread(),0}function he(e){if(x)return ke(1,1,e);P=e,ee()||(be.terminateAllThreads(),h.onExit&&h.onExit(e),V=!0),O(e,new de(e))}var me=function(e,t){if(P=e,!t&&x)throw ye(e),"unwind";he(e)},be={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],pthreads:{},init:function(){x?be.initWorker():be.initMainThread()},initMainThread:function(){for(var e=8;e--;)be.allocateUnusedWorker()},initWorker:function(){R=!1},setExitStatus:function(e){P=e},terminateAllThreads:function(){for(var e of Object.values(be.pthreads))be.returnWorkerToPool(e);for(var e of be.unusedWorkers)e.terminate();be.unusedWorkers=[]},returnWorkerToPool:function(e){var t=e.pthread_ptr;delete be.pthreads[t],be.unusedWorkers.push(e),be.runningWorkers.splice(be.runningWorkers.indexOf(e),1),e.pthread_ptr=0,_&&e.unref(),Ge(t)},receiveObjectTransfer:function(e){},threadInitTLS:function(){be.tlsInitFunctions.forEach((e=>e()))},loadWasmModuleToWorker:function(e,t){e.onmessage=n=>{var r,a=n.data,s=a.cmd;if(e.pthread_ptr&&(be.currentProxiedOperationCallerThread=e.pthread_ptr),a.targetThread&&a.targetThread!=ze()){var o=be.pthreads[a.targetThread];return o?o.postMessage(a,a.transferList):D('Internal error! Worker sent a message "'+s+'" to target pthread '+a.targetThread+", but that thread no longer exists!"),void(be.currentProxiedOperationCallerThread=void 0)}"processProxyingQueue"===s?_e(a.queue):"spawnThread"===s?fe(a):"cleanupThread"===s?pe(a.thread):"killThread"===s?function(e){var t=be.pthreads[e];delete be.pthreads[e],t.terminate(),Ge(e),be.runningWorkers.splice(be.runningWorkers.indexOf(t),1),t.pthread_ptr=0}(a.thread):"cancelThread"===s?(r=a.thread,be.pthreads[r].postMessage({cmd:"cancel"})):"loaded"===s?(e.loaded=!0,_&&e.unref(),t&&t(e),e.runPthread&&e.runPthread()):"print"===s?I("Thread "+a.threadId+": "+a.text):"printErr"===s?D("Thread "+a.threadId+": "+a.text):"alert"===s?alert("Thread "+a.threadId+": "+a.text):"setimmediate"===a.target?e.postMessage(a):"callHandler"===s?h[a.handler](...a.args):s&&D("worker sent an unknown command "+s),be.currentProxiedOperationCallerThread=void 0},e.onerror=e=>{throw D("worker sent an error! "+e.filename+":"+e.lineno+": "+e.message),e},_&&(e.on("message",(function(t){e.onmessage({data:t})})),e.on("error",(function(t){e.onerror(t)})),e.on("detachedExit",(function(){})));var n=[];for(var r of["onExit","onAbort","print","printErr"])h.hasOwnProperty(r)&&n.push(r);e.postMessage({cmd:"load",handlers:n,urlOrBlob:h.mainScriptUrlOrBlob||o,wasmMemory:$,wasmModule:C})},allocateUnusedWorker:function(){var e,t=k("tfjs-backend-wasm-threaded-simd.worker.js");e=new Worker(t),be.unusedWorkers.push(e)},getNewWorker:function(){return 0==be.unusedWorkers.length&&(be.allocateUnusedWorker(),be.loadWasmModuleToWorker(be.unusedWorkers[0])),be.unusedWorkers.pop()}};function ge(e){for(;e.length>0;)e.shift()(h)}function ye(e){if(x)return ke(2,0,e);try{me(e)}catch(e){!function(e){if(e instanceof de||"unwind"==e)return P;O(1,e)}(e)}}h.PThread=be,h.establishStackSpace=function(){var e=ze(),t=u()[e+52>>>2],n=u()[e+56>>>2];He(t,t-n),Ye(t)};var we,Oe=[];function ve(e,t,n,r){return x?ke(3,1,e,t,n,r):je(e,t,n,r)}function je(e,t,n,r){if("undefined"==typeof SharedArrayBuffer)return D("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var a=[];if(x&&0===a.length)return ve(e,t,n,r);var s={startRoutine:n,pthread_ptr:e,arg:r,transferList:a};return x?(s.cmd="spawnThread",postMessage(s,a),0):fe(s)}function _e(e){Atomics.store(u(),e>>2,1),ze()&&Ve(e),Atomics.compareExchange(u(),e>>2,1,0)}function xe(e){xe.shown||(xe.shown={}),xe.shown[e]||(xe.shown[e]=1,_&&(e="warning: "+e),D(e))}function Se(e){var t=Ke(),n=e();return Ye(t),n}function ke(e,t){var n=arguments.length-2,r=arguments;return Se((()=>{for(var a=n,s=Je(8*a),o=s>>3,i=0;i<n;i++){var u=r[2+i];l()[o+i>>>0]=u}return Ue(e,a,s,t)}))}h.invokeEntryPoint=function(e,t){var n,r,a=((r=Oe[n=e])||(n>=Oe.length&&(Oe.length=n+1),Oe[n]=r=Y.get(n)),r)(t);ee()?be.setExitStatus(a):qe(a)},h.executeNotifiedProxyingQueue=_e,we=_?()=>{var e=r.hrtime();return 1e3*e[0]+e[1]/1e6}:()=>performance.timeOrigin+performance.now();var Ee=[];function Te(e){try{return $.grow(e-F.byteLength+65535>>>16),K($.buffer),1}catch(e){}}function Ne(e){return x?ke(4,1,e):52}function Ae(e,t,n,r,a){return x?ke(5,1,e,t,n,r,a):70}var Me=[null,[],[]];function Ie(e,t){var n=Me[e];0===t||10===t?((1===e?I:D)(q(n,0)),n.length=0):n.push(t)}function De(e,t,n,r){if(x)return ke(6,1,e,t,n,r);for(var a=0,s=0;s<n;s++){var o=c()[t>>>2],u=c()[t+4>>>2];t+=8;for(var l=0;l<u;l++)Ie(e,i()[o+l>>>0]);a+=u}return c()[r>>>2]=a,0}function $e(e){return h["_"+e]}function Ce(e,n,r,a,s){var o={string:e=>{var t=0;if(null!=e&&0!==e){var n=1+(e.length<<2);!function(e,t,n){!function(e,t,n,r){if(!(r>0))return 0;n>>>=0;for(var a=n+r-1,s=0;s<e.length;++s){var o=e.charCodeAt(s);if(o>=55296&&o<=57343&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++s)),o<=127){if(n>=a)break;t[n++>>>0]=o}else if(o<=2047){if(n+1>=a)break;t[n++>>>0]=192|o>>6,t[n++>>>0]=128|63&o}else if(o<=65535){if(n+2>=a)break;t[n++>>>0]=224|o>>12,t[n++>>>0]=128|o>>6&63,t[n++>>>0]=128|63&o}else{if(n+3>=a)break;t[n++>>>0]=240|o>>18,t[n++>>>0]=128|o>>12&63,t[n++>>>0]=128|o>>6&63,t[n++>>>0]=128|63&o}}t[n>>>0]=0}(e,i(),t,n)}(e,t=Je(n),n)}return t},array:e=>{var n=Je(e.length);return function(e,n){t().set(e,n>>>0)}(e,n),n}},u=$e(e),c=[],l=0;if(a)for(var d=0;d<a.length;d++){var p=o[r[d]];p?(0===l&&(l=Ke()),c[d]=p(a[d])):c[d]=a[d]}var f=u.apply(null,c);return f=function(e){return 0!==l&&Ye(l),function(e){return"string"===n?H(e):"boolean"===n?Boolean(e):e}(e)}(f)}be.init();var Re,Pe,Fe,Be=[null,he,ye,ve,Ne,Ae,De],Le={__emscripten_init_main_thread_js:function(e){We(e,!j,1,!v),be.threadInitTLS()},__emscripten_thread_cleanup:function(e){x?postMessage({cmd:"cleanupThread",thread:e}):pe(e)},__pthread_create_js:je,_emscripten_default_pthread_stack_size:function(){return 65536},_emscripten_get_now_is_monotonic:function(){return!0},_emscripten_notify_task_queue:function(e,t,n,r){if(e==t)setTimeout((()=>_e(r)));else if(x)postMessage({targetThread:e,cmd:"processProxyingQueue",queue:r});else{var a=be.pthreads[e];if(!a)return;a.postMessage({cmd:"processProxyingQueue",queue:r})}return 1},_emscripten_set_offscreencanvas_size:function(e,t,n){return-1},abort:function(){oe("")},emscripten_check_blocking_allowed:function(){_||j||xe("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")},emscripten_date_now:function(){return Date.now()},emscripten_get_heap_max:function(){return 4294901760},emscripten_get_now:we,emscripten_memcpy_big:function(e,t,n){i().copyWithin(e>>>0,t>>>0,t+n>>>0)},emscripten_num_logical_cores:function(){return _?n(146).cpus().length:navigator.hardwareConcurrency},emscripten_receive_on_main_thread_js:function(e,t,n){Ee.length=t;for(var r=n>>3,a=0;a<t;a++)Ee[a]=l()[r+a>>>0];return(e<0?le[-e-1]:Be[e]).apply(null,Ee)},emscripten_resize_heap:function(e){var t=i().length;if((e>>>=0)<=t)return!1;var n,r,a=4294901760;if(e>a)return!1;for(var s=1;s<=4;s*=2){var o=t*(1+.2/s);if(o=Math.min(o,e+100663296),Te(Math.min(a,(n=Math.max(e,o))+((r=65536)-n%r)%r)))return!0}return!1},emscripten_unwind_to_js_event_loop:function(){throw"unwind"},exit:me,fd_close:Ne,fd_seek:Ae,fd_write:De,memory:$||h.wasmMemory},ze=(function(){var e={env:Le,wasi_snapshot_preview1:Le};function t(e,t){var n,r,a=e.exports;if(h.asm=a,n=h.asm._emscripten_tls_init,be.tlsInitFunctions.push(n),Y=h.asm.__indirect_function_table,r=h.asm.__wasm_call_ctors,Z.unshift(r),C=t,!x){var s=be.unusedWorkers.length;be.unusedWorkers.forEach((function(e){be.loadWasmModuleToWorker(e,(function(){--s||function(e){if(re--,h.monitorRunDependencies&&h.monitorRunDependencies(re),0==re&&(null!==ae&&(clearInterval(ae),ae=null),se)){var t=se;se=null,t()}}()}))}))}}function n(e){t(e.instance,e.module)}function r(t){return function(){if(!M&&(v||j)){if("function"==typeof fetch&&!ue(ne))return fetch(ne,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+ne+"'";return e.arrayBuffer()})).catch((function(){return ce(ne)}));if(b)return new Promise((function(e,t){b(ne,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return ce(ne)}))}().then((function(t){return WebAssembly.instantiate(t,e)})).then((function(e){return e})).then(t,(function(e){D("failed to asynchronously prepare wasm: "+e),oe(e)}))}if(x||(re++,h.monitorRunDependencies&&h.monitorRunDependencies(re)),h.instantiateWasm)try{return h.instantiateWasm(e,t)}catch(e){D("Module.instantiateWasm callback failed with error: "+e),p(e)}(M||"function"!=typeof WebAssembly.instantiateStreaming||ie(ne)||ue(ne)||_||"function"!=typeof fetch?r(n):fetch(ne,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(n,(function(e){return D("wasm streaming compile failed: "+e),D("falling back to ArrayBuffer instantiation"),r(n)}))}))).catch(p)}(),h.___wasm_call_ctors=function(){return(h.___wasm_call_ctors=h.asm.__wasm_call_ctors).apply(null,arguments)},h._init=function(){return(h._init=h.asm.init).apply(null,arguments)},h._init_with_threads_count=function(){return(h._init_with_threads_count=h.asm.init_with_threads_count).apply(null,arguments)},h._get_threads_count=function(){return(h._get_threads_count=h.asm.get_threads_count).apply(null,arguments)},h._register_tensor=function(){return(h._register_tensor=h.asm.register_tensor).apply(null,arguments)},h._dispose_data=function(){return(h._dispose_data=h.asm.dispose_data).apply(null,arguments)},h._dispose=function(){return(h._dispose=h.asm.dispose).apply(null,arguments)},h._Abs=function(){return(h._Abs=h.asm.Abs).apply(null,arguments)},h._Acos=function(){return(h._Acos=h.asm.Acos).apply(null,arguments)},h._Acosh=function(){return(h._Acosh=h.asm.Acosh).apply(null,arguments)},h._Add=function(){return(h._Add=h.asm.Add).apply(null,arguments)},h._AddN=function(){return(h._AddN=h.asm.AddN).apply(null,arguments)},h._All=function(){return(h._All=h.asm.All).apply(null,arguments)},h._Any=function(){return(h._Any=h.asm.Any).apply(null,arguments)},h._ArgMax=function(){return(h._ArgMax=h.asm.ArgMax).apply(null,arguments)},h._ArgMin=function(){return(h._ArgMin=h.asm.ArgMin).apply(null,arguments)},h._Asin=function(){return(h._Asin=h.asm.Asin).apply(null,arguments)},h._Asinh=function(){return(h._Asinh=h.asm.Asinh).apply(null,arguments)},h._Atan=function(){return(h._Atan=h.asm.Atan).apply(null,arguments)},h._Atan2=function(){return(h._Atan2=h.asm.Atan2).apply(null,arguments)},h._Atanh=function(){return(h._Atanh=h.asm.Atanh).apply(null,arguments)},h._AvgPool=function(){return(h._AvgPool=h.asm.AvgPool).apply(null,arguments)},h._AvgPool3D=function(){return(h._AvgPool3D=h.asm.AvgPool3D).apply(null,arguments)},h._AvgPool3DGrad=function(){return(h._AvgPool3DGrad=h.asm.AvgPool3DGrad).apply(null,arguments)},h._AvgPoolGrad=function(){return(h._AvgPoolGrad=h.asm.AvgPoolGrad).apply(null,arguments)},h._BatchMatMul=function(){return(h._BatchMatMul=h.asm.BatchMatMul).apply(null,arguments)},h._Bincount=function(){return(h._Bincount=h.asm.Bincount).apply(null,arguments)},h._BitwiseAnd=function(){return(h._BitwiseAnd=h.asm.BitwiseAnd).apply(null,arguments)},h._Ceil=function(){return(h._Ceil=h.asm.Ceil).apply(null,arguments)},h._ClipByValue=function(){return(h._ClipByValue=h.asm.ClipByValue).apply(null,arguments)},h._Conv2D=function(){return(h._Conv2D=h.asm.Conv2D).apply(null,arguments)},h._Conv2DBackpropInput=function(){return(h._Conv2DBackpropInput=h.asm.Conv2DBackpropInput).apply(null,arguments)},h._Conv3D=function(){return(h._Conv3D=h.asm.Conv3D).apply(null,arguments)},h._Conv3DBackpropFilterV2=function(){return(h._Conv3DBackpropFilterV2=h.asm.Conv3DBackpropFilterV2).apply(null,arguments)},h._Conv3DBackpropInputV2=function(){return(h._Conv3DBackpropInputV2=h.asm.Conv3DBackpropInputV2).apply(null,arguments)},h._Cos=function(){return(h._Cos=h.asm.Cos).apply(null,arguments)},h._Cosh=function(){return(h._Cosh=h.asm.Cosh).apply(null,arguments)},h._CropAndResize=function(){return(h._CropAndResize=h.asm.CropAndResize).apply(null,arguments)},h._Cumprod=function(){return(h._Cumprod=h.asm.Cumprod).apply(null,arguments)},h._Cumsum=function(){return(h._Cumsum=h.asm.Cumsum).apply(null,arguments)},h._DenseBincount=function(){return(h._DenseBincount=h.asm.DenseBincount).apply(null,arguments)},h._DepthToSpace=function(){return(h._DepthToSpace=h.asm.DepthToSpace).apply(null,arguments)},h._DepthwiseConv2dNative=function(){return(h._DepthwiseConv2dNative=h.asm.DepthwiseConv2dNative).apply(null,arguments)},h._Diag=function(){return(h._Diag=h.asm.Diag).apply(null,arguments)},h._Dilation2D=function(){return(h._Dilation2D=h.asm.Dilation2D).apply(null,arguments)},h._Dilation2DBackpropFilter=function(){return(h._Dilation2DBackpropFilter=h.asm.Dilation2DBackpropFilter).apply(null,arguments)},h._Dilation2DBackpropInput=function(){return(h._Dilation2DBackpropInput=h.asm.Dilation2DBackpropInput).apply(null,arguments)},h._Elu=function(){return(h._Elu=h.asm.Elu).apply(null,arguments)},h._EluGrad=function(){return(h._EluGrad=h.asm.EluGrad).apply(null,arguments)},h._Equal=function(){return(h._Equal=h.asm.Equal).apply(null,arguments)},h._Erf=function(){return(h._Erf=h.asm.Erf).apply(null,arguments)},h._Exp=function(){return(h._Exp=h.asm.Exp).apply(null,arguments)},h._Expm1=function(){return(h._Expm1=h.asm.Expm1).apply(null,arguments)},h._FlipLeftRight=function(){return(h._FlipLeftRight=h.asm.FlipLeftRight).apply(null,arguments)},h._Floor=function(){return(h._Floor=h.asm.Floor).apply(null,arguments)},h._FloorDiv=function(){return(h._FloorDiv=h.asm.FloorDiv).apply(null,arguments)},h._FusedBatchNorm=function(){return(h._FusedBatchNorm=h.asm.FusedBatchNorm).apply(null,arguments)},h._FusedConv2D=function(){return(h._FusedConv2D=h.asm.FusedConv2D).apply(null,arguments)},h._FusedDepthwiseConv2D=function(){return(h._FusedDepthwiseConv2D=h.asm.FusedDepthwiseConv2D).apply(null,arguments)},h._Gather=function(){return(h._Gather=h.asm.Gather).apply(null,arguments)},h._GatherNd=function(){return(h._GatherNd=h.asm.GatherNd).apply(null,arguments)},h._Greater=function(){return(h._Greater=h.asm.Greater).apply(null,arguments)},h._GreaterEqual=function(){return(h._GreaterEqual=h.asm.GreaterEqual).apply(null,arguments)},h._IsFinite=function(){return(h._IsFinite=h.asm.IsFinite).apply(null,arguments)},h._IsInf=function(){return(h._IsInf=h.asm.IsInf).apply(null,arguments)},h._IsNan=function(){return(h._IsNan=h.asm.IsNan).apply(null,arguments)},h._LRN=function(){return(h._LRN=h.asm.LRN).apply(null,arguments)},h._LRNGrad=function(){return(h._LRNGrad=h.asm.LRNGrad).apply(null,arguments)},h._LeakyRelu=function(){return(h._LeakyRelu=h.asm.LeakyRelu).apply(null,arguments)},h._Less=function(){return(h._Less=h.asm.Less).apply(null,arguments)},h._LessEqual=function(){return(h._LessEqual=h.asm.LessEqual).apply(null,arguments)},h._LinSpace=function(){return(h._LinSpace=h.asm.LinSpace).apply(null,arguments)},h._Log=function(){return(h._Log=h.asm.Log).apply(null,arguments)},h._Log1p=function(){return(h._Log1p=h.asm.Log1p).apply(null,arguments)},h._LogicalAnd=function(){return(h._LogicalAnd=h.asm.LogicalAnd).apply(null,arguments)},h._LogicalNot=function(){return(h._LogicalNot=h.asm.LogicalNot).apply(null,arguments)},h._LogicalOr=function(){return(h._LogicalOr=h.asm.LogicalOr).apply(null,arguments)},h._LogicalXor=function(){return(h._LogicalXor=h.asm.LogicalXor).apply(null,arguments)},h._Max=function(){return(h._Max=h.asm.Max).apply(null,arguments)},h._MaxPool=function(){return(h._MaxPool=h.asm.MaxPool).apply(null,arguments)},h._MaxPool3D=function(){return(h._MaxPool3D=h.asm.MaxPool3D).apply(null,arguments)},h._MaxPool3DGrad=function(){return(h._MaxPool3DGrad=h.asm.MaxPool3DGrad).apply(null,arguments)},h._MaxPoolGrad=function(){return(h._MaxPoolGrad=h.asm.MaxPoolGrad).apply(null,arguments)},h._MaxPoolWithArgmax=function(){return(h._MaxPoolWithArgmax=h.asm.MaxPoolWithArgmax).apply(null,arguments)},h._Maximum=function(){return(h._Maximum=h.asm.Maximum).apply(null,arguments)},h._Mean=function(){return(h._Mean=h.asm.Mean).apply(null,arguments)},h._Min=function(){return(h._Min=h.asm.Min).apply(null,arguments)},h._Minimum=function(){return(h._Minimum=h.asm.Minimum).apply(null,arguments)},h._MirrorPad=function(){return(h._MirrorPad=h.asm.MirrorPad).apply(null,arguments)},h._Mod=function(){return(h._Mod=h.asm.Mod).apply(null,arguments)},h._Multinomial=function(){return(h._Multinomial=h.asm.Multinomial).apply(null,arguments)},h._Multiply=function(){return(h._Multiply=h.asm.Multiply).apply(null,arguments)},h._Neg=function(){return(h._Neg=h.asm.Neg).apply(null,arguments)},h._NonMaxSuppressionV3=function(){return(h._NonMaxSuppressionV3=h.asm.NonMaxSuppressionV3).apply(null,arguments)},h._NonMaxSuppressionV4=function(){return(h._NonMaxSuppressionV4=h.asm.NonMaxSuppressionV4).apply(null,arguments)},h._NonMaxSuppressionV5=function(){return(h._NonMaxSuppressionV5=h.asm.NonMaxSuppressionV5).apply(null,arguments)},h._NotEqual=function(){return(h._NotEqual=h.asm.NotEqual).apply(null,arguments)},h._OneHot=function(){return(h._OneHot=h.asm.OneHot).apply(null,arguments)},h._PadV2=function(){return(h._PadV2=h.asm.PadV2).apply(null,arguments)},h._Pow=function(){return(h._Pow=h.asm.Pow).apply(null,arguments)},h._Prelu=function(){return(h._Prelu=h.asm.Prelu).apply(null,arguments)},h._Prod=function(){return(h._Prod=h.asm.Prod).apply(null,arguments)},h._RealDiv=function(){return(h._RealDiv=h.asm.RealDiv).apply(null,arguments)},h._Reciprocal=function(){return(h._Reciprocal=h.asm.Reciprocal).apply(null,arguments)},h._Relu=function(){return(h._Relu=h.asm.Relu).apply(null,arguments)},h._Relu6=function(){return(h._Relu6=h.asm.Relu6).apply(null,arguments)},h._ResizeBilinear=function(){return(h._ResizeBilinear=h.asm.ResizeBilinear).apply(null,arguments)},h._ResizeBilinearGrad=function(){return(h._ResizeBilinearGrad=h.asm.ResizeBilinearGrad).apply(null,arguments)},h._ResizeNearestNeighbor=function(){return(h._ResizeNearestNeighbor=h.asm.ResizeNearestNeighbor).apply(null,arguments)},h._ResizeNearestNeighborGrad=function(){return(h._ResizeNearestNeighborGrad=h.asm.ResizeNearestNeighborGrad).apply(null,arguments)},h._Reverse=function(){return(h._Reverse=h.asm.Reverse).apply(null,arguments)},h._RotateWithOffset=function(){return(h._RotateWithOffset=h.asm.RotateWithOffset).apply(null,arguments)},h._Round=function(){return(h._Round=h.asm.Round).apply(null,arguments)},h._Rsqrt=function(){return(h._Rsqrt=h.asm.Rsqrt).apply(null,arguments)},h._ScatterNd=function(){return(h._ScatterNd=h.asm.ScatterNd).apply(null,arguments)},h._SearchSorted=function(){return(h._SearchSorted=h.asm.SearchSorted).apply(null,arguments)},h._SelectV2=function(){return(h._SelectV2=h.asm.SelectV2).apply(null,arguments)},h._Selu=function(){return(h._Selu=h.asm.Selu).apply(null,arguments)},h._Sigmoid=function(){return(h._Sigmoid=h.asm.Sigmoid).apply(null,arguments)},h._Sign=function(){return(h._Sign=h.asm.Sign).apply(null,arguments)},h._Sin=function(){return(h._Sin=h.asm.Sin).apply(null,arguments)},h._Sinh=function(){return(h._Sinh=h.asm.Sinh).apply(null,arguments)},h._Softmax=function(){return(h._Softmax=h.asm.Softmax).apply(null,arguments)},h._Softplus=function(){return(h._Softplus=h.asm.Softplus).apply(null,arguments)},h._SparseFillEmptyRows=function(){return(h._SparseFillEmptyRows=h.asm.SparseFillEmptyRows).apply(null,arguments)},h._SparseReshape=function(){return(h._SparseReshape=h.asm.SparseReshape).apply(null,arguments)},h._SparseSegmentReduction=function(){return(h._SparseSegmentReduction=h.asm.SparseSegmentReduction).apply(null,arguments)},h._SparseToDense=function(){return(h._SparseToDense=h.asm.SparseToDense).apply(null,arguments)},h._Sqrt=function(){return(h._Sqrt=h.asm.Sqrt).apply(null,arguments)},h._Square=function(){return(h._Square=h.asm.Square).apply(null,arguments)},h._SquaredDifference=function(){return(h._SquaredDifference=h.asm.SquaredDifference).apply(null,arguments)},h._Step=function(){return(h._Step=h.asm.Step).apply(null,arguments)},h._StridedSlice=function(){return(h._StridedSlice=h.asm.StridedSlice).apply(null,arguments)},h._Sub=function(){return(h._Sub=h.asm.Sub).apply(null,arguments)},h._Sum=function(){return(h._Sum=h.asm.Sum).apply(null,arguments)},h._Tan=function(){return(h._Tan=h.asm.Tan).apply(null,arguments)},h._Tanh=function(){return(h._Tanh=h.asm.Tanh).apply(null,arguments)},h._TensorScatterUpdate=function(){return(h._TensorScatterUpdate=h.asm.TensorScatterUpdate).apply(null,arguments)},h._Tile=function(){return(h._Tile=h.asm.Tile).apply(null,arguments)},h._TopK=function(){return(h._TopK=h.asm.TopK).apply(null,arguments)},h._Transform=function(){return(h._Transform=h.asm.Transform).apply(null,arguments)},h._Transpose=function(){return(h._Transpose=h.asm.Transpose).apply(null,arguments)},h.__FusedMatMul=function(){return(h.__FusedMatMul=h.asm._FusedMatMul).apply(null,arguments)},h._malloc=function(){return(h._malloc=h.asm.malloc).apply(null,arguments)},h._free=function(){return(h._free=h.asm.free).apply(null,arguments)},h.__emscripten_tls_init=function(){return(h.__emscripten_tls_init=h.asm._emscripten_tls_init).apply(null,arguments)},h._pthread_self=function(){return(ze=h._pthread_self=h.asm.pthread_self).apply(null,arguments)}),We=(h.___errno_location=function(){return(h.___errno_location=h.asm.__errno_location).apply(null,arguments)},h.__emscripten_thread_init=function(){return(We=h.__emscripten_thread_init=h.asm._emscripten_thread_init).apply(null,arguments)}),Ue=(h.__emscripten_thread_crashed=function(){return(h.__emscripten_thread_crashed=h.asm._emscripten_thread_crashed).apply(null,arguments)},h._emscripten_main_thread_process_queued_calls=function(){return(h._emscripten_main_thread_process_queued_calls=h.asm.emscripten_main_thread_process_queued_calls).apply(null,arguments)},h._emscripten_main_browser_thread_id=function(){return(h._emscripten_main_browser_thread_id=h.asm.emscripten_main_browser_thread_id).apply(null,arguments)},h._emscripten_run_in_main_runtime_thread_js=function(){return(Ue=h._emscripten_run_in_main_runtime_thread_js=h.asm.emscripten_run_in_main_runtime_thread_js).apply(null,arguments)}),Ve=(h._emscripten_dispatch_to_thread_=function(){return(h._emscripten_dispatch_to_thread_=h.asm.emscripten_dispatch_to_thread_).apply(null,arguments)},h.__emscripten_proxy_execute_task_queue=function(){return(Ve=h.__emscripten_proxy_execute_task_queue=h.asm._emscripten_proxy_execute_task_queue).apply(null,arguments)}),Ge=h.__emscripten_thread_free_data=function(){return(Ge=h.__emscripten_thread_free_data=h.asm._emscripten_thread_free_data).apply(null,arguments)},qe=h.__emscripten_thread_exit=function(){return(qe=h.__emscripten_thread_exit=h.asm._emscripten_thread_exit).apply(null,arguments)},He=h._emscripten_stack_set_limits=function(){return(He=h._emscripten_stack_set_limits=h.asm.emscripten_stack_set_limits).apply(null,arguments)},Ke=h.stackSave=function(){return(Ke=h.stackSave=h.asm.stackSave).apply(null,arguments)},Ye=h.stackRestore=function(){return(Ye=h.stackRestore=h.asm.stackRestore).apply(null,arguments)},Je=h.stackAlloc=function(){return(Je=h.stackAlloc=h.asm.stackAlloc).apply(null,arguments)};function Xe(e){if(e=e||w,!(re>0)){if(x)return d(h),te(),void startWorker(h);!function(){if(h.preRun)for("function"==typeof h.preRun&&(h.preRun=[h.preRun]);h.preRun.length;)e=h.preRun.shift(),X.unshift(e);var e;ge(X)}(),re>0||(h.setStatus?(h.setStatus("Running..."),setTimeout((function(){setTimeout((function(){h.setStatus("")}),1),t()}),1)):t())}function t(){Re||(Re=!0,h.calledRun=!0,V||(te(),d(h),h.onRuntimeInitialized&&h.onRuntimeInitialized(),function(){if(!x){if(h.postRun)for("function"==typeof h.postRun&&(h.postRun=[h.postRun]);h.postRun.length;)e=h.postRun.shift(),Q.unshift(e);var e;ge(Q)}}()))}}if(h.dynCall_iijjiiii=function(){return(h.dynCall_iijjiiii=h.asm.dynCall_iijjiiii).apply(null,arguments)},h.dynCall_jiji=function(){return(h.dynCall_jiji=h.asm.dynCall_jiji).apply(null,arguments)},h.keepRuntimeAlive=ee,h.wasmMemory=$,h.cwrap=function(e,t,n,r){var a=(n=n||[]).every((e=>"number"===e||"boolean"===e));return"string"!==t&&a&&!r?$e(e):function(){return Ce(e,t,n,arguments)}},h.ExitStatus=de,h.PThread=be,se=function e(){Re||Xe(),Re||(se=e)},h.preInit)for("function"==typeof h.preInit&&(h.preInit=[h.preInit]);h.preInit.length>0;)h.preInit.pop()();if(Xe(),f&&(Pe={uncaughtException:r.listeners("uncaughtException").filter((function(e){return!f.uncaughtException.indexOf(e)>-1})),unhandledRejection:r.listeners("unhandledRejection").filter((function(e){return!f.unhandledRejection.indexOf(e)>-1}))}),"undefined"!=typeof WasmBackendModule)Fe=WasmBackendModule;else{if("undefined"==typeof e)throw new Error("Could not find wasm module in post.js");Fe=e}if(Pe){var Ze=Fe._dispose;Fe._dispose=function(){Ze(),Pe.uncaughtException.forEach((function(e){r.removeListener("uncaughtException",e)})),Pe.unhandledRejection.forEach((function(e){r.removeListener("unhandledRejection",e)}))}}return e.ready});e.exports=i}).call(this,"/index.js",n(58),"/",n(63))},function(e,t,n){(function(t,r,a){var s,o=(s=(s="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||t,function(e){var t,o,i,u="undefined"!=typeof(e=e||{})?e:{};u.ready=new Promise((function(e,n){t=e,o=n})),"undefined"!=typeof r&&r.listeners&&(i={uncaughtException:r.listeners("uncaughtException"),unhandledRejection:r.listeners("unhandledRejection")});var c,l,d,p=Object.assign({},u),f=[],h="object"==typeof window,m="function"==typeof importScripts,b="object"==typeof r&&"object"==typeof r.versions&&"string"==typeof r.versions.node,g="";if(b){var y=n(98),w=n(99);g=m?w.dirname(g)+"/":a+"/",c=(e,t)=>(e=U(e)?new URL(e):w.normalize(e),y.readFileSync(e,t?void 0:"utf8")),d=e=>{var t=c(e,!0);return t.buffer||(t=new Uint8Array(t)),t},l=(e,t,n)=>{e=U(e)?new URL(e):w.normalize(e),y.readFile(e,(function(e,r){e?n(e):t(r.buffer)}))},r.argv.length>1&&r.argv[1].replace(/\\/g,"/"),f=r.argv.slice(2),r.on("uncaughtException",(function(e){if(!(e instanceof G))throw e})),r.on("unhandledRejection",(function(e){throw e})),u.inspect=function(){return"[Emscripten Module object]"}}else(h||m)&&(m?g=self.location.href:"undefined"!=typeof document&&document.currentScript&&(g=document.currentScript.src),s&&(g=s),g=0!==g.indexOf("blob:")?g.substr(0,g.replace(/[?#].*/,"").lastIndexOf("/")+1):"",c=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},m&&(d=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),l=(e,t,n)=>{var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)});var O,v=u.print||console.log.bind(console),j=u.printErr||console.warn.bind(console);Object.assign(u,p),p=null,u.arguments&&(f=u.arguments),u.thisProgram&&u.thisProgram,u.quit&&u.quit,u.wasmBinary&&(O=u.wasmBinary);var _;u.noExitRuntime;"object"!=typeof WebAssembly&&z("no native wasm support detected");var x,S,k,E,T=!1,N="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function A(e,t,n){for(var r=(t>>>=0)+n,a=t;e[a]&&!(a>=r);)++a;if(a-t>16&&e.buffer&&N)return N.decode(e.subarray(t,a));for(var s="";t<a;){var o=e[t++];if(128&o){var i=63&e[t++];if(192!=(224&o)){var u=63&e[t++];if((o=224==(240&o)?(15&o)<<12|i<<6|u:(7&o)<<18|i<<12|u<<6|63&e[t++])<65536)s+=String.fromCharCode(o);else{var c=o-65536;s+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else s+=String.fromCharCode((31&o)<<6|i)}else s+=String.fromCharCode(o)}return s}function M(e,t){return(e>>>=0)?A(k,e,t):""}function I(e){x=e,u.HEAP8=S=new Int8Array(e),u.HEAP16=new Int16Array(e),u.HEAP32=new Int32Array(e),u.HEAPU8=k=new Uint8Array(e),u.HEAPU16=new Uint16Array(e),u.HEAPU32=E=new Uint32Array(e),u.HEAPF32=new Float32Array(e),u.HEAPF64=new Float64Array(e)}u.INITIAL_MEMORY;var D,$,C=[],R=[],P=[],F=0,B=null,L=null;function z(e){u.onAbort&&u.onAbort(e),j(e="Aborted("+e+")"),T=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw o(t),t}function W(e){return e.startsWith("data:application/octet-stream;base64,")}function U(e){return e.startsWith("file://")}function V(e){try{if(e==D&&O)return new Uint8Array(O);if(d)return d(e);throw"both async and sync fetching of the wasm failed"}catch(e){z(e)}}function G(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function q(e){for(;e.length>0;)e.shift()(u)}function H(e){try{return _.grow(e-x.byteLength+65535>>>16),I(_.buffer),1}catch(e){}}W(D="tfjs-backend-wasm.wasm")||($=D,D=u.locateFile?u.locateFile($,g):g+$);var K=[null,[],[]];function Y(e,t){var n=K[e];0===t||10===t?((1===e?v:j)(A(n,0)),n.length=0):n.push(t)}function J(e){return u["_"+e]}function X(e,t,n,r,a){var s={string:e=>{var t=0;if(null!=e&&0!==e){var n=1+(e.length<<2);!function(e,t,n){!function(e,t,n,r){if(!(r>0))return 0;n>>>=0;for(var a=n+r-1,s=0;s<e.length;++s){var o=e.charCodeAt(s);if(o>=55296&&o<=57343&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++s)),o<=127){if(n>=a)break;t[n++>>>0]=o}else if(o<=2047){if(n+1>=a)break;t[n++>>>0]=192|o>>6,t[n++>>>0]=128|63&o}else if(o<=65535){if(n+2>=a)break;t[n++>>>0]=224|o>>12,t[n++>>>0]=128|o>>6&63,t[n++>>>0]=128|63&o}else{if(n+3>=a)break;t[n++>>>0]=240|o>>18,t[n++>>>0]=128|o>>12&63,t[n++>>>0]=128|o>>6&63,t[n++>>>0]=128|63&o}}t[n>>>0]=0}(e,k,t,n)}(e,t=ae(n),n)}return t},array:e=>{var t=ae(e.length);return function(e,t){S.set(e,t>>>0)}(e,t),t}},o=J(e),i=[],u=0;if(r)for(var c=0;c<r.length;c++){var l=s[n[c]];l?(0===u&&(u=ne()),i[c]=l(r[c])):i[c]=r[c]}var d=o.apply(null,i);return d=function(e){return 0!==u&&re(u),function(e){return"string"===t?M(e):"boolean"===t?Boolean(e):e}(e)}(d)}var Z,Q,ee,te={abort:function(){z("")},emscripten_get_heap_max:function(){return 4294901760},emscripten_memcpy_big:function(e,t,n){k.copyWithin(e>>>0,t>>>0,t+n>>>0)},emscripten_resize_heap:function(e){var t,n,r=k.length,a=4294901760;if((e>>>=0)>a)return!1;for(var s=1;s<=4;s*=2){var o=r*(1+.2/s);if(o=Math.min(o,e+100663296),H(Math.min(a,(t=Math.max(e,o))+((n=65536)-t%n)%n)))return!0}return!1},fd_close:function(e){return 52},fd_seek:function(e,t,n,r,a){return 70},fd_write:function(e,t,n,r){for(var a=0,s=0;s<n;s++){var o=E[t>>>2],i=E[t+4>>>2];t+=8;for(var u=0;u<i;u++)Y(e,k[o+u>>>0]);a+=i}return E[r>>>2]=a,0}},ne=(function(){var e={env:te,wasi_snapshot_preview1:te};function t(e,t){var n,r=e.exports;u.asm=r,I((_=u.asm.memory).buffer),u.asm.__indirect_function_table,n=u.asm.__wasm_call_ctors,R.unshift(n),function(e){if(F--,u.monitorRunDependencies&&u.monitorRunDependencies(F),0==F&&(null!==B&&(clearInterval(B),B=null),L)){var t=L;L=null,t()}}()}function n(e){t(e.instance)}function r(t){return function(){if(!O&&(h||m)){if("function"==typeof fetch&&!U(D))return fetch(D,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+D+"'";return e.arrayBuffer()})).catch((function(){return V(D)}));if(l)return new Promise((function(e,t){l(D,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return V(D)}))}().then((function(t){return WebAssembly.instantiate(t,e)})).then((function(e){return e})).then(t,(function(e){j("failed to asynchronously prepare wasm: "+e),z(e)}))}if(F++,u.monitorRunDependencies&&u.monitorRunDependencies(F),u.instantiateWasm)try{return u.instantiateWasm(e,t)}catch(e){j("Module.instantiateWasm callback failed with error: "+e),o(e)}(O||"function"!=typeof WebAssembly.instantiateStreaming||W(D)||U(D)||b||"function"!=typeof fetch?r(n):fetch(D,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(n,(function(e){return j("wasm streaming compile failed: "+e),j("falling back to ArrayBuffer instantiation"),r(n)}))}))).catch(o)}(),u.___wasm_call_ctors=function(){return(u.___wasm_call_ctors=u.asm.__wasm_call_ctors).apply(null,arguments)},u._init=function(){return(u._init=u.asm.init).apply(null,arguments)},u._init_with_threads_count=function(){return(u._init_with_threads_count=u.asm.init_with_threads_count).apply(null,arguments)},u._get_threads_count=function(){return(u._get_threads_count=u.asm.get_threads_count).apply(null,arguments)},u._register_tensor=function(){return(u._register_tensor=u.asm.register_tensor).apply(null,arguments)},u._dispose_data=function(){return(u._dispose_data=u.asm.dispose_data).apply(null,arguments)},u._dispose=function(){return(u._dispose=u.asm.dispose).apply(null,arguments)},u._Abs=function(){return(u._Abs=u.asm.Abs).apply(null,arguments)},u._Acos=function(){return(u._Acos=u.asm.Acos).apply(null,arguments)},u._Acosh=function(){return(u._Acosh=u.asm.Acosh).apply(null,arguments)},u._Add=function(){return(u._Add=u.asm.Add).apply(null,arguments)},u._AddN=function(){return(u._AddN=u.asm.AddN).apply(null,arguments)},u._All=function(){return(u._All=u.asm.All).apply(null,arguments)},u._Any=function(){return(u._Any=u.asm.Any).apply(null,arguments)},u._ArgMax=function(){return(u._ArgMax=u.asm.ArgMax).apply(null,arguments)},u._ArgMin=function(){return(u._ArgMin=u.asm.ArgMin).apply(null,arguments)},u._Asin=function(){return(u._Asin=u.asm.Asin).apply(null,arguments)},u._Asinh=function(){return(u._Asinh=u.asm.Asinh).apply(null,arguments)},u._Atan=function(){return(u._Atan=u.asm.Atan).apply(null,arguments)},u._Atan2=function(){return(u._Atan2=u.asm.Atan2).apply(null,arguments)},u._Atanh=function(){return(u._Atanh=u.asm.Atanh).apply(null,arguments)},u._AvgPool=function(){return(u._AvgPool=u.asm.AvgPool).apply(null,arguments)},u._AvgPool3D=function(){return(u._AvgPool3D=u.asm.AvgPool3D).apply(null,arguments)},u._AvgPool3DGrad=function(){return(u._AvgPool3DGrad=u.asm.AvgPool3DGrad).apply(null,arguments)},u._AvgPoolGrad=function(){return(u._AvgPoolGrad=u.asm.AvgPoolGrad).apply(null,arguments)},u._BatchMatMul=function(){return(u._BatchMatMul=u.asm.BatchMatMul).apply(null,arguments)},u._Bincount=function(){return(u._Bincount=u.asm.Bincount).apply(null,arguments)},u._BitwiseAnd=function(){return(u._BitwiseAnd=u.asm.BitwiseAnd).apply(null,arguments)},u._Ceil=function(){return(u._Ceil=u.asm.Ceil).apply(null,arguments)},u._ClipByValue=function(){return(u._ClipByValue=u.asm.ClipByValue).apply(null,arguments)},u._Conv2D=function(){return(u._Conv2D=u.asm.Conv2D).apply(null,arguments)},u._Conv2DBackpropInput=function(){return(u._Conv2DBackpropInput=u.asm.Conv2DBackpropInput).apply(null,arguments)},u._Conv3D=function(){return(u._Conv3D=u.asm.Conv3D).apply(null,arguments)},u._Conv3DBackpropFilterV2=function(){return(u._Conv3DBackpropFilterV2=u.asm.Conv3DBackpropFilterV2).apply(null,arguments)},u._Conv3DBackpropInputV2=function(){return(u._Conv3DBackpropInputV2=u.asm.Conv3DBackpropInputV2).apply(null,arguments)},u._Cos=function(){return(u._Cos=u.asm.Cos).apply(null,arguments)},u._Cosh=function(){return(u._Cosh=u.asm.Cosh).apply(null,arguments)},u._CropAndResize=function(){return(u._CropAndResize=u.asm.CropAndResize).apply(null,arguments)},u._Cumprod=function(){return(u._Cumprod=u.asm.Cumprod).apply(null,arguments)},u._Cumsum=function(){return(u._Cumsum=u.asm.Cumsum).apply(null,arguments)},u._DenseBincount=function(){return(u._DenseBincount=u.asm.DenseBincount).apply(null,arguments)},u._DepthToSpace=function(){return(u._DepthToSpace=u.asm.DepthToSpace).apply(null,arguments)},u._DepthwiseConv2dNative=function(){return(u._DepthwiseConv2dNative=u.asm.DepthwiseConv2dNative).apply(null,arguments)},u._Diag=function(){return(u._Diag=u.asm.Diag).apply(null,arguments)},u._Dilation2D=function(){return(u._Dilation2D=u.asm.Dilation2D).apply(null,arguments)},u._Dilation2DBackpropFilter=function(){return(u._Dilation2DBackpropFilter=u.asm.Dilation2DBackpropFilter).apply(null,arguments)},u._Dilation2DBackpropInput=function(){return(u._Dilation2DBackpropInput=u.asm.Dilation2DBackpropInput).apply(null,arguments)},u._Elu=function(){return(u._Elu=u.asm.Elu).apply(null,arguments)},u._EluGrad=function(){return(u._EluGrad=u.asm.EluGrad).apply(null,arguments)},u._Equal=function(){return(u._Equal=u.asm.Equal).apply(null,arguments)},u._Erf=function(){return(u._Erf=u.asm.Erf).apply(null,arguments)},u._Exp=function(){return(u._Exp=u.asm.Exp).apply(null,arguments)},u._Expm1=function(){return(u._Expm1=u.asm.Expm1).apply(null,arguments)},u._FlipLeftRight=function(){return(u._FlipLeftRight=u.asm.FlipLeftRight).apply(null,arguments)},u._Floor=function(){return(u._Floor=u.asm.Floor).apply(null,arguments)},u._FloorDiv=function(){return(u._FloorDiv=u.asm.FloorDiv).apply(null,arguments)},u._FusedBatchNorm=function(){return(u._FusedBatchNorm=u.asm.FusedBatchNorm).apply(null,arguments)},u._FusedConv2D=function(){return(u._FusedConv2D=u.asm.FusedConv2D).apply(null,arguments)},u._FusedDepthwiseConv2D=function(){return(u._FusedDepthwiseConv2D=u.asm.FusedDepthwiseConv2D).apply(null,arguments)},u._Gather=function(){return(u._Gather=u.asm.Gather).apply(null,arguments)},u._GatherNd=function(){return(u._GatherNd=u.asm.GatherNd).apply(null,arguments)},u._Greater=function(){return(u._Greater=u.asm.Greater).apply(null,arguments)},u._GreaterEqual=function(){return(u._GreaterEqual=u.asm.GreaterEqual).apply(null,arguments)},u._IsFinite=function(){return(u._IsFinite=u.asm.IsFinite).apply(null,arguments)},u._IsInf=function(){return(u._IsInf=u.asm.IsInf).apply(null,arguments)},u._IsNan=function(){return(u._IsNan=u.asm.IsNan).apply(null,arguments)},u._LRN=function(){return(u._LRN=u.asm.LRN).apply(null,arguments)},u._LRNGrad=function(){return(u._LRNGrad=u.asm.LRNGrad).apply(null,arguments)},u._LeakyRelu=function(){return(u._LeakyRelu=u.asm.LeakyRelu).apply(null,arguments)},u._Less=function(){return(u._Less=u.asm.Less).apply(null,arguments)},u._LessEqual=function(){return(u._LessEqual=u.asm.LessEqual).apply(null,arguments)},u._LinSpace=function(){return(u._LinSpace=u.asm.LinSpace).apply(null,arguments)},u._Log=function(){return(u._Log=u.asm.Log).apply(null,arguments)},u._Log1p=function(){return(u._Log1p=u.asm.Log1p).apply(null,arguments)},u._LogicalAnd=function(){return(u._LogicalAnd=u.asm.LogicalAnd).apply(null,arguments)},u._LogicalNot=function(){return(u._LogicalNot=u.asm.LogicalNot).apply(null,arguments)},u._LogicalOr=function(){return(u._LogicalOr=u.asm.LogicalOr).apply(null,arguments)},u._LogicalXor=function(){return(u._LogicalXor=u.asm.LogicalXor).apply(null,arguments)},u._Max=function(){return(u._Max=u.asm.Max).apply(null,arguments)},u._MaxPool=function(){return(u._MaxPool=u.asm.MaxPool).apply(null,arguments)},u._MaxPool3D=function(){return(u._MaxPool3D=u.asm.MaxPool3D).apply(null,arguments)},u._MaxPool3DGrad=function(){return(u._MaxPool3DGrad=u.asm.MaxPool3DGrad).apply(null,arguments)},u._MaxPoolGrad=function(){return(u._MaxPoolGrad=u.asm.MaxPoolGrad).apply(null,arguments)},u._MaxPoolWithArgmax=function(){return(u._MaxPoolWithArgmax=u.asm.MaxPoolWithArgmax).apply(null,arguments)},u._Maximum=function(){return(u._Maximum=u.asm.Maximum).apply(null,arguments)},u._Mean=function(){return(u._Mean=u.asm.Mean).apply(null,arguments)},u._Min=function(){return(u._Min=u.asm.Min).apply(null,arguments)},u._Minimum=function(){return(u._Minimum=u.asm.Minimum).apply(null,arguments)},u._MirrorPad=function(){return(u._MirrorPad=u.asm.MirrorPad).apply(null,arguments)},u._Mod=function(){return(u._Mod=u.asm.Mod).apply(null,arguments)},u._Multinomial=function(){return(u._Multinomial=u.asm.Multinomial).apply(null,arguments)},u._Multiply=function(){return(u._Multiply=u.asm.Multiply).apply(null,arguments)},u._Neg=function(){return(u._Neg=u.asm.Neg).apply(null,arguments)},u._NonMaxSuppressionV3=function(){return(u._NonMaxSuppressionV3=u.asm.NonMaxSuppressionV3).apply(null,arguments)},u._NonMaxSuppressionV4=function(){return(u._NonMaxSuppressionV4=u.asm.NonMaxSuppressionV4).apply(null,arguments)},u._NonMaxSuppressionV5=function(){return(u._NonMaxSuppressionV5=u.asm.NonMaxSuppressionV5).apply(null,arguments)},u._NotEqual=function(){return(u._NotEqual=u.asm.NotEqual).apply(null,arguments)},u._OneHot=function(){return(u._OneHot=u.asm.OneHot).apply(null,arguments)},u._PadV2=function(){return(u._PadV2=u.asm.PadV2).apply(null,arguments)},u._Pow=function(){return(u._Pow=u.asm.Pow).apply(null,arguments)},u._Prelu=function(){return(u._Prelu=u.asm.Prelu).apply(null,arguments)},u._Prod=function(){return(u._Prod=u.asm.Prod).apply(null,arguments)},u._RealDiv=function(){return(u._RealDiv=u.asm.RealDiv).apply(null,arguments)},u._Reciprocal=function(){return(u._Reciprocal=u.asm.Reciprocal).apply(null,arguments)},u._Relu=function(){return(u._Relu=u.asm.Relu).apply(null,arguments)},u._Relu6=function(){return(u._Relu6=u.asm.Relu6).apply(null,arguments)},u._ResizeBilinear=function(){return(u._ResizeBilinear=u.asm.ResizeBilinear).apply(null,arguments)},u._ResizeBilinearGrad=function(){return(u._ResizeBilinearGrad=u.asm.ResizeBilinearGrad).apply(null,arguments)},u._ResizeNearestNeighbor=function(){return(u._ResizeNearestNeighbor=u.asm.ResizeNearestNeighbor).apply(null,arguments)},u._ResizeNearestNeighborGrad=function(){return(u._ResizeNearestNeighborGrad=u.asm.ResizeNearestNeighborGrad).apply(null,arguments)},u._Reverse=function(){return(u._Reverse=u.asm.Reverse).apply(null,arguments)},u._RotateWithOffset=function(){return(u._RotateWithOffset=u.asm.RotateWithOffset).apply(null,arguments)},u._Round=function(){return(u._Round=u.asm.Round).apply(null,arguments)},u._Rsqrt=function(){return(u._Rsqrt=u.asm.Rsqrt).apply(null,arguments)},u._ScatterNd=function(){return(u._ScatterNd=u.asm.ScatterNd).apply(null,arguments)},u._SearchSorted=function(){return(u._SearchSorted=u.asm.SearchSorted).apply(null,arguments)},u._SelectV2=function(){return(u._SelectV2=u.asm.SelectV2).apply(null,arguments)},u._Selu=function(){return(u._Selu=u.asm.Selu).apply(null,arguments)},u._Sigmoid=function(){return(u._Sigmoid=u.asm.Sigmoid).apply(null,arguments)},u._Sign=function(){return(u._Sign=u.asm.Sign).apply(null,arguments)},u._Sin=function(){return(u._Sin=u.asm.Sin).apply(null,arguments)},u._Sinh=function(){return(u._Sinh=u.asm.Sinh).apply(null,arguments)},u._Softmax=function(){return(u._Softmax=u.asm.Softmax).apply(null,arguments)},u._Softplus=function(){return(u._Softplus=u.asm.Softplus).apply(null,arguments)},u._SparseFillEmptyRows=function(){return(u._SparseFillEmptyRows=u.asm.SparseFillEmptyRows).apply(null,arguments)},u._SparseReshape=function(){return(u._SparseReshape=u.asm.SparseReshape).apply(null,arguments)},u._SparseSegmentReduction=function(){return(u._SparseSegmentReduction=u.asm.SparseSegmentReduction).apply(null,arguments)},u._SparseToDense=function(){return(u._SparseToDense=u.asm.SparseToDense).apply(null,arguments)},u._Sqrt=function(){return(u._Sqrt=u.asm.Sqrt).apply(null,arguments)},u._Square=function(){return(u._Square=u.asm.Square).apply(null,arguments)},u._SquaredDifference=function(){return(u._SquaredDifference=u.asm.SquaredDifference).apply(null,arguments)},u._Step=function(){return(u._Step=u.asm.Step).apply(null,arguments)},u._StridedSlice=function(){return(u._StridedSlice=u.asm.StridedSlice).apply(null,arguments)},u._Sub=function(){return(u._Sub=u.asm.Sub).apply(null,arguments)},u._Sum=function(){return(u._Sum=u.asm.Sum).apply(null,arguments)},u._Tan=function(){return(u._Tan=u.asm.Tan).apply(null,arguments)},u._Tanh=function(){return(u._Tanh=u.asm.Tanh).apply(null,arguments)},u._TensorScatterUpdate=function(){return(u._TensorScatterUpdate=u.asm.TensorScatterUpdate).apply(null,arguments)},u._Tile=function(){return(u._Tile=u.asm.Tile).apply(null,arguments)},u._TopK=function(){return(u._TopK=u.asm.TopK).apply(null,arguments)},u._Transform=function(){return(u._Transform=u.asm.Transform).apply(null,arguments)},u._Transpose=function(){return(u._Transpose=u.asm.Transpose).apply(null,arguments)},u.__FusedMatMul=function(){return(u.__FusedMatMul=u.asm._FusedMatMul).apply(null,arguments)},u._malloc=function(){return(u._malloc=u.asm.malloc).apply(null,arguments)},u._free=function(){return(u._free=u.asm.free).apply(null,arguments)},u.___errno_location=function(){return(u.___errno_location=u.asm.__errno_location).apply(null,arguments)},u.stackSave=function(){return(ne=u.stackSave=u.asm.stackSave).apply(null,arguments)}),re=u.stackRestore=function(){return(re=u.stackRestore=u.asm.stackRestore).apply(null,arguments)},ae=u.stackAlloc=function(){return(ae=u.stackAlloc=u.asm.stackAlloc).apply(null,arguments)};function se(e){function n(){Z||(Z=!0,u.calledRun=!0,T||(q(R),t(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),function(){if(u.postRun)for("function"==typeof u.postRun&&(u.postRun=[u.postRun]);u.postRun.length;)e=u.postRun.shift(),P.unshift(e);var e;q(P)}()))}e=e||f,F>0||(function(){if(u.preRun)for("function"==typeof u.preRun&&(u.preRun=[u.preRun]);u.preRun.length;)e=u.preRun.shift(),C.unshift(e);var e;q(C)}(),F>0||(u.setStatus?(u.setStatus("Running..."),setTimeout((function(){setTimeout((function(){u.setStatus("")}),1),n()}),1)):n()))}if(u.dynCall_iijjiiii=function(){return(u.dynCall_iijjiiii=u.asm.dynCall_iijjiiii).apply(null,arguments)},u.dynCall_jiji=function(){return(u.dynCall_jiji=u.asm.dynCall_jiji).apply(null,arguments)},u.cwrap=function(e,t,n,r){var a=(n=n||[]).every((e=>"number"===e||"boolean"===e));return"string"!==t&&a&&!r?J(e):function(){return X(e,t,n,arguments)}},L=function e(){Z||se(),Z||(L=e)},u.preInit)for("function"==typeof u.preInit&&(u.preInit=[u.preInit]);u.preInit.length>0;)u.preInit.pop()();if(se(),i&&(Q={uncaughtException:r.listeners("uncaughtException").filter((function(e){return!i.uncaughtException.indexOf(e)>-1})),unhandledRejection:r.listeners("unhandledRejection").filter((function(e){return!i.unhandledRejection.indexOf(e)>-1}))}),"undefined"!=typeof e)ee=e;else{if("undefined"==typeof WasmBackendModuleThreadedSimd)throw new Error("Could not find wasm module in post.js");ee=WasmBackendModuleThreadedSimd}if(Q){var oe=ee._dispose;ee._dispose=function(){oe(),Q.uncaughtException.forEach((function(e){r.removeListener("uncaughtException",e)})),Q.unhandledRejection.forEach((function(e){r.removeListener("unhandledRejection",e)}))}}return e.ready});e.exports=o}).call(this,"/index.js",n(58),"/")},function(e,t,n){"use strict";(function(e){var r=n(128),a=n(129),s=n(130);function o(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(e,t){if(o()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return d(this,e)}return c(this,e,t,n)}function c(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=p(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|h(t,n),a=(e=i(e,r)).write(t,n);a!==r&&(e=e.slice(0,a));return e}(e,t,n):function(e,t){if(u.isBuffer(t)){var n=0|f(t.length);return 0===(e=i(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?i(e,0):p(e,t);if("Buffer"===t.type&&s(t.data))return p(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function d(e,t){if(l(t),e=i(e,t<0?0:0|f(t)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function p(e,t){var n=t.length<0?0:0|f(t.length);e=i(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function f(e){if(e>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function h(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return W(e).length;default:if(r)return z(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return A(this,t,n);case"utf8":case"utf-8":return k(this,t,n);case"ascii":return T(this,t,n);case"latin1":case"binary":return N(this,t,n);case"base64":return S(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function b(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,a){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=a?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(a)return-1;n=e.length-1}else if(n<0){if(!a)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,a);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,a);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,a){var s,o=1,i=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,i/=2,u/=2,n/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(a){var l=-1;for(s=n;s<i;s++)if(c(e,s)===c(t,-1===l?0:s-l)){if(-1===l&&(l=s),s-l+1===u)return l*o}else-1!==l&&(s-=s-l),l=-1}else for(n+u>i&&(n=i-u),s=n;s>=0;s--){for(var d=!0,p=0;p<u;p++)if(c(e,s+p)!==c(t,p)){d=!1;break}if(d)return s}return-1}function w(e,t,n,r){n=Number(n)||0;var a=e.length-n;r?(r=Number(r))>a&&(r=a):r=a;var s=t.length;if(s%2!=0)throw new TypeError("Invalid hex string");r>s/2&&(r=s/2);for(var o=0;o<r;++o){var i=parseInt(t.substr(2*o,2),16);if(isNaN(i))return o;e[n+o]=i}return o}function O(e,t,n,r){return U(z(t,e.length-n),e,n,r)}function v(e,t,n,r){return U(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function j(e,t,n,r){return v(e,t,n,r)}function _(e,t,n,r){return U(W(t),e,n,r)}function x(e,t,n,r){return U(function(e,t){for(var n,r,a,s=[],o=0;o<e.length&&!((t-=2)<0);++o)r=(n=e.charCodeAt(o))>>8,a=n%256,s.push(a),s.push(r);return s}(t,e.length-n),e,n,r)}function S(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function k(e,t,n){n=Math.min(e.length,n);for(var r=[],a=t;a<n;){var s,o,i,u,c=e[a],l=null,d=c>239?4:c>223?3:c>191?2:1;if(a+d<=n)switch(d){case 1:c<128&&(l=c);break;case 2:128==(192&(s=e[a+1]))&&(u=(31&c)<<6|63&s)>127&&(l=u);break;case 3:s=e[a+1],o=e[a+2],128==(192&s)&&128==(192&o)&&(u=(15&c)<<12|(63&s)<<6|63&o)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:s=e[a+1],o=e[a+2],i=e[a+3],128==(192&s)&&128==(192&o)&&128==(192&i)&&(u=(15&c)<<18|(63&s)<<12|(63&o)<<6|63&i)>65535&&u<1114112&&(l=u)}null===l?(l=65533,d=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),a+=d}return function(e){var t=e.length;if(t<=E)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=E));return n}(r)}t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=o(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,n){return c(null,e,t,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,n){return function(e,t,n,r){return l(t),t<=0?i(e,t):void 0!==n?"string"==typeof r?i(e,t).fill(n,r):i(e,t).fill(n):i(e,t)}(null,e,t,n)},u.allocUnsafe=function(e){return d(null,e)},u.allocUnsafeSlow=function(e){return d(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,a=0,s=Math.min(n,r);a<s;++a)if(e[a]!==t[a]){n=e[a],r=t[a];break}return n<r?-1:r<n?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!s(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=u.allocUnsafe(t),a=0;for(n=0;n<e.length;++n){var o=e[n];if(!u.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,a),a+=o.length}return r},u.byteLength=h,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)b(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)b(this,t,t+3),b(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)b(this,t,t+7),b(this,t+1,t+6),b(this,t+2,t+5),b(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?k(this,0,e):m.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,n,r,a){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===a&&(a=this.length),t<0||n>e.length||r<0||a>this.length)throw new RangeError("out of range index");if(r>=a&&t>=n)return 0;if(r>=a)return-1;if(t>=n)return 1;if(this===e)return 0;for(var s=(a>>>=0)-(r>>>=0),o=(n>>>=0)-(t>>>=0),i=Math.min(s,o),c=this.slice(r,a),l=e.slice(t,n),d=0;d<i;++d)if(c[d]!==l[d]){s=c[d],o=l[d];break}return s<o?-1:o<s?1:0},u.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},u.prototype.indexOf=function(e,t,n){return g(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return g(this,e,t,n,!1)},u.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var a=this.length-t;if((void 0===n||n>a)&&(n=a),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var s=!1;;)switch(r){case"hex":return w(this,e,t,n);case"utf8":case"utf-8":return O(this,e,t,n);case"ascii":return v(this,e,t,n);case"latin1":case"binary":return j(this,e,t,n);case"base64":return _(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,n);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var E=4096;function T(e,t,n){var r="";n=Math.min(e.length,n);for(var a=t;a<n;++a)r+=String.fromCharCode(127&e[a]);return r}function N(e,t,n){var r="";n=Math.min(e.length,n);for(var a=t;a<n;++a)r+=String.fromCharCode(e[a]);return r}function A(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var a="",s=t;s<n;++s)a+=L(e[s]);return a}function M(e,t,n){for(var r=e.slice(t,n),a="",s=0;s<r.length;s+=2)a+=String.fromCharCode(r[s]+256*r[s+1]);return a}function I(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,n,r,a,s){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||t<s)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function $(e,t,n,r){t<0&&(t=65535+t+1);for(var a=0,s=Math.min(e.length-n,2);a<s;++a)e[n+a]=(t&255<<8*(r?a:1-a))>>>8*(r?a:1-a)}function C(e,t,n,r){t<0&&(t=4294967295+t+1);for(var a=0,s=Math.min(e.length-n,4);a<s;++a)e[n+a]=t>>>8*(r?a:3-a)&255}function R(e,t,n,r,a,s){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function P(e,t,n,r,s){return s||R(e,0,n,4),a.write(e,t,n,r,23,4),n+4}function F(e,t,n,r,s){return s||R(e,0,n,8),a.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=u.prototype;else{var a=t-e;n=new u(a,void 0);for(var s=0;s<a;++s)n[s]=this[s+e]}return n},u.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var r=this[e],a=1,s=0;++s<t&&(a*=256);)r+=this[e+s]*a;return r},u.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var r=this[e+--t],a=1;t>0&&(a*=256);)r+=this[e+--t]*a;return r},u.prototype.readUInt8=function(e,t){return t||I(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||I(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||I(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||I(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var r=this[e],a=1,s=0;++s<t&&(a*=256);)r+=this[e+s]*a;return r>=(a*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var r=t,a=1,s=this[e+--r];r>0&&(a*=256);)s+=this[e+--r]*a;return s>=(a*=128)&&(s-=Math.pow(2,8*t)),s},u.prototype.readInt8=function(e,t){return t||I(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||I(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||I(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||I(e,4,this.length),a.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||I(e,4,this.length),a.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||I(e,8,this.length),a.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||I(e,8,this.length),a.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||D(this,e,t,n,Math.pow(2,8*n)-1,0);var a=1,s=0;for(this[t]=255&e;++s<n&&(a*=256);)this[t+s]=e/a&255;return t+n},u.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||D(this,e,t,n,Math.pow(2,8*n)-1,0);var a=n-1,s=1;for(this[t+a]=255&e;--a>=0&&(s*=256);)this[t+a]=e/s&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):$(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):$(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):C(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var a=Math.pow(2,8*n-1);D(this,e,t,n,a-1,-a)}var s=0,o=1,i=0;for(this[t]=255&e;++s<n&&(o*=256);)e<0&&0===i&&0!==this[t+s-1]&&(i=1),this[t+s]=(e/o>>0)-i&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var a=Math.pow(2,8*n-1);D(this,e,t,n,a-1,-a)}var s=n-1,o=1,i=0;for(this[t+s]=255&e;--s>=0&&(o*=256);)e<0&&0===i&&0!==this[t+s+1]&&(i=1),this[t+s]=(e/o>>0)-i&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):$(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):$(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):C(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return P(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return P(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return F(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return F(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var a,s=r-n;if(this===e&&n<t&&t<r)for(a=s-1;a>=0;--a)e[a+t]=this[a+n];else if(s<1e3||!u.TYPED_ARRAY_SUPPORT)for(a=0;a<s;++a)e[a+t]=this[a+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+s),t);return s},u.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var a=e.charCodeAt(0);a<256&&(e=a)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var s;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(s=t;s<n;++s)this[s]=e;else{var o=u.isBuffer(e)?e:z(new u(e,r).toString()),i=o.length;for(s=0;s<n-t;++s)this[s+t]=o[s%i]}return this};var B=/[^+\/0-9A-Za-z-_]/g;function L(e){return e<16?"0"+e.toString(16):e.toString(16)}function z(e,t){var n;t=t||1/0;for(var r=e.length,a=null,s=[],o=0;o<r;++o){if((n=e.charCodeAt(o))>55295&&n<57344){if(!a){if(n>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&s.push(239,191,189);continue}a=n;continue}if(n<56320){(t-=3)>-1&&s.push(239,191,189),a=n;continue}n=65536+(a-55296<<10|n-56320)}else a&&(t-=3)>-1&&s.push(239,191,189);if(a=null,n<128){if((t-=1)<0)break;s.push(n)}else if(n<2048){if((t-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function W(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(B,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function U(e,t,n,r){for(var a=0;a<r&&!(a+n>=t.length||a>=e.length);++a)t[a+n]=e[a];return a}}).call(this,n(63))},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return a}));const r="undefined"!=typeof requestAnimationFrame?requestAnimationFrame:"undefined"!=typeof e?e:e=>e();function a(){return new Promise((e=>r((()=>e()))))}}).call(this,n(139).setImmediate)},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.r(t),n.d(t,"AdadeltaOptimizer",(function(){return dt})),n.d(t,"AdagradOptimizer",(function(){return ft})),n.d(t,"AdamOptimizer",(function(){return bt})),n.d(t,"AdamaxOptimizer",(function(){return wt})),n.d(t,"MomentumOptimizer",(function(){return vt})),n.d(t,"Optimizer",(function(){return lt})),n.d(t,"OptimizerConstructors",(function(){return _t})),n.d(t,"RMSPropOptimizer",(function(){return jt})),n.d(t,"SGDOptimizer",(function(){return Ot})),n.d(t,"Tensor",(function(){return Q.a})),n.d(t,"TensorBuffer",(function(){return Q.b})),n.d(t,"Variable",(function(){return Q.c})),n.d(t,"Rank",(function(){return xt.a})),n.d(t,"sumOutType",(function(){return xt.d})),n.d(t,"upcastType",(function(){return xt.e})),n.d(t,"abs",(function(){return gt})),n.d(t,"acos",(function(){return St})),n.d(t,"acosh",(function(){return kt})),n.d(t,"add",(function(){return tt.add})),n.d(t,"addN",(function(){return Et})),n.d(t,"all",(function(){return Tt})),n.d(t,"any",(function(){return Nt})),n.d(t,"argMax",(function(){return At})),n.d(t,"argMin",(function(){return Mt})),n.d(t,"asin",(function(){return It})),n.d(t,"asinh",(function(){return Dt})),n.d(t,"atan",(function(){return $t})),n.d(t,"atan2",(function(){return Ct})),n.d(t,"atanh",(function(){return Rt})),n.d(t,"avgPool",(function(){return Pt.avgPool})),n.d(t,"avgPool3d",(function(){return Lt})),n.d(t,"basicLSTMCell",(function(){return Gt})),n.d(t,"batchToSpaceND",(function(){return qt})),n.d(t,"batchNorm",(function(){return Ht})),n.d(t,"batchNorm2d",(function(){return Kt})),n.d(t,"batchNorm3d",(function(){return Yt})),n.d(t,"batchNorm4d",(function(){return Jt})),n.d(t,"bincount",(function(){return Xt})),n.d(t,"bitwiseAnd",(function(){return Zt})),n.d(t,"broadcastArgs",(function(){return Qt})),n.d(t,"broadcastTo",(function(){return tn})),n.d(t,"buffer",(function(){return nn.a})),n.d(t,"cast",(function(){return U.a})),n.d(t,"ceil",(function(){return rn})),n.d(t,"clipByValue",(function(){return an})),n.d(t,"clone",(function(){return en.a})),n.d(t,"complex",(function(){return sn.a})),n.d(t,"concat",(function(){return zt.concat})),n.d(t,"concat1d",(function(){return on})),n.d(t,"concat2d",(function(){return un})),n.d(t,"concat3d",(function(){return cn})),n.d(t,"concat4d",(function(){return ln})),n.d(t,"conv1d",(function(){return pn})),n.d(t,"conv2d",(function(){return dn.a})),n.d(t,"conv2dTranspose",(function(){return hn})),n.d(t,"conv3d",(function(){return mn})),n.d(t,"conv3dTranspose",(function(){return gn})),n.d(t,"cos",(function(){return yn})),n.d(t,"cosh",(function(){return wn})),n.d(t,"cumprod",(function(){return On})),n.d(t,"cumsum",(function(){return vn})),n.d(t,"denseBincount",(function(){return jn})),n.d(t,"depthToSpace",(function(){return _n})),n.d(t,"depthwiseConv2d",(function(){return xn.a})),n.d(t,"diag",(function(){return Sn})),n.d(t,"dilation2d",(function(){return kn})),n.d(t,"div",(function(){return rt})),n.d(t,"divNoNan",(function(){return Nn})),n.d(t,"dot",(function(){return An})),n.d(t,"einsum",(function(){return Mn})),n.d(t,"elu",(function(){return In.a})),n.d(t,"ensureShape",(function(){return Dn})),n.d(t,"equal",(function(){return En})),n.d(t,"erf",(function(){return $n})),n.d(t,"euclideanNorm",(function(){return Kn})),n.d(t,"exp",(function(){return Yn})),n.d(t,"expandDims",(function(){return Jn})),n.d(t,"expm1",(function(){return Xn})),n.d(t,"eye",(function(){return Qn})),n.d(t,"fill",(function(){return pt})),n.d(t,"floor",(function(){return er})),n.d(t,"floorDiv",(function(){return nt})),n.d(t,"gather",(function(){return tr})),n.d(t,"greater",(function(){return nr})),n.d(t,"greaterEqual",(function(){return rr})),n.d(t,"imag",(function(){return ar.a})),n.d(t,"isFinite",(function(){return sr})),n.d(t,"isInf",(function(){return or})),n.d(t,"isNaN",(function(){return ir})),n.d(t,"leakyRelu",(function(){return ur.a})),n.d(t,"less",(function(){return cr})),n.d(t,"lessEqual",(function(){return lr})),n.d(t,"linspace",(function(){return dr})),n.d(t,"localResponseNormalization",(function(){return pr})),n.d(t,"log",(function(){return fr})),n.d(t,"log1p",(function(){return hr})),n.d(t,"logSigmoid",(function(){return gr})),n.d(t,"logSoftmax",(function(){return yr})),n.d(t,"logSumExp",(function(){return wr})),n.d(t,"logicalAnd",(function(){return Or})),n.d(t,"logicalNot",(function(){return vr})),n.d(t,"logicalOr",(function(){return jr})),n.d(t,"logicalXor",(function(){return _r})),n.d(t,"lowerBound",(function(){return kr})),n.d(t,"matMul",(function(){return V.a})),n.d(t,"max",(function(){return Un})),n.d(t,"maxPool",(function(){return Er})),n.d(t,"maxPool3d",(function(){return Tr})),n.d(t,"maxPoolWithArgmax",(function(){return Nr})),n.d(t,"maximum",(function(){return yt.maximum})),n.d(t,"mean",(function(){return Ar.mean})),n.d(t,"meshgrid",(function(){return Dr})),n.d(t,"min",(function(){return Vn})),n.d(t,"minimum",(function(){return $r.minimum})),n.d(t,"mirrorPad",(function(){return Cr})),n.d(t,"mod",(function(){return Rr})),n.d(t,"moments",(function(){return Pr})),n.d(t,"mul",(function(){return at.mul})),n.d(t,"multiRNNCell",(function(){return Fr})),n.d(t,"multinomial",(function(){return Br})),n.d(t,"neg",(function(){return mr.a})),n.d(t,"notEqual",(function(){return Lr})),n.d(t,"oneHot",(function(){return K})),n.d(t,"ones",(function(){return Ir})),n.d(t,"onesLike",(function(){return zr})),n.d(t,"outerProduct",(function(){return Wr})),n.d(t,"pad",(function(){return Ur.pad})),n.d(t,"pad1d",(function(){return Vr})),n.d(t,"pad2d",(function(){return Gr})),n.d(t,"pad3d",(function(){return qr})),n.d(t,"pad4d",(function(){return Hr})),n.d(t,"pool",(function(){return Yr})),n.d(t,"pow",(function(){return ht})),n.d(t,"prelu",(function(){return Jr.a})),n.d(t,"print",(function(){return Xr.a})),n.d(t,"prod",(function(){return Zr})),n.d(t,"raggedGather",(function(){return Qr})),n.d(t,"raggedRange",(function(){return ea})),n.d(t,"raggedTensorToTensor",(function(){return ta})),n.d(t,"rand",(function(){return na})),n.d(t,"randomGamma",(function(){return ia})),n.d(t,"randomNormal",(function(){return ua})),n.d(t,"randomStandardNormal",(function(){return ca})),n.d(t,"randomUniform",(function(){return la})),n.d(t,"randomUniformInt",(function(){return da})),n.d(t,"range",(function(){return pa})),n.d(t,"real",(function(){return fa.a})),n.d(t,"reciprocal",(function(){return ha})),n.d(t,"relu",(function(){return ma.relu})),n.d(t,"relu6",(function(){return ba.relu6})),n.d(t,"reshape",(function(){return Bt.reshape})),n.d(t,"reverse",(function(){return ga})),n.d(t,"reverse1d",(function(){return ya})),n.d(t,"reverse2d",(function(){return wa})),n.d(t,"reverse3d",(function(){return Oa})),n.d(t,"reverse4d",(function(){return va})),n.d(t,"round",(function(){return ja})),n.d(t,"rsqrt",(function(){return _a})),n.d(t,"scalar",(function(){return ct})),n.d(t,"selu",(function(){return xa})),n.d(t,"separableConv2d",(function(){return Sa})),n.d(t,"setdiff1dAsync",(function(){return ka})),n.d(t,"sigmoid",(function(){return Wt.sigmoid})),n.d(t,"sign",(function(){return Ea})),n.d(t,"sin",(function(){return Ta})),n.d(t,"sinh",(function(){return Na})),n.d(t,"slice",(function(){return Ut})),n.d(t,"slice1d",(function(){return Aa})),n.d(t,"slice2d",(function(){return Ma})),n.d(t,"slice3d",(function(){return Ia})),n.d(t,"slice4d",(function(){return Da})),n.d(t,"softmax",(function(){return $a.softmax})),n.d(t,"softplus",(function(){return br})),n.d(t,"spaceToBatchND",(function(){return Kr})),n.d(t,"fft",(function(){return Ca})),n.d(t,"ifft",(function(){return Ra})),n.d(t,"irfft",(function(){return Pa})),n.d(t,"rfft",(function(){return Ba})),n.d(t,"split",(function(){return Fa})),n.d(t,"sqrt",(function(){return st})),n.d(t,"square",(function(){return ot})),n.d(t,"squaredDifference",(function(){return La})),n.d(t,"squeeze",(function(){return za.squeeze})),n.d(t,"stack",(function(){return Wa.stack})),n.d(t,"step",(function(){return Ua.a})),n.d(t,"stridedSlice",(function(){return Va.stridedSlice})),n.d(t,"sub",(function(){return mt})),n.d(t,"sum",(function(){return Gn.a})),n.d(t,"tan",(function(){return Ga})),n.d(t,"tanh",(function(){return Vt})),n.d(t,"tensor",(function(){return qa.a})),n.d(t,"tensor1d",(function(){return Ha.tensor1d})),n.d(t,"tensor2d",(function(){return Ka})),n.d(t,"tensor3d",(function(){return te})),n.d(t,"tensor4d",(function(){return Ya})),n.d(t,"tensor5d",(function(){return Ja})),n.d(t,"tensor6d",(function(){return Xa})),n.d(t,"tensorScatterUpdate",(function(){return Za})),n.d(t,"tile",(function(){return Zn})),n.d(t,"topk",(function(){return Qa})),n.d(t,"truncatedNormal",(function(){return es})),n.d(t,"unique",(function(){return ts})),n.d(t,"unsortedSegmentSum",(function(){return ns})),n.d(t,"unstack",(function(){return rs})),n.d(t,"upperBound",(function(){return as})),n.d(t,"variable",(function(){return ss})),n.d(t,"where",(function(){return Tn})),n.d(t,"whereAsync",(function(){return is})),n.d(t,"zeros",(function(){return Mr})),n.d(t,"zerosLike",(function(){return it})),n.d(t,"booleanMaskAsync",(function(){return us})),n.d(t,"transpose",(function(){return Y.transpose})),n.d(t,"norm",(function(){return Hn})),n.d(t,"movingAverage",(function(){return cs})),n.d(t,"scatterND",(function(){return ls})),n.d(t,"searchSorted",(function(){return Sr})),n.d(t,"sparseToDense",(function(){return ds})),n.d(t,"gatherND",(function(){return ps})),n.d(t,"dropout",(function(){return fs})),n.d(t,"enclosingPowerOfTwo",(function(){return hs})),n.d(t,"cosineWindow",(function(){return ms})),n.d(t,"inTopKAsync",(function(){return bs})),n.d(t,"op",(function(){return H.b})),n.d(t,"OP_SCOPE_SUFFIX",(function(){return H.a})),n.d(t,"image",(function(){return po})),n.d(t,"linalg",(function(){return fo})),n.d(t,"losses",(function(){return ho})),n.d(t,"spectral",(function(){return co})),n.d(t,"fused",(function(){return d})),n.d(t,"signal",(function(){return lo})),n.d(t,"sparse",(function(){return mo})),n.d(t,"string",(function(){return bo})),n.d(t,"Reduction",(function(){return Qs})),n.d(t,"train",(function(){return go})),n.d(t,"enableProdMode",(function(){return et.g})),n.d(t,"enableDebugMode",(function(){return et.f})),n.d(t,"disableDeprecationWarnings",(function(){return et.c})),n.d(t,"deprecationWarn",(function(){return et.b})),n.d(t,"disposeVariables",(function(){return et.e})),n.d(t,"engine",(function(){return et.h})),n.d(t,"memory",(function(){return et.m})),n.d(t,"profile",(function(){return et.n})),n.d(t,"tidy",(function(){return et.t})),n.d(t,"dispose",(function(){return et.d})),n.d(t,"keep",(function(){return et.l})),n.d(t,"time",(function(){return et.u})),n.d(t,"setBackend",(function(){return et.r})),n.d(t,"ready",(function(){return et.o})),n.d(t,"getBackend",(function(){return et.k})),n.d(t,"removeBackend",(function(){return et.q})),n.d(t,"findBackend",(function(){return et.i})),n.d(t,"findBackendFactory",(function(){return et.j})),n.d(t,"registerBackend",(function(){return et.p})),n.d(t,"backend",(function(){return et.a})),n.d(t,"setPlatform",(function(){return et.s})),n.d(t,"getKernel",(function(){return Z.c})),n.d(t,"getGradient",(function(){return Z.b})),n.d(t,"getKernelsForBackend",(function(){return Z.d})),n.d(t,"registerKernel",(function(){return Z.f})),n.d(t,"registerGradient",(function(){return Z.e})),n.d(t,"unregisterKernel",(function(){return Z.h})),n.d(t,"unregisterGradient",(function(){return Z.g})),n.d(t,"copyRegisteredKernels",(function(){return Z.a})),n.d(t,"customGrad",(function(){return ut.a})),n.d(t,"grad",(function(){return ut.b})),n.d(t,"grads",(function(){return ut.c})),n.d(t,"valueAndGrad",(function(){return ut.d})),n.d(t,"valueAndGrads",(function(){return ut.e})),n.d(t,"variableGrads",(function(){return ut.f})),n.d(t,"Environment",(function(){return m.b})),n.d(t,"env",(function(){return m.c})),n.d(t,"ENV",(function(){return m.a})),n.d(t,"version_core",(function(){return Qe})),n.d(t,"nextFrame",(function(){return yo.a})),n.d(t,"browser",(function(){return s})),n.d(t,"io",(function(){return r})),n.d(t,"math",(function(){return a})),n.d(t,"serialization",(function(){return c})),n.d(t,"test_util",(function(){return l})),n.d(t,"util",(function(){return Be})),n.d(t,"backend_util",(function(){return f})),n.d(t,"broadcast_util",(function(){return X})),n.d(t,"tensor_util",(function(){return Fe})),n.d(t,"slice_util",(function(){return u})),n.d(t,"gather_util",(function(){return o})),n.d(t,"scatter_util",(function(){return i})),n.d(t,"device_util",(function(){return xi})),n.d(t,"kernel_impls",(function(){return h})),n.d(t,"KernelBackend",(function(){return Si.b})),n.d(t,"DataStorage",(function(){return Si.a})),n.d(t,"Abs",(function(){return q.a})),n.d(t,"Acos",(function(){return q.b})),n.d(t,"Acosh",(function(){return q.c})),n.d(t,"Add",(function(){return q.d})),n.d(t,"AddN",(function(){return q.e})),n.d(t,"All",(function(){return q.f})),n.d(t,"Any",(function(){return q.g})),n.d(t,"ArgMax",(function(){return q.h})),n.d(t,"ArgMin",(function(){return q.i})),n.d(t,"Asin",(function(){return q.j})),n.d(t,"Asinh",(function(){return q.k})),n.d(t,"Atan",(function(){return q.l})),n.d(t,"Atanh",(function(){return q.n})),n.d(t,"Atan2",(function(){return q.m})),n.d(t,"AvgPool",(function(){return q.o})),n.d(t,"AvgPoolGrad",(function(){return q.r})),n.d(t,"AvgPool3D",(function(){return q.p})),n.d(t,"AvgPool3DGrad",(function(){return q.q})),n.d(t,"BatchMatMul",(function(){return q.s})),n.d(t,"BatchToSpaceND",(function(){return q.t})),n.d(t,"Bincount",(function(){return q.u})),n.d(t,"BitwiseAnd",(function(){return q.v})),n.d(t,"BroadcastTo",(function(){return q.x})),n.d(t,"BroadcastArgs",(function(){return q.w})),n.d(t,"Cast",(function(){return q.y})),n.d(t,"Ceil",(function(){return q.z})),n.d(t,"ClipByValue",(function(){return q.A})),n.d(t,"Complex",(function(){return q.B})),n.d(t,"ComplexAbs",(function(){return q.C})),n.d(t,"Concat",(function(){return q.D})),n.d(t,"Conv2D",(function(){return q.E})),n.d(t,"Conv2DBackpropFilter",(function(){return q.F})),n.d(t,"Conv2DBackpropInput",(function(){return q.G})),n.d(t,"Conv3D",(function(){return q.H})),n.d(t,"Conv3DBackpropFilterV2",(function(){return q.I})),n.d(t,"Conv3DBackpropInputV2",(function(){return q.J})),n.d(t,"Cos",(function(){return q.K})),n.d(t,"Cosh",(function(){return q.L})),n.d(t,"Cumprod",(function(){return q.N})),n.d(t,"Cumsum",(function(){return q.O})),n.d(t,"CropAndResize",(function(){return q.M})),n.d(t,"DenseBincount",(function(){return q.P})),n.d(t,"DepthToSpace",(function(){return q.Q})),n.d(t,"DepthwiseConv2dNative",(function(){return q.R})),n.d(t,"DepthwiseConv2dNativeBackpropFilter",(function(){return q.S})),n.d(t,"DepthwiseConv2dNativeBackpropInput",(function(){return q.T})),n.d(t,"Diag",(function(){return q.U})),n.d(t,"Dilation2D",(function(){return q.V})),n.d(t,"Dilation2DBackpropInput",(function(){return q.X})),n.d(t,"Dilation2DBackpropFilter",(function(){return q.W})),n.d(t,"Draw",(function(){return q.Y})),n.d(t,"RealDiv",(function(){return q.vc})),n.d(t,"Einsum",(function(){return q.Z})),n.d(t,"Elu",(function(){return q.ab})),n.d(t,"EluGrad",(function(){return q.bb})),n.d(t,"Erf",(function(){return q.db})),n.d(t,"Equal",(function(){return q.cb})),n.d(t,"Exp",(function(){return q.eb})),n.d(t,"ExpandDims",(function(){return q.fb})),n.d(t,"Expm1",(function(){return q.gb})),n.d(t,"FFT",(function(){return q.hb})),n.d(t,"Fill",(function(){return q.ib})),n.d(t,"FlipLeftRight",(function(){return q.jb})),n.d(t,"Floor",(function(){return q.kb})),n.d(t,"FloorDiv",(function(){return q.lb})),n.d(t,"FusedBatchNorm",(function(){return q.nb})),n.d(t,"GatherV2",(function(){return q.rb})),n.d(t,"GatherNd",(function(){return q.qb})),n.d(t,"Greater",(function(){return q.sb})),n.d(t,"GreaterEqual",(function(){return q.tb})),n.d(t,"Identity",(function(){return q.vb})),n.d(t,"IFFT",(function(){return q.ub})),n.d(t,"Imag",(function(){return q.wb})),n.d(t,"IsFinite",(function(){return q.xb})),n.d(t,"IsInf",(function(){return q.yb})),n.d(t,"IsNan",(function(){return q.zb})),n.d(t,"LeakyRelu",(function(){return q.Cb})),n.d(t,"Less",(function(){return q.Db})),n.d(t,"LessEqual",(function(){return q.Eb})),n.d(t,"LinSpace",(function(){return q.Fb})),n.d(t,"Log",(function(){return q.Gb})),n.d(t,"Log1p",(function(){return q.Hb})),n.d(t,"LogicalAnd",(function(){return q.Jb})),n.d(t,"LogicalNot",(function(){return q.Kb})),n.d(t,"LogicalOr",(function(){return q.Lb})),n.d(t,"LogicalXor",(function(){return q.Mb})),n.d(t,"LogSoftmax",(function(){return q.Ib})),n.d(t,"LowerBound",(function(){return q.Nb})),n.d(t,"LRN",(function(){return q.Ab})),n.d(t,"LRNGrad",(function(){return q.Bb})),n.d(t,"MatrixBandPart",(function(){return q.Ob})),n.d(t,"Max",(function(){return q.Pb})),n.d(t,"Maximum",(function(){return q.Vb})),n.d(t,"MaxPool",(function(){return q.Qb})),n.d(t,"MaxPoolGrad",(function(){return q.Tb})),n.d(t,"MaxPool3D",(function(){return q.Rb})),n.d(t,"MaxPool3DGrad",(function(){return q.Sb})),n.d(t,"MaxPoolWithArgmax",(function(){return q.Ub})),n.d(t,"Mean",(function(){return q.Wb})),n.d(t,"Min",(function(){return q.Xb})),n.d(t,"Minimum",(function(){return q.Yb})),n.d(t,"MirrorPad",(function(){return q.Zb})),n.d(t,"Mod",(function(){return q.ac})),n.d(t,"Multinomial",(function(){return q.bc})),n.d(t,"Multiply",(function(){return q.cc})),n.d(t,"Neg",(function(){return q.dc})),n.d(t,"NotEqual",(function(){return q.hc})),n.d(t,"NonMaxSuppressionV3",(function(){return q.ec})),n.d(t,"NonMaxSuppressionV4",(function(){return q.fc})),n.d(t,"NonMaxSuppressionV5",(function(){return q.gc})),n.d(t,"OnesLike",(function(){return q.jc})),n.d(t,"OneHot",(function(){return q.ic})),n.d(t,"Pack",(function(){return q.kc})),n.d(t,"PadV2",(function(){return q.lc})),n.d(t,"Pool",(function(){return q.mc})),n.d(t,"Pow",(function(){return q.nc})),n.d(t,"Prelu",(function(){return q.oc})),n.d(t,"Prod",(function(){return q.pc})),n.d(t,"RaggedGather",(function(){return q.qc})),n.d(t,"RaggedRange",(function(){return q.rc})),n.d(t,"RaggedTensorToTensor",(function(){return q.sc})),n.d(t,"Range",(function(){return q.tc})),n.d(t,"Real",(function(){return q.uc})),n.d(t,"Reciprocal",(function(){return q.wc})),n.d(t,"Relu",(function(){return q.xc})),n.d(t,"Reshape",(function(){return q.zc})),n.d(t,"ResizeNearestNeighbor",(function(){return q.Cc})),n.d(t,"ResizeNearestNeighborGrad",(function(){return q.Dc})),n.d(t,"ResizeBilinear",(function(){return q.Ac})),n.d(t,"ResizeBilinearGrad",(function(){return q.Bc})),n.d(t,"Relu6",(function(){return q.yc})),n.d(t,"Reverse",(function(){return q.Ec})),n.d(t,"Round",(function(){return q.Gc})),n.d(t,"Rsqrt",(function(){return q.Hc})),n.d(t,"ScatterNd",(function(){return q.Ic})),n.d(t,"TensorScatterUpdate",(function(){return q.nd})),n.d(t,"SearchSorted",(function(){return q.Jc})),n.d(t,"Select",(function(){return q.Kc})),n.d(t,"Selu",(function(){return q.Lc})),n.d(t,"Slice",(function(){return q.Qc})),n.d(t,"Sin",(function(){return q.Oc})),n.d(t,"Sinh",(function(){return q.Pc})),n.d(t,"Sign",(function(){return q.Nc})),n.d(t,"Sigmoid",(function(){return q.Mc})),n.d(t,"Softplus",(function(){return q.Sc})),n.d(t,"Sqrt",(function(){return q.ad})),n.d(t,"Sum",(function(){return q.kd})),n.d(t,"SpaceToBatchND",(function(){return q.Tc})),n.d(t,"SplitV",(function(){return q.Zc})),n.d(t,"Softmax",(function(){return q.Rc})),n.d(t,"SparseFillEmptyRows",(function(){return q.Uc})),n.d(t,"SparseReshape",(function(){return q.Vc})),n.d(t,"SparseSegmentMean",(function(){return q.Wc})),n.d(t,"SparseSegmentSum",(function(){return q.Xc})),n.d(t,"SparseToDense",(function(){return q.Yc})),n.d(t,"SquaredDifference",(function(){return q.cd})),n.d(t,"Square",(function(){return q.bd})),n.d(t,"StaticRegexReplace",(function(){return q.dd})),n.d(t,"StridedSlice",(function(){return q.fd})),n.d(t,"StringNGrams",(function(){return q.gd})),n.d(t,"StringSplit",(function(){return q.hd})),n.d(t,"StringToHashBucketFast",(function(){return q.id})),n.d(t,"Sub",(function(){return q.jd})),n.d(t,"Tan",(function(){return q.ld})),n.d(t,"Tanh",(function(){return q.md})),n.d(t,"Tile",(function(){return q.od})),n.d(t,"TopK",(function(){return q.pd})),n.d(t,"Transform",(function(){return q.qd})),n.d(t,"Transpose",(function(){return q.rd})),n.d(t,"Unique",(function(){return q.sd})),n.d(t,"Unpack",(function(){return q.td})),n.d(t,"UnsortedSegmentSum",(function(){return q.ud})),n.d(t,"UpperBound",(function(){return q.vd})),n.d(t,"ZerosLike",(function(){return q.wd})),n.d(t,"Step",(function(){return q.ed})),n.d(t,"FromPixels",(function(){return q.mb})),n.d(t,"RotateWithOffset",(function(){return q.Fc})),n.d(t,"_FusedMatMul",(function(){return q.xd})),n.d(t,"FusedConv2D",(function(){return q.ob})),n.d(t,"FusedDepthwiseConv2D",(function(){return q.pb}));var r={};n.r(r),n.d(r,"copyModel",(function(){return z.b})),n.d(r,"listModels",(function(){return z.c})),n.d(r,"moveModel",(function(){return z.d})),n.d(r,"removeModel",(function(){return z.e})),n.d(r,"browserFiles",(function(){return j})),n.d(r,"browserHTTPRequest",(function(){return D})),n.d(r,"CompositeArrayBuffer",(function(){return y.a})),n.d(r,"concatenateArrayBuffers",(function(){return b.d})),n.d(r,"decodeWeights",(function(){return b.e})),n.d(r,"encodeWeights",(function(){return b.f})),n.d(r,"fromMemory",(function(){return P})),n.d(r,"fromMemorySync",(function(){return F})),n.d(r,"getLoadHandlers",(function(){return g.b})),n.d(r,"getModelArtifactsForJSON",(function(){return b.g})),n.d(r,"getModelArtifactsForJSONSync",(function(){return b.h})),n.d(r,"getModelArtifactsInfoForJSON",(function(){return b.i})),n.d(r,"getSaveHandlers",(function(){return g.c})),n.d(r,"getWeightSpecs",(function(){return b.k})),n.d(r,"http",(function(){return I})),n.d(r,"isHTTPScheme",(function(){return A})),n.d(r,"loadWeights",(function(){return E})),n.d(r,"registerLoadRouter",(function(){return g.d})),n.d(r,"registerSaveRouter",(function(){return g.e})),n.d(r,"weightsLoaderFactory",(function(){return T})),n.d(r,"withSaveHandler",(function(){return B})),n.d(r,"withSaveHandlerSync",(function(){return L}));var a={};n.r(a),n.d(a,"confusionMatrix",(function(){return J}));var s={};n.r(s),n.d(s,"fromPixelsAsync",(function(){return oe})),n.d(s,"toPixels",(function(){return ue})),n.d(s,"draw",(function(){return ce})),n.d(s,"fromPixels",(function(){return le}));var o={};n.r(o),n.d(o,"prepareAndValidate",(function(){return de}));var i={};n.r(i),n.d(i,"validateUpdateShape",(function(){return pe})),n.d(i,"validateInput",(function(){return fe})),n.d(i,"calculateShapes",(function(){return he}));var u={};n.r(u),n.d(u,"assertParamsValid",(function(){return me})),n.d(u,"maskToAxes",(function(){return be})),n.d(u,"computeOutShape",(function(){return ge})),n.d(u,"stridesWithElidedDims",(function(){return ye})),n.d(u,"getNormalizedAxes",(function(){return ve})),n.d(u,"startIndicesWithElidedDims",(function(){return je})),n.d(u,"stopIndicesWithElidedDims",(function(){return _e})),n.d(u,"stridesForAxis",(function(){return xe})),n.d(u,"startForAxis",(function(){return Se})),n.d(u,"stopForAxis",(function(){return ke})),n.d(u,"isSliceContinous",(function(){return Ee})),n.d(u,"computeFlatOffset",(function(){return Te})),n.d(u,"parseSliceParams",(function(){return Ne})),n.d(u,"sliceInfo",(function(){return Ae}));var c={};n.r(c),n.d(c,"Serializable",(function(){return $e})),n.d(c,"SerializationMap",(function(){return Ce})),n.d(c,"registerClass",(function(){return Re})),n.d(c,"getRegisteredName",(function(){return Pe}));var l={};n.r(l),n.d(l,"TEST_EPSILON_FLOAT16",(function(){return Le})),n.d(l,"expectArraysClose",(function(){return ze})),n.d(l,"testEpsilon",(function(){return We})),n.d(l,"expectPromiseToFail",(function(){return Ve})),n.d(l,"expectArraysEqual",(function(){return Ge})),n.d(l,"expectNumbersClose",(function(){return qe})),n.d(l,"expectValuesInRange",(function(){return Ke})),n.d(l,"expectArrayBuffersEqual",(function(){return Ye})),n.d(l,"encodeStrings",(function(){return Je})),n.d(l,"createVideoElement",(function(){return Xe})),n.d(l,"play",(function(){return Ze}));var d={};n.r(d),n.d(d,"conv2d",(function(){return gs.conv2d})),n.d(d,"depthwiseConv2d",(function(){return ys.depthwiseConv2d})),n.d(d,"matMul",(function(){return ws.matMul}));var p={};n.r(p),n.d(p,"segOpComputeOptimalWindowSize",(function(){return wi})),n.d(p,"computeOutShape",(function(){return Oi})),n.d(p,"collectGatherOpShapeInfo",(function(){return vi}));var f={};n.r(f),n.d(f,"axesAreInnerMostDims",(function(){return Cn})),n.d(f,"combineLocations",(function(){return Rn})),n.d(f,"computeOutAndReduceShapes",(function(){return Pn})),n.d(f,"expandShapeToKeepDim",(function(){return Fn})),n.d(f,"assertAxesAreInnerMostDims",(function(){return Bn})),n.d(f,"getAxesPermutation",(function(){return Ln})),n.d(f,"getUndoAxesPermutation",(function(){return zn})),n.d(f,"getInnerMostAxes",(function(){return Wn})),n.d(f,"getBroadcastDims",(function(){return X.getBroadcastDims})),n.d(f,"getReductionAxes",(function(){return X.getReductionAxes})),n.d(f,"assertAndGetBroadcastShape",(function(){return X.assertAndGetBroadcastShape})),n.d(f,"assertParamsConsistent",(function(){return wo})),n.d(f,"computeOutShape",(function(){return Oo})),n.d(f,"computeDilation2DInfo",(function(){return Ft.e})),n.d(f,"computePool2DInfo",(function(){return Ft.f})),n.d(f,"computePool3DInfo",(function(){return Ft.g})),n.d(f,"computeConv2DInfo",(function(){return Ft.b})),n.d(f,"computeConv3DInfo",(function(){return Ft.c})),n.d(f,"computeDefaultPad",(function(){return Ft.d})),n.d(f,"tupleValuesAreOne",(function(){return Ft.k})),n.d(f,"eitherStridesOrDilationsAreOne",(function(){return Ft.i})),n.d(f,"stridesOrDilationsArePositive",(function(){return Ft.j})),n.d(f,"convertConv2DDataFormat",(function(){return Ft.h})),n.d(f,"checkPadOnDimRoundingMode",(function(){return Ft.a})),n.d(f,"getFusedDyActivation",(function(){return jo.c})),n.d(f,"getFusedBiasGradient",(function(){return jo.b})),n.d(f,"applyActivation",(function(){return jo.a})),n.d(f,"shouldFuse",(function(){return jo.d})),n.d(f,"RowPartitionType",(function(){return vo})),n.d(f,"combineRaggedTensorToTensorShapes",(function(){return _o})),n.d(f,"getRowPartitionTypesHelper",(function(){return xo})),n.d(f,"getRaggedRank",(function(){return So})),n.d(f,"validateDefaultValueShape",(function(){return ko})),n.d(f,"PARALLELIZE_THRESHOLD",(function(){return Eo})),n.d(f,"computeOptimalWindowSize",(function(){return To})),n.d(f,"slice_util",(function(){return u})),n.d(f,"upcastType",(function(){return xt.e})),n.d(f,"getImageCenter",(function(){return No})),n.d(f,"getReshaped",(function(){return Ao})),n.d(f,"getPermuted",(function(){return Mo})),n.d(f,"getReshapedPermuted",(function(){return Io})),n.d(f,"getSliceBeginCoords",(function(){return Do})),n.d(f,"getSliceSize",(function(){return $o})),n.d(f,"prepareAndValidate",(function(){return de})),n.d(f,"validateUpdateShape",(function(){return pe})),n.d(f,"validateInput",(function(){return fe})),n.d(f,"calculateShapes",(function(){return he})),n.d(f,"SELU_SCALEALPHA",(function(){return Co})),n.d(f,"SELU_SCALE",(function(){return Ro})),n.d(f,"ERF_P",(function(){return Po})),n.d(f,"ERF_A1",(function(){return Fo})),n.d(f,"ERF_A2",(function(){return Bo})),n.d(f,"ERF_A3",(function(){return Lo})),n.d(f,"ERF_A4",(function(){return zo})),n.d(f,"ERF_A5",(function(){return Wo})),n.d(f,"warn",(function(){return Uo.b})),n.d(f,"log",(function(){return Uo.a})),n.d(f,"mergeRealAndImagArrays",(function(){return Vo})),n.d(f,"splitRealAndImagArrays",(function(){return Go})),n.d(f,"complexWithEvenIndex",(function(){return qo})),n.d(f,"complexWithOddIndex",(function(){return Ho})),n.d(f,"getComplexWithIndex",(function(){return Ko})),n.d(f,"assignToTypedArray",(function(){return Yo})),n.d(f,"exponents",(function(){return Jo})),n.d(f,"exponent",(function(){return Xo})),n.d(f,"decodeEinsumEquation",(function(){return ei})),n.d(f,"getEinsumPermutation",(function(){return ti})),n.d(f,"checkEinsumDimSizes",(function(){return ni})),n.d(f,"getEinsumComputePath",(function(){return ri})),n.d(f,"isIdentityPermutation",(function(){return ai})),n.d(f,"prepareSplitSize",(function(){return oi})),n.d(f,"getSparseFillEmptyRowsIndicesDenseShapeMismatch",(function(){return ii})),n.d(f,"getSparseFillEmptyRowsNegativeIndexErrorMessage",(function(){return ui})),n.d(f,"getSparseFillEmptyRowsOutOfRangeIndexErrorMessage",(function(){return ci})),n.d(f,"getSparseReshapeMultipleNegativeOneOutputDimErrorMessage",(function(){return li})),n.d(f,"getSparseReshapeNegativeOutputDimErrorMessage",(function(){return di})),n.d(f,"getSparseReshapeEmptyTensorZeroOutputDimErrorMessage",(function(){return pi})),n.d(f,"getSparseReshapeInputOutputMultipleErrorMessage",(function(){return fi})),n.d(f,"getSparseReshapeInputOutputMismatchErrorMessage",(function(){return hi})),n.d(f,"getSparseSegmentReductionNegativeSegmentIdsErrorMessage",(function(){return mi})),n.d(f,"getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage",(function(){return bi})),n.d(f,"getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage",(function(){return gi})),n.d(f,"getSparseSegmentReductionIndicesOutOfRangeErrorMessage",(function(){return yi})),n.d(f,"segment_util",(function(){return p})),n.d(f,"fromUint8ToStringArray",(function(){return ji})),n.d(f,"fromStringArrayToUint8",(function(){return _i}));var h={};n.r(h),n.d(h,"nonMaxSuppressionV3Impl",(function(){return Ds})),n.d(h,"nonMaxSuppressionV4Impl",(function(){return $s})),n.d(h,"nonMaxSuppressionV5Impl",(function(){return Cs})),n.d(h,"whereImpl",(function(){return os}));n(77),n(79),n(62);var m=n(11),b=n(21),g=n(25),y=n(29);function w(e){return new Promise((e=>setTimeout(e))).then(e)}class O{constructor(e){if(!Object(m.c)().getBool("IS_BROWSER"))throw new Error("browserDownloads() cannot proceed because the current environment is not a browser.");e.startsWith(O.URL_SCHEME)&&(e=e.slice(O.URL_SCHEME.length)),null!=e&&0!==e.length||(e="model"),this.modelJsonFileName=e+".json",this.weightDataFileName=e+".weights.bin"}async save(e){if("undefined"==typeof document)throw new Error("Browser downloads are not supported in this environment since `document` is not present");const t=y.a.join(e.weightData),n=window.URL.createObjectURL(new Blob([t],{type:"application/octet-stream"}));if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserDownloads.save() does not support saving model topology in binary formats yet.");{const t=[{paths:["./"+this.weightDataFileName],weights:e.weightSpecs}],r=Object(b.j)(e,t),a=window.URL.createObjectURL(new Blob([JSON.stringify(r)],{type:"application/json"})),s=null==this.modelJsonAnchor?document.createElement("a"):this.modelJsonAnchor;if(s.download=this.modelJsonFileName,s.href=a,await w((()=>s.dispatchEvent(new MouseEvent("click")))),null!=e.weightData){const e=null==this.weightDataAnchor?document.createElement("a"):this.weightDataAnchor;e.download=this.weightDataFileName,e.href=n,await w((()=>e.dispatchEvent(new MouseEvent("click"))))}return{modelArtifactsInfo:Object(b.i)(e)}}}}O.URL_SCHEME="downloads://";class v{constructor(e){if(null==e||e.length<1)throw new Error(`When calling browserFiles, at least 1 file is required, but received ${e}`);this.jsonFile=e[0],this.weightsFiles=e.slice(1)}async load(){return new Promise(((e,t)=>{const n=new FileReader;n.onload=n=>{const r=JSON.parse(n.target.result),a=r.modelTopology;if(null==a)return void t(new Error(`modelTopology field is missing from file ${this.jsonFile.name}`));if(null==r.weightsManifest)return void t(new Error(`weightManifest field is missing from file ${this.jsonFile.name}`));if(0===this.weightsFiles.length)return void e({modelTopology:a});const s=Object(b.g)(r,(e=>this.loadWeights(e)));e(s)},n.onerror=e=>t(`Failed to read model topology and weights manifest JSON from file '${this.jsonFile.name}'. BrowserFiles supports loading Keras-style tf.Model artifacts only.`),n.readAsText(this.jsonFile)}))}loadWeights(e){const t=[],n=[];for(const r of e)t.push(...r.weights),n.push(...r.paths);const r=this.checkManifestAndWeightFiles(e),a=n.map((e=>this.loadWeightsFile(e,r[e])));return Promise.all(a).then((e=>[t,e]))}loadWeightsFile(e,t){return new Promise(((n,r)=>{const a=new FileReader;a.onload=e=>{const t=e.target.result;n(t)},a.onerror=t=>r(`Failed to weights data from file of path '${e}'.`),a.readAsArrayBuffer(t)}))}checkManifestAndWeightFiles(e){const t=[],n=this.weightsFiles.map((e=>Object(b.c)(e.name))),r={};for(const a of e)a.paths.forEach((e=>{const a=Object(b.c)(e);if(-1!==t.indexOf(a))throw new Error(`Duplicate file basename found in weights manifest: '${a}'`);if(t.push(a),-1===n.indexOf(a))throw new Error(`Weight file with basename '${a}' is not provided.`);r[e]=this.weightsFiles[n.indexOf(a)]}));if(t.length!==this.weightsFiles.length)throw new Error(`Mismatch in the number of files in weights manifest (${t.length}) and the number of weight files provided (${this.weightsFiles.length}).`);return r}}function j(e){return new v(e)}g.a.registerSaveRouter((e=>Object(m.c)().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(O.URL_SCHEME)?function(e="model"){return new O(e)}(e.slice(O.URL_SCHEME.length)):null));var _=n(8);function x(e,t,n,r){!function(e){Object(_.c)(null!=e&&Array.isArray(e)&&e.length>0,(()=>"promises must be a none empty array"))}(e),function(e,t){Object(_.c)(e>=0&&e<=1,(()=>`Progress fraction must be in range [0, 1], but got startFraction ${e}`)),Object(_.c)(t>=0&&t<=1,(()=>`Progress fraction must be in range [0, 1], but got endFraction ${t}`)),Object(_.c)(t>=e,(()=>`startFraction must be no more than endFraction, but got startFraction ${e} and endFraction ${t}`))}(n=null==n?0:n,r=null==r?1:r);let a=0;return Promise.all(e.map((s=>(s.then((s=>{const o=n+ ++a/e.length*(r-n);return t(o),s})),s))))}var S=n(69);async function k(e,t){null==t&&(t={});const n=null==t.fetchFunc?Object(m.c)().platform.fetch:t.fetchFunc,r=e.map((e=>n(e,t.requestInit,{isBinary:!0}))),a=(null==t.onProgress?await Promise.all(r):await x(r,t.onProgress,0,.5)).map((e=>e.arrayBuffer()));return null==t.onProgress?await Promise.all(a):await x(a,t.onProgress,.5,1)}async function E(e,t="",n,r){return T((e=>k(e,{requestInit:r})))(e,t,n)}function T(e){return async(t,n="",r)=>{const a=t.map((()=>!1)),s={},o=null!=r?r.map((()=>!1)):[],i=[];if(t.forEach(((e,t)=>{let n=0;e.weights.forEach((e=>{const u="quantization"in e?e.quantization.dtype:e.dtype,c=S.a[u]*_.O(e.shape),l=()=>{a[t]=!0,null==s[t]&&(s[t]=[]),s[t].push({manifestEntry:e,groupOffset:n,sizeBytes:c})};null!=r?r.forEach(((t,n)=>{t===e.name&&(l(),o[n]=!0)})):l(),i.push(e.name),n+=c}))})),!o.every((e=>e))){const e=r.filter(((e,t)=>!o[t]));throw new Error(`Could not find weights in manifest with names: ${e.join(", ")}. \nManifest JSON has weights with names: ${i.join(", ")}.`)}const u=a.reduce(((e,t,n)=>(t&&e.push(n),e)),[]),c=[];u.forEach((e=>{t[e].paths.forEach((e=>{const t=n+(n.endsWith("/")?"":"/")+e;c.push(t)}))}));const l=await e(c),d={};let p=0;return u.forEach((e=>{const n=t[e].paths.length,r=new y.a(l.slice(p,p+n));s[e].forEach((e=>{const t=r.slice(e.groupOffset,e.groupOffset+e.sizeBytes),n=Object(b.e)(t,[e.manifestEntry]);for(const e in n)d[e]=n[e]})),p+=n})),d}}class N{constructor(e,t){if(this.DEFAULT_METHOD="POST",null==t&&(t={}),this.weightPathPrefix=t.weightPathPrefix,this.onProgress=t.onProgress,this.weightUrlConverter=t.weightUrlConverter,null!=t.fetchFunc?(Object(_.c)("function"==typeof t.fetchFunc,(()=>"Must pass a function that matches the signature of `fetch` (see https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)")),this.fetch=t.fetchFunc):this.fetch=Object(m.c)().platform.fetch,Object(_.c)(null!=e&&e.length>0,(()=>"URL path for http must not be null, undefined or empty.")),Array.isArray(e)&&Object(_.c)(2===e.length,(()=>`URL paths for http must have a length of 2, (actual length is ${e.length}).`)),this.path=e,null!=t.requestInit&&null!=t.requestInit.body)throw new Error("requestInit is expected to have no pre-existing body, but has one.");this.requestInit=t.requestInit||{}}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserHTTPRequest.save() does not support saving model topology in binary formats yet.");const t=Object.assign({method:this.DEFAULT_METHOD},this.requestInit);t.body=new FormData;const n=[{paths:["./model.weights.bin"],weights:e.weightSpecs}],r=Object(b.j)(e,n);if(t.body.append("model.json",new Blob([JSON.stringify(r)],{type:"application/json"}),"model.json"),null!=e.weightData){const n=y.a.join(e.weightData);t.body.append("model.weights.bin",new Blob([n],{type:"application/octet-stream"}),"model.weights.bin")}const a=await this.fetch(this.path,t);if(a.ok)return{modelArtifactsInfo:Object(b.i)(e),responses:[a]};throw new Error(`BrowserHTTPRequest.save() failed due to HTTP response status ${a.status}.`)}async load(){const e=await this.fetch(this.path,this.requestInit);if(!e.ok)throw new Error(`Request to ${this.path} failed with status code ${e.status}. Please verify this URL points to the model JSON of the model to load.`);let t;try{t=await e.json()}catch(e){let t=`Failed to parse model JSON of response from ${this.path}.`;throw this.path.endsWith(".pb")?t+=" Your path contains a .pb file extension. Support for .pb models have been removed in TensorFlow.js 1.0 in favor of .json models. You can re-convert your Python TensorFlow model using the TensorFlow.js 1.0 conversion scripts or you can convert your.pb models with the 'pb2json'NPM script in the tensorflow/tfjs-converter repository.":t+=" Please make sure the server is serving valid JSON for this request.",new Error(t)}const n=t.modelTopology,r=t.weightsManifest;if(null==n&&null==r)throw new Error(`The JSON from HTTP path ${this.path} contains neither model topology or manifest for weights.`);return Object(b.g)(t,(e=>this.loadWeights(e)))}async loadWeights(e){const t=Array.isArray(this.path)?this.path[1]:this.path,[n,r]=function(e){const t=e.lastIndexOf("/"),n=e.lastIndexOf("?"),r=e.substring(0,t),a=n>t?e.substring(n):"";return[r+"/",a]}(t),a=this.weightPathPrefix||n,s=Object(b.k)(e),o=[],i=[];for(const t of e)for(const e of t.paths)null!=this.weightUrlConverter?i.push(this.weightUrlConverter(e)):o.push(a+e+r);this.weightUrlConverter&&o.push(...await Promise.all(i));return[s,await k(o,{requestInit:this.requestInit,fetchFunc:this.fetch,onProgress:this.onProgress})]}}function A(e){return null!=e.match(N.URL_SCHEME_REGEX)}N.URL_SCHEME_REGEX=/^https?:\/\//;const M=(e,t)=>{if("undefined"==typeof fetch&&(null==t||null==t.fetchFunc))return null;{let n=!0;if(n=Array.isArray(e)?e.every((e=>A(e))):A(e),n)return I(e,t)}return null};function I(e,t){return new N(e,t)}function D(e,t){return I(e,t)}g.a.registerSaveRouter(M),g.a.registerLoadRouter(M);class ${constructor(e){this.modelArtifacts=e}load(){return this.modelArtifacts}}class C{constructor(e){this.saveHandler=e}save(e){return this.saveHandler(e)}}class R{constructor(e){e.load&&(this.load=()=>Promise.resolve(e.load())),e.save&&(this.save=t=>Promise.resolve(e.save(t)))}}function P(e,t,n,r){const a=arguments;return new R(F(...a))}function F(e,t,n,r){if(1===arguments.length){return null!=e.modelTopology||null!=e.weightSpecs?new $(e):(console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."),new $({modelTopology:e}))}return console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."),new $({modelTopology:e,weightSpecs:t,weightData:n,trainingConfig:r})}function B(e){return new C(e)}function L(e){return new C(e)}var z=n(48),W=n(1),U=n(15),V=n(19),G=n(3),q=n(4),H=n(2);const K=Object(H.b)({oneHot_:function(e,t,n=1,r=0,a="int32"){if(t<2)throw new Error(`Error in oneHot: depth must be >=2, but it is ${t}`);const s={indices:Object(W.a)(e,"indices","oneHot","int32")},o={dtype:a,depth:t,onValue:n,offValue:r};return G.a.runKernel(q.ic,s,o)}});var Y=n(53);const J=Object(H.b)({confusionMatrix_:function(e,t,n){const r=Object(W.a)(e,"labels","confusionMatrix"),a=Object(W.a)(t,"predictions","confusionMatrix");_.c(null==n||n>0&&Number.isInteger(n),(()=>`If provided, numClasses must be a positive integer, but got ${n}`)),_.c(1===r.rank,(()=>`Expected the rank of labels to be 1, but got ${r.rank}`)),_.c(1===a.rank,(()=>`Expected the rank of predictions to be 1, but got ${a.rank}`)),_.c(r.shape[0]===a.shape[0],(()=>`Mismatch in the number of examples: ${r.shape[0]} vs. ${a.shape[0]}. Labels and predictions should have the same number of elements.`)),_.c(n>0&&Number.isInteger(n),(()=>`numClasses is required to be a positive integer, but got ${n}`));const s=K(Object(U.a)(r,"int32"),n),o=K(Object(U.a)(a,"int32"),n),i=Object(Y.transpose)(s),u=Object(V.a)(i,o);return Object(U.a)(u,"int32")}});var X=n(16),Z=n(38),Q=n(17),ee=n(30);function te(e,t,n){if(Object(_.e)(e),null!=t&&3!==t.length)throw new Error("tensor3d() requires shape to have three numbers");const r=Object(W.c)(e,n);if(3!==r.length&&1!==r.length)throw new Error("tensor3d() requires values to be number[][][] or flat/TypedArray");if(1===r.length&&null==t)throw new Error("tensor3d() requires shape to be provided when `values` are a flat array");return Object(ee.a)(e,t,r,n)}let ne,re=!1;function ae(e,t=3){if(t>4)throw new Error("Cannot construct Tensor with more than 4 channels from pixels.");if(null==e)throw new Error("pixels passed to tf.browser.fromPixels() can not be null");let n=!1,r=!1,a=!1,s=!1,o=!1,i=!1;if(e.data instanceof Uint8Array)n=!0;else if("undefined"!=typeof ImageData&&e instanceof ImageData)r=!0;else if("undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement)a=!0;else if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement)s=!0;else if(null!=e.getContext)o=!0;else{if(!("undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap))throw new Error(`pixels passed to tf.browser.fromPixels() must be either an HTMLVideoElement, HTMLImageElement, HTMLCanvasElement, ImageData in browser, or OffscreenCanvas, ImageData in webworker or {data: Uint32Array, width: number, height: number}, but was ${e.constructor.name}`);i=!0}if(null!=Object(Z.c)(q.mb,G.a.backendName)){const n={pixels:e},r={numChannels:t};return G.a.runKernel(q.mb,n,r)}const[u,c]=a?[e.videoWidth,e.videoHeight]:[e.width,e.height];let l,d;if(o)l=e.getContext("2d").getImageData(0,0,u,c).data;else if(r||n)l=e.data;else if(s||a||i){if(null==ne)if("undefined"==typeof document){if("undefined"==typeof OffscreenCanvas||"undefined"==typeof OffscreenCanvasRenderingContext2D)throw new Error("Cannot parse input in current context. Reason: OffscreenCanvas Context2D rendering is not supported.");ne=new OffscreenCanvas(1,1).getContext("2d")}else ne=document.createElement("canvas").getContext("2d",{willReadFrequently:!0});ne.canvas.width=u,ne.canvas.height=c,ne.drawImage(e,0,0,u,c),l=ne.getImageData(0,0,u,c).data}if(4===t)d=new Int32Array(l);else{const e=u*c;d=new Int32Array(e*t);for(let n=0;n<e;n++)for(let e=0;e<t;++e)d[n*t+e]=l[4*n+e]}return te(d,[c,u,t],"int32")}function se(e){return"undefined"!=typeof window&&"undefined"!=typeof ImageBitmap&&window.hasOwnProperty("createImageBitmap")&&!(e instanceof ImageBitmap)&&function(e){return null!=e&&0!==e.width&&0!==e.height}(e)&&!function(e){return null!=e&&e.data instanceof Uint8Array}(e)}async function oe(e,t=3){let n=null;if(Object(m.c)().getBool("WRAP_TO_IMAGEBITMAP")&&se(e)){let t;try{t=await createImageBitmap(e,{premultiplyAlpha:"none"})}catch(e){t=null}n=null!=t&&t.width===e.width&&t.height===e.height?t:e}else n=e;return ae(n,t)}function ie(e){if(2!==e.rank&&3!==e.rank)throw new Error(`toPixels only supports rank 2 or 3 tensors, got rank ${e.rank}.`);const t=2===e.rank?1:e.shape[2];if(t>4||2===t)throw new Error(`toPixels only supports depth of size 1, 3 or 4 but got ${t}`);if("float32"!==e.dtype&&"int32"!==e.dtype)throw new Error(`Unsupported type for toPixels: ${e.dtype}. Please use float32 or int32 tensors.`)}async function ue(e,t){let n=Object(W.a)(e,"img","toPixels");if(!(e instanceof Q.a)){const e=n;n=Object(U.a)(e,"int32"),e.dispose()}ie(n);const[r,a]=n.shape.slice(0,2),s=2===n.rank?1:n.shape[2],o=await n.data(),i="float32"===n.dtype?255:1,u=new Uint8ClampedArray(a*r*4);for(let e=0;e<r*a;++e){const t=[0,0,0,255];for(let r=0;r<s;r++){const a=o[e*s+r];if("float32"===n.dtype){if(a<0||a>1)throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${a}.`)}else if("int32"===n.dtype&&(a<0||a>255))throw new Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${a}.`);1===s?(t[0]=a*i,t[1]=a*i,t[2]=a*i):t[r]=a*i}const r=4*e;u[r+0]=Math.round(t[0]),u[r+1]=Math.round(t[1]),u[r+2]=Math.round(t[2]),u[r+3]=Math.round(t[3])}if(null!=t){if(!re){null!=Object(Z.c)(q.Y,G.a.backendName)&&(console.warn("tf.browser.toPixels is not efficient to draw tensor on canvas. Please try tf.browser.draw instead."),re=!0)}t.width=a,t.height=r;const e=t.getContext("2d"),n=new ImageData(u,a,r);e.putImageData(n,0,0)}return n!==e&&n.dispose(),u}function ce(e,t,n){let r=Object(W.a)(e,"img","draw");if(!(e instanceof Q.a)){const e=r;r=Object(U.a)(e,"int32"),e.dispose()}ie(r),function(e){const t=(null==e?void 0:e.alpha)||1;if(t>1||t<0)throw new Error(`Alpha value ${t} is suppoed to be in range [0 - 1].`)}(null==n?void 0:n.imageOptions);const a={image:r},s={canvas:t,options:n};G.a.runKernel(q.Y,a,s)}const le=Object(H.b)({fromPixels_:ae});function de(e,t){const n=e.shape.length,r=t.shape.length;if(n<1)throw new Error(`tf.gatherND() expects the input to be rank 1 or higher, but the rank was ${n}.`);if(r<1)throw new Error(`tf.gatherND() expects the indices to be rank 1 or higher, but the rank was ${r}.`);if("int32"!==t.dtype)throw new Error(`tf.gatherND() expects the indices to be int32 type, but the dtype was ${t.dtype}.`);if(t.shape[r-1]>n)throw new Error(`index innermost dimension length must be <= tensor rank; saw: ${t.shape[r-1]} vs. ${n}`);if(0===Object(_.O)(e.shape))throw new Error(`Requested more than 0 entries, but input is empty. Input shape: ${e.shape}.`);const a=t.shape,s=a[a.length-1];let o=1;for(let e=0;e<a.length-1;++e)o*=a[e];const i=e.shape,u=a.slice();u.pop();let c=1;for(let e=s;e<n;++e)c*=i[e],u.push(i[e]);const l=[...Object(_.k)(e.shape).map((e=>e/c)),1].slice(0,s);return[u,o,c,l]}function pe(e,t,n){const r=t.rank>1?t.shape[t.rank-1]:1,a=t.rank>1?t.rank-1:1,s=`Must have updates.shape = indices.shape[:batchDim] + shape[sliceDim:], got updates.shape: ${n.shape}, indices.shape: ${t.shape}, shape: ${e}, sliceDim: ${r}, and batchDim: ${a}.`;if(n.rank<a)throw new Error(s+` update.rank < ${a}. `);if(e.length<r+(n.rank-a))throw new Error(s+` Output shape length < ${r+(n.rank-a)}`);if(n.rank!==a+e.length-r)throw new Error(s+" update.rank != "+(a+e.length-r));for(let e=0;e<a;++e)if(n.shape[e]!==t.shape[e])throw new Error(s+` updates.shape[${e}] (${n.shape[e]}) != indices.shape[${e}] (${t.shape[e]}).`);for(let t=0;t<n.rank-a;++t)if(n.shape[t+a]!==e[t+r])throw new Error(s+` updates.shape[${t+a}] (${n.shape[t+a]}) != shape[${t+a}] (${e[t+a]})`)}function fe(e,t,n){if(t.rank<1)throw new Error(`tf.scatterND() expects the indices to be rank 1 or higher, but the rank was ${t.rank}.`);if(e.rank<1)throw new Error(`tf.scatterND() expects the updates to be rank 1 or higher, but the rank was ${e.rank}.`);if("int32"!==t.dtype)throw new Error(`The dtype of 'indices' should be int32, but got dtype: ${t.dtype}`);if(n.length<1)throw new Error(`Output rank must be greater or equal to 1, but got shape: ${n}`);if(0===n.length){if(0===t.size)throw new Error(`Indices specified for empty output. indices shape: ${t.shape}`);if(0===e.size)throw new Error(`Updates specified for empty output. updates shape: ${e.shape}`)}pe(n,t,e)}function he(e,t,n){const r=t.shape.length,a=r>1?t.shape[r-1]:1,s=n.length;let o=1;for(let e=a;e<s;++e)o*=n[e];const i=a<1?1:a;return{sliceRank:a,numUpdates:Object(_.O)(t.shape)/i,sliceSize:o,strides:[...Object(_.k)(n.slice(0,a)),1],outputSize:Object(_.O)(n)}}function me(e,t,n){const r=e.shape.length;_.c(r===t.length,(()=>`Error in slice${r}D: Length of begin ${t} must match the rank of the array (${r}).`)),_.c(r===n.length,(()=>`Error in slice${r}D: Length of size ${n} must match the rank of the array (${r}).`));for(let a=0;a<r;++a)_.c(t[a]+n[a]<=e.shape[a],(()=>`Error in slice${r}D: begin[${a}] + size[${a}] (${t[a]+n[a]}) would overflow input.shape[${a}] (${e.shape[a]})`))}function be(e){const t=[];let n=0;for(;e>0;)1&e&&t.push(n),e/=2,n++;return t}function ge(e,t,n){const r=[];for(let a=0;a<e.length;a++)r[a]=Math.ceil((t[a]-e[a])/n[a]);return r}function ye(e,t,n,r){const a=[...e];for(let e=a.length;e<r.length;e++)a.push(1);for(let e=0;e<n;e++)0===e?a[t]=1:(a.splice(t,0,1),a.pop());return a}function we(e,t,n){return n<=e?n:n-(t-1)}function Oe(e,t){const n=[];for(let r=0;r<e;r++)n.push(t+r);return n}function ve(e,t,n,r,a,s,o,i,u){const c=e.length;let l=new Array(c),d=new Array(c),p=new Array(c);if(t.length&&n>0){const u=t[0],c=n+1;l=je(o,u,c,r,e),d=_e(i,u,c,a,e),p=ye(s,u,c,e)}else for(let t=0;t<c;t++)l[t]=Se(o,r,s,e,t,u),d[t]=ke(i,a,s,e,t,u),p[t]=xe(s,t,u);return{begin:l,end:d,strides:p}}function je(e,t,n,r,a){const s=[...a],o=Oe(n,t);for(let a=0;a<s.length;a++)if(o.indexOf(a)>-1)s[a]=0;else{const o=we(t,n,a);let i=r[o];e&1<<o&&(i=0),s[a]=i}return s}function _e(e,t,n,r,a){const s=[...a],o=Oe(n,t);for(let a=0;a<s.length;a++)if(o.indexOf(a)>-1)s[a]=Number.MAX_SAFE_INTEGER;else{const o=we(t,n,a);let i=r[o];e&1<<o&&(i=Number.MAX_SAFE_INTEGER),s[a]=i}for(let e=0;e<s.length;e++){const t=a[e];s[e]<0&&(s[e]+=t),s[e]=_.j(0,s[e],a[e])}return s}function xe(e,t,n){let r=e[t];return(n&1<<t||null==r)&&(r=1),r}function Se(e,t,n,r,a,s){let o=t[a];const i=n[a]||1;(e&1<<a||s&1<<a||null==o)&&(o=i>0?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER);const u=r[a];return o<0&&(o+=u),o=_.j(0,o,u-1),o}function ke(e,t,n,r,a,s){let o=t[a];const i=n[a]||1;(e&1<<a||s&1<<a||null==o)&&(o=i>0?Number.MAX_SAFE_INTEGER:Number.MIN_SAFE_INTEGER);const u=r[a];return o<0&&(o+=u),o=i>0?_.j(0,o,u):_.j(-1,o,u-1),o}function Ee(e,t,n){let r=n.length;for(let e=0;e<n.length;e++)if(n[e]>1){r=e;break}for(let a=r+1;a<n.length;a++)if(t[a]>0||n[a]!==e[a])return!1;return!0}function Te(e,t){let n=e.length>0?e[e.length-1]:1;for(let r=0;r<e.length-1;r++)n+=e[r]*t[r];return n}function Ne(e,t,n){let r;const a=e.shape.length;let s;return r="number"==typeof t?[t,...new Array(a-1).fill(0)]:t.length<a?t.concat(new Array(a-t.length).fill(0)):t.slice(),r.forEach((e=>{_.c(-1!==e,(()=>"slice() does not support negative begin indexing."))})),s=null==n?new Array(a).fill(-1):"number"==typeof n?[n,...new Array(a-1).fill(-1)]:n.length<a?n.concat(new Array(a-n.length).fill(-1)):n,s=s.map(((t,n)=>t>=0?t:(_.c(-1===t,(()=>`Negative size values should be exactly -1 but got ${t} for the slice() size at index ${n}.`)),e.shape[n]-r[n]))),[r,s]}function Ae(e,t,n,r,a,s,o,i,u){let c;if(null==r?(c=new Array(t.length),c.fill(1)):c=r,null!=o&&0!=(o&o-1))throw new Error("Multiple ellipses in slice is not allowed.");let l=!1;const d={dims:c.length,numAddAxisAfterEllipsis:0,begin:t.slice(),end:n.slice(),strides:c.slice(),beginMask:a,endMask:s,ellipsisMask:o,newAxisMask:i,shrinkAxisMask:u};for(let e=0;e<d.dims;e++)l&&0!=(1<<e&i)&&d.numAddAxisAfterEllipsis++,1<<e&o&&(l=!0);l||(d.ellipsisMask|=1<<d.dims,d.dims++);const p={dims:e.length,beginMask:0,endMask:0,beginValid:!1,endValid:!1};!function(e,t){t.beginMask=0,t.endMask=0,t.shrinkAxisMask=0;let n=0;t.beginValid=null!=e.begin,t.endValid=null!=e.end,t.begin=new Array(t.dims),t.end=new Array(t.dims),t.strides=new Array(t.dims),t.finalShapeGatherIndices=[],t.finalShapeGatherIndicesSparse=[],t.inputShapeGatherIndicesSparse=new Array(t.dims);for(let r=0;r<e.dims;r++)if(1<<r&e.ellipsisMask){const a=Math.min(t.dims-(e.dims-r)+1+e.numAddAxisAfterEllipsis,t.dims);for(;n<a;n++)t.begin[n]=0,t.end[n]=0,t.strides[n]=1,t.beginMask|=1<<n,t.endMask|=1<<n,t.finalShapeGatherIndices.push(n),t.finalShapeGatherIndicesSparse.push(-1),t.inputShapeGatherIndicesSparse[n]=r}else if(1<<r&e.newAxisMask)t.finalShapeGatherIndices.push(-2),t.finalShapeGatherIndicesSparse.push(-1);else{if(n===t.begin.length)throw Error(`Index out of range using input dim ${n}; input has only ${t.dims} dims, ${t.begin.length}.`);null!=e.begin&&(t.begin[n]=e.begin[r]),null!=e.end&&(t.end[n]=e.end[r]),t.strides[n]=e.strides[r],e.beginMask&1<<r&&(t.beginMask|=1<<n),e.endMask&1<<r&&(t.endMask|=1<<n),e.shrinkAxisMask&1<<r?(t.finalShapeGatherIndices.push(-1),t.finalShapeGatherIndicesSparse.push(-1),t.shrinkAxisMask|=1<<n):(t.finalShapeGatherIndices.push(n),t.finalShapeGatherIndicesSparse.push(r)),t.inputShapeGatherIndicesSparse[n]=r,n++}}(d,p);let f=!0,h=!0,m=!0;const b=[],g=[];for(let t=0;t<e.length;++t){if(0===p.strides[t])throw Error(`strides[${t}] must be non-zero`);const n=!!(p.shrinkAxisMask&1<<t),r=e[t];if(-1===r){b.push(n?1:-1);continue}const a=[p.beginMask&1<<t,p.endMask&1<<t],s=[p.strides[t]>0?0:-1,p.strides[t]>0?r:r-1];if(n&&p.strides[t]<=0)throw Error("only stride 1 allowed on non-range indexing.");m=m&&1===p.strides[t];const o=!!(p.beginMask&1<<t&&p.endMask&1<<t);if(p.beginValid&&p.endValid){if(n){const e=p.begin[t]<0?r+p.begin[t]:p.begin[t];if(p.begin[t]=e,p.end[t]=p.begin[t]+1,e<0||e>=r)throw Error(`slice index ${p.begin[t]} of dimension ${t} out of bounds.`)}else p.begin[t]=Me(p.begin[t],0,p.strides[t],r,a,s),p.end[t]=Me(p.end[t],1,p.strides[t],r,a,s);const e=1===p.strides[t]&&0===p.begin[t]&&p.end[t]===r;f=f&&e,h=h&&(0===t&&1===p.strides[t]||e)}else f=f&&1===p.strides[t]&&o,h=h&&(0===t&&1===p.strides[t]||o);let i,u=!1;if(p.beginValid&&p.endValid?(i=p.end[t]-p.begin[t],u=!0):n?(i=1,u=!0):o&&r>=0&&(i=p.strides[t]<0?-r:r,u=!0),u){let e;e=0===i||i<0!=p.strides[t]<0?0:Math.trunc(i/p.strides[t])+(i%p.strides[t]!=0?1:0),b.push(e)}else b.push(-1)}for(let e=0;e<p.finalShapeGatherIndices.length;++e){const t=p.finalShapeGatherIndices[e];t>=0?g.push(b[t]):-2===t&&g.push(1)}return{finalShapeSparse:g.filter(((e,t)=>-2!==p.finalShapeGatherIndices[t])),finalShape:g,isIdentity:f,sliceDim0:h,isSimpleSlice:m,begin:p.begin,end:p.end,strides:p.strides}}function Me(e,t,n,r,a,s){if(a[t])return n>0?s[t]:s[t+1&1];{const t=e<0?r+e:e;return t<s[0]?s[0]:t>s[1]?s[1]:t}}const Ie=new Map,De=new Map;class $e{getClassName(){return this.constructor.className}static fromConfig(e,t){return new e(t)}}class Ce{constructor(){this.classNameMap={}}static getMap(){return null==Ce.instance&&(Ce.instance=new Ce),Ce.instance}static register(e){Ce.getMap().classNameMap[e.className]=[e,e.fromConfig]}}function Re(e,t,n){Object(_.c)(null!=e.className,(()=>"Class being registered does not have the static className property defined.")),Object(_.c)("string"==typeof e.className,(()=>"className is required to be a string, but got type "+typeof e.className)),Object(_.c)(e.className.length>0,(()=>"Class being registered has an empty-string as its className, which is disallowed.")),"undefined"==typeof t&&(t="Custom"),"undefined"==typeof n&&(n=e.className);const r=t+">"+n;return Ce.register(e),Ie.set(r,e),De.set(e,r),e}function Pe(e){return De.has(e)?De.get(e):e.className}var Fe=n(12),Be=n(6);const Le=.1;function ze(e,t,n){return null==n&&(n=We()),Ue(e,t,((e,t)=>He(e,t,n)))}function We(){return 32===G.a.backend.floatPrecision()?.001:Le}function Ue(e,t,n){let r=!0;if((Object(Be.isTypedArray)(e)||Object(Be.isTypedArray)(t))&&(r=!1),Object(Be.isTypedArray)(e)&&Object(Be.isTypedArray)(t)&&(r=!0),r){const n=e.constructor.name,r=t.constructor.name;if(n!==r)throw new Error(`Arrays are of different type. Actual: ${n}. Expected: ${r}`)}if(Array.isArray(e)&&Array.isArray(t)){const n=Object(W.c)(e),r=Object(W.c)(t);if(!Object(_.a)(n,r))throw new Error(`Arrays have different shapes. Actual: [${n}]. Expected: [${r}]`)}const a=Object(Be.isTypedArray)(e)?e:Object(Be.flatten)(e),s=Object(Be.isTypedArray)(t)?t:Object(Be.flatten)(t);if(a.length!==s.length)throw new Error(`Arrays have different lengths actual: ${a.length} vs expected: ${s.length}.\nActual: ${a}.\nExpected: ${s}.`);for(let e=0;e<s.length;++e){const t=a[e],r=s[e];if(!n(t,r))throw new Error(`Arrays differ: actual[${e}] = ${t}, expected[${e}] = ${r}.\nActual: ${a}.\nExpected: ${s}.`)}"undefined"!=typeof expect&&expect().nothing()}function Ve(e,t){e().then((()=>t.fail()),(()=>t())),"undefined"!=typeof expect&&expect().nothing()}function Ge(e,t){const n="string"==typeof t||"number"==typeof t||"boolean"==typeof t?[t]:t;return Object(_.A)(e)||Object(_.A)(e[0])||Object(_.A)(t)||Object(_.A)(t[0])?Ue(e,n,((e,t)=>e==t)):Ue(e,t,((e,t)=>He(e,t,0)))}function qe(e,t,n){if(null==n&&(n=We()),!He(e,t,n))throw new Error(`Numbers differ: actual === ${e}, expected === ${t}`);"undefined"!=typeof expect&&expect().nothing()}function He(e,t,n){return!isFinite(e)&&!isFinite(t)||!(isNaN(e)||isNaN(t)||Math.abs(e-t)>n)}function Ke(e,t,n){for(let r=0;r<e.length;r++)if(e[r]<t||e[r]>n)throw new Error(`Value out of range:${e[r]} low: ${t}, high: ${n}`)}function Ye(e,t){const n=new Float32Array(e),r=new Float32Array(t);if(n.length!==r.length)throw new Error(`Expected ArrayBuffer to be of length ${r.length}, but it was ${n.length}`);for(let e=0;e<r.length;e++)if(n[e]!==r[e])throw new Error(`Expected ArrayBuffer value at ${e} to be ${r[e]} but got ${n[e]} instead`)}function Je(e){for(let t=0;t<e.length;t++){const n=e[t];Array.isArray(n)?Je(n):e[t]=Object(Be.encodeString)(n)}return e}function Xe(e){const t=document.createElement("video");return"playsInline"in t&&(t.playsInline=!0),t.muted=!0,t.loop=!0,t.style.position="fixed",t.style.left="0px",t.style.top="0px",t.preload="auto",t.appendChild(e),new Promise((e=>{t.addEventListener("loadeddata",(n=>e(t))),t.load()}))}async function Ze(e){await e.play(),"requestVideoFrameCallback"in e&&await new Promise((t=>{e.requestVideoFrameCallback(t)}))}const Qe="4.10.0";var et=n(13),tt=n(10);const nt=Object(H.b)({floorDiv_:function(e,t){let n=Object(W.a)(e,"a","floorDiv"),r=Object(W.a)(t,"b","floorDiv");[n,r]=Object(Fe.makeTypesMatch)(n,r);const a={a:n,b:r};return G.a.runKernel(q.lb,a)}});const rt=Object(H.b)({div_:function(e,t){let n=Object(W.a)(e,"a","div"),r=Object(W.a)(t,"b","div");if([n,r]=Object(Fe.makeTypesMatch)(n,r),"int32"===n.dtype&&"int32"===r.dtype)return nt(n,r);const a={a:n,b:r};return G.a.runKernel(q.vc,a,{})}});var at=n(9);const st=Object(H.b)({sqrt_:function(e){const t={x:Object(W.a)(e,"x","sqrt","float32")};return G.a.runKernel(q.ad,t)}});const ot=Object(H.b)({square_:function(e){const t=Object(W.a)(e,"x","square");return G.a.runKernel("Square",{x:t},{})}});const it=Object(H.b)({zerosLike_:function(e){const t={x:Object(W.a)(e,"x","zerosLike")};return G.a.runKernel(q.wd,t)}});var ut=n(23);function ct(e,t){if((Object(Be.isTypedArray)(e)&&"string"!==t||Array.isArray(e))&&"complex64"!==t)throw new Error("Error creating a new Scalar: value must be a primitive (number|boolean|string)");if("string"===t&&Object(Be.isTypedArray)(e)&&!(e instanceof Uint8Array))throw new Error("When making a scalar from encoded string, the value must be `Uint8Array`.");return Object(ee.a)(e,[],[],t)}class lt extends $e{minimize(e,t=!1,n){const{value:r,grads:a}=this.computeGradients(e,n);if(null!=n){const e=n.map((e=>({name:e.name,tensor:a[e.name]})));this.applyGradients(e)}else this.applyGradients(a);return Object(et.d)(a),t?r:(r.dispose(),null)}get iterations(){return null==this.iterations_&&(this.iterations_=0),this.iterations_}incrementIterations(){this.iterations_=this.iterations+1}computeGradients(e,t){return Object(ut.f)(e,t)}dispose(){null!=this.iterations_&&Object(et.d)(this.iterations_)}async saveIterations(){return null==this.iterations_&&(this.iterations_=0),{name:"iter",tensor:ct(this.iterations_,"int32")}}async getWeights(){throw new Error("getWeights() is not implemented for this optimizer yet.")}async setWeights(e){throw new Error(`setWeights() is not implemented for this optimizer class ${this.getClassName()}`)}async extractIterations(e){return this.iterations_=(await e[0].tensor.data())[0],e.slice(1)}}Object.defineProperty(lt,Symbol.hasInstance,{value:e=>null!=e.minimize&&null!=e.computeGradients&&null!=e.applyGradients});class dt extends lt{static get className(){return"Adadelta"}constructor(e,t,n=null){super(),this.learningRate=e,this.rho=t,this.epsilon=n,this.accumulatedGrads=[],this.accumulatedUpdates=[],null==n&&(this.epsilon=G.a.backend.epsilon())}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const r=G.a.registeredVariables[t];null==this.accumulatedGrads[n]&&(this.accumulatedGrads[n]={originalName:`${t}/accum_grad`,variable:Object(et.t)((()=>it(r).variable(false)))}),null==this.accumulatedUpdates[n]&&(this.accumulatedUpdates[n]={originalName:`${t}/accum_var`,variable:Object(et.t)((()=>it(r).variable(false)))});const a=Array.isArray(e)?e[n].tensor:e[t];if(null==a)return;const s=this.accumulatedGrads[n].variable,o=this.accumulatedUpdates[n].variable;Object(et.t)((()=>{const e=Object(tt.add)(Object(at.mul)(s,this.rho),Object(at.mul)(ot(a),1-this.rho)),t=Object(at.mul)(rt(st(Object(tt.add)(o,this.epsilon)),st(Object(tt.add)(s,this.epsilon))),a),n=Object(tt.add)(Object(at.mul)(o,this.rho),Object(at.mul)(ot(t),1-this.rho));s.assign(e),o.assign(n);const i=Object(tt.add)(Object(at.mul)(t,-this.learningRate),r);r.assign(i)}))})),this.incrementIterations()}dispose(){null!=this.accumulatedUpdates&&(Object(et.d)(this.accumulatedGrads.map((e=>e.variable))),Object(et.d)(this.accumulatedUpdates.map((e=>e.variable))))}async getWeights(){const e=[...this.accumulatedGrads,...this.accumulatedUpdates];return[await this.saveIterations()].concat(e.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){const t=(e=await this.extractIterations(e)).length/2;this.accumulatedGrads=e.slice(0,t).map((e=>({originalName:e.name,variable:e.tensor.variable(false)}))),this.accumulatedUpdates=e.slice(t,2*t).map((e=>({originalName:e.name,variable:e.tensor.variable(false)})))}getConfig(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}}static fromConfig(e,t){return new e(t.learningRate,t.rho,t.epsilon)}}function pt(e,t,n){Object(_.d)(e);const r={shape:e,value:t,dtype:n=n||Object(_.s)(t)};return G.a.runKernel(q.ib,{},r)}class ft extends lt{static get className(){return"Adagrad"}constructor(e,t=.1){super(),this.learningRate=e,this.initialAccumulatorValue=t,this.accumulatedGrads=[]}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const r=G.a.registeredVariables[t];if(null==this.accumulatedGrads[n]){const e=!1;this.accumulatedGrads[n]={originalName:`${t}/accumulator`,variable:Object(et.t)((()=>pt(r.shape,this.initialAccumulatorValue).variable(e)))}}const a=Array.isArray(e)?e[n].tensor:e[t];if(null==a)return;const s=this.accumulatedGrads[n].variable;Object(et.t)((()=>{const e=Object(tt.add)(s,ot(a));s.assign(e);const t=Object(tt.add)(Object(at.mul)(rt(a,st(Object(tt.add)(e,G.a.backend.epsilon()))),-this.learningRate),r);r.assign(t)}))})),this.incrementIterations()}dispose(){null!=this.accumulatedGrads&&Object(et.d)(this.accumulatedGrads.map((e=>e.variable)))}async getWeights(){return[await this.saveIterations()].concat(this.accumulatedGrads.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){e=await this.extractIterations(e);this.accumulatedGrads=e.map((e=>({originalName:e.name,variable:e.tensor.variable(false)})))}getConfig(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}}static fromConfig(e,t){return new e(t.learningRate,t.initialAccumulatorValue)}}const ht=Object(H.b)({pow_:function(e,t){let n=Object(W.a)(e,"base","pow"),r=Object(W.a)(t,"exp","pow");[n,r]=Object(Fe.makeTypesMatch)(n,r);const a={a:n,b:r};return G.a.runKernel(q.nc,a)}});const mt=Object(H.b)({sub_:function(e,t){let n=Object(W.a)(e,"a","sub"),r=Object(W.a)(t,"b","sub");[n,r]=Object(Fe.makeTypesMatch)(n,r);const a={a:n,b:r};return G.a.runKernel(q.jd,a)}});class bt extends lt{static get className(){return"Adam"}constructor(e,t,n,r=null){super(),this.learningRate=e,this.beta1=t,this.beta2=n,this.epsilon=r,this.accumulatedFirstMoment=[],this.accumulatedSecondMoment=[],Object(et.t)((()=>{this.accBeta1=ct(t).variable(),this.accBeta2=ct(n).variable()})),null==r&&(this.epsilon=G.a.backend.epsilon())}applyGradients(e){const t=Array.isArray(e)?e.map((e=>e.name)):Object.keys(e);Object(et.t)((()=>{const n=mt(1,this.accBeta1),r=mt(1,this.accBeta2);t.forEach(((t,a)=>{const s=G.a.registeredVariables[t];null==this.accumulatedFirstMoment[a]&&(this.accumulatedFirstMoment[a]={originalName:`${t}/m`,variable:Object(et.t)((()=>it(s).variable(false)))}),null==this.accumulatedSecondMoment[a]&&(this.accumulatedSecondMoment[a]={originalName:`${t}/v`,variable:Object(et.t)((()=>it(s).variable(false)))});const o=Array.isArray(e)?e[a].tensor:e[t];if(null==o)return;const i=this.accumulatedFirstMoment[a].variable,u=this.accumulatedSecondMoment[a].variable,c=Object(tt.add)(Object(at.mul)(i,this.beta1),Object(at.mul)(o,1-this.beta1)),l=Object(tt.add)(Object(at.mul)(u,this.beta2),Object(at.mul)(ot(o),1-this.beta2)),d=rt(c,n),p=rt(l,r);i.assign(c),u.assign(l);const f=Object(tt.add)(Object(at.mul)(rt(d,Object(tt.add)(st(p),this.epsilon)),-this.learningRate),s);s.assign(f)})),this.accBeta1.assign(Object(at.mul)(this.accBeta1,this.beta1)),this.accBeta2.assign(Object(at.mul)(this.accBeta2,this.beta2))})),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.accBeta2.dispose(),null!=this.accumulatedFirstMoment&&Object(et.d)(this.accumulatedFirstMoment.map((e=>e.variable))),null!=this.accumulatedSecondMoment&&Object(et.d)(this.accumulatedSecondMoment.map((e=>e.variable)))}async getWeights(){const e=[...this.accumulatedFirstMoment,...this.accumulatedSecondMoment];return[await this.saveIterations()].concat(e.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){e=await this.extractIterations(e),Object(et.t)((()=>{this.accBeta1.assign(ht(this.beta1,this.iterations_+1)),this.accBeta2.assign(ht(this.beta2,this.iterations_+1))}));const t=e.length/2;this.accumulatedFirstMoment=e.slice(0,t).map((e=>({originalName:e.name,variable:e.tensor.variable(false)}))),this.accumulatedSecondMoment=e.slice(t,2*t).map((e=>({originalName:e.name,variable:e.tensor.variable(false)})))}getConfig(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon}}static fromConfig(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon)}}const gt=Object(H.b)({abs_:function(e){const t=Object(W.a)(e,"x","abs");if("complex64"===t.dtype){const e={x:t};return G.a.runKernel(q.C,e)}{const e={x:t};return G.a.runKernel(q.a,e)}}});var yt=n(65);class wt extends lt{static get className(){return"Adamax"}constructor(e,t,n,r=null,a=0){super(),this.learningRate=e,this.beta1=t,this.beta2=n,this.epsilon=r,this.decay=a,this.accumulatedFirstMoment=[],this.accumulatedWeightedInfNorm=[],Object(et.t)((()=>{this.iteration=ct(0).variable(),this.accBeta1=ct(t).variable()})),null==r&&(this.epsilon=G.a.backend.epsilon())}applyGradients(e){const t=Array.isArray(e)?e.map((e=>e.name)):Object.keys(e);Object(et.t)((()=>{const n=mt(1,this.accBeta1),r=rt(-this.learningRate,Object(tt.add)(Object(at.mul)(this.iteration,this.decay),1));t.forEach(((t,a)=>{const s=G.a.registeredVariables[t];null==this.accumulatedFirstMoment[a]&&(this.accumulatedFirstMoment[a]={originalName:`${t}/m`,variable:it(s).variable(false)}),null==this.accumulatedWeightedInfNorm[a]&&(this.accumulatedWeightedInfNorm[a]={originalName:`${t}/v`,variable:it(s).variable(false)});const o=Array.isArray(e)?e[a].tensor:e[t];if(null==o)return;const i=this.accumulatedFirstMoment[a].variable,u=this.accumulatedWeightedInfNorm[a].variable,c=Object(tt.add)(Object(at.mul)(i,this.beta1),Object(at.mul)(o,1-this.beta1)),l=Object(at.mul)(u,this.beta2),d=gt(o),p=Object(yt.maximum)(l,d);i.assign(c),u.assign(p);const f=Object(tt.add)(Object(at.mul)(rt(r,n),rt(c,Object(tt.add)(p,this.epsilon))),s);s.assign(f)})),this.iteration.assign(Object(tt.add)(this.iteration,1)),this.accBeta1.assign(Object(at.mul)(this.accBeta1,this.beta1))})),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.iteration.dispose(),null!=this.accumulatedFirstMoment&&Object(et.d)(this.accumulatedFirstMoment.map((e=>e.variable))),null!=this.accumulatedWeightedInfNorm&&Object(et.d)(this.accumulatedWeightedInfNorm.map((e=>e.variable)))}async getWeights(){throw new Error("getWeights() is not implemented for Adamax yet.")}async setWeights(e){throw new Error("setWeights() is not implemented for Adamax yet.")}getConfig(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon,decay:this.decay}}static fromConfig(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon,t.decay)}}class Ot extends lt{static get className(){return"SGD"}constructor(e){super(),this.learningRate=e,this.setLearningRate(e)}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const r=Array.isArray(e)?e[n].tensor:e[t];if(null==r)return;const a=G.a.registeredVariables[t];Object(et.t)((()=>{const e=Object(tt.add)(Object(at.mul)(this.c,r),a);a.assign(e)}))})),this.incrementIterations()}setLearningRate(e){this.learningRate=e,null!=this.c&&this.c.dispose(),this.c=Object(et.l)(ct(-e))}dispose(){this.c.dispose()}async getWeights(){return[await this.saveIterations()]}async setWeights(e){if(0!==(e=await this.extractIterations(e)).length)throw new Error("SGD optimizer does not have settable weights.")}getConfig(){return{learningRate:this.learningRate}}static fromConfig(e,t){return new e(t.learningRate)}}class vt extends Ot{static get className(){return"Momentum"}constructor(e,t,n=!1){super(e),this.learningRate=e,this.momentum=t,this.useNesterov=n,this.accumulations=[],this.m=ct(this.momentum)}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const r=G.a.registeredVariables[t];if(null==this.accumulations[n]){const e=!1;this.accumulations[n]={originalName:`${t}/momentum`,variable:Object(et.t)((()=>it(r).variable(e)))}}const a=this.accumulations[n].variable,s=Array.isArray(e)?e[n].tensor:e[t];null!=s&&Object(et.t)((()=>{let e;const t=Object(tt.add)(Object(at.mul)(this.m,a),s);e=this.useNesterov?Object(tt.add)(Object(at.mul)(this.c,Object(tt.add)(s,Object(at.mul)(t,this.m))),r):Object(tt.add)(Object(at.mul)(this.c,t),r),a.assign(t),r.assign(e)}))})),this.incrementIterations()}dispose(){this.m.dispose(),null!=this.accumulations&&Object(et.d)(this.accumulations.map((e=>e.variable)))}setMomentum(e){this.momentum=e}async getWeights(){return[await this.saveIterations()].concat(this.accumulations.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){e=await this.extractIterations(e);this.accumulations=e.map((e=>({originalName:e.name,variable:e.tensor.variable(false)})))}getConfig(){return{learningRate:this.learningRate,momentum:this.momentum,useNesterov:this.useNesterov}}static fromConfig(e,t){return new e(t.learningRate,t.momentum,t.useNesterov)}}class jt extends lt{static get className(){return"RMSProp"}constructor(e,t=.9,n=0,r=null,a=!1){if(super(),this.learningRate=e,this.decay=t,this.momentum=n,this.epsilon=r,this.accumulatedMeanSquares=[],this.accumulatedMoments=[],this.accumulatedMeanGrads=[],this.centered=a,null==r&&(this.epsilon=G.a.backend.epsilon()),null==e)throw new Error("learningRate for RMSPropOptimizer must be defined.")}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const r=G.a.registeredVariables[t],a=!1;null==this.accumulatedMeanSquares[n]&&(this.accumulatedMeanSquares[n]={originalName:`${t}/rms`,variable:Object(et.t)((()=>it(r).variable(a)))}),null==this.accumulatedMoments[n]&&(this.accumulatedMoments[n]={originalName:`${t}/momentum`,variable:Object(et.t)((()=>it(r).variable(a)))}),null==this.accumulatedMeanGrads[n]&&this.centered&&(this.accumulatedMeanGrads[n]={originalName:`${t}/mg`,variable:Object(et.t)((()=>it(r).variable(a)))});const s=Array.isArray(e)?e[n].tensor:e[t];if(null==s)return;const o=this.accumulatedMeanSquares[n].variable,i=this.accumulatedMoments[n].variable;Object(et.t)((()=>{const e=Object(tt.add)(Object(at.mul)(o,this.decay),Object(at.mul)(ot(s),1-this.decay));if(this.centered){const t=this.accumulatedMeanGrads[n].variable,a=Object(tt.add)(Object(at.mul)(t,this.decay),Object(at.mul)(s,1-this.decay)),u=rt(Object(at.mul)(s,this.learningRate),st(mt(e,Object(tt.add)(ot(a),this.epsilon)))),c=Object(tt.add)(Object(at.mul)(i,this.momentum),u);o.assign(e),t.assign(a),i.assign(c);const l=mt(r,c);r.assign(l)}else{const e=Object(tt.add)(Object(at.mul)(o,this.decay),Object(at.mul)(ot(s),1-this.decay)),t=Object(tt.add)(Object(at.mul)(i,this.momentum),rt(Object(at.mul)(s,this.learningRate),st(Object(tt.add)(e,this.epsilon))));o.assign(e),i.assign(t);const n=mt(r,t);r.assign(n)}}))})),this.incrementIterations()}dispose(){null!=this.accumulatedMeanSquares&&Object(et.d)(this.accumulatedMeanSquares.map((e=>e.variable))),null!=this.accumulatedMeanGrads&&this.centered&&Object(et.d)(this.accumulatedMeanGrads.map((e=>e.variable))),null!=this.accumulatedMoments&&Object(et.d)(this.accumulatedMoments.map((e=>e.variable)))}async getWeights(){const e=[...this.accumulatedMeanSquares,...this.accumulatedMoments];return this.centered&&e.push(...this.accumulatedMeanGrads),[await this.saveIterations()].concat(e.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){e=await this.extractIterations(e);const t=this.centered?e.length/3:e.length/2,n=!1;this.accumulatedMeanSquares=e.slice(0,t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)}))),this.accumulatedMoments=e.slice(t,2*t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)}))),this.centered&&(this.accumulatedMeanGrads=e.slice(2*t,3*t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)}))))}getConfig(){return{learningRate:this.learningRate,decay:this.decay,momentum:this.momentum,epsilon:this.epsilon,centered:this.centered}}static fromConfig(e,t){return new e(t.learningRate,t.decay,t.momentum,t.epsilon,t.centered)}}class _t{static sgd(e){return new Ot(e)}static momentum(e,t,n=!1){return new vt(e,t,n)}static rmsprop(e,t=.9,n=0,r=null,a=!1){return new jt(e,t,n,r,a)}static adam(e=.001,t=.9,n=.999,r=null){return new bt(e,t,n,r)}static adadelta(e=.001,t=.95,n=null){return new dt(e,t,n)}static adamax(e=.002,t=.9,n=.999,r=null,a=0){return new wt(e,t,n,r,a)}static adagrad(e,t=.1){return new ft(e,t)}}var xt=n(32);const St=Object(H.b)({acos_:function(e){const t={x:Object(W.a)(e,"x","acos")};return G.a.runKernel(q.b,t)}});const kt=Object(H.b)({acosh_:function(e){const t={x:Object(W.a)(e,"x","acosh")};return G.a.runKernel(q.c,t)}});const Et=Object(H.b)({addN_:function(e){_.c(Array.isArray(e),(()=>"The argument passed to tf.addN() must be a list of tensors")),_.c(e.length>=1,(()=>`Must pass at least one tensor to tf.addN(), but got ${e.length}`));const t=e.map(((e,t)=>Object(W.a)(e,`tensors${t}`,"addN"))),n=t[0];t.forEach((e=>{if(e.dtype!==n.dtype)throw new Error("All tensors passed to tf.addN() must have the same dtype")})),t.forEach((e=>{if(!_.a(e.shape,n.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")}));const r=t;return G.a.runKernel(q.e,r)}});const Tt=Object(H.b)({all_:function(e,t=null,n=!1){const r={x:Object(W.a)(e,"x","all","bool")},a={axis:t,keepDims:n};return G.a.runKernel(q.f,r,a)}});const Nt=Object(H.b)({any_:function(e,t=null,n=!1){const r={x:Object(W.a)(e,"x","any","bool")},a={axis:t,keepDims:n};return G.a.runKernel(q.g,r,a)}});const At=Object(H.b)({argMax_:function(e,t=0){const n={x:Object(W.a)(e,"x","argMax")},r={axis:t};return G.a.runKernel(q.h,n,r)}});const Mt=Object(H.b)({argMin_:function(e,t=0){const n={x:Object(W.a)(e,"x","argMin")},r={axis:t};return G.a.runKernel(q.i,n,r)}});const It=Object(H.b)({asin_:function(e){const t={x:Object(W.a)(e,"x","asin")};return G.a.runKernel(q.j,t)}});const Dt=Object(H.b)({asinh_:function(e){const t={x:Object(W.a)(e,"x","asinh")};return G.a.runKernel(q.k,t)}});const $t=Object(H.b)({atan_:function(e){const t={x:Object(W.a)(e,"x","atan")};return G.a.runKernel(q.l,t)}});const Ct=Object(H.b)({atan2_:function(e,t){let n=Object(W.a)(e,"a","atan2"),r=Object(W.a)(t,"b","atan2");[n,r]=Object(Fe.makeTypesMatch)(n,r);const a={a:n,b:r};return G.a.runKernel(q.m,a)}});const Rt=Object(H.b)({atanh_:function(e){const t={x:Object(W.a)(e,"x","atanh")};return G.a.runKernel(q.n,t)}});var Pt=n(66),Ft=n(14),Bt=n(7);const Lt=Object(H.b)({avgPool3d_:function(e,t,n,r,a,s="NDHWC"){const o=Object(W.a)(e,"x","avgPool3d","float32");let i=o,u=!1;4===o.rank&&(u=!0,i=Object(Bt.reshape)(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]])),_.c(5===i.rank,(()=>`Error in avgPool3d: x must be rank 5 but got rank ${i.rank}.`)),_.c("NDHWC"===s,(()=>`Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of ${s}`)),_.c("number"==typeof n&&n>0||Array.isArray(n)&&n[0]>0&&n[1]>0&&n[2]>0,(()=>`Error in avgPool3d: Stride must be > 0, but got '${n}'`)),Object(Ft.a)("avgPool3d",r,a);const c={x:i},l={filterSize:t,strides:n,pad:r,dimRoundingMode:a,dataFormat:s};let d=G.a.runKernel(q.p,c,l);return d=Object(U.a)(d,i.dtype),u?Object(Bt.reshape)(d,[d.shape[1],d.shape[2],d.shape[3],d.shape[4]]):d}});var zt=n(22),Wt=n(40);const Ut=Object(H.b)({slice_:function(e,t,n){const r=Object(W.a)(e,"x","slice","string_or_numeric");if(0===r.rank)throw new Error("Slicing scalar is not possible");const a={x:r},s={begin:t,size:n};return G.a.runKernel(q.Qc,a,s)}});const Vt=Object(H.b)({tanh_:function(e){const t={x:Object(W.a)(e,"x","tanh","float32")};return G.a.runKernel(q.md,t)}});const Gt=Object(H.b)({basicLSTMCell_:function(e,t,n,r,a,s){const o=Object(W.a)(e,"forgetBias","basicLSTMCell"),i=Object(W.a)(t,"lstmKernel","basicLSTMCell"),u=Object(W.a)(n,"lstmBias","basicLSTMCell"),c=Object(W.a)(r,"data","basicLSTMCell"),l=Object(W.a)(a,"c","basicLSTMCell"),d=Object(W.a)(s,"h","basicLSTMCell"),p=Object(zt.concat)([c,d],1),f=Object(V.a)(p,i),h=Object(tt.add)(f,u),m=h.shape[0],b=h.shape[1]/4,g=[m,b],y=Ut(h,[0,0],g),w=Ut(h,[0,b],g),O=Ut(h,[0,2*b],g),v=Ut(h,[0,3*b],g),j=Object(tt.add)(Object(at.mul)(Object(Wt.sigmoid)(y),Vt(w)),Object(at.mul)(l,Object(Wt.sigmoid)(Object(tt.add)(o,O))));return[j,Object(at.mul)(Vt(j),Object(Wt.sigmoid)(v))]}});const qt=Object(H.b)({batchToSpaceND_:function(e,t,n){const r=Object(W.a)(e,"x","batchToSpaceND"),a=t.reduce(((e,t)=>e*t));_.c(r.rank>=1+t.length,(()=>`input rank is ${r.rank} but should be > than blockShape.length ${t.length}`)),_.c(n.length===t.length,(()=>`crops.length is ${n.length} but should be equal to blockShape.length ${t.length}`)),_.c(r.shape[0]%a==0,(()=>`input tensor batch is ${r.shape[0]} but is not divisible by the product of the elements of blockShape ${t.join(" * ")} === ${a}`));const s={x:r},o={blockShape:t,crops:n};return G.a.runKernel(q.t,s,o)}});const Ht=Object(H.b)({batchNorm_:function(e,t,n,r,a,s){null==s&&(s=.001);const o=Object(W.a)(e,"x","batchNorm"),i=Object(W.a)(t,"mean","batchNorm"),u=Object(W.a)(n,"variance","batchNorm");let c,l;null!=a&&(c=Object(W.a)(a,"scale","batchNorm")),null!=r&&(l=Object(W.a)(r,"offset","batchNorm")),_.c(i.rank===u.rank,(()=>"Batch normalization gradient requires mean and variance to have equal ranks.")),_.c(null==l||i.rank===l.rank,(()=>"Batch normalization gradient requires mean and offset to have equal ranks.")),_.c(null==c||i.rank===c.rank,(()=>"Batch normalization gradient requires mean and scale to have equal ranks."));const d=function(e){let t;return t=0===e.rank||1===e.rank?Object(Bt.reshape)(e,[1,1,1,e.size]):2===e.rank?Object(Bt.reshape)(e,[1,1,e.shape[0],e.shape[1]]):3===e.rank?Object(Bt.reshape)(e,[1,e.shape[0],e.shape[1],e.shape[2]]):e,t}(o),p={x:d,scale:c,offset:l,mean:i,variance:u},f={varianceEpsilon:s},h=G.a.runKernel(q.nb,p,f);return Object(Bt.reshape)(h,o.shape)}});const Kt=Object(H.b)({batchNorm2d_:function(e,t,n,r,a,s){const o=Object(W.a)(e,"x","batchNorm"),i=Object(W.a)(t,"mean","batchNorm"),u=Object(W.a)(n,"variance","batchNorm");let c,l;return null!=a&&(c=Object(W.a)(a,"scale","batchNorm")),null!=r&&(l=Object(W.a)(r,"offset","batchNorm")),_.c(2===o.rank,(()=>`Error in batchNorm2D: x must be rank 2 but got rank ${o.rank}.`)),_.c(2===i.rank||1===i.rank,(()=>`Error in batchNorm2D: mean must be rank 2 or rank 1 but got rank ${i.rank}.`)),_.c(2===u.rank||1===u.rank,(()=>`Error in batchNorm2D: variance must be rank 2 or rank 1 but got rank ${u.rank}.`)),null!=c&&_.c(2===c.rank||1===c.rank,(()=>`Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank ${c.rank}.`)),null!=l&&_.c(2===l.rank||1===l.rank,(()=>`Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank ${l.rank}.`)),Ht(o,i,u,l,c,s)}});const Yt=Object(H.b)({batchNorm3d_:function(e,t,n,r,a,s){const o=Object(W.a)(e,"x","batchNorm"),i=Object(W.a)(t,"mean","batchNorm"),u=Object(W.a)(n,"variance","batchNorm");let c,l;return null!=a&&(c=Object(W.a)(a,"scale","batchNorm")),null!=r&&(l=Object(W.a)(r,"offset","batchNorm")),_.c(3===o.rank,(()=>`Error in batchNorm3D: x must be rank 3 but got rank ${o.rank}.`)),_.c(3===i.rank||1===i.rank,(()=>`Error in batchNorm3D: mean must be rank 3 or rank 1 but got rank ${i.rank}.`)),_.c(3===u.rank||1===u.rank,(()=>`Error in batchNorm3D: variance must be rank 3 or rank 1 but got rank ${u.rank}.`)),null!=c&&_.c(3===c.rank||1===c.rank,(()=>`Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank ${c.rank}.`)),null!=l&&_.c(3===l.rank||1===l.rank,(()=>`Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank ${l.rank}.`)),Ht(o,i,u,l,c,s)}});const Jt=Object(H.b)({batchNorm4d_:function(e,t,n,r,a,s){const o=Object(W.a)(e,"x","batchNorm"),i=Object(W.a)(t,"mean","batchNorm"),u=Object(W.a)(n,"variance","batchNorm");let c,l;return null!=a&&(c=Object(W.a)(a,"scale","batchNorm")),null!=r&&(l=Object(W.a)(r,"offset","batchNorm")),_.c(4===o.rank,(()=>`Error in batchNorm4D: x must be rank 4 but got rank ${o.rank}.`)),_.c(4===i.rank||1===i.rank,(()=>`Error in batchNorm4D: mean must be rank 4 or rank 1 but got rank ${i.rank}.`)),_.c(4===u.rank||1===u.rank,(()=>`Error in batchNorm4D: variance must be rank 4 or rank 1 but got rank ${u.rank}.`)),null!=c&&_.c(4===c.rank||1===c.rank,(()=>`Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank ${c.rank}.`)),null!=l&&_.c(4===l.rank||1===l.rank,(()=>`Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank ${l.rank}.`)),Ht(o,i,u,l,c,s)}});const Xt=Object(H.b)({bincount_:function(e,t,n){const r=Object(W.a)(e,"x","bincount"),a=Object(W.a)(t,"weights","bincount");_.c("int32"===r.dtype,(()=>`Error in bincount: input dtype must be int32, but got ${r.dtype}`)),_.c(n>=0,(()=>`size must be non-negative, but got ${n}.`)),_.c(a.size===r.size||0===a.size,(()=>`Error in bincount: weights must have the same size as input or0-length, but got input shape: ${r.shape}, weights shape: ${a.shape}.`));const s={x:r,weights:a},o={size:n};return G.a.runKernel(q.u,s,o)}});const Zt=Object(H.b)({bitwiseAnd_:function(e,t){const n=Object(W.a)(e,"x","bitwiseAnd"),r=Object(W.a)(t,"y","bitwiseAnd");if(!Object(_.a)(n.shape,r.shape))throw new Error(`BitwiseAnd: Tensors must have the same shape. x: ${n.shape}, y: ${r.shape}`);if("int32"!==n.dtype||"int32"!==r.dtype)throw new Error(`BitwiseAnd: Only supports 'int32' values in tensor, found type of x: ${n.dtype} and type of y: ${r.dtype}`);const a={a:n,b:r};return G.a.runKernel(q.v,a)}});const Qt=Object(H.b)({broadcastArgs_:function(e,t){const n=Object(W.a)(e,"s0","broadcastArgs","int32"),r=Object(W.a)(t,"s1","broadcastArgs","int32");if(1!==n.rank)throw new Error(`broadcastArgs(): first input must be a vector (rank=1). Has rank ${n.rank}`);if(1!==r.rank)throw new Error(`broadcastArgs(): second input must be a vector (rank=1). Has rank ${r.rank}`);const a={s0:n,s1:r};return G.a.runKernel(q.w,a)}});var en=n(36);const tn=Object(H.b)({broadcastTo_:function(e,t){let n=Object(W.a)(e,"broadcastTo","x");const r=n.shape;if(Object(_.d)(t),t.length<n.rank)throw new Error(`broadcastTo(): shape.length=${t.length} < input.rank=${n.rank}.`);if(t.length>n.rank){const e=n.shape.slice();for(;e.length<t.length;)e.unshift(1);n=Object(Bt.reshape)(n,e)}const a=n.shape,s=Array.from(t);for(let e=t.length-1;e>=0;e--)if(a[e]===t[e])s[e]=1;else if(1!==n.shape[e])throw new Error(`broadcastTo(): [${r}] cannot be broadcast to [${t}].`);if(0===s.map(((e,t)=>e>1?t:-1)).filter((e=>e>=0)).length)return Object(en.a)(n);const o={x:n},i={reps:s};return G.a.runKernel(q.od,o,i)}});var nn=n(28);const rn=Object(H.b)({ceil_:function(e){const t={x:Object(W.a)(e,"x","ceil","float32")};return G.a.runKernel(q.z,t)}});const an=Object(H.b)({clipByValue_:function(e,t,n){const r=Object(W.a)(e,"x","clipByValue");if(_.c(t<=n,(()=>`Error in clip: min (${t}) must be less than or equal to max (${n}).`)),t===n)return pt(r.shape,t,r.dtype);const a={x:r},s={clipValueMin:t,clipValueMax:n};return G.a.runKernel(q.A,a,s)}});var sn=n(31);const on=Object(H.b)({concat1d_:function(e){return Object(zt.concat)(e,0)}});const un=Object(H.b)({concat2d_:function(e,t){return Object(zt.concat)(e,t)}});const cn=Object(H.b)({concat3d_:function(e,t){return Object(zt.concat)(e,t)}});const ln=Object(H.b)({concat4d_:function(e,t){return Object(zt.concat)(e,t)}});var dn=n(49);const pn=Object(H.b)({conv1d_:function(e,t,n,r,a="NWC",s=1,o){const i=Object(W.a)(e,"x","conv1d"),u=Object(W.a)(t,"filter","conv1d");let c=i,l=!1;2===i.rank&&(l=!0,c=Object(Bt.reshape)(i,[1,i.shape[0],i.shape[1]])),_.c(3===c.rank,(()=>`Error in conv1d: input must be rank 3, but got rank ${c.rank}.`)),_.c(3===u.rank,(()=>`Error in conv1d: filter must be rank 3, but got rank ${u.rank}.`)),Ft.a("conv1d",r,o),_.c(c.shape[2]===u.shape[1],(()=>`Error in conv1d: depth of input (${c.shape[2]}) must match input depth for filter ${u.shape[1]}.`)),_.c(Ft.i(n,s),(()=>`Error in conv1D: Either stride or dilation must be 1. Got stride ${n} and dilation '${s}'`)),_.c(Ft.j(s),(()=>"Error in conv1D: Dilated rates should be larger than 0.")),_.c(Ft.j(n),(()=>"Error in conv1D: Stride should be larger than 0.")),_.c("NWC"===a,(()=>`Error in conv1d: got dataFormat of ${a} but only NWC is currently supported.`));const d=Object(Bt.reshape)(u,[1,u.shape[0],u.shape[1],u.shape[2]]),p=Object(Bt.reshape)(c,[c.shape[0],1,c.shape[1],c.shape[2]]),f=[1,n],h=[1,s],m=Object(dn.a)(p,d,f,r,"NHWC",h,o);return l?Object(Bt.reshape)(m,[m.shape[2],m.shape[3]]):Object(Bt.reshape)(m,[m.shape[0],m.shape[2],m.shape[3]])}});var fn=n(80);const hn=Object(H.b)({conv2dTranspose_:function(e,t,n,r,a,s){const o=Object(W.a)(e,"x","conv2dTranspose"),i=Object(W.a)(t,"filter","conv2dTranspose");return Object(fn.a)(n,o,i,r,a,"NHWC",s)}});const mn=Object(H.b)({conv3d_:function(e,t,n,r,a="NDHWC",s=[1,1,1]){const o=Object(W.a)(e,"x","conv3d"),i=Object(W.a)(t,"filter","conv3d");let u=o,c=!1;4===o.rank&&(c=!0,u=Object(Bt.reshape)(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]])),_.c(5===u.rank,(()=>`Error in conv3d: input must be rank 5, but got rank ${u.rank}.`)),_.c(5===i.rank,(()=>`Error in conv3d: filter must be rank 5, but got rank ${i.rank}.`)),_.c(u.shape[4]===i.shape[3],(()=>`Error in conv3d: depth of input (${u.shape[4]}) must match input depth for filter ${i.shape[3]}.`)),_.c(Object(Ft.i)(n,s),(()=>`Error in conv3D: Either strides or dilations must be 1. Got strides ${n} and dilations '${s}'`)),_.c("NDHWC"===a,(()=>`Error in conv3d: got dataFormat of ${a} but only NDHWC is currently supported.`)),_.c(Object(Ft.j)(s),(()=>"Error in conv3D: Dilated rates should be larger than 0.")),_.c(Object(Ft.j)(n),(()=>"Error in conv3D: Strides should be larger than 0."));const l={x:u,filter:i},d={strides:n,pad:r,dataFormat:a,dilations:s},p=G.a.runKernel(q.H,l,d);return c?Object(Bt.reshape)(p,[p.shape[1],p.shape[2],p.shape[3],p.shape[4]]):p}});const bn=Object(H.b)({conv3DBackpropInput_:function(e,t,n,r,a){_.c(e.length===t.rank,(()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`));let s=e,o=t,i=!1;4===t.rank&&(i=!0,o=Object(Bt.reshape)(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]]),s=[1,e[0],e[1],e[2],e[3]]);const u=s[4],c=o.shape[4];_.c(5===s.length,(()=>`Error in conv3dDerInput: inShape must be length 5, but got length ${s.length}.`)),_.c(5===o.rank,(()=>`Error in conv3dDerInput: dy must be rank 5, but got rank ${o.rank}`)),_.c(5===n.rank,(()=>`Error in conv3dDerInput: filter must be rank 5, but got rank ${n.rank}`)),_.c(u===n.shape[3],(()=>`Error in conv3dDerInput: depth of input (${u}) must match input depth for filter ${n.shape[3]}.`)),_.c(c===n.shape[4],(()=>`Error in conv3dDerInput: depth of output (${c}) must match output depth for filter ${n.shape[4]}.`));const l={dy:o,filter:n},d={pad:a,strides:r,inputShape:s},p=G.a.runKernel(q.J,l,d);return i?Object(Bt.reshape)(p,[p.shape[1],p.shape[2],p.shape[3],p.shape[4]]):p}});const gn=Object(H.b)({conv3dTranspose_:function(e,t,n,r,a){const s=Object(W.a)(e,"x","conv3dTranspose"),o=Object(W.a)(t,"filter","conv3dTranspose");return bn(n,s,o,r,a)}});const yn=Object(H.b)({cos_:function(e){const t={x:Object(W.a)(e,"x","cos","float32")};return G.a.runKernel(q.K,t)}});const wn=Object(H.b)({cosh_:function(e){const t={x:Object(W.a)(e,"x","cosh","float32")};return G.a.runKernel(q.L,t)}});const On=Object(H.b)({cumprod_:function(e,t=0,n=!1,r=!1){const a={x:Object(W.a)(e,"x","cumprod")},s={axis:t,exclusive:n,reverse:r};return G.a.runKernel(q.N,a,s)}});const vn=Object(H.b)({cumsum_:function(e,t=0,n=!1,r=!1){const a={x:Object(W.a)(e,"x","cumsum")},s={axis:t,exclusive:n,reverse:r};return G.a.runKernel(q.O,a,s)}});const jn=Object(H.b)({denseBincount_:function(e,t,n,r=!1){const a=Object(W.a)(e,"x","denseBincount"),s=Object(W.a)(t,"weights","denseBincount");_.c("int32"===a.dtype,(()=>`Error in denseBincount: input dtype must be int32, but got ${a.dtype}`)),_.c(a.rank<=2,(()=>`Error in denseBincount: input must be at most rank 2, but got rank ${a.rank}.`)),_.c(n>=0,(()=>`size must be non-negative, but got ${n}.`)),_.c(s.size===a.size||0===s.size,(()=>`Error in denseBincount: weights must have the same shape as x or 0-length, but got x shape: ${a.shape}, weights shape: ${s.shape}.`));const o={x:a,weights:s},i={size:n,binaryOutput:r};return G.a.runKernel(q.P,o,i)}});const _n=Object(H.b)({depthToSpace_:function(e,t,n="NHWC"){const r=Object(W.a)(e,"x","depthToSpace","float32"),a="NHWC"===n?r.shape[1]:r.shape[2],s="NHWC"===n?r.shape[2]:r.shape[3],o="NHWC"===n?r.shape[3]:r.shape[1];_.c(t>1,(()=>`blockSize should be > 1 for depthToSpace, but was: ${t}`)),_.c(a*t>=0,(()=>`Negative dimension size caused by overflow when multiplying\n ${a} and ${t} for depthToSpace with input shape\n ${r.shape}`)),_.c(s*t>=0,(()=>`Negative dimension size caused by overflow when multiplying\n ${s} and ${t} for depthToSpace with input shape\n ${r.shape}`)),_.c(o%(t*t)==0,(()=>`Dimension size must be evenly divisible by ${t*t} but is ${o} for depthToSpace with input shape ${r.shape}`));const i={x:r},u={blockSize:t,dataFormat:n};return G.a.runKernel(q.Q,i,u)}});var xn=n(61);const Sn=Object(H.b)({diag_:function(e){const t={x:Object(W.a)(e,"x","diag")};return G.a.runKernel(q.U,t)}});const kn=Object(H.b)({dilation2d_:function(e,t,n,r,a=[1,1],s="NHWC"){const o=Object(W.a)(e,"x","dilation2d"),i=Object(W.a)(t,"filter","dilation2d");_.c(3===o.rank||4===o.rank,(()=>`Error in dilation2d: input must be rank 3 or 4, but got rank ${o.rank}.`)),_.c(3===i.rank,(()=>`Error in dilation2d: filter must be rank 3, but got rank ${i.rank}.`)),_.c("NHWC"===s,(()=>`Error in dilation2d: Only NHWC is currently supported, but got dataFormat of ${s}`));let u=o,c=!1;3===o.rank&&(u=Object(Bt.reshape)(o,[1,o.shape[0],o.shape[1],o.shape[2]]),c=!0),_.c(u.shape[3]===i.shape[2],(()=>`Error in dilation2d: input and filter must have the same depth: ${u.shape[3]} vs ${i.shape[2]}`));const l={x:u,filter:i},d={strides:n,pad:r,dilations:a},p=G.a.runKernel(q.V,l,d);return c?Object(Bt.reshape)(p,[p.shape[1],p.shape[2],p.shape[3]]):p}});const En=Object(H.b)({equal_:function(e,t){let n=Object(W.a)(e,"a","equal","string_or_numeric"),r=Object(W.a)(t,"b","equal","string_or_numeric");[n,r]=Object(Fe.makeTypesMatch)(n,r),Object(X.assertAndGetBroadcastShape)(n.shape,r.shape);const a={a:n,b:r};return G.a.runKernel(q.cb,a)}});const Tn=Object(H.b)({where_:function(e,t,n){const r=Object(W.a)(t,"a","where"),a=Object(W.a)(n,"b","where"),s=Object(W.a)(e,"condition","where","bool"),o=Object(X.assertAndGetBroadcastShape)(Object(X.assertAndGetBroadcastShape)(s.shape,r.shape),a.shape),i={condition:tn(s,o),t:tn(r,o),e:tn(a,o)};return G.a.runKernel(q.Kc,i)}});const Nn=Object(H.b)({divNoNan_:function(e,t){let n=Object(W.a)(e,"a","div"),r=Object(W.a)(t,"b","div");[n,r]=Object(Fe.makeTypesMatch)(n,r);const a=rt(n,r),s=it(a),o=En(r,s);return Tn(o,s,a)}});const An=Object(H.b)({dot_:function(e,t){const n=Object(W.a)(e,"t1","dot"),r=Object(W.a)(t,"t2","dot");_.c(!(1!==n.rank&&2!==n.rank||1!==r.rank&&2!==r.rank),(()=>`Error in dot: inputs must all be rank 1 or 2, but got ranks ${n.rank} and ${r.rank}.`));const a=1===n.rank?n.size:n.shape[1],s=1===r.rank?r.size:r.shape[0];if(_.c(a===s,(()=>`Error in dot: inner dimensions of inputs must match, but got ${a} and ${s}.`)),1===n.rank&&1===r.rank){const e=Object(Bt.reshape)(n,[1,-1]),t=Object(Bt.reshape)(r,[-1,1]),a=Object(V.a)(e,t);return Object(Bt.reshape)(a,[])}if(1===n.rank&&2===r.rank){const e=Object(Bt.reshape)(n,[1,-1]),t=Object(Bt.reshape)(r,[r.shape[0],r.shape[1]]),a=Object(V.a)(e,t);return Object(Bt.reshape)(a,[a.size])}if(2===n.rank&&1===r.rank){const e=Object(Bt.reshape)(r,[-1,1]),t=Object(V.a)(n,e);return Object(Bt.reshape)(t,[t.size])}{const e=Object(Bt.reshape)(r,[r.shape[0],r.shape[1]]);return Object(V.a)(n,e)}}});const Mn=Object(H.b)({einsum_:function(e,...t){const n=t.map(((e,t)=>Object(W.a)(e,`tensors${t}`,"einsum"))),r={equation:e};return G.a.runKernel(q.Z,n,r)}});var In=n(72);const Dn=Object(H.b)({ensureShape_:function(e,t){const n=Object(W.a)(e,"x","ensureShape","string_or_numeric");if(!Object(_.b)(n.shape,t))throw new Error(`EnsureShape: Shape of tensor ${n.shape} is not compatible with expected shape ${t}`);return e}});const $n=Object(H.b)({erf_:function(e){let t=Object(W.a)(e,"x","erf");_.c("int32"===t.dtype||"float32"===t.dtype,(()=>"Input dtype must be `int32` or `float32`.")),"int32"===t.dtype&&(t=Object(U.a)(t,"float32"));const n={x:t};return G.a.runKernel(q.db,n)}});function Cn(e,t){for(let n=0;n<e.length;++n)if(e[e.length-n-1]!==t-1-n)return!1;return!0}function Rn(e,t,n){const r=e.length+t.length,a=[];let s=0,o=0;for(let i=0;i<r;i++)-1===n.indexOf(i)?a.push(e[s++]):a.push(t[o++]);return a}function Pn(e,t){const n=[],r=e.length;for(let a=0;a<r;a++)-1===t.indexOf(a)&&n.push(e[a]);return[n,t.map((t=>e[t]))]}function Fn(e,t){return Rn(e,t.map((e=>1)),t)}function Bn(e,t,n){_.c(Cn(t,n),(()=>`${e} supports only inner-most axes for now. Got axes ${t} and rank-${n} input.`))}function Ln(e,t){if(Cn(e,t))return null;const n=[];for(let r=0;r<t;++r)-1===e.indexOf(r)&&n.push(r);return e.forEach((e=>n.push(e))),n}function zn(e){return e.map(((e,t)=>[t,e])).sort(((e,t)=>e[1]-t[1])).map((e=>e[0]))}function Wn(e,t){const n=[];for(let r=t-e;r<t;++r)n.push(r);return n}const Un=Object(H.b)({max_:function(e,t=null,n=!1){const r={x:Object(W.a)(e,"x","max")},a={reductionIndices:t,keepDims:n};return G.a.runKernel(q.Pb,r,a)}});const Vn=Object(H.b)({min_:function(e,t=null,n=!1){const r={x:Object(W.a)(e,"x","min")},a={axis:t,keepDims:n};return G.a.runKernel(q.Xb,r,a)}});var Gn=n(20);function qn(e,t,n=null){if(0===e.rank)return gt(e);if(1!==e.rank&&null===n)return qn(Object(Bt.reshape)(e,[-1]),t,n);if(1===e.rank||"number"==typeof n||Array.isArray(n)&&1===n.length){if(1===t)return Object(Gn.a)(gt(e),n);if(t===1/0)return Un(gt(e),n);if(t===-1/0)return Vn(gt(e),n);if("euclidean"===t||2===t)return st(Object(Gn.a)(ht(gt(e),ct(2,"int32")),n));throw new Error(`Error in norm: invalid ord value: ${t}`)}if(Array.isArray(n)&&2===n.length){if(1===t)return Un(Object(Gn.a)(gt(e),n[0]),n[1]-1);if(t===1/0)return Un(Object(Gn.a)(gt(e),n[1]),n[0]);if(t===-1/0)return Vn(Object(Gn.a)(gt(e),n[1]),n[0]);if("fro"===t||"euclidean"===t)return st(Object(Gn.a)(ot(e),n));throw new Error(`Error in norm: invalid ord value: ${t}`)}throw new Error(`Error in norm: invalid axis: ${n}`)}const Hn=Object(H.b)({norm_:function(e,t="euclidean",n=null,r=!1){const a=qn(e=Object(W.a)(e,"x","norm"),t,n);let s=a.shape;if(r){const t=Object(_.I)(n,e.shape);s=Fn(a.shape,t)}return Object(Bt.reshape)(a,s)}});const Kn=Object(H.b)({euclideanNorm_:function(e,t=null,n=!1){return Hn(e,"euclidean",t,n)}});const Yn=Object(H.b)({exp_:function(e){const t={x:Object(W.a)(e,"x","exp")};return G.a.runKernel(q.eb,t)}});const Jn=Object(H.b)({expandDims_:function(e,t=0){const n=Object(W.a)(e,"x","expandDims","string_or_numeric");_.c(t<=n.rank,(()=>"Axis must be <= rank of the tensor"));const r={input:n},a={dim:t};return G.a.runKernel(q.fb,r,a)}});const Xn=Object(H.b)({expm1_:function(e){const t={x:Object(W.a)(e,"x","expm1")};return G.a.runKernel(q.gb,t)}});const Zn=Object(H.b)({tile_:function(e,t){const n=Object(W.a)(e,"x","tile","string_or_numeric");_.c(n.rank===t.length,(()=>`Error in transpose: rank of input ${n.rank} must match length of reps ${t}.`));const r={x:n},a={reps:t};return G.a.runKernel(q.od,r,a)}});const Qn=Object(H.b)({eye_:function(e,t,n,r="float32"){null==t&&(t=e);const a=Object(nn.a)([e,t],r),s=e<=t?e:t;for(let e=0;e<s;++e)a.set(1,e,e);const o=Object(Bt.reshape)(a.toTensor(),[e,t]);if(null==n)return o;if(1===n.length)return Zn(Jn(o,0),[n[0],1,1]);if(2===n.length)return Zn(Jn(Jn(o,0),0),[n[0],n[1],1,1]);if(3===n.length)return Zn(Jn(Jn(Jn(o,0),0),0),[n[0],n[1],n[2],1,1]);throw new Error(`eye() currently supports only 1D and 2D batchShapes, but received ${n.length}D.`)}});const er=Object(H.b)({floor_:function(e){const t={x:Object(W.a)(e,"x","floor","float32")};return G.a.runKernel(q.kb,t)}});const tr=Object(H.b)({gather_:function(e,t,n=0,r=0){const a={x:Object(W.a)(e,"x","gather"),indices:Object(W.a)(t,"indices","gather","int32")},s={axis:n,batchDims:r};return G.a.runKernel(q.rb,a,s)}});const nr=Object(H.b)({greater_:function(e,t){let n=Object(W.a)(e,"a","greater","string_or_numeric"),r=Object(W.a)(t,"b","greater","string_or_numeric");[n,r]=Object(Fe.makeTypesMatch)(n,r),Object(X.assertAndGetBroadcastShape)(n.shape,r.shape);const a={a:n,b:r};return G.a.runKernel(q.sb,a)}});const rr=Object(H.b)({greaterEqual_:function(e,t){let n=Object(W.a)(e,"a","greaterEqual","string_or_numeric"),r=Object(W.a)(t,"b","greaterEqual","string_or_numeric");[n,r]=Object(Fe.makeTypesMatch)(n,r),Object(X.assertAndGetBroadcastShape)(n.shape,r.shape);const a={a:n,b:r};return G.a.runKernel(q.tb,a)}});var ar=n(50);const sr=Object(H.b)({isFinite_:function(e){const t={x:Object(W.a)(e,"x","isFinite")};return G.a.runKernel(q.xb,t)}});const or=Object(H.b)({isInf_:function(e){const t={x:Object(W.a)(e,"x","isInf")};return G.a.runKernel(q.yb,t)}});const ir=Object(H.b)({isNaN_:function(e){const t={x:Object(W.a)(e,"x","isNaN")};return G.a.runKernel(q.zb,t)}});var ur=n(73);const cr=Object(H.b)({less_:function(e,t){let n=Object(W.a)(e,"a","less","string_or_numeric"),r=Object(W.a)(t,"b","less","string_or_numeric");[n,r]=Object(Fe.makeTypesMatch)(n,r),Object(X.assertAndGetBroadcastShape)(n.shape,r.shape);const a={a:n,b:r};return G.a.runKernel(q.Db,a)}});const lr=Object(H.b)({lessEqual_:function(e,t){let n=Object(W.a)(e,"a","lessEqual","string_or_numeric"),r=Object(W.a)(t,"b","lessEqual","string_or_numeric");[n,r]=Object(Fe.makeTypesMatch)(n,r),Object(X.assertAndGetBroadcastShape)(n.shape,r.shape);const a={a:n,b:r};return G.a.runKernel(q.Eb,a)}});function dr(e,t,n){if(n<=0)throw new Error("The number of values should be positive.");const r={start:e,stop:t,num:n};return G.a.runKernel(q.Fb,{},r)}const pr=Object(H.b)({localResponseNormalization_:function(e,t=5,n=1,r=1,a=.5){const s=Object(W.a)(e,"x","localResponseNormalization");_.c(4===s.rank||3===s.rank,(()=>`Error in localResponseNormalization: x must be rank 3 or 4 but got\n rank ${s.rank}.`)),_.c(_.w(t),(()=>`Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${t}.`));let o=s,i=!1;3===s.rank&&(i=!0,o=Object(Bt.reshape)(s,[1,s.shape[0],s.shape[1],s.shape[2]]));const u={x:o},c={depthRadius:t,bias:n,alpha:r,beta:a},l=G.a.runKernel(q.Ab,u,c);return i?Object(Bt.reshape)(l,[l.shape[1],l.shape[2],l.shape[3]]):l}});const fr=Object(H.b)({log_:function(e){const t={x:Object(W.a)(e,"x","log","float32")};return G.a.runKernel(q.Gb,t)}});const hr=Object(H.b)({log1p_:function(e){const t={x:Object(W.a)(e,"x","log1p")};return G.a.runKernel(q.Hb,t)}});var mr=n(27);const br=Object(H.b)({softplus_:function(e){const t={x:Object(W.a)(e,"x","softplus")};return G.a.runKernel(q.Sc,t)}});const gr=Object(H.b)({logSigmoid_:function(e){const t=Object(W.a)(e,"x","logSigmoid"),n=Object(ut.a)((e=>({value:Object(mr.a)(br(Object(mr.a)(e))),gradFunc:t=>Object(at.mul)(t,Object(Wt.sigmoid)(Object(mr.a)(e)))})));return n(t)}});const yr=Object(H.b)({logSoftmax_:function(e,t=-1){const n=Object(W.a)(e,"logits","logSoftmax");if(-1===t&&(t=n.rank-1),t!==n.rank-1)throw Error(`Log Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and axis was ${t}`);const r=Object(ut.a)(((e,n)=>{const r=Un(e,t,!0),a=mt(e,r),s=mt(Object(U.a)(a,"float32"),fr(Object(Gn.a)(Yn(a),t,!0)));n([s]);return{value:s,gradFunc:(e,n)=>{const[r]=n,a=Yn(r);return mt(e,Object(at.mul)(Object(Gn.a)(e,t,!0),a))}}}));return r(n)}});const wr=Object(H.b)({logSumExp_:function(e,t=null,n=!1){const r=Object(W.a)(e,"x","logSumExp"),a=Object(_.I)(t,r.shape),s=Un(r,a,!0),o=mt(r,s),i=Yn(o),u=Object(Gn.a)(i,a),c=fr(u),l=Object(tt.add)(Object(Bt.reshape)(s,c.shape),c);if(n){const e=Fn(l.shape,a);return Object(Bt.reshape)(l,e)}return l}});const Or=Object(H.b)({logicalAnd_:function(e,t){const n=Object(W.a)(e,"a","logicalAnd","bool"),r=Object(W.a)(t,"b","logicalAnd","bool");Object(X.assertAndGetBroadcastShape)(n.shape,r.shape);const a={a:n,b:r};return G.a.runKernel(q.Jb,a)}});const vr=Object(H.b)({logicalNot_:function(e){const t={x:Object(W.a)(e,"x","logicalNot","bool")};return G.a.runKernel(q.Kb,t)}});const jr=Object(H.b)({logicalOr_:function(e,t){const n=Object(W.a)(e,"a","logicalOr","bool"),r=Object(W.a)(t,"b","logicalOr","bool");Object(X.assertAndGetBroadcastShape)(n.shape,r.shape);const a={a:n,b:r};return G.a.runKernel(q.Lb,a)}});const _r=Object(H.b)({logicalXor_:function(e,t){const n=Object(W.a)(e,"a","logicalXor","bool"),r=Object(W.a)(t,"b","logicalXor","bool");return Object(X.assertAndGetBroadcastShape)(n.shape,r.shape),Or(jr(e,t),vr(Or(e,t)))}}),xr=2147483648;const Sr=Object(H.b)({searchSorted_:function(e,t,n="left"){const r=Object(W.a)(e,"sortedSequence","searchSorted"),a=Object(W.a)(t,"values","searchSorted"),s=r.shape[r.shape.length-1],o=a.shape[a.shape.length-1],i=Object(Bt.reshape)(r,[-1,s]),u=Object(Bt.reshape)(a,[-1,o]);if(i.rank<2)throw new Error("Sorted input argument must be at least 2-dimensional");if(i.shape[0]!==u.shape[0])throw new Error("Leading dimension of 'sortedSequence' and 'values' must match.");if(Object(_.O)(u.shape)>=xr)throw new Error("values tensor size must less than 2147483648");if(i.shape[1]>=xr)throw new Error(`trailing dim_size must less than 2147483648 for int32 output type, was ${i.shape[1]}`);const c={sortedSequence:i,values:u},l={side:n};return G.a.runKernel(q.Jc,c,l)}});function kr(e,t){return Sr(e,t,"left")}const Er=Object(H.b)({maxPool_:function(e,t,n,r,a){const s=Object(W.a)(e,"x","maxPool");let o=s,i=!1;3===s.rank&&(i=!0,o=Object(Bt.reshape)(s,[1,s.shape[0],s.shape[1],s.shape[2]])),_.c(4===o.rank,(()=>`Error in maxPool: input must be rank 4 but got rank ${o.rank}.`)),_.c(Ft.i(n,1),(()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${n} and dilations '1'`)),Ft.a("maxPool",r,a);const u={x:o},c={filterSize:t,strides:n,pad:r,dimRoundingMode:a},l=G.a.runKernel(q.Qb,u,c);return i?Object(Bt.reshape)(l,[l.shape[1],l.shape[2],l.shape[3]]):l}});const Tr=Object(H.b)({maxPool3d_:function(e,t=[1,1,1],n,r,a,s="NDHWC"){const o=Object(W.a)(e,"x","maxPool3d");let i=o,u=!1;4===o.rank&&(u=!0,i=Object(Bt.reshape)(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]])),_.c(5===i.rank,(()=>`Error in maxPool3d: x must be rank 5 but got rank ${i.rank}.`)),_.c("NDHWC"===s,(()=>`Error in maxPool3d: Only NDHWC is currently supported, but got dataFormat of ${s}`)),Object(Ft.a)("maxPool3d",r,a);const c={x:i},l={filterSize:t,strides:n,pad:r,dimRoundingMode:a,dataFormat:s},d=G.a.runKernel(q.Rb,c,l);return u?Object(Bt.reshape)(d,[d.shape[1],d.shape[2],d.shape[3],d.shape[4]]):d}});const Nr=Object(H.b)({maxPoolWithArgmax_:function(e,t,n,r,a=!1){const s={x:Object(W.a)(e,"x","maxPoolWithArgmax")},o={filterSize:t,strides:n,pad:r,includeBatchInIndex:a},i=G.a.runKernel(q.Ub,s,o);return{result:i[0],indexes:i[1]}}});var Ar=n(51);function Mr(e,t="float32"){if(Object(_.d)(e),"complex64"===t){const t=Mr(e,"float32"),n=Mr(e,"float32");return Object(sn.a)(t,n)}const n=Object(_.F)(Object(_.O)(e),t);return G.a.makeTensor(n,e,t)}function Ir(e,t="float32"){if(Object(_.d)(e),"complex64"===t){const t=Ir(e,"float32"),n=Mr(e,"float32");return Object(sn.a)(t,n)}const n=Object(_.D)(Object(_.O)(e),t);return G.a.makeTensor(n,e,t)}function Dr(e,t,{indexing:n="xy"}={}){if("xy"!==n&&"ij"!==n)throw new TypeError(`${n} is not a valid third argument to meshgrid`);if(void 0===e)return[];let r=Object(W.a)(e,"x","meshgrid",e instanceof Q.a?e.dtype:"float32");if(void 0===t)return[r];let a=Object(W.a)(t,"y","meshgrid",t instanceof Q.a?t.dtype:"float32");const s=Object(_.O)(r.shape),o=Object(_.O)(a.shape);return"xy"===n?(r=Object(Bt.reshape)(r,[1,-1]),a=Object(Bt.reshape)(a,[-1,1]),[Object(V.a)(Ir([o,1],r.dtype),r),Object(V.a)(a,Ir([1,s],a.dtype))]):(r=Object(Bt.reshape)(r,[-1,1]),a=Object(Bt.reshape)(a,[1,-1]),[Object(V.a)(r,Ir([1,o],r.dtype)),Object(V.a)(Ir([s,1],a.dtype),a)])}var $r=n(52);const Cr=Object(H.b)({mirrorPad_:function(e,t,n){_.c("reflect"===n||"symmetric"===n,(()=>`Invalid mode. Mode must be either reflect or symmetric. Got ${n}.`));const r=Object(W.a)(e,"x","mirrorPad");if(0===r.rank)throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad");_.c(t.length===r.rank,(()=>`Padding doesn't match input. Must be ${r.rank}. Got ${t.length}.`));const a="reflect"===n?1:0;for(let e=0;e<r.rank;e++)_.c(2===t[e].length,(()=>"Invalid number of paddings. Must be length of 2 each.")),_.c(t[e][0]>=0&&t[e][0]<=r.shape[e]-a&&t[e][1]>=0&&t[e][1]<=r.shape[e]-a,(()=>`Padding in dimension ${e} cannot be greater than or equal to ${r.shape[e]-a} or less than 0 for input of shape ${r.shape}`));const s={paddings:t,mode:n},o={x:r};return G.a.runKernel(q.Zb,o,s)}});const Rr=Object(H.b)({mod_:function(e,t){let n=Object(W.a)(e,"a","mod"),r=Object(W.a)(t,"b","mod");[n,r]=Object(Fe.makeTypesMatch)(n,r);const a={a:n,b:r};return G.a.runKernel(q.ac,a)}});const Pr=Object(H.b)({moments_:function(e,t=null,n=!1){e=Object(W.a)(e,"x","moments");const r=Object(_.I)(t,e.shape),a=Object(Ar.mean)(e,r,n);let s=a.shape;n||(s=Fn(a.shape,r));const o=ot(mt(Object(U.a)(e,"float32"),Object(Bt.reshape)(a,s)));return{mean:a,variance:Object(Ar.mean)(o,r,n)}}});const Fr=Object(H.b)({multiRNNCell_:function(e,t,n,r){const a=Object(W.a)(t,"data","multiRNNCell"),s=Object(W.b)(n,"c","multiRNNCell"),o=Object(W.b)(r,"h","multiRNNCell");let i=a;const u=[];for(let t=0;t<e.length;t++){const n=e[t](i,s[t],o[t]);u.push(n[0]),u.push(n[1]),i=n[1]}const c=[],l=[];for(let e=0;e<u.length;e+=2)c.push(u[e]),l.push(u[e+1]);return[c,l]}});const Br=Object(H.b)({multinomial_:function(e,t,n,r=!1){const a=Object(W.a)(e,"logits","multinomial"),s=a.size,o=a.rank;if(s<2)throw new Error(`Error in multinomial: you need at least 2 outcomes, but got ${s}.`);if(o>2)throw new Error(`Rank of probabilities must be 1 or 2, but is ${o}`);n=n||Math.random();const i={logits:1===o?Object(Bt.reshape)(a,[1,-1]):a},u={numSamples:t,seed:n,normalized:r},c=G.a.runKernel(q.bc,i,u);return 1===o?Object(Bt.reshape)(c,[c.size]):c}});const Lr=Object(H.b)({notEqual_:function(e,t){let n=Object(W.a)(e,"a","notEqual","string_or_numeric"),r=Object(W.a)(t,"b","notEqual","string_or_numeric");[n,r]=Object(Fe.makeTypesMatch)(n,r),Object(X.assertAndGetBroadcastShape)(n.shape,r.shape);const a={a:n,b:r};return G.a.runKernel(q.hc,a)}});const zr=Object(H.b)({onesLike_:function(e){const t={x:Object(W.a)(e,"x","onesLike")};return G.a.runKernel(q.jc,t)}});const Wr=Object(H.b)({outerProduct_:function(e,t){const n=Object(W.a)(e,"v1","outerProduct"),r=Object(W.a)(t,"v2","outerProduct");_.c(1===n.rank&&1===r.rank,(()=>`Error in outerProduct: inputs must be rank 1, but got ranks ${n.rank} and ${r.rank}.`));const a=Object(Bt.reshape)(n,[-1,1]),s=Object(Bt.reshape)(r,[1,-1]);return Object(V.a)(a,s)}});var Ur=n(39);const Vr=Object(H.b)({pad1d_:function(e,t,n=0){return Object(_.c)(2===t.length,(()=>"Invalid number of paddings. Must be length of 2.")),Object(Ur.pad)(e,[t],n)}});const Gr=Object(H.b)({pad2d_:function(e,t,n=0){return Object(_.c)(2===t.length&&2===t[0].length&&2===t[1].length,(()=>"Invalid number of paddings. Must be length of 2 each.")),Object(Ur.pad)(e,t,n)}});const qr=Object(H.b)({pad3d_:function(e,t,n=0){return Object(_.c)(3===t.length&&2===t[0].length&&2===t[1].length&&2===t[2].length,(()=>"Invalid number of paddings. Must be length of 2 each.")),Object(Ur.pad)(e,t,n)}});const Hr=Object(H.b)({pad4d_:function(e,t,n=0){return Object(_.c)(4===t.length&&2===t[0].length&&2===t[1].length&&2===t[2].length&&2===t[3].length,(()=>"Invalid number of paddings. Must be length of 2 each.")),Object(Ur.pad)(e,t,n)}});const Kr=Object(H.b)({spaceToBatchND_:function(e,t,n){const r=Object(W.a)(e,"x","spaceToBatchND");_.c(r.rank>=1+t.length,(()=>`input rank ${r.rank} should be > than [blockShape] ${t.length}`)),_.c(n.length===t.length,(()=>`paddings.shape[0] ${n.length} must be equal to [blockShape] ${t.length}`)),_.c(r.shape.reduce(((e,r,a)=>a>0&&a<=t.length?e&&(r+n[a-1][0]+n[a-1][1])%t[a-1]==0:e),!0),(()=>`input spatial dimensions ${r.shape.slice(1)} with paddings ${n.toString()} must be divisible by blockShapes ${t.toString()}`));const a={x:r},s={blockShape:t,paddings:n};return G.a.runKernel(q.Tc,a,s)}});const Yr=Object(H.b)({pool_:function(e,t,n,r,a,s,o){null==a&&(a=[1,1]),null==s&&(s=1),0===r&&(r="valid");const i=Object(W.a)(e,"x","maxPool");let u=i,c=!1;3===i.rank&&(c=!0,u=Object(Bt.reshape)(i,[1,i.shape[0],i.shape[1],i.shape[2]])),_.c(Ft.i(s,a),(()=>`Error in pool: Either strides or dilations must be 1. Got strides ${s} and dilations '${a}'`));const l=Ft.f(u.shape,t,s,a,r),d=[l.dilationHeight,l.dilationWidth];let p;p="same"===r?function(e,t){const n=e.map(((e,n)=>e+(e-1)*(t[n]-1))).map((e=>e-1)),r=n.map((e=>Math.floor(e/2))),a=n.map(((e,t)=>e-r[t]));return n.map(((e,t)=>[r[t],a[t]]))}([l.filterHeight,l.filterWidth],d):[[0,0],[0,0]];const f=1===d[0]&&1===d[1],[h,m]=function(e,t,n){const r=n.map((e=>e[0])),a=n.map((e=>e[1])),s=e.concat(r,a),o=t.map(((e,t)=>(e-s[t]%e)%e)),i=a.map(((e,t)=>e+o[t])),u=t.map(((e,t)=>[r[t],i[t]])),c=t.map(((e,t)=>[0,o[t]]));return[u,c]}([l.inHeight,l.inWidth],d,p),b=f?r:"valid",g=f?u:Kr(u,d,h),y=("avg"===n?()=>Object(Pt.avgPool)(g,t,s,b,o):()=>Er(g,t,s,b,o))(),w=f?y:qt(y,d,m);return c?Object(Bt.reshape)(w,[w.shape[1],w.shape[2],w.shape[3]]):w}});var Jr=n(74),Xr=n(75);const Zr=Object(H.b)({prod_:function(e,t=null,n=!1){let r=Object(W.a)(e,"x","prod");"bool"===r.dtype&&(r=Object(U.a)(r,"int32"));const a={x:r},s={axis:t,keepDims:n};return G.a.runKernel(q.pc,a,s)}});const Qr=Object(H.b)({raggedGather_:function(e,t,n,r){const a={paramsNestedSplits:e.map(((e,t)=>Object(W.a)(e,`tensors${t}`,"raggedGather","int32"))),paramsDenseValues:Object(W.a)(t,"paramsDenseValues","raggedGather"),indices:Object(W.a)(n,"indices","raggedGather","int32")},s={outputRaggedRank:r},o=G.a.runKernel(q.qc,a,s);return{outputNestedSplits:o.slice(0,o.length-1),outputDenseValues:o[o.length-1]}}});const ea=Object(H.b)({raggedRange_:function(e,t,n){const r=Object(W.a)(e,"starts","raggedRange"),a={starts:r,limits:Object(W.a)(t,"limits","raggedRange",r.dtype),deltas:Object(W.a)(n,"deltas","raggedRange",r.dtype)},s=G.a.runKernel(q.rc,a);return{rtNestedSplits:s[0],rtDenseValues:s[1]}}});const ta=Object(H.b)({raggedTensorToTensor_:function(e,t,n,r,a){const s=Object(W.a)(e,"shape","raggedTensorToTensor","int32"),o=Object(W.a)(t,"values","raggedTensorToTensor"),i={shape:s,values:o,defaultValue:Object(W.a)(n,"defaultValue","raggedTensorToTensor",o.dtype),rowPartitionTensors:r.map(((e,t)=>Object(W.a)(e,`tensors${t}`,"raggedTensorToTensor","int32")))},u={rowPartitionTypes:a};return G.a.runKernel(q.sc,i,u)}});const na=Object(H.b)({rand_:function(e,t,n){Object(_.d)(e);const r=Object(_.O)(e);let a=null;if(null==n||"float32"===n)a=new Float32Array(r);else if("int32"===n)a=new Int32Array(r);else{if("bool"!==n)throw new Error(`Unknown data type ${n}`);a=new Uint8Array(r)}for(let e=0;e<r;e++)a[e]=t();return G.a.makeTensor(a,e,n)}});var ra=n(83);class aa{constructor(e,t,n,r,a){this.mean=e,this.stdDev=t,this.dtype=n,this.nextVal=NaN,this.truncated=r,this.truncated&&(this.upper=this.mean+2*this.stdDev,this.lower=this.mean-2*this.stdDev);const s=a||Math.random();this.random=ra.alea(s.toString())}nextValue(){if(!isNaN(this.nextVal)){const e=this.nextVal;return this.nextVal=NaN,e}let e,t,n=!1;for(;!n;){let r,a,s;do{r=2*this.random()-1,a=2*this.random()-1,s=r*r+a*a}while(s>=1||0===s);const o=Math.sqrt(-2*Math.log(s)/s);e=this.mean+this.stdDev*r*o,t=this.mean+this.stdDev*a*o,this.truncated&&!this.isValidTruncated(e)||(n=!0)}return this.truncated&&!this.isValidTruncated(t)||(this.nextVal=this.convertValue(t)),this.convertValue(e)}convertValue(e){return null==this.dtype||"float32"===this.dtype?e:Math.round(e)}isValidTruncated(e){return e<=this.upper&&e>=this.lower}}class sa{constructor(e,t,n,r){this.alpha=e,this.beta=1/t,this.dtype=n;const a=r||Math.random();this.randu=ra.alea(a.toString()),this.randn=new aa(0,1,n,!1,this.randu()),this.d=e<1?e+2/3:e-1/3,this.c=1/Math.sqrt(9*this.d)}nextValue(){let e,t,n,r,a,s;for(;;){do{r=this.randn.nextValue(),s=1+this.c*r}while(s<=0);if(s*=s*s,e=r*r,t=1-.331*e*e,n=.5*e+this.d*(1-s+Math.log(s)),a=this.randu(),a<t||Math.log(a)<n)break}return s=1/this.beta*this.d*s,this.alpha<1&&(s*=Math.pow(this.randu(),1/this.alpha)),this.convertValue(s)}convertValue(e){return"float32"===this.dtype?e:Math.round(e)}}class oa{constructor(e=0,t=1,n,r){if(this.canReturnFloat=()=>null==this.dtype||"float32"===this.dtype,this.min=e,this.range=t-e,this.dtype=n,null==r&&(r=Math.random()),"number"==typeof r&&(r=r.toString()),!this.canReturnFloat()&&this.range<=1)throw new Error(`The difference between ${e} - ${t} <= 1 and dtype is not float`);this.random=ra.alea(r)}convertValue(e){return this.canReturnFloat()?e:Math.round(e)}nextValue(){return this.convertValue(this.min+this.range*this.random())}}const ia=Object(H.b)({randomGamma_:function(e,t,n=1,r="float32",a){if(Object(_.d)(e),null==n&&(n=1),null==r&&(r="float32"),"float32"!==r&&"int32"!==r)throw new Error(`Unsupported data type ${r}`);const s=new sa(t,n,r,a),o=Object(nn.a)(e,r);for(let e=0;e<o.values.length;e++)o.values[e]=s.nextValue();return o.toTensor()}});const ua=Object(H.b)({randomNormal_:function(e,t=0,n=1,r,a){if(Object(_.d)(e),null!=r&&"bool"===r)throw new Error(`Unsupported data type ${r}`);const s=new aa(t,n,r,!1,a),o=Object(nn.a)(e,r);for(let e=0;e<o.values.length;e++)o.values[e]=s.nextValue();return o.toTensor()}});const ca=Object(H.b)({randomStandardNormal_:function(e,t,n){if(null!=t&&"bool"===t)throw new Error(`Unsupported data type ${t}`);return ua(e,0,1,t,n)}});const la=Object(H.b)({randomUniform_:function(e,t=0,n=1,r="float32",a){Object(_.d)(e);const s=Object(nn.a)(e,r),o=new oa(t,n,null,a);for(let e=0;e<s.values.length;e++)s.values[e]=o.nextValue();return s.toTensor()}});const da=Object(H.b)({randomUniformInt_:function(e,t,n,r){return la(e,t,n,"int32",r)}});function pa(e,t,n=1,r="float32"){if(0===n)throw new Error("Cannot have a step of zero");const a={start:e,stop:t,step:n,dtype:r};return G.a.runKernel(q.tc,{},a)}var fa=n(46);const ha=Object(H.b)({reciprocal_:function(e){const t={x:Object(W.a)(e,"x","reciprocal")};return G.a.runKernel(q.wc,t)}});var ma=n(45),ba=n(67);const ga=Object(H.b)({reverse_:function(e,t){const n={x:Object(W.a)(e,"x","reverse")},r={dims:t};return G.a.runKernel(q.Ec,n,r)}});const ya=Object(H.b)({reverse1d_:function(e){const t=Object(W.a)(e,"x","reverse");return _.c(1===t.rank,(()=>`Error in reverse1D: x must be rank 1 but got rank ${t.rank}.`)),ga(t,0)}});const wa=Object(H.b)({reverse2d_:function(e,t){const n=Object(W.a)(e,"x","reverse");return _.c(2===n.rank,(()=>`Error in reverse2D: x must be rank 2 but got rank ${n.rank}.`)),ga(n,t)}});const Oa=Object(H.b)({reverse3d_:function(e,t){const n=Object(W.a)(e,"x","reverse");return _.c(3===n.rank,(()=>`Error in reverse3D: x must be rank 3 but got rank ${n.rank}.`)),ga(n,t)}});const va=Object(H.b)({reverse4d_:function(e,t){const n=Object(W.a)(e,"x","reverse");return _.c(4===n.rank,(()=>`Error in reverse4D: x must be rank 4 but got rank ${n.rank}.`)),ga(n,t)}});const ja=Object(H.b)({round_:function(e){const t={x:Object(W.a)(e,"x","round")};return G.a.runKernel(q.Gc,t)}});const _a=Object(H.b)({rsqrt_:function(e){const t={x:Object(W.a)(e,"x","rsqrt","float32")};return G.a.runKernel(q.Hc,t)}});const xa=Object(H.b)({selu_:function(e){const t={x:Object(W.a)(e,"x","selu")};return G.a.runKernel(q.Lc,t)}});const Sa=Object(H.b)({separableConv2d_:function(e,t,n,r,a,s=[1,1],o="NHWC"){const i=Object(W.a)(e,"x","separableConv2d"),u=Object(W.a)(t,"depthwiseFilter","separableConv2d"),c=Object(W.a)(n,"pointwiseFilter","separableConv2d");let l=i,d=!1;if(3===i.rank&&(d=!0,l=Object(Bt.reshape)(i,[1,i.shape[0],i.shape[1],i.shape[2]])),"NCHW"===o)throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");_.c(4===l.rank,(()=>`Error in separableConv2d: input must be rank 4, but got rank ${l.rank}.`)),_.c(4===u.rank,(()=>`Error in separableConv2d: depthwise filter must be rank 4, but got rank ${u.rank}.`)),_.c(4===c.rank,(()=>`Error in separableConv2d: pointwise filter must be rank 4, but got rank ${u.rank}.`)),_.c(1===c.shape[0],(()=>`Error in separableConv2d: the first dimension of pointwise filter must be 1, but got ${c.shape[0]}.`)),_.c(1===c.shape[1],(()=>`Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${c.shape[1]}.`));const p=u.shape[2],f=u.shape[3];_.c(c.shape[2]===p*f,(()=>`Error in separableConv2d: the third dimension of pointwise filter must be ${p*f}, but got ${c.shape[2]}.`));const h=Object(xn.a)(l,u,r,a,o,s),m=Object(dn.a)(h,c,1,"valid",o);return d?Object(Bt.reshape)(m,[m.shape[1],m.shape[2],m.shape[3]]):m}});const ka=async function(e,t){const n=Object(W.a)(e,"x","setdiff1d"),r=Object(W.a)(t,"y","setdiff1d");_.c(n.dtype===r.dtype,(()=>`x and y should have the same dtype, but got x (${n.dtype}) and y (${r.dtype}).`)),_.c(1===n.rank,(()=>`x should be 1D tensor, but got x (${n.shape}).`)),_.c(1===r.rank,(()=>`y should be 1D tensor, but got y (${r.shape}).`));const a=await n.data(),s=await r.data(),o=new Set(s);let i=0;for(let e=0;e<a.length;e++)o.has(a[e])||i++;const u=new Q.b([i],n.dtype),c=new Q.b([i],"int32");for(let e=0,t=0;e<a.length;e++)o.has(a[e])||(u.values[t]=a[e],c.values[t]=e,t++);return[u.toTensor(),c.toTensor()]};const Ea=Object(H.b)({sign_:function(e){const t={x:Object(W.a)(e,"x","sign")};return G.a.runKernel(q.Nc,t)}});const Ta=Object(H.b)({sin_:function(e){const t={x:Object(W.a)(e,"x","sin","float32")};return G.a.runKernel(q.Oc,t)}});const Na=Object(H.b)({sinh_:function(e){const t={x:Object(W.a)(e,"x","sinh")};return G.a.runKernel(q.Pc,t)}});const Aa=Object(H.b)({slice1d_:function(e,t,n){const r=Object(W.a)(e,"x","slice1d");return _.c(1===r.rank,(()=>`slice1d expects a rank-1 tensor, but got a rank-${r.rank} tensor`)),Ut(r,[t],[n])}});const Ma=Object(H.b)({slice2d_:function(e,t,n){const r=Object(W.a)(e,"x","slice2d");return _.c(2===r.rank,(()=>`slice2d expects a rank-2 tensor, but got a rank-${r.rank} tensor`)),Ut(r,t,n)}});const Ia=Object(H.b)({slice3d_:function(e,t,n){const r=Object(W.a)(e,"x","slice3d");return _.c(3===r.rank,(()=>`slice3d expects a rank-3 tensor, but got a rank-${r.rank} tensor`)),Ut(r,t,n)}});const Da=Object(H.b)({slice4d_:function(e,t,n){const r=Object(W.a)(e,"x","slice4d");return _.c(4===r.rank,(()=>`slice4d expects a rank-4 tensor, but got a rank-${r.rank} tensor`)),Ut(r,t,n)}});var $a=n(84);const Ca=Object(H.b)({fft_:function(e){Object(_.c)("complex64"===e.dtype,(()=>`The dtype for tf.spectral.fft() must be complex64 but got ${e.dtype}.`));const t={input:e};return G.a.runKernel(q.hb,t)}});const Ra=Object(H.b)({ifft_:function(e){Object(_.c)("complex64"===e.dtype,(()=>`The dtype for tf.spectral.ifft() must be complex64 but got ${e.dtype}.`));const t={input:e};return G.a.runKernel(q.ub,t)}});const Pa=Object(H.b)({irfft_:function(e){const t=e.shape[e.shape.length-1],n=e.size/t;let r;if(t<=2){const a=Object(Bt.reshape)(e,[n,t]);r=Ra(a)}else{const a=[n,2*(t-1)],s=Object(Bt.reshape)(Object(fa.a)(e),[n,t]),o=Object(Bt.reshape)(Object(ar.a)(e),[n,t]),i=ga(Ut(s,[0,1],[n,t-2]),1),u=Object(at.mul)(ga(Ut(o,[0,1],[n,t-2]),1),ct(-1)),c=Object(zt.concat)([s,i],1),l=Object(zt.concat)([o,u],1),d=Object(Bt.reshape)(Object(sn.a)(c,l),[a[0],a[1]]);r=Ra(d)}if(r=Object(fa.a)(r),3===e.rank&&0!==e.shape[0]){const t=r,n=e.shape[0];r=Object(Bt.reshape)(r,[n,r.shape[0]/n,r.shape[1]]),t.dispose()}return r}});const Fa=Object(H.b)({split_:function(e,t,n=0){const r={x:Object(W.a)(e,"x","split")},a={numOrSizeSplits:t,axis:n};return G.a.runKernel(q.Zc,r,a)}});const Ba=Object(H.b)({rfft_:function(e,t){Object(_.c)("float32"===e.dtype,(()=>`The dtype for rfft() must be real value but got ${e.dtype}`));let n=e.shape[e.shape.length-1];const r=e.size/n;let a;if(null!=t&&t<n){const r=e.shape.map((e=>0)),s=e.shape.map((e=>e));s[e.shape.length-1]=t,a=Ut(e,r,s),n=t}else if(null!=t&&t>n){const r=e.shape.map((e=>e));r[e.shape.length-1]=t-n,a=Object(zt.concat)([e,Mr(r)],e.shape.length-1),n=t}else a=e;const s=it(a),o=Object(Bt.reshape)(Object(sn.a)(a,s),[r,n]),i=Ca(o),u=Math.floor(n/2)+1,c=Object(fa.a)(i),l=Object(ar.a)(i),d=Fa(c,[u,n-u],c.shape.length-1),p=Fa(l,[u,n-u],l.shape.length-1),f=a.shape.slice();return f[a.shape.length-1]=u,Object(Bt.reshape)(Object(sn.a)(d[0],p[0]),f)}});const La=Object(H.b)({squaredDifference_:function(e,t){let n=Object(W.a)(e,"a","squaredDifference"),r=Object(W.a)(t,"b","squaredDifference");[n,r]=Object(Fe.makeTypesMatch)(n,r),Object(X.assertAndGetBroadcastShape)(n.shape,r.shape);const a={a:n,b:r};return G.a.runKernel(q.cd,a,{})}});var za=n(54),Wa=n(43),Ua=n(76),Va=n(85);const Ga=Object(H.b)({tan_:function(e){const t={x:Object(W.a)(e,"x","tan","float32")};return G.a.runKernel(q.ld,t)}});var qa=n(44),Ha=n(24);function Ka(e,t,n){if(Object(_.e)(e),null!=t&&2!==t.length)throw new Error("tensor2d() requires shape to have two numbers");const r=Object(W.c)(e,n);if(2!==r.length&&1!==r.length)throw new Error("tensor2d() requires values to be number[][] or flat/TypedArray");if(1===r.length&&null==t)throw new Error("tensor2d() requires shape to be provided when `values` are a flat/TypedArray");return Object(ee.a)(e,t,r,n)}function Ya(e,t,n){if(Object(_.e)(e),null!=t&&4!==t.length)throw new Error("tensor4d() requires shape to have four numbers");const r=Object(W.c)(e,n);if(4!==r.length&&1!==r.length)throw new Error("tensor4d() requires values to be number[][][][] or flat/TypedArray");if(1===r.length&&null==t)throw new Error("tensor4d() requires shape to be provided when `values` are a flat array");return Object(ee.a)(e,t,r,n)}function Ja(e,t,n){if(Object(_.e)(e),null!=t&&5!==t.length)throw new Error("tensor5d() requires shape to have five numbers");const r=Object(W.c)(e,n);if(5!==r.length&&1!==r.length)throw new Error("tensor5d() requires values to be number[][][][][] or flat/TypedArray");if(1===r.length&&null==t)throw new Error("tensor5d() requires shape to be provided when `values` are a flat array");return Object(ee.a)(e,t,r,n)}function Xa(e,t,n){if(Object(_.e)(e),null!=t&&6!==t.length)throw new Error("tensor6d() requires shape to have six numbers");const r=Object(W.c)(e,n);if(6!==r.length&&1!==r.length)throw new Error("tensor6d() requires values to be number[][][][][][] or flat/TypedArray");if(1===r.length&&null==t)throw new Error("tensor6d() requires shape to be provided when `values` are a flat array");return t=t||r,Object(ee.a)(e,t,r,n)}const Za=Object(H.b)({tensorScatterUpdate_:function(e,t,n){const r=Object(W.a)(e,"tensor","tensorScatterupdate"),a=Object(W.a)(t,"indices","tensorScatterupdate","int32"),s=Object(W.a)(n,"updates","tensorScatterupdate");if(fe(s,a,r.shape),r.dtype!==s.dtype)throw new Error(`tensor and updates must have the same dtype, instead they are ${r.dtype} and ${s.dtype}.`);const o={tensor:r,indices:a,updates:s};return G.a.runKernel(q.nd,o,{})}});const Qa=Object(H.b)({topk_:function(e,t=1,n=!0){const r=Object(W.a)(e,"x","topk");if(0===r.rank)throw new Error("topk() expects the input to be of rank 1 or higher");const a=r.shape[r.shape.length-1];if(t<0)throw new Error(`'k' passed to topk() must be >= 0 but got ${t}`);if(t>a)throw new Error(`'k' passed to topk() must be <= the last dimension (${a}) but got ${t}`);const s={x:r},o={k:t,sorted:n},[i,u]=G.a.runKernel(q.pd,s,o);return{values:i,indices:u}}});const es=Object(H.b)({truncatedNormal_:function(e,t=0,n=1,r,a){if(Object(_.d)(e),null!=r&&"bool"===r)throw new Error("Unsupported data type $ { dtype }");const s=new aa(t,n,r,!0,a),o=Object(nn.a)(e,r);for(let e=0;e<o.values.length;e++)o.values[e]=s.nextValue();return o.toTensor()}});const ts=Object(H.b)({unique_:function(e,t=0){const n=Object(W.a)(e,"x","unique","string_or_numeric");Object(_.c)(n.rank>0,(()=>"The input tensor must be at least 1D"));const r={x:n},a={axis:t},[s,o]=G.a.runKernel(q.sd,r,a);return{values:s,indices:o}}});const ns=Object(H.b)({unsortedSegmentSum_:function(e,t,n){const r=Object(W.a)(e,"x","unsortedSegmentSum"),a=Object(W.a)(t,"segmentIds","unsortedSegmentSum","int32");Object(_.c)(Object(_.w)(n),(()=>"numSegments must be of dtype int"));const s={x:r,segmentIds:a},o={numSegments:n};return G.a.runKernel(q.ud,s,o)}});const rs=Object(H.b)({unstack_:function(e,t=0){const n=Object(W.a)(e,"x","unstack","string_or_numeric");_.c(t>=-n.shape.length&&t<n.shape.length,(()=>`Axis = ${t} is not in [-${n.shape.length}, ${n.shape.length})`));const r={value:n},a={axis:t};return G.a.runKernel(q.td,r,a)}});function as(e,t){return Sr(e,t,"right")}function ss(e,t=!0,n,r){return G.a.makeVariable(e,t,n,r)}function os(e,t){const n=[];for(let e=0;e<t.length;e++)t[e]&&n.push(e);const r=Object(nn.a)(e,"int32"),a=Object(nn.a)([n.length,e.length],"int32");for(let t=0;t<n.length;t++){const s=r.indexToLoc(n[t]),o=t*e.length;a.values.set(s,o)}return a.toTensor()}const is=async function(e){const t=Object(W.a)(e,"condition","whereAsync","bool"),n=await t.data(),r=os(t.shape,n);return e!==t&&t.dispose(),r};const us=async function(e,t,n){const r=Object(W.a)(e,"tensor","boolMask"),a=Object(W.a)(t,"mask","boolMask","bool"),s=null==n?0:n,o=a.rank,i=r.shape;_.c(o>0,(()=>"mask cannot be scalar")),_.f(i.slice(s,s+o),a.shape,"mask's shape must match the first K dimensions of tensor's shape,");let u=1;for(let e=s;e<s+o;e++)u*=i[e];const c=i.slice(0,s).concat([u],i.slice(s+o)),l=Object(Bt.reshape)(r,c),d=Object(Bt.reshape)(a,[-1]),p=await is(d),f=Object(za.squeeze)(p,[1]),h=tr(l,f,s);return e!==r&&r.dispose(),t!==a&&a.dispose(),f.dispose(),l.dispose(),d.dispose(),p.dispose(),h};const cs=Object(H.b)({movingAverage_:function(e,t,n,r,a=!0){const s=Object(W.a)(e,"v","movingAverage"),o=Object(W.a)(t,"x","movingAverage"),i=Object(W.a)(n,"decay","movingAverage");Object(Fe.assertTypesMatch)(s,o),_.c(_.a(s.shape,o.shape),(()=>"Shape mismatch in v and x"));const u=ct(1),c=mt(u,i);let l=Object(at.mul)(mt(o,s),c);if(a){_.c(null!=r,(()=>"When using zeroDebias: true, step is required."));const e=Object(W.a)(r,"step","movingAverage");l=rt(l,mt(u,ht(i,e)))}return Object(tt.add)(s,l)}});const ls=Object(H.b)({scatterND_:function(e,t,n){Object(_.d)(n);const r=Object(W.a)(e,"indices","scatterND","int32"),a=Object(W.a)(t,"updates","scatterND");fe(a,r,n);const s={indices:r,updates:a},o={shape:n};return G.a.runKernel(q.Ic,s,o)}});const ds=Object(H.b)({sparseToDense_:function(e,t,n,r=0){Object(_.d)(n);const a=Object(W.a)(e,"sparseIndices","sparseToDense","int32"),s=Object(W.a)(t,"sparseValues","sparseToDense","string_or_numeric"),o=Object(W.a)(r,"defaultValue","sparseToDense",s.dtype);!function(e,t,n,r){if("int32"!==e.dtype)throw new Error(`tf.sparseToDense() expects the indices to be int32 type, but the dtype was ${e.dtype}.`);if(e.rank>2)throw new Error(`sparseIndices should be a scalar, vector, or matrix, but got shape ${e.shape}.`);const a=e.rank>0?e.shape[0]:1,s=e.rank>1?e.shape[1]:1;if(n.length!==s)throw new Error(`outputShape has incorrect number of elements:, ${n.length}, should be: ${s}.`);const o=t.size;if(0!==t.rank&&(1!==t.rank||o!==a))throw new Error(`sparseValues has incorrect shape ${t.shape}, should be [] or [${a}]`);if(t.dtype!==r.dtype)throw new Error("sparseValues.dtype must match defaultValues.dtype")}(a,s,n,o);const i={sparseIndices:a,sparseValues:s,defaultValue:o},u={outputShape:n};return G.a.runKernel(q.Yc,i,u)}});const ps=Object(H.b)({gatherND_:function(e,t){const n=Object(W.a)(t,"indices","gatherND","int32"),r={params:Object(W.a)(e,"x","gatherND","string_or_numeric"),indices:n};return G.a.runKernel(q.qb,r)}});const fs=Object(H.b)({dropout_:function(e,t,n,r){const a=Object(W.a)(e,"x","dropout");if(_.c("float32"===a.dtype,(()=>`x has to be a floating point tensor since it's going to be scaled, but got a ${a.dtype} tensor instead.`)),_.c(t>=0&&t<1,(()=>`rate must be a float in the range [0, 1), but got ${t}.`)),0===t)return e instanceof Q.a?a.clone():a;const s=function(e,t){if(null==t)return e.shape.slice();if(_.a(e.shape,t))return t;if(e.shape.length===t.length){const n=[];for(let r=0;r<e.shape.length;r++)null==t[r]&&null!=e.shape[r]?n.push(e.shape[r]):n.push(t[r]);return n}return t}(a,n),o=1-t,i=rt(er(Object(tt.add)(la(s,0,1,"float32",r),o)),o);return Object(at.mul)(a,i)}});function hs(e){return Math.floor(Math.pow(2,Math.ceil(Math.log(e)/Math.log(2))))}function ms(e,t,n){const r=1-e%2,a=new Float32Array(e);for(let s=0;s<e;++s){const o=2*Math.PI*s/(e+r-1);a[s]=t-n*Math.cos(o)}return Object(Ha.tensor1d)(a,"float32")}const bs=async function(e,t,n=1){const r=Object(W.a)(e,"predictions","inTopK"),a=Object(W.a)(t,"targets","inTopK");Object(_.c)(r.rank>1,(()=>`inTopK() expects the predictions to be of rank 2 or higher, but got ${r.rank}`)),Object(_.c)(r.rank-1===a.rank,(()=>`predictions rank should be 1 larger than targets rank, but got predictions rank ${r.rank} and targets rank ${a.rank}`)),Object(_.f)(r.shape.slice(0,r.shape.length-1),a.shape,"predictions's shape should be align with the targets' shape, except the last dimension.");const s=r.shape[r.shape.length-1];Object(_.c)(n>0&&n<=s,(()=>`'k' passed to inTopK() must be > 0 && <= the predictions last dimension (${s}), but got ${n}`));const o=await r.data(),i=await a.data(),[u,c]=[o.length/s,s],l=Object(_.p)("bool",u);for(let e=0;e<u;e++){const t=e*c,r=o.subarray(t,t+c),a=[];for(let e=0;e<r.length;e++)a.push({value:r[e],index:e});a.sort(((e,t)=>t.value-e.value)),l[e]=0;for(let t=0;t<n;t++)if(a[t].index===i[e]){l[e]=1;break}}return e!==r&&r.dispose(),t!==a&&a.dispose(),Object(qa.a)(l,a.shape,"bool")};var gs=n(88),ys=n(87),ws=n(86);const Os=Object(H.b)({hammingWindow_:function(e){return ms(e,.54,.46)}});const vs=Object(H.b)({hannWindow_:function(e){return ms(e,.5,.5)}});const js=Object(H.b)({frame_:function(e,t,n,r=!1,a=0){let s=0;const o=[];for(;s+t<=e.size;)o.push(Ut(e,s,t)),s+=n;if(r)for(;s<e.size;){const r=s+t-e.size,i=Object(zt.concat)([Ut(e,s,t-r),pt([r],a)]);o.push(i),s+=n}return 0===o.length?Ka([],[0,t]):Object(Bt.reshape)(Object(zt.concat)(o),[o.length,t])}});const _s=Object(H.b)({stft_:function(e,t,n,r,a=vs){null==r&&(r=hs(t));const s=js(e,t,n),o=Object(at.mul)(s,a(t));return Ba(o,r)}});const xs=Object(H.b)({cropAndResize_:function(e,t,n,r,a="bilinear",s=0){const o=Object(W.a)(e,"image","cropAndResize"),i=Object(W.a)(t,"boxes","cropAndResize","float32"),u=Object(W.a)(n,"boxInd","cropAndResize","int32"),c=i.shape[0];_.c(4===o.rank,(()=>`Error in cropAndResize: image must be rank 4,but got rank ${o.rank}.`)),_.c(2===i.rank&&4===i.shape[1],(()=>`Error in cropAndResize: boxes must be have size [${c},4] but had shape ${i.shape}.`)),_.c(1===u.rank&&u.shape[0]===c,(()=>`Error in cropAndResize: boxInd must be have size [${c}] but had shape ${i.shape}.`)),_.c(2===r.length,(()=>`Error in cropAndResize: cropSize must be of length 2, but got length ${r.length}.`)),_.c(r[0]>=1&&r[1]>=1,(()=>`cropSize must be atleast [1,1], but was ${r}`)),_.c("bilinear"===a||"nearest"===a,(()=>`method must be bilinear or nearest, but was ${a}`));const l={image:o,boxes:i,boxInd:u},d={method:a,extrapolationValue:s,cropSize:r};return G.a.runKernel(q.M,l,d)}});const Ss=Object(H.b)({flipLeftRight_:function(e){const t=Object(W.a)(e,"image","flipLeftRight","float32");_.c(4===t.rank,(()=>`Error in flipLeftRight: image must be rank 4,but got rank ${t.rank}.`));const n={image:t};return G.a.runKernel(q.jb,n,{})}});const ks=Object(H.b)({grayscaleToRGB_:function(e){const t=Object(W.a)(e,"image","grayscaleToRGB"),n=t.rank-1,r=t.shape[n];_.c(t.rank>=2,(()=>`Error in grayscaleToRGB: images must be at least rank 2, but got rank ${t.rank}.`)),_.c(1===r,(()=>`Error in grayscaleToRGB: last dimension of a grayscale image should be size 1, but got size ${r}.`));const a=new Array(t.rank);return a.fill(1,0,n),a[n]=3,Zn(t,a)}});const Es=Object(H.b)({rgbToGrayscale_:function(e){const t=Object(W.a)(e,"image","RGBToGrayscale"),n=t.rank-1,r=t.shape[n];_.c(t.rank>=2,(()=>`Error in RGBToGrayscale: images must be at least rank 2, but got rank ${t.rank}.`)),_.c(3===r,(()=>`Error in RGBToGrayscale: last dimension of an RGB image should be size 3, but got size ${r}.`));const a=t.dtype,s=Object(U.a)(t,"float32"),o=Object(Ha.tensor1d)([.2989,.587,.114]);let i;switch(t.rank){case 2:i=Mn("ij,j->i",s,o);break;case 3:i=Mn("ijk,k->ij",s,o);break;case 4:i=Mn("ijkl,l->ijk",s,o);break;case 5:i=Mn("ijklm,m->ijkl",s,o);break;case 6:i=Mn("ijklmn,n->ijklm",s,o);break;default:throw new Error("Not a valid tensor rank.")}return i=Jn(i,-1),Object(U.a)(i,a)}});const Ts=Object(H.b)({rotateWithOffset_:function(e,t,n=0,r=.5){const a=Object(W.a)(e,"image","rotateWithOffset","float32");_.c(4===a.rank,(()=>`Error in rotateWithOffset: image must be rank 4,but got rank ${a.rank}.`));const s={image:a},o={radians:t,fillValue:n,center:r};return G.a.runKernel(q.Fc,s,o)}});function Ns(e,t,n,r,a,s){null==r&&(r=.5),null==a&&(a=Number.NEGATIVE_INFINITY),null==s&&(s=0);const o=e.shape[0];return n=Math.min(n,o),_.c(0<=r&&r<=1,(()=>`iouThreshold must be in [0, 1], but was '${r}'`)),_.c(2===e.rank,(()=>`boxes must be a 2D tensor, but was of rank '${e.rank}'`)),_.c(4===e.shape[1],(()=>`boxes must have 4 columns, but 2nd dimension was ${e.shape[1]}`)),_.c(1===t.rank,(()=>"scores must be a 1D tensor")),_.c(t.shape[0]===o,(()=>`scores has incompatible shape with boxes. Expected ${o}, but was ${t.shape[0]}`)),_.c(0<=s&&s<=1,(()=>`softNmsSigma must be in [0, 1], but was '${s}'`)),{maxOutputSize:n,iouThreshold:r,scoreThreshold:a,softNmsSigma:s}}const As=Object(H.b)({nonMaxSuppression_:function(e,t,n,r=.5,a=Number.NEGATIVE_INFINITY){const s=Object(W.a)(e,"boxes","nonMaxSuppression","float32"),o=Object(W.a)(t,"scores","nonMaxSuppression","float32"),i=Ns(s,o,n,r,a),u={maxOutputSize:n=i.maxOutputSize,iouThreshold:r=i.iouThreshold,scoreThreshold:a=i.scoreThreshold};return G.a.runKernel(q.ec,{boxes:s,scores:o},u)}});function Ms(e,t,n){const r=function(e,t,n){return function(e,t,n){let r=0,a=e.length,s=0,o=!1;for(;r<a;){s=r+(a-r>>>1);const i=n(t,e[s]);i>0?r=s+1:(a=s,o=!i)}return o?r:-r-1}(e,t,n||Is)}(e,t,n),a=r<0?-(r+1):r;e.splice(a,0,t)}function Is(e,t){return e>t?1:e<t?-1:0}function Ds(e,t,n,r,a){return Rs(e,t,n,r,a,0)}function $s(e,t,n,r,a,s){return Rs(e,t,n,r,a,0,!1,s,!0)}function Cs(e,t,n,r,a,s){return Rs(e,t,n,r,a,s,!0)}function Rs(e,t,n,r,a,s,o=!1,i=!1,u=!1){const c=[];for(let e=0;e<t.length;e++)t[e]>a&&c.push({score:t[e],boxIndex:e,suppressBeginIndex:0});c.sort(Bs);const l=s>0?-.5/s:0,d=[],p=[];for(;d.length<n&&c.length>0;){const t=c.pop(),{score:n,boxIndex:s,suppressBeginIndex:o}=t;if(n<a)break;let i=!1;for(let n=d.length-1;n>=o;--n){const o=Ps(e,s,d[n]);if(o>=r){i=!0;break}if(t.score=t.score*Fs(r,l,o),t.score<=a)break}t.suppressBeginIndex=d.length,i||(t.score===n?(d.push(s),p.push(t.score)):t.score>a&&Ms(c,t,Bs))}const f=d.length,h=n-f;i&&h>0&&(d.push(...new Array(h).fill(0)),p.push(...new Array(h).fill(0)));const m={selectedIndices:d};return o&&(m.selectedScores=p),u&&(m.validOutputs=f),m}function Ps(e,t,n){const r=e.subarray(4*t,4*t+4),a=e.subarray(4*n,4*n+4),s=Math.min(r[0],r[2]),o=Math.min(r[1],r[3]),i=Math.max(r[0],r[2]),u=Math.max(r[1],r[3]),c=Math.min(a[0],a[2]),l=Math.min(a[1],a[3]),d=Math.max(a[0],a[2]),p=Math.max(a[1],a[3]),f=(i-s)*(u-o),h=(d-c)*(p-l);if(f<=0||h<=0)return 0;const m=Math.max(s,c),b=Math.max(o,l),g=Math.min(i,d),y=Math.min(u,p),w=Math.max(g-m,0)*Math.max(y-b,0);return w/(f+h-w)}function Fs(e,t,n){const r=Math.exp(t*n*n);return n<=e?r:0}function Bs(e,t){return e.score-t.score||e.score===t.score&&t.boxIndex-e.boxIndex}const Ls=async function(e,t,n,r=.5,a=Number.NEGATIVE_INFINITY){const s=Object(W.a)(e,"boxes","nonMaxSuppressionAsync"),o=Object(W.a)(t,"scores","nonMaxSuppressionAsync"),i=Ns(s,o,n,r,a);n=i.maxOutputSize,r=i.iouThreshold,a=i.scoreThreshold;const u=await Promise.all([s.data(),o.data()]),c=u[0],l=u[1],{selectedIndices:d}=Ds(c,l,n,r,a);return s!==e&&s.dispose(),o!==t&&o.dispose(),Object(Ha.tensor1d)(d,"int32")};const zs=Object(H.b)({nonMaxSuppressionWithScore_:function(e,t,n,r=.5,a=Number.NEGATIVE_INFINITY,s=0){const o=Object(W.a)(e,"boxes","nonMaxSuppression"),i=Object(W.a)(t,"scores","nonMaxSuppression"),u=Ns(o,i,n,r,a,s),c={boxes:o,scores:i},l={maxOutputSize:n=u.maxOutputSize,iouThreshold:r=u.iouThreshold,scoreThreshold:a=u.scoreThreshold,softNmsSigma:s=u.softNmsSigma},d=G.a.runKernel(q.gc,c,l);return{selectedIndices:d[0],selectedScores:d[1]}}});const Ws=async function(e,t,n,r=.5,a=Number.NEGATIVE_INFINITY,s=0){const o=Object(W.a)(e,"boxes","nonMaxSuppressionAsync"),i=Object(W.a)(t,"scores","nonMaxSuppressionAsync"),u=Ns(o,i,n,r,a,s);n=u.maxOutputSize,r=u.iouThreshold,a=u.scoreThreshold,s=u.softNmsSigma;const c=await Promise.all([o.data(),i.data()]),l=c[0],d=c[1],{selectedIndices:p,selectedScores:f}=Cs(l,d,n,r,a,s);return o!==e&&o.dispose(),i!==t&&i.dispose(),{selectedIndices:Object(Ha.tensor1d)(p,"int32"),selectedScores:Object(Ha.tensor1d)(f)}};const Us=Object(H.b)({nonMaxSuppressionPadded_:function(e,t,n,r=.5,a=Number.NEGATIVE_INFINITY,s=!1){const o=Object(W.a)(e,"boxes","nonMaxSuppression"),i=Object(W.a)(t,"scores","nonMaxSuppression"),u=Ns(o,i,n,r,a,null),c={boxes:o,scores:i},l={maxOutputSize:u.maxOutputSize,iouThreshold:u.iouThreshold,scoreThreshold:u.scoreThreshold,padToMaxOutputSize:s},d=G.a.runKernel(q.fc,c,l);return{selectedIndices:d[0],validOutputs:d[1]}}});const Vs=async function(e,t,n,r=.5,a=Number.NEGATIVE_INFINITY,s=!1){const o=Object(W.a)(e,"boxes","nonMaxSuppressionAsync"),i=Object(W.a)(t,"scores","nonMaxSuppressionAsync"),u=Ns(o,i,n,r,a,null),c=u.maxOutputSize,l=u.iouThreshold,d=u.scoreThreshold,[p,f]=await Promise.all([o.data(),i.data()]),{selectedIndices:h,validOutputs:m}=$s(p,f,c,l,d,s);return o!==e&&o.dispose(),i!==t&&i.dispose(),{selectedIndices:Object(Ha.tensor1d)(h,"int32"),validOutputs:ct(m,"int32")}};const Gs=Object(H.b)({resizeBilinear_:function(e,t,n=!1,r=!1){const a=Object(W.a)(e,"images","resizeBilinear");_.c(3===a.rank||4===a.rank,(()=>`Error in resizeBilinear: x must be rank 3 or 4, but got rank ${a.rank}.`)),_.c(2===t.length,(()=>`Error in resizeBilinear: new shape must 2D, but got shape ${t}.`)),_.c(!1===r||!1===n,(()=>"Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false."));let s=a,o=!1;3===a.rank&&(o=!0,s=Object(Bt.reshape)(a,[1,a.shape[0],a.shape[1],a.shape[2]]));const[]=t,i={images:s},u={alignCorners:n,halfPixelCenters:r,size:t},c=G.a.runKernel(q.Ac,i,u);return o?Object(Bt.reshape)(c,[c.shape[1],c.shape[2],c.shape[3]]):c}});const qs=Object(H.b)({resizeNearestNeighbor_:function(e,t,n=!1,r=!1){const a=Object(W.a)(e,"images","resizeNearestNeighbor");_.c(3===a.rank||4===a.rank,(()=>`Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank ${a.rank}.`)),_.c(2===t.length,(()=>`Error in resizeNearestNeighbor: new shape must 2D, but got shape ${t}.`)),_.c("float32"===a.dtype||"int32"===a.dtype,(()=>"`images` must have `int32` or `float32` as dtype")),_.c(!1===r||!1===n,(()=>"Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false."));let s=a,o=!1;3===a.rank&&(o=!0,s=Object(Bt.reshape)(a,[1,a.shape[0],a.shape[1],a.shape[2]]));const[]=t,i={images:s},u={alignCorners:n,halfPixelCenters:r,size:t},c=G.a.runKernel(q.Cc,i,u);return o?Object(Bt.reshape)(c,[c.shape[1],c.shape[2],c.shape[3]]):c}});const Hs=Object(H.b)({threshold_:function(e,t="binary",n=!1,r=.5){const a=Object(W.a)(e,"image","threshold"),s=a.shape[0]*a.shape[1];let o,i,u,c,l=Object(at.mul)(Object(Ha.tensor1d)([r]),255);if(_.c(3===a.rank,(()=>`Error in threshold: image must be rank 3,but got rank ${a.rank}.`)),_.c(3===a.shape[2]||1===a.shape[2],(()=>`Error in threshold: image color channel must be equal to 3 or 1but got ${a.shape[2]}.`)),_.c("int32"===a.dtype||"float32"===a.dtype,(()=>`Error in dtype: image dtype must be int32 or float32,but got dtype ${a.dtype}.`)),_.c("otsu"===t||"binary"===t,(()=>`Method must be binary or otsu, but was ${t}`)),3===a.shape[2]){[o,i,u]=Fa(a,[1,1,1],-1);const e=Object(at.mul)(o,.2989),t=Object(at.mul)(i,.587),n=Object(at.mul)(u,.114);c=Object(tt.add)(Object(tt.add)(e,t),n)}else c=e;if("otsu"===t){l=function(e,t){let n,r,a,s,o,i,u=Object(Ha.tensor1d)([-1]),c=Object(Ha.tensor1d)([0]),l=Object(Ha.tensor1d)([0]);for(let d=0;d<e.size-1;d++){n=Ut(e,0,d+1),r=Ut(e,d+1),o=rt(Object(Gn.a)(n),t),i=rt(Object(Gn.a)(r),t);const p=Object(Gn.a)(Object(at.mul)(n,pa(0,n.size)));a=rt(p,Object(Gn.a)(n));const f=pt(r.shape,n.size),h=Object(tt.add)(pa(0,r.size),f),m=Object(at.mul)(r,h);s=rt(Object(Gn.a)(m),Object(Gn.a)(r));const b=mt(a,s),g=mt(a,s),y=Object(at.mul)(o,i);l=Object(at.mul)(Object(at.mul)(y,b),g);const w=nr(l,c);c=Tn(w,l,c),u=Tn(w,Object(Ha.tensor1d)([d]),u)}return u}(Xt(Object(U.a)(ja(c),"int32"),Object(qa.a)([]),256),s)}const d=n?lr(c,l):nr(c,l);return Object(U.a)(Object(at.mul)(d,255),"int32")}});const Ks=Object(H.b)({transform_:function(e,t,n="nearest",r="constant",a=0,s){const o=Object(W.a)(e,"image","transform","float32"),i=Object(W.a)(t,"transforms","transform","float32");_.c(4===o.rank,(()=>`Error in transform: image must be rank 4,but got rank ${o.rank}.`)),_.c(2===i.rank&&(i.shape[0]===o.shape[0]||1===i.shape[0])&&8===i.shape[1],(()=>"Error in transform: Input transform should be batch x 8 or 1 x 8")),_.c(null==s||2===s.length,(()=>`Error in transform: outputShape must be [height, width] or null, but got ${s}.`));const u={image:o,transforms:i},c={interpolation:n,fillMode:r,fillValue:a,outputShape:s};return G.a.runKernel(q.qd,u,c)}});const Ys=Object(H.b)({bandPart_:function(e,t,n){const r=Object(W.a)(e,"a","bandPart");Object(_.c)(r.rank>=2,(()=>`bandPart(): Rank must be at least 2, got ${r.rank}.`));const a=r.shape,[s,o]=r.shape.slice(-2);let i,u;"number"==typeof t?(Object(_.c)(t%1==0,(()=>`bandPart(): numLower must be an integer, got ${t}.`)),Object(_.c)(t<=s,(()=>`bandPart(): numLower (${t}) must not be greater than the number of rows (${s}).`)),i=Object(W.a)(t<0?s:t,"numLower","bandPart")):(Object(_.c)("int32"===t.dtype,(()=>"bandPart(): numLower's dtype must be an int32.")),i=Tn(cr(t,0),s,Object($r.minimum)(t,s))),"number"==typeof n?(Object(_.c)(n%1==0,(()=>`bandPart(): numUpper must be an integer, got ${n}.`)),Object(_.c)(n<=o,(()=>`bandPart(): numUpper (${n}) must not be greater than the number of columns (${o}).`)),u=Object(W.a)(n<0?o:n,"numUpper","bandPart")):(Object(_.c)("int32"===n.dtype,(()=>"bandPart(): numUpper's dtype must be an int32.")),u=Tn(cr(n,0),o,Object($r.minimum)(n,o)));const c=Object(Bt.reshape)(pa(0,s,1,"int32"),[-1,1]),l=pa(0,o,1,"int32"),d=mt(c,l),p=Or(lr(d,i),rr(d,Object(mr.a)(u))),f=Mr([s,o],r.dtype);return Object(Bt.reshape)(Object(Wa.stack)(rs(Object(Bt.reshape)(r,[-1,s,o])).map((e=>Tn(p,e,f)))),a)}});const Js=Object(H.b)({gramSchmidt_:function(e){let t;if(Array.isArray(e)){t=!1,Object(_.c)(null!=e&&e.length>0,(()=>"Gram-Schmidt process: input must not be null, undefined, or empty"));const n=e[0].shape[0];for(let t=1;t<e.length;++t)Object(_.c)(e[t].shape[0]===n,(()=>`Gram-Schmidt: Non-unique lengths found in the input vectors: (${e[t].shape[0]} vs. ${n})`))}else t=!0,e=Fa(e,e.shape[0],0).map((e=>Object(za.squeeze)(e,[0])));Object(_.c)(e.length<=e[0].shape[0],(()=>`Gram-Schmidt: Number of vectors (${e.length}) exceeds number of dimensions (${e[0].shape[0]}).`));const n=[],r=e;for(let t=0;t<e.length;++t)n.push(G.a.tidy((()=>{let e=r[t];if(t>0)for(let r=0;r<t;++r){const t=Object(at.mul)(Object(Gn.a)(Object(at.mul)(n[r],e)),n[r]);e=mt(e,t)}return rt(e,Hn(e,"euclidean"))})));return t?Object(Wa.stack)(n,0):n}});function Xs(e,t=!1){return G.a.tidy((()=>{Object(_.c)(2===e.shape.length,(()=>`qr2d() requires a 2D Tensor, but got a ${e.shape.length}D Tensor.`));const n=e.shape[0],r=e.shape[1];let a=Qn(n),s=Object(en.a)(e);const o=Ka([[1]],[1,1]);let i=Object(en.a)(o);const u=n>=r?r:n;for(let e=0;e<u;++e){const t=s,u=i,c=a;[i,s,a]=G.a.tidy((()=>{const t=Ut(s,[e,e],[n-e,1]),u=Hn(t),c=Ut(s,[e,e],[1,1]),l=Tn(nr(c,0),Ka([[-1]]),Ka([[1]])),d=mt(c,Object(at.mul)(l,u)),p=rt(t,d);i=1===p.shape[0]?Object(en.a)(o):Object(zt.concat)([o,Ut(p,[1,0],[p.shape[0]-1,p.shape[1]])],0);const f=Object(mr.a)(rt(Object(V.a)(l,d),u)),h=Ut(s,[e,0],[n-e,r]),m=Object(at.mul)(f,i),b=Object(Y.transpose)(i);if(0===e)s=mt(h,Object(V.a)(m,Object(V.a)(b,h)));else{const t=mt(h,Object(V.a)(m,Object(V.a)(b,h)));s=Object(zt.concat)([Ut(s,[0,0],[e,r]),t],0)}const g=Object(Y.transpose)(m),y=Ut(a,[0,e],[n,a.shape[1]-e]);if(0===e)a=mt(y,Object(V.a)(Object(V.a)(y,i),g));else{const t=mt(y,Object(V.a)(Object(V.a)(y,i),g));a=Object(zt.concat)([Ut(a,[0,0],[n,e]),t],1)}return[i,s,a]})),Object(et.d)([t,u,c])}return!t&&n>r&&(a=Ut(a,[0,0],[n,r]),s=Ut(s,[0,0],[r,r])),[a,s]}))}const Zs=Object(H.b)({qr_:function(e,t=!1){if(Object(_.c)(e.rank>=2,(()=>`qr() requires input tensor to have a rank >= 2, but got rank ${e.rank}`)),2===e.rank)return Xs(e,t);{const n=e.shape.slice(0,e.shape.length-2).reduce(((e,t)=>e*t)),r=rs(Object(Bt.reshape)(e,[n,e.shape[e.shape.length-2],e.shape[e.shape.length-1]]),0),a=[],s=[];r.forEach((e=>{const[n,r]=Xs(e,t);a.push(n),s.push(r)}));return[Object(Bt.reshape)(Object(Wa.stack)(a,0),e.shape),Object(Bt.reshape)(Object(Wa.stack)(s,0),e.shape)]}}});var Qs;!function(e){e[e.NONE=0]="NONE",e[e.MEAN=1]="MEAN",e[e.SUM=2]="SUM",e[e.SUM_BY_NONZERO_WEIGHTS=3]="SUM_BY_NONZERO_WEIGHTS"}(Qs||(Qs={}));const eo=Object(H.b)({computeWeightedLoss_:function(e,t,n=Qs.SUM_BY_NONZERO_WEIGHTS){const r=Object(W.a)(e,"losses","computeWeightedLoss");let a=null;null!=t&&(a=Object(W.a)(t,"weights","computeWeightedLoss"));const s=null==a?r:Object(at.mul)(r,a);if(n===Qs.NONE)return s;if(n===Qs.SUM)return Object(Gn.a)(s);if(n===Qs.MEAN){if(null==a)return Object(Ar.mean)(s);{const e=r.size/a.size,t=rt(Object(Gn.a)(s),Object(Gn.a)(a));return e>1?rt(t,ct(e)):t}}if(n===Qs.SUM_BY_NONZERO_WEIGHTS){if(null==a)return rt(Object(Gn.a)(s),ct(r.size));{const e=Object(at.mul)(a,Ir(r.shape)),t=Object(U.a)(Object(Gn.a)(Lr(e,ct(0))),"float32");return rt(Object(Gn.a)(s),t)}}throw Error(`Unknown reduction: ${n}`)}});const to=Object(H.b)({absoluteDifference_:function(e,t,n,r=Qs.SUM_BY_NONZERO_WEIGHTS){const a=Object(W.a)(e,"labels","absoluteDifference"),s=Object(W.a)(t,"predictions","absoluteDifference");let o=null;null!=n&&(o=Object(W.a)(n,"weights","absoluteDifference")),Object(_.f)(a.shape,s.shape,"Error in absoluteDifference: ");const i=gt(mt(a,s));return eo(i,o,r)}});const no=Object(H.b)({cosineDistance_:function(e,t,n,r,a=Qs.SUM_BY_NONZERO_WEIGHTS){const s=Object(W.a)(e,"labels","cosineDistance"),o=Object(W.a)(t,"predictions","cosineDistance");let i=null;null!=r&&(i=Object(W.a)(r,"weights","cosineDistance")),Object(_.f)(s.shape,o.shape,"Error in cosineDistance: ");const u=ct(1),c=mt(u,Object(Gn.a)(Object(at.mul)(s,o),n,!0));return eo(c,i,a)}});const ro=Object(H.b)({hingeLoss_:function(e,t,n,r=Qs.SUM_BY_NONZERO_WEIGHTS){let a=Object(W.a)(e,"labels","hingeLoss");const s=Object(W.a)(t,"predictions","hingeLoss");let o=null;null!=n&&(o=Object(W.a)(n,"weights","hingeLoss")),Object(_.f)(a.shape,s.shape,"Error in hingeLoss: ");const i=ct(1);a=mt(Object(at.mul)(ct(2),a),i);const u=Object(ma.relu)(mt(i,Object(at.mul)(a,s)));return eo(u,o,r)}});const ao=Object(H.b)({huberLoss_:function(e,t,n,r=1,a=Qs.SUM_BY_NONZERO_WEIGHTS){const s=Object(W.a)(e,"labels","huberLoss"),o=Object(W.a)(t,"predictions","huberLoss");let i=null;null!=n&&(i=Object(W.a)(n,"weights","huberLoss")),Object(_.f)(s.shape,o.shape,"Error in huberLoss: ");const u=ct(r),c=gt(mt(o,s)),l=Object($r.minimum)(c,u),d=mt(c,l),p=Object(tt.add)(Object(at.mul)(ct(.5),ot(l)),Object(at.mul)(u,d));return eo(p,i,a)}});const so=Object(H.b)({logLoss_:function(e,t,n,r=1e-7,a=Qs.SUM_BY_NONZERO_WEIGHTS){const s=Object(W.a)(e,"labels","logLoss"),o=Object(W.a)(t,"predictions","logLoss");let i=null;null!=n&&(i=Object(W.a)(n,"weights","logLoss")),Object(_.f)(s.shape,o.shape,"Error in logLoss: ");const u=ct(1),c=ct(r),l=Object(mr.a)(Object(at.mul)(s,fr(Object(tt.add)(o,c)))),d=Object(at.mul)(mt(u,s),fr(Object(tt.add)(mt(u,o),c))),p=mt(l,d);return eo(p,i,a)}});const oo=Object(H.b)({meanSquaredError_:function(e,t,n,r=Qs.SUM_BY_NONZERO_WEIGHTS){const a=Object(W.a)(e,"labels","meanSquaredError"),s=Object(W.a)(t,"predictions","meanSquaredError");let o=null;null!=n&&(o=Object(W.a)(n,"weights","meanSquaredError")),Object(_.f)(a.shape,s.shape,"Error in meanSquaredError: ");const i=La(a,s);return eo(i,o,r)}});const io=Object(H.b)({sigmoidCrossEntropy_:function(e,t,n,r=0,a=Qs.SUM_BY_NONZERO_WEIGHTS){let s=Object(W.a)(e,"multiClassLabels","sigmoidCrossEntropy");const o=Object(W.a)(t,"logits","sigmoidCrossEntropy");let i=null;if(null!=n&&(i=Object(W.a)(n,"weights","sigmoidCrossEntropy")),Object(_.f)(s.shape,o.shape,"Error in sigmoidCrossEntropy: "),r>0){const e=ct(r),t=ct(1),n=ct(.5);s=Object(tt.add)(Object(at.mul)(s,mt(t,e)),Object(at.mul)(n,e))}const u=function(e,t){const n=Object(W.a)(e,"labels","sigmoidCrossEntropyWithLogits"),r=Object(W.a)(t,"logits","sigmoidCrossEntropyWithLogits");Object(_.f)(n.shape,r.shape,"Error in sigmoidCrossEntropyWithLogits: ");const a=Object(ma.relu)(r),s=Object(at.mul)(r,n),o=hr(Yn(Object(mr.a)(gt(r))));return Object(tt.add)(mt(a,s),o)}(s,o);return eo(u,i,a)}});const uo=Object(H.b)({softmaxCrossEntropy_:function(e,t,n,r=0,a=Qs.SUM_BY_NONZERO_WEIGHTS){let s=Object(W.a)(e,"onehotLabels","softmaxCrossEntropy");const o=Object(W.a)(t,"logits","softmaxCrossEntropy");let i=null;if(null!=n&&(i=Object(W.a)(n,"weights","softmaxCrossEntropy")),Object(_.f)(s.shape,o.shape,"Error in softmaxCrossEntropy: "),r>0){const e=ct(r),t=ct(1),n=ct(s.shape[1]);s=Object(tt.add)(Object(at.mul)(s,mt(t,e)),rt(e,n))}const u=function(e,t,n=-1){if(-1===n&&(n=t.rank-1),n!==t.rank-1)throw Error(`Softmax cross entropy along a non-last dimension is not yet supported. Labels / logits was rank ${t.rank} and dim was ${n}`);const r=Object(ut.a)(((e,t,r)=>{const a=wr(t,[n],!0),s=mt(Object(U.a)(t,"float32"),a);r([e,s]);const o=Object(mr.a)(Object(at.mul)(s,e));return{value:Object(Gn.a)(o,[n]),gradFunc:(e,t)=>{const[r,a]=t,s=Fn(e.shape,[n]);return[Object(at.mul)(Object(Bt.reshape)(e,s),mt(Object(U.a)(r,"float32"),Yn(a))),Object(at.mul)(Object(Bt.reshape)(e,s),mt(Yn(a),Object(U.a)(r,"float32")))]}}}));return r(e,t)}(s,o);return eo(u,i,a)}});const co={fft:Ca,ifft:Ra,rfft:Ba,irfft:Pa},lo={hammingWindow:Os,hannWindow:vs,frame:js,stft:_s},po={flipLeftRight:Ss,grayscaleToRGB:ks,resizeNearestNeighbor:qs,resizeBilinear:Gs,rgbToGrayscale:Es,rotateWithOffset:Ts,cropAndResize:xs,nonMaxSuppression:As,nonMaxSuppressionAsync:Ls,nonMaxSuppressionWithScore:zs,nonMaxSuppressionWithScoreAsync:Ws,nonMaxSuppressionPadded:Us,nonMaxSuppressionPaddedAsync:Vs,threshold:Hs,transform:Ks},fo={bandPart:Ys,gramSchmidt:Js,qr:Zs},ho={absoluteDifference:to,computeWeightedLoss:eo,cosineDistance:no,hingeLoss:ro,huberLoss:ao,logLoss:so,meanSquaredError:oo,sigmoidCrossEntropy:io,softmaxCrossEntropy:uo},mo={sparseFillEmptyRows:Object(H.b)({sparseFillEmptyRows_:function(e,t,n,r){const a=Object(W.a)(e,"indices","sparseFillEmptyRows","int32"),s=Object(W.a)(t,"values","sparseFillEmptyRows"),o=Object(W.a)(n,"denseShape","sparseFillEmptyRows","int32"),i=Object(W.a)(r,"defaultValue","sparseFillEmptyRows",s.dtype);if(2!==a.rank)throw new Error(`Indices should be Tensor2D but received shape\n ${a.shape}`);if(1!==s.rank)throw new Error(`Values should be Tensor1D but received shape ${s.shape}`);if(1!==o.rank)throw new Error(`Dense shape should be Tensor1D but received shape ${o.shape}`);if(0!==i.rank)throw new Error(`Default value should be a scalar but received shape ${i.shape}`);const u={indices:a,values:s,denseShape:o,defaultValue:i},c=G.a.runKernel(q.Uc,u);return{outputIndices:c[0],outputValues:c[1],emptyRowIndicator:c[2],reverseIndexMap:c[3]}}}),sparseReshape:Object(H.b)({sparseReshape_:function(e,t,n){const r=Object(W.a)(e,"inputIndices","sparseReshape","int32"),a=Object(W.a)(t,"inputShape","sparseReshape","int32"),s=Object(W.a)(n,"newShape","sparseReshape","int32");if(2!==r.rank)throw new Error(`Input indices should be Tensor2D but received shape\n ${r.shape}`);if(1!==a.rank)throw new Error(`Input shape should be Tensor1D but received shape ${a.shape}`);if(1!==s.rank)throw new Error(`New shape should be Tensor1D but received shape ${s.shape}`);const o={inputIndices:r,inputShape:a,newShape:s},i=G.a.runKernel(q.Vc,o);return{outputIndices:i[0],outputShape:i[1]}}}),sparseSegmentMean:Object(H.b)({sparseSegmentMean_:function(e,t,n){const r=Object(W.a)(e,"data","sparseSegmentMean"),a=Object(W.a)(t,"indices","sparseSegmentMean","int32"),s=Object(W.a)(n,"segmentIds","sparseSegmentMean","int32");if(r.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==a.rank)throw new Error(`Indices should be Tensor1D but received shape\n ${a.shape}`);if(1!==s.rank)throw new Error(`Segment ids should be Tensor1D but received shape\n ${s.shape}`);const o={data:r,indices:a,segmentIds:s};return G.a.runKernel(q.Wc,o)}}),sparseSegmentSum:Object(H.b)({sparseSegmentSum_:function(e,t,n){const r=Object(W.a)(e,"data","sparseSegmentSum"),a=Object(W.a)(t,"indices","sparseSegmentSum","int32"),s=Object(W.a)(n,"segmentIds","sparseSegmentSum","int32");if(r.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==a.rank)throw new Error(`Indices should be Tensor1D but received shape\n ${a.shape}`);if(1!==s.rank)throw new Error(`Segment ids should be Tensor1D but received shape\n ${s.shape}`);const o={data:r,indices:a,segmentIds:s};return G.a.runKernel(q.Xc,o)}})},bo={stringNGrams:Object(H.b)({stringNGrams_:function(e,t,n,r,a,s,o,i){const u=Object(W.a)(e,"data","stringNGrams","string");if("string"!==u.dtype)throw new Error("Data must be of datatype string");if(1!==u.shape.length)throw new Error(`Data must be a vector, saw: ${u.shape}`);const c=Object(W.a)(t,"dataSplits","stringNGrams");if("int32"!==c.dtype)throw new Error("Data splits must be of datatype int32");const l={separator:n,nGramWidths:r,leftPad:a,rightPad:s,padWidth:o,preserveShortSequences:i},d={data:u,dataSplits:c},p=G.a.runKernel(q.gd,d,l);return{nGrams:p[0],nGramsSplits:p[1]}}}),stringSplit:Object(H.b)({stringSplit_:function(e,t,n=!0){const r=Object(W.a)(e,"input","stringSplit","string"),a=Object(W.a)(t,"delimiter","stringSplit","string");if(1!==r.rank)throw new Error(`Input should be Tensor1D but received shape ${r.shape}`);if(0!==a.rank)throw new Error(`Delimiter should be a scalar but received shape ${a.shape}`);const s={skipEmpty:n},o={input:r,delimiter:a},i=G.a.runKernel(q.hd,o,s);return{indices:i[0],values:i[1],shape:i[2]}}}),stringToHashBucketFast:Object(H.b)({stringToHashBucketFast_:function(e,t){const n=Object(W.a)(e,"input","stringToHashBucketFast","string"),r={numBuckets:t};if(t<=0)throw new Error("Number of buckets must be at least 1");const a={input:n};return G.a.runKernel(q.id,a,r)}}),staticRegexReplace:Object(H.b)({staticRegexReplace_:function(e,t,n,r=!0){const a=Object(W.a)(e,"input","staticRegexReplace","string"),s={pattern:t,rewrite:n,replaceGlobal:r};return G.a.runKernel(q.dd,{x:a},s)}})},go=_t;var yo=n(97);function wo(e,t){const n=e[0].length;e.forEach(((e,t)=>{_.c(e.length===n,(()=>`Error in concat${n}D: rank of tensors[${t}] must be the same as the rank of the rest (${n})`))})),_.c(t>=0&&t<n,(()=>`Error in concat${n}D: axis must be between 0 and ${n-1}.`));const r=e[0];e.forEach(((e,a)=>{for(let s=0;s<n;s++)_.c(s===t||e[s]===r[s],(()=>`Error in concat${n}D: Shape of tensors[${a}] (${e}) does not match the shape of the rest (${r}) along the non-concatenated axis ${a}.`))}))}function Oo(e,t){const n=e[0].slice();for(let r=1;r<e.length;r++)n[t]+=e[r][t];return n}var vo,jo=n(26);function _o(e,t,n){let r=new Array;if(null==n&&null==t)return r;if(null==t)for(;r.length<e+n.length;)r.push(-1);else r=t.slice();if(null==n)return r;if(e+n.length!==r.length)throw new Error(`rt input.shape and shape=${t} are incompatible: rt input.rank = ${e+n.length}, but shape.rank = ${r.length}`);for(let a=1;a<n.length;++a){const s=n[a],o=r[r.length-n.length+a],i=r[o];if(s>=0)if(i>=0){if(i!==s)throw new Error(`rt input.shape and shape=${t} are incompatible: rt input.shape[${a+e}] = ${s} but shape[${a+e}] = ${i}`)}else r[o]=s}return r}function xo(e){const t={FIRST_DIM_SIZE:vo.FIRST_DIM_SIZE,VALUE_ROWIDS:vo.VALUE_ROWIDS,ROW_LENGTHS:vo.ROW_LENGTHS,ROW_SPLITS:vo.ROW_SPLITS,ROW_LIMITS:vo.ROW_LIMITS,ROW_STARTS:vo.ROW_STARTS},n=[];for(const r of e){if(!(r in t))break;n.push(t[r])}return n}function So(e){return 0===e.length?0:e[0]===vo.FIRST_DIM_SIZE?e.length-1:e.length}function ko(e,t){if(null==e||null==t)return;const n=e.length,r=t.length;if(n>=r)throw new Error(`defaultValue.shape=${e} and ragged tensor flatValues.shape=${t}, are incompatible: defaultValue.rank = ${n} must be less than ragged tensor input flatValues.rank = ${r})`);for(let a=0;a<Math.min(n,r-1);++a){const n=e[a],r=t[a+1];if(n>=0&&r>=0&&1!==n&&n!==r)throw new Error(`defaultValue.shape=${e}, and ragged tensor input flatValues.shape=${t} are incompatible: defaultValue.shape[${a-e.length}] = ${n} but ragged tensor input.flatValues.shape[${a-e.length}] = ${r}`)}}!function(e){e[e.FIRST_DIM_SIZE=0]="FIRST_DIM_SIZE",e[e.VALUE_ROWIDS=1]="VALUE_ROWIDS",e[e.ROW_LENGTHS=2]="ROW_LENGTHS",e[e.ROW_SPLITS=3]="ROW_SPLITS",e[e.ROW_LIMITS=4]="ROW_LIMITS",e[e.ROW_STARTS=5]="ROW_STARTS"}(vo||(vo={}));const Eo=30;function To(e){return e<=Eo?e:Object(_.G)(e,Math.floor(Math.sqrt(e)))}function No(e,t,n){return[n*("number"==typeof e?e:e[0]),t*("number"==typeof e?e:e[1])]}function Ao(e,t,n,r=!0){let a=[];if(r)a=a.concat(t.slice(0)),a.push(e[0]/n),a=a.concat(e.slice(1));else{a=a.concat(e[0]);const n=t.length;for(let r=0;r<n;++r)a=a.concat([e[r+1]/t[r],t[r]]);a=a.concat(e.slice(n+1))}return a}function Mo(e,t,n=!0){const r=[];if(n){r.push(t);for(let n=t+1;n<e;++n)n<=2*t?(r.push(n),r.push(n-(t+1))):r.push(n)}else{const n=[],a=[];for(let r=1;r<e;++r)r>=2*t+1||r%2==1?a.push(r):n.push(r);r.push(...n),r.push(0),r.push(...a)}return r}function Io(e,t,n,r=!0){const a=[];r?a.push(e[0]/n):a.push(e[0]*n);for(let n=1;n<e.length;++n)n<=t.length?r?a.push(t[n-1]*e[n]):a.push(e[n]/t[n-1]):a.push(e[n]);return a}function Do(e,t){const n=[0];for(let r=0;r<t;++r)n.push(e[r][0]);return n}function $o(e,t,n){const r=e.slice(0,1);for(let a=0;a<n;++a)r.push(e[a+1]-t[a][0]-t[a][1]);return r}const Co=1.7580993408473768,Ro=1.0507009873554805,Po=.3275911,Fo=.254829592,Bo=-.284496736,Lo=1.421413741,zo=-1.453152027,Wo=1.061405429;var Uo=n(41);function Vo(e,t){if(e.length!==t.length)throw new Error(`Cannot merge real and imag arrays of different lengths. real:${e.length}, imag: ${t.length}.`);const n=new Float32Array(2*e.length);for(let r=0;r<n.length;r+=2)n[r]=e[r/2],n[r+1]=t[r/2];return n}function Go(e){const t=new Float32Array(e.length/2),n=new Float32Array(e.length/2);for(let r=0;r<e.length;r+=2)t[r/2]=e[r],n[r/2]=e[r+1];return{real:t,imag:n}}function qo(e){const t=Math.ceil(e.length/4),n=new Float32Array(t),r=new Float32Array(t);for(let t=0;t<e.length;t+=4)n[Math.floor(t/4)]=e[t],r[Math.floor(t/4)]=e[t+1];return{real:n,imag:r}}function Ho(e){const t=Math.floor(e.length/4),n=new Float32Array(t),r=new Float32Array(t);for(let t=2;t<e.length;t+=4)n[Math.floor(t/4)]=e[t],r[Math.floor(t/4)]=e[t+1];return{real:n,imag:r}}function Ko(e,t){return{real:e[2*t],imag:e[2*t+1]}}function Yo(e,t,n,r){e[2*r]=t,e[2*r+1]=n}function Jo(e,t){const n=new Float32Array(e/2),r=new Float32Array(e/2);for(let a=0;a<Math.ceil(e/2);a++){const s=(t?2:-2)*Math.PI*(a/e);n[a]=Math.cos(s),r[a]=Math.sin(s)}return{real:n,imag:r}}function Xo(e,t,n){const r=(n?2:-2)*Math.PI*(e/t);return{real:Math.cos(r),imag:Math.sin(r)}}const Zo="->",Qo=/->/g;function ei(e,t){const n=((e=e.replace(/\s/g,"")).length-e.replace(Qo,"").length)/Zo.length;if(n<1)throw new Error("Equations without an arrow are not supported.");if(n>1)throw new Error('Equation must contain exactly one arrow ("->").');const[r,a]=e.split(Zo);Object(_.c)(-1===r.indexOf("..."),(()=>'The ellipsis notation ("...") is not supported yet.'));const s=r.split(","),o=s.length;if(t!==o)throw new Error(`Expected ${o} input tensors, received ${t}`);if(o>2)throw new Error("Support for more than 2 input tensors is not implemented yet.");const i=[];for(let e=0;e<a.length;++e){const t=a[e];if(!s.some((e=>-1!==e.indexOf(t))))throw new Error(`Output subscripts contain the label ${t} not present in the input subscripts.`);-1===i.indexOf(t)&&i.push(t)}for(let e=0;e<r.length;++e){const t=r[e];-1===i.indexOf(t)&&","!==t&&i.push(t)}const u=new Array(s.length);for(let e=0;e<o;++e){if(new Set(s[e].split("")).size!==s[e].length)throw new Error(`Found duplicate axes in input component ${s[e]}. Support for duplicate axes in input is not implemented yet.`);u[e]=[];for(let t=0;t<s[e].length;++t)u[e].push(i.indexOf(s[e][t]))}const c=i.length,l=[];for(let e=a.length;e<c;++e)l.push(e);return{allDims:i,summedDims:l,idDims:u}}function ti(e,t){let n=new Array(e);n.fill(-1);for(let e=0;e<t.length;++e)n[t[e]]=e;const r=[];for(let t=0;t<e;++t)-1===n[t]&&r.push(t);return n=n.filter((e=>-1!==e)),{permutationIndices:n,expandDims:r}}function ni(e,t,n){const r=new Array(e);for(let e=0;e<n.length;++e){const a=n[e].shape;for(let n=0;n<t[e].length;++n)void 0===r[t[e][n]]?r[t[e][n]]=a[n]:Object(_.c)(r[t[e][n]]===a[n],(()=>`Expected dimension ${r[t[e][n]]} at axis ${n} of input shaped ${JSON.stringify(a)}, but got dimension ${a[n]}`))}}function ri(e,t){const n=e,r=[];let a=0;0===e.length&&n.push(-1),a=e.length+1;for(let e=0;e<a;++e)r.push([]);const s=[];for(let e=0;e<n.length;++e){const a=si(t,n[e]);for(const t of a)-1===s.indexOf(t)&&(r[e].push(t),s.push(t))}return{path:n,steps:r}}function ai(e){return e.every(((e,t)=>e===t))}function si(e,t){const n=[];for(let r=0;r<e.length;++r)0!==e[r].length&&-1===e[r].indexOf(t)&&-1!==t||n.push(r);return n}function oi(e,t,n=0){let r=[];if("number"==typeof t)Object(_.c)(e.shape[n]%t==0,(()=>"Number of splits must evenly divide the axis.")),r=new Array(t).fill(e.shape[n]/t);else{const a=t.reduce(((e,t)=>(-1===t&&(e+=1),e)),0);Object(_.c)(a<=1,(()=>"There should be only one negative value in split array."));const s=t.indexOf(-1);if(-1!==s){const r=t.reduce(((e,t)=>t>0?e+t:e));t[s]=e.shape[n]-r}Object(_.c)(e.shape[n]===t.reduce(((e,t)=>e+t)),(()=>"The sum of sizes must match the size of the axis dimension.")),r=t}return r}function ii(e){return`Received SparseTensor with denseShape[0] = 0 but\n indices.shape[0] = ${e}`}function ui(e,t){return`indices(${e}, 0) is invalid: ${t} < 0`}function ci(e,t,n){return`indices(${e}, 0) is invalid: ${t} >= ${n}`}function li(e,t){return`only one output dimension may be -1, not both ${e} and ${t}`}function di(e,t){return`size ${e} must be non-negative, not ${t}`}function pi(){return"reshape cannot infer the missing input size for an empty tensor unless all specified input sizes are non-zero"}function fi(e,t){return`Input to reshape is a SparseTensor with ${Object(_.O)(e)}\n dense values, but the requested shape requires a multiple of ${Object(_.O)(t)}. inputShape=${e} outputShape= ${t}`}function hi(e,t){return`Input to reshape is a tensor with ${Object(_.O)(e)} dense values, but the requested shape has ${Object(_.O)(t)}. inputShape=${e} outputShape=${t}`}function mi(){return"segment ids must be >= 0"}function bi(){return"segment ids are not increasing"}function gi(e,t){return`Segment id ${e} out of range [0, ${t}), possibly because segmentIds input is not sorted.`}function yi(e,t,n){return`Bad: indices[${e}] == ${t} out of range [0, ${n})`}function wi(e,t){let n,r=!1;for(e<=Eo?(n=e,r=!0):n=Object(_.G)(e,Math.floor(Math.sqrt(e)));!r;)n>t||n===e?r=!0:n=Object(_.G)(e,n+1);return n}function Oi(e,t,n){const r=[],a=e.length;for(let s=0;s<a;s++)s!==t?r.push(e[s]):r.push(n);return r}function vi(e,t,n,r){const a=t.shape.length,s=e.shape.length;if(0!==r&&(r<-a||r>a))throw new Error(`Expect batchDims in the range of [-${a}, ${a}], but got ${r}`);if(r<0&&(r+=a),r>s)throw new Error(`batchDims (${r}) must be less than rank(x) (\n ${s}).`);if(n<r)throw new Error(`batchDims (${r}) must be less than or equal to axis (${n}).`);for(let n=0;n<r;++n)if(e.shape[n]!==t.shape[n])throw new Error(`x.shape[${n}]: ${e.shape[n]} should be equal to indices.shape[${n}]: ${t.shape[n]}.`);const o=e.shape[n],i=[];let u=1,c=1,l=1;for(let t=0;t<r;++t)i.push(e.shape[t]),u*=e.shape[t];for(let t=r;t<n;t++)i.push(e.shape[t]),c*=e.shape[t];for(let e=r;e<a;e++)i.push(t.shape[e]);for(let t=n+1;t<s;t++)i.push(e.shape[t]),l*=e.shape[t];return{batchSize:u,sliceSize:l,outerSize:c,dimSize:o,outputShape:i}}function ji(e){try{return e.map((e=>Object(Be.decodeString)(e)))}catch(e){throw new Error(`Failed to decode encoded string bytes into utf-8, error: ${e}`)}}function _i(e){return e.map((e=>Object(Be.encodeString)(e)))}var xi=n(71),Si=n(64)},function(e,t,n){"use strict";n.r(t),n.d(t,"BackendWasm",(function(){return p})),n.d(t,"getThreadsCount",(function(){return k})),n.d(t,"setThreadsCount",(function(){return S})),n.d(t,"setWasmPath",(function(){return v})),n.d(t,"setWasmPaths",(function(){return j})),n.d(t,"version_wasm",(function(){return E}));var r=n(5);const a=Object(r.env)();a.registerFlag("WASM_HAS_SIMD_SUPPORT",(async()=>{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,9,1,7,0,65,0,253,15,26,11]))}catch(e){return!1}})),a.registerFlag("WASM_HAS_MULTITHREAD_SUPPORT",(async()=>{if(a.get("IS_NODE"))return!1;try{return(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(e){return!1}}));var s=n(94),o=n.n(s),i=n(122),u=n(95),c=n.n(u);const l=o.a||s,d=c.a||u;class p extends r.KernelBackend{constructor(e){super(),this.wasm=e,this.dataIdNextNumber=1,this.wasm.tfjs.initWithThreadsCount(_),x=this.wasm.tfjs.getThreadsCount(),this.dataIdMap=new r.DataStorage(this,Object(r.engine)())}write(e,t,n){const r={id:this.dataIdNextNumber++};return this.move(r,e,t,n,1),r}numDataIds(){return this.dataIdMap.numDataIds()}async time(e){const t=r.util.now();e();return{kernelMs:r.util.now()-t}}move(e,t,n,a,s){const o=this.dataIdNextNumber++;if("string"===a){const r=t;return void this.dataIdMap.set(e,{id:o,stringBytes:r,shape:n,dtype:a,memoryOffset:null,refCount:s})}const i=r.util.sizeFromShape(n),u=i*r.util.bytesPerElement(a),c=this.wasm._malloc(u)>>>0;this.dataIdMap.set(e,{id:o,memoryOffset:c,shape:n,dtype:a,refCount:s}),this.wasm.tfjs.registerTensor(o,i,c),null!=t&&this.wasm.HEAPU8.set(new Uint8Array(t.buffer,t.byteOffset,u),c)}async read(e){return this.readSync(e)}readSync(e,t,n){const{memoryOffset:a,dtype:s,shape:o,stringBytes:i}=this.dataIdMap.get(e);if("string"===s)return null!=t&&0!==t||!(null==n||n>=i.length)?i.slice(t,n):i;t=t||0,n=n||r.util.sizeFromShape(o);const u=r.util.bytesPerElement(s);return function(e,t){switch(t){case"float32":return new Float32Array(e);case"int32":return new Int32Array(e);case"bool":return new Uint8Array(e);default:throw new Error(`Unknown dtype ${t}`)}}(this.wasm.HEAPU8.slice(a+t*u,a+n*u).buffer,s)}disposeData(e,t=!1){if(this.dataIdMap.has(e)){const n=this.dataIdMap.get(e);if(n.refCount--,!t&&n.refCount>0)return!1;this.wasm._free(n.memoryOffset),this.wasm.tfjs.disposeData(n.id),this.dataIdMap.delete(e)}return!0}refCount(e){if(this.dataIdMap.has(e)){return this.dataIdMap.get(e).refCount}return 0}incRef(e){const t=this.dataIdMap.get(e);null!=t&&t.refCount++}floatPrecision(){return 32}getMemoryOffset(e){return this.dataIdMap.get(e).memoryOffset}dispose(){this.wasm.tfjs.dispose(),"PThread"in this.wasm&&this.wasm.PThread.terminateAllThreads(),this.wasm=null}memory(){return{unreliable:!1}}makeOutput(e,t,n,a){let s;if(null==n)s=this.write(null!=a?a:null,e,t);else{const a=this.dataIdNextNumber++;s={id:a},this.dataIdMap.set(s,{id:a,memoryOffset:n,shape:e,dtype:t,refCount:1});const o=r.util.sizeFromShape(e);this.wasm.tfjs.registerTensor(a,o,n)}return{dataId:s,shape:e,dtype:t}}typedArrayFromHeap({shape:e,dtype:t,dataId:n}){const a=this.wasm.HEAPU8.buffer,{memoryOffset:s}=this.dataIdMap.get(n),o=r.util.sizeFromShape(e);switch(t){case"float32":return new Float32Array(a,s,o);case"int32":return new Int32Array(a,s,o);case"bool":return new Uint8Array(a,s,o);default:throw new Error(`Unknown dtype ${t}`)}}}function f(e,t,n){if(null!=b)return b;let r="tfjs-backend-wasm.wasm";return e&&t?r="tfjs-backend-wasm-threaded-simd.wasm":e&&(r="tfjs-backend-wasm-simd.wasm"),null!=y&&null!=y[r]?y[r]:n+r}async function h(){const[e,t]=await Promise.all([Object(r.env)().getAsync("WASM_HAS_SIMD_SUPPORT"),Object(r.env)().getAsync("WASM_HAS_MULTITHREAD_SUPPORT")]);return new Promise(((n,a)=>{const s={};var o;s.locateFile=(n,r)=>{if(n.endsWith(".worker.js")){const e=i.wasmWorkerContents.replace(/\n/g,"\\n"),t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}return n.endsWith(".wasm")?f(e,t,null!=g?g:r):r+n},O&&(s.instantiateWasm=(o=f(e,t,null!=g?g:""),(e,t)=>(r.util.fetch(o,{credentials:"same-origin"}).then((n=>{n.ok||e.env.a(`failed to load wasm binary file at '${o}'`),n.arrayBuffer().then((n=>{WebAssembly.instantiate(n,e).then((e=>{t(e.instance,e.module)}))}))})),{})));let u,c=!1;s.onAbort=()=>{if(c)return;if(w)return;w=!0;a({message:"Make sure the server can serve the `.wasm` file relative to the bundled js file. For more details see https://github.com/tensorflow/tfjs/blob/master/tfjs-backend-wasm/README.md#using-bundlers"})},t&&e&&null==b?(s.mainScriptUrlOrBlob=new Blob(["var WasmBackendModuleThreadedSimd = "+l.toString()],{type:"text/javascript"}),u=l(s)):u=d(s),u.then((e=>{c=!0,w=!1;e.tfjs={init:e.cwrap("init",null,[]),initWithThreadsCount:e.cwrap("init_with_threads_count",null,["number"]),getThreadsCount:e.cwrap("get_threads_count","number",[]),registerTensor:e.cwrap("register_tensor",null,["number","number","number"]),disposeData:e.cwrap("dispose_data",null,["number"]),dispose:e.cwrap("dispose",null,[])},n({wasm:e})})).catch(a)}))}const m=["tfjs-backend-wasm.wasm","tfjs-backend-wasm-simd.wasm","tfjs-backend-wasm-threaded-simd.wasm"];let b=null,g=null,y={},w=!1,O=!1;function v(e,t=!1){if(Object(r.deprecationWarn)("setWasmPath has been deprecated in favor of setWasmPaths and will be removed in a future release."),w)throw new Error("The WASM backend was already initialized. Make sure you call `setWasmPath()` before you call `tf.setBackend()` or `tf.ready()`");b=e,O=t}function j(e,t=!1){if(w)throw new Error("The WASM backend was already initialized. Make sure you call `setWasmPaths()` before you call `tf.setBackend()` or `tf.ready()`");if("string"==typeof e)g=e;else{y=e;const t=m.filter((e=>null==y[e]));if(t.length>0)throw new Error(`There were no entries found for the following binaries: ${t.join(",")}. Please either call setWasmPaths with a map providing a path for each binary, or with a string indicating the directory where all the binaries can be found.`)}O=t}let _=-1,x=-1;function S(e){_=e}function k(){if(-1===x)throw new Error("WASM backend not initialized.");return x}const E="4.10.0";Object(r.registerBackend)("wasm",(async()=>{const{wasm:e}=await h();return new p(e)}),2)},function(e,t,n){"use strict";n.r(t);var r=n(3),a=(n(62),n(11)),s=n(77),o=n(79),i=n(48),u=n(78);class c{constructor(){this.messageName="setTimeoutCustom",this.functionRefs=[],this.handledMessageCount=0,this.hasEventListener=!1}fetch(e,t){return fetch(e,t)}now(){return performance.now()}encode(e,t){if("utf-8"!==t&&"utf8"!==t)throw new Error(`Browser's encoder only supports utf-8, but got ${t}`);return null==this.textEncoder&&(this.textEncoder=new TextEncoder),this.textEncoder.encode(e)}decode(e,t){return new TextDecoder(t).decode(e)}setTimeoutCustom(e,t){"undefined"!=typeof window&&Object(a.c)().getBool("USE_SETTIMEOUTCUSTOM")?(this.functionRefs.push(e),setTimeout((()=>{window.postMessage({name:this.messageName,index:this.functionRefs.length-1},"*")}),t),this.hasEventListener||(this.hasEventListener=!0,window.addEventListener("message",(e=>{if(e.source===window&&e.data.name===this.messageName){e.stopPropagation();(0,this.functionRefs[e.data.index])(),this.handledMessageCount++,this.handledMessageCount===this.functionRefs.length&&(this.functionRefs=[],this.handledMessageCount=0)}}),!0))):setTimeout(e,t)}isTypedArray(e){return Object(u.a)(e)}}if(Object(a.c)().get("IS_BROWSER")){Object(a.c)().setPlatform("browser",new c);try{i.a.registerManager(o.a.URL_SCHEME,new o.b)}catch(e){}try{i.a.registerManager(s.a.URL_SCHEME,new s.b)}catch(e){}}n(141);var l=n(28),d=n(15),p=n(36),f=n(75),h=n(17);Object(r.b)();const m={buffer:l.a,cast:d.a,clone:p.a,print:f.a};Object(h.e)(m)},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"Add",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddV2",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddN",category:"arithmetic",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"BiasAdd",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"Sub",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"RealDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Div",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"DivNoNan",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mul",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Maximum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Minimum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Pow",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SquaredDifference",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorMod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"Abs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan2",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Ceil",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ClipByValue",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"clipValueMin",type:"number"},{start:2,name:"clipValueMax",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Complex",category:"basic_math",inputs:[{start:0,name:"real",type:"tensor"},{start:1,name:"imag",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ComplexAbs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Elu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Exp",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Floor",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Imag",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Neg",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Real",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Prelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"alpha",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu6",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Selu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sigmoid",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Rsqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Square",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sign",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Round",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Expm1",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log1p",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Reciprocal",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Softplus",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Erf",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LeakyRelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"alpha",name:"alpha",type:"number",defaultValue:.2},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsNan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsFinite",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsInf",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"EmptyTensorList",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"maxNumElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"LoopCond",category:"control",inputs:[{start:0,name:"pred",type:"tensor"}]},{tfOpName:"Switch",category:"control",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"pred",type:"tensor"}]},{tfOpName:"Merge",category:"control",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"Enter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"frame_name",name:"frameName",type:"string"},{tfName:"is_constant",name:"isConstant",type:"bool"}]},{tfOpName:"Exit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NextIteration",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayV3",category:"control",inputs:[{start:0,name:"size",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"dynamic_size",name:"dynamicSize",type:"bool"},{tfName:"clear_after_read",name:"clearAfterRead",type:"bool"},{tfName:"identical_element_shapes",name:"identicalElementShapes",type:"bool"},{tfName:"tensor_array_name",name:"name",type:"string"}]},{tfOpName:"TensorArrayWriteV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayReadV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayGatherV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"}]},{tfOpName:"TensorArrayScatterV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArrayConcatV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape_except0",name:"elementShapeExcept0",type:"shape",notSupported:!0}]},{tfOpName:"TensorArraySplitV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"tensor",type:"tensor"},{start:2,name:"lengths",type:"number[]"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArraySizeV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}]},{tfOpName:"TensorArrayCloseV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"}]},{tfOpName:"StatelessIf",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"If",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"StatelessWhile",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"While",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"TensorListScatter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListScatterV2",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"},{start:3,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGather",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListSetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListReserve",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListFromTensor",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListStack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"},{tfName:"num_elements",name:"numElements",type:"dtype"}]},{tfOpName:"TensorListSplit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"},{start:2,name:"lengths",type:"number[]"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListConcat",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}],attrs:[{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListConcatV2",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}],attrs:[{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPopBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPushBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListLength",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}]},{tfOpName:"TensorListResize",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"size",type:"number"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"AvgPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[],notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPoolWithArgmax",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"include_batch_in_index",name:"includeBatchInIndex",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AvgPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Conv1D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"stride",name:"stride",type:"number"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NWC"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"dilation",name:"dilation",type:"number",defaultValue:1}]},{tfOpName:"Conv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"useCudnnOnGpu",name:"useCudnnOnGpu",type:"bool"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"_FusedConv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"use_cudnn_on_gpu",name:"useCudnnOnGpu",type:"bool",defaultValue:!0},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"leakyrelu_alpha",name:"leakyreluAlpha",type:"number",defaultValue:.2}]},{tfOpName:"Conv2DBackpropInput",category:"convolution",inputs:[{start:2,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:0,name:"outputShape",type:"number[]"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]",notSupported:!0}]},{tfOpName:"DepthwiseConv2d",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"DepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"FusedDepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]}]},{tfOpName:"Conv3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"Dilation2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"rates",name:"dilations",type:"number[]"},{tfName:"padding",name:"pad",type:"string"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"Fill",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"},{start:1,name:"value",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"LinSpace",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"num",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"OneHot",category:"creation",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"depth",type:"number"},{start:2,name:"onValue",type:"number",defaultValue:1},{start:3,name:"offValue",type:"number",defaultValue:0}],attrs:[{tfName:"axis",name:"axis",type:"number",notSupported:!0},{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"Ones",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"OnesLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"RandomStandardNormal",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"RandomUniform",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"minval",name:"minval",type:"number",defaultValue:0},{tfName:"maxval",name:"maxval",type:"number",defaultValue:1},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"RandomUniformInt",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"minval",name:"minval",type:"number"},{tfName:"maxval",name:"maxval",type:"number"},{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0}]},{tfOpName:"Range",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"step",type:"number",defaultValue:0}],attrs:[{tfName:"Tidx",name:"dtype",type:"dtype"}]},{tfOpName:"TruncatedNormal",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"means",name:"mean",type:"number",defaultValue:0},{tfName:"stddev",name:"stdDev",type:"number",defaultValue:1},{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"Zeros",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"ZerosLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"Multinomial",category:"creation",inputs:[{start:0,name:"logits",type:"tensor"},{start:1,name:"numSamples",type:"number"}],attrs:[{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number"},{tfName:"T",name:"dtype",type:"dtype"},{tfName:"output_dtype",name:"output_dtype",type:"dtype"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"NonMaxSuppressionV2",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV3",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV4",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"T_threshold",name:"threshold",type:"dtype",notSupported:!0},{tfName:"pad_to_max_output_size",name:"padToMaxOutputSize",type:"bool"}]},{tfOpName:"NonMaxSuppressionV5",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"},{start:5,name:"softNmsSigma",type:"number"}]},{tfOpName:"Where",category:"dynamic",inputs:[{start:0,name:"condition",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ListDiff",category:"dynamic",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"LowerBound",category:"evaluation",inputs:[{start:0,name:"sortedSequence",type:"tensor"},{start:1,name:"values",type:"tensor"}]},{tfOpName:"TopKV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"k",type:"number"}],attrs:[{tfName:"sorted",name:"sorted",type:"bool"}]},{tfOpName:"UpperBound",category:"evaluation",inputs:[{start:0,name:"sortedSequence",type:"tensor"},{start:1,name:"values",type:"tensor"}]},{tfOpName:"Unique",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"UniqueV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"PlaceholderWithDefault",category:"graph",inputs:[{start:0,name:"default",type:"tensor"}],attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Placeholder",category:"graph",attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Const",category:"graph"},{tfOpName:"Identity",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IdentityN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Snapshot",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Rank",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Size",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Shape",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"ShapeN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Print",category:"graph",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"data",type:"tensors"}],attrs:[{tfName:"message",name:"message",type:"string"},{tfName:"first_n",name:"firstN",type:"number",notSupported:!0},{tfName:"summarize",name:"summarize",type:"number",defaultValue:3}]},{tfOpName:"NoOp",category:"graph",inputs:[]},{tfOpName:"StopGradient",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"FakeQuantWithMinMaxVars",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"min",name:"min",type:"number"},{tfName:"max",name:"max",type:"number"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"HashTable",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"HashTableV2",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"LookupTableImport",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableImportV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFind",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFindV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableSize",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]},{tfOpName:"LookupTableSizeV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]},{tfOpName:"InitializeTable",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}]},{tfOpName:"InitializeTableV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"ResizeBilinear",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"half_pixel_centers",name:"halfPixelCenters",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ResizeNearestNeighbor",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"half_pixel_centers",name:"halfPixelCenters",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"CropAndResize",category:"image",inputs:[{start:0,name:"image",type:"tensor"},{start:1,name:"boxes",type:"tensor"},{start:2,name:"boxInd",type:"tensor"},{start:3,name:"cropSize",type:"number[]"}],attrs:[{tfName:"method",name:"method",type:"string"},{tfName:"extrapolation_value",name:"extrapolationValue",type:"number"}]},{tfOpName:"ImageProjectiveTransformV3",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"transforms",type:"tensor"},{start:2,name:"outputShape",type:"number[]"},{start:3,name:"fillValue",type:"number"}],attrs:[{tfName:"interpolation",name:"interpolation",type:"string"},{tfName:"fill_mode",name:"fillMode",type:"string"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"Equal",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NotEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Greater",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"GreaterEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Less",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LessEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalAnd",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalNot",category:"logical",inputs:[{start:0,name:"a",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalOr",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Select",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SelectV2",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BitwiseAnd",category:"logical",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"_FusedMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"leakyrelu_alpha",name:"leakyreluAlpha",type:"number",defaultValue:.2},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMulV2",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Transpose",category:"matrices",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"perm",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Einsum",category:"matrices",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"equation",name:"equation",type:"string"},{tfName:"N",name:"n",type:"number",defaultValue:2},{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"MatrixBandPart",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"numLower",type:"tensor"},{start:1,name:"numUpper",type:"tensor"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"EuclideanNorm",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool",defaultValue:!1}]},{tfOpName:"FusedBatchNorm",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV2",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV3",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"LRN",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"depth_radius",name:"radius",type:"number",defaultValue:5},{tfName:"bias",name:"bias",type:"number",defaultValue:1},{tfName:"alpha",name:"alpha",type:"number",defaultValue:1},{tfName:"beta",name:"beta",type:"number",defaultValue:.5}]},{tfOpName:"Softmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"LogSoftmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"Bincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}]},{tfOpName:"DenseBincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}],attrs:[{tfName:"binary_output",name:"binaryOutput",type:"bool"}]},{tfOpName:"Max",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Mean",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Min",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Sum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"All",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Any",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"ArgMax",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"ArgMin",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"Prod",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cumprod",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}],attrs:[{tfName:"exclusive",name:"exclusive",type:"bool"},{tfName:"reverse",name:"reverse",type:"bool"}]},{tfOpName:"Cumsum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}],attrs:[{tfName:"exclusive",name:"exclusive",type:"bool"},{tfName:"reverse",name:"reverse",type:"bool"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"ConcatV2",category:"slice_join",inputs:[{start:0,end:-1,name:"tensors",type:"tensors"},{start:-1,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"Concat",category:"slice_join",inputs:[{start:1,end:0,name:"tensors",type:"tensors"},{start:0,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"GatherV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"axis",type:"number",defaultValue:0}],attrs:[{tfName:"batch_dims",name:"batchDims",type:"number",defaultValue:0}]},{tfOpName:"Gather",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",notSupported:!0}]},{tfOpName:"Reverse",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"dims",type:"bool[]"}]},{tfOpName:"ReverseV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}]},{tfOpName:"Slice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"size",type:"number[]"}]},{tfOpName:"StridedSlice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"end",type:"number[]"},{start:3,name:"strides",type:"number[]"}],attrs:[{tfName:"begin_mask",name:"beginMask",type:"number",defaultValue:0},{tfName:"end_mask",name:"endMask",type:"number",defaultValue:0},{tfName:"new_axis_mask",name:"newAxisMask",type:"number",defaultValue:0},{tfName:"ellipsis_mask",name:"ellipsisMask",type:"number",defaultValue:0},{tfName:"shrink_axis_mask",name:"shrinkAxisMask",type:"number",defaultValue:0}]},{tfOpName:"Pack",category:"slice_join",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0}]},{tfOpName:"Unpack",category:"slice_join",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0},{tfName:"num",name:"num",type:"number",defaultValue:0,notSupported:!0}]},{tfOpName:"Tile",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"reps",type:"number[]"}]},{tfOpName:"Split",category:"slice_join",inputs:[{start:0,name:"axis",type:"number",defaultValue:0},{start:1,name:"x",type:"tensor"}],attrs:[{tfName:"num_split",name:"numOrSizeSplits",type:"number",defaultValue:1}]},{tfOpName:"SplitV",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"numOrSizeSplits",type:"number[]"},{start:2,name:"axis",type:"number",defaultValue:0}]},{tfOpName:"ScatterNd",category:"slice_join",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"shape",type:"number[]"}]},{tfOpName:"GatherNd",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}]},{tfOpName:"SparseToDense",category:"slice_join",inputs:[{start:0,name:"sparseIndices",type:"tensor"},{start:1,name:"outputShape",type:"number[]"},{start:2,name:"sparseValues",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",defaultValue:!1,notSupported:!0}]},{tfOpName:"TensorScatterUpdate",category:"slice_join",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"values",type:"tensor"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"SparseFillEmptyRows",category:"sparse",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"denseShape",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}]},{tfOpName:"SparseReshape",category:"sparse",inputs:[{start:0,name:"inputIndices",type:"tensor"},{start:1,name:"inputShape",type:"tensor"},{start:2,name:"newShape",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SparseSegmentMean",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]},{tfOpName:"SparseSegmentSum",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"FFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"RFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]},{tfOpName:"IRFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"StaticRegexReplace",category:"string",inputs:[{start:0,name:"input",type:"tensor"}],attrs:[{tfName:"pattern",name:"pattern",type:"string"},{tfName:"rewrite",name:"rewrite",type:"string"},{tfName:"replace_global",name:"replaceGlobal",type:"bool"}]},{tfOpName:"StringNGrams",category:"string",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"dataSplits",type:"tensor"}],attrs:[{tfName:"separator",name:"separator",type:"string"},{tfName:"ngram_widths",name:"nGramWidths",type:"number[]"},{tfName:"left_pad",name:"leftPad",type:"string"},{tfName:"right_pad",name:"rightPad",type:"string"},{tfName:"pad_width",name:"padWidth",type:"number"},{tfName:"preserve_short_sequences",name:"preserveShortSequences",type:"bool"}],outputs:["ngrams","ngrams_splits"]},{tfOpName:"StringSplit",category:"string",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"delimiter",type:"tensor"}],attrs:[{tfName:"skip_empty",name:"skipEmpty",type:"bool"}],outputs:["indices","values","shape"]},{tfOpName:"StringToHashBucketFast",category:"string",inputs:[{start:0,name:"input",type:"tensor"}],attrs:[{tfName:"num_buckets",name:"numBuckets",type:"number"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"Cast",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"SrcT",name:"sdtype",type:"dtype",notSupported:!0},{tfName:"DstT",name:"dtype",type:"dtype"}]},{tfOpName:"ExpandDims",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"MirrorPad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"mode",name:"mode",type:"string"}]},{tfOpName:"Pad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"constant_value",name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"PadV2",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"},{start:2,name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"Reshape",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}]},{tfOpName:"EnsureShape",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}]},{tfOpName:"Squeeze",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"axis",tfDeprecatedName:"squeeze_dims",name:"axis",type:"number[]"}]},{tfOpName:"SpaceToBatchND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"paddings",type:"number[]"}]},{tfOpName:"BatchToSpaceND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"crops",type:"number[]"}]},{tfOpName:"DepthToSpace",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"block_size",name:"blockSize",type:"number"},{tfName:"data_format",name:"dataFormat",type:"string"}]},{tfOpName:"BroadcastTo",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}],attrs:[]},{tfOpName:"BroadcastArgs",category:"transformation",inputs:[{start:0,name:"s0",type:"tensor"},{start:1,name:"s1",type:"tensor"}],attrs:[]}]},function(e,t){e.exports.wasmWorkerContents='"use strict";var Module={};var ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";if(ENVIRONMENT_IS_NODE){var nodeWorkerThreads=require("worker_threads");var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",data=>onmessage({data:data}));var fs=require("fs");Object.assign(global,{self:global,require:require,Module:Module,location:{href:__filename},Worker:nodeWorkerThreads.Worker,importScripts:function(f){(0,eval)(fs.readFileSync(f,"utf8")+"//# sourceURL="+f)},postMessage:function(msg){parentPort.postMessage(msg)},performance:global.performance||{now:function(){return Date.now()}}})}var initializedJS=false;var pendingNotifiedProxyingQueues=[];function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");if(ENVIRONMENT_IS_NODE){fs.writeSync(2,text+"\n");return}console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;self.alert=threadAlert;Module["instantiateWasm"]=(info,receiveInstance)=>{var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};self.onunhandledrejection=e=>{throw e.reason??e};self.startWorker=instance=>{Module=instance;postMessage({"cmd":"loaded"})};self.onmessage=e=>{try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;for(const handler of e.data.handlers){Module[handler]=function(){postMessage({cmd:"callHandler",handler:handler,args:[...arguments]})}}Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob=="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}WasmBackendModuleThreadedSimd(Module)}else if(e.data.cmd==="run"){Module["__emscripten_thread_init"](e.data.pthread_ptr,0,0,1);Module["establishStackSpace"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInitTLS();if(!initializedJS){pendingNotifiedProxyingQueues.forEach(queue=>{Module["executeNotifiedProxyingQueue"](queue)});pendingNotifiedProxyingQueues=[];initializedJS=true}try{Module["invokeEntryPoint"](e.data.start_routine,e.data.arg)}catch(ex){if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["__emscripten_thread_exit"](ex.status)}}else{throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processProxyingQueue"){if(initializedJS){Module["executeNotifiedProxyingQueue"](e.data.queue)}else{pendingNotifiedProxyingQueues.push(e.data.queue)}}else if(e.data.cmd){err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){if(Module["__emscripten_thread_crashed"]){Module["__emscripten_thread_crashed"]()}throw ex}};'},,function(e,t,n){"use strict";var r=n(125),a=n(126);let s;const o="/tessdata",i={};function u(e){const t=Math.random().toString(36);return i[t]=e,t}function c(e){if(!i.hasOwnProperty(e))throw new Error(`Object ${e} does not exist`);return i[e]}function l(e){const t=c(e);t.delete&&t.delete(),delete i[e]}function d(e,t){for(let n in t){if(e===t[n])return n}}function p(e){if(!(e instanceof Array))throw new Error('languages must be an array of valid language codes, e.g. ["eng", "deu"]');return s.FS.analyzePath(o).exists||s.FS.mkdir(o),e.forEach((function(e){if(!s.FS.analyzePath("/tessdata/"+e+".traineddata").exists){let t=s.locateFile(`tessdata/${e}.traineddata`);s.FS.createLazyFile(o,e+".traineddata",t,!0,!1)}})),e.join("+")}const f={initialize:async function(e,t,o,i,u){const{captureConsole:c,allowThreads:l,profileTfjsKernels:d}=u||{};c&&(console.log=function(...e){self.postMessage({log:e})},console.error=function(...e){self.postMessage({logError:e})});const p=n(163),f={locateFile:function(e,n){let a;return a=t?(0,r.isRemote)(t)?t:"":i,a+e}};return await Promise.all([p(f),(0,a.initialize)(f.locateFile(""),l,d)]),(0,a.initializeModule)(f),s=f,s.initialize(e||"",o)},getLicenseInfo:function(){return s.getLicenseInfo()},applyFilter:function(e,t){return b(s.applyFilter(y(e),t),m)},rotateImageCcw:function(e,t){return b(s.rotateImageCcw(y(e),t),m)},cropAndRotateImageCcw:function(e,t,n){const r=function(e){const t=[];for(let n=0;n<e.length;++n)t.push(e[n].x,e[n].y);return t}(t);return b(s.cropAndRotateImageCcw(y(e),r,n),m)},detectDocument:async function(e,t,n,r){const a=new s.DocumentDetector({useCombinedDetector:t,acceptedAngleScore:n,acceptedSizeScore:r}),o=a.detect(y(e));return a.delete(),await h(o)},detectAndCropDocument:async function(e){return await h(s.detectAndCropDocument(y(e)))},createDocumentDetector:async function(e){return u(new s.DocumentDetector(e||{}))},documentDetectorDetect:async function(e,t){const n=c(e);return await h(n.detect(y(t)))},createBarcodeRecognizer:async function(e){return u(new s.BarcodeRecognizer(e||{}))},recognizeBarcodes:async function(e,t,n){let r,a=!1;"string"==typeof e?r=c(e):(n=t,t=e,r=new s.BarcodeRecognizer(n),a=!0);try{const e=r.recognize(y(t),n||{});if(!e)return null;let o;return e.length?(o=e.map((e=>({format:d(e.format,s.BarcodeFormat),text:e.text,parsedText:e.parsedText,rawBytes:e.rawBytes.data.slice(),quad:e.quad,barcodeImage:m(e.barcodeImage)}))),e.forEach((e=>e.delete()))):o=[],{result:o,originalImage:t}}finally{a&&r.delete()}},beginPdf:async function(e){return u(new s.PdfGenerationContext(e||{}))},addPageToPdf:async function(e,t){b(c(e).addPage(t))},completePdf:async function(e){const t=b(c(e).complete(),m);return l(e),t},beginTiff:async function(e){const t=new s.TiffGenerationContext(e||{});return b(t.begin()),u(t)},addPageToTiff:async function(e,t){return b(c(e).addPage(y(t)))},completeTiff:async function(e){try{const t=c(e).complete();return b(t,m)}finally{l(e)}},createMRZRecognizer:async function(){return u(new s.MrzRecognizerContext)},recognizeMRZ:async function(e,t){return c(e).recognize(y(t))},createBlurDetector:function(){return u(new s.BlurDetectorContext)},estimateBlurriness:function(e,t){return b(c(e).estimateBlurriness(y(t)))},estimateBlurrinessOnBuffer:function(e,t){return f.estimateBlurriness(e,t)},releaseObject:async function(e){l(e)},createOcrEngine:async function(e){const t=p(e);return u(new s.TesseractOcrContext(o,t))},performOcr:async function(e,t){return c(e).performOcr(y(t))},createGenericTextLineScanner:async function(e){e.languages||(e.languages=["eng"]),e.languages=p(e.languages),e.tessdataPath=o;return u(new s.GenericTextLineScanner(e))},recognizeTextLine:async function(e,t){return c(e).recognize(y(t))},cleanTextLineRecognitionQueue:async function(e){c(e).cleanRecognitionQueue()}};async function h(e){if(!e)return{success:!1,detectionStatus:"Error_License"};const t=w[e.status],n={detectionStatus:t,success:(r=t,"OK"===r.substr(0,2))};var r;return n.original=m(e.originalImageJpegData),n.success&&(n.cropped=m(e.croppedImageJpegData),n.polygon=function(e){if(e.length%2!=0)throw Error("pointCoords size is not even.");const t=[];for(let n=0;n<e.length;n+=2)t.push({x:e[n],y:e[n+1]});return t}(e.polygon.data),n.horizontalLines=g(e.horizontalLines.data),n.verticalLines=g(e.verticalLines.data)),e.delete(),n}function m(e){return e&&e.data&&e.data.slice()}function b(e,t){try{if(e.errorMessage){throw new Error(e.errorMessage)}return(t||(e=>e))(e.result)}finally{e.delete()}}function g(e){const t=[];if(!e)return t;if(e.length%4!=0)throw Error("lineCoords size invalid.");for(let n=0;n<e.length;n+=4)t.push({p1:{x:e[n],y:e[n+1]},p2:{x:e[n+2],y:e[n+3]}});return t}function y(e){if(!e)throw new Error("null image data or buffer");return"number"==typeof e.width?e:{data:e,width:-1,height:-1}}const w={0:"NotAcquired",100:"OK",101:"OK_SmallSize",102:"OK_BadAngles",103:"OK_BadAspectRatio",104:"OK_OffCenter",200:"Error_NothingDetected",201:"Error_Brightness",202:"Error_Noise"};onmessage=function(e){const{command:t,args:n,ticket:a}=e.data;s||"initialize"===t?(async()=>await f[t].apply(null,n))().then((e=>{const t=(0,r.gatherTransferables)(e);self.postMessage({ticket:a,result:e},t)})).catch((e=>{const t="number"==typeof e?Error(s.stringFromException(e)):e;console.error(t),self.postMessage({ticket:a,error:t})})):self.postMessage({ticket:a,error:"WASM module not loaded yet."})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gatherTransferables=function(e,t){const n=[];return function e(r){if(!r)return;if(r.constructor===ImageData){const e={data:r.data.slice(),width:r.width,height:r.height};return n.push(e.data.buffer),e}if(r.constructor===ArrayBuffer){const e=t?r.slice(0):r;if(n.push(e),t)return r}else if(ArrayBuffer.isView(r)){let e;if(t){e=new(0,r.constructor)(r.buffer.slice(0))}else e=r;if(n.push(e.buffer),t)return r}else if(Array.isArray(r))for(let t=0;t<r.length;++t){const n=e(r[t]);n&&(r[t]=n)}else if(r.constructor===Object)for(const t in r)if(r.hasOwnProperty(t)){const n=e(r[t]);n&&(r[t]=n)}}(e),n},t.isRemote=function(e){return e.startsWith("http:")||e.startsWith("https:")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initialize=async function(e,t,n){(0,s.setWasmPaths)(e),(0,s.setThreadsCount)(2);const o=await r.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT");t||r.env().setFlags({WASM_HAS_MULTITHREAD_SUPPORT:!1});u.wasm=await r.engine().initializeBackend("wasm").success,u.wasm&&o&&t&&console.log("ScanbotSDK: Using multithreaded backend");u.wasm||o&&t&&(console.log("ScanbotSDK: Multithreaded backend not available, falling back to single-threaded backend."),r.env().setFlags({WASM_HAS_MULTITHREAD_SUPPORT:!1}),u.wasm=await r.engine().initializeBackend("wasm").success);r.engine().findBackendFactory("webgl")&&(u.webgl=await r.engine().initializeBackend("webgl").success);r.engine().setBackendSync=function(e){this.backendName=e,this.backendInstance=this.registry[e],this.setupRegisteredKernels(),this.profiler=new a.Profiler(this.backendInstance)},n?r.enableDebugMode():r.enableProdMode()},t.initializeModule=function(e){e.tfjs={loadModel:l,predict:f,disposeModel:d}};var r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(127)),a=n(89),s=n(101);let o=1;const i={},u={};function c(e){e!==r.getBackend()&&u[e]&&r.engine().setBackendSync(e)}function l(e,t,n,a,s,u){const l=(new TextDecoder).decode(new Uint8Array(e.HEAPU8.buffer,n,a)),d=JSON.parse(l);d.weightData=[new Uint8Array(e.HEAPU8.buffer,s,u).slice()],c(t=e.UTF8ToString(t));const p=r.loadGraphModelSync({load:()=>d}),f=o++,h={model:p,backend:t};return i[f]=h,d.userDefinedMetadata&&(h.inferenceParameters=d.userDefinedMetadata.inferenceParameters),f}function d(e){const{model:t,backend:n}=i[e];c(n),t.dispose(),delete i[e]}const p={0:["int32",Uint8Array],1:["int32",Int8Array],2:["int32",Uint16Array],3:["int32",Int16Array],4:["int32",Int32Array],5:["float32",Float32Array],6:["float32",Float64Array]};function f(e,t,n,a,s,o){const{model:u,backend:l,inferenceParameters:d}=i[t];return c(l),r.tidy((()=>{const t=[],i=e.HEAPU32,c=function(e,t){let n=t/4;function r(){return e[n++]}return function(){const e=r(),t=[];let n=1;for(let a=0;a<e;a++){const e=r();n*=e,t.push(e)}return{shape:t,size:n,depth:r()}}}(i,s);for(let e=0;e<n;e++){const{shape:n,size:s,depth:o}=c(),[u,l]=p[o],f=i[a/4+e],h=new l(i.buffer,f,s);let m=r.tensor(h,n,u);if(d&&d[e]){const{scale:t,bias:n}=d[e];m=r.add(r.mul(m,t),n)}n.length<4&&(m=r.expandDims(m)),t.push(m)}const l=u.predict(t);return function(e,t,n){Array.isArray(t)||(t=[t]);const r=function(t){const n=e._malloc(4*t);return new Uint32Array(e.HEAPU8.buffer,n,t)}(t.length+1);r[0]=t.length;for(let a=0;a<t.length;a++){const s=t[a];if("float32"!==s.dtype)throw new Error("Unsupported dtype: "+s.dtype);let o=n&&1==s.shape[0]?s.shape.slice(1):s.shape;o=1==o[o.length-1]?o.slice(0,-1):o;const i=e.tfjsAllocateCvMat(o,1,5),u=e.tfjsGetCvMatData(i),c=s.dataSync();e.HEAPF32.set(c,u/4),r[a+1]=i}return r.byteOffset}(e,l,o)}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(100);Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})}));var a=n(164);Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}})}));var s=n(101);Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}})})),n(102);var o=n(147),i=n(148),u=n(149),c=n(90),l=n(91),d=n(150),p=n(81),f=n(151),h=n(152),m=n(68),b=n(153),g=n(165),y=n(154),w=n(155),O=n(156),v=n(157),j=n(166),_=n(158),x=n(159),S=n(47),k=n(160),E=n(161),T=n(167),N=n(162),A=n(92);(0,r.registerKernel)(o._fusedMatMulConfig),(0,r.registerKernel)(i.addConfig),(0,r.registerKernel)(u.avgPoolConfig),(0,r.registerKernel)(c.castConfig),(0,r.registerKernel)(l.concatConfig),(0,r.registerKernel)(d.conv2DConfig),(0,r.registerKernel)(p.expandDimsConfig),(0,r.registerKernel)(f.fusedConv2DConfig),(0,r.registerKernel)(h.fusedDepthwiseConv2DConfig),(0,r.registerKernel)(m.identityConfig),(0,r.registerKernel)(b.maximumConfig),(0,r.registerKernel)(g.meanConfig),(0,r.registerKernel)(y.minimumConfig),(0,r.registerKernel)(w.modConfig),(0,r.registerKernel)(O.multiplyConfig),(0,r.registerKernel)(v.packConfig),(0,r.registerKernel)(j.padV2Config),(0,r.registerKernel)(_.reluConfig),(0,r.registerKernel)(x.relu6Config),(0,r.registerKernel)(S.reshapeConfig),(0,r.registerKernel)(k.sigmoidConfig),(0,r.registerKernel)(E.softmaxConfig),(0,r.registerKernel)(T.stridedSliceConfig),(0,r.registerKernel)(N.subConfig),(0,r.registerKernel)(A.transposeConfig)},function(e,t,n){"use strict";t.byteLength=function(e){var t=c(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=c(e),o=r[0],i=r[1],u=new s(function(e,t,n){return 3*(t+n)/4-n}(0,o,i)),l=0,d=i>0?o-4:o;for(n=0;n<d;n+=4)t=a[e.charCodeAt(n)]<<18|a[e.charCodeAt(n+1)]<<12|a[e.charCodeAt(n+2)]<<6|a[e.charCodeAt(n+3)],u[l++]=t>>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===i&&(t=a[e.charCodeAt(n)]<<2|a[e.charCodeAt(n+1)]>>4,u[l++]=255&t);1===i&&(t=a[e.charCodeAt(n)]<<10|a[e.charCodeAt(n+1)]<<4|a[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,a=n%3,s=[],o=16383,i=0,u=n-a;i<u;i+=o)s.push(l(e,i,i+o>u?u:i+o));1===a?(t=e[n-1],s.push(r[t>>2]+r[t<<4&63]+"==")):2===a&&(t=(e[n-2]<<8)+e[n-1],s.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return s.join("")};for(var r=[],a=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,u=o.length;i<u;++i)r[i]=o[i],a[o.charCodeAt(i)]=i;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,n){for(var a,s,o=[],i=t;i<n;i+=3)a=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push(r[(s=a)>>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);return o.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,a){var s,o,i=8*a-r-1,u=(1<<i)-1,c=u>>1,l=-7,d=n?a-1:0,p=n?-1:1,f=e[t+d];for(d+=p,s=f&(1<<-l)-1,f>>=-l,l+=i;l>0;s=256*s+e[t+d],d+=p,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=r;l>0;o=256*o+e[t+d],d+=p,l-=8);if(0===s)s=1-c;else{if(s===u)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,r),s-=c}return(f?-1:1)*o*Math.pow(2,s-r)},t.write=function(e,t,n,r,a,s){var o,i,u,c=8*s-a-1,l=(1<<c)-1,d=l>>1,p=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:s-1,h=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(i=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+d>=1?p/u:p*Math.pow(2,1-d))*u>=2&&(o++,u/=2),o+d>=l?(i=0,o=l):o+d>=1?(i=(t*u-1)*Math.pow(2,a),o+=d):(i=t*Math.pow(2,d-1)*Math.pow(2,a),o=0));a>=8;e[n+f]=255&i,f+=h,i/=256,a-=8);for(o=o<<a|i,c+=a;c>0;e[n+f]=255&o,f+=h,o/=256,c-=8);e[n+f-h]|=128*m}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){(function(e){var r;!function(e,a,s){function o(e){var t,n=this,r=(t=4022871197,function(e){e=String(e);for(var n=0;n<e.length;n++){var r=.02519603282416938*(t+=e.charCodeAt(n));r-=t=r>>>0,t=(r*=t)>>>0,t+=4294967296*(r-=t)}return 2.3283064365386963e-10*(t>>>0)});n.next=function(){var e=2091639*n.s0+2.3283064365386963e-10*n.c;return n.s0=n.s1,n.s1=n.s2,n.s2=e-(n.c=0|e)},n.c=1,n.s0=r(" "),n.s1=r(" "),n.s2=r(" "),n.s0-=r(e),n.s0<0&&(n.s0+=1),n.s1-=r(e),n.s1<0&&(n.s1+=1),n.s2-=r(e),n.s2<0&&(n.s2+=1),r=null}function i(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function u(e,t){var n=new o(e),r=t&&t.state,a=n.next;return a.int32=function(){return 4294967296*n.next()|0},a.double=function(){return a()+11102230246251565e-32*(2097152*a()|0)},a.quick=a,r&&("object"==typeof r&&i(r,n),a.state=function(){return i(n,{})}),a}a&&a.exports?a.exports=u:n(35)&&n(60)?void 0===(r=function(){return u}.call(t,n,t,a))||(a.exports=r):this.alea=u}(0,e,n(35))}).call(this,n(59)(e))},function(e,t,n){(function(e){var r;!function(e,a,s){function o(e){var t=this,n="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:n+=e;for(var r=0;r<n.length+64;r++)t.x^=0|n.charCodeAt(r),t.next()}function i(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t}function u(e,t){var n=new o(e),r=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,r&&("object"==typeof r&&i(r,n),a.state=function(){return i(n,{})}),a}a&&a.exports?a.exports=u:n(35)&&n(60)?void 0===(r=function(){return u}.call(t,n,t,a))||(a.exports=r):this.xor128=u}(0,e,n(35))}).call(this,n(59)(e))},function(e,t,n){(function(e){var r;!function(e,a,s){function o(e){var t=this,n="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,e===(0|e)?t.x=e:n+=e;for(var r=0;r<n.length+64;r++)t.x^=0|n.charCodeAt(r),r==n.length&&(t.d=t.x<<10^t.x>>>4),t.next()}function i(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function u(e,t){var n=new o(e),r=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,r&&("object"==typeof r&&i(r,n),a.state=function(){return i(n,{})}),a}a&&a.exports?a.exports=u:n(35)&&n(60)?void 0===(r=function(){return u}.call(t,n,t,a))||(a.exports=r):this.xorwow=u}(0,e,n(35))}).call(this,n(59)(e))},function(e,t,n){(function(e){var r;!function(e,a,s){function o(e){var t=this;t.next=function(){var e,n,r=t.x,a=t.i;return e=r[a],n=(e^=e>>>7)^e<<24,n^=(e=r[a+1&7])^e>>>10,n^=(e=r[a+3&7])^e>>>3,n^=(e=r[a+4&7])^e<<7,e=r[a+7&7],n^=(e^=e<<13)^e<<9,r[a]=n,t.i=a+1&7,n},function(e,t){var n,r=[];if(t===(0|t))r[0]=t;else for(t=""+t,n=0;n<t.length;++n)r[7&n]=r[7&n]<<15^t.charCodeAt(n)+r[n+1&7]<<13;for(;r.length<8;)r.push(0);for(n=0;n<8&&0===r[n];++n);for(8==n?r[7]=-1:r[n],e.x=r,e.i=0,n=256;n>0;--n)e.next()}(t,e)}function i(e,t){return t.x=e.x.slice(),t.i=e.i,t}function u(e,t){null==e&&(e=+new Date);var n=new o(e),r=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,r&&(r.x&&i(r,n),a.state=function(){return i(n,{})}),a}a&&a.exports?a.exports=u:n(35)&&n(60)?void 0===(r=function(){return u}.call(t,n,t,a))||(a.exports=r):this.xorshift7=u}(0,e,n(35))}).call(this,n(59)(e))},function(e,t,n){(function(e){var r;!function(e,a,s){function o(e){var t=this;t.next=function(){var e,n,r=t.w,a=t.X,s=t.i;return t.w=r=r+1640531527|0,n=a[s+34&127],e=a[s=s+1&127],n^=n<<13,e^=e<<17,n^=n>>>15,e^=e>>>12,n=a[s]=n^e,t.i=s,n+(r^r>>>16)|0},function(e,t){var n,r,a,s,o,i=[],u=128;for(t===(0|t)?(r=t,t=null):(t+="\0",r=0,u=Math.max(u,t.length)),a=0,s=-32;s<u;++s)t&&(r^=t.charCodeAt((s+32)%t.length)),0===s&&(o=r),r^=r<<10,r^=r>>>15,r^=r<<4,r^=r>>>13,s>=0&&(o=o+1640531527|0,a=0==(n=i[127&s]^=r+o)?a+1:0);for(a>=128&&(i[127&(t&&t.length||0)]=-1),a=127,s=512;s>0;--s)r=i[a+34&127],n=i[a=a+1&127],r^=r<<13,n^=n<<17,r^=r>>>15,n^=n>>>12,i[a]=r^n;e.w=o,e.X=i,e.i=a}(t,e)}function i(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function u(e,t){null==e&&(e=+new Date);var n=new o(e),r=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,r&&(r.X&&i(r,n),a.state=function(){return i(n,{})}),a}a&&a.exports?a.exports=u:n(35)&&n(60)?void 0===(r=function(){return u}.call(t,n,t,a))||(a.exports=r):this.xor4096=u}(0,e,n(35))}).call(this,n(59)(e))},function(e,t,n){(function(e){var r;!function(e,a,s){function o(e){var t=this,n="";t.next=function(){var e=t.b,n=t.c,r=t.d,a=t.a;return e=e<<25^e>>>7^n,n=n-r|0,r=r<<24^r>>>8^a,a=a-e|0,t.b=e=e<<20^e>>>12^n,t.c=n=n-r|0,t.d=r<<16^n>>>16^a,t.a=a-e|0},t.a=0,t.b=0,t.c=-1640531527,t.d=1367130551,e===Math.floor(e)?(t.a=e/4294967296|0,t.b=0|e):n+=e;for(var r=0;r<n.length+20;r++)t.b^=0|n.charCodeAt(r),t.next()}function i(e,t){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t}function u(e,t){var n=new o(e),r=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,r&&("object"==typeof r&&i(r,n),a.state=function(){return i(n,{})}),a}a&&a.exports?a.exports=u:n(35)&&n(60)?void 0===(r=function(){return u}.call(t,n,t,a))||(a.exports=r):this.tychei=u}(0,e,n(35))}).call(this,n(59)(e))},function(e,t,n){var r;!function(a,s,o){var i,u=256,c=o.pow(u,6),l=o.pow(2,52),d=2*l,p=255;function f(e,t,n){var r=[],p=g(b((t=1==t?{entropy:!0}:t||{}).entropy?[e,y(s)]:null==e?function(){try{var e;return i&&(e=i.randomBytes)?e=e(u):(e=new Uint8Array(u),(a.crypto||a.msCrypto).getRandomValues(e)),y(e)}catch(e){var t=a.navigator,n=t&&t.plugins;return[+new Date,a,n,a.screen,y(s)]}}():e,3),r),f=new h(r),w=function(){for(var e=f.g(6),t=c,n=0;e<l;)e=(e+n)*u,t*=u,n=f.g(1);for(;e>=d;)e/=2,t/=2,n>>>=1;return(e+n)/t};return w.int32=function(){return 0|f.g(4)},w.quick=function(){return f.g(4)/4294967296},w.double=w,g(y(f.S),s),(t.pass||n||function(e,t,n,r){return r&&(r.S&&m(r,f),e.state=function(){return m(f,{})}),n?(o.random=e,t):e})(w,p,"global"in t?t.global:this==o,t.state)}function h(e){var t,n=e.length,r=this,a=0,s=r.i=r.j=0,o=r.S=[];for(n||(e=[n++]);a<u;)o[a]=a++;for(a=0;a<u;a++)o[a]=o[s=p&s+e[a%n]+(t=o[a])],o[s]=t;(r.g=function(e){for(var t,n=0,a=r.i,s=r.j,o=r.S;e--;)t=o[a=p&a+1],n=n*u+o[p&(o[a]=o[s=p&s+t])+(o[s]=t)];return r.i=a,r.j=s,n})(u)}function m(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function b(e,t){var n,r=[],a=typeof e;if(t&&"object"==a)for(n in e)try{r.push(b(e[n],t-1))}catch(e){}return r.length?r:"string"==a?e:e+"\0"}function g(e,t){for(var n,r=e+"",a=0;a<r.length;)t[p&a]=p&(n^=19*t[p&a])+r.charCodeAt(a++);return y(t)}function y(e){return String.fromCharCode.apply(0,e)}if(g(o.random(),s),e.exports){e.exports=f;try{i=n(138)}catch(e){}}else void 0===(r=function(){return f}.call(t,n,t,e))||(e.exports=r)}("undefined"!=typeof self?self:this,[],Math)},function(e,t){},function(e,t,n){(function(e){var r="undefined"!=typeof e&&e||"undefined"!=typeof self&&self||window,a=Function.prototype.apply;function s(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new s(a.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new s(a.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(140),t.setImmediate="undefined"!=typeof self&&self.setImmediate||"undefined"!=typeof e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||"undefined"!=typeof e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(63))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,a,s,o,i,u=1,c={},l=!1,d=e.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(e);p=p&&p.setTimeout?p:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){h(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((s=new MessageChannel).port1.onmessage=function(e){h(e.data)},r=function(e){s.port2.postMessage(e)}):d&&"onreadystatechange"in d.createElement("script")?(a=d.documentElement,r=function(e){var t=d.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,a.removeChild(t),t=null},a.appendChild(t)}):r=function(e){setTimeout(h,0,e)}:(o="setImmediate$"+Math.random()+"$",i=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&h(+t.data.slice(o.length))},e.addEventListener?e.addEventListener("message",i,!1):e.attachEvent("onmessage",i),r=function(t){e.postMessage(o+t,"*")}),p.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var a={callback:e,args:t};return c[u]=a,r(u),u++},p.clearImmediate=f}function f(e){delete c[e]}function h(e){if(l)setTimeout(h,0,e);else{var t=c[e];if(t){l=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{f(e),l=!1}}}}}("undefined"==typeof self?"undefined"==typeof e?this:e:self)}).call(this,n(63),n(58))},function(e,t,n){"use strict";(function(e){var t=n(11);const r=()=>n(142);let a;class s{constructor(){this.util=n(143),this.textEncoder=new this.util.TextEncoder}fetch(e,n){return null!=Object(t.c)().global.fetch?Object(t.c)().global.fetch(e,n):(null==a&&(a=r()),a(e,n))}now(){const t=e.hrtime();return 1e3*t[0]+t[1]/1e6}encode(e,t){if("utf-8"!==t&&"utf8"!==t)throw new Error(`Node built-in encoder only supports utf-8, but got ${t}`);return this.textEncoder.encode(e)}decode(e,t){return 0===e.length?"":new this.util.TextDecoder(t).decode(e)}isTypedArray(e){return this.util.types.isFloat32Array(e)||this.util.types.isInt32Array(e)||this.util.types.isUint8Array(e)||this.util.types.isUint8ClampedArray(e)}}Object(t.c)().get("IS_NODE")&&!Object(t.c)().get("IS_BROWSER")&&Object(t.c)().setPlatform("node",new s)}).call(this,n(58))},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.r(t),n.d(t,"_fusedMatMulConfig",(function(){return o}));var r=n(5),a=n(33);let s;const o={kernelName:r._FusedMatMul,backendName:"wasm",setupFunc:function(e){s=e.wasm.cwrap(r._FusedMatMul,null,["number","array","number","number","array","number","number","number","number","number","number","number","number"])},kernelFunc:function(e){const{inputs:t,backend:n,attrs:o}=e,{a:i,b:u,bias:c,preluActivationWeights:l}=t;if("float32"!==i.dtype||"float32"!==u.dtype)throw new Error("_FusedMatMul for non non-float32 tensors not yet supported.");const{transposeA:d,transposeB:p,activation:f,leakyreluAlpha:h}=o,m=n.dataIdMap.get(i.dataId).id,b=n.dataIdMap.get(u.dataId).id;let g=0;if(null!=c){const e=n.dataIdMap.get(c.dataId);if(1!==e.shape.length)throw new Error(`_FusedMatMul only supports rank-1 bias but got rank ${e.shape.length}.`);g=e.id}const y=null==l?0:n.dataIdMap.get(l.dataId).id,w=a.b[f];if(null==w)throw new Error(`${f} activation not yet supported for FusedConv2D in the wasm backend.`);const O=d?i.shape[2]:i.shape[1],v=p?u.shape[1]:u.shape[2],j=r.broadcast_util.assertAndGetBroadcastShape(i.shape.slice(0,-2),u.shape.slice(0,-2)),_=n.makeOutput([...j,O,v],i.dtype),x=n.dataIdMap.get(_.dataId).id,S=new Uint8Array(new Int32Array(i.shape).buffer),k=new Uint8Array(new Int32Array(u.shape).buffer);return s(m,S,i.shape.length,b,k,u.shape.length,d,p,w,g,y,h||0,x),_}}},function(e,t,n){"use strict";n.r(t),n.d(t,"addConfig",(function(){return s}));var r=n(5),a=n(37);const s=Object(a.a)(r.Add,!0)},function(e,t,n){"use strict";n.r(t),n.d(t,"avgPoolConfig",(function(){return s}));var r=n(5);let a;const s={kernelName:r.AvgPool,backendName:"wasm",setupFunc:function(e){a=e.wasm.cwrap(r.AvgPool,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number"])},kernelFunc:function(e){const{inputs:t,attrs:n,backend:s}=e,o=t.x,i=s.dataIdMap.get(o.dataId).id,{filterSize:u,strides:c,pad:l,dimRoundingMode:d}=n,p=r.backend_util.computePool2DInfo(o.shape,u,c,1,l,d),f=p.filterHeight,h=p.filterWidth,m=p.padInfo.top,b=p.padInfo.right,g=p.padInfo.bottom,y=p.padInfo.left,w=p.strideHeight,O=p.strideWidth,v=p.inChannels;if("channelsLast"!==p.dataFormat)throw new Error(`wasm backend does not support dataFormat:'${p.dataFormat}'. Please use 'channelsLast'.`);if(1!==p.dilationWidth||1!==p.dilationHeight)throw new Error(`was backend only supports average pooling with dilation = [1, 1], got [${p.dilationHeight}, ${p.dilationWidth}].`);const j=s.makeOutput(p.outShape,"float32"),_=s.dataIdMap.get(j.dataId).id;return a(i,o.shape[0],o.shape[1],o.shape[2],f,h,m,b,g,y,w,O,v,_),j}}},function(e,t,n){"use strict";n.r(t),n.d(t,"conv2DConfig",(function(){return s}));var r=n(5);let a;const s={kernelName:r.Conv2D,backendName:"wasm",setupFunc:function(e){a=e.wasm.cwrap(r.Conv2D,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])},kernelFunc:function(e){const{inputs:t,attrs:n,backend:s}=e,{x:o,filter:i}=t,u=s.dataIdMap.get(o.dataId).id,c=s.dataIdMap.get(i.dataId).id,{strides:l,dilations:d,pad:p,dimRoundingMode:f,dataFormat:h}=n,m=r.backend_util.convertConv2DDataFormat(h),b=r.backend_util.computeConv2DInfo(o.shape,i.shape,l,d,p,f,!1,m),g=b.filterHeight,y=b.filterWidth,w=b.padInfo.top,O=b.padInfo.right,v=b.padInfo.bottom,j=b.padInfo.left,_=b.dilationHeight,x=b.dilationWidth,S=b.strideHeight,k=b.strideWidth,E=b.inChannels,T=b.outChannels,N="SAME"===b.padInfo.type?1:0;if("channelsLast"!==b.dataFormat)throw new Error(`wasm backend Conv2D does not support dataFormat:'${b.dataFormat}'. Please use 'channelsLast'.`);const A=s.makeOutput(b.outShape,"float32"),M=s.dataIdMap.get(A.dataId).id;return a(u,o.shape[0],o.shape[1],o.shape[2],c,g,y,w,O,v,j,N,_,x,S,k,E,T,M),A}}},function(e,t,n){"use strict";n.r(t),n.d(t,"fusedConv2DConfig",(function(){return o}));var r=n(5),a=n(33);let s;const o={kernelName:r.FusedConv2D,backendName:"wasm",setupFunc:function(e){s=e.wasm.cwrap(r.FusedConv2D,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])},kernelFunc:function(e){const{inputs:t,attrs:n,backend:o}=e,{x:i,filter:u,bias:c,preluActivationWeights:l}=t,{strides:d,pad:p,dilations:f,dataFormat:h,dimRoundingMode:m,activation:b,leakyreluAlpha:g}=n,y=r.backend_util.computeConv2DInfo(i.shape,u.shape,d,f,p,m),w=a.b[b];if(null==w)throw new Error(`${b} activation not yet supported for FusedConv2D in the wasm backend.`);const O=o.dataIdMap.get(i.dataId).id,v=o.dataIdMap.get(u.dataId).id,j=y.outChannels;let _=0;if(null!=c){const e=o.dataIdMap.get(c.dataId);if(1!==e.shape.length)throw new Error(`FusedConv2D only supports rank-1 bias but got rank ${e.shape.length}.`);if(e.shape[0]!==j)throw new Error(`FusedConv2D bias shape (${e.shape}) does not match the number of output channels (${j})`);_=e.id}const x=y.filterHeight,S=y.filterWidth,k=y.padInfo.top,E=y.padInfo.right,T=y.padInfo.bottom,N=y.padInfo.left,A=y.dilationHeight,M=y.dilationWidth,I=y.strideHeight,D=y.strideWidth,$=y.inChannels,C="SAME"===y.padInfo.type?1:0,R=y.batchSize,P=y.inHeight,F=y.inWidth;if("NHWC"!==h)throw new Error(`wasm backend FusedConv2D does not support dataFormat:'${h}'. Please use 'NHWC'.`);const B=o.makeOutput(y.outShape,"float32"),L=o.dataIdMap.get(B.dataId).id,z=null==l?0:o.dataIdMap.get(l.dataId).id;return s(O,R,P,F,v,x,S,_,k,E,T,N,C,A,M,I,D,$,j,w,z,g||0,L),B}}},function(e,t,n){"use strict";n.r(t),n.d(t,"fusedDepthwiseConv2DConfig",(function(){return o}));var r=n(5),a=n(33);let s;const o={kernelName:r.FusedDepthwiseConv2D,backendName:"wasm",setupFunc:function(e){s=e.wasm.cwrap(r.FusedDepthwiseConv2D,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])},kernelFunc:function(e){const{inputs:t,attrs:n,backend:o}=e,{x:i,filter:u,bias:c,preluActivationWeights:l}=t,{strides:d,pad:p,dilations:f,dataFormat:h,dimRoundingMode:m,activation:b,leakyreluAlpha:g}=n,y=r.backend_util.computeConv2DInfo(i.shape,u.shape,d,f,p,m,!0),w=a.b[b];if(null==w)throw new Error(`${b} activation not yet supported for FusedDepthwiseConv2D in the wasm backend.`);const O=o.dataIdMap.get(i.dataId).id,v=o.dataIdMap.get(u.dataId).id,j=y.outChannels;let _=0;if(null!=c){const e=o.dataIdMap.get(c.dataId);if(1!==e.shape.length)throw new Error(`FusedDepthwiseConv2D only supports rank-1 bias but got rank ${e.shape.length}.`);if(e.shape[0]!==j)throw new Error(`FusedDepthwiseConv2D bias shape (${e.shape}) does not match the number of output channels (${j})`);_=e.id}const x=y.filterHeight,S=y.filterWidth,k=y.padInfo.top,E=y.padInfo.right,T=y.padInfo.bottom,N=y.padInfo.left,A=y.dilationHeight,M=y.dilationWidth,I=y.strideHeight,D=y.strideWidth,$=y.inChannels,C="SAME"===y.padInfo.type?1:0,R=y.batchSize,P=y.inHeight,F=y.inWidth;if("NHWC"!==h)throw new Error(`wasm backend FusedDepthwiseConv2D does not support dataFormat:'${h}'. Please use 'NHWC'.`);const B=o.makeOutput(y.outShape,"float32"),L=o.dataIdMap.get(B.dataId).id,z=null==l?0:o.dataIdMap.get(l.dataId).id;return s(O,R,P,F,v,x,S,_,k,E,T,N,C,A,M,I,D,$,j,w,z,g||0,L),B}}},function(e,t,n){"use strict";n.r(t),n.d(t,"maximumConfig",(function(){return s}));var r=n(5),a=n(37);const s=Object(a.a)(r.Maximum,!1)},function(e,t,n){"use strict";n.r(t),n.d(t,"minimumConfig",(function(){return s}));var r=n(5),a=n(37);const s=Object(a.a)(r.Minimum,!1)},function(e,t,n){"use strict";n.r(t),n.d(t,"modConfig",(function(){return s}));var r=n(5),a=n(37);const s=Object(a.a)(r.Mod,!0)},function(e,t,n){"use strict";n.r(t),n.d(t,"multiplyConfig",(function(){return s}));var r=n(5),a=n(37);const s=Object(a.a)(r.Multiply,!0)},function(e,t,n){"use strict";n.r(t),n.d(t,"pack",(function(){return o})),n.d(t,"packConfig",(function(){return i}));var r=n(5),a=n(91),s=n(81);function o(e){const{inputs:t,backend:n,attrs:o}=e,{axis:i}=o;if(1===t.length)return Object(s.expandDims)({inputs:{input:t[0]},backend:n,attrs:{dim:i}});const u=t[0].shape,c=t[0].dtype;t.forEach((e=>{r.util.assertShapesMatch(u,e.shape,"All tensors passed to stack must have matching shapes"),r.util.assert(c===e.dtype,(()=>"All tensors passed to stack must have matching dtypes"))}));const l=[],d=t.map((e=>{const t=Object(s.expandDims)({inputs:{input:e},backend:n,attrs:{dim:i}});return l.push(t),t})),p=Object(a.concat)({inputs:d,backend:n,attrs:{axis:i}});return l.forEach((e=>n.disposeData(e.dataId))),p}const i={kernelName:r.Pack,backendName:"wasm",kernelFunc:o}},function(e,t,n){"use strict";n.r(t),n.d(t,"reluConfig",(function(){return s}));var r=n(5),a=n(82);const s=Object(a.a)(r.Relu)},function(e,t,n){"use strict";n.r(t),n.d(t,"relu6Config",(function(){return s}));var r=n(5),a=n(82);const s=Object(a.a)(r.Relu6)},function(e,t,n){"use strict";n.r(t),n.d(t,"sigmoidConfig",(function(){return s}));var r=n(5);let a;const s={kernelName:"Sigmoid",backendName:"wasm",setupFunc:function(e){a=e.wasm.cwrap(r.Sigmoid,null,["number","number"])},kernelFunc:function(e){const{backend:t,inputs:{x:n}}=e,s=t.dataIdMap.get(n.dataId).id,o=t.makeOutput(n.shape,n.dtype),i=t.dataIdMap.get(o.dataId).id;return 0===r.util.sizeFromShape(o.shape)||a(s,i),o}}},function(e,t,n){"use strict";n.r(t),n.d(t,"softmax",(function(){return s})),n.d(t,"softmaxConfig",(function(){return o}));var r=n(5);let a;function s(e){const{backend:t,inputs:{logits:n},attrs:{dim:s}}=e,o=t.dataIdMap.get(n.dataId).id,i=t.makeOutput(n.shape,n.dtype),u=t.dataIdMap.get(i.dataId).id,c=n.shape[s],l=r.util.sizeFromShape(n.shape)/c;return 0===r.util.sizeFromShape(i.shape)||a(o,u,c,l),i}const o={kernelName:r.Softmax,backendName:"wasm",setupFunc:function(e){a=e.wasm.cwrap(r.Softmax,null,["number","number","number","number"])},kernelFunc:s}},function(e,t,n){"use strict";n.r(t),n.d(t,"subConfig",(function(){return s}));var r=n(5),a=n(37);const s=Object(a.a)(r.Sub,!0)},function(e,t,n){"use strict";var r,a=(r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(e={}){var t,n,a=e;a.ready=new Promise(((e,r)=>{t=e,n=r}));var s,o,i,u=Object.assign({},a),c="./this.program",l=(e,t)=>{throw t},d="";d=self.location.href,r&&(d=r),d=0!==d.indexOf("blob:")?d.substr(0,d.replace(/[?#].*/,"").lastIndexOf("/")+1):"",s=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},i=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)},o=(e,t,n)=>{var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)};var p,f=a.print||console.log.bind(console),h=a.printErr||console.error.bind(console);Object.assign(a,u),u=null,a.arguments&&a.arguments,a.thisProgram&&(c=a.thisProgram),a.quit&&(l=a.quit),a.wasmBinary&&(p=a.wasmBinary);var m,b=a.noExitRuntime||!0;"object"!=typeof WebAssembly&&L("no native wasm support detected");var g,y,w,O,v,j,_,x,S,k=!1;function E(){var e=m.buffer;a.HEAP8=g=new Int8Array(e),a.HEAP16=w=new Int16Array(e),a.HEAPU8=y=new Uint8Array(e),a.HEAPU16=O=new Uint16Array(e),a.HEAP32=v=new Int32Array(e),a.HEAPU32=j=new Uint32Array(e),a.HEAPF32=_=new Float32Array(e),a.HEAPF64=x=new Float64Array(e)}var T,N,A,M,I=[],D=[],$=[],C=0,R=null,P=null;function F(e){C++,a.monitorRunDependencies&&a.monitorRunDependencies(C)}function B(e){if(C--,a.monitorRunDependencies&&a.monitorRunDependencies(C),0==C&&(null!==R&&(clearInterval(R),R=null),P)){var t=P;P=null,t()}}function L(e){a.onAbort&&a.onAbort(e),h(e="Aborted("+e+")"),k=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw n(t),t}function z(e){return e.startsWith("data:application/octet-stream;base64,")}function W(e){if(e==T&&p)return new Uint8Array(p);if(i)return i(e);throw"both async and sync fetching of the wasm failed"}function U(e,t,n){return function(e){return p||"function"!=typeof fetch?Promise.resolve().then((()=>W(e))):fetch(e,{credentials:"same-origin"}).then((t=>{if(!t.ok)throw"failed to load wasm binary file at '"+e+"'";return t.arrayBuffer()})).catch((()=>W(e)))}(e).then((e=>WebAssembly.instantiate(e,t))).then((e=>e)).then(n,(e=>{h(`failed to asynchronously prepare wasm: ${e}`),L(e)}))}z(T="ScanbotSDK.Asm-simd.wasm")||(N=T,T=a.locateFile?a.locateFile(N,d):d+N);var V={1696288:e=>gn(function(){return this[me(e)].toString()}.apply((0,eval)("(()=>this)()"))),1696402:(e,t,n,r,s)=>a.tfjs.loadModel(a,e,t,n,r,s),1696459:e=>{a.tfjs.disposeModel(e)},1696488:()=>{console.error("TensorflowJsModelProvider: model not loaded")},1696550:(e,t,n,r,s)=>a.tfjs.predict(a,e,t,n,r,s)};function G(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var q=e=>{for(;e.length>0;)e.shift()(a)},H=[],K=0,Y=0;function J(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){j[this.ptr+4>>2]=e},this.get_type=function(){return j[this.ptr+4>>2]},this.set_destructor=function(e){j[this.ptr+8>>2]=e},this.get_destructor=function(){return j[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,g[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=g[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,g[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=g[this.ptr+13>>0]},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)},this.set_adjusted_ptr=function(e){j[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return j[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Rn(this.get_type()))return j[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var X=e=>{var t=Y;if(!t)return En(0),0;var n=new J(t);n.set_adjusted_ptr(t);var r=n.get_type();if(!r)return En(0),t;for(var a in e){var s=e[a];if(0===s||s===r)break;var o=n.ptr+16;if(Cn(s,r,o))return En(s),t}return En(r),t},Z=()=>{var e=H.pop();e||L("no exception to throw");var t=e.excPtr;throw e.get_rethrown()||(H.push(e),e.set_rethrown(!0),e.set_caught(!1),K++),Y=t},Q={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var n=0,r=e.length-1;r>=0;r--){var a=e[r];"."===a?e.splice(r,1):".."===a?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n;n--)e.unshift("..");return e},normalize:e=>{var t=Q.isAbs(e),n="/"===e.substr(-1);return(e=Q.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=Q.splitPath(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},basename:e=>{if("/"===e)return"/";var t=(e=(e=Q.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments);return Q.normalize(e.join("/"))},join2:(e,t)=>Q.normalize(e+"/"+t)},ee=e=>(ee=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);L("initRandomDevice")})())(e),te={resolve:function(){for(var e="",t=!1,n=arguments.length-1;n>=-1&&!t;n--){var r=n>=0?arguments[n]:he.cwd();if("string"!=typeof r)throw new TypeError("Arguments to path.resolve must be strings");if(!r)return"";e=r+"/"+e,t=Q.isAbs(r)}return(t?"/":"")+(e=Q.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||"."},relative:(e,t)=>{function n(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=te.resolve(e).substr(1),t=te.resolve(t).substr(1);for(var r=n(e.split("/")),a=n(t.split("/")),s=Math.min(r.length,a.length),o=s,i=0;i<s;i++)if(r[i]!==a[i]){o=i;break}var u=[];for(i=o;i<r.length;i++)u.push("..");return(u=u.concat(a.slice(o))).join("/")}},ne="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,re=(e,t,n)=>{for(var r=t+n,a=t;e[a]&&!(a>=r);)++a;if(a-t>16&&e.buffer&&ne)return ne.decode(e.subarray(t,a));for(var s="";t<a;){var o=e[t++];if(128&o){var i=63&e[t++];if(192!=(224&o)){var u=63&e[t++];if((o=224==(240&o)?(15&o)<<12|i<<6|u:(7&o)<<18|i<<12|u<<6|63&e[t++])<65536)s+=String.fromCharCode(o);else{var c=o-65536;s+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else s+=String.fromCharCode((31&o)<<6|i)}else s+=String.fromCharCode(o)}return s},ae=[],se=e=>{for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);r<=127?t++:r<=2047?t+=2:r>=55296&&r<=57343?(t+=4,++n):t+=3}return t},oe=(e,t,n,r)=>{if(!(r>0))return 0;for(var a=n,s=n+r-1,o=0;o<e.length;++o){var i=e.charCodeAt(o);if(i>=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++o)),i<=127){if(n>=s)break;t[n++]=i}else if(i<=2047){if(n+1>=s)break;t[n++]=192|i>>6,t[n++]=128|63&i}else if(i<=65535){if(n+2>=s)break;t[n++]=224|i>>12,t[n++]=128|i>>6&63,t[n++]=128|63&i}else{if(n+3>=s)break;t[n++]=240|i>>18,t[n++]=128|i>>12&63,t[n++]=128|i>>6&63,t[n++]=128|63&i}}return t[n]=0,n-a};function ie(e,t,n){var r=n>0?n:se(e)+1,a=new Array(r),s=oe(e,a,0,a.length);return t&&(a.length=s),a}var ue={ttys:[],init(){},shutdown(){},register(e,t){ue.ttys[e]={input:[],output:[],ops:t},he.registerDevice(e,ue.stream_ops)},stream_ops:{open(e){var t=ue.ttys[e.node.rdev];if(!t)throw new he.ErrnoError(43);e.tty=t,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,t,n,r,a){if(!e.tty||!e.tty.ops.get_char)throw new he.ErrnoError(60);for(var s=0,o=0;o<r;o++){var i;try{i=e.tty.ops.get_char(e.tty)}catch(e){throw new he.ErrnoError(29)}if(void 0===i&&0===s)throw new he.ErrnoError(6);if(null==i)break;s++,t[n+o]=i}return s&&(e.node.timestamp=Date.now()),s},write(e,t,n,r,a){if(!e.tty||!e.tty.ops.put_char)throw new he.ErrnoError(60);try{for(var s=0;s<r;s++)e.tty.ops.put_char(e.tty,t[n+s])}catch(e){throw new he.ErrnoError(29)}return r&&(e.node.timestamp=Date.now()),s}},default_tty_ops:{get_char:e=>(()=>{if(!ae.length){var e=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n"),!e)return null;ae=ie(e,!0)}return ae.shift()})(),put_char(e,t){null===t||10===t?(f(re(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(f(re(e.output,0)),e.output=[])},ioctl_tcgets:e=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ioctl_tcsets:(e,t,n)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,t){null===t||10===t?(h(re(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(h(re(e.output,0)),e.output=[])}}},ce=e=>{e=((e,t)=>Math.ceil(e/t)*t)(e,65536);var t=Nn(65536,e);return t?((e,t)=>(y.fill(0,e,e+t),e))(t,e):0},le={ops_table:null,mount:e=>le.createNode(null,"/",16895,0),createNode(e,t,n,r){if(he.isBlkdev(n)||he.isFIFO(n))throw new he.ErrnoError(63);le.ops_table||(le.ops_table={dir:{node:{getattr:le.node_ops.getattr,setattr:le.node_ops.setattr,lookup:le.node_ops.lookup,mknod:le.node_ops.mknod,rename:le.node_ops.rename,unlink:le.node_ops.unlink,rmdir:le.node_ops.rmdir,readdir:le.node_ops.readdir,symlink:le.node_ops.symlink},stream:{llseek:le.stream_ops.llseek}},file:{node:{getattr:le.node_ops.getattr,setattr:le.node_ops.setattr},stream:{llseek:le.stream_ops.llseek,read:le.stream_ops.read,write:le.stream_ops.write,allocate:le.stream_ops.allocate,mmap:le.stream_ops.mmap,msync:le.stream_ops.msync}},link:{node:{getattr:le.node_ops.getattr,setattr:le.node_ops.setattr,readlink:le.node_ops.readlink},stream:{}},chrdev:{node:{getattr:le.node_ops.getattr,setattr:le.node_ops.setattr},stream:he.chrdev_stream_ops}});var a=he.createNode(e,t,n,r);return he.isDir(a.mode)?(a.node_ops=le.ops_table.dir.node,a.stream_ops=le.ops_table.dir.stream,a.contents={}):he.isFile(a.mode)?(a.node_ops=le.ops_table.file.node,a.stream_ops=le.ops_table.file.stream,a.usedBytes=0,a.contents=null):he.isLink(a.mode)?(a.node_ops=le.ops_table.link.node,a.stream_ops=le.ops_table.link.stream):he.isChrdev(a.mode)&&(a.node_ops=le.ops_table.chrdev.node,a.stream_ops=le.ops_table.chrdev.stream),a.timestamp=Date.now(),e&&(e.contents[t]=a,e.timestamp=a.timestamp),a},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,t){var n=e.contents?e.contents.length:0;if(!(n>=t)){t=Math.max(t,n*(n<1048576?2:1.125)>>>0),0!=n&&(t=Math.max(t,256));var r=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(r.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var n=e.contents;e.contents=new Uint8Array(t),n&&e.contents.set(n.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr(e){var t={};return t.dev=he.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,he.isDir(e.mode)?t.size=4096:he.isFile(e.mode)?t.size=e.usedBytes:he.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&le.resizeFileStorage(e,t.size)},lookup(e,t){throw he.genericErrors[44]},mknod:(e,t,n,r)=>le.createNode(e,t,n,r),rename(e,t,n){if(he.isDir(e.mode)){var r;try{r=he.lookupNode(t,n)}catch(e){}if(r)for(var a in r.contents)throw new he.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=n,t.contents[n]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir(e,t){var n=he.lookupNode(e,t);for(var r in n.contents)throw new he.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir(e){var t=[".",".."];for(var n in e.contents)e.contents.hasOwnProperty(n)&&t.push(n);return t},symlink(e,t,n){var r=le.createNode(e,t,41471,0);return r.link=n,r},readlink(e){if(!he.isLink(e.mode))throw new he.ErrnoError(28);return e.link}},stream_ops:{read(e,t,n,r,a){var s=e.node.contents;if(a>=e.node.usedBytes)return 0;var o=Math.min(e.node.usedBytes-a,r);if(o>8&&s.subarray)t.set(s.subarray(a,a+o),n);else for(var i=0;i<o;i++)t[n+i]=s[a+i];return o},write(e,t,n,r,a,s){if(t.buffer===g.buffer&&(s=!1),!r)return 0;var o=e.node;if(o.timestamp=Date.now(),t.subarray&&(!o.contents||o.contents.subarray)){if(s)return o.contents=t.subarray(n,n+r),o.usedBytes=r,r;if(0===o.usedBytes&&0===a)return o.contents=t.slice(n,n+r),o.usedBytes=r,r;if(a+r<=o.usedBytes)return o.contents.set(t.subarray(n,n+r),a),r}if(le.expandFileStorage(o,a+r),o.contents.subarray&&t.subarray)o.contents.set(t.subarray(n,n+r),a);else for(var i=0;i<r;i++)o.contents[a+i]=t[n+i];return o.usedBytes=Math.max(o.usedBytes,a+r),r},llseek(e,t,n){var r=t;if(1===n?r+=e.position:2===n&&he.isFile(e.node.mode)&&(r+=e.node.usedBytes),r<0)throw new he.ErrnoError(28);return r},allocate(e,t,n){le.expandFileStorage(e.node,t+n),e.node.usedBytes=Math.max(e.node.usedBytes,t+n)},mmap(e,t,n,r,a){if(!he.isFile(e.node.mode))throw new he.ErrnoError(43);var s,o,i=e.node.contents;if(2&a||i.buffer!==g.buffer){if((n>0||n+t<i.length)&&(i=i.subarray?i.subarray(n,n+t):Array.prototype.slice.call(i,n,n+t)),o=!0,!(s=ce(t)))throw new he.ErrnoError(48);g.set(i,s)}else o=!1,s=i.byteOffset;return{ptr:s,allocated:o}},msync:(e,t,n,r,a)=>(le.stream_ops.write(e,t,0,r,n,!1),0)}},de=(e,t,n,r)=>{var a=r?"":`al ${e}`;o(e,(n=>{var r;r=`Loading data file "${e}" failed (no arrayBuffer).`,n||L(r),t(new Uint8Array(n)),a&&B()}),(t=>{if(!n)throw`Loading data file "${e}" failed.`;n()})),a&&F()},pe=a.preloadPlugins||[],fe=(e,t)=>{var n=0;return e&&(n|=365),t&&(n|=146),n},he={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(e,t={}){if(!(e=te.resolve(e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new he.ErrnoError(32);for(var n=e.split("/").filter((e=>!!e)),r=he.root,a="/",s=0;s<n.length;s++){var o=s===n.length-1;if(o&&t.parent)break;if(r=he.lookupNode(r,n[s]),a=Q.join2(a,n[s]),he.isMountpoint(r)&&(!o||o&&t.follow_mount)&&(r=r.mounted.root),!o||t.follow)for(var i=0;he.isLink(r.mode);){var u=he.readlink(a);if(a=te.resolve(Q.dirname(a),u),r=he.lookupPath(a,{recurse_count:t.recurse_count+1}).node,i++>40)throw new he.ErrnoError(32)}}return{path:a,node:r}},getPath(e){for(var t;;){if(he.isRoot(e)){var n=e.mount.mountpoint;return t?"/"!==n[n.length-1]?`${n}/${t}`:n+t:n}t=t?`${e.name}/${t}`:e.name,e=e.parent}},hashName(e,t){for(var n=0,r=0;r<t.length;r++)n=(n<<5)-n+t.charCodeAt(r)|0;return(e+n>>>0)%he.nameTable.length},hashAddNode(e){var t=he.hashName(e.parent.id,e.name);e.name_next=he.nameTable[t],he.nameTable[t]=e},hashRemoveNode(e){var t=he.hashName(e.parent.id,e.name);if(he.nameTable[t]===e)he.nameTable[t]=e.name_next;else for(var n=he.nameTable[t];n;){if(n.name_next===e){n.name_next=e.name_next;break}n=n.name_next}},lookupNode(e,t){var n=he.mayLookup(e);if(n)throw new he.ErrnoError(n,e);for(var r=he.hashName(e.id,t),a=he.nameTable[r];a;a=a.name_next){var s=a.name;if(a.parent.id===e.id&&s===t)return a}return he.lookup(e,t)},createNode(e,t,n,r){var a=new he.FSNode(e,t,n,r);return he.hashAddNode(a),a},destroyNode(e){he.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>49152==(49152&e),flagsToPermissionString(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>he.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup(e){var t=he.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate(e,t){try{return he.lookupNode(e,t),20}catch(e){}return he.nodePermissions(e,"wx")},mayDelete(e,t,n){var r;try{r=he.lookupNode(e,t)}catch(e){return e.errno}var a=he.nodePermissions(e,"wx");if(a)return a;if(n){if(!he.isDir(r.mode))return 54;if(he.isRoot(r)||he.getPath(r)===he.cwd())return 10}else if(he.isDir(r.mode))return 31;return 0},mayOpen:(e,t)=>e?he.isLink(e.mode)?32:he.isDir(e.mode)&&("r"!==he.flagsToPermissionString(t)||512&t)?31:he.nodePermissions(e,he.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=he.MAX_OPEN_FDS;e++)if(!he.streams[e])return e;throw new he.ErrnoError(33)},getStreamChecked(e){var t=he.getStream(e);if(!t)throw new he.ErrnoError(8);return t},getStream:e=>he.streams[e],createStream:(e,t=-1)=>(he.FSStream||(he.FSStream=function(){this.shared={}},he.FSStream.prototype={},Object.defineProperties(he.FSStream.prototype,{object:{get(){return this.node},set(e){this.node=e}},isRead:{get(){return 1!=(2097155&this.flags)}},isWrite:{get(){return 0!=(2097155&this.flags)}},isAppend:{get(){return 1024&this.flags}},flags:{get(){return this.shared.flags},set(e){this.shared.flags=e}},position:{get(){return this.shared.position},set(e){this.shared.position=e}}})),e=Object.assign(new he.FSStream,e),-1==t&&(t=he.nextfd()),e.fd=t,he.streams[t]=e,e),closeStream(e){he.streams[e]=null},chrdev_stream_ops:{open(e){var t=he.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek(){throw new he.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice(e,t){he.devices[e]={stream_ops:t}},getDevice:e=>he.devices[e],getMounts(e){for(var t=[],n=[e];n.length;){var r=n.pop();t.push(r),n.push.apply(n,r.mounts)}return t},syncfs(e,t){"function"==typeof e&&(t=e,e=!1),he.syncFSRequests++,he.syncFSRequests>1&&h(`warning: ${he.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var n=he.getMounts(he.root.mount),r=0;function a(e){return he.syncFSRequests--,t(e)}function s(e){if(e)return s.errored?void 0:(s.errored=!0,a(e));++r>=n.length&&a(null)}n.forEach((t=>{if(!t.type.syncfs)return s(null);t.type.syncfs(t,e,s)}))},mount(e,t,n){var r,a="/"===n,s=!n;if(a&&he.root)throw new he.ErrnoError(10);if(!a&&!s){var o=he.lookupPath(n,{follow_mount:!1});if(n=o.path,r=o.node,he.isMountpoint(r))throw new he.ErrnoError(10);if(!he.isDir(r.mode))throw new he.ErrnoError(54)}var i={type:e,opts:t,mountpoint:n,mounts:[]},u=e.mount(i);return u.mount=i,i.root=u,a?he.root=u:r&&(r.mounted=i,r.mount&&r.mount.mounts.push(i)),u},unmount(e){var t=he.lookupPath(e,{follow_mount:!1});if(!he.isMountpoint(t.node))throw new he.ErrnoError(28);var n=t.node,r=n.mounted,a=he.getMounts(r);Object.keys(he.nameTable).forEach((e=>{for(var t=he.nameTable[e];t;){var n=t.name_next;a.includes(t.mount)&&he.destroyNode(t),t=n}})),n.mounted=null;var s=n.mount.mounts.indexOf(r);n.mount.mounts.splice(s,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod(e,t,n){var r=he.lookupPath(e,{parent:!0}).node,a=Q.basename(e);if(!a||"."===a||".."===a)throw new he.ErrnoError(28);var s=he.mayCreate(r,a);if(s)throw new he.ErrnoError(s);if(!r.node_ops.mknod)throw new he.ErrnoError(63);return r.node_ops.mknod(r,a,t,n)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,he.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,he.mknod(e,t,0)),mkdirTree(e,t){for(var n=e.split("/"),r="",a=0;a<n.length;++a)if(n[a]){r+="/"+n[a];try{he.mkdir(r,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,n)=>("undefined"==typeof n&&(n=t,t=438),t|=8192,he.mknod(e,t,n)),symlink(e,t){if(!te.resolve(e))throw new he.ErrnoError(44);var n=he.lookupPath(t,{parent:!0}).node;if(!n)throw new he.ErrnoError(44);var r=Q.basename(t),a=he.mayCreate(n,r);if(a)throw new he.ErrnoError(a);if(!n.node_ops.symlink)throw new he.ErrnoError(63);return n.node_ops.symlink(n,r,e)},rename(e,t){var n,r,a=Q.dirname(e),s=Q.dirname(t),o=Q.basename(e),i=Q.basename(t);if(n=he.lookupPath(e,{parent:!0}).node,r=he.lookupPath(t,{parent:!0}).node,!n||!r)throw new he.ErrnoError(44);if(n.mount!==r.mount)throw new he.ErrnoError(75);var u,c=he.lookupNode(n,o),l=te.relative(e,s);if("."!==l.charAt(0))throw new he.ErrnoError(28);if("."!==(l=te.relative(t,a)).charAt(0))throw new he.ErrnoError(55);try{u=he.lookupNode(r,i)}catch(e){}if(c!==u){var d=he.isDir(c.mode),p=he.mayDelete(n,o,d);if(p)throw new he.ErrnoError(p);if(p=u?he.mayDelete(r,i,d):he.mayCreate(r,i))throw new he.ErrnoError(p);if(!n.node_ops.rename)throw new he.ErrnoError(63);if(he.isMountpoint(c)||u&&he.isMountpoint(u))throw new he.ErrnoError(10);if(r!==n&&(p=he.nodePermissions(n,"w")))throw new he.ErrnoError(p);he.hashRemoveNode(c);try{n.node_ops.rename(c,r,i)}catch(e){throw e}finally{he.hashAddNode(c)}}},rmdir(e){var t=he.lookupPath(e,{parent:!0}).node,n=Q.basename(e),r=he.lookupNode(t,n),a=he.mayDelete(t,n,!0);if(a)throw new he.ErrnoError(a);if(!t.node_ops.rmdir)throw new he.ErrnoError(63);if(he.isMountpoint(r))throw new he.ErrnoError(10);t.node_ops.rmdir(t,n),he.destroyNode(r)},readdir(e){var t=he.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new he.ErrnoError(54);return t.node_ops.readdir(t)},unlink(e){var t=he.lookupPath(e,{parent:!0}).node;if(!t)throw new he.ErrnoError(44);var n=Q.basename(e),r=he.lookupNode(t,n),a=he.mayDelete(t,n,!1);if(a)throw new he.ErrnoError(a);if(!t.node_ops.unlink)throw new he.ErrnoError(63);if(he.isMountpoint(r))throw new he.ErrnoError(10);t.node_ops.unlink(t,n),he.destroyNode(r)},readlink(e){var t=he.lookupPath(e).node;if(!t)throw new he.ErrnoError(44);if(!t.node_ops.readlink)throw new he.ErrnoError(28);return te.resolve(he.getPath(t.parent),t.node_ops.readlink(t))},stat(e,t){var n=he.lookupPath(e,{follow:!t}).node;if(!n)throw new he.ErrnoError(44);if(!n.node_ops.getattr)throw new he.ErrnoError(63);return n.node_ops.getattr(n)},lstat:e=>he.stat(e,!0),chmod(e,t,n){var r;if(!(r="string"==typeof e?he.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new he.ErrnoError(63);r.node_ops.setattr(r,{mode:4095&t|-4096&r.mode,timestamp:Date.now()})},lchmod(e,t){he.chmod(e,t,!0)},fchmod(e,t){var n=he.getStreamChecked(e);he.chmod(n.node,t)},chown(e,t,n,r){var a;if(!(a="string"==typeof e?he.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new he.ErrnoError(63);a.node_ops.setattr(a,{timestamp:Date.now()})},lchown(e,t,n){he.chown(e,t,n,!0)},fchown(e,t,n){var r=he.getStreamChecked(e);he.chown(r.node,t,n)},truncate(e,t){if(t<0)throw new he.ErrnoError(28);var n;if(!(n="string"==typeof e?he.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new he.ErrnoError(63);if(he.isDir(n.mode))throw new he.ErrnoError(31);if(!he.isFile(n.mode))throw new he.ErrnoError(28);var r=he.nodePermissions(n,"w");if(r)throw new he.ErrnoError(r);n.node_ops.setattr(n,{size:t,timestamp:Date.now()})},ftruncate(e,t){var n=he.getStreamChecked(e);if(0==(2097155&n.flags))throw new he.ErrnoError(28);he.truncate(n.node,t)},utime(e,t,n){var r=he.lookupPath(e,{follow:!0}).node;r.node_ops.setattr(r,{timestamp:Math.max(t,n)})},open(e,t,n){if(""===e)throw new he.ErrnoError(44);var r;if(n="undefined"==typeof n?438:n,n=64&(t="string"==typeof t?(e=>{var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if("undefined"==typeof t)throw new Error(`Unknown file open mode: ${e}`);return t})(t):t)?4095&n|32768:0,"object"==typeof e)r=e;else{e=Q.normalize(e);try{r=he.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var s=!1;if(64&t)if(r){if(128&t)throw new he.ErrnoError(20)}else r=he.mknod(e,n,0),s=!0;if(!r)throw new he.ErrnoError(44);if(he.isChrdev(r.mode)&&(t&=-513),65536&t&&!he.isDir(r.mode))throw new he.ErrnoError(54);if(!s){var o=he.mayOpen(r,t);if(o)throw new he.ErrnoError(o)}512&t&&!s&&he.truncate(r,0),t&=-131713;var i=he.createStream({node:r,path:he.getPath(r),flags:t,seekable:!0,position:0,stream_ops:r.stream_ops,ungotten:[],error:!1});return i.stream_ops.open&&i.stream_ops.open(i),!a.logReadFiles||1&t||(he.readFiles||(he.readFiles={}),e in he.readFiles||(he.readFiles[e]=1)),i},close(e){if(he.isClosed(e))throw new he.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{he.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,t,n){if(he.isClosed(e))throw new he.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new he.ErrnoError(70);if(0!=n&&1!=n&&2!=n)throw new he.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,n),e.ungotten=[],e.position},read(e,t,n,r,a){if(r<0||a<0)throw new he.ErrnoError(28);if(he.isClosed(e))throw new he.ErrnoError(8);if(1==(2097155&e.flags))throw new he.ErrnoError(8);if(he.isDir(e.node.mode))throw new he.ErrnoError(31);if(!e.stream_ops.read)throw new he.ErrnoError(28);var s="undefined"!=typeof a;if(s){if(!e.seekable)throw new he.ErrnoError(70)}else a=e.position;var o=e.stream_ops.read(e,t,n,r,a);return s||(e.position+=o),o},write(e,t,n,r,a,s){if(r<0||a<0)throw new he.ErrnoError(28);if(he.isClosed(e))throw new he.ErrnoError(8);if(0==(2097155&e.flags))throw new he.ErrnoError(8);if(he.isDir(e.node.mode))throw new he.ErrnoError(31);if(!e.stream_ops.write)throw new he.ErrnoError(28);e.seekable&&1024&e.flags&&he.llseek(e,0,2);var o="undefined"!=typeof a;if(o){if(!e.seekable)throw new he.ErrnoError(70)}else a=e.position;var i=e.stream_ops.write(e,t,n,r,a,s);return o||(e.position+=i),i},allocate(e,t,n){if(he.isClosed(e))throw new he.ErrnoError(8);if(t<0||n<=0)throw new he.ErrnoError(28);if(0==(2097155&e.flags))throw new he.ErrnoError(8);if(!he.isFile(e.node.mode)&&!he.isDir(e.node.mode))throw new he.ErrnoError(43);if(!e.stream_ops.allocate)throw new he.ErrnoError(138);e.stream_ops.allocate(e,t,n)},mmap(e,t,n,r,a){if(0!=(2&r)&&0==(2&a)&&2!=(2097155&e.flags))throw new he.ErrnoError(2);if(1==(2097155&e.flags))throw new he.ErrnoError(2);if(!e.stream_ops.mmap)throw new he.ErrnoError(43);return e.stream_ops.mmap(e,t,n,r,a)},msync:(e,t,n,r,a)=>e.stream_ops.msync?e.stream_ops.msync(e,t,n,r,a):0,munmap:e=>0,ioctl(e,t,n){if(!e.stream_ops.ioctl)throw new he.ErrnoError(59);return e.stream_ops.ioctl(e,t,n)},readFile(e,t={}){if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error(`Invalid encoding type "${t.encoding}"`);var n,r=he.open(e,t.flags),a=he.stat(e).size,s=new Uint8Array(a);return he.read(r,s,0,a,0),"utf8"===t.encoding?n=re(s,0):"binary"===t.encoding&&(n=s),he.close(r),n},writeFile(e,t,n={}){n.flags=n.flags||577;var r=he.open(e,n.flags,n.mode);if("string"==typeof t){var a=new Uint8Array(se(t)+1),s=oe(t,a,0,a.length);he.write(r,a,0,s,void 0,n.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");he.write(r,t,0,t.byteLength,void 0,n.canOwn)}he.close(r)},cwd:()=>he.currentPath,chdir(e){var t=he.lookupPath(e,{follow:!0});if(null===t.node)throw new he.ErrnoError(44);if(!he.isDir(t.node.mode))throw new he.ErrnoError(54);var n=he.nodePermissions(t.node,"x");if(n)throw new he.ErrnoError(n);he.currentPath=t.path},createDefaultDirectories(){he.mkdir("/tmp"),he.mkdir("/home"),he.mkdir("/home/web_user")},createDefaultDevices(){he.mkdir("/dev"),he.registerDevice(he.makedev(1,3),{read:()=>0,write:(e,t,n,r,a)=>r}),he.mkdev("/dev/null",he.makedev(1,3)),ue.register(he.makedev(5,0),ue.default_tty_ops),ue.register(he.makedev(6,0),ue.default_tty1_ops),he.mkdev("/dev/tty",he.makedev(5,0)),he.mkdev("/dev/tty1",he.makedev(6,0));var e=new Uint8Array(1024),t=0,n=()=>(0===t&&(t=ee(e).byteLength),e[--t]);he.createDevice("/dev","random",n),he.createDevice("/dev","urandom",n),he.mkdir("/dev/shm"),he.mkdir("/dev/shm/tmp")},createSpecialDirectories(){he.mkdir("/proc");var e=he.mkdir("/proc/self");he.mkdir("/proc/self/fd"),he.mount({mount(){var t=he.createNode(e,"fd",16895,73);return t.node_ops={lookup(e,t){var n=+t,r=he.getStreamChecked(n),a={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>r.path}};return a.parent=a,a}},t}},{},"/proc/self/fd")},createStandardStreams(){a.stdin?he.createDevice("/dev","stdin",a.stdin):he.symlink("/dev/tty","/dev/stdin"),a.stdout?he.createDevice("/dev","stdout",null,a.stdout):he.symlink("/dev/tty","/dev/stdout"),a.stderr?he.createDevice("/dev","stderr",null,a.stderr):he.symlink("/dev/tty1","/dev/stderr"),he.open("/dev/stdin",0),he.open("/dev/stdout",1),he.open("/dev/stderr",1)},ensureErrnoError(){he.ErrnoError||(he.ErrnoError=function(e,t){this.name="ErrnoError",this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},he.ErrnoError.prototype=new Error,he.ErrnoError.prototype.constructor=he.ErrnoError,[44].forEach((e=>{he.genericErrors[e]=new he.ErrnoError(e),he.genericErrors[e].stack="<generic error, no stack>"})))},staticInit(){he.ensureErrnoError(),he.nameTable=new Array(4096),he.mount(le,{},"/"),he.createDefaultDirectories(),he.createDefaultDevices(),he.createSpecialDirectories(),he.filesystems={MEMFS:le}},init(e,t,n){he.init.initialized=!0,he.ensureErrnoError(),a.stdin=e||a.stdin,a.stdout=t||a.stdout,a.stderr=n||a.stderr,he.createStandardStreams()},quit(){he.init.initialized=!1;for(var e=0;e<he.streams.length;e++){var t=he.streams[e];t&&he.close(t)}},findObject(e,t){var n=he.analyzePath(e,t);return n.exists?n.object:null},analyzePath(e,t){try{e=(r=he.lookupPath(e,{follow:!t})).path}catch(e){}var n={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var r=he.lookupPath(e,{parent:!0});n.parentExists=!0,n.parentPath=r.path,n.parentObject=r.node,n.name=Q.basename(e),r=he.lookupPath(e,{follow:!t}),n.exists=!0,n.path=r.path,n.object=r.node,n.name=r.node.name,n.isRoot="/"===r.path}catch(e){n.error=e.errno}return n},createPath(e,t,n,r){e="string"==typeof e?e:he.getPath(e);for(var a=t.split("/").reverse();a.length;){var s=a.pop();if(s){var o=Q.join2(e,s);try{he.mkdir(o)}catch(e){}e=o}}return o},createFile(e,t,n,r,a){var s=Q.join2("string"==typeof e?e:he.getPath(e),t),o=fe(r,a);return he.create(s,o)},createDataFile(e,t,n,r,a,s){var o=t;e&&(e="string"==typeof e?e:he.getPath(e),o=t?Q.join2(e,t):e);var i=fe(r,a),u=he.create(o,i);if(n){if("string"==typeof n){for(var c=new Array(n.length),l=0,d=n.length;l<d;++l)c[l]=n.charCodeAt(l);n=c}he.chmod(u,146|i);var p=he.open(u,577);he.write(p,n,0,n.length,0,s),he.close(p),he.chmod(u,i)}return u},createDevice(e,t,n,r){var a=Q.join2("string"==typeof e?e:he.getPath(e),t),s=fe(!!n,!!r);he.createDevice.major||(he.createDevice.major=64);var o=he.makedev(he.createDevice.major++,0);return he.registerDevice(o,{open(e){e.seekable=!1},close(e){r&&r.buffer&&r.buffer.length&&r(10)},read(e,t,r,a,s){for(var o=0,i=0;i<a;i++){var u;try{u=n()}catch(e){throw new he.ErrnoError(29)}if(void 0===u&&0===o)throw new he.ErrnoError(6);if(null==u)break;o++,t[r+i]=u}return o&&(e.node.timestamp=Date.now()),o},write(e,t,n,a,s){for(var o=0;o<a;o++)try{r(t[n+o])}catch(e){throw new he.ErrnoError(29)}return a&&(e.node.timestamp=Date.now()),o}}),he.mkdev(a,s,o)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!s)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=ie(s(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new he.ErrnoError(29)}},createLazyFile(e,t,n,r,a){function s(){this.lengthKnown=!1,this.chunks=[]}if(s.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,n=e/this.chunkSize|0;return this.getter(n)[t]}},s.prototype.setDataGetter=function(e){this.getter=e},s.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",n,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+n+". Status: "+e.status);var t,r=Number(e.getResponseHeader("Content-length")),a=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,s=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,o=1048576;a||(o=r);var i=this;i.setDataGetter((e=>{var t=e*o,a=(e+1)*o-1;if(a=Math.min(a,r-1),"undefined"==typeof i.chunks[e]&&(i.chunks[e]=((e,t)=>{if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>r-1)throw new Error("only "+r+" bytes available! programmer error!");var a=new XMLHttpRequest;if(a.open("GET",n,!1),r!==o&&a.setRequestHeader("Range","bytes="+e+"-"+t),a.responseType="arraybuffer",a.overrideMimeType&&a.overrideMimeType("text/plain; charset=x-user-defined"),a.send(null),!(a.status>=200&&a.status<300||304===a.status))throw new Error("Couldn't load "+n+". Status: "+a.status);return void 0!==a.response?new Uint8Array(a.response||[]):ie(a.responseText||"",!0)})(t,a)),"undefined"==typeof i.chunks[e])throw new Error("doXHR failed!");return i.chunks[e]})),!s&&r||(o=r=1,r=this.getter(0).length,o=r,f("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=r,this._chunkSize=o,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){var o=new s;Object.defineProperties(o,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var i={isDevice:!1,contents:o}}else i={isDevice:!1,url:n};var u=he.createFile(e,t,i,r,a);i.contents?u.contents=i.contents:i.url&&(u.contents=null,u.url=i.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var c={};function l(e,t,n,r,a){var s=e.node.contents;if(a>=s.length)return 0;var o=Math.min(s.length-a,r);if(s.slice)for(var i=0;i<o;i++)t[n+i]=s[a+i];else for(i=0;i<o;i++)t[n+i]=s.get(a+i);return o}return Object.keys(u.stream_ops).forEach((e=>{var t=u.stream_ops[e];c[e]=function(){return he.forceLoadFile(u),t.apply(null,arguments)}})),c.read=(e,t,n,r,a)=>(he.forceLoadFile(u),l(e,t,n,r,a)),c.mmap=(e,t,n,r,a)=>{he.forceLoadFile(u);var s=ce(t);if(!s)throw new he.ErrnoError(48);return l(e,g,s,t,n),{ptr:s,allocated:!0}},u.stream_ops=c,u}},me=(e,t)=>e?re(y,e,t):"",be={DEFAULT_POLLMASK:5,calculateAt(e,t,n){if(Q.isAbs(t))return t;var r;if(r=-100===e?he.cwd():be.getStreamFromFD(e).path,0==t.length){if(!n)throw new he.ErrnoError(44);return r}return Q.join2(r,t)},doStat(e,t,n){try{var r=e(t)}catch(e){if(e&&e.node&&Q.normalize(t)!==Q.normalize(he.getPath(e.node)))return-54;throw e}v[n>>2]=r.dev,v[n+4>>2]=r.mode,j[n+8>>2]=r.nlink,v[n+12>>2]=r.uid,v[n+16>>2]=r.gid,v[n+20>>2]=r.rdev,M=[r.size>>>0,(A=r.size,+Math.abs(A)>=1?A>0?+Math.floor(A/4294967296)>>>0:~~+Math.ceil((A-+(~~A>>>0))/4294967296)>>>0:0)],v[n+24>>2]=M[0],v[n+28>>2]=M[1],v[n+32>>2]=4096,v[n+36>>2]=r.blocks;var a=r.atime.getTime(),s=r.mtime.getTime(),o=r.ctime.getTime();return M=[Math.floor(a/1e3)>>>0,(A=Math.floor(a/1e3),+Math.abs(A)>=1?A>0?+Math.floor(A/4294967296)>>>0:~~+Math.ceil((A-+(~~A>>>0))/4294967296)>>>0:0)],v[n+40>>2]=M[0],v[n+44>>2]=M[1],j[n+48>>2]=a%1e3*1e3,M=[Math.floor(s/1e3)>>>0,(A=Math.floor(s/1e3),+Math.abs(A)>=1?A>0?+Math.floor(A/4294967296)>>>0:~~+Math.ceil((A-+(~~A>>>0))/4294967296)>>>0:0)],v[n+56>>2]=M[0],v[n+60>>2]=M[1],j[n+64>>2]=s%1e3*1e3,M=[Math.floor(o/1e3)>>>0,(A=Math.floor(o/1e3),+Math.abs(A)>=1?A>0?+Math.floor(A/4294967296)>>>0:~~+Math.ceil((A-+(~~A>>>0))/4294967296)>>>0:0)],v[n+72>>2]=M[0],v[n+76>>2]=M[1],j[n+80>>2]=o%1e3*1e3,M=[r.ino>>>0,(A=r.ino,+Math.abs(A)>=1?A>0?+Math.floor(A/4294967296)>>>0:~~+Math.ceil((A-+(~~A>>>0))/4294967296)>>>0:0)],v[n+88>>2]=M[0],v[n+92>>2]=M[1],0},doMsync(e,t,n,r,a){if(!he.isFile(t.node.mode))throw new he.ErrnoError(43);if(2&r)return 0;var s=y.slice(e,e+n);he.msync(t,s,a,n,r)},varargs:void 0,get(){var e=v[be.varargs>>2];return be.varargs+=4,e},getp:()=>be.get(),getStr:e=>me(e),getStreamFromFD:e=>he.getStreamChecked(e)},ge={},ye=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function we(e){return this.fromWireType(v[e>>2])}var Oe={},ve={},je={},_e=void 0,xe=e=>{throw new _e(e)},Se=(e,t,n)=>{function r(t){var r=n(t);r.length!==e.length&&xe("Mismatched type converter count");for(var a=0;a<e.length;++a)Me(e[a],r[a])}e.forEach((function(e){je[e]=t}));var a=new Array(t.length),s=[],o=0;t.forEach(((e,t)=>{ve.hasOwnProperty(e)?a[t]=ve[e]:(s.push(e),Oe.hasOwnProperty(e)||(Oe[e]=[]),Oe[e].push((()=>{a[t]=ve[e],++o===s.length&&r(a)})))})),0===s.length&&r(a)},ke={},Ee=void 0,Te=e=>{for(var t="",n=e;y[n];)t+=Ee[y[n++]];return t},Ne=void 0,Ae=e=>{throw new Ne(e)};function Me(e,t,n={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(e,t,n={}){var r=t.name;if(e||Ae(`type "${r}" must have a positive integer typeid pointer`),ve.hasOwnProperty(e)){if(n.ignoreDuplicateRegistrations)return;Ae(`Cannot register type '${r}' twice`)}if(ve[e]=t,delete je[e],Oe.hasOwnProperty(e)){var a=Oe[e];delete Oe[e],a.forEach((e=>e()))}}(e,t,n)}var Ie=8;function De(e){if(!(this instanceof tt))return!1;if(!(e instanceof tt))return!1;for(var t=this.$$.ptrType.registeredClass,n=this.$$.ptr,r=e.$$.ptrType.registeredClass,a=e.$$.ptr;t.baseClass;)n=t.upcast(n),t=t.baseClass;for(;r.baseClass;)a=r.upcast(a),r=r.baseClass;return t===r&&n===a}var $e=e=>{Ae(e.$$.ptrType.registeredClass.name+" instance already deleted")},Ce=!1,Re=e=>{},Pe=e=>{e.count.value-=1,0===e.count.value&&(e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)})(e)},Fe=(e,t,n)=>{if(t===n)return e;if(void 0===n.baseClass)return null;var r=Fe(e,t,n.baseClass);return null===r?null:n.downcast(r)},Be={},Le=()=>Object.keys(qe).length,ze=()=>{var e=[];for(var t in qe)qe.hasOwnProperty(t)&&e.push(qe[t]);return e},We=[],Ue=()=>{for(;We.length;){var e=We.pop();e.$$.deleteScheduled=!1,e.delete()}},Ve=void 0,Ge=e=>{Ve=e,We.length&&Ve&&Ve(Ue)},qe={},He=(e,t)=>(t=((e,t)=>{for(void 0===t&&Ae("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t})(e,t),qe[t]),Ke=(e,t)=>(t.ptrType&&t.ptr||xe("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&xe("Both smartPtrType and smartPtr must be specified"),t.count={value:1},Je(Object.create(e,{$$:{value:t}})));function Ye(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var n=He(this.registeredClass,t);if(void 0!==n){if(0===n.$$.count.value)return n.$$.ptr=t,n.$$.smartPtr=e,n.clone();var r=n.clone();return this.destructor(e),r}function a(){return this.isSmartPointer?Ke(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):Ke(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var s,o=this.registeredClass.getActualType(t),i=Be[o];if(!i)return a.call(this);s=this.isConst?i.constPointerType:i.pointerType;var u=Fe(t,this.registeredClass,s.registeredClass);return null===u?a.call(this):this.isSmartPointer?Ke(s.registeredClass.instancePrototype,{ptrType:s,ptr:u,smartPtrType:this,smartPtr:e}):Ke(s.registeredClass.instancePrototype,{ptrType:s,ptr:u})}var Je=e=>"undefined"==typeof FinalizationRegistry?(Je=e=>e,e):(Ce=new FinalizationRegistry((e=>{Pe(e.$$)})),Je=e=>{var t=e.$$;if(t.smartPtr){var n={$$:t};Ce.register(e,n,e)}return e},Re=e=>Ce.unregister(e),Je(e));function Xe(){if(this.$$.ptr||$e(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=Je(Object.create(Object.getPrototypeOf(this),{$$:{value:(e=this.$$,{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType})}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t}function Ze(){this.$$.ptr||$e(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Ae("Object already scheduled for deletion"),Re(this),Pe(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function Qe(){return!this.$$.ptr}function et(){return this.$$.ptr||$e(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Ae("Object already scheduled for deletion"),We.push(this),1===We.length&&Ve&&Ve(Ue),this.$$.deleteScheduled=!0,this}function tt(){}var nt=e=>{if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=48&&t<=57?`_${e}`:e};function rt(e,t){return{[e=nt(e)]:function(){return t.apply(this,arguments)}}[e]}var at=(e,t,n)=>{if(void 0===e[t].overloadTable){var r=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||Ae(`Function '${n}' called with an invalid number of arguments (${arguments.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[r.argCount]=r}},st=(e,t,n)=>{a.hasOwnProperty(e)?((void 0===n||void 0!==a[e].overloadTable&&void 0!==a[e].overloadTable[n])&&Ae(`Cannot register public name '${e}' twice`),at(a,e,e),a.hasOwnProperty(n)&&Ae(`Cannot register multiple overloads of a function with the same number of arguments (${n})!`),a[e].overloadTable[n]=t):(a[e]=t,void 0!==n&&(a[e].numArguments=n))};function ot(e,t,n,r,a,s,o,i){this.name=e,this.constructor=t,this.instancePrototype=n,this.rawDestructor=r,this.baseClass=a,this.getActualType=s,this.upcast=o,this.downcast=i,this.pureVirtualFunctions=[]}var it=(e,t,n)=>{for(;t!==n;)t.upcast||Ae(`Expected null or instance of ${n.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e};function ut(e,t){if(null===t)return this.isReference&&Ae(`null is not a valid ${this.name}`),0;t.$$||Ae(`Cannot pass "${Rt(t)}" as a ${this.name}`),t.$$.ptr||Ae(`Cannot pass deleted object as a pointer of type ${this.name}`);var n=t.$$.ptrType.registeredClass;return it(t.$$.ptr,n,this.registeredClass)}function ct(e,t){var n;if(null===t)return this.isReference&&Ae(`null is not a valid ${this.name}`),this.isSmartPointer?(n=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,n),n):0;t.$$||Ae(`Cannot pass "${Rt(t)}" as a ${this.name}`),t.$$.ptr||Ae(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&Ae(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass;if(n=it(t.$$.ptr,r,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&Ae("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?n=t.$$.smartPtr:Ae(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:n=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)n=t.$$.smartPtr;else{var a=t.clone();n=this.rawShare(n,Dt.toHandle((()=>a.delete()))),null!==e&&e.push(this.rawDestructor,n)}break;default:Ae("Unsupporting sharing policy")}return n}function lt(e,t){if(null===t)return this.isReference&&Ae(`null is not a valid ${this.name}`),0;t.$$||Ae(`Cannot pass "${Rt(t)}" as a ${this.name}`),t.$$.ptr||Ae(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&Ae(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var n=t.$$.ptrType.registeredClass;return it(t.$$.ptr,n,this.registeredClass)}function dt(e){return this.fromWireType(j[e>>2])}function pt(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e}function ft(e){this.rawDestructor&&this.rawDestructor(e)}var ht=e=>{null!==e&&e.delete()};function mt(e,t,n,r,a,s,o,i,u,c,l){this.name=e,this.registeredClass=t,this.isReference=n,this.isConst=r,this.isSmartPointer=a,this.pointeeType=s,this.sharingPolicy=o,this.rawGetPointee=i,this.rawConstructor=u,this.rawShare=c,this.rawDestructor=l,a||void 0!==t.baseClass?this.toWireType=ct:r?(this.toWireType=ut,this.destructorFunction=null):(this.toWireType=lt,this.destructorFunction=null)}var bt=(e,t,n)=>{a.hasOwnProperty(e)||xe("Replacing nonexistant public symbol"),void 0!==a[e].overloadTable&&void 0!==n?a[e].overloadTable[n]=t:(a[e]=t,a[e].argCount=n)},gt=[],yt=e=>{var t=gt[e];return t||(e>=gt.length&&(gt.length=e+1),gt[e]=t=S.get(e)),t},wt=(e,t,n)=>e.includes("j")?((e,t,n)=>{var r=a["dynCall_"+e];return n&&n.length?r.apply(null,[t].concat(n)):r.call(null,t)})(e,t,n):yt(t).apply(null,n),Ot=(e,t)=>{var n,r,a,s=(e=Te(e)).includes("j")?(n=e,r=t,a=[],function(){return a.length=0,Object.assign(a,arguments),wt(n,r,a)}):yt(t);return"function"!=typeof s&&Ae(`unknown function pointer with signature ${e}: ${t}`),s},vt=void 0,jt=e=>{var t=Tn(e),n=Te(t);return Sn(t),n},_t=(e,t)=>{var n=[],r={};throw t.forEach((function e(t){r[t]||ve[t]||(je[t]?je[t].forEach(e):(n.push(t),r[t]=!0))})),new vt(`${e}: `+n.map(jt).join([", "]))},xt=(e,t)=>{for(var n=[],r=0;r<e;r++)n.push(j[t+4*r>>2]);return n};function St(e,t){if(!(e instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof e} which is not a function`);var n=rt(e.name||"unknownFunctionName",(function(){}));n.prototype=e.prototype;var r=new n,a=e.apply(r,t);return a instanceof Object?a:r}function kt(e,t,n,r,a,s){var o=t.length;o<2&&Ae("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var i=null!==t[1]&&null!==n,u=!1,c=1;c<t.length;++c)if(null!==t[c]&&void 0===t[c].destructorFunction){u=!0;break}var l="void"!==t[0].name,d="",p="";for(c=0;c<o-2;++c)d+=(0!==c?", ":"")+"arg"+c,p+=(0!==c?", ":"")+"arg"+c+"Wired";var f=`\n return function ${nt(e)}(${d}) {\n if (arguments.length !== ${o-2}) {\n throwBindingError('function ${e} called with ' + arguments.length + ' arguments, expected ${o-2}');\n }`;u&&(f+="var destructors = [];\n");var h=u?"destructors":"null",m=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],b=[Ae,r,a,ye,t[0],t[1]];for(i&&(f+="var thisWired = classParam.toWireType("+h+", this);\n"),c=0;c<o-2;++c)f+="var arg"+c+"Wired = argType"+c+".toWireType("+h+", arg"+c+"); // "+t[c+2].name+"\n",m.push("argType"+c),b.push(t[c+2]);if(i&&(p="thisWired"+(p.length>0?", ":"")+p),f+=(l||s?"var rv = ":"")+"invoker(fn"+(p.length>0?", ":"")+p+");\n",u)f+="runDestructors(destructors);\n";else for(c=i?1:2;c<t.length;++c){var g=1===c?"thisWired":"arg"+(c-2)+"Wired";null!==t[c].destructorFunction&&(f+=g+"_dtor("+g+"); // "+t[c].name+"\n",m.push(g+"_dtor"),b.push(t[c].destructorFunction))}return l&&(f+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),f+="}\n",m.push(f),St(Function,m).apply(null,b)}var Et=(e,t,n)=>(e instanceof Object||Ae(`${n} with invalid "this": ${e}`),e instanceof t.registeredClass.constructor||Ae(`${n} incompatible with "this" of type ${e.constructor.name}`),e.$$.ptr||Ae(`cannot call emscripten binding method ${n} on deleted object`),it(e.$$.ptr,e.$$.ptrType.registeredClass,t.registeredClass));function Tt(){this.allocated=[void 0],this.freelist=[]}var Nt,At=new Tt,Mt=e=>{e>=At.reserved&&0==--At.get(e).refcount&&At.free(e)},It=()=>{for(var e=0,t=At.reserved;t<At.allocated.length;++t)void 0!==At.allocated[t]&&++e;return e},Dt={toValue:e=>(e||Ae("Cannot use deleted val. handle = "+e),At.get(e).value),toHandle:e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return At.allocate({refcount:1,value:e})}}},$t=(e,t,n)=>{switch(t){case 1:return n?function(e){return this.fromWireType(g[e>>0])}:function(e){return this.fromWireType(y[e>>0])};case 2:return n?function(e){return this.fromWireType(w[e>>1])}:function(e){return this.fromWireType(O[e>>1])};case 4:return n?function(e){return this.fromWireType(v[e>>2])}:function(e){return this.fromWireType(j[e>>2])};default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Ct=(e,t)=>{var n=ve[e];return void 0===n&&Ae(t+" has unknown type "+jt(e)),n},Rt=e=>{if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e},Pt=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(_[e>>2])};case 8:return function(e){return this.fromWireType(x[e>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},Ft=(e,t,n)=>{switch(t){case 1:return n?e=>g[e>>0]:e=>y[e>>0];case 2:return n?e=>w[e>>1]:e=>O[e>>1];case 4:return n?e=>v[e>>2]:e=>j[e>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Bt=(e,t,n)=>oe(e,y,t,n),Lt="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,zt=(e,t)=>{for(var n=e,r=n>>1,a=r+t/2;!(r>=a)&&O[r];)++r;if((n=r<<1)-e>32&&Lt)return Lt.decode(y.subarray(e,n));for(var s="",o=0;!(o>=t/2);++o){var i=w[e+2*o>>1];if(0==i)break;s+=String.fromCharCode(i)}return s},Wt=(e,t,n)=>{if(void 0===n&&(n=2147483647),n<2)return 0;for(var r=t,a=(n-=2)<2*e.length?n/2:e.length,s=0;s<a;++s){var o=e.charCodeAt(s);w[t>>1]=o,t+=2}return w[t>>1]=0,t-r},Ut=e=>2*e.length,Vt=(e,t)=>{for(var n=0,r="";!(n>=t/4);){var a=v[e+4*n>>2];if(0==a)break;if(++n,a>=65536){var s=a-65536;r+=String.fromCharCode(55296|s>>10,56320|1023&s)}else r+=String.fromCharCode(a)}return r},Gt=(e,t,n)=>{if(void 0===n&&(n=2147483647),n<4)return 0;for(var r=t,a=r+n-4,s=0;s<e.length;++s){var o=e.charCodeAt(s);if(o>=55296&&o<=57343&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++s)),v[t>>2]=o,(t+=4)+4>a)break}return v[t>>2]=0,t-r},qt=e=>{for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);r>=55296&&r<=57343&&++n,t+=4}return t},Ht={},Kt=e=>{var t=Ht[e];return void 0===t?Te(e):t},Yt=[],Jt=()=>"object"==typeof globalThis?globalThis:Function("return this")(),Xt=[],Zt=e=>e%4==0&&(e%100!=0||e%400==0),Qt=[0,31,60,91,121,152,182,213,244,274,305,335],en=[0,31,59,90,120,151,181,212,243,273,304,334],tn=(e,t)=>t+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*t:NaN,nn=e=>{var t=se(e)+1,n=xn(t);return n&&Bt(e,n,t),n},rn=[],an=(e,t,n)=>{var r=((e,t)=>{var n;for(rn.length=0;n=y[e++];)t+=105!=n&&t%8?4:0,rn.push(105==n?v[t>>2]:x[t>>3]),t+=105==n?4:8;return rn})(t,n);return V[e].apply(null,r)};Nt=()=>performance.now();var sn,on,un,cn=e=>{var t=(e-m.buffer.byteLength+65535)/65536;try{return m.grow(t),E(),1}catch(e){}},ln={},dn=()=>{if(!dn.strings){var 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",_:c||"./this.program"};for(var t in ln)void 0===ln[t]?delete e[t]:e[t]=ln[t];var n=[];for(var t in e)n.push(`${t}=${e[t]}`);dn.strings=n}return dn.strings},pn=e=>{b||(a.onExit&&a.onExit(e),k=!0),l(e,new G(e))},fn=(e,t)=>{pn(e)},hn=[31,29,31,30,31,30,31,31,30,31,30,31],mn=[31,28,31,30,31,30,31,31,30,31,30,31],bn=(e,t,n,r)=>{var a=j[r+40>>2],s={tm_sec:v[r>>2],tm_min:v[r+4>>2],tm_hour:v[r+8>>2],tm_mday:v[r+12>>2],tm_mon:v[r+16>>2],tm_year:v[r+20>>2],tm_wday:v[r+24>>2],tm_yday:v[r+28>>2],tm_isdst:v[r+32>>2],tm_gmtoff:v[r+36>>2],tm_zone:a?me(a):""},o=me(n),i={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var u in i)o=o.replace(new RegExp(u,"g"),i[u]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],l=["January","February","March","April","May","June","July","August","September","October","November","December"];function d(e,t,n){for(var r="number"==typeof e?e.toString():e||"";r.length<t;)r=n[0]+r;return r}function p(e,t){return d(e,t,"0")}function f(e,t){function n(e){return e<0?-1:e>0?1:0}var r;return 0===(r=n(e.getFullYear()-t.getFullYear()))&&0===(r=n(e.getMonth()-t.getMonth()))&&(r=n(e.getDate()-t.getDate())),r}function h(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function m(e){var t=((e,t)=>{for(var n=new Date(e.getTime());t>0;){var r=Zt(n.getFullYear()),a=n.getMonth(),s=(r?hn:mn)[a];if(!(t>s-n.getDate()))return n.setDate(n.getDate()+t),n;t-=s-n.getDate()+1,n.setDate(1),a<11?n.setMonth(a+1):(n.setMonth(0),n.setFullYear(n.getFullYear()+1))}return n})(new Date(e.tm_year+1900,0,1),e.tm_yday),n=new Date(t.getFullYear(),0,4),r=new Date(t.getFullYear()+1,0,4),a=h(n),s=h(r);return f(a,t)<=0?f(s,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var b={"%a":e=>c[e.tm_wday].substring(0,3),"%A":e=>c[e.tm_wday],"%b":e=>l[e.tm_mon].substring(0,3),"%B":e=>l[e.tm_mon],"%C":e=>p((e.tm_year+1900)/100|0,2),"%d":e=>p(e.tm_mday,2),"%e":e=>d(e.tm_mday,2," "),"%g":e=>m(e).toString().substring(2),"%G":e=>m(e),"%H":e=>p(e.tm_hour,2),"%I":e=>{var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),p(t,2)},"%j":e=>p(e.tm_mday+((e,t)=>{for(var n=0,r=0;r<=t;n+=e[r++]);return n})(Zt(e.tm_year+1900)?hn:mn,e.tm_mon-1),3),"%m":e=>p(e.tm_mon+1,2),"%M":e=>p(e.tm_min,2),"%n":()=>"\n","%p":e=>e.tm_hour>=0&&e.tm_hour<12?"AM":"PM","%S":e=>p(e.tm_sec,2),"%t":()=>"\t","%u":e=>e.tm_wday||7,"%U":e=>{var t=e.tm_yday+7-e.tm_wday;return p(Math.floor(t/7),2)},"%V":e=>{var t=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&t++,t){if(53==t){var n=(e.tm_wday+371-e.tm_yday)%7;4==n||3==n&&Zt(e.tm_year)||(t=1)}}else{t=52;var r=(e.tm_wday+7-e.tm_yday-1)%7;(4==r||5==r&&Zt(e.tm_year%400-1))&&t++}return p(t,2)},"%w":e=>e.tm_wday,"%W":e=>{var t=e.tm_yday+7-(e.tm_wday+6)%7;return p(Math.floor(t/7),2)},"%y":e=>(e.tm_year+1900).toString().substring(2),"%Y":e=>e.tm_year+1900,"%z":e=>{var t=e.tm_gmtoff,n=t>=0;return t=(t=Math.abs(t)/60)/60*100+t%60,(n?"+":"-")+String("0000"+t).slice(-4)},"%Z":e=>e.tm_zone,"%%":()=>"%"};for(var u in o=o.replace(/%%/g,"\0\0"),b)o.includes(u)&&(o=o.replace(new RegExp(u,"g"),b[u](s)));var y,w,O=ie(o=o.replace(/\0\0/g,"%"),!1);return O.length>t?0:(y=O,w=e,g.set(y,w),O.length-1)},gn=nn,yn=function(e,t,n,r){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=he.nextInode++,this.name=t,this.mode=n,this.node_ops={},this.stream_ops={},this.rdev=r},wn=365,On=146;Object.defineProperties(yn.prototype,{read:{get:function(){return(this.mode&wn)===wn},set:function(e){e?this.mode|=wn:this.mode&=-366}},write:{get:function(){return(this.mode&On)===On},set:function(e){e?this.mode|=On:this.mode&=-147}},isFolder:{get:function(){return he.isDir(this.mode)}},isDevice:{get:function(){return he.isChrdev(this.mode)}}}),he.FSNode=yn,he.createPreloadedFile=(e,t,n,r,a,s,o,i,u,c)=>{var l=t?te.resolve(Q.join2(e,t)):e;function d(n){function d(n){c&&c(),i||he.createDataFile(e,t,n,r,a,u),s&&s(),B()}((e,t,n,r)=>{"undefined"!=typeof Browser&&Browser.init();var a=!1;return pe.forEach((s=>{a||s.canHandle(t)&&(s.handle(e,t,n,r),a=!0)})),a})(n,l,d,(()=>{o&&o(),B()}))||d(n)}F(),"string"==typeof n?de(n,(e=>d(e)),o):d(n)},he.staticInit(),_e=a.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},(()=>{for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);Ee=e})(),Ne=a.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},tt.prototype.isAliasOf=De,tt.prototype.clone=Xe,tt.prototype.delete=Ze,tt.prototype.isDeleted=Qe,tt.prototype.deleteLater=et,a.getInheritedInstanceCount=Le,a.getLiveInheritedInstances=ze,a.flushPendingDeletes=Ue,a.setDelayFunction=Ge,mt.prototype.getPointee=pt,mt.prototype.destructor=ft,mt.prototype.argPackAdvance=Ie,mt.prototype.readValueFromPointer=dt,mt.prototype.deleteObject=ht,mt.prototype.fromWireType=Ye,vt=a.UnboundTypeError=(sn=Error,(un=rt(on="UnboundTypeError",(function(e){this.name=on,this.message=e;var t=new Error(e).stack;void 0!==t&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))}))).prototype=Object.create(sn.prototype),un.prototype.constructor=un,un.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},un),Object.assign(Tt.prototype,{get(e){return this.allocated[e]},has(e){return void 0!==this.allocated[e]},allocate(e){var t=this.freelist.pop()||this.allocated.length;return this.allocated[t]=e,t},free(e){this.allocated[e]=void 0,this.freelist.push(e)}}),At.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),At.reserved=At.allocated.length,a.count_emval_handles=It;var vn,jn={r:e=>{var t=new J(e);return t.get_caught()||(t.set_caught(!0),K--),t.set_rethrown(!1),H.push(t),$n(t.excPtr),t.get_exception_ptr()},lb:()=>{if(!H.length)return 0;var e=H[H.length-1];return $n(e.excPtr),e.excPtr},s:()=>{An(0,0);var e=H.pop();Dn(e.excPtr),Y=0},a:()=>X([]),f:e=>X([e]),o:(e,t)=>X([e,t]),ma:Z,kb:e=>{if(e){var t=new J(e);H.push(t),t.set_rethrown(!0),Z()}},p:(e,t,n)=>{throw new J(e).init(t,n),K++,Y=e},mb:()=>K,c:e=>{throw Y||(Y=e),Y},rb:function(e,t,n,r,a){try{for(var s=0,o=t?v[t>>2]:0,i=t?v[t+4>>2]:0,u=n?v[n>>2]:0,c=n?v[n+4>>2]:0,l=r?v[r>>2]:0,d=r?v[r+4>>2]:0,p=0,f=0,h=0,m=0,b=0,g=0,y=(t?v[t>>2]:0)|(n?v[n>>2]:0)|(r?v[r>>2]:0),w=(t?v[t+4>>2]:0)|(n?v[n+4>>2]:0)|(r?v[r+4>>2]:0),O=function(e,t,n,r){return e<32?t&r:n&r},j=0;j<e;j++){var _=1<<j%32;if(O(j,y,w,_)){var x=be.getStreamFromFD(j),S=be.DEFAULT_POLLMASK;if(x.stream_ops.poll){var k=-1;a&&(k=1e3*((t?v[a>>2]:0)+(t?v[a+8>>2]:0)/1e6)),S=x.stream_ops.poll(x,k)}1&S&&O(j,o,i,_)&&(j<32?p|=_:f|=_,s++),4&S&&O(j,u,c,_)&&(j<32?h|=_:m|=_,s++),2&S&&O(j,l,d,_)&&(j<32?b|=_:g|=_,s++)}}return t&&(v[t>>2]=p,v[t+4>>2]=f),n&&(v[n>>2]=h,v[n+4>>2]=m),r&&(v[r>>2]=b,v[r+4>>2]=g),s}catch(e){if("undefined"==typeof he||"ErrnoError"!==e.name)throw e;return-e.errno}},za:function(e,t,n){be.varargs=n;try{var r=be.getStreamFromFD(e);switch(t){case 0:if((a=be.get())<0)return-28;for(;he.streams[a];)a++;return he.createStream(r,a).fd;case 1:case 2:case 6:case 7:return 0;case 3:return r.flags;case 4:var a=be.get();return r.flags|=a,0;case 5:return a=be.getp(),w[a+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return s=28,v[kn()>>2]=s,-1}}catch(e){if("undefined"==typeof he||"ErrnoError"!==e.name)throw e;return-e.errno}var s},yb:function(e,t){try{var n=be.getStreamFromFD(e);return be.doStat(he.stat,n.path,t)}catch(e){if("undefined"==typeof he||"ErrnoError"!==e.name)throw e;return-e.errno}},zb:function(e,t,n){be.varargs=n;try{var r=be.getStreamFromFD(e);switch(t){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return r.tty?0:-59;case 21505:if(!r.tty)return-59;if(r.tty.ops.ioctl_tcgets){var a=r.tty.ops.ioctl_tcgets(r),s=be.getp();v[s>>2]=a.c_iflag||0,v[s+4>>2]=a.c_oflag||0,v[s+8>>2]=a.c_cflag||0,v[s+12>>2]=a.c_lflag||0;for(var o=0;o<32;o++)g[s+o+17>>0]=a.c_cc[o]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!r.tty)return-59;if(r.tty.ops.ioctl_tcsets){s=be.getp();var i=v[s>>2],u=v[s+4>>2],c=v[s+8>>2],l=v[s+12>>2],d=[];for(o=0;o<32;o++)d.push(g[s+o+17>>0]);return r.tty.ops.ioctl_tcsets(r.tty,t,{c_iflag:i,c_oflag:u,c_cflag:c,c_lflag:l,c_cc:d})}return 0;case 21519:return r.tty?(s=be.getp(),v[s>>2]=0,0):-59;case 21520:return r.tty?-28:-59;case 21531:return s=be.getp(),he.ioctl(r,t,s);case 21523:if(!r.tty)return-59;if(r.tty.ops.ioctl_tiocgwinsz){var p=r.tty.ops.ioctl_tiocgwinsz(r.tty);s=be.getp(),w[s>>1]=p[0],w[s+2>>1]=p[1]}return 0;default:return-28}}catch(e){if("undefined"==typeof he||"ErrnoError"!==e.name)throw e;return-e.errno}},wb:function(e,t,n,r){try{t=be.getStr(t);var a=256&r,s=4096&r;return r&=-6401,t=be.calculateAt(e,t,s),be.doStat(a?he.lstat:he.stat,t,n)}catch(e){if("undefined"==typeof he||"ErrnoError"!==e.name)throw e;return-e.errno}},fa:function(e,t,n,r){be.varargs=r;try{t=be.getStr(t),t=be.calculateAt(e,t);var a=r?be.get():0;return he.open(t,n,a).fd}catch(e){if("undefined"==typeof he||"ErrnoError"!==e.name)throw e;return-e.errno}},sb:function(e){try{return e=be.getStr(e),he.rmdir(e),0}catch(e){if("undefined"==typeof he||"ErrnoError"!==e.name)throw e;return-e.errno}},xb:function(e,t){try{return e=be.getStr(e),be.doStat(he.stat,e,t)}catch(e){if("undefined"==typeof he||"ErrnoError"!==e.name)throw e;return-e.errno}},tb:function(e,t,n){try{return t=be.getStr(t),t=be.calculateAt(e,t),0===n?he.unlink(t):512===n?he.rmdir(t):L("Invalid flags passed to unlinkat"),0}catch(e){if("undefined"==typeof he||"ErrnoError"!==e.name)throw e;return-e.errno}},Xa:e=>{var t=ge[e];delete ge[e];var n=t.elements,r=n.length,a=n.map((e=>e.getterReturnType)).concat(n.map((e=>e.setterArgumentType))),s=t.rawConstructor,o=t.rawDestructor;Se([e],a,(function(e){return n.forEach(((t,n)=>{var a=e[n],s=t.getter,o=t.getterContext,i=e[n+r],u=t.setter,c=t.setterContext;t.read=e=>a.fromWireType(s(o,e)),t.write=(e,t)=>{var n=[];u(c,e,i.toWireType(n,t)),ye(n)}})),[{name:t.name,fromWireType:e=>{for(var t=new Array(r),a=0;a<r;++a)t[a]=n[a].read(e);return o(e),t},toWireType:(e,a)=>{if(r!==a.length)throw new TypeError(`Incorrect number of tuple elements for ${t.name}: expected=${r}, actual=${a.length}`);for(var i=s(),u=0;u<r;++u)n[u].write(i,a[u]);return null!==e&&e.push(o,i),i},argPackAdvance:Ie,readValueFromPointer:we,destructorFunction:o}]}))},Ua:e=>{var t=ke[e];delete ke[e];var n=t.rawConstructor,r=t.rawDestructor,a=t.fields,s=a.map((e=>e.getterReturnType)).concat(a.map((e=>e.setterArgumentType)));Se([e],s,(e=>{var s={};return a.forEach(((t,n)=>{var r=t.fieldName,o=e[n],i=t.getter,u=t.getterContext,c=e[n+a.length],l=t.setter,d=t.setterContext;s[r]={read:e=>o.fromWireType(i(u,e)),write:(e,t)=>{var n=[];l(d,e,c.toWireType(n,t)),ye(n)}}})),[{name:t.name,fromWireType:e=>{var t={};for(var n in s)t[n]=s[n].read(e);return r(e),t},toWireType:(e,t)=>{for(var a in s)if(!(a in t))throw new TypeError(`Missing field: "${a}"`);var o=n();for(a in s)s[a].write(o,t[a]);return null!==e&&e.push(r,o),o},argPackAdvance:Ie,readValueFromPointer:we,destructorFunction:r}]}))},eb:(e,t,n,r,a)=>{},Da:(e,t,n,r)=>{Me(e,{name:t=Te(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?n:r},argPackAdvance:Ie,readValueFromPointer:function(e){return this.fromWireType(y[e])},destructorFunction:null})},B:(e,t,n,r,a,s,o,i,u,c,l,d,p)=>{l=Te(l),s=Ot(a,s),i&&(i=Ot(o,i)),c&&(c=Ot(u,c)),p=Ot(d,p);var f=nt(l);st(f,(function(){_t(`Cannot construct ${l} due to unbound types`,[r])})),Se([e,t,n],r?[r]:[],(function(t){var n,a;t=t[0],a=r?(n=t.registeredClass).instancePrototype:tt.prototype;var o=rt(f,(function(){if(Object.getPrototypeOf(this)!==u)throw new Ne("Use 'new' to construct "+l);if(void 0===d.constructor_body)throw new Ne(l+" has no accessible constructor");var e=d.constructor_body[arguments.length];if(void 0===e)throw new Ne(`Tried to invoke ctor of ${l} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(d.constructor_body).toString()}) parameters instead!`);return e.apply(this,arguments)})),u=Object.create(a,{constructor:{value:o}});o.prototype=u;var d=new ot(l,o,u,p,n,s,i,c);d.baseClass&&(void 0===d.baseClass.__derivedClasses&&(d.baseClass.__derivedClasses=[]),d.baseClass.__derivedClasses.push(d));var h=new mt(l,d,!0,!1,!1),m=new mt(l+"*",d,!1,!1,!1),b=new mt(l+" const*",d,!1,!0,!1);return Be[e]={pointerType:m,constPointerType:b},bt(f,o),[h,m,b]}))},ua:(e,t,n,r,a,s)=>{var o=xt(t,n);a=Ot(r,a),Se([],[e],(function(e){var n=`constructor ${(e=e[0]).name}`;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[t-1])throw new Ne(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[t-1]=()=>{_t(`Cannot construct ${e.name} due to unbound types`,o)},Se([],o,(r=>(r.splice(1,0,null),e.registeredClass.constructor_body[t-1]=kt(n,r,null,a,s),[]))),[]}))},ta:(e,t,n,r,a,s,o,i,u)=>{var c=xt(n,r);t=Te(t),s=Ot(a,s),Se([],[e],(function(e){var r=`${(e=e[0]).name}.${t}`;function a(){_t(`Cannot call ${r} due to unbound types`,c)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),i&&e.registeredClass.pureVirtualFunctions.push(t);var l=e.registeredClass.instancePrototype,d=l[t];return void 0===d||void 0===d.overloadTable&&d.className!==e.name&&d.argCount===n-2?(a.argCount=n-2,a.className=e.name,l[t]=a):(at(l,t,r),l[t].overloadTable[n-2]=a),Se([],c,(function(a){var i=kt(r,a,e,s,o,u);return void 0===l[t].overloadTable?(i.argCount=n-2,l[t]=i):l[t].overloadTable[n-2]=i,[]})),[]}))},u:(e,t,n,r,a,s,o,i,u,c)=>{t=Te(t),a=Ot(r,a),Se([],[e],(function(e){var r=`${(e=e[0]).name}.${t}`,l={get(){_t(`Cannot access ${r} due to unbound types`,[n,o])},enumerable:!0,configurable:!0};return l.set=u?()=>_t(`Cannot access ${r} due to unbound types`,[n,o]):e=>Ae(r+" is a read-only property"),Object.defineProperty(e.registeredClass.instancePrototype,t,l),Se([],u?[n,o]:[n],(function(n){var o=n[0],l={get(){var t=Et(this,e,r+" getter");return o.fromWireType(a(s,t))},enumerable:!0};if(u){u=Ot(i,u);var d=n[1];l.set=function(t){var n=Et(this,e,r+" setter"),a=[];u(c,n,d.toWireType(a,t)),ye(a)}}return Object.defineProperty(e.registeredClass.instancePrototype,t,l),[]})),[]}))},Ca:(e,t)=>{Me(e,{name:t=Te(t),fromWireType:e=>{var t=Dt.toValue(e);return Mt(e),t},toWireType:(e,t)=>Dt.toHandle(t),argPackAdvance:Ie,readValueFromPointer:we,destructorFunction:null})},_a:(e,t,n,r)=>{function a(){}t=Te(t),a.values={},Me(e,{name:t,constructor:a,fromWireType:function(e){return this.constructor.values[e]},toWireType:(e,t)=>t.value,argPackAdvance:Ie,readValueFromPointer:$t(t,n,r),destructorFunction:null}),st(t,a)},J:(e,t,n)=>{var r=Ct(e,"enum");t=Te(t);var a=r.constructor,s=Object.create(r.constructor.prototype,{value:{value:n},constructor:{value:rt(`${r.name}_${t}`,(function(){}))}});a.values[n]=s,a[t]=s},ha:(e,t,n)=>{Me(e,{name:t=Te(t),fromWireType:e=>e,toWireType:(e,t)=>t,argPackAdvance:Ie,readValueFromPointer:Pt(t,n),destructorFunction:null})},D:(e,t,n,r,a,s,o)=>{var i=xt(t,n);e=Te(e),a=Ot(r,a),st(e,(function(){_t(`Cannot call ${e} due to unbound types`,i)}),t-1),Se([],i,(function(n){var r=[n[0],null].concat(n.slice(1));return bt(e,kt(e,r,null,a,s,o),t-1),[]}))},E:(e,t,n,r,a)=>{t=Te(t),-1===a&&(a=4294967295);var s=e=>e;if(0===r){var o=32-8*n;s=e=>e<<o>>>o}var i=t.includes("unsigned");Me(e,{name:t,fromWireType:s,toWireType:i?function(e,t){return this.name,t>>>0}:function(e,t){return this.name,t},argPackAdvance:Ie,readValueFromPointer:Ft(t,n,0!==r),destructorFunction:null})},t:(e,t,n)=>{var r=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];function a(e){var t=j[e>>2],n=j[e+4>>2];return new r(g.buffer,n,t)}Me(e,{name:n=Te(n),fromWireType:a,argPackAdvance:Ie,readValueFromPointer:a},{ignoreDuplicateRegistrations:!0})},ga:(e,t)=>{var n="std::string"===(t=Te(t));Me(e,{name:t,fromWireType:e=>{var t,r=j[e>>2],a=e+4;if(n)for(var s=a,o=0;o<=r;++o){var i=a+o;if(o==r||0==y[i]){var u=me(s,i-s);void 0===t?t=u:(t+=String.fromCharCode(0),t+=u),s=i+1}}else{var c=new Array(r);for(o=0;o<r;++o)c[o]=String.fromCharCode(y[a+o]);t=c.join("")}return Sn(e),t},toWireType:(e,t)=>{var r;t instanceof ArrayBuffer&&(t=new Uint8Array(t));var a="string"==typeof t;a||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||Ae("Cannot pass non-string to std::string"),r=n&&a?se(t):t.length;var s=xn(4+r+1),o=s+4;if(j[s>>2]=r,n&&a)Bt(t,o,r+1);else if(a)for(var i=0;i<r;++i){var u=t.charCodeAt(i);u>255&&(Sn(o),Ae("String has UTF-16 code units that do not fit in 8 bits")),y[o+i]=u}else for(i=0;i<r;++i)y[o+i]=t[i];return null!==e&&e.push(Sn,s),s},argPackAdvance:Ie,readValueFromPointer:dt,destructorFunction:e=>Sn(e)})},_:(e,t,n)=>{var r,a,s,o,i;n=Te(n),2===t?(r=zt,a=Wt,o=Ut,s=()=>O,i=1):4===t&&(r=Vt,a=Gt,o=qt,s=()=>j,i=2),Me(e,{name:n,fromWireType:e=>{for(var n,a=j[e>>2],o=s(),u=e+4,c=0;c<=a;++c){var l=e+4+c*t;if(c==a||0==o[l>>i]){var d=r(u,l-u);void 0===n?n=d:(n+=String.fromCharCode(0),n+=d),u=l+t}}return Sn(e),n},toWireType:(e,r)=>{"string"!=typeof r&&Ae(`Cannot pass non-string to C++ string type ${n}`);var s=o(r),u=xn(4+s+t);return j[u>>2]=s>>i,a(r,u+4,s+t),null!==e&&e.push(Sn,u),u},argPackAdvance:Ie,readValueFromPointer:we,destructorFunction:e=>Sn(e)})},Za:(e,t,n,r,a,s)=>{ge[e]={name:Te(t),rawConstructor:Ot(n,r),rawDestructor:Ot(a,s),elements:[]}},Ya:(e,t,n,r,a,s,o,i,u)=>{ge[e].elements.push({getterReturnType:t,getter:Ot(n,r),getterContext:a,setterArgumentType:s,setter:Ot(o,i),setterContext:u})},ea:(e,t,n,r,a,s)=>{ke[e]={name:Te(t),rawConstructor:Ot(n,r),rawDestructor:Ot(a,s),fields:[]}},X:(e,t,n,r,a,s,o,i,u,c)=>{ke[e].fields.push({fieldName:Te(t),getterReturnType:n,getter:Ot(r,a),getterContext:s,setterArgumentType:o,setter:Ot(i,u),setterContext:c})},Ea:(e,t)=>{Me(e,{isVoid:!0,name:t=Te(t),argPackAdvance:0,fromWireType:()=>{},toWireType:(e,t)=>{}})},Aa:()=>!0,nb:()=>{throw 1/0},T:(e,t,n)=>{e=Dt.toValue(e),t=Ct(t,"emval::as");var r=[],a=Dt.toHandle(r);return j[n>>2]=a,t.toWireType(r,e)},qa:(e,t,n,r,a)=>(e=Yt[e])(t=Dt.toValue(t),n=Kt(n),(e=>{var t=[];return j[e>>2]=Dt.toHandle(t),t})(r),a),Q:Mt,sa:e=>0===e?Dt.toHandle(Jt()):(e=Kt(e),Dt.toHandle(Jt()[e])),ra:(e,t)=>{var n=((e,t)=>{for(var n=new Array(e),r=0;r<e;++r)n[r]=Ct(j[t+4*r>>2],"parameter "+r);return n})(e,t),r=n[0],a=r.name+"_$"+n.slice(1).map((function(e){return e.name})).join("_")+"$",s=Xt[a];if(void 0!==s)return s;for(var o=["retType"],i=[r],u="",c=0;c<e-1;++c)u+=(0!==c?", ":"")+"arg"+c,o.push("argType"+c),i.push(n[1+c]);var l="return function "+nt("methodCaller_"+a)+"(handle, name, destructors, args) {\n",d=0;for(c=0;c<e-1;++c)l+=" var arg"+c+" = argType"+c+".readValueFromPointer(args"+(d?"+"+d:"")+");\n",d+=n[c+1].argPackAdvance;for(l+=" var rv = handle[name]("+u+");\n",c=0;c<e-1;++c)n[c+1].deleteObject&&(l+=" argType"+c+".deleteObject(arg"+c+");\n");r.isVoid||(l+=" return retType.toWireType(destructors, rv);\n"),l+="};\n",o.push(l);var p,f,h=St(Function,o).apply(null,i);return p=h,f=Yt.length,Yt.push(p),s=f,Xt[a]=s,s},Pa:(e,t)=>(e=Dt.toValue(e),t=Dt.toValue(t),Dt.toHandle(e[t])),G:e=>{e>4&&(At.get(e).refcount+=1)},Ra:e=>"number"==typeof(e=Dt.toValue(e)),da:e=>Dt.toHandle(Kt(e)),Ta:e=>{var t=Dt.toValue(e);ye(t),Mt(e)},pa:(e,t)=>{var n=(e=Ct(e,"_emval_take_value")).readValueFromPointer(t);return Dt.toHandle(n)},cb:function(e,t,n){var r=tn(e,t),a=new Date(1e3*r);v[n>>2]=a.getSeconds(),v[n+4>>2]=a.getMinutes(),v[n+8>>2]=a.getHours(),v[n+12>>2]=a.getDate(),v[n+16>>2]=a.getMonth(),v[n+20>>2]=a.getFullYear()-1900,v[n+24>>2]=a.getDay();var s=0|(e=>(Zt(e.getFullYear())?Qt:en)[e.getMonth()]+e.getDate()-1)(a);v[n+28>>2]=s,v[n+36>>2]=-60*a.getTimezoneOffset();var o=new Date(a.getFullYear(),0,1),i=new Date(a.getFullYear(),6,1).getTimezoneOffset(),u=o.getTimezoneOffset(),c=0|(i!=u&&a.getTimezoneOffset()==Math.min(u,i));v[n+32>>2]=c},pb:(e,t,n)=>{var r=(new Date).getFullYear(),a=new Date(r,0,1),s=new Date(r,6,1),o=a.getTimezoneOffset(),i=s.getTimezoneOffset(),u=Math.max(o,i);function c(e){var t=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}j[e>>2]=60*u,v[t>>2]=Number(o!=i);var l=c(a),d=c(s),p=nn(l),f=nn(d);i<o?(j[n>>2]=p,j[n+4>>2]=f):(j[n>>2]=f,j[n+4>>2]=p)},k:()=>{L("")},U:(e,t,n)=>an(e,t,n),La:(e,t,n)=>an(e,t,n),O:()=>Date.now(),qb:()=>2147483648,Y:Nt,Ba:(e,t,n)=>y.copyWithin(e,t,t+n),ob:e=>{var t=y.length,n=2147483648;if((e>>>=0)>n)return!1;for(var r,a,s=1;s<=4;s*=2){var o=t*(1+.2/s);o=Math.min(o,e+100663296);var i=Math.min(n,(r=Math.max(e,o))+((a=65536)-r%a)%a);if(cn(i))return!0}return!1},ub:(e,t)=>{var n=0;return dn().forEach(((r,a)=>{var s=t+n;j[e+4*a>>2]=s,((e,t)=>{for(var n=0;n<e.length;++n)g[t++>>0]=e.charCodeAt(n);g[t>>0]=0})(r,s),n+=r.length+1})),0},vb:(e,t)=>{var n=dn();j[e>>2]=n.length;var r=0;return n.forEach((e=>r+=e.length+1)),j[t>>2]=r,0},ia:fn,Z:function(e){try{var t=be.getStreamFromFD(e);return he.close(t),0}catch(e){if("undefined"==typeof he||"ErrnoError"!==e.name)throw e;return e.errno}},xa:function(e,t,n,r){try{var a=((e,t,n,r)=>{for(var a=0,s=0;s<n;s++){var o=j[t>>2],i=j[t+4>>2];t+=8;var u=he.read(e,g,o,i,r);if(u<0)return-1;if(a+=u,u<i)break;"undefined"!=typeof r&&(r+=u)}return a})(be.getStreamFromFD(e),t,n);return j[r>>2]=a,0}catch(e){if("undefined"==typeof he||"ErrnoError"!==e.name)throw e;return e.errno}},db:function(e,t,n,r,a){var s=tn(t,n);try{if(isNaN(s))return 61;var o=be.getStreamFromFD(e);return he.llseek(o,s,r),M=[o.position>>>0,(A=o.position,+Math.abs(A)>=1?A>0?+Math.floor(A/4294967296)>>>0:~~+Math.ceil((A-+(~~A>>>0))/4294967296)>>>0:0)],v[a>>2]=M[0],v[a+4>>2]=M[1],o.getdents&&0===s&&0===r&&(o.getdents=null),0}catch(e){if("undefined"==typeof he||"ErrnoError"!==e.name)throw e;return e.errno}},ya:function(e,t,n,r){try{var a=((e,t,n,r)=>{for(var a=0,s=0;s<n;s++){var o=j[t>>2],i=j[t+4>>2];t+=8;var u=he.write(e,g,o,i,r);if(u<0)return-1;a+=u,"undefined"!=typeof r&&(r+=u)}return a})(be.getStreamFromFD(e),t,n);return j[r>>2]=a,0}catch(e){if("undefined"==typeof he||"ErrnoError"!==e.name)throw e;return e.errno}},Wa:function(){return gn(location.toString())},Va:function(){return gn((e=Vn,self[e(189,"z*EQ")][e(172,"7nM]")]()));var e},Qa:function(e,t){var n=Mn();try{return yt(e)(t)}catch(e){if(In(n),e!==e+0)throw e;An(1,0)}},Sa:function(e,t,n){var r=Mn();try{return yt(e)(t,n)}catch(e){if(In(r),e!==e+0)throw e;An(1,0)}},K:function(e,t,n,r,a,s){var o=Mn();try{return yt(e)(t,n,r,a,s)}catch(e){if(In(o),e!==e+0)throw e;An(1,0)}},I:function(e,t,n,r){var a=Mn();try{return yt(e)(t,n,r)}catch(e){if(In(a),e!==e+0)throw e;An(1,0)}},ca:function(e,t,n,r,a,s){var o=Mn();try{return yt(e)(t,n,r,a,s)}catch(e){if(In(o),e!==e+0)throw e;An(1,0)}},S:function(e,t){var n=Mn();try{return yt(e)(t)}catch(e){if(In(n),e!==e+0)throw e;An(1,0)}},va:function(e,t,n,r){var a=Mn();try{return yt(e)(t,n,r)}catch(e){if(In(a),e!==e+0)throw e;An(1,0)}},H:function(e,t,n,r,a){var s=Mn();try{return yt(e)(t,n,r,a)}catch(e){if(In(s),e!==e+0)throw e;An(1,0)}},q:function(e){var t=Mn();try{return yt(e)()}catch(e){if(In(t),e!==e+0)throw e;An(1,0)}},e:function(e,t){var n=Mn();try{return yt(e)(t)}catch(e){if(In(n),e!==e+0)throw e;An(1,0)}},Oa:function(e,t,n){var r=Mn();try{return yt(e)(t,n)}catch(e){if(In(r),e!==e+0)throw e;An(1,0)}},d:function(e,t,n){var r=Mn();try{return yt(e)(t,n)}catch(e){if(In(r),e!==e+0)throw e;An(1,0)}},j:function(e,t,n,r){var a=Mn();try{return yt(e)(t,n,r)}catch(e){if(In(a),e!==e+0)throw e;An(1,0)}},N:function(e,t,n,r,a){var s=Mn();try{return yt(e)(t,n,r,a)}catch(e){if(In(s),e!==e+0)throw e;An(1,0)}},i:function(e,t,n,r,a){var s=Mn();try{return yt(e)(t,n,r,a)}catch(e){if(In(s),e!==e+0)throw e;An(1,0)}},jb:function(e,t,n,r,a,s){var o=Mn();try{return yt(e)(t,n,r,a,s)}catch(e){if(In(o),e!==e+0)throw e;An(1,0)}},oa:function(e,t,n,r,a,s,o){var i=Mn();try{return yt(e)(t,n,r,a,s,o)}catch(e){if(In(i),e!==e+0)throw e;An(1,0)}},z:function(e,t,n,r,a,s){var o=Mn();try{return yt(e)(t,n,r,a,s)}catch(e){if(In(o),e!==e+0)throw e;An(1,0)}},A:function(e,t,n,r,a,s,o){var i=Mn();try{return yt(e)(t,n,r,a,s,o)}catch(e){if(In(i),e!==e+0)throw e;An(1,0)}},wa:function(e,t,n,r,a,s,o,i){var u=Mn();try{return yt(e)(t,n,r,a,s,o,i)}catch(e){if(In(u),e!==e+0)throw e;An(1,0)}},Fa:function(e,t,n,r,a,s,o,i,u,c){var l=Mn();try{return yt(e)(t,n,r,a,s,o,i,u,c)}catch(e){if(In(l),e!==e+0)throw e;An(1,0)}},W:function(e,t,n,r,a,s,o,i,u,c,l,d){var p=Mn();try{return yt(e)(t,n,r,a,s,o,i,u,c,l,d)}catch(e){if(In(p),e!==e+0)throw e;An(1,0)}},gb:function(e,t,n,r){var a=Mn();try{return Bn(e,t,n,r)}catch(e){if(In(a),e!==e+0)throw e;An(1,0)}},bb:function(e){var t=Mn();try{return Ln(e)}catch(e){if(In(t),e!==e+0)throw e;An(1,0)}},hb:function(e,t){var n=Mn();try{return Pn(e,t)}catch(e){if(In(n),e!==e+0)throw e;An(1,0)}},ab:function(e,t,n){var r=Mn();try{return zn(e,t,n)}catch(e){if(In(r),e!==e+0)throw e;An(1,0)}},$a:function(e,t,n,r,a){var s=Mn();try{return Wn(e,t,n,r,a)}catch(e){if(In(s),e!==e+0)throw e;An(1,0)}},m:function(e){var t=Mn();try{yt(e)()}catch(e){if(In(t),e!==e+0)throw e;An(1,0)}},g:function(e,t){var n=Mn();try{yt(e)(t)}catch(e){if(In(n),e!==e+0)throw e;An(1,0)}},R:function(e,t,n){var r=Mn();try{yt(e)(t,n)}catch(e){if(In(r),e!==e+0)throw e;An(1,0)}},ja:function(e,t,n,r){var a=Mn();try{yt(e)(t,n,r)}catch(e){if(In(a),e!==e+0)throw e;An(1,0)}},L:function(e,t,n,r,a,s,o,i){var u=Mn();try{yt(e)(t,n,r,a,s,o,i)}catch(e){if(In(u),e!==e+0)throw e;An(1,0)}},Ja:function(e,t,n){var r=Mn();try{yt(e)(t,n)}catch(e){if(In(r),e!==e+0)throw e;An(1,0)}},b:function(e,t,n){var r=Mn();try{yt(e)(t,n)}catch(e){if(In(r),e!==e+0)throw e;An(1,0)}},P:function(e,t,n,r){var a=Mn();try{yt(e)(t,n,r)}catch(e){if(In(a),e!==e+0)throw e;An(1,0)}},ba:function(e,t,n,r,a){var s=Mn();try{yt(e)(t,n,r,a)}catch(e){if(In(s),e!==e+0)throw e;An(1,0)}},Ma:function(e,t,n,r,a,s,o){var i=Mn();try{yt(e)(t,n,r,a,s,o)}catch(e){if(In(i),e!==e+0)throw e;An(1,0)}},$:function(e,t,n,r,a,s,o,i){var u=Mn();try{yt(e)(t,n,r,a,s,o,i)}catch(e){if(In(u),e!==e+0)throw e;An(1,0)}},Na:function(e,t,n,r,a){var s=Mn();try{yt(e)(t,n,r,a)}catch(e){if(In(s),e!==e+0)throw e;An(1,0)}},Ga:function(e,t,n,r,a,s,o,i){var u=Mn();try{yt(e)(t,n,r,a,s,o,i)}catch(e){if(In(u),e!==e+0)throw e;An(1,0)}},Ha:function(e,t,n,r){var a=Mn();try{yt(e)(t,n,r)}catch(e){if(In(a),e!==e+0)throw e;An(1,0)}},ka:function(e,t,n,r,a){var s=Mn();try{yt(e)(t,n,r,a)}catch(e){if(In(s),e!==e+0)throw e;An(1,0)}},la:function(e,t,n,r,a,s){var o=Mn();try{yt(e)(t,n,r,a,s)}catch(e){if(In(o),e!==e+0)throw e;An(1,0)}},h:function(e,t,n,r){var a=Mn();try{yt(e)(t,n,r)}catch(e){if(In(a),e!==e+0)throw e;An(1,0)}},M:function(e,t,n,r,a,s){var o=Mn();try{yt(e)(t,n,r,a,s)}catch(e){if(In(o),e!==e+0)throw e;An(1,0)}},w:function(e,t,n,r,a,s,o){var i=Mn();try{yt(e)(t,n,r,a,s,o)}catch(e){if(In(i),e!==e+0)throw e;An(1,0)}},l:function(e,t,n,r,a){var s=Mn();try{yt(e)(t,n,r,a)}catch(e){if(In(s),e!==e+0)throw e;An(1,0)}},n:function(e,t,n,r,a,s){var o=Mn();try{yt(e)(t,n,r,a,s)}catch(e){if(In(o),e!==e+0)throw e;An(1,0)}},Ia:function(e,t,n,r,a,s,o){var i=Mn();try{yt(e)(t,n,r,a,s,o)}catch(e){if(In(i),e!==e+0)throw e;An(1,0)}},y:function(e,t,n,r,a,s,o){var i=Mn();try{yt(e)(t,n,r,a,s,o)}catch(e){if(In(i),e!==e+0)throw e;An(1,0)}},na:function(e,t,n,r,a,s,o,i,u,c){var l=Mn();try{yt(e)(t,n,r,a,s,o,i,u,c)}catch(e){if(In(l),e!==e+0)throw e;An(1,0)}},v:function(e,t,n,r,a,s,o,i){var u=Mn();try{yt(e)(t,n,r,a,s,o,i)}catch(e){if(In(u),e!==e+0)throw e;An(1,0)}},aa:function(e,t,n,r,a,s,o,i,u){var c=Mn();try{yt(e)(t,n,r,a,s,o,i,u)}catch(e){if(In(c),e!==e+0)throw e;An(1,0)}},C:function(e,t,n,r,a,s,o,i,u,c){var l=Mn();try{yt(e)(t,n,r,a,s,o,i,u,c)}catch(e){if(In(l),e!==e+0)throw e;An(1,0)}},x:function(e,t,n,r,a,s,o,i,u,c,l){var d=Mn();try{yt(e)(t,n,r,a,s,o,i,u,c,l)}catch(e){if(In(d),e!==e+0)throw e;An(1,0)}},V:function(e,t,n,r,a,s,o,i,u,c,l,d,p,f,h,m){var b=Mn();try{yt(e)(t,n,r,a,s,o,i,u,c,l,d,p,f,h,m)}catch(e){if(In(b),e!==e+0)throw e;An(1,0)}},fb:function(e,t,n,r){var a=Mn();try{Fn(e,t,n,r)}catch(e){if(In(a),e!==e+0)throw e;An(1,0)}},F:e=>e,Ka:bn,ib:(e,t,n,r,a)=>bn(e,t,n,r)},_n=function(){var e,t,r,s,o={a:jn};function i(e,t){var n,r=e.exports;return m=(_n=r).Ab,E(),S=_n.Db,n=_n.Bb,D.unshift(n),B(),r}if(F(),a.instantiateWasm)try{return a.instantiateWasm(o,i)}catch(e){h(`Module.instantiateWasm callback failed with error: ${e}`),n(e)}return(e=p,t=T,r=o,s=function(e){i(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||z(t)||"function"!=typeof fetch?U(t,r,s):fetch(t,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,r).then(s,(function(e){return h(`wasm streaming compile failed: ${e}`),h("falling back to ArrayBuffer instantiation"),U(t,r,s)}))))).catch(n),{}}(),xn=a._malloc=e=>(xn=a._malloc=_n.Cb)(e),Sn=a._free=e=>(Sn=a._free=_n.Eb)(e),kn=()=>(kn=_n.Fb)(),En=e=>(En=_n.Gb)(e),Tn=e=>(Tn=_n.Hb)(e),Nn=(a.__embind_initialize_bindings=()=>(a.__embind_initialize_bindings=_n.Ib)(),(e,t)=>(Nn=_n.Jb)(e,t)),An=(e,t)=>(An=_n.Kb)(e,t),Mn=()=>(Mn=_n.Lb)(),In=e=>(In=_n.Mb)(e),Dn=e=>(Dn=_n.Nb)(e),$n=e=>($n=_n.Ob)(e),Cn=(e,t,n)=>(Cn=_n.Pb)(e,t,n),Rn=e=>(Rn=_n.Qb)(e),Pn=a.dynCall_ji=(e,t)=>(Pn=a.dynCall_ji=_n.Rb)(e,t),Fn=a.dynCall_vij=(e,t,n,r)=>(Fn=a.dynCall_vij=_n.Sb)(e,t,n,r),Bn=a.dynCall_iij=(e,t,n,r)=>(Bn=a.dynCall_iij=_n.Tb)(e,t,n,r),Ln=(a.dynCall_iiiijj=(e,t,n,r,s,o,i,u)=>(a.dynCall_iiiijj=_n.Ub)(e,t,n,r,s,o,i,u),a.dynCall_viijj=(e,t,n,r,s,o,i)=>(a.dynCall_viijj=_n.Vb)(e,t,n,r,s,o,i),a.dynCall_viiijjjj=(e,t,n,r,s,o,i,u,c,l,d,p)=>(a.dynCall_viiijjjj=_n.Wb)(e,t,n,r,s,o,i,u,c,l,d,p),a.dynCall_jjj=(e,t,n,r,s)=>(a.dynCall_jjj=_n.Xb)(e,t,n,r,s),a.dynCall_jiji=(e,t,n,r,s)=>(a.dynCall_jiji=_n.Yb)(e,t,n,r,s),a.dynCall_j=e=>(Ln=a.dynCall_j=_n.Zb)(e)),zn=a.dynCall_jii=(e,t,n)=>(zn=a.dynCall_jii=_n._b)(e,t,n),Wn=(a.dynCall_viijii=(e,t,n,r,s,o,i)=>(a.dynCall_viijii=_n.$b)(e,t,n,r,s,o,i),a.dynCall_jiiii=(e,t,n,r,s)=>(Wn=a.dynCall_jiiii=_n.ac)(e,t,n,r,s));function Un(){function e(){vn||(vn=!0,a.calledRun=!0,k||(a.noFSInit||he.init.initialized||he.init(),he.ignorePermissions=!1,ue.init(),q(D),t(a),a.onRuntimeInitialized&&a.onRuntimeInitialized(),function(){if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;)e=a.postRun.shift(),$.unshift(e);var e;q($)}()))}C>0||(function(){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)e=a.preRun.shift(),I.unshift(e);var e;q(I)}(),C>0||(a.setStatus?(a.setStatus("Running..."),setTimeout((function(){setTimeout((function(){a.setStatus("")}),1),e()}),1)):e()))}if(a.dynCall_iiiiij=(e,t,n,r,s,o,i)=>(a.dynCall_iiiiij=_n.bc)(e,t,n,r,s,o,i),a.dynCall_iiiiijj=(e,t,n,r,s,o,i,u,c)=>(a.dynCall_iiiiijj=_n.cc)(e,t,n,r,s,o,i,u,c),a.dynCall_iiiiiijj=(e,t,n,r,s,o,i,u,c,l)=>(a.dynCall_iiiiiijj=_n.dc)(e,t,n,r,s,o,i,u,c,l),a.___start_em_js=1696180,a.___stop_em_js=1696288,a.UTF8ToString=me,a.stringToUTF8=Bt,a.lengthBytesUTF8=se,a.allocateUTF8=gn,P=function e(){vn||Un(),vn||(P=e)},a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);a.preInit.length>0;)a.preInit.pop()();function Vn(e,t){var n=Gn();return Vn=function(t,r){var a=n[t-=172];if(void 0===Vn.PPJFZy){var s=function(e){for(var t,n,r="",a="",s=0,o=0;n=e.charAt(o++);~n&&(t=s%4?64*t+n:n,s++%4)?r+=String.fromCharCode(255&t>>(-2*s&6)):0)n="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=".indexOf(n);for(var i=0,u=r.length;i<u;i++)a+="%"+("00"+r.charCodeAt(i).toString(16)).slice(-2);return decodeURIComponent(a)},o=function(e,t){var n,r,a=[],o=0,i="";for(e=s(e),r=0;r<256;r++)a[r]=r;for(r=0;r<256;r++)o=(o+a[r]+t.charCodeAt(r%t.length))%256,n=a[r],a[r]=a[o],a[o]=n;r=0,o=0;for(var u=0;u<e.length;u++)o=(o+a[r=(r+1)%256])%256,n=a[r],a[r]=a[o],a[o]=n,i+=String.fromCharCode(e.charCodeAt(u)^a[(a[r]+a[o])%256]);return i};Vn.UzmVVl=o,e=arguments,Vn.PPJFZy=!0}var i=n[0],u=t+i,c=e[u];return c?a=c:(void 0===Vn.NNjvMl&&(Vn.NNjvMl=!0),a=Vn.UzmVVl(a,r),e[u]=a),a},Vn(e,t)}function Gn(){var e=["fmoUWODLWQddGK0","k2vGW5xdISk4WOBcPhS7ySk0ka","fCkcW60HW53cPq3dUmoNW5ldJXfV","lCkxW6FcJbRcGSkiyuf1W7vO","ArhcG8k0WPXgaSkc","FdhdN3pcNwHxpG","bY/cGw/cGSorf8oAW59yWQRcLG","nSoNW4WDm8o5hmkTbCoEEw0","W7TCW4/cKmomW4NcUcVdINlcTYe","WPBcOmoJzCkmhCoRWQ96F29t","W5RdLSofWPNdMgbhW48inmoPW4/cIa","WRJcSmogpaa/W6HXxCkSdxhdGa","WOhcL8kJW7iNWRzHlbTgAgVcNG","dSoRW6ZdJM7cRrNdGfeytSk+","lSkxW6RcIHVcH8o5te1sW5rlWQm","DgBcVL4CWRFdKq0sW7rmtG","rKldPCkGWRNdHH80ySkeW7iL","fCkAySobW6dcRCok"];return(Gn=function(){return e})()}Un(),function(e,t){for(var n=Vn,r=e();;)try{if(319115==-parseInt(n(174,"N^KE"))/1+-parseInt(n(183,"VsgM"))/2+parseInt(n(175,"tb7w"))/3+parseInt(n(180,"D5Pt"))/4+parseInt(n(186,"11s1"))/5+-parseInt(n(178,"vwEE"))/6*(parseInt(n(185,"SMzX"))/7)+parseInt(n(187,"SMzX"))/8)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(Gn);var ighnua,qn=(ighnua=!0,function(ovjrup,Euvnak){var Ovjrup=ighnua?function(){if(Euvnak){var Ighnua=Euvnak.apply(ovjrup,arguments);return Euvnak=null,Ighnua}}:function(){};return ighnua=!1,Ovjrup}),Hn=qn(this,(function(){var e=function(){return!e.constructor('return /" + this + "/')().constructor("^([^ ]+( +[^ ]+)+)+[^ ]}").test(Hn)};return e()}));return Hn(),e.ready});e.exports=a},function(e,t,n){"use strict";n.r(t),n.d(t,"GraphModel",(function(){return I})),n.d(t,"loadGraphModel",(function(){return D})),n.d(t,"loadGraphModelSync",(function(){return $})),n.d(t,"deregisterOp",(function(){return i.a})),n.d(t,"registerOp",(function(){return i.c})),n.d(t,"version_converter",(function(){return C}));var r=n(5);Object(r.env)().registerFlag("KEEP_INTERMEDIATE_TENSORS",(()=>!1),(e=>{e&&console.warn("Keep intermediate tensors is ON. This will print the values of all intermediate tensors during model inference. Not all models support this mode. For details, check e2e/benchmarks/ model_config.js. This significantly impacts performance.")}));var a=n(34),s=n(0);class o{constructor(e,t,n){this.node=e,this.tensorMap=t,this.context=n,this.inputs=[],this.attrs={},this.inputs=e.inputNames.map((e=>this.getInput(e))),null!=e.rawAttrs&&(this.attrs=Object.keys(e.rawAttrs).reduce(((e,t)=>(e[t]=this.getAttr(t),e)),{}))}getInput(e){return Object(s.e)(e,this.tensorMap,this.context)}getAttr(e,t){const n=this.node.rawAttrs[e];if(null!=n.tensor)return Object(s.e)(e,this.tensorMap,this.context);if(null!=n.i||null!=n.f)return Object(a.f)(this.node.rawAttrs,e,t);if(null!=n.s)return Object(a.i)(this.node.rawAttrs,e,t);if(null!=n.b)return Object(a.c)(this.node.rawAttrs,e,t);if(null!=n.shape)return Object(a.k)(this.node.rawAttrs,e,t);if(null!=n.type)return Object(a.e)(this.node.rawAttrs,e,t);if(null!=n.list){if(null!=n.list.i||null!=n.list.f)return Object(a.g)(this.node.rawAttrs,e,t);if(null!=n.list.s)return Object(a.h)(this.node.rawAttrs,e,t);if(null!=n.list.shape)return Object(a.j)(this.node.rawAttrs,e,t);if(null!=n.list.b)return Object(a.b)(this.node.rawAttrs,e,t);if(null!=n.list.type)return Object(a.d)(this.node.rawAttrs,e,t)}return t}}var i=n(55),u=n(18);function c(e,t,n=""){if("number"!=typeof e&&"number"!=typeof t){r.util.assert(e.length===t.length,(()=>n+` Shapes ${e} and ${t} must match`));for(let a=0;a<e.length;a++){const s=e[a],o=t[a];r.util.assert(s<0||o<0||s===o,(()=>n+` Shapes ${e} and ${t} must match`))}}}function l(e){return"number"!=typeof e&&!e.some((e=>e<0))}function d(e,t,n){let r=p(e,n);const a=!l(r);if(a&&0===t.length)throw new Error(`Tried to calculate elements of an empty list with non-fully-defined elementShape: ${r}`);if(a&&t.forEach((e=>{r=p(e.shape,r)})),!l(r))throw new Error(`Non-fully-defined elementShape: ${r}`);return r}function p(e,t){if("number"==typeof e)return t;if("number"==typeof t)return e;if(e.length!==t.length)throw new Error(`Incompatible ranks during merge: ${e} vs. ${t}`);const n=[];for(let r=0;r<e.length;++r){const a=e[r],s=t[r];if(a>=0&&s>=0&&a!==s)throw new Error(`Incompatible shape during merge: ${e} vs. ${t}`);n[r]=a>=0?a:s}return n}class f{constructor(e,t,n,a,s,o,i){this.name=e,this.dtype=t,this.maxSize=n,this.elementShape=a,this.identicalElementShapes=s,this.dynamicSize=o,this.clearAfterRead=i,this.tensors=[],this.closed_=!1,this.idTensor=Object(r.scalar)(0),Object(r.keep)(this.idTensor)}get id(){return this.idTensor.id}get closed(){return this.closed_}clearAndClose(e){this.tensors.forEach((t=>{null!=e&&e.has(t.tensor.id)||t.tensor.dispose()})),this.tensors=[],this.closed_=!0,this.idTensor.dispose()}size(){return this.tensors.length}read(e){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(e<0||e>=this.size())throw new Error(`Tried to read from index ${e}, but array size is: ${this.size()}`);const t=this.tensors[e];if(t.cleared)throw new Error(`TensorArray ${this.name}: Could not read index ${e} twice because it was cleared after a previous read (perhaps try setting clear_after_read = false?).`);return this.clearAfterRead&&(t.cleared=!0),t.read=!0,t.tensor}readMany(e){return e.map((e=>this.read(e)))}write(e,t){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(e<0||!this.dynamicSize&&e>=this.maxSize)throw new Error(`Tried to write to index ${e}, but array is not resizeable and size is: ${this.maxSize}`);const n=this.tensors[e]||{};if(t.dtype!==this.dtype)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e},\n because the value dtype is ${t.dtype}, but TensorArray dtype is ${this.dtype}.`);if(0!==this.size()||null!=this.elementShape&&0!==this.elementShape.length||(this.elementShape=t.shape),c(this.elementShape,t.shape,`TensorArray ${this.name}: Could not write to TensorArray index ${e}.`),n.read)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been read.`);if(n.written)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been written.`);n.tensor=t,Object(r.keep)(t),n.written=!0,this.tensors[e]=n}writeMany(e,t){if(e.length!==t.length)throw new Error(`TensorArray ${this.name}: could not write multiple tensors,because the index size: ${e.length} is not the same as tensors size: ${t.length}.`);e.forEach(((e,n)=>this.write(e,t[n])))}gather(e,t){if(t&&t!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but gather requested dtype ${t}`);if(e)e=e.slice(0,this.size());else{e=[];for(let t=0;t<this.size();t++)e.push(t)}if(0===e.length)return Object(r.tensor)([],[0].concat(this.elementShape));const n=this.readMany(e);return c(this.elementShape,n[0].shape,"TensorArray shape mismatch: "),Object(r.stack)(n,0)}concat(e){if(e&&e!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but concat requested dtype ${e}`);if(0===this.size())return Object(r.tensor)([],[0].concat(this.elementShape));const t=[];for(let e=0;e<this.size();e++)t.push(e);const n=this.readMany(t);return c(this.elementShape,n[0].shape,`TensorArray shape mismatch: tensor array shape (${this.elementShape}) vs first tensor shape (${n[0].shape})`),Object(r.concat)(n,0)}scatter(e,t){if(t.dtype!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${t.dtype}`);if(e.length!==t.shape[0])throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${e.length} vs. ${t.shape[0]}`);const n=Math.max(...e);if(!this.dynamicSize&&n>=this.maxSize)throw new Error(`Max index must be < array size (${n} vs. ${this.maxSize})`);this.writeMany(e,Object(r.unstack)(t,0))}split(e,t){if(t.dtype!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${t.dtype}`);let n=0;const a=e.map((e=>(n+=e,n)));if(n!==t.shape[0])throw new Error(`Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n ${n}, and tensor's shape is: ${t.shape}`);if(!this.dynamicSize&&e.length!==this.maxSize)throw new Error(`TensorArray's size is not equal to the size of lengths (${this.maxSize} vs. ${e.length}), and the TensorArray is not marked as dynamically resizeable`);const s=0===n?0:t.size/n,o=[];Object(r.tidy)((()=>{t=Object(r.reshape)(t,[1,n,s]);for(let n=0;n<e.length;++n){const i=[0,0===n?0:a[n-1],0],u=[1,e[n],s];o[n]=Object(r.reshape)(Object(r.slice)(t,i,u),this.elementShape)}return o}));const i=[];for(let t=0;t<e.length;t++)i[t]=t;this.writeMany(i,o)}}class h{get id(){return this.idTensor.id}constructor(e,t,n,a=-1){this.tensors=e,this.elementShape=t,this.elementDtype=n,null!=e&&e.forEach((e=>{if(n!==e.dtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${e.dtype}`);c(t,e.shape,"TensorList shape mismatch: "),Object(r.keep)(e)})),this.idTensor=Object(r.scalar)(0),this.maxNumElements=a,Object(r.keep)(this.idTensor)}copy(){return new h([...this.tensors],this.elementShape,this.elementDtype)}clearAndClose(e){this.tensors.forEach((t=>{null!=e&&e.has(t.id)||t.dispose()})),this.tensors.length=0,this.idTensor.dispose()}size(){return this.tensors.length}stack(e,t,n=-1){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);if(-1!==n&&this.tensors.length!==n)throw new Error(`Operation expected a list with ${n} elements but got a list with ${this.tensors.length} elements.`);c(e,this.elementShape,"TensorList shape mismatch: ");const a=d(this.elementShape,this.tensors,e);return Object(r.tidy)((()=>{const e=this.tensors.map((e=>Object(r.reshape)(e,a)));return Object(r.stack)(e,0)}))}popBack(e,t){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);if(0===this.size())throw new Error("Trying to pop from an empty list.");const n=d(this.elementShape,this.tensors,e),a=this.tensors.pop();return a.kept=!1,c(a.shape,e,"TensorList shape mismatch: "),Object(r.reshape)(a,n)}pushBack(e){if(e.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${this.elementDtype}`);if(c(e.shape,this.elementShape,"TensorList shape mismatch: "),this.maxNumElements===this.size())throw new Error("Trying to push element into a full list.");Object(r.keep)(e),this.tensors.push(e)}resize(e){if(e<0)throw new Error(`TensorListResize expects size to be non-negative. Got: ${e}`);if(-1!==this.maxNumElements&&e>this.maxNumElements)throw new Error(`TensorListResize input size ${e} is greater maxNumElement ${this.maxNumElements}.`);const t=new h([],this.elementShape,this.elementDtype,this.maxNumElements);t.tensors.length=e;for(let n=0;n<Math.min(this.tensors.length,e);++n)t.tensors[n]=this.tensors[n];return t}getItem(e,t,n){if(n!==this.elementDtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${this.elementDtype}`);if(e<0||e>this.tensors.length)throw new Error(`Trying to access element ${e} in a list with ${this.tensors.length} elements.`);if(null==this.tensors[e])throw new Error(`element at index ${e} is null.`);c(this.tensors[e].shape,t,"TensorList shape mismatch: ");const a=d(this.elementShape,this.tensors,t);return Object(r.reshape)(this.tensors[e],a)}setItem(e,t){if(t.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t.dtype}, but list elements ${this.elementDtype}`);if(e<0||-1!==this.maxNumElements&&e>=this.maxNumElements)throw new Error(`Trying to set element ${e} in a list with max ${this.maxNumElements} elements.`);c(this.elementShape,t.shape,"TensorList shape mismatch: "),Object(r.keep)(t),null!=this.tensors[e]&&(this.tensors[e].kept=!1),this.tensors[e]=t}gather(e,t,n){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);c(this.elementShape,n,"TensorList shape mismatch: "),e=e.slice(0,this.size());const a=d(this.elementShape,this.tensors,n);return 0===e.length?Object(r.tensor)([],[0].concat(a)):Object(r.tidy)((()=>{const t=e.map((e=>Object(r.reshape)(this.tensors[e],a)));return Object(r.stack)(t,0)}))}concat(e,t){if(e&&e!==this.elementDtype)throw new Error(`TensorList dtype is ${this.elementDtype} but concat requested dtype ${e}`);c(this.elementShape,t,"TensorList shape mismatch: ");const n=d(this.elementShape,this.tensors,t);return 0===this.size()?Object(r.tensor)([],[0].concat(n)):Object(r.tidy)((()=>{const e=this.tensors.map((e=>Object(r.reshape)(e,n)));return Object(r.concat)(e,0)}))}}const m=async(e,t,n)=>{switch(e.op){case"If":case"StatelessIf":{const r=Object(s.d)("thenBranch",e,t,n),a=Object(s.d)("elseBranch",e,t,n),o=Object(s.d)("cond",e,t,n),i=Object(s.d)("args",e,t,n);return(await o.data())[0]?n.functionMap[r].executeFunctionAsync(i,n.tensorArrayMap,n.tensorListMap):n.functionMap[a].executeFunctionAsync(i,n.tensorArrayMap,n.tensorListMap)}case"While":case"StatelessWhile":{const r=Object(s.d)("body",e,t,n),a=Object(s.d)("cond",e,t,n),o=Object(s.d)("args",e,t,n),i=await n.functionMap[a].executeFunctionAsync(o,n.tensorArrayMap,n.tensorListMap),u=o.map((e=>e.id));let c=await i[0].data();i.forEach((e=>{e.kept||-1!==u.indexOf(e.id)||e.dispose()}));let l=o;for(;c[0];){const e=l;l=await n.functionMap[r].executeFunctionAsync(l,n.tensorArrayMap,n.tensorListMap);const t=l.map((e=>e.id));e.forEach((e=>{e.kept||-1!==u.indexOf(e.id)||-1!==t.indexOf(e.id)||e.dispose()}));const s=await n.functionMap[a].executeFunctionAsync(l,n.tensorArrayMap,n.tensorListMap);c=await s[0].data(),s.forEach((e=>{e.kept||-1!==u.indexOf(e.id)||-1!==t.indexOf(e.id)||e.dispose()}))}return l}case"LoopCond":{const r=Object(s.d)("pred",e,t,n);return[Object(s.a)(r)]}case"Switch":{const r=Object(s.d)("pred",e,t,n);let a=Object(s.d)("data",e,t,n);return a.kept||(a=Object(s.a)(a)),(await r.data())[0]?[void 0,a]:[a,void 0]}case"Merge":{const r=e.inputNames.find((e=>void 0!==Object(s.e)(e,t,n)));if(r){const e=Object(s.e)(r,t,n);return[Object(s.a)(e)]}return}case"Enter":{const r=Object(s.d)("frameName",e,t,n),a=Object(s.d)("tensor",e,t,n);return n.enterFrame(r),[Object(s.a)(a)]}case"Exit":{const r=Object(s.d)("tensor",e,t,n);return n.exitFrame(),[Object(s.a)(r)]}case"NextIteration":{const r=Object(s.d)("tensor",e,t,n);return n.nextIteration(),[Object(s.a)(r)]}case"TensorArrayV3":{const a=Object(s.d)("size",e,t,n),o=Object(s.d)("dtype",e,t,n),i=Object(s.d)("elementShape",e,t,n),u=Object(s.d)("dynamicSize",e,t,n),c=Object(s.d)("clearAfterRead",e,t,n),l=Object(s.d)("identicalElementShapes",e,t,n),d=Object(s.d)("name",e,t,n),p=new f(d,o,a,i,l,u,c);return n.addTensorArray(p),[p.idTensor,Object(r.scalar)(1)]}case"TensorArrayWriteV3":{const r=Object(s.d)("tensorArrayId",e,t,n),a=Object(s.d)("index",e,t,n),o=Object(s.d)("tensor",e,t,n),i=n.getTensorArray(r.id);return i.write(a,o),[i.idTensor]}case"TensorArrayReadV3":{const r=Object(s.d)("tensorArrayId",e,t,n),a=Object(s.d)("index",e,t,n);return[n.getTensorArray(r.id).read(a)]}case"TensorArrayGatherV3":{const r=Object(s.d)("tensorArrayId",e,t,n),a=Object(s.d)("indices",e,t,n),o=Object(s.d)("dtype",e,t,n);return[n.getTensorArray(r.id).gather(a,o)]}case"TensorArrayScatterV3":{const r=Object(s.d)("tensorArrayId",e,t,n),a=Object(s.d)("indices",e,t,n),o=Object(s.d)("tensor",e,t,n),i=n.getTensorArray(r.id);return i.scatter(a,o),[i.idTensor]}case"TensorArrayConcatV3":{const r=Object(s.d)("tensorArrayId",e,t,n),a=n.getTensorArray(r.id),o=Object(s.d)("dtype",e,t,n);return[a.concat(o)]}case"TensorArraySplitV3":{const r=Object(s.d)("tensorArrayId",e,t,n),a=Object(s.d)("tensor",e,t,n),o=Object(s.d)("lengths",e,t,n),i=n.getTensorArray(r.id);return i.split(o,a),[i.idTensor]}case"TensorArraySizeV3":{const a=Object(s.d)("tensorArrayId",e,t,n),o=n.getTensorArray(a.id);return[Object(r.scalar)(o.size(),"int32")]}case"TensorArrayCloseV3":{const r=Object(s.d)("tensorArrayId",e,t,n),a=n.getTensorArray(r.id);return a.clearAndClose(),[a.idTensor]}case"TensorListSetItem":{const r=Object(s.d)("tensorListId",e,t,n),a=Object(s.d)("index",e,t,n),o=Object(s.d)("tensor",e,t,n),i=n.getTensorList(r.id);return i.setItem(a,o),[i.idTensor]}case"TensorListGetItem":{const r=Object(s.d)("tensorListId",e,t,n),a=Object(s.d)("index",e,t,n),o=Object(s.d)("elementShape",e,t,n),i=Object(s.d)("elementDType",e,t,n);return[n.getTensorList(r.id).getItem(a,o,i)]}case"TensorListScatterV2":case"TensorListScatter":{const a=Object(s.d)("indices",e,t,n),o=function(e,t,n,a){if(t.length!==e.shape[0])throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${t.length} vs. ${e.shape[0]}`);const s=Math.max(...t);if(null!=a&&-1!==a&&s>=a)throw new Error(`Max index must be < array size (${s} vs. ${a})`);const o=new h([],n,e.dtype,a),i=Object(r.unstack)(e,0);return t.forEach(((e,t)=>{o.setItem(e,i[t])})),o}(Object(s.d)("tensor",e,t,n),a,Object(s.d)("elementShape",e,t,n),Object(s.d)("numElements",e,t,n));return n.addTensorList(o),[o.idTensor]}case"TensorListReserve":case"EmptyTensorList":{const r=Object(s.d)("elementShape",e,t,n),a=Object(s.d)("elementDType",e,t,n);let o;o="TensorListReserve"===e.op?"numElements":"maxNumElements";const i=Object(s.d)(o,e,t,n),u=function(e,t,n,r){return new h([],e,t,r)}(r,a,0,"TensorListReserve"===e.op?-1:i);return n.addTensorList(u),[u.idTensor]}case"TensorListGather":{const r=Object(s.d)("tensorListId",e,t,n),a=Object(s.d)("indices",e,t,n),o=Object(s.d)("elementShape",e,t,n),i=Object(s.d)("elementDType",e,t,n);return[n.getTensorList(r.id).gather(a,i,o)]}case"TensorListStack":{const r=Object(s.d)("tensorListId",e,t,n),a=Object(s.d)("elementShape",e,t,n),o=Object(s.d)("elementDType",e,t,n),i=Object(s.d)("numElements",e,t,n);return[n.getTensorList(r.id).stack(a,o,i)]}case"TensorListFromTensor":{const a=function(e,t,n){const a=e.dtype;if(e.shape.length<1)throw new Error(`Tensor must be at least a vector, but saw shape: ${e.shape}`);if(e.dtype!==n)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${n}`);c(e.shape.slice(1),t,"TensorList shape mismatch: ");const s=Object(r.unstack)(e);return new h(s,t,a)}(Object(s.d)("tensor",e,t,n),Object(s.d)("elementShape",e,t,n),Object(s.d)("elementDType",e,t,n));return n.addTensorList(a),[a.idTensor]}case"TensorListConcat":case"TensorListConcatV2":{const r=Object(s.d)("tensorListId",e,t,n),a=n.getTensorList(r.id),o=Object(s.d)("dtype",e,t,n),i=Object(s.d)("elementShape",e,t,n);return[a.concat(o,i)]}case"TensorListPushBack":{const r=Object(s.d)("tensorListId",e,t,n),a=Object(s.d)("tensor",e,t,n),o=n.getTensorList(r.id);return o.pushBack(a),[o.idTensor]}case"TensorListPopBack":{const r=Object(s.d)("tensorListId",e,t,n),a=Object(s.d)("elementShape",e,t,n),o=Object(s.d)("elementDType",e,t,n);return[n.getTensorList(r.id).popBack(a,o)]}case"TensorListSplit":{const a=Object(s.d)("tensor",e,t,n),o=Object(s.d)("elementShape",e,t,n),i=function(e,t,n){let a=0;const s=t.map((e=>(a+=e,a)));if(a!==e.shape[0])throw new Error(`Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n ${a}, and tensor's shape is: ${e.shape}`);const o=p(e.shape.slice(1),n),i=0===a?0:e.size/a,u=Object(r.tidy)((()=>{const n=[];e=Object(r.reshape)(e,[1,a,i]);for(let a=0;a<t.length;++a){const u=[0,0===a?0:s[a-1],0],c=[1,t[a],i];n[a]=Object(r.reshape)(Object(r.slice)(e,u,c),o)}return e.dispose(),n})),c=new h([],n,e.dtype,t.length);for(let e=0;e<u.length;e++)c.setItem(e,u[e]);return c}(a,Object(s.d)("lengths",e,t,n),o);return n.addTensorList(i),[i.idTensor]}case"TensorListLength":{const a=Object(s.d)("tensorListId",e,t,n),o=n.getTensorList(a.id);return[Object(r.scalar)(o.size(),"int32")]}case"TensorListResize":{const r=Object(s.d)("tensorListId",e,t,n),a=Object(s.d)("size",e,t,n),o=n.getTensorList(r.id).resize(a);return n.addTensorList(o),[o.idTensor]}default:throw TypeError(`Node type ${e.op} is not implemented`)}};function b(e,t,n){const[r,a]=Object(s.d)("fusedOps",e,t,n),o="biasadd"===r,i=!o,u="prelu"===a,c="fusedbatchnorm"===r,l=Object(s.d)("numArgs",e,t,n);if(o){if(u&&2!==l)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!u&&o&&1!==l)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd must have one extra argument: bias.")}if(c)throw new Error("FusedConv2d and DepthwiseConv2d with FusedBatchNorm is not supported");const d=Object(s.d)("strides",e,t,n),p=Object(s.c)(e,t,n),f=Object(s.d)("dataFormat",e,t,n).toUpperCase(),h=Object(s.d)("dilations",e,t,n);let[m,b]=Object(s.d)("args",e,t,n);i&&(b=m,m=void 0);return{stride:d,pad:p,dataFormat:f,dilations:h,biasArg:m,preluArg:b,activationFunc:a,leakyreluAlpha:Object(s.d)("leakyreluAlpha",e,t,n)}}function g(e,t,n){return{boxes:Object(s.d)("boxes",e,t,n),scores:Object(s.d)("scores",e,t,n),maxOutputSize:Object(s.d)("maxOutputSize",e,t,n),iouThreshold:Object(s.d)("iouThreshold",e,t,n),scoreThreshold:Object(s.d)("scoreThreshold",e,t,n),softNmsSigma:Object(s.d)("softNmsSigma",e,t,n)}}class y{get id(){return this.handle.id}constructor(e,t){this.keyDType=e,this.valueDType=t,this.handle=Object(r.scalar)(0),this.tensorMap=new Map,Object(r.keep)(this.handle)}clearAndClose(){this.tensorMap.forEach((e=>e.dispose())),this.tensorMap.clear(),this.handle.dispose()}size(){return this.tensorMap.size}tensorSize(){return u.scalar(this.size(),"int32")}async import(e,t){this.checkKeyAndValueTensor(e,t);const n=await e.data();return this.tensorMap.forEach((e=>e.dispose())),this.tensorMap.clear(),Object(r.tidy)((()=>{const e=Object(r.unstack)(t),a=n.length,s=e.length;r.util.assert(a===s,(()=>`The number of elements doesn't match, keys has ${a} elements, the values has ${s} elements.`));for(let t=0;t<a;t++){const a=n[t],s=e[t];Object(r.keep)(s),this.tensorMap.set(a,s)}return this.handle}))}async find(e,t){this.checkKeyAndValueTensor(e,t);const n=await e.data();return Object(r.tidy)((()=>{const e=[];for(let r=0;r<n.length;r++){const a=n[r],s=this.findWithDefault(a,t);e.push(s)}return Object(r.stack)(e)}))}findWithDefault(e,t){const n=this.tensorMap.get(e);return null!=n?n:t}checkKeyAndValueTensor(e,t){if(e.dtype!==this.keyDType)throw new Error(`Expect key dtype ${this.keyDType}, but got ${e.dtype}`);if(t.dtype!==this.valueDType)throw new Error(`Expect value dtype ${this.valueDType}, but got ${t.dtype}`)}}function w(e,t,n,a,c=r.tidy){const l=((e,t,n)=>{switch(e.category){case"arithmetic":return c((()=>((e,t,n,r=u)=>{switch(e.op){case"BiasAdd":case"AddV2":case"Add":return[r.add(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"AddN":return[r.addN(Object(s.d)("tensors",e,t,n))];case"FloorMod":case"Mod":return[r.mod(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"Mul":return[r.mul(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"RealDiv":case"Div":return[r.div(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"DivNoNan":return[r.divNoNan(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"FloorDiv":return[r.floorDiv(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"Sub":return[r.sub(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"Minimum":return[r.minimum(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"Maximum":return[r.maximum(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"Pow":return[r.pow(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"SquaredDifference":return[r.squaredDifference(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"basic_math":return c((()=>((e,t,n,r=u)=>{switch(e.op){case"Abs":case"ComplexAbs":return[r.abs(Object(s.d)("x",e,t,n))];case"Acos":return[r.acos(Object(s.d)("x",e,t,n))];case"Acosh":return[r.acosh(Object(s.d)("x",e,t,n))];case"Asin":return[r.asin(Object(s.d)("x",e,t,n))];case"Asinh":return[r.asinh(Object(s.d)("x",e,t,n))];case"Atan":return[r.atan(Object(s.d)("x",e,t,n))];case"Atan2":return[r.atan2(Object(s.d)("x",e,t,n),Object(s.d)("y",e,t,n))];case"Atanh":return[r.atanh(Object(s.d)("x",e,t,n))];case"Ceil":return[r.ceil(Object(s.d)("x",e,t,n))];case"Complex":return[r.complex(Object(s.d)("real",e,t,n),Object(s.d)("imag",e,t,n))];case"Cos":return[r.cos(Object(s.d)("x",e,t,n))];case"Cosh":return[r.cosh(Object(s.d)("x",e,t,n))];case"Elu":return[r.elu(Object(s.d)("x",e,t,n))];case"Erf":return[r.erf(Object(s.d)("x",e,t,n))];case"Exp":return[r.exp(Object(s.d)("x",e,t,n))];case"Expm1":return[r.expm1(Object(s.d)("x",e,t,n))];case"Floor":return[r.floor(Object(s.d)("x",e,t,n))];case"Log":return[r.log(Object(s.d)("x",e,t,n))];case"Log1p":return[r.log1p(Object(s.d)("x",e,t,n))];case"Imag":return[r.imag(Object(s.d)("x",e,t,n))];case"Neg":return[r.neg(Object(s.d)("x",e,t,n))];case"Reciprocal":return[r.reciprocal(Object(s.d)("x",e,t,n))];case"Real":return[r.real(Object(s.d)("x",e,t,n))];case"Relu":return[r.relu(Object(s.d)("x",e,t,n))];case"Round":return[r.round(Object(s.d)("x",e,t,n))];case"Selu":return[r.selu(Object(s.d)("x",e,t,n))];case"Sigmoid":return[r.sigmoid(Object(s.d)("x",e,t,n))];case"Sin":return[r.sin(Object(s.d)("x",e,t,n))];case"Sign":return[r.sign(Object(s.d)("x",e,t,n))];case"Sinh":return[r.sinh(Object(s.d)("x",e,t,n))];case"Softplus":return[r.softplus(Object(s.d)("x",e,t,n))];case"Sqrt":return[r.sqrt(Object(s.d)("x",e,t,n))];case"Square":return[r.square(Object(s.d)("x",e,t,n))];case"Tanh":return[r.tanh(Object(s.d)("x",e,t,n))];case"Tan":return[r.tan(Object(s.d)("x",e,t,n))];case"ClipByValue":return[r.clipByValue(Object(s.d)("x",e,t,n),Object(s.d)("clipValueMin",e,t,n),Object(s.d)("clipValueMax",e,t,n))];case"Relu6":return[r.relu6(Object(s.d)("x",e,t,n))];case"Rsqrt":return[r.rsqrt(Object(s.e)(e.inputNames[0],t,n))];case"LeakyRelu":return[r.leakyRelu(Object(s.d)("x",e,t,n),Object(s.d)("alpha",e,t,n))];case"Prelu":return[r.prelu(Object(s.d)("x",e,t,n),Object(s.d)("alpha",e,t,n))];case"IsNan":return[r.isNaN(Object(s.e)(e.inputNames[0],t,n))];case"IsInf":return[r.isInf(Object(s.e)(e.inputNames[0],t,n))];case"IsFinite":return[r.isFinite(Object(s.e)(e.inputNames[0],t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"control":return m(e,t,n);case"convolution":return c((()=>((e,t,n,r=u)=>{switch(e.op){case"Conv1D":{const a=Object(s.d)("stride",e,t,n),o=Object(s.d)("pad",e,t,n),i=Object(s.d)("dataFormat",e,t,n).toUpperCase(),u=Object(s.d)("dilation",e,t,n);return[r.conv1d(Object(s.d)("x",e,t,n),Object(s.d)("filter",e,t,n),a,o,i,u)]}case"Conv2D":{const a=Object(s.d)("strides",e,t,n),o=Object(s.c)(e,t,n),i=Object(s.d)("dataFormat",e,t,n).toUpperCase(),u=Object(s.d)("dilations",e,t,n);return[r.conv2d(Object(s.d)("x",e,t,n),Object(s.d)("filter",e,t,n),[a[1],a[2]],o,i,[u[1],u[2]])]}case"_FusedConv2D":{const{stride:a,pad:o,dataFormat:i,dilations:u,biasArg:c,preluArg:l,activationFunc:d,leakyreluAlpha:p}=b(e,t,n);return[r.fused.conv2d({x:Object(s.d)("x",e,t,n),filter:Object(s.d)("filter",e,t,n),strides:[a[1],a[2]],pad:o,dataFormat:i,dilations:[u[1],u[2]],bias:c,activation:d,preluActivationWeights:l,leakyreluAlpha:p})]}case"FusedDepthwiseConv2dNative":{const{stride:a,pad:o,dataFormat:i,dilations:u,biasArg:c,preluArg:l,activationFunc:d,leakyreluAlpha:p}=b(e,t,n);return[r.fused.depthwiseConv2d({x:Object(s.d)("x",e,t,n),filter:Object(s.d)("filter",e,t,n),strides:[a[1],a[2]],pad:o,dataFormat:i,dilations:[u[1],u[2]],bias:c,activation:d,preluActivationWeights:l,leakyreluAlpha:p})]}case"Conv2DBackpropInput":case"Conv2dTranspose":{const a=Object(s.d)("outputShape",e,t,n),o=Object(s.d)("strides",e,t,n),i=Object(s.c)(e,t,n);return[r.conv2dTranspose(Object(s.d)("x",e,t,n),Object(s.d)("filter",e,t,n),a,[o[1],o[2]],i)]}case"DepthwiseConv2dNative":case"DepthwiseConv2d":{const a=Object(s.d)("strides",e,t,n),o=Object(s.c)(e,t,n),i=Object(s.d)("dilations",e,t,n),u=Object(s.d)("dataFormat",e,t,n).toUpperCase();return[r.depthwiseConv2d(Object(s.d)("input",e,t,n),Object(s.d)("filter",e,t,n),[a[1],a[2]],o,u,[i[1],i[2]])]}case"Conv3D":{const a=Object(s.d)("strides",e,t,n),o=Object(s.d)("pad",e,t,n),i=Object(s.d)("dataFormat",e,t,n).toUpperCase(),u=Object(s.d)("dilations",e,t,n);return[r.conv3d(Object(s.d)("x",e,t,n),Object(s.d)("filter",e,t,n),[a[1],a[2],a[3]],o,i,[u[1],u[2],u[3]])]}case"AvgPool":{const a=Object(s.d)("strides",e,t,n),o=Object(s.d)("pad",e,t,n),i=Object(s.d)("kernelSize",e,t,n);return[r.avgPool(Object(s.d)("x",e,t,n),[i[1],i[2]],[a[1],a[2]],o)]}case"MaxPool":{const a=Object(s.d)("strides",e,t,n),o=Object(s.d)("pad",e,t,n),i=Object(s.d)("kernelSize",e,t,n);return[r.maxPool(Object(s.d)("x",e,t,n),[i[1],i[2]],[a[1],a[2]],o)]}case"MaxPoolWithArgmax":{const a=Object(s.d)("strides",e,t,n),o=Object(s.d)("pad",e,t,n),i=Object(s.d)("kernelSize",e,t,n),u=Object(s.d)("includeBatchInIndex",e,t,n),{result:c,indexes:l}=r.maxPoolWithArgmax(Object(s.d)("x",e,t,n),[i[1],i[2]],[a[1],a[2]],o,u);return[c,l]}case"AvgPool3D":{const a=Object(s.d)("strides",e,t,n),o=Object(s.d)("pad",e,t,n),i=Object(s.d)("kernelSize",e,t,n);return[r.avgPool3d(Object(s.d)("x",e,t,n),[i[1],i[2],i[3]],[a[1],a[2],a[3]],o)]}case"MaxPool3D":{const a=Object(s.d)("strides",e,t,n),o=Object(s.d)("pad",e,t,n),i=Object(s.d)("kernelSize",e,t,n);return[r.maxPool3d(Object(s.d)("x",e,t,n),[i[1],i[2],i[3]],[a[1],a[2],a[3]],o)]}case"Dilation2D":{const a=Object(s.d)("strides",e,t,n),o=Object(s.d)("pad",e,t,n),i=Object(s.d)("dilations",e,t,n),u=a[1],c=a[2],l=i[1],d=i[2];return[r.dilation2d(Object(s.d)("x",e,t,n),Object(s.d)("filter",e,t,n),[u,c],o,[l,d],"NHWC")]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"creation":return c((()=>((e,t,n,r=u)=>{switch(e.op){case"Fill":{const a=Object(s.d)("shape",e,t,n),o=Object(s.d)("dtype",e,t,n),i=Object(s.d)("value",e,t,n);return[r.fill(a,i,o)]}case"LinSpace":{const a=Object(s.d)("start",e,t,n),o=Object(s.d)("stop",e,t,n),i=Object(s.d)("num",e,t,n);return[r.linspace(a,o,i)]}case"Multinomial":{const a=Object(s.d)("logits",e,t,n),o=Object(s.d)("numSamples",e,t,n),i=Object(s.d)("seed",e,t,n);return[r.multinomial(a,o,i)]}case"OneHot":{const a=Object(s.d)("indices",e,t,n),o=Object(s.d)("depth",e,t,n),i=Object(s.d)("onValue",e,t,n),u=Object(s.d)("offValue",e,t,n),c=Object(s.d)("dtype",e,t,n);return[r.oneHot(a,o,i,u,c)]}case"Ones":return[r.ones(Object(s.d)("shape",e,t,n),Object(s.d)("dtype",e,t,n))];case"OnesLike":return[r.onesLike(Object(s.d)("x",e,t,n))];case"RandomStandardNormal":return[r.randomStandardNormal(Object(s.d)("shape",e,t,n),Object(s.d)("dtype",e,t,n),Object(s.d)("seed",e,t,n))];case"RandomUniform":return[r.randomUniform(Object(s.d)("shape",e,t,n),Object(s.d)("minval",e,t,n),Object(s.d)("maxval",e,t,n),Object(s.d)("dtype",e,t,n))];case"RandomUniformInt":return[r.randomUniformInt(Object(s.d)("shape",e,t,n),Object(s.d)("minval",e,t,n),Object(s.d)("maxval",e,t,n),Object(s.d)("seed",e,t,n))];case"Range":{const a=Object(s.d)("start",e,t,n),o=Object(s.d)("stop",e,t,n),i=Object(s.d)("step",e,t,n);return[r.range(a,o,i,Object(s.d)("dtype",e,t,n))]}case"TruncatedNormal":{const a=Object(s.d)("shape",e,t,n),o=Object(s.d)("mean",e,t,n),i=Object(s.d)("stdDev",e,t,n),u=Object(s.d)("seed",e,t,n);return[r.truncatedNormal(a,o,i,Object(s.d)("dtype",e,t,n),u)]}case"Zeros":return[r.zeros(Object(s.d)("shape",e,t,n),Object(s.d)("dtype",e,t,n))];case"ZerosLike":return[r.zerosLike(Object(s.d)("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"dynamic":return(async(e,t,n,r,a=u)=>{switch(e.op){case"NonMaxSuppressionV5":{const{boxes:r,scores:s,maxOutputSize:o,iouThreshold:i,scoreThreshold:u,softNmsSigma:c}=g(e,t,n),l=await a.image.nonMaxSuppressionWithScoreAsync(r,s,o,i,u,c);return[l.selectedIndices,l.selectedScores]}case"NonMaxSuppressionV4":{const{boxes:r,scores:o,maxOutputSize:i,iouThreshold:u,scoreThreshold:c}=g(e,t,n),l=Object(s.d)("padToMaxOutputSize",e,t,n),d=await a.image.nonMaxSuppressionPaddedAsync(r,o,i,u,c,l);return[d.selectedIndices,d.validOutputs]}case"NonMaxSuppressionV3":case"NonMaxSuppressionV2":{const{boxes:r,scores:s,maxOutputSize:o,iouThreshold:i,scoreThreshold:u}=g(e,t,n);return[await a.image.nonMaxSuppressionAsync(r,s,o,i,u)]}case"Where":{const r=a.cast(Object(s.d)("condition",e,t,n),"bool"),o=[await a.whereAsync(r)];return r.dispose(),o}case"ListDiff":return a.setdiff1dAsync(Object(s.d)("x",e,t,n),Object(s.d)("y",e,t,n));default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n);case"evaluation":return c((()=>((e,t,n,r=u)=>{switch(e.op){case"LowerBound":{const a=Object(s.d)("sortedSequence",e,t,n),o=Object(s.d)("values",e,t,n);return[r.lowerBound(a,o)]}case"TopKV2":{const a=Object(s.d)("x",e,t,n),o=Object(s.d)("k",e,t,n),i=Object(s.d)("sorted",e,t,n),u=r.topk(a,o,i);return[u.values,u.indices]}case"UpperBound":{const a=Object(s.d)("sortedSequence",e,t,n),o=Object(s.d)("values",e,t,n);return[r.upperBound(a,o)]}case"Unique":{const a=Object(s.d)("x",e,t,n),o=r.unique(a);return[o.values,o.indices]}case"UniqueV2":{const a=Object(s.d)("x",e,t,n),o=Object(s.d)("axis",e,t,n),i=r.unique(a,o);return[i.values,i.indices]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"image":return c((()=>((e,t,n,r=u)=>{switch(e.op){case"ResizeBilinear":{const a=Object(s.d)("images",e,t,n),o=Object(s.d)("size",e,t,n),i=Object(s.d)("alignCorners",e,t,n),u=Object(s.d)("halfPixelCenters",e,t,n);return[r.image.resizeBilinear(a,[o[0],o[1]],i,u)]}case"ResizeNearestNeighbor":{const a=Object(s.d)("images",e,t,n),o=Object(s.d)("size",e,t,n),i=Object(s.d)("alignCorners",e,t,n),u=Object(s.d)("halfPixelCenters",e,t,n);return[r.image.resizeNearestNeighbor(a,[o[0],o[1]],i,u)]}case"CropAndResize":{const a=Object(s.d)("image",e,t,n),o=Object(s.d)("boxes",e,t,n),i=Object(s.d)("boxInd",e,t,n),u=Object(s.d)("cropSize",e,t,n),c=Object(s.d)("method",e,t,n),l=Object(s.d)("extrapolationValue",e,t,n);return[r.image.cropAndResize(a,o,i,u,c,l)]}case"ImageProjectiveTransformV3":{const a=Object(s.d)("images",e,t,n),o=Object(s.d)("transforms",e,t,n),i=Object(s.d)("outputShape",e,t,n),u=Object(s.d)("fillValue",e,t,n),c=Object(s.d)("interpolation",e,t,n),l=Object(s.d)("fillMode",e,t,n);return[r.image.transform(a,o,c.toLowerCase(),l.toLowerCase(),u,i)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"graph":return c((()=>((e,t,n,r=u)=>{switch(e.op){case"Const":return t[e.name];case"PlaceholderWithDefault":const a=Object(s.d)("default",e,t,n);return[Object(s.e)(e.name,t,n)||a];case"Placeholder":return[Object(s.e)(e.name,t,n)];case"Identity":case"StopGradient":case"FakeQuantWithMinMaxVars":{const r=Object(s.d)("x",e,t,n);return[Object(s.a)(r)]}case"IdentityN":return Object(s.d)("x",e,t,n).map((e=>Object(s.a)(e)));case"Snapshot":const o=Object(s.d)("x",e,t,n);return[Object(s.a)(o)];case"Shape":return[r.tensor1d(Object(s.d)("x",e,t,n).shape,"int32")];case"ShapeN":return Object(s.d)("x",e,t,n).map((e=>r.tensor1d(e.shape)));case"Size":return[r.scalar(Object(s.d)("x",e,t,n).size,"int32")];case"Rank":return[r.scalar(Object(s.d)("x",e,t,n).rank,"int32")];case"NoOp":return[r.scalar(1)];case"Print":const i=Object(s.d)("x",e,t,n),u=Object(s.d)("data",e,t,n),c=Object(s.d)("message",e,t,n),l=Object(s.d)("summarize",e,t,n);console.warn("The graph has a tf.print() operation,usually used for debugging, which slows down performance."),console.log(c);for(let e=0;e<u.length;e++)console.log(Array.prototype.slice.call(u[e].dataSync()).slice(0,l));return[i];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"logical":return c((()=>((e,t,n,r=u)=>{switch(e.op){case"Equal":return[r.equal(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"NotEqual":return[r.notEqual(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"Greater":return[r.greater(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"GreaterEqual":return[r.greaterEqual(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"Less":return[r.less(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"LessEqual":return[r.lessEqual(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"LogicalAnd":return[r.logicalAnd(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"LogicalNot":return[r.logicalNot(Object(s.d)("a",e,t,n))];case"LogicalOr":return[r.logicalOr(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"Select":case"SelectV2":return[r.where(Object(s.d)("condition",e,t,n),Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"BitwiseAnd":return[r.bitwiseAnd(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"matrices":return c((()=>((e,t,n,r=u)=>{switch(e.op){case"BatchMatMul":case"BatchMatMulV2":case"MatMul":return[r.matMul(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n),Object(s.d)("transposeA",e,t,n),Object(s.d)("transposeB",e,t,n))];case"Einsum":return[r.einsum(Object(s.d)("equation",e,t,n),...Object(s.d)("tensors",e,t,n))];case"Transpose":return[r.transpose(Object(s.d)("x",e,t,n),Object(s.d)("perm",e,t,n))];case"_FusedMatMul":const[a,o]=Object(s.d)("fusedOps",e,t,n),i="biasadd"===a,u="prelu"===o,c=Object(s.d)("numArgs",e,t,n),l=Object(s.d)("leakyreluAlpha",e,t,n);if(i){if(u&&2!==c)throw new Error("Fused MatMul with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!u&&1!==c)throw new Error("Fused MatMul with BiasAdd must have one extra argument: bias.")}const[d,p]=Object(s.d)("args",e,t,n);return[r.fused.matMul({a:Object(s.d)("a",e,t,n),b:Object(s.d)("b",e,t,n),transposeA:Object(s.d)("transposeA",e,t,n),transposeB:Object(s.d)("transposeB",e,t,n),bias:d,activation:o,preluActivationWeights:p,leakyreluAlpha:l})];case"MatrixBandPart":return[r.linalg.bandPart(Object(s.d)("a",e,t,n),Object(s.d)("numLower",e,t,n),Object(s.d)("numUpper",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"normalization":return c((()=>((e,t,n,r=u)=>{switch(e.op){case"EuclideanNorm":return[r.euclideanNorm(Object(s.d)("x",e,t,n),Object(s.d)("axis",e,t,n),Object(s.d)("keepDims",e,t,n))];case"FusedBatchNorm":case"FusedBatchNormV2":case"FusedBatchNormV3":return[r.batchNorm(Object(s.d)("x",e,t,n),Object(s.d)("mean",e,t,n),Object(s.d)("variance",e,t,n),Object(s.d)("offset",e,t,n),Object(s.d)("scale",e,t,n),Object(s.d)("epsilon",e,t,n))];case"LRN":return[r.localResponseNormalization(Object(s.d)("x",e,t,n),Object(s.d)("radius",e,t,n),Object(s.d)("bias",e,t,n),Object(s.d)("alpha",e,t,n),Object(s.d)("beta",e,t,n))];case"Softmax":return[r.softmax(Object(s.d)("x",e,t,n))];case"LogSoftmax":return[r.logSoftmax(Object(s.d)("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"ragged":return c((()=>((e,t,n,r=u)=>{switch(e.op){case"RaggedGather":{const{outputNestedSplits:a,outputDenseValues:o}=r.raggedGather(Object(s.d)("paramsNestedSplits",e,t,n),Object(s.d)("paramsDenseValues",e,t,n),Object(s.d)("indices",e,t,n),Object(s.d)("outputRaggedRank",e,t,n));return a.concat(o)}case"RaggedRange":{const{rtNestedSplits:a,rtDenseValues:o}=r.raggedRange(Object(s.d)("starts",e,t,n),Object(s.d)("limits",e,t,n),Object(s.d)("splits",e,t,n));return[a,o]}case"RaggedTensorToTensor":return[r.raggedTensorToTensor(Object(s.d)("shape",e,t,n),Object(s.d)("values",e,t,n),Object(s.d)("defaultValue",e,t,n),Object(s.d)("rowPartitionTensors",e,t,n),Object(s.d)("rowPartitionTypes",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"reduction":return c((()=>((e,t,n,r=u)=>{switch(e.op){case"Max":{const a=Object(s.d)("axis",e,t,n),o=Object(s.d)("keepDims",e,t,n);return[r.max(Object(s.d)("x",e,t,n),a,o)]}case"Mean":{const a=Object(s.d)("axis",e,t,n),o=Object(s.d)("keepDims",e,t,n);return[r.mean(Object(s.d)("x",e,t,n),a,o)]}case"Min":{const a=Object(s.d)("axis",e,t,n),o=Object(s.d)("keepDims",e,t,n);return[r.min(Object(s.d)("x",e,t,n),a,o)]}case"Sum":{const a=Object(s.d)("axis",e,t,n),o=Object(s.d)("keepDims",e,t,n);return[r.sum(Object(s.d)("x",e,t,n),a,o)]}case"All":{const a=Object(s.d)("axis",e,t,n),o=Object(s.d)("keepDims",e,t,n);return[r.all(Object(s.d)("x",e,t,n),a,o)]}case"Any":{const a=Object(s.d)("axis",e,t,n),o=Object(s.d)("keepDims",e,t,n);return[r.any(Object(s.d)("x",e,t,n),a,o)]}case"ArgMax":{const a=Object(s.d)("axis",e,t,n);return[r.argMax(Object(s.d)("x",e,t,n),a)]}case"ArgMin":{const a=Object(s.d)("axis",e,t,n);return[r.argMin(Object(s.d)("x",e,t,n),a)]}case"Prod":{const a=Object(s.d)("axis",e,t,n),o=Object(s.d)("keepDims",e,t,n);return[r.prod(Object(s.d)("x",e,t,n),a,o)]}case"Cumprod":{const a=Object(s.d)("axis",e,t,n),o=Object(s.d)("exclusive",e,t,n),i=Object(s.d)("reverse",e,t,n);return[r.cumprod(Object(s.d)("x",e,t,n),a,o,i)]}case"Cumsum":{const a=Object(s.d)("axis",e,t,n),o=Object(s.d)("exclusive",e,t,n),i=Object(s.d)("reverse",e,t,n);return[r.cumsum(Object(s.d)("x",e,t,n),a,o,i)]}case"Bincount":const a=Object(s.d)("x",e,t,n),o=Object(s.d)("weights",e,t,n),i=Object(s.d)("size",e,t,n);return[r.bincount(a,o,i)];case"DenseBincount":{const a=Object(s.d)("x",e,t,n),o=Object(s.d)("weights",e,t,n),i=Object(s.d)("size",e,t,n),u=Object(s.d)("binaryOutput",e,t,n);return[r.denseBincount(a,o,i,u)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"slice_join":return c((()=>((e,t,n,a=u)=>{switch(e.op){case"ConcatV2":case"Concat":{const r=Object(s.d)("n",e,t,n),o=Object(s.d)("axis",e,t,n);let i=Object(s.d)("tensors",e,t,n);return i=i.slice(0,r),[a.concat(i,o)]}case"Gather":{const r=Object(s.d)("x",e,t,n),o=Object(s.d)("indices",e,t,n);return[a.gather(r,a.cast(o,"int32"),0)]}case"GatherV2":{const r=Object(s.d)("axis",e,t,n),o=Object(s.d)("batchDims",e,t,n),i=Object(s.d)("x",e,t,n),u=Object(s.d)("indices",e,t,n);return[a.gather(i,a.cast(u,"int32"),r,o)]}case"Reverse":{const r=Object(s.d)("dims",e,t,n),o=[];for(let e=0;e<r.length;e++)r[e]&&o.push(e);const i=Object(s.d)("x",e,t,n);return[a.reverse(i,o)]}case"ReverseV2":{const r=Object(s.d)("axis",e,t,n),o=Object(s.d)("x",e,t,n);return[a.reverse(o,r)]}case"Slice":{const r=Object(s.d)("begin",e,t,n),o=Object(s.d)("size",e,t,n);return[a.slice(Object(s.d)("x",e,t,n),r,o)]}case"StridedSlice":{const r=Object(s.d)("begin",e,t,n),o=Object(s.d)("end",e,t,n),i=Object(s.d)("strides",e,t,n),u=Object(s.d)("beginMask",e,t,n),c=Object(s.d)("endMask",e,t,n),l=Object(s.d)("ellipsisMask",e,t,n),d=Object(s.d)("newAxisMask",e,t,n),p=Object(s.d)("shrinkAxisMask",e,t,n),f=Object(s.d)("x",e,t,n);return[a.stridedSlice(f,r,o,i,u,c,l,d,p)]}case"Pack":return Object(r.tidy)((()=>{const o=Object(s.d)("axis",e,t,n),i=Object(s.d)("tensors",e,t,n),u=i[0].shape,c=a.squeeze(i[0]).shape,l=i.map((e=>{const t=r.util.arraysEqual(e.shape,u);if(!t&&!r.util.arraysEqual(a.squeeze(e).shape,c))throw new Error("the input tensors shape does not match");return t?e:a.reshape(e,u)}));return[a.stack(l,o)]}));case"Unpack":{const r=Object(s.d)("axis",e,t,n),o=Object(s.d)("tensor",e,t,n);return a.unstack(o,r)}case"Tile":{const r=Object(s.d)("reps",e,t,n);return[a.tile(Object(s.d)("x",e,t,n),r)]}case"Split":case"SplitV":{const r=Object(s.d)("axis",e,t,n),o=Object(s.d)("numOrSizeSplits",e,t,n),i=Object(s.d)("x",e,t,n);return a.split(i,o,r)}case"ScatterNd":{const r=Object(s.d)("indices",e,t,n),o=Object(s.d)("values",e,t,n),i=Object(s.d)("shape",e,t,n);return[a.scatterND(r,o,i)]}case"GatherNd":{const r=Object(s.d)("x",e,t,n),o=Object(s.d)("indices",e,t,n);return[a.gatherND(r,o)]}case"SparseToDense":{const r=Object(s.d)("sparseIndices",e,t,n),o=Object(s.d)("outputShape",e,t,n),i=Object(s.d)("sparseValues",e,t,n),u=Object(s.d)("defaultValue",e,t,n);return[a.sparseToDense(r,i,o,i.dtype===u.dtype?u:a.cast(u,i.dtype))]}case"TensorScatterUpdate":{const r=Object(s.d)("indices",e,t,n),o=Object(s.d)("values",e,t,n),i=Object(s.d)("tensor",e,t,n);return[a.tensorScatterUpdate(i,r,o)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"sparse":return c((()=>((e,t,n,r=u)=>{switch(e.op){case"SparseFillEmptyRows":{const{outputIndices:a,outputValues:o,emptyRowIndicator:i,reverseIndexMap:u}=r.sparse.sparseFillEmptyRows(Object(s.d)("indices",e,t,n),Object(s.d)("values",e,t,n),Object(s.d)("denseShape",e,t,n),Object(s.d)("defaultValue",e,t,n));return[a,o,i,u]}case"SparseReshape":{const{outputIndices:a,outputShape:o}=r.sparse.sparseReshape(Object(s.d)("inputIndices",e,t,n),Object(s.d)("inputShape",e,t,n),Object(s.d)("newShape",e,t,n));return[a,o]}case"SparseSegmentMean":return[r.sparse.sparseSegmentMean(Object(s.d)("data",e,t,n),Object(s.d)("indices",e,t,n),Object(s.d)("segmentIds",e,t,n))];case"SparseSegmentSum":return[r.sparse.sparseSegmentSum(Object(s.d)("data",e,t,n),Object(s.d)("indices",e,t,n),Object(s.d)("segmentIds",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"spectral":return c((()=>((e,t,n,r=u)=>{switch(e.op){case"FFT":return[r.fft(Object(s.d)("x",e,t,n))];case"IFFT":return[r.ifft(Object(s.d)("x",e,t,n))];case"RFFT":return[r.rfft(Object(s.d)("x",e,t,n))];case"IRFFT":return[r.irfft(Object(s.d)("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"string":return c((()=>((e,t,n,r=u)=>{switch(e.op){case"StaticRegexReplace":return[r.string.staticRegexReplace(Object(s.d)("input",e,t,n),Object(s.d)("pattern",e,t,n),Object(s.d)("rewrite",e,t,n),Object(s.d)("replaceGlobal",e,t,n))];case"StringNGrams":{const{nGrams:a,nGramsSplits:o}=r.string.stringNGrams(Object(s.d)("data",e,t,n),Object(s.d)("dataSplits",e,t,n),Object(s.d)("separator",e,t,n),Object(s.d)("nGramWidths",e,t,n),Object(s.d)("leftPad",e,t,n),Object(s.d)("rightPad",e,t,n),Object(s.d)("padWidth",e,t,n),Object(s.d)("preserveShortSequences",e,t,n));return[a,o]}case"StringSplit":{const{indices:a,values:o,shape:i}=r.string.stringSplit(Object(s.d)("input",e,t,n),Object(s.d)("delimiter",e,t,n),Object(s.d)("skipEmpty",e,t,n));return[a,o,i]}case"StringToHashBucketFast":return[r.string.stringToHashBucketFast(Object(s.d)("input",e,t,n),Object(s.d)("numBuckets",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"transformation":return c((()=>((e,t,n,r=u)=>{switch(e.op){case"Cast":return[r.cast(Object(s.d)("x",e,t,n),Object(s.d)("dtype",e,t,n))];case"ExpandDims":{const a=Object(s.d)("axis",e,t,n);return[r.expandDims(Object(s.d)("x",e,t,n),a)]}case"Squeeze":{const a=Object(s.d)("axis",e,t,n);return[r.squeeze(Object(s.d)("x",e,t,n),a)]}case"Reshape":return[r.reshape(Object(s.d)("x",e,t,n),Object(s.d)("shape",e,t,n))];case"EnsureShape":return[r.ensureShape(Object(s.d)("x",e,t,n),Object(s.d)("shape",e,t,n))];case"MirrorPad":return[r.mirrorPad(Object(s.d)("x",e,t,n),Object(s.d)("padding",e,t,n),Object(s.d)("mode",e,t,n))];case"PadV2":case"Pad":return[r.pad(Object(s.d)("x",e,t,n),Object(s.d)("padding",e,t,n),Object(s.d)("constantValue",e,t,n))];case"SpaceToBatchND":{const a=Object(s.d)("blockShape",e,t,n),o=Object(s.d)("paddings",e,t,n);return[r.spaceToBatchND(Object(s.d)("x",e,t,n),a,o)]}case"BatchToSpaceND":{const a=Object(s.d)("blockShape",e,t,n),o=Object(s.d)("crops",e,t,n);return[r.batchToSpaceND(Object(s.d)("x",e,t,n),a,o)]}case"DepthToSpace":{const a=Object(s.d)("blockSize",e,t,n),o=Object(s.d)("dataFormat",e,t,n).toUpperCase();return[r.depthToSpace(Object(s.d)("x",e,t,n),a,o)]}case"BroadcastTo":return[r.broadcastTo(Object(s.d)("x",e,t,n),Object(s.d)("shape",e,t,n))];case"BroadcastArgs":return[r.broadcastArgs(Object(s.d)("s0",e,t,n),Object(s.d)("s1",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"hash_table":return(async(e,t,n,r)=>{switch(e.op){case"HashTable":case"HashTableV2":{const a=r.getHashTableHandleByName(e.name);if(null!=a)return[a];{const a=Object(s.d)("keyDType",e,t,n),o=Object(s.d)("valueDType",e,t,n),i=new y(a,o);return r.addHashTable(e.name,i),[i.handle]}}case"InitializeTable":case"InitializeTableV2":case"LookupTableImport":case"LookupTableImportV2":{const a=Object(s.d)("tableHandle",e,t,n,r),o=Object(s.d)("keys",e,t,n),i=Object(s.d)("values",e,t,n),u=r.getHashTableById(a.id);return[await u.import(o,i)]}case"LookupTableFind":case"LookupTableFindV2":{const a=Object(s.d)("tableHandle",e,t,n,r),o=Object(s.d)("keys",e,t,n),i=Object(s.d)("defaultValue",e,t,n),u=r.getHashTableById(a.id);return[await u.find(o,i)]}case"LookupTableSize":case"LookupTableSizeV2":{const a=Object(s.d)("tableHandle",e,t,n,r);return[r.getHashTableById(a.id).tensorSize()]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n,a);case"custom":const l=Object(i.b)(e.op);if(l&&l.customExecutor)return l.customExecutor(new o(e,t,n));throw TypeError(`Custom op ${e.op} is not registered.`);default:throw TypeError(`Unknown op '${e.op}'. File an issue at https://github.com/tensorflow/tfjs/issues so we can add it, or register a custom execution with tf.registerOp()`)}})(e,t,n);return r.util.isPromise(l)?l.then((e=>[].concat(e))):[].concat(l)}class O{constructor(e={},t={},n={},r={},a){this.weightMap=e,this.tensorArrayMap=t,this.tensorListMap=n,this.functionMap=r,this.parseNodeNameCache=a,this.rootContext={id:0,frameName:"",iterationId:0},this.contexts=[this.rootContext],this.lastId=0,this.generateCurrentContextIds()}newFrame(e,t){return{id:e,frameName:t,iterationId:0}}set currentContext(e){this.contexts!==e&&(this.contexts=e,this.generateCurrentContextIds())}get currentContext(){return this.contexts}get currentContextId(){return this._currentContextIds[0]}get currentContextIds(){return this._currentContextIds}generateCurrentContextIds(){const e=[];for(let t=0;t<this.contexts.length-1;t++){const n=this.contexts.slice(0,this.contexts.length-t);e.push(this.contextIdforContexts(n))}e.push(""),this._currentContextIds=e}contextIdforContexts(e){return e?e.map((e=>0===e.id&&0===e.iterationId?"":`${e.frameName}-${e.iterationId}`)).join("/"):""}enterFrame(e){this.contexts&&(this.lastId++,this.contexts=this.contexts.slice(),this.contexts.push(this.newFrame(this.lastId,e)),this._currentContextIds.unshift(this.contextIdforContexts(this.contexts)))}exitFrame(){if(!(this.contexts&&this.contexts.length>1))throw new Error("Cannot exit frame, the context is empty");this.contexts=this.contexts.slice(),this.contexts.splice(-1),this.currentContextIds.shift()}nextIteration(){if(!(this.contexts&&this.contexts.length>0))throw new Error("Cannot increase frame iteration, the context is empty");{this.contexts=this.contexts.slice(),this.lastId++;const e=Object.assign({},this.contexts[this.contexts.length-1]);e.iterationId+=1,e.id=this.lastId,this.contexts.splice(-1,1,e),this._currentContextIds.splice(0,1,this.contextIdforContexts(this.contexts))}}getWeight(e){return this.weightMap[e]}addTensorArray(e){this.tensorArrayMap[e.id]=e}getTensorArray(e){return this.tensorArrayMap[e]}addTensorList(e){this.tensorListMap[e.id]=e}getTensorList(e){return this.tensorListMap[e]}dispose(e){for(const t in this.tensorArrayMap)this.tensorArrayMap[t].clearAndClose(e);for(const t in this.tensorListMap)this.tensorListMap[t].clearAndClose(e)}}function v(e,t,n,r){const a=new Set,o=[];let i=null,u=null;const c=new Set,l=new Set(Object.keys(e).map((e=>Object(s.g)(e)[0])));r=r||[];const d=new Set(r.map((e=>Object(s.g)(e.name)[0]))),p=[...t];for(;p.length>0;){const e=p.pop();(E(e)||T(e)||N(e))&&null==i&&(i=e,u=i.children.map((e=>e.name)).filter((e=>a.has(e)))),a.add(e.name),null==n[e.name]&&(l.has(e.name)||d.has(e.name)||(0!==e.inputs.length?e.inputs.forEach((e=>{c.has(e.name)||(c.add(e.name),p.push(e))})):o.push(e.name)))}return{inputs:e,outputs:t,usedNodes:a,missingInputs:o,dynamicNode:i,syncInputs:u}}function j(e,t){const{usedNodes:n,inputs:r}=t,a=Object.keys(r).map((e=>Object(s.g)(e)[0])).map((t=>e.nodes[t])),o=e.initNodes||[],i=e=>n.has("string"==typeof e?e:e.name);function u(e){return[...new Map(e.map((e=>[e.name,e]))).values()]}const c=u([...a,...e.weights,...o]).filter(i),l=u([...c,...Object.values(e.nodes)]).filter(i),d=new Map(l.map((e=>[e.name,e]))),p={};for(const e of l){p[e.name]=p[e.name]||0;for(const t of e.children)i(t)||(p[t.name]=Number.POSITIVE_INFINITY),p[t.name]=(p[t.name]||0)+1}const f=Object.entries(p).filter((([,e])=>0===e)).map((([e])=>e)),h=[...f];for(;f.length>0;){const e=f.pop(),t=d.get(e);for(const e of t.children.filter(i))0==--p[e.name]&&(h.push(e.name),f.push(e.name))}const m=function(e,t){const n=new Map(e.map((e=>[e.name,e]))),r=t.map((e=>e.name)),a=new Set(r);for(;r.length>0;){const e=r.pop(),t=n.get(e);for(const e of t.children)n.has(e.name)&&!a.has(e.name)&&(a.add(e.name),r.push(e.name))}return e.filter((e=>a.has(e.name)))}(h.map((e=>d.get(e))),c);return function(e,t){const n=new Map(e.map(((e,t)=>[e.name,t]))),r=new Set(t.map((e=>e.name))),a=e=>r.has("string"==typeof e?e:e.name),s=new Set(e.map((e=>e.name))),o=e=>s.has("string"==typeof e?e:e.name);for(const t of e){for(const e of t.children.filter(o)){if(!n.has(e.name))throw new _(`Child ${e.name} of node ${t.name} is unreachable.`);if(n.get(t.name)>n.get(e.name))throw new _(`Node ${t.name} is scheduled to run after its child ${e.name}.`)}if(!a(t))for(const e of t.inputs){if(!n.has(e.name))throw new _(`Input ${e.name} of node ${t.name} is unreachable.`);if(n.get(e.name)>n.get(t.name))throw new _(`Node ${t.name} is scheduled to run before its input ${e.name}.`)}}}(m,c),m}class _ extends Error{constructor(e){super(`NodesExecutionOrderError: ${e}`)}}const x=new Set(["Switch","Merge","Enter","Exit","NextIteration","StatelessIf","StatelessWhile","if","While"]),S=new Set(["NonMaxSuppressionV2","NonMaxSuppressionV3","NonMaxSuppressionV5","Where"]),k=new Set(["HashTable","HashTableV2","LookupTableImport","LookupTableImportV2","LookupTableFind","LookupTableFindV2","LookupTableSize","LookupTableSizeV2"]);function E(e){return x.has(e.op)}function T(e){return S.has(e.op)}function N(e){return k.has(e.op)}class A{get weightIds(){return this.parent?this.parent.weightIds:this._weightIds}get functionExecutorMap(){return this.parent?this.parent.functionExecutorMap:this._functionExecutorMap}get weightMap(){return this.parent?this.parent.weightMap:this._weightMap}set weightMap(e){const t=Object.keys(e).map((t=>e[t].map((e=>e.id))));this._weightIds=[].concat(...t),this._weightMap=e}set resourceManager(e){this._resourceManager=e}get inputs(){return this._inputs.map((e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0})))}get outputs(){return this._outputs.map((e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0})))}get inputNodes(){return this._inputs.map((e=>e.signatureKey||e.name))}get outputNodes(){return this._outputs.map((e=>{const t=e.signatureKey||e.name;return e.defaultOutput?`${t}:${e.defaultOutput}`:t}))}get functions(){return Object.keys(this._functions).reduce(((e,t)=>(e[t]=this._functions[t].signature,e)),{})}constructor(e,t){this.graph=e,this.parent=t,this.compiledMap=new Map,this.parseNodeNameCache=new Map,this._weightMap={},this.SEPARATOR=",",this._functions={},this._functionExecutorMap={},this.keepIntermediateTensors=!1,this._outputs=e.outputs,this._inputs=e.inputs,this._initNodes=e.initNodes,this._signature=e.signature,this._functions=e.functions,null!=e.functions&&Object.keys(e.functions).forEach((t=>{this._functionExecutorMap[t]=new A(e.functions[t],this)}))}getCompilationKey(e,t){const n=e.map((e=>e.name)).sort(),r=t.map((e=>e.name)).sort();return n.join(this.SEPARATOR)+"--"+r.join(this.SEPARATOR)}compile(e,t){const n=v(e,t,this.weightMap,this._initNodes),{missingInputs:r,dynamicNode:a,syncInputs:s}=n;if(null!=a)throw new Error(`This execution contains the node '${a.name}', which has the dynamic op '${a.op}'. Please use model.executeAsync() instead. Alternatively, to avoid the dynamic ops, specify the inputs [${s}]`);if(r.length>0){const n=t.map((e=>e.name)),a=Object.keys(e);throw new Error(`Cannot compute the outputs [${n}] from the provided inputs [${a}]. Missing the following inputs: [${r}]`)}const o=j(this.graph,n),i=function(e){const t=new Map(e.map(((e,t)=>[e.name,t]))),n=Number.MAX_SAFE_INTEGER,r=e.map(((e,t)=>E(e)?n:t)),a=e=>{const n=r[t.get(e.name)];return null==n?-1:n},s=e.map(((e,t)=>e.children.map(a).reduce(((e,t)=>Math.max(e,t)),r[t]))),o=new Map;for(let t=0;t<e.length;++t){const r=s[t];if(r===n)continue;const a=e[t],i=e[r];o.has(i.name)||o.set(i.name,[]),o.get(i.name).push(a)}return o}(o);return{orderedNodes:o,nodeLiveUntilMap:i}}cloneAndKeepTensor(e){if(null==e)return null;const t=e.clone();return Object(r.keep)(t),t}cloneTensorList(e){if(!e)return null;return e.map((e=>this.cloneAndKeepTensor(e)))}cloneTensorMap(e){return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,this.cloneTensorList(t)])))}execute(e,t){this.disposeIntermediateTensors(),e=this.mapInputs(e);const n=Object.keys(e).sort();this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t);const a=n.map((e=>this.graph.nodes[Object(s.g)(e)[0]])),o=t.map((e=>Object(s.g)(e)[0])),i=new Set(o);let u=o.map((e=>this.graph.nodes[e]));0===u.length&&(u=this._outputs);const c=this.getCompilationKey(a,u);let l=this.compiledMap.get(c);null==l&&(l=this.compile(e,u),this.compiledMap.set(c,l));try{this.keepIntermediateTensors=Object(r.env)().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(e){this.keepIntermediateTensors=!1,console.warn(e.message)}const d={},p={};return Object(r.tidy)((()=>{const n=new O(this.weightMap,d,p,this.functionExecutorMap,this.parseNodeNameCache),a=Object.assign({},this.weightMap);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap)),Object.keys(e).forEach((t=>{const[r,o]=Object(s.g)(t,n),i=[];i[o]=e[t],a[r]=i,this.keepIntermediateTensors&&(this.clonedTensorsMap[r]=this.cloneTensorList(i))}));const o=this.getFrozenTensorIds(a),{orderedNodes:u,nodeLiveUntilMap:c}=l;for(const e of u){if(a[e.name])continue;const t=w(e,a,n,this._resourceManager);if(r.util.isPromise(t))throw new Error(`The execution of the op '${e.op}' returned a promise. Please use model.executeAsync() instead.`);a[e.name]=t,this.keepIntermediateTensors&&(this.clonedTensorsMap[e.name]=this.cloneTensorList(t)),this.checkTensorForDisposalWithNodeLiveUntilInfo(e,a,n,o,i,c.get(e.name))}return null==this.parent&&n.dispose(o),t.map((e=>Object(s.e)(e,a,n)))}))}getFrozenTensorIds(e){const t=[].concat.apply([],Object.keys(e).map((t=>e[t])).map((e=>e.map((e=>e.id)))));return new Set(t)}checkTensorForDisposal(e,t,n,r,a,o,i){if(!E(t)&&!o.has(e)){for(const r of n[e])null!=r&&(i[r.id]=(i[r.id]||0)+t.children.length);for(const e of t.inputs){if(E(e))continue;const t=Object(s.f)(e.name,n,r);if(null!=t)for(const e of t){if(!e||e.kept||a.has(e.id))continue;const t=i[e.id];1===t?(e.dispose(),delete i[e.id]):null!=t&&i[e.id]--}}}}checkTensorForDisposalWithNodeLiveUntilInfo(e,t,n,r,a,o){function i(e){return E(e)||a.has(e.name)}if(!E(e)&&null!=o)for(const e of o){if(i(e))continue;const a=Object(s.f)(e.name,t,n);for(const e of a)!e||e.kept||r.has(e.id)||e.dispose()}}async executeAsync(e,t){return this._executeAsync(e,t)}disposeIntermediateTensors(){this.clonedTensorsMap&&(Object.values(this.clonedTensorsMap).forEach((e=>{for(const t of e)t&&!t.isDisposed&&t.dispose()})),this.clonedTensorsMap=null)}getIntermediateTensors(){return this.clonedTensorsMap}async _executeAsync(e,t,n=!1,a={},o={}){this.disposeIntermediateTensors(),n||(e=this.mapInputs(e),this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t));try{this.keepIntermediateTensors=Object(r.env)().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(e){this.keepIntermediateTensors=!1,console.warn(e.message)}const i=new O(this.weightMap,a,o,this.functionExecutorMap,this.parseNodeNameCache);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap));const u=await this.executeWithControlFlow(e,i,t,n),c=t.map((e=>Object(s.e)(e,u,i))),l=c.map((e=>e.id)),d=Object.keys(e).map((t=>e[t].id)),p=new Set([...l,...d,...this.weightIds]);return Object.values(u).forEach((e=>{e.forEach((e=>{!e||e.isDisposed||p.has(e.id)||e.dispose()}))})),null==this.parent&&i.dispose(p),c}async executeFunctionAsync(e,t,n){const r=e.reduce(((e,t,n)=>(e[this.inputs[n].name]=t,e)),{});return this._executeAsync(r,this.outputNodes,!0,t,n)}async executeWithControlFlow(e,t,n,r){const a=Object.keys(e),o=a.map((e=>this.graph.nodes[Object(s.g)(e)[0]])),i=n.map((e=>Object(s.g)(e)[0])),u=new Set(i);let c=i.map((e=>this.graph.nodes[e]));0===c.length&&(c=this._outputs);const{usedNodes:l,missingInputs:d,dynamicNode:p,syncInputs:f}=v(e,c,this.weightMap,this._initNodes),h=[...o,...this.graph.weights,...this._initNodes||[]].map((e=>({node:e,contexts:t.currentContext}))),m=Object.assign({},this.weightMap);Object.keys(e).forEach((t=>{const[n,r]=Object(s.g)(t),a=[];a[r]=e[t],m[n]=a}));const b={},g=this.getFrozenTensorIds(m),y={};for(;h.length>0;){const e=this.processStack(o,h,t,m,y,g,u,b,l);await Promise.all(e)}null!=p||r||console.warn("This model execution did not contain any nodes with control flow or dynamic output shapes. You can use model.execute() instead.");const w=c.filter((e=>!E(e)&&!Object(s.e)(e.name,m,t))).map((e=>e.name));if(w.length>0){let e="";throw null!=p&&(e=`Alternatively, to avoid the dynamic ops, use model.execute() and specify the inputs [${f}]`),new Error(`Cannot compute the outputs [${w}] from the provided inputs [${a}]. Consider providing the following inputs: [${d}]. ${e}`)}return m}processStack(e,t,n,a,o,i,u,c,l){const d=[];for(;t.length>0;){const e=t.pop();n.currentContext=e.contexts;let p="";if("Enter"===e.node.op&&Object(s.d)("isConstant",e.node,a,n)&&([p]=Object(s.b)(e.node.name,n)),null==a[e.node.name]){const f=w(e.node,a,n,this._resourceManager);p||([p]=Object(s.b)(e.node.name,n));const h=n.currentContext;r.util.isPromise(f)?d.push(f.then((r=>(a[p]=r,this.keepIntermediateTensors&&(this.clonedTensorsMap[p]=this.cloneTensorList(r)),n.currentContext=h,this.checkTensorForDisposal(p,e.node,a,n,i,u,c),this.processChildNodes(e.node,t,n,a,o,l),r)))):(a[p]=f,this.keepIntermediateTensors&&(this.clonedTensorsMap[p]=this.cloneTensorList(f)),this.checkTensorForDisposal(p,e.node,a,n,i,u,c),this.processChildNodes(e.node,t,n,a,o,l))}else this.processChildNodes(e.node,t,n,a,o,l)}return d}processChildNodes(e,t,n,r,a,o){e.children.forEach((e=>{const[i]=Object(s.b)(e.name,n);!a[i]&&o.has(e.name)&&("Merge"===e.op?e.inputNames.some((e=>!!Object(s.e)(e,r,n)))&&(a[i]=!0,t.push({contexts:n.currentContext,node:e})):e.inputNames.every((e=>!!Object(s.e)(e,r,n)))&&(a[i]=!0,t.push({contexts:n.currentContext,node:e})))}))}dispose(){Object.keys(this.weightMap).forEach((e=>this.weightMap[e].forEach((e=>e.dispose()))))}checkInputShapeAndType(e){Object.keys(e).forEach((t=>{const n=e[t],[a]=Object(s.g)(t),o=this.graph.nodes[a];if(o.attrParams.shape&&o.attrParams.shape.value){const e=o.attrParams.shape.value,t=e.length===n.shape.length&&n.shape.every(((t,n)=>-1===e[n]||e[n]===t));r.util.assert(t,(()=>`The shape of dict['${o.name}'] provided in model.execute(dict) must be [${e}], but was [${n.shape}]`))}o.attrParams.dtype&&o.attrParams.dtype.value&&r.util.assert(n.dtype===o.attrParams.dtype.value,(()=>`The dtype of dict['${o.name}'] provided in model.execute(dict) must be ${o.attrParams.dtype.value}, but was ${n.dtype}`))}))}mapInputs(e){var t,n;const r={};for(const a in e){const s=null===(n=null===(t=this._signature)||void 0===t?void 0:t.inputs)||void 0===n?void 0:n[a];null!=s?r[s.name]=e[a]:r[a]=e[a]}return r}checkInputs(e){const t=Object.keys(e).filter((e=>{const[t]=Object(s.g)(e);return null==this.graph.nodes[t]}));if(t.length>0)throw new Error(`The dict provided in model.execute(dict) has keys: [${t}] that are not part of graph`)}mapOutputs(e){return e.map((e=>{var t,n;const r=null===(n=null===(t=this._signature)||void 0===t?void 0:t.outputs)||void 0===n?void 0:n[e];return null!=r?r.name:e}),{})}checkOutputs(e){e.forEach((e=>{const[t]=Object(s.g)(e);if(!this.graph.nodes[t])throw new Error(`The output '${e}' is not found in the graph`)}))}}class M{constructor(e={},t={}){this.hashTableNameToHandle=e,this.hashTableMap=t}addHashTable(e,t){this.hashTableNameToHandle[e]=t.handle,this.hashTableMap[t.id]=t}getHashTableHandleByName(e){return this.hashTableNameToHandle[e]}getHashTableById(e){return this.hashTableMap[e]}dispose(){for(const e in this.hashTableMap)this.hashTableMap[e].clearAndClose(),delete this.hashTableMap[e];for(const e in this.hashTableNameToHandle)this.hashTableNameToHandle[e].dispose(),delete this.hashTableNameToHandle[e]}}class I{get modelVersion(){return this.version}get inputNodes(){return this.executor.inputNodes}get outputNodes(){return this.executor.outputNodes}get inputs(){return this.executor.inputs}get outputs(){return this.executor.outputs}get weights(){return this.executor.weightMap}get metadata(){return this.artifacts.userDefinedMetadata}get modelSignature(){return this.signature}get modelStructuredOutputKeys(){return this.structuredOutputKeys}constructor(e,t={},n=r.io){this.modelUrl=e,this.loadOptions=t,this.version="n/a",this.io=n,null==t&&(this.loadOptions={}),this.resourceManager=new M}findIOHandler(){const e=this.modelUrl;if(null!=e.load)this.handler=e;else if(null!=this.loadOptions.requestInit)this.handler=this.io.browserHTTPRequest(e,this.loadOptions);else{const t=this.io.getLoadHandlers(e,this.loadOptions);if(0===t.length)t.push(this.io.browserHTTPRequest(e,this.loadOptions));else if(t.length>1)throw new Error(`Found more than one (${t.length}) load handlers for URL '${[e]}'`);this.handler=t[0]}}load(){if(this.findIOHandler(),null==this.handler.load)throw new Error("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");const e=this.handler.load();return r.util.isPromise(e)?e.then((e=>this.loadSync(e))):this.loadSync(e)}loadSync(e){this.artifacts=e;const t=this.artifacts.modelTopology;let n=this.artifacts.signature;if(null!=this.artifacts.userDefinedMetadata){const e=this.artifacts.userDefinedMetadata;null!=e.signature&&(n=e.signature),null!=e.structuredOutputKeys&&(this.structuredOutputKeys=e.structuredOutputKeys)}this.signature=n,this.version=`${t.versions.producer}.${t.versions.minConsumer}`;const r=this.io.decodeWeights(this.artifacts.weightData,this.artifacts.weightSpecs);if(this.executor=new A(a.a.Instance.transformGraph(t,this.signature)),this.executor.weightMap=this.convertTensorMapToTensorsMap(r),this.executor.resourceManager=this.resourceManager,null!=e.modelInitializer&&null!=e.modelInitializer.node){const t=a.a.Instance.transformGraph(e.modelInitializer);this.initializer=new A(t),this.initializer.weightMap=this.executor.weightMap,this.initializer.resourceManager=this.resourceManager,this.initializerSignature=e.initializerSignature}return!0}async save(e,t){if("string"==typeof e){const t=this.io.getSaveHandlers(e);if(0===t.length)throw new Error(`Cannot find any save handlers for URL '${e}'`);if(t.length>1)throw new Error(`Found more than one (${t.length}) save handlers for URL '${e}'`);e=t[0]}if(null==e.save)throw new Error("GraphModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");return e.save(this.artifacts)}addStructuredOutputNames(e){if(this.structuredOutputKeys){const t=e instanceof r.Tensor?[e]:e,n={};return t.forEach(((e,t)=>n[this.structuredOutputKeys[t]]=e)),n}return e}predict(e,t){const n=this.execute(e,this.outputNodes);return this.addStructuredOutputNames(n)}async predictAsync(e,t){const n=await this.executeAsync(e,this.outputNodes);return this.addStructuredOutputNames(n)}normalizeInputs(e){var t;if(!(e instanceof r.Tensor||Array.isArray(e))){const n=null===(t=this.signature)||void 0===t?void 0:t.inputs;if(null!=n)for(const t in n){const r=n[t];null!=r.resourceId&&(e[t]=this.resourceIdToCapturedInput[r.resourceId])}return e}e=Array.isArray(e)?e:[e];const n=Object.keys(this.resourceIdToCapturedInput).length;if(e.length+n!==this.inputNodes.length)throw new Error(`Input tensor count mismatch, the graph model has ${this.inputNodes.length-n} non-resource placeholders, while there are ${e.length} input tensors provided.`);let a=0;return this.inputNodes.reduce(((t,n)=>{var r,s,o;const i=null===(o=null===(s=null===(r=this.signature)||void 0===r?void 0:r.inputs)||void 0===s?void 0:s[n])||void 0===o?void 0:o.resourceId;return t[n]=null!=i?this.resourceIdToCapturedInput[i]:e[a++],t}),{})}normalizeOutputs(e){return e=e||this.outputNodes,Array.isArray(e)?e:[e]}executeInitializerGraph(){return null==this.initializer?[]:null==this.initializerSignature?this.initializer.execute({},[]):this.initializer.execute({},Object.keys(this.initializerSignature.outputs))}async executeInitializerGraphAsync(){return null==this.initializer?[]:null==this.initializerSignature?this.initializer.executeAsync({},[]):this.initializer.executeAsync({},Object.keys(this.initializerSignature.outputs))}setResourceIdToCapturedInput(e){if(this.resourceIdToCapturedInput={},this.initializerSignature){const t=this.initializerSignature.outputs,n=Object.keys(t);for(let r=0;r<n.length;r++){const a=t[n[r]];this.resourceIdToCapturedInput[a.resourceId]=e[r]}}}execute(e,t){null==this.resourceIdToCapturedInput&&this.setResourceIdToCapturedInput(this.executeInitializerGraph()),e=this.normalizeInputs(e),t=this.normalizeOutputs(t);const n=this.executor.execute(e,t);return n.length>1?n:n[0]}async executeAsync(e,t){null==this.resourceIdToCapturedInput&&this.setResourceIdToCapturedInput(await this.executeInitializerGraphAsync()),e=this.normalizeInputs(e),t=this.normalizeOutputs(t);const n=await this.executor.executeAsync(e,t);return n.length>1?n:n[0]}getIntermediateTensors(){return this.executor.getIntermediateTensors()}disposeIntermediateTensors(){this.executor.disposeIntermediateTensors()}convertTensorMapToTensorsMap(e){return Object.keys(e).reduce(((t,n)=>(t[n]=[e[n]],t)),{})}dispose(){this.executor.dispose(),this.initializer&&(this.initializer.dispose(),this.resourceIdToCapturedInput&&Object(r.dispose)(this.resourceIdToCapturedInput)),this.resourceManager.dispose()}}async function D(e,t={},n=r.io){if(null==e)throw new Error("modelUrl in loadGraphModel() cannot be null. Please provide a url or an IOHandler that loads the model");null==t&&(t={}),t.fromTFHub&&"string"==typeof e&&(e=function(e){e.endsWith("/")||(e+="/");return`${e}model.json?tfjs-format=file`}(e));const a=new I(e,t,n);return await a.load(),a}function $(e){if(null==e)throw new Error("modelUrl in loadGraphModelSync() cannot be null. Please provide model artifacts or an IOHandler that loads the model");let t;if(e instanceof Array){const[n,a]=e;if(!n)throw new Error("modelJSON must be the first element of the array");if(!(a&&a instanceof ArrayBuffer))throw new Error("An ArrayBuffer of weights must be the second element of the array");if(!("modelTopology"in n))throw new Error("Model JSON is missing 'modelTopology'");if(!("weightsManifest"in n))throw new Error("Model JSON is missing 'weightsManifest'");const s=r.io.getWeightSpecs(n.weightsManifest),o=r.io.getModelArtifactsForJSONSync(n,s,a);t=r.io.fromMemorySync(o)}else if("load"in e)t=e;else{if(!("modelTopology"in e&&"weightSpecs"in e&&"weightData"in e))throw new Error("Unknown model format");t=r.io.fromMemorySync(e)}const n=new I(t);return n.load(),n}const C="4.10.0"},function(e,t,n){"use strict";n.r(t),n.d(t,"mean",(function(){return i})),n.d(t,"meanConfig",(function(){return u}));var r=n(5),a=n(90),s=n(92);let o;function i(e){const{backend:t,inputs:n,attrs:i}=e,{axis:u,keepDims:c}=i,{x:l}=n,d=t.dataIdMap.get(l.dataId).id;let p=d,f=l;const{transposed:h,axes:m,originalAxes:b,inputWasTransposed:g}=function(e,t,n){const a=e.shape,o=e.shape.length,i=r.util.parseAxisParam(t,a);let u=i;const c=r.backend_util.getAxesPermutation(u,o);let l=null,d=!1;if(null!=c){const t=new Array(o);for(let e=0;e<t.length;e++)t[e]=a[c[e]];u=r.backend_util.getInnerMostAxes(u.length,o),l=Object(s.transpose)({inputs:{x:e},attrs:{perm:c},backend:n});const i=n.dataIdMap.get(e.dataId).id;n.dataIdMap.get(l.dataId).id!==i&&(d=!0)}return{transposed:l,originalAxes:i,axes:u,inputWasTransposed:d}}(l,u,t);let y=m;if(g){const e=t.dataIdMap.get(h.dataId).id;e!==d&&(f=h,p=e,y=r.backend_util.getInnerMostAxes(y.length,f.shape.length))}r.backend_util.assertAxesAreInnerMostDims("mean",y,f.shape.length);const[w,O]=r.backend_util.computeOutAndReduceShapes(f.shape,y),v=r.util.sizeFromShape(O);let j=f;"float32"!==f.dtype&&(j=Object(a.cast)({backend:t,inputs:{x:f},attrs:{dtype:"float32"}}),p=t.dataIdMap.get(j.dataId).id);const _=t.makeOutput(w,"float32");if(0!==r.util.sizeFromShape(f.shape)){const e=t.dataIdMap.get(_.dataId).id;o(p,v,e)}if(g&&t.disposeData(h.dataId),c){const e=r.backend_util.expandShapeToKeepDim(_.shape,b);_.shape=e}return"float32"!==f.dtype&&t.disposeData(j.dataId),_}const u={kernelName:r.Mean,backendName:"wasm",setupFunc:function(e){o=e.wasm.cwrap(r.Mean,null,["number, number, number"])},kernelFunc:i}},function(e,t,n){"use strict";n.r(t),n.d(t,"padV2Config",(function(){return i}));var r=n(5);function a(e){const{attrs:{shape:t,value:n,dtype:r},backend:a}=e,s=a.makeOutput(t,r);return a.typedArrayFromHeap(s).fill(n),s}r.Fill;var s=n(33);let o;const i={kernelName:r.PadV2,backendName:"wasm",kernelFunc:function(e){const{inputs:{x:t},backend:n,attrs:{paddings:i,constantValue:u}}=e,c=i.map(((e,n)=>e[0]+t.shape[n]+e[1]));if(0===r.util.sizeFromShape(t.shape))return a({backend:n,attrs:{shape:c,value:u,dtype:t.dtype}});const l=n.dataIdMap.get(t.dataId).id,d=n.makeOutput(c,t.dtype),p=n.dataIdMap.get(d.dataId).id,f=new Uint8Array(new Int32Array(t.shape).buffer),h=i.map((e=>e[0])),m=i.map((e=>e[1])),b=new Uint8Array(new Int32Array(h).buffer),g=new Uint8Array(new Int32Array(m).buffer);return o(l,f,t.shape.length,s.a[t.dtype],b,g,u,p),d},setupFunc:function(e){o=e.wasm.cwrap(r.PadV2,null,["number","array","number","number","array","array","number","number"])}}},function(e,t,n){"use strict";n.r(t),n.d(t,"stridedSlice",(function(){return u})),n.d(t,"stridedSliceConfig",(function(){return c}));var r=n(5),a=n(47),s=n(70);function o(e){const{inputs:{x:t},attrs:{begin:n,size:a},backend:o}=e,[i,u]=r.slice_util.parseSliceParams(t,n,a),c=r.slice_util.isSliceContinous(t.shape,i,u),l=o.readSync(t.dataId),d=o.makeOutput(u,t.dtype),p=r.util.computeStrides(t.shape),f=o.dataIdMap.get(d.dataId);if(c){const e=r.slice_util.computeFlatOffset(i,p);if("string"===t.dtype)f.stringBytes=l.slice(e,e+r.util.sizeFromShape(u));else{o.typedArrayFromHeap(d).set(l.subarray(e,e+r.util.sizeFromShape(u)))}return d}if("string"===t.dtype){const e=Object(s.b)(l,i,u,t.shape,t.dtype);return f.stringBytes=e,d}const h=o.typedArrayFromHeap(d),m=t.shape.length;if(2===m)!function(e,t,n,r,a){let s=0;const o=r[0],i=r[1],u=o+a[0];for(let r=o;r<u;r++){const o=r*t+i;n.set(e.subarray(o,o+a[1]),s),s+=a[1]}}(l,p[0],h,i,u);else if(3===m)!function(e,t,n,r,a,s){let o=0;const i=a[0],u=a[1],c=a[2],l=i+s[0],d=u+s[1];for(let a=i;a<l;a++)for(let i=u;i<d;i++){const u=a*t+i*n+c;r.set(e.subarray(u,u+s[2]),o),o+=s[2]}}(l,p[0],p[1],h,i,u);else if(4===m)!function(e,t,n,r,a,s,o){let i=0;const u=s[0],c=s[1],l=s[2],d=u+o[0],p=c+o[1],f=l+o[2],h=s[3];for(let s=u;s<d;s++)for(let u=c;u<p;u++)for(let c=l;c<f;c++){const l=s*t+u*n+c*r+h;a.set(e.subarray(l,l+o[3]),i),i+=o[3]}}(l,p[0],p[1],p[2],h,i,u);else{const e=Object(s.b)(l,i,u,t.shape,t.dtype);h.set(e)}return d}r.Slice;let i;function u(e){const{backend:t,inputs:n,attrs:s}=e,{x:u}=n,{begin:c,end:l,strides:d,beginMask:p,endMask:f,ellipsisMask:h,newAxisMask:m,shrinkAxisMask:b}=s,{finalShapeSparse:g,finalShape:y,isIdentity:w,sliceDim0:O,isSimpleSlice:v,begin:j,end:_,strides:x}=r.slice_util.sliceInfo(u.shape,c,l,d,p,f,h,m,b);let S;if(w)S=Object(a.reshape)({inputs:{x:u},backend:t,attrs:{shape:y}});else if(O||v){r.util.assert(u.shape.length>=1,(()=>`Input must have rank at least 1, got: ${u.shape.length}`));const e=r.slice_util.computeOutShape(j,_,x),n=o({inputs:{x:u},backend:t,attrs:{begin:j,size:e}});S=Object(a.reshape)({inputs:{x:n},backend:t,attrs:{shape:y}}),t.disposeData(n.dataId)}else{const e=t.makeOutput(g,"float32"),n=t.dataIdMap.get(u.dataId).id,s=new Uint8Array(new Int32Array(r.util.computeStrides(u.shape)).buffer),o=new Uint8Array(new Int32Array(j).buffer),c=new Uint8Array(new Int32Array(_).buffer),l=new Uint8Array(new Int32Array(x).buffer),d=new Uint8Array(new Int32Array(g).buffer),p=new Uint8Array(new Int32Array(r.util.computeStrides(g)).buffer),f=t.dataIdMap.get(e.dataId).id;i(n,s,u.shape.length,o,c,l,d,p,g.length,f),S=Object(a.reshape)({inputs:{x:e},backend:t,attrs:{shape:y}}),t.disposeData(e.dataId)}return S}const c={kernelName:r.StridedSlice,backendName:"wasm",setupFunc:function(e){i=e.wasm.cwrap(r.StridedSlice,null,["number","array","number","array","array","array","array","array","number","number"])},kernelFunc:u}}]);
|
|
2
|
+
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=124)}([function(e,t,n){"use strict";n.d(t,"d",(function(){return a})),n.d(t,"e",(function(){return s})),n.d(t,"f",(function(){return o})),n.d(t,"b",(function(){return i})),n.d(t,"g",(function(){return c})),n.d(t,"c",(function(){return l})),n.d(t,"a",(function(){return d}));var r=n(5);function a(e,t,n,a,o){const i=t.inputParams[e];if(i&&void 0!==i.inputIndexStart){const e=i.inputIndexStart,u=0===i.inputIndexEnd?void 0:void 0===i.inputIndexEnd?e+1:i.inputIndexEnd,c=e<0?t.inputNames.length+e:e;if("tensor"===i.type)return s(t.inputNames[c],n,a,o);if("tensors"===i.type){const r=t.inputs.slice(e,u);return t.inputNames.slice(e,u).filter(((e,t)=>{var n;return"NoOp"!==(null===(n=r[t])||void 0===n?void 0:n.op)})).map((e=>s(e,n,a,o)))}const l=s(t.inputNames[c],n,a,o),d=l.dataSync();return"number"===i.type?d[0]:r.util.toNestedArray(l.shape,d)}const u=t.attrParams[e];return u&&u.value}function s(e,t,n,r){const[a,s]=c(e,n);if(null!=r){const e=r.getHashTableHandleByName(a);if(null!=e)return e}const o=n.currentContextIds.find((e=>!!t[u(a,e)]));return void 0!==o?t[u(a,o)][s]:void 0}function o(e,t,n){return t[u(e,n.currentContextId)]}function i(e,t){const[n,r,a]=c(e,t);return[u(n,t&&t.currentContextId),r,a]}function u(e,t){return t?`${e}-${t}`:e}function c(e,t){if(""===e)return["",0,void 0];const n=null!=t&&null!=t.parseNodeNameCache;if(n){const n=t.parseNodeNameCache.get(e);if(null!=n)return n}const r=e.split(":");let a;if(1===r.length)a=[e,0,void 0];else{const e=r[0],t=3===r.length?r[1]:void 0;a=[e,Number(r[r.length-1]),t]}return n&&t.parseNodeNameCache.set(e,a),a}function l(e,t,n){let r=a("pad",e,t,n);if("explicit"===r){r=a("explicitPaddings",e,t,n);const s=[[0,0],[0,0],[0,0],[0,0]];for(let e=0;e<4;e++)s[e][0]=r[2*e],s[e][1]=r[2*e+1];return s}return r}function d(e){return e.kept?e:Object(r.clone)(e)}},function(e,t,n){"use strict";n.d(t,"c",(function(){return c})),n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return f}));var r=n(3),a=n(11),s=n(17),o=n(32),i=n(6),u=n(8);function c(e,t){let n=e;if(Object(i.isTypedArray)(e))return"string"===t?[]:[e.length];if(Object(o.b)(e)){const t=e.channels||"RGBA";return[e.height,e.width*t.length]}if(Object(o.c)(e))return[e.buffer.size/(null==t?4:Object(u.h)(t))];if(!Array.isArray(e))return[];const r=[];for(;Array.isArray(n)||Object(i.isTypedArray)(n)&&"string"!==t;)r.push(n.length),n=n[0];return Array.isArray(e)&&Object(a.c)().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&l(e,r,[]),r}function l(e,t,n){if(n=n||[],!Array.isArray(e)&&!Object(i.isTypedArray)(e))return void Object(u.c)(0===t.length,(()=>`Element arr[${n.join("][")}] is a primitive, but should be an array/TypedArray of ${t[0]} elements`));Object(u.c)(t.length>0,(()=>`Element arr[${n.join("][")}] should be a primitive, but is an array of ${e.length} elements`)),Object(u.c)(e.length===t[0],(()=>`Element arr[${n.join("][")}] should have ${t[0]} elements, but has ${e.length} elements`));const r=t.slice(1);for(let t=0;t<e.length;++t)l(e[t],r,n.concat(t))}function d(e,t,n,r){if("string_or_numeric"!==e){if(null==e)throw new Error("Expected dtype cannot be null.");if("numeric"!==e&&e!==t||"numeric"===e&&"string"===t)throw new Error(`Argument '${n}' passed to '${r}' must be ${e} tensor, but got ${t} tensor`)}}function p(e,t,n,a="numeric"){if(e instanceof s.a)return d(a,e.dtype,t,n),e;let o=Object(u.s)(e);if("string"!==o&&["bool","int32","float32"].indexOf(a)>=0&&(o=a),d(a,o,t,n),null==e||!Object(i.isTypedArray)(e)&&!Array.isArray(e)&&"number"!=typeof e&&"boolean"!=typeof e&&"string"!=typeof e){const r=null==e?"null":e.constructor.name;throw new Error(`Argument '${t}' passed to '${n}' must be a Tensor or TensorLike, but got '${r}'`)}const l=c(e,o);Object(i.isTypedArray)(e)||Array.isArray(e)||(e=[e]);const p="string"!==o?Object(i.toTypedArray)(e,o):Object(i.flatten)(e,[],!0);return r.a.makeTensor(p,l,o)}function f(e,t,n,r="numeric"){if(!Array.isArray(e))throw new Error(`Argument ${t} passed to ${n} must be a \`Tensor[]\` or \`TensorLike[]\``);return e.map(((e,a)=>p(e,`${t}[${a}]`,n,r)))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return o}));var r=n(3),a=n(8);const s="__op";function o(e){const t=Object.keys(e);if(1!==t.length)throw new Error(`Please provide an object with a single key (operation name) mapping to a function. Got an object with ${t.length} keys.`);let n=t[0];const o=e[n];n.endsWith("_")&&(n=n.substring(0,n.length-1)),n+=s;const i=(...e)=>{r.a.startScope(n);try{const t=o(...e);return Object(a.y)(t)&&console.error("Cannot return a Promise inside of tidy."),r.a.endScope(t),t}catch(e){throw r.a.endScope(null),e}};return Object.defineProperty(i,"name",{value:n,configurable:!0}),i}},function(e,t,n){"use strict";n.d(t,"b",(function(){return g})),n.d(t,"a",(function(){return y}));var r=n(64),a=n(11),s=n(56),o=n(4),i=n(38),u=n(41),c=n(89),l=n(8);var d=n(17),p=n(12),f=n(6);function h(e){return null!=e.kernelName}class m{constructor(){this.registeredVariables={},this.nextTapeNodeId=0,this.numBytes=0,this.numTensors=0,this.numStringTensors=0,this.numDataBuffers=0,this.gradientDepth=0,this.kernelDepth=0,this.scopeStack=[],this.numDataMovesStack=[],this.nextScopeId=0,this.tensorInfo=new WeakMap,this.profiling=!1,this.activeProfile={newBytes:0,newTensors:0,peakBytes:0,kernels:[],result:null,get kernelNames(){return Array.from(new Set(this.kernels.map((e=>e.name))))}}}dispose(){for(const e in this.registeredVariables)this.registeredVariables[e].dispose()}}class b{constructor(e){this.ENV=e,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new m}async ready(){if(null!=this.pendingBackendInit)return this.pendingBackendInit.then((()=>{}));if(null!=this.backendInstance)return;const e=this.getSortedBackends();for(let t=0;t<e.length;t++){const n=e[t];if(await this.initializeBackend(n).success)return void await this.setBackend(n)}throw new Error("Could not initialize any backends, all backend initializations failed.")}get backend(){if(null!=this.pendingBackendInit)throw new Error(`Backend '${this.backendName}' has not yet been initialized. Make sure to await tf.ready() or await tf.setBackend() before calling other methods`);if(null==this.backendInstance){const{name:e,asyncInit:t}=this.initializeBackendsAndReturnBest();if(t)throw new Error(`The highest priority backend '${e}' has not yet been initialized. Make sure to await tf.ready() or await tf.setBackend() before calling other methods`);this.setBackend(e)}return this.backendInstance}backendNames(){return Object.keys(this.registryFactory)}findBackend(e){if(!(e in this.registry)){if(!(e in this.registryFactory))return null;{const{asyncInit:t}=this.initializeBackend(e);if(t)return null}}return this.registry[e]}findBackendFactory(e){return e in this.registryFactory?this.registryFactory[e].factory:null}registerBackend(e,t,n=1){return e in this.registryFactory?(u.b(`${e} backend was already registered. Reusing existing backend factory.`),!1):(this.registryFactory[e]={factory:t,priority:n},!0)}async setBackend(e){if(null==this.registryFactory[e])throw new Error(`Backend name '${e}' not found in registry`);if(this.backendName=e,null==this.registry[e]){this.backendInstance=null;const{success:t,asyncInit:n}=this.initializeBackend(e);if(!(n?await t:t))return!1}return this.backendInstance=this.registry[e],this.setupRegisteredKernels(),this.profiler=new c.Profiler(this.backendInstance),!0}setupRegisteredKernels(){Object(i.d)(this.backendName).forEach((e=>{null!=e.setupFunc&&e.setupFunc(this.backendInstance)}))}disposeRegisteredKernels(e){Object(i.d)(e).forEach((t=>{null!=t.disposeFunc&&t.disposeFunc(this.registry[e])}))}initializeBackend(e){const t=this.registryFactory[e];if(null==t)throw new Error(`Cannot initialize backend ${e}, no registration found.`);try{const n=t.factory();if(!n||n instanceof r.b||"function"!=typeof n.then)return this.registry[e]=n,{success:!0,asyncInit:!1};{const t=++this.pendingBackendInitId,r=n.then((n=>!(t<this.pendingBackendInitId)&&(this.registry[e]=n,this.pendingBackendInit=null,!0))).catch((n=>(t<this.pendingBackendInitId||(this.pendingBackendInit=null,u.b(`Initialization of backend ${e} failed`),u.b(n.stack||n.message)),!1)));return this.pendingBackendInit=r,{success:r,asyncInit:!0}}}catch(t){return u.b(`Initialization of backend ${e} failed`),u.b(t.stack||t.message),{success:!1,asyncInit:!1}}}removeBackend(e){if(!(e in this.registryFactory))throw new Error(`${e} backend not found in registry`);this.backendName===e&&null!=this.pendingBackendInit&&this.pendingBackendInitId++,e in this.registry&&(this.disposeRegisteredKernels(e),this.registry[e].dispose(),delete this.registry[e]),delete this.registryFactory[e],this.backendName===e&&(this.pendingBackendInit=null,this.backendName=null,this.backendInstance=null)}getSortedBackends(){if(0===Object.keys(this.registryFactory).length)throw new Error("No backend found in registry.");return Object.keys(this.registryFactory).sort(((e,t)=>this.registryFactory[t].priority-this.registryFactory[e].priority))}initializeBackendsAndReturnBest(){const e=this.getSortedBackends();for(let t=0;t<e.length;t++){const n=e[t],{success:r,asyncInit:a}=this.initializeBackend(n);if(a||r)return{name:n,asyncInit:a}}throw new Error("Could not initialize any backends, all backend initializations failed.")}moveData(e,t){const n=this.state.tensorInfo.get(t),r=n.backend,a=this.readSync(t),s=r.refCount(t);r.disposeData(t,!0),n.backend=e,e.move(t,a,n.shape,n.dtype,s),this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack[this.state.numDataMovesStack.length-1]++}tidy(e,t){let n,r=null;if(null==t){if("function"!=typeof e)throw new Error("Please provide a function to tidy()");t=e}else{if("string"!=typeof e&&!(e instanceof String))throw new Error("When calling with two arguments, the first argument to tidy() must be a string");if("function"!=typeof t)throw new Error("When calling with two arguments, the 2nd argument to tidy() must be a function");r=e}return this.scopedRun((()=>this.startScope(r)),(()=>this.endScope(n)),(()=>(n=t(),n instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),n)))}scopedRun(e,t,n){e();try{const e=n();return t(),e}catch(e){throw t(),e}}nextTensorId(){return b.nextTensorId++}nextVariableId(){return b.nextVariableId++}clone(e){const t=y.runKernel(o.vb,{x:e}),n={x:e};return this.addTapeNode(this.state.activeScope.name,n,[t],(e=>({x:()=>{const t={x:e},n={dtype:"float32"};return y.runKernel(o.y,t,n)}})),[],{}),t}runKernel(e,t,n){null==this.backendName&&this.backend;if(!(null!=Object(i.c)(e,this.backendName)))throw new Error(`Kernel '${e}' not registered for backend '${this.backendName}'`);return this.runKernelFunc({kernelName:e,inputs:t,attrs:n})}shouldCheckForMemLeaks(){return this.ENV.getBool("IS_TEST")}checkKernelForMemLeak(e,t,n){const r=this.backend.numDataIds();let a=0;n.forEach((e=>{a+="complex64"===e.dtype?3:1}));const s=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],o=r-t-a-s;if(o>0)throw new Error(`Backend '${this.backendName}' has an internal memory leak (${o} data ids) after running '${e}'`)}runKernelFunc(e){let t,n=[];const r=this.isTapeOn(),a=this.state.numBytes,s=this.state.numTensors;let o,u;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0),null==this.backendName&&this.backend;const c=h(e)?e.kernelName:null!=this.state.activeScope?this.state.activeScope.name:"";if(h(e)){const{kernelName:t,inputs:a,attrs:s}=e;null==this.backendName&&this.backend;const c=Object(i.c)(t,this.backendName);l.c(null!=c,(()=>`Cannot find registered kernel '${t}' for backend '${this.backendName}'`)),o=()=>{const e=this.backend.numDataIds();u=c.kernelFunc({inputs:a,attrs:s,backend:this.backend});const o=Array.isArray(u)?u:[u];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(t,e,o);const i=o.map((e=>null!=e.rank?e:this.makeTensorFromTensorInfo(e)));if(r){const e=this.getTensorsForGradient(t,a,i);n=this.saveTensorsForBackwardMode(e)}return i}}else{const{forwardFunc:t}=e,a=e=>{r&&(n=e.map((e=>this.keep(this.clone(e)))))};o=()=>{const e=this.backend.numDataIds();u=this.tidy((()=>t(this.backend,a)));const n=Array.isArray(u)?u:[u];return this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(c,e,n),n}}const{inputs:d,attrs:p}=e,f=h(e)?null:e.backwardsFunc;let m;return this.scopedRun((()=>this.state.kernelDepth++),(()=>this.state.kernelDepth--),(()=>{this.ENV.getBool("DEBUG")||this.state.profiling?(m=this.profiler.profileKernel(c,d,(()=>o())),this.ENV.getBool("DEBUG")&&this.profiler.logKernelProfile(m),t=m.outputs):t=o()})),r&&this.addTapeNode(c,d,t,f,n,p),this.state.profiling&&this.state.activeProfile.kernels.push({name:c,bytesAdded:this.state.numBytes-a,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-s,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(d).map((e=>null!=d[e]?d[e].shape:null)),outputShapes:t.map((e=>e.shape)),kernelTimeMs:m.timeMs,extraInfo:m.extraInfo}),Array.isArray(u)?t:t[0]}saveTensorsForBackwardMode(e){const t=e.map((e=>this.keep(this.clone(e))));return t}getTensorsForGradient(e,t,n){const r=Object(i.b)(e);if(null!=r){const e=r.inputsToSave||[],a=r.outputsToSave||[];let s;r.saveAllInputs?(l.c(Array.isArray(t),(()=>"saveAllInputs is true, expected inputs to be an array.")),s=Object.keys(t).map((e=>t[e]))):s=e.map((e=>t[e]));const o=n.filter(((e,t)=>a[t]));return s.concat(o)}return[]}makeTensor(e,t,n,r){if(null==e)throw new Error("Values passed to engine.makeTensor() are null");n=n||"float32",r=r||this.backend;let a=e;"string"===n&&l.A(e[0])&&(a=e.map((e=>f.encodeString(e))));const s=r.write(a,t,n),o=new d.a(t,n,s,this.nextTensorId());if(this.trackTensor(o,r),"string"===n){const e=this.state.tensorInfo.get(s),t=Object(l.g)(a);this.state.numBytes+=t-e.bytes,e.bytes=t}return o}makeTensorFromDataId(e,t,n,r){const a={dataId:e,shape:t,dtype:n=n||"float32"};return this.makeTensorFromTensorInfo(a,r)}makeTensorFromTensorInfo(e,t){const{dataId:n,shape:r,dtype:a}=e,s=new d.a(r,a,n,this.nextTensorId());return this.trackTensor(s,t),s}makeVariable(e,t=!0,n,r){n=n||this.nextVariableId().toString(),null!=r&&r!==e.dtype&&(e=e.cast(r));const a=new d.c(e,t,n,this.nextTensorId());if(null!=this.state.registeredVariables[a.name])throw new Error(`Variable with name ${a.name} was already registered`);return this.state.registeredVariables[a.name]=a,this.incRef(a,this.backend),a}trackTensor(e,t){this.state.numTensors++,"string"===e.dtype&&this.state.numStringTensors++;let n=0;"complex64"!==e.dtype&&"string"!==e.dtype&&(n=e.size*l.h(e.dtype)),this.state.numBytes+=n,this.state.tensorInfo.has(e.dataId)||(this.state.numDataBuffers++,this.state.tensorInfo.set(e.dataId,{backend:t||this.backend,dtype:e.dtype,shape:e.shape,bytes:n})),e instanceof d.c||this.track(e)}incRef(e,t){this.trackTensor(e,t),this.backend.incRef(e.dataId)}removeDataId(e,t){this.state.tensorInfo.has(e)&&this.state.tensorInfo.get(e).backend===t&&(this.state.tensorInfo.delete(e),this.state.numDataBuffers--)}disposeTensor(e){if(!this.state.tensorInfo.has(e.dataId))return;const t=this.state.tensorInfo.get(e.dataId);if(this.state.numTensors--,"string"===e.dtype&&(this.state.numStringTensors--,this.state.numBytes-=t.bytes),"complex64"!==e.dtype&&"string"!==e.dtype){const t=e.size*l.h(e.dtype);this.state.numBytes-=t}t.backend.disposeData(e.dataId)&&this.removeDataId(e.dataId,t.backend)}disposeVariables(){for(const e in this.state.registeredVariables){const t=this.state.registeredVariables[e];this.disposeVariable(t)}}disposeVariable(e){this.disposeTensor(e),null!=this.state.registeredVariables[e.name]&&delete this.state.registeredVariables[e.name]}memory(){const e=this.backend.memory();return e.numTensors=this.state.numTensors,e.numDataBuffers=this.state.numDataBuffers,e.numBytes=this.state.numBytes,this.state.numStringTensors>0&&(e.unreliable=!0,null==e.reasons&&(e.reasons=[]),e.reasons.push("Memory usage by string tensors is approximate (2 bytes per character)")),e}async profile(e){this.state.profiling=!0;const t=this.state.numBytes,n=this.state.numTensors;this.state.activeProfile.kernels=[],this.state.activeProfile.result=await e(),this.state.profiling=!1,this.state.activeProfile.peakBytes=Math.max(...this.state.activeProfile.kernels.map((e=>e.totalBytesSnapshot))),this.state.activeProfile.newBytes=this.state.numBytes-t,this.state.activeProfile.newTensors=this.state.numTensors-n;for(const e of this.state.activeProfile.kernels)e.kernelTimeMs=await e.kernelTimeMs,e.extraInfo=await e.extraInfo;return this.state.activeProfile}isTapeOn(){return this.state.gradientDepth>0&&0===this.state.kernelDepth}addTapeNode(e,t,n,r,a,s){const o={id:this.state.nextTapeNodeId++,kernelName:e,inputs:t,outputs:n,saved:a},u=Object(i.b)(e);null!=u&&(r=u.gradFunc),null!=r&&(o.gradient=e=>(e=e.map(((e,t)=>{if(null==e){const e=n[t],r=l.F(e.size,e.dtype);return this.makeTensor(r,e.shape,e.dtype)}return e})),r(e.length>1?e:e[0],a,s))),this.state.activeTape.push(o)}keep(e){return e.kept=!0,e}startTape(){0===this.state.gradientDepth&&(this.state.activeTape=[]),this.state.gradientDepth++}endTape(){this.state.gradientDepth--}startScope(e){const t={track:[],name:"unnamed scope",id:this.state.nextScopeId++};e&&(t.name=e),this.state.scopeStack.push(t),this.state.activeScope=t}endScope(e){const t=Object(p.getTensorsInContainer)(e),n=new Set(t.map((e=>e.id)));for(let e=0;e<this.state.activeScope.track.length;e++){const t=this.state.activeScope.track[e];t.kept||n.has(t.id)||t.dispose()}const r=this.state.scopeStack.pop();this.state.activeScope=0===this.state.scopeStack.length?null:this.state.scopeStack[this.state.scopeStack.length-1],t.forEach((e=>{e.kept||e.scopeId!==r.id||this.track(e)}))}gradients(e,t,n,r=!1){if(l.c(t.length>0,(()=>"gradients() received an empty list of xs.")),null!=n&&"float32"!==n.dtype)throw new Error(`dy must have 'float32' dtype, but has '${n.dtype}'`);const a=this.scopedRun((()=>this.startTape()),(()=>this.endTape()),(()=>this.tidy("forward",e)));l.c(a instanceof d.a,(()=>"The result y returned by f() must be a tensor."));const s=function(e,t,n){const r={},a={};for(let e=0;e<t.length;e++)r[t[e].id]=!0;for(let n=0;n<e.length;n++){const s=e[n],o=s.inputs;for(const e in o){const n=o[e];let i=!1;for(let e=0;e<t.length;e++)if(r[n.id]){s.outputs.forEach((e=>r[e.id]=!0)),i=!0,a[s.id]=!0;break}if(i)break}}const s={};s[n.id]=!0;const o={};for(let t=e.length-1;t>=0;t--){const n=e[t],r=n.inputs;for(let e=0;e<n.outputs.length;e++)if(s[n.outputs[e].id]){for(const e in r)s[r[e].id]=!0,o[n.id]=!0;break}}const i=[];for(let t=0;t<e.length;t++){const n=e[t];if(a[n.id]&&o[n.id]){const e={};for(const t in n.inputs){const a=n.inputs[t];r[a.id]&&(e[t]=a)}const t=Object.assign({},n);t.inputs=e,t.outputs=n.outputs,i.push(t)}}return i}(this.state.activeTape,t,a);if(!r&&0===s.length&&t.length>0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.");return this.tidy("backward",(()=>{const e={};e[a.id]=null==n?function(e){const t=Object(l.D)(Object(l.O)(e),"float32");return y.makeTensor(t,e,"float32")}(a.shape):n,function(e,t,n,r){for(let a=t.length-1;a>=0;a--){const s=t[a],o=[];if(s.outputs.forEach((t=>{const n=e[t.id];null!=n?o.push(n):o.push(null)})),null==s.gradient)throw new Error(`Cannot compute gradient: gradient function not found for ${s.kernelName}.`);const i=s.gradient(o);for(const t in s.inputs){if(!(t in i))throw new Error(`Cannot backprop through input ${t}. Available gradients found: ${Object.keys(i)}.`);const a=n((()=>i[t]()));if("float32"!==a.dtype)throw new Error(`Error in gradient for op ${s.kernelName}. The gradient of input ${t} must have 'float32' dtype, but has '${a.dtype}'`);const o=s.inputs[t];if(!l.a(a.shape,o.shape))throw new Error(`Error in gradient for op ${s.kernelName}. The gradient of input '${t}' has shape '${a.shape}', which does not match the shape of the input '${o.shape}'`);if(null==e[o.id])e[o.id]=a;else{const t=e[o.id];e[o.id]=r(t,a),t.dispose()}}}}(e,s,(e=>this.tidy(e)),w);const r=t.map((t=>e[t.id]));return 0===this.state.gradientDepth&&(this.state.activeTape.forEach((e=>{for(const t of e.saved)t.dispose()})),this.state.activeTape=null),{value:a,grads:r}}))}customGrad(e){return l.c(l.v(e),(()=>"The f passed in customGrad(f) must be a function.")),(...t)=>{let n;l.c(t.every((e=>e instanceof d.a)),(()=>"The args passed in customGrad(f)(x1, x2,...) must all be tensors"));const r={};t.forEach(((e,t)=>{r[t]=e}));return this.runKernelFunc({forwardFunc:(r,a)=>(n=e(...t,a),l.c(n.value instanceof d.a,(()=>"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor")),l.c(l.v(n.gradFunc),(()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function.")),n.value),backwardsFunc:(e,r)=>{const a=n.gradFunc(e,r),s=Array.isArray(a)?a:[a];l.c(s.length===t.length,(()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns the same number of tensors as inputs passed to f(...).")),l.c(s.every((e=>e instanceof d.a)),(()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns a list of only tensors."));const o={};return s.forEach(((e,t)=>{o[t]=()=>e})),o},inputs:r})}}readSync(e){return this.state.tensorInfo.get(e).backend.readSync(e)}read(e){return this.state.tensorInfo.get(e).backend.read(e)}readToGPU(e,t){return this.state.tensorInfo.get(e).backend.readToGPU(e,t)}async time(e){const t=Object(f.now)(),n=await this.backend.time(e);return n.wallMs=Object(f.now)()-t,n}track(e){return null!=this.state.activeScope&&(e.scopeId=this.state.activeScope.id,this.state.activeScope.track.push(e)),e}get registeredVariables(){return this.state.registeredVariables}reset(){this.pendingBackendInitId++,this.state.dispose(),this.ENV.reset(),this.state=new m;for(const e in this.registry)this.disposeRegisteredKernels(e),this.registry[e].dispose(),delete this.registry[e];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null}}function g(){const e=Object(s.b)();if(null==e._tfengine){const t=new a.b(e);e._tfengine=new b(t)}return Object(a.d)(e._tfengine.ENV),Object(d.f)((()=>e._tfengine)),e._tfengine}b.nextTensorId=0,b.nextVariableId=0;const y=g();function w(e,t){const n={a:e,b:t};return y.runKernel(o.d,n)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return s})),n.d(t,"d",(function(){return o})),n.d(t,"e",(function(){return i})),n.d(t,"f",(function(){return u})),n.d(t,"g",(function(){return c})),n.d(t,"h",(function(){return l})),n.d(t,"i",(function(){return d})),n.d(t,"j",(function(){return p})),n.d(t,"k",(function(){return f})),n.d(t,"l",(function(){return h})),n.d(t,"n",(function(){return m})),n.d(t,"m",(function(){return b})),n.d(t,"o",(function(){return g})),n.d(t,"r",(function(){return y})),n.d(t,"p",(function(){return w})),n.d(t,"q",(function(){return O})),n.d(t,"s",(function(){return v})),n.d(t,"t",(function(){return j})),n.d(t,"u",(function(){return _})),n.d(t,"v",(function(){return S})),n.d(t,"x",(function(){return k})),n.d(t,"w",(function(){return x})),n.d(t,"y",(function(){return E})),n.d(t,"z",(function(){return T})),n.d(t,"A",(function(){return N})),n.d(t,"B",(function(){return A})),n.d(t,"C",(function(){return M})),n.d(t,"D",(function(){return I})),n.d(t,"E",(function(){return D})),n.d(t,"F",(function(){return $})),n.d(t,"G",(function(){return C})),n.d(t,"H",(function(){return R})),n.d(t,"I",(function(){return P})),n.d(t,"J",(function(){return F})),n.d(t,"K",(function(){return B})),n.d(t,"L",(function(){return L})),n.d(t,"N",(function(){return z})),n.d(t,"O",(function(){return W})),n.d(t,"M",(function(){return U})),n.d(t,"P",(function(){return V})),n.d(t,"Q",(function(){return G})),n.d(t,"R",(function(){return q})),n.d(t,"S",(function(){return H})),n.d(t,"T",(function(){return K})),n.d(t,"U",(function(){return Y})),n.d(t,"V",(function(){return J})),n.d(t,"X",(function(){return X})),n.d(t,"W",(function(){return Q})),n.d(t,"Y",(function(){return Z})),n.d(t,"vc",(function(){return ee})),n.d(t,"Z",(function(){return te})),n.d(t,"ab",(function(){return ne})),n.d(t,"bb",(function(){return re})),n.d(t,"db",(function(){return ae})),n.d(t,"cb",(function(){return se})),n.d(t,"eb",(function(){return oe})),n.d(t,"fb",(function(){return ie})),n.d(t,"gb",(function(){return ue})),n.d(t,"hb",(function(){return ce})),n.d(t,"ib",(function(){return le})),n.d(t,"jb",(function(){return de})),n.d(t,"kb",(function(){return pe})),n.d(t,"lb",(function(){return fe})),n.d(t,"nb",(function(){return he})),n.d(t,"rb",(function(){return me})),n.d(t,"qb",(function(){return be})),n.d(t,"sb",(function(){return ge})),n.d(t,"tb",(function(){return ye})),n.d(t,"vb",(function(){return we})),n.d(t,"ub",(function(){return Oe})),n.d(t,"wb",(function(){return ve})),n.d(t,"xb",(function(){return je})),n.d(t,"yb",(function(){return _e})),n.d(t,"zb",(function(){return Se})),n.d(t,"Cb",(function(){return ke})),n.d(t,"Db",(function(){return xe})),n.d(t,"Eb",(function(){return Ee})),n.d(t,"Fb",(function(){return Te})),n.d(t,"Gb",(function(){return Ne})),n.d(t,"Hb",(function(){return Ae})),n.d(t,"Jb",(function(){return Me})),n.d(t,"Kb",(function(){return Ie})),n.d(t,"Lb",(function(){return De})),n.d(t,"Mb",(function(){return $e})),n.d(t,"Ib",(function(){return Ce})),n.d(t,"Nb",(function(){return Re})),n.d(t,"Ab",(function(){return Pe})),n.d(t,"Bb",(function(){return Fe})),n.d(t,"Ob",(function(){return Be})),n.d(t,"Pb",(function(){return Le})),n.d(t,"Vb",(function(){return ze})),n.d(t,"Qb",(function(){return We})),n.d(t,"Tb",(function(){return Ue})),n.d(t,"Rb",(function(){return Ve})),n.d(t,"Sb",(function(){return Ge})),n.d(t,"Ub",(function(){return qe})),n.d(t,"Wb",(function(){return He})),n.d(t,"Xb",(function(){return Ke})),n.d(t,"Yb",(function(){return Ye})),n.d(t,"Zb",(function(){return Je})),n.d(t,"ac",(function(){return Xe})),n.d(t,"bc",(function(){return Qe})),n.d(t,"cc",(function(){return Ze})),n.d(t,"dc",(function(){return et})),n.d(t,"hc",(function(){return tt})),n.d(t,"ec",(function(){return nt})),n.d(t,"fc",(function(){return rt})),n.d(t,"gc",(function(){return at})),n.d(t,"jc",(function(){return st})),n.d(t,"ic",(function(){return ot})),n.d(t,"kc",(function(){return it})),n.d(t,"lc",(function(){return ut})),n.d(t,"mc",(function(){return ct})),n.d(t,"nc",(function(){return lt})),n.d(t,"oc",(function(){return dt})),n.d(t,"pc",(function(){return pt})),n.d(t,"qc",(function(){return ft})),n.d(t,"rc",(function(){return ht})),n.d(t,"sc",(function(){return mt})),n.d(t,"tc",(function(){return bt})),n.d(t,"uc",(function(){return gt})),n.d(t,"wc",(function(){return yt})),n.d(t,"xc",(function(){return wt})),n.d(t,"zc",(function(){return Ot})),n.d(t,"Cc",(function(){return vt})),n.d(t,"Dc",(function(){return jt})),n.d(t,"Ac",(function(){return _t})),n.d(t,"Bc",(function(){return St})),n.d(t,"yc",(function(){return kt})),n.d(t,"Ec",(function(){return xt})),n.d(t,"Gc",(function(){return Et})),n.d(t,"Hc",(function(){return Tt})),n.d(t,"Ic",(function(){return Nt})),n.d(t,"nd",(function(){return At})),n.d(t,"Jc",(function(){return Mt})),n.d(t,"Kc",(function(){return It})),n.d(t,"Lc",(function(){return Dt})),n.d(t,"Qc",(function(){return $t})),n.d(t,"Oc",(function(){return Ct})),n.d(t,"Pc",(function(){return Rt})),n.d(t,"Nc",(function(){return Pt})),n.d(t,"Mc",(function(){return Ft})),n.d(t,"Sc",(function(){return Bt})),n.d(t,"ad",(function(){return Lt})),n.d(t,"kd",(function(){return zt})),n.d(t,"Tc",(function(){return Wt})),n.d(t,"Zc",(function(){return Ut})),n.d(t,"Rc",(function(){return Vt})),n.d(t,"Uc",(function(){return Gt})),n.d(t,"Vc",(function(){return qt})),n.d(t,"Wc",(function(){return Ht})),n.d(t,"Xc",(function(){return Kt})),n.d(t,"Yc",(function(){return Yt})),n.d(t,"cd",(function(){return Jt})),n.d(t,"bd",(function(){return Xt})),n.d(t,"dd",(function(){return Qt})),n.d(t,"fd",(function(){return Zt})),n.d(t,"gd",(function(){return en})),n.d(t,"hd",(function(){return tn})),n.d(t,"id",(function(){return nn})),n.d(t,"jd",(function(){return rn})),n.d(t,"ld",(function(){return an})),n.d(t,"md",(function(){return sn})),n.d(t,"od",(function(){return on})),n.d(t,"pd",(function(){return un})),n.d(t,"qd",(function(){return cn})),n.d(t,"rd",(function(){return ln})),n.d(t,"sd",(function(){return dn})),n.d(t,"td",(function(){return pn})),n.d(t,"ud",(function(){return fn})),n.d(t,"vd",(function(){return hn})),n.d(t,"wd",(function(){return mn})),n.d(t,"ed",(function(){return bn})),n.d(t,"mb",(function(){return gn})),n.d(t,"Fc",(function(){return yn})),n.d(t,"xd",(function(){return wn})),n.d(t,"ob",(function(){return On})),n.d(t,"pb",(function(){return vn}));const r="Abs",a="Acos",s="Acosh",o="Add",i="AddN",u="All",c="Any",l="ArgMax",d="ArgMin",p="Asin",f="Asinh",h="Atan",m="Atanh",b="Atan2",g="AvgPool",y="AvgPoolGrad",w="AvgPool3D",O="AvgPool3DGrad",v="BatchMatMul",j="BatchToSpaceND",_="Bincount",S="BitwiseAnd",k="BroadcastTo",x="BroadcastArgs",E="Cast",T="Ceil",N="ClipByValue",A="Complex",M="ComplexAbs",I="Concat",D="Conv2D",$="Conv2DBackpropFilter",C="Conv2DBackpropInput",R="Conv3D",P="Conv3DBackpropFilterV2",F="Conv3DBackpropInputV2",B="Cos",L="Cosh",z="Cumprod",W="Cumsum",U="CropAndResize",V="DenseBincount",G="DepthToSpace",q="DepthwiseConv2dNative",H="DepthwiseConv2dNativeBackpropFilter",K="DepthwiseConv2dNativeBackpropInput",Y="Diag",J="Dilation2D",X="Dilation2DBackpropInput",Q="Dilation2DBackpropFilter",Z="Draw",ee="RealDiv",te="Einsum",ne="Elu",re="EluGrad",ae="Erf",se="Equal",oe="Exp",ie="ExpandDims",ue="Expm1",ce="FFT",le="Fill",de="FlipLeftRight",pe="Floor",fe="FloorDiv",he="FusedBatchNorm",me="GatherV2",be="GatherNd",ge="Greater",ye="GreaterEqual",we="Identity",Oe="IFFT",ve="Imag",je="IsFinite",_e="IsInf",Se="IsNan",ke="LeakyRelu",xe="Less",Ee="LessEqual",Te="LinSpace",Ne="Log",Ae="Log1p",Me="LogicalAnd",Ie="LogicalNot",De="LogicalOr",$e="LogicalXor",Ce="LogSoftmax",Re="LowerBound",Pe="LRN",Fe="LRNGrad",Be="MatrixBandPart",Le="Max",ze="Maximum",We="MaxPool",Ue="MaxPoolGrad",Ve="MaxPool3D",Ge="MaxPool3DGrad",qe="MaxPoolWithArgmax",He="Mean",Ke="Min",Ye="Minimum",Je="MirrorPad",Xe="Mod",Qe="Multinomial",Ze="Multiply",et="Neg",tt="NotEqual",nt="NonMaxSuppressionV3",rt="NonMaxSuppressionV4",at="NonMaxSuppressionV5",st="OnesLike",ot="OneHot",it="Pack",ut="PadV2",ct="Pool",lt="Pow",dt="Prelu",pt="Prod",ft="RaggedGather",ht="RaggedRange",mt="RaggedTensorToTensor",bt="Range",gt="Real",yt="Reciprocal",wt="Relu",Ot="Reshape",vt="ResizeNearestNeighbor",jt="ResizeNearestNeighborGrad",_t="ResizeBilinear",St="ResizeBilinearGrad",kt="Relu6",xt="Reverse",Et="Round",Tt="Rsqrt",Nt="ScatterNd",At="TensorScatterUpdate",Mt="SearchSorted",It="Select",Dt="Selu",$t="Slice",Ct="Sin",Rt="Sinh",Pt="Sign",Ft="Sigmoid",Bt="Softplus",Lt="Sqrt",zt="Sum",Wt="SpaceToBatchND",Ut="SplitV",Vt="Softmax",Gt="SparseFillEmptyRows",qt="SparseReshape",Ht="SparseSegmentMean",Kt="SparseSegmentSum",Yt="SparseToDense",Jt="SquaredDifference",Xt="Square",Qt="StaticRegexReplace",Zt="StridedSlice",en="StringNGrams",tn="StringSplit",nn="StringToHashBucketFast",rn="Sub",an="Tan",sn="Tanh",on="Tile",un="TopK",cn="Transform",ln="Transpose",dn="Unique",pn="Unpack",fn="UnsortedSegmentSum",hn="UpperBound",mn="ZerosLike",bn="Step",gn="FromPixels",yn="RotateWithOffset",wn="_FusedMatMul",On="FusedConv2D",vn="FusedDepthwiseConv2D"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(100);Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})})),n(102)},function(e,t,n){"use strict";n.r(t),n.d(t,"shuffle",(function(){return s.M})),n.d(t,"shuffleCombo",(function(){return s.N})),n.d(t,"clamp",(function(){return s.j})),n.d(t,"nearestLargerEven",(function(){return s.H})),n.d(t,"swap",(function(){return s.S})),n.d(t,"sum",(function(){return s.R})),n.d(t,"randUniform",(function(){return s.J})),n.d(t,"distSquared",(function(){return s.n})),n.d(t,"assert",(function(){return s.c})),n.d(t,"assertShapesMatch",(function(){return s.f})),n.d(t,"assertNonNull",(function(){return s.e})),n.d(t,"sizeFromShape",(function(){return s.O})),n.d(t,"isScalarShape",(function(){return s.z})),n.d(t,"arraysEqualWithNull",(function(){return s.b})),n.d(t,"arraysEqual",(function(){return s.a})),n.d(t,"isInt",(function(){return s.w})),n.d(t,"tanh",(function(){return s.T})),n.d(t,"sizeToSquarishShape",(function(){return s.P})),n.d(t,"createShuffledIndices",(function(){return s.m})),n.d(t,"rightPad",(function(){return s.L})),n.d(t,"repeatedTry",(function(){return s.K})),n.d(t,"inferFromImplicitShape",(function(){return s.t})),n.d(t,"parseAxisParam",(function(){return s.I})),n.d(t,"squeezeShape",(function(){return s.Q})),n.d(t,"getTypedArrayFromDType",(function(){return s.p})),n.d(t,"getArrayFromDType",(function(){return s.o})),n.d(t,"checkConversionForErrors",(function(){return s.i})),n.d(t,"isValidDtype",(function(){return s.B})),n.d(t,"hasEncodingLoss",(function(){return s.q})),n.d(t,"bytesPerElement",(function(){return s.h})),n.d(t,"bytesFromStringArray",(function(){return s.g})),n.d(t,"isString",(function(){return s.A})),n.d(t,"isBoolean",(function(){return s.u})),n.d(t,"isNumber",(function(){return s.x})),n.d(t,"inferDtype",(function(){return s.s})),n.d(t,"isFunction",(function(){return s.v})),n.d(t,"nearestDivisor",(function(){return s.G})),n.d(t,"computeStrides",(function(){return s.k})),n.d(t,"toNestedArray",(function(){return s.U})),n.d(t,"convertBackendValuesAndArrayBuffer",(function(){return s.l})),n.d(t,"makeOnesTypedArray",(function(){return s.D})),n.d(t,"makeZerosTypedArray",(function(){return s.F})),n.d(t,"makeZerosNestedTypedArray",(function(){return s.E})),n.d(t,"assertNonNegativeIntegerDimensions",(function(){return s.d})),n.d(t,"locToIndex",(function(){return s.C})),n.d(t,"indexToLoc",(function(){return s.r})),n.d(t,"isPromise",(function(){return s.y})),n.d(t,"hexToLong",(function(){return u})),n.d(t,"fingerPrint64",(function(){return w})),n.d(t,"createScalarValue",(function(){return O})),n.d(t,"toTypedArray",(function(){return v})),n.d(t,"now",(function(){return j})),n.d(t,"fetch",(function(){return _})),n.d(t,"encodeString",(function(){return S})),n.d(t,"decodeString",(function(){return k})),n.d(t,"isTypedArray",(function(){return x})),n.d(t,"flatten",(function(){return E}));var r=n(11),a=n(78),s=n(8),o=n(93);const i=n.n(o).a||o;function u(e){return i.fromString(e,!0,16)}const c=u("c3a5c85c97cb3127"),l=u("b492b66fbe98f273"),d=u("9ae16a3b2f90404f");function p(e){return e.xor(e.shru(47))}function f(e,t,n){const r=e.slice(t,t+n);return i.fromBytes(Array.from(r),!0,!0)}function h(e,t){return f(e,t,8)}function m(e,t){return f(e,t,4)}function b(e,t){return 0===t?e:e.shru(t).or(e.shl(64-t))}function g(e,t,n=u("9ddfea08eb382d69")){let r=e.xor(t).mul(n);r=r.xor(r.shru(47));let a=t.xor(r).mul(n);return a=a.xor(a.shru(47)),a=a.mul(n),a}function y(e,t,n,r){return function(e,t,n,r,a,s){a=a.add(e),s=b(s.add(a).add(r),21);const o=a;return a=(a=a.add(t)).add(n),s=s.add(b(a,44)),[a.add(r),s.add(o)]}(h(e,t),h(e,t+8),h(e,t+16),h(e,t+24),n,r)}function w(e,t=e.length){const n=i.fromNumber(81,!0);if(t<=32)return t<=16?function(e,t=e.length){if(t>=8){const n=d.add(2*t),r=h(e,0).add(d),a=h(e,t-8);return g(b(a,37).mul(n).add(r),b(r,25).add(a).mul(n),n)}if(t>=4){const n=d.add(2*t);return g(m(e,0).shl(3).add(t),m(e,t-4),n)}if(t>0){const n=e[0]+(e[t>>1]<<8),r=t+(e[t-1]<<2);return p(d.mul(n).xor(c.mul(r))).mul(d)}return d}(e,t):function(e,t=e.length){const n=d.add(2*t),r=h(e,0).mul(l),a=h(e,8),s=h(e,t-8).mul(n),o=h(e,t-16).mul(d);return g(b(r.add(a),43).add(b(s,30)).add(o),r.add(b(a.add(d),18)).add(s),n)}(e,t);if(t<=64)return function(e,t=e.length){const n=d.add(2*t),r=h(e,0).mul(d),a=h(e,8),s=h(e,t-8).mul(n),o=h(e,t-16).mul(d),i=b(r.add(a),43).add(b(s,30)).add(o),u=g(i,r.add(b(a.add(d),18)).add(s),n),c=h(e,16).mul(n),l=h(e,24),p=i.add(h(e,t-32)).mul(n),f=u.add(h(e,t-24)).mul(n);return g(b(c.add(l),43).add(b(p,30)).add(f),c.add(b(l.add(r),18)).add(p),n)}(e,t);let r=n,a=n.mul(l).add(113),s=p(a.mul(d).add(113)).mul(d),o=[i.UZERO,i.UZERO],u=[i.UZERO,i.UZERO];r=r.mul(d).add(h(e,0));let f=0;const w=64*(t-1>>6),O=w+(t-1&63)-63;do{r=b(r.add(a).add(o[0]).add(h(e,f+8)),37).mul(l),a=b(a.add(o[1]).add(h(e,f+48)),42).mul(l),r=r.xor(u[1]),a=a.add(o[0]).add(h(e,f+40)),s=b(s.add(u[0]),33).mul(l),o=y(e,f,o[1].mul(l),r.add(u[0])),u=y(e,f+32,s.add(u[1]),a.add(h(e,f+16))),[s,r]=[r,s],f+=64}while(f!==w);const v=l.add(s.and(255).shl(1));return f=O,u[0]=u[0].add(t-1&63),o[0]=o[0].add(u[0]),u[0]=u[0].add(o[0]),r=b(r.add(a).add(o[0]).add(h(e,f+8)),37).mul(v),a=b(a.add(o[1]).add(h(e,f+48)),42).mul(v),r=r.xor(u[1].mul(9)),a=a.add(o[0].mul(9).add(h(e,f+40))),s=b(s.add(u[0]),33).mul(v),o=y(e,f,o[1].mul(v),r.add(u[0])),u=y(e,f+32,s.add(u[1]),a.add(h(e,f+16))),[s,r]=[r,s],g(g(o[0],u[0],v).add(p(a).mul(c)).add(s),g(o[1],u[1],v).add(r),v)}function O(e,t){return"string"===t?S(e):v([e],t)}function v(e,t){if("string"===t)throw new Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(e)&&(e=E(e)),Object(r.c)().getBool("DEBUG")&&s.i(e,t),function(e,t){return e instanceof Float32Array&&"float32"===t||e instanceof Int32Array&&"int32"===t||e instanceof Uint8Array&&"bool"===t}(e,t))return e;if(null==t||"float32"===t||"complex64"===t)return new Float32Array(e);if("int32"===t)return new Int32Array(e);if("bool"===t){const t=new Uint8Array(e.length);for(let n=0;n<t.length;++n)0!==Math.round(e[n])&&(t[n]=1);return t}throw new Error(`Unknown data type ${t}`)}function j(){return Object(r.c)().platform.now()}function _(e,t){return Object(r.c)().platform.fetch(e,t)}function S(e,t="utf-8"){return t=t||"utf-8",Object(r.c)().platform.encode(e,t)}function k(e,t="utf-8"){return t=t||"utf-8",Object(r.c)().platform.decode(e,t)}function x(e){return null!=Object(r.c)().platform.isTypedArray?Object(r.c)().platform.isTypedArray(e):Object(a.a)(e)}function E(e,t=[],n=!1){if(null==t&&(t=[]),"boolean"==typeof e||"number"==typeof e||"string"==typeof e||s.y(e)||null==e||x(e)&&n)t.push(e);else if(Array.isArray(e)||x(e))for(let r=0;r<e.length;++r)E(e[r],t,n);else{let r=-1;for(const t of Object.keys(e))/^([1-9]+[0-9]*|0)$/.test(t)&&(r=Math.max(r,Number(t)));for(let a=0;a<=r;a++)E(e[a],t,n)}return t}},function(e,t,n){"use strict";n.r(t),n.d(t,"reshape",(function(){return i}));var r=n(3),a=n(4),s=n(1),o=n(2);const i=Object(o.b)({reshape_:function(e,t){const n={x:Object(s.a)(e,"x","reshape","string_or_numeric")},o={shape:t};return r.a.runKernel(a.zc,n,o)}})},function(e,t,n){"use strict";function r(e){let t=e.length,n=0;for(;t>0;)n=Math.random()*t|0,t--,i(e,t,n)}function a(e,t){if(e.length!==t.length)throw new Error(`Array sizes must match to be shuffled together First array length was ${e.length}Second array length was ${t.length}`);let n=e.length,r=0;for(;n>0;)r=Math.random()*n|0,n--,i(e,n,r),i(t,n,r)}function s(e,t,n){return Math.max(e,Math.min(t,n))}function o(e){return e%2==0?e:e+1}function i(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function u(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n];return t}function c(e,t){const n=Math.random();return t*n+(1-n)*e}function l(e,t){let n=0;for(let r=0;r<e.length;r++){const a=Number(e[r])-Number(t[r]);n+=a*a}return n}function d(e,t){if(!e)throw new Error("string"==typeof t?t:t())}function p(e,t,n=""){d(g(e,t),(()=>n+` Shapes ${e} and ${t} must match`))}function f(e){d(null!=e,(()=>"The input to the tensor constructor must be a non-null value."))}function h(e){if(0===e.length)return 1;let t=e[0];for(let n=1;n<e.length;n++)t*=e[n];return t}function m(e){return 0===e.length}function b(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(null!==e[n]&&null!==t[n]&&e[n]!==t[n])return!1;return!0}function g(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function y(e){return e%1==0}function w(e){if(null!=Math.tanh)return Math.tanh(e);if(e===1/0)return 1;if(e===-1/0)return-1;{const t=Math.exp(2*e);return(t-1)/(t+1)}}function O(e){const t=Math.ceil(Math.sqrt(e));return[t,Math.ceil(e/t)]}function v(e){const t=new Uint32Array(e);for(let n=0;n<e;++n)t[n]=n;return r(t),t}function j(e,t){return t<=e.length?e:e+" ".repeat(t-e.length)}function _(e,t=(e=>0),n,r){return new Promise(((a,s)=>{let o=0;const i=()=>{if(e())return void a();o++;const u=t(o);null!=n&&o>=n?s():null!=r?r(i,u):setTimeout(i,u)};i()}))}function S(e,t){let n=1,r=-1;for(let t=0;t<e.length;++t)if(e[t]>=0)n*=e[t];else if(-1===e[t]){if(-1!==r)throw Error(`Shapes can only have 1 implicit size. Found -1 at dim ${r} and dim ${t}`);r=t}else if(e[t]<0)throw Error(`Shapes can not be < 0. Found ${e[t]} at dim ${t}`);if(-1===r){if(t>0&&t!==n)throw Error(`Size(${t}) must match the product of shape ${e}`);return e}if(0===n)throw Error(`Cannot infer the missing size in [${e}] when there are 0 elements`);if(t%n!=0)throw Error(`The implicit shape can't be a fractional number. Got ${t} / ${n}`);const a=e.slice();return a[r]=t/n,a}function k(e,t){const n=t.length;return d((e=null==e?t.map(((e,t)=>t)):[].concat(e)).every((e=>e>=-n&&e<n)),(()=>`All values in axis param must be in range [-${n}, ${n}) but got axis ${e}`)),d(e.every((e=>y(e))),(()=>`All values in axis param must be integers but got axis ${e}`)),e.map((e=>e<0?n+e:e))}function x(e,t){const n=[],r=[],a=null!=t&&Array.isArray(t)&&0===t.length,s=null==t||a?null:k(t,e).sort();let o=0;for(let t=0;t<e.length;++t){if(null!=s){if(s[o]===t&&1!==e[t])throw new Error(`Can't squeeze axis ${t} since its dim '${e[t]}' is not 1`);(null==s[o]||s[o]>t)&&1===e[t]&&(n.push(e[t]),r.push(t)),s[o]<=t&&o++}1!==e[t]&&(n.push(e[t]),r.push(t))}return{newShape:n,keptDims:r}}function E(e,t){return T(e,t)}function T(e,t){let n=null;if(null==e||"float32"===e)n=new Float32Array(t);else if("int32"===e)n=new Int32Array(t);else if("bool"===e)n=new Uint8Array(t);else{if("string"!==e)throw new Error(`Unknown data type ${e}`);n=new Array(t)}return n}function N(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(isNaN(r)||!isFinite(r))throw Error(`A tensor of type ${t} being uploaded contains ${r}.`)}}function A(e){return"bool"===e||"complex64"===e||"float32"===e||"int32"===e||"string"===e}function M(e,t){return"complex64"!==t&&(("float32"!==t||"complex64"===e)&&(("int32"!==t||"float32"===e||"complex64"===e)&&("bool"!==t||"bool"!==e)))}function I(e){if("float32"===e||"int32"===e)return 4;if("complex64"===e)return 8;if("bool"===e)return 1;throw new Error(`Unknown dtype ${e}`)}function D(e){if(null==e)return 0;let t=0;return e.forEach((e=>t+=e.length)),t}function $(e){return"string"==typeof e||e instanceof String}function C(e){return"boolean"==typeof e}function R(e){return"number"==typeof e}function P(e){return Array.isArray(e)?P(e[0]):e instanceof Float32Array?"float32":e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray?"int32":R(e)?"float32":$(e)?"string":C(e)?"bool":"float32"}function F(e){return!!(e&&e.constructor&&e.call&&e.apply)}function B(e,t){for(let n=t;n<e;++n)if(e%n==0)return n;return e}function L(e){const t=e.length;if(t<2)return[];const n=new Array(t-1);n[t-2]=e[t-1];for(let r=t-3;r>=0;--r)n[r]=n[r+1]*e[r+1];return n}function z(e,t,n,r=!1){const a=new Array;if(1===t.length){const s=t[0]*(r?2:1);for(let t=0;t<s;t++)a[t]=n[e+t]}else{const s=t[0],o=t.slice(1),i=o.reduce(((e,t)=>e*t))*(r?2:1);for(let t=0;t<s;t++)a[t]=z(e+t*i,o,n,r)}return a}function W(e,t,n=!1){if(0===e.length)return t[0];const r=e.reduce(((e,t)=>e*t))*(n?2:1);if(0===r)return[];if(r!==t.length)throw new Error(`[${e}] does not match the input size ${t.length}${n?" for a complex tensor":""}.`);return z(0,e,t,n)}function U(e,t){if(Array.isArray(e))return e;if("float32"===t)return e instanceof Float32Array?e:new Float32Array(e);if("int32"===t)return e instanceof Int32Array?e:new Int32Array(e);if("bool"===t||"string"===t)return Uint8Array.from(new Int32Array(e));throw new Error(`Unknown dtype ${t}`)}function V(e,t){const n=G(e,t);for(let e=0;e<n.length;e++)n[e]=1;return n}function G(e,t){if(null==t||"float32"===t||"complex64"===t)return new Float32Array(e);if("int32"===t)return new Int32Array(e);if("bool"===t)return new Uint8Array(e);throw new Error(`Unknown data type ${t}`)}function q(e,t){const n=e.reduce(((e,t)=>e*t),1);if(null==t||"float32"===t)return W(e,new Float32Array(n));if("int32"===t)return W(e,new Int32Array(n));if("bool"===t)return W(e,new Uint8Array(n));throw new Error(`Unknown data type ${t}`)}function H(e){e.forEach((t=>{d(Number.isInteger(t)&&t>=0,(()=>`Tensor must have a shape comprised of positive integers but got shape [${e}].`))}))}function K(e,t,n){if(0===t)return 0;if(1===t)return e[0];let r=e[e.length-1];for(let t=0;t<e.length-1;++t)r+=n[t]*e[t];return r}function Y(e,t,n){if(0===t)return[];if(1===t)return[e];const r=new Array(t);for(let t=0;t<r.length-1;++t)r[t]=Math.floor(e/n[t]),e-=r[t]*n[t];return r[r.length-1]=e,r}function J(e){return e&&e.then&&"function"==typeof e.then}n.d(t,"M",(function(){return r})),n.d(t,"N",(function(){return a})),n.d(t,"j",(function(){return s})),n.d(t,"H",(function(){return o})),n.d(t,"S",(function(){return i})),n.d(t,"R",(function(){return u})),n.d(t,"J",(function(){return c})),n.d(t,"n",(function(){return l})),n.d(t,"c",(function(){return d})),n.d(t,"f",(function(){return p})),n.d(t,"e",(function(){return f})),n.d(t,"O",(function(){return h})),n.d(t,"z",(function(){return m})),n.d(t,"b",(function(){return b})),n.d(t,"a",(function(){return g})),n.d(t,"w",(function(){return y})),n.d(t,"T",(function(){return w})),n.d(t,"P",(function(){return O})),n.d(t,"m",(function(){return v})),n.d(t,"L",(function(){return j})),n.d(t,"K",(function(){return _})),n.d(t,"t",(function(){return S})),n.d(t,"I",(function(){return k})),n.d(t,"Q",(function(){return x})),n.d(t,"p",(function(){return E})),n.d(t,"o",(function(){return T})),n.d(t,"i",(function(){return N})),n.d(t,"B",(function(){return A})),n.d(t,"q",(function(){return M})),n.d(t,"h",(function(){return I})),n.d(t,"g",(function(){return D})),n.d(t,"A",(function(){return $})),n.d(t,"u",(function(){return C})),n.d(t,"x",(function(){return R})),n.d(t,"s",(function(){return P})),n.d(t,"v",(function(){return F})),n.d(t,"G",(function(){return B})),n.d(t,"k",(function(){return L})),n.d(t,"U",(function(){return W})),n.d(t,"l",(function(){return U})),n.d(t,"D",(function(){return V})),n.d(t,"F",(function(){return G})),n.d(t,"E",(function(){return q})),n.d(t,"d",(function(){return H})),n.d(t,"C",(function(){return K})),n.d(t,"r",(function(){return Y})),n.d(t,"y",(function(){return J}))},function(e,t,n){"use strict";n.r(t),n.d(t,"mul",(function(){return u}));var r=n(3),a=n(4),s=n(12),o=n(1),i=n(2);const u=Object(i.b)({mul_:function(e,t){let n=Object(o.a)(e,"a","mul"),i=Object(o.a)(t,"b","mul");[n,i]=Object(s.makeTypesMatch)(n,i);const u={a:n,b:i};return r.a.runKernel(a.cc,u)}})},function(e,t,n){"use strict";n.r(t),n.d(t,"add",(function(){return u}));var r=n(3),a=n(4),s=n(12),o=n(1),i=n(2);const u=Object(i.b)({add_:function(e,t){let n=Object(o.a)(e,"a","add"),i=Object(o.a)(t,"b","add");[n,i]=Object(s.makeTypesMatch)(n,i);const u={a:n,b:i};return r.a.runKernel(a.d,u)}})},function(e,t,n){"use strict";n.d(t,"b",(function(){return s})),n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return u})),n.d(t,"d",(function(){return c}));var r=n(8);const a="tfjsflags";class s{constructor(e){this.global=e,this.flags={},this.flagRegistry={},this.urlFlags={},this.getQueryParams=o,this.populateURLFlags()}setPlatform(e,t){null!=this.platform&&(i().getBool("IS_TEST")||i().getBool("PROD")||console.warn(`Platform ${this.platformName} has already been set. Overwriting the platform with ${e}.`)),this.platformName=e,this.platform=t}registerFlag(e,t,n){if(this.flagRegistry[e]={evaluationFn:t,setHook:n},null!=this.urlFlags[e]){const t=this.urlFlags[e];i().getBool("IS_TEST")||i().getBool("PROD")||console.warn(`Setting feature override from URL ${e}: ${t}.`),this.set(e,t)}}async getAsync(e){return e in this.flags||(this.flags[e]=await this.evaluateFlag(e)),this.flags[e]}get(e){if(e in this.flags)return this.flags[e];const t=this.evaluateFlag(e);if(Object(r.y)(t))throw new Error(`Flag ${e} cannot be synchronously evaluated. Please use getAsync() instead.`);return this.flags[e]=t,this.flags[e]}getNumber(e){return this.get(e)}getBool(e){return this.get(e)}getString(e){return this.get(e)}getFlags(){return this.flags}get features(){return this.flags}set(e,t){if(null==this.flagRegistry[e])throw new Error(`Cannot set flag ${e} as it has not been registered.`);this.flags[e]=t,null!=this.flagRegistry[e].setHook&&this.flagRegistry[e].setHook(t)}evaluateFlag(e){if(null==this.flagRegistry[e])throw new Error(`Cannot evaluate flag '${e}': no evaluation function found.`);return this.flagRegistry[e].evaluationFn()}setFlags(e){this.flags=Object.assign({},e)}reset(){this.flags={},this.urlFlags={},this.populateURLFlags()}populateURLFlags(){if("undefined"==typeof this.global||"undefined"==typeof this.global.location||"undefined"==typeof this.global.location.search)return;const e=this.getQueryParams(this.global.location.search);if(a in e){e.tfjsflags.split(",").forEach((e=>{const[t,n]=e.split(":");this.urlFlags[t]=function(e,t){const n=t.toLowerCase();return"true"===n||"false"===n?"true"===n:""+ +n===n?+n:t}(0,n)}))}}}function o(e){const t={};return e.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,((e,...n)=>(function(e,t,n){e[decodeURIComponent(t)]=decodeURIComponent(n||"")}(t,n[0],n[1]),n.join("=")))),t}function i(){return u}let u=null;function c(e){u=e}},function(e,t,n){"use strict";n.r(t),n.d(t,"makeTypesMatch",(function(){return o})),n.d(t,"assertTypesMatch",(function(){return i})),n.d(t,"isTensorInList",(function(){return u})),n.d(t,"getTensorsInContainer",(function(){return c}));var r=n(17),a=n(32),s=n(8);function o(e,t){if(e.dtype===t.dtype)return[e,t];const n=Object(a.e)(e.dtype,t.dtype);return[e.cast(n),t.cast(n)]}function i(e,t){Object(s.c)(e.dtype===t.dtype,(()=>`The dtypes of the first(${e.dtype}) and second(${t.dtype}) input must match`))}function u(e,t){return t.some((t=>t.id===e.id))}function c(e){const t=[];return l(e,t,new Set),t}function l(e,t,n){if(null==e)return;if(e instanceof r.a)return void t.push(e);if(a=e,!Array.isArray(a)&&"object"!=typeof a)return;var a;const s=e;for(const e in s){const r=s[e];n.has(r)||(n.add(r),l(r,t,n))}}},function(e,t,n){"use strict";n.d(t,"g",(function(){return i})),n.d(t,"f",(function(){return u})),n.d(t,"c",(function(){return c})),n.d(t,"b",(function(){return l})),n.d(t,"e",(function(){return d})),n.d(t,"h",(function(){return p})),n.d(t,"m",(function(){return f})),n.d(t,"n",(function(){return h})),n.d(t,"t",(function(){return m})),n.d(t,"d",(function(){return b})),n.d(t,"l",(function(){return g})),n.d(t,"u",(function(){return y})),n.d(t,"r",(function(){return w})),n.d(t,"o",(function(){return O})),n.d(t,"k",(function(){return v})),n.d(t,"q",(function(){return j})),n.d(t,"i",(function(){return _})),n.d(t,"j",(function(){return S})),n.d(t,"p",(function(){return k})),n.d(t,"a",(function(){return x})),n.d(t,"s",(function(){return E}));var r=n(3),a=n(11),s=n(17),o=n(12);function i(){Object(a.c)().set("PROD",!0)}function u(){Object(a.c)().set("DEBUG",!0)}function c(){Object(a.c)().set("DEPRECATION_WARNINGS_ENABLED",!1),console.warn("TensorFlow.js deprecation warnings have been disabled.")}function l(e){Object(a.c)().getBool("DEPRECATION_WARNINGS_ENABLED")&&console.warn(e+" You can disable deprecation warnings with tf.disableDeprecationWarnings().")}function d(){r.a.disposeVariables()}function p(){return r.a}function f(){return r.a.memory()}function h(e){return r.a.profile(e)}function m(e,t){return r.a.tidy(e,t)}function b(e){Object(o.getTensorsInContainer)(e).forEach((e=>e.dispose()))}function g(e){return r.a.keep(e)}function y(e){return r.a.time(e)}function w(e){return r.a.setBackend(e)}function O(){return r.a.ready()}function v(){return r.a.backendName}function j(e){r.a.removeBackend(e)}function _(e){return r.a.findBackend(e)}function S(e){return r.a.findBackendFactory(e)}function k(e,t,n=1){return r.a.registerBackend(e,t,n)}function x(){return r.a.backend}function E(e,t){Object(a.c)().setPlatform(e,t)}Object(s.d)(l)},function(e,t,n){"use strict";n.d(t,"e",(function(){return a})),n.d(t,"f",(function(){return s})),n.d(t,"g",(function(){return o})),n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return u})),n.d(t,"d",(function(){return c})),n.d(t,"k",(function(){return h})),n.d(t,"i",(function(){return m})),n.d(t,"j",(function(){return b})),n.d(t,"h",(function(){return g})),n.d(t,"a",(function(){return y}));var r=n(8);function a(e,t,n,r,a="NHWC",s){return i(e,[...t,e[3]],n,s,r,null,null,g(a))}function s(e,t,n,r,a,s,o="channelsLast"){const[u,c]=l(t);let d;if("channelsLast"===o)d=[u,c,e[3],e[3]];else{if("channelsFirst"!==o)throw new Error(`Unknown dataFormat ${o}`);d=[u,c,e[1],e[1]]}return i(e,d,n,r,a,s,!1,o)}function o(e,t,n,r,a,s,o="NDHWC"){const[i,c,l]=d(t);let p,f;if("NDHWC"===o)f="channelsLast",p=[i,c,l,e[4],e[4]];else{if("NCDHW"!==o)throw new Error(`Unknown dataFormat ${o}`);f="channelsFirst",p=[i,c,l,e[1],e[1]]}return u(e,p,n,r,a,!1,f,s)}function i(e,t,n,r,a,s,o=!1,i="channelsLast"){let[u,d,h,m]=[-1,-1,-1,-1];if("channelsLast"===i)[u,d,h,m]=e;else{if("channelsFirst"!==i)throw new Error(`Unknown dataFormat ${i}`);[u,m,d,h]=e}const[b,g,,y]=t,[w,O]=l(n),[v,j]=l(r),_=p(b,v),S=p(g,j),{padInfo:k,outHeight:x,outWidth:E}=function(e,t,n,r,a,s,o,i,u){let l,d,p;if("number"==typeof e){l={top:e,bottom:e,left:e,right:e,type:0===e?"VALID":"NUMBER"};const a=function(e,t,n,r,a){null==r&&(r=c(e,t,n));const s=e[0],o=e[1],i=f((s-t+2*r)/n+1,a),u=f((o-t+2*r)/n+1,a);return[i,u]}([t,n],s,r,e,i);d=a[0],p=a[1]}else if("same"===e){d=Math.ceil(t/r),p=Math.ceil(n/a);const e=Math.max(0,(d-1)*r+s-t),i=Math.max(0,(p-1)*a+o-n),u=Math.floor(e/2),c=e-u,f=Math.floor(i/2);l={top:u,bottom:c,left:f,right:i-f,type:"SAME"}}else if("valid"===e)l={top:0,bottom:0,left:0,right:0,type:"VALID"},d=Math.ceil((t-s+1)/r),p=Math.ceil((n-o+1)/a);else{if("object"!=typeof e)throw Error(`Unknown padding parameter: ${e}`);{const c="channelsLast"===u?e[1][0]:e[2][0],h="channelsLast"===u?e[1][1]:e[2][1],m="channelsLast"===u?e[2][0]:e[3][0],b="channelsLast"===u?e[2][1]:e[3][1];l={top:c,bottom:h,left:m,right:b,type:0===c&&0===h&&0===m&&0===b?"VALID":"EXPLICIT"},d=f((t-s+c+h)/r+1,i),p=f((n-o+m+b)/a+1,i)}}return{padInfo:l,outHeight:d,outWidth:p}}(a,d,h,w,O,_,S,s,i),T=o?y*m:y;let N;return"channelsFirst"===i?N=[u,T,x,E]:"channelsLast"===i&&(N=[u,x,E,T]),{batchSize:u,dataFormat:i,inHeight:d,inWidth:h,inChannels:m,outHeight:x,outWidth:E,outChannels:T,padInfo:k,strideHeight:w,strideWidth:O,filterHeight:b,filterWidth:g,effectiveFilterHeight:_,effectiveFilterWidth:S,dilationHeight:v,dilationWidth:j,inShape:e,outShape:N,filterShape:t}}function u(e,t,n,r,a,s=!1,o="channelsLast",i){let[u,l,h,m,b]=[-1,-1,-1,-1,-1];if("channelsLast"===o)[u,l,h,m,b]=e;else{if("channelsFirst"!==o)throw new Error(`Unknown dataFormat ${o}`);[u,b,l,h,m]=e}const[g,y,w,,O]=t,[v,j,_]=d(n),[S,k,x]=d(r),E=p(g,S),T=p(y,k),N=p(w,x),{padInfo:A,outDepth:M,outHeight:I,outWidth:D}=function(e,t,n,r,a,s,o,i,u,l,d){let p,h,m,b;"valid"===e&&(e=0);if("number"==typeof e){p={top:e,bottom:e,left:e,right:e,front:e,back:e,type:0===e?"VALID":"NUMBER"};const g=function(e,t,n,r,a,s){null==a&&(a=c(e,t[0],r[0]));const o=[0,0,0,n];for(let n=0;n<3;n++)e[n]+2*a>=t[n]&&(o[n]=f((e[n]-t[n]+2*a)/r[n]+1,s));return o}([t,n,r,1],[i,u,l],1,[a,s,o],e,d);h=g[0],m=g[1],b=g[2]}else{if("same"!==e)throw Error(`Unknown padding parameter: ${e}`);{h=Math.ceil(t/a),m=Math.ceil(n/s),b=Math.ceil(r/o);const e=(h-1)*a+i-t,c=(m-1)*s+u-n,d=(b-1)*o+l-r,f=Math.floor(e/2),g=e-f,y=Math.floor(c/2),w=c-y,O=Math.floor(d/2);p={top:y,bottom:w,left:O,right:d-O,front:f,back:g,type:"SAME"}}}return{padInfo:p,outDepth:h,outHeight:m,outWidth:b}}(a,l,h,m,v,j,_,E,T,N,i),$=s?O*b:O;let C;return"channelsFirst"===o?C=[u,$,M,I,D]:"channelsLast"===o&&(C=[u,M,I,D,$]),{batchSize:u,dataFormat:o,inDepth:l,inHeight:h,inWidth:m,inChannels:b,outDepth:M,outHeight:I,outWidth:D,outChannels:$,padInfo:A,strideDepth:v,strideHeight:j,strideWidth:_,filterDepth:g,filterHeight:y,filterWidth:w,effectiveFilterDepth:E,effectiveFilterHeight:T,effectiveFilterWidth:N,dilationDepth:S,dilationHeight:k,dilationWidth:x,inShape:e,outShape:C,filterShape:t}}function c(e,t,n,r=1){const a=p(t,r);return Math.floor((e[0]*(n-1)-n+a)/2)}function l(e){return"number"==typeof e?[e,e,e]:2===e.length?[e[0],e[1],1]:e}function d(e){return"number"==typeof e?[e,e,e]:e}function p(e,t){return t<=1?e:e+(e-1)*(t-1)}function f(e,t){if(!t)return Math.trunc(e);switch(t){case"round":return Math.round(e);case"ceil":return Math.ceil(e);case"floor":return Math.floor(e);default:throw new Error(`Unknown roundingMode ${t}`)}}function h(e){const[t,n,r]=l(e);return 1===t&&1===n&&1===r}function m(e,t){return h(e)||h(t)}function b(e){return l(e).every((e=>e>0))}function g(e){if("NHWC"===e)return"channelsLast";if("NCHW"===e)return"channelsFirst";throw new Error(`Unknown dataFormat ${e}`)}function y(e,t,n){if(null!=n){if("string"==typeof t)throw Error(`Error in ${e}: pad must be an integer when using dimRoundingMode ${n} but got pad ${t}.`);if("number"==typeof t)r.c(r.w(t),(()=>`Error in ${e}: pad must be an integer when using dimRoundingMode ${n} but got pad ${t}.`));else{if("object"!=typeof t)throw Error(`Error in ${e}: Unknown padding parameter: ${t}`);t.forEach((t=>{t.forEach((t=>{r.c(r.w(t),(()=>`Error in ${e}: pad must be an integer when using dimRoundingMode ${n} but got pad ${t}.`))}))}))}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(3),a=n(4),s=n(1),o=n(8),i=n(2);const u=Object(i.b)({cast_:function(e,t){const n=Object(s.a)(e,"x","cast");if(!o.B(t))throw new Error(`Failed to cast to unknown dtype ${t}`);if("string"===t&&"string"!==n.dtype||"string"!==t&&"string"===n.dtype)throw new Error("Only strings can be casted to strings");const i={x:n},u={dtype:t};return r.a.runKernel(a.y,i,u)}})},function(e,t,n){"use strict";function r(e,t){const n=e.length,r=[];for(let a=0;a<n;a++){const s=n-1-a,o=e[s]||1;(t[t.length-1-a]||1)>1&&1===o&&r.unshift(s)}return r}function a(e,t){const n=[];for(let r=0;r<t.length;r++){const a=e[e.length-r-1],s=t.length-r-1,o=t[s];(null==a||1===a&&o>1)&&n.unshift(s)}return n}function s(e,t){const n=Math.max(e.length,t.length),r=new Array(n);for(let a=0;a<n;a++){let s=e[e.length-a-1];null==s&&(s=1);let o=t[t.length-a-1];if(null==o&&(o=1),1===s)r[n-a-1]=o;else if(1===o)r[n-a-1]=s;else{if(s!==o){throw Error(`Operands could not be broadcast together with shapes ${e} and ${t}.`)}r[n-a-1]=s}}return r}n.r(t),n.d(t,"getBroadcastDims",(function(){return r})),n.d(t,"getReductionAxes",(function(){return a})),n.d(t,"assertAndGetBroadcastShape",(function(){return s}))},function(e,t,n){"use strict";n.d(t,"b",(function(){return d})),n.d(t,"f",(function(){return m})),n.d(t,"e",(function(){return b})),n.d(t,"d",(function(){return g})),n.d(t,"a",(function(){return y})),n.d(t,"c",(function(){return w}));var r=n(56),a=n(8);function s(e,t,n,r){const s=Object(a.k)(t),i=function(e,t,n,r){const s=Object(a.O)(t),i=r[r.length-1],u=new Array(i).fill(0),l=t.length,d="complex64"===n?c(e):e;if(l>1)for(let e=0;e<s/i;e++){const t=e*i;for(let e=0;e<i;e++)u[e]=Math.max(u[e],o(d[t+e],0,n).length)}return u}(e,t,n,s),l=t.length,d=u(e,t,n,s,i),p=["Tensor"];return r&&(p.push(` dtype: ${n}`),p.push(` rank: ${l}`),p.push(` shape: [${t}]`),p.push(" values:")),p.push(d.map((e=>" "+e)).join("\n")),p.join("\n")}function o(e,t,n){let r;return r=Array.isArray(e)?`${parseFloat(e[0].toFixed(7))} + ${parseFloat(e[1].toFixed(7))}j`:Object(a.A)(e)?`'${e}'`:"bool"===n?i(e):parseFloat(e.toFixed(7)).toString(),Object(a.L)(r,t)}function i(e){return 0===e?"false":"true"}function u(e,t,n,r,a,s=!0){const l="complex64"===n?2:1,d=t[0],p=t.length;if(0===p){if("complex64"===n){return[o(c(e)[0],0,n)]}return"bool"===n?[i(e[0])]:[e[0].toString()]}if(1===p){if(d>20){const t=3*l;let r=Array.from(e.slice(0,t)),s=Array.from(e.slice((d-3)*l,d*l));return"complex64"===n&&(r=c(r),s=c(s)),["["+r.map(((e,t)=>o(e,a[t],n))).join(", ")+", ..., "+s.map(((e,t)=>o(e,a[d-3+t],n))).join(", ")+"]"]}return["["+("complex64"===n?c(e):Array.from(e)).map(((e,t)=>o(e,a[t],n))).join(", ")+"]"]}const f=t.slice(1),h=r.slice(1),m=r[0]*l,b=[];if(d>20){for(let t=0;t<3;t++){const r=t*m,s=r+m;b.push(...u(e.slice(r,s),f,n,h,a,!1))}b.push("...");for(let t=d-3;t<d;t++){const r=t*m,s=r+m;b.push(...u(e.slice(r,s),f,n,h,a,t===d-1))}}else for(let t=0;t<d;t++){const r=t*m,s=r+m;b.push(...u(e.slice(r,s),f,n,h,a,t===d-1))}const g=2===p?",":"";b[0]="["+(d>0?b[0]+g:"");for(let e=1;e<b.length-1;e++)b[e]=" "+b[e]+g;let y=",\n";for(let e=2;e<p;e++)y+="\n";return b[b.length-1]=" "+b[b.length-1]+"]"+(s?"":y),b}function c(e){const t=[];for(let n=0;n<e.length;n+=2)t.push([e[n],e[n+1]]);return t}var l=n(6);class d{constructor(e,t,n){if(this.dtype=t,this.shape=e.slice(),this.size=a.O(e),null!=n){const e=n.length;a.c(e===this.size,(()=>`Length of values '${e}' does not match the size inferred by the shape '${this.size}'.`))}if("complex64"===t)throw new Error("complex64 dtype TensorBuffers are not supported. Please create a TensorBuffer for the real and imaginary parts separately and call tf.complex(real, imag).");this.values=n||a.o(t,this.size),this.strides=Object(a.k)(e)}set(e,...t){0===t.length&&(t=[0]),a.c(t.length===this.rank,(()=>`The number of provided coordinates (${t.length}) must match the rank (${this.rank})`));const n=this.locToIndex(t);this.values[n]=e}get(...e){0===e.length&&(e=[0]);let t=0;for(const n of e){if(n<0||n>=this.shape[t]){const t=`Requested out of range element at ${e}. Buffer shape=${this.shape}`;throw new Error(t)}t++}let n=e[e.length-1];for(let t=0;t<e.length-1;++t)n+=this.strides[t]*e[t];return this.values[n]}locToIndex(e){if(0===this.rank)return 0;if(1===this.rank)return e[0];let t=e[e.length-1];for(let n=0;n<e.length-1;++n)t+=this.strides[n]*e[n];return t}indexToLoc(e){if(0===this.rank)return[];if(1===this.rank)return[e];const t=new Array(this.shape.length);for(let n=0;n<t.length-1;++n)t[n]=Math.floor(e/this.strides[n]),e-=t[n]*this.strides[n];return t[t.length-1]=e,t}get rank(){return this.shape.length}toTensor(){return p().makeTensor(this.values,this.shape,this.dtype)}}let p=null,f=null,h=null;function m(e){p=e}function b(e){f=e}function g(e){h=e}class y{constructor(e,t,n,r){this.kept=!1,this.isDisposedInternal=!1,this.shape=e.slice(),this.dtype=t||"float32",this.size=a.O(e),this.strides=Object(a.k)(e),this.dataId=n,this.id=r,this.rankType=this.rank<5?this.rank.toString():"higher"}get rank(){return this.shape.length}async buffer(){const e=await this.data();return f.buffer(this.shape,this.dtype,e)}bufferSync(){return f.buffer(this.shape,this.dtype,this.dataSync())}async array(){const e=await this.data();return Object(a.U)(this.shape,e,"complex64"===this.dtype)}arraySync(){return Object(a.U)(this.shape,this.dataSync(),"complex64"===this.dtype)}async data(){this.throwIfDisposed();const e=p().read(this.dataId);if("string"===this.dtype){const t=await e;try{return t.map((e=>l.decodeString(e)))}catch(e){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}}return e}dataToGPU(e){return this.throwIfDisposed(),p().readToGPU(this.dataId,e)}dataSync(){this.throwIfDisposed();const e=p().readSync(this.dataId);if("string"===this.dtype)try{return e.map((e=>l.decodeString(e)))}catch(e){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}return e}async bytes(){this.throwIfDisposed();const e=await p().read(this.dataId);return"string"===this.dtype?e:new Uint8Array(e.buffer)}dispose(){this.isDisposed||(p().disposeTensor(this),this.isDisposedInternal=!0)}get isDisposed(){return this.isDisposedInternal}throwIfDisposed(){if(this.isDisposed)throw new Error("Tensor is disposed.")}print(e=!1){return f.print(this,e)}clone(){return this.throwIfDisposed(),f.clone(this)}toString(e=!1){return s(this.dataSync(),this.shape,this.dtype,e)}cast(e){return this.throwIfDisposed(),f.cast(this,e)}variable(e=!0,t,n){return this.throwIfDisposed(),p().makeVariable(this,e,t,n)}}Object.defineProperty(y,Symbol.hasInstance,{value:e=>!!e&&null!=e.data&&null!=e.dataSync&&null!=e.throwIfDisposed}),Object(r.a)("Tensor",(()=>y));class w extends y{constructor(e,t,n,r){super(e.shape,e.dtype,e.dataId,r),this.trainable=t,this.name=n}assign(e){if(e.dtype!==this.dtype)throw new Error(`dtype of the new value (${e.dtype}) and previous value (${this.dtype}) must match`);if(!a.a(e.shape,this.shape))throw new Error(`shape of the new value (${e.shape}) and previous value (${this.shape}) must match`);p().disposeTensor(this),this.dataId=e.dataId,p().incRef(this,null)}dispose(){p().disposeVariable(this),this.isDisposedInternal=!0}}Object.defineProperty(w,Symbol.hasInstance,{value:e=>e instanceof y&&null!=e.assign&&e.assign instanceof Function})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.softmax=t.pad=t.transpose=t.relu=t.stack=t.reshape=t.squeeze=t.stridedSlice=t.tensor1d=t.maximum=t.minimum=t.mean=t.concat=t.sigmoid=t.avgPool=t.relu6=t.add=t.mul=t.fused=void 0;var r=n(9);Object.defineProperty(t,"mul",{enumerable:!0,get:function(){return r.mul}});var a=n(10);Object.defineProperty(t,"add",{enumerable:!0,get:function(){return a.add}});var s=n(67);Object.defineProperty(t,"relu6",{enumerable:!0,get:function(){return s.relu6}});var o=n(66);Object.defineProperty(t,"avgPool",{enumerable:!0,get:function(){return o.avgPool}});var i=n(40);Object.defineProperty(t,"sigmoid",{enumerable:!0,get:function(){return i.sigmoid}});var u=n(22);Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return u.concat}});var c=n(51);Object.defineProperty(t,"mean",{enumerable:!0,get:function(){return c.mean}});var l=n(52);Object.defineProperty(t,"minimum",{enumerable:!0,get:function(){return l.minimum}});var d=n(65);Object.defineProperty(t,"maximum",{enumerable:!0,get:function(){return d.maximum}});var p=n(24);Object.defineProperty(t,"tensor1d",{enumerable:!0,get:function(){return p.tensor1d}});var f=n(85);Object.defineProperty(t,"stridedSlice",{enumerable:!0,get:function(){return f.stridedSlice}});var h=n(54);Object.defineProperty(t,"squeeze",{enumerable:!0,get:function(){return h.squeeze}});var m=n(7);Object.defineProperty(t,"reshape",{enumerable:!0,get:function(){return m.reshape}});var b=n(43);Object.defineProperty(t,"stack",{enumerable:!0,get:function(){return b.stack}});var g=n(45);Object.defineProperty(t,"relu",{enumerable:!0,get:function(){return g.relu}});var y=n(53);Object.defineProperty(t,"transpose",{enumerable:!0,get:function(){return y.transpose}});var w=n(39);Object.defineProperty(t,"pad",{enumerable:!0,get:function(){return w.pad}});var O=n(84);Object.defineProperty(t,"softmax",{enumerable:!0,get:function(){return O.softmax}});var v=n(88),j=n(87),_=n(86);t.fused={conv2d:v.conv2d,depthwiseConv2d:j.depthwiseConv2d,matMul:_.matMul}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(3),a=n(4),s=n(12),o=n(1),i=n(2);const u=Object(i.b)({matMul_:function(e,t,n=!1,i=!1){let u=Object(o.a)(e,"a","matMul"),c=Object(o.a)(t,"b","matMul");[u,c]=Object(s.makeTypesMatch)(u,c);const l={a:u,b:c},d={transposeA:n,transposeB:i};return r.a.runKernel(a.s,l,d)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(3),a=n(4),s=n(1),o=n(15),i=n(2);const u=Object(i.b)({sum_:function(e,t=null,n=!1){let i=Object(s.a)(e,"x","sum");"bool"===i.dtype&&(i=Object(o.a)(i,"int32"));const u={x:i},c={axis:t,keepDims:n};return r.a.runKernel(a.kd,u,c)}})},function(e,t,n){"use strict";(function(e){n.d(t,"f",(function(){return u})),n.d(t,"e",(function(){return c})),n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return h})),n.d(t,"d",(function(){return m})),n.d(t,"c",(function(){return b})),n.d(t,"j",(function(){return g})),n.d(t,"h",(function(){return y})),n.d(t,"g",(function(){return w})),n.d(t,"i",(function(){return O})),n.d(t,"k",(function(){return v}));var r=n(31),a=n(44),s=n(8),o=n(69),i=n(29);async function u(e,t){const n=[],r=[],a=Array.isArray(e)?e.map((e=>e.name)):Object.keys(e);for(let s=0;s<a.length;++s){const o=a[s],i=Array.isArray(e)?e[s].tensor:e[o];if("float32"!==i.dtype&&"int32"!==i.dtype&&"bool"!==i.dtype&&"string"!==i.dtype&&"complex64"!==i.dtype)throw new Error(`Unsupported dtype in weight '${o}': ${i.dtype}`);const u={name:o,shape:i.shape,dtype:i.dtype};if("string"===i.dtype){const e=new Promise((async e=>{const t=await i.bytes(),n=t.reduce(((e,t)=>e+t.length),0)+4*t.length,r=new Uint8Array(n);let a=0;for(let e=0;e<t.length;e++){const n=t[e],s=new Uint8Array(new Uint32Array([n.length]).buffer);r.set(s,a),a+=4,r.set(n,a),a+=n.length}e(r)}));r.push(e)}else r.push(i.data());null!=t&&(u.group=t),n.push(u)}return{data:l(await Promise.all(r)),specs:n}}function c(e,t){const n=new i.a(e),u={};let c,l=0;for(const e of t){const t=e.name,i=e.dtype,d=e.shape,p=Object(s.O)(d);let f;if("quantization"in e){const r=e.quantization;if("uint8"===r.dtype||"uint16"===r.dtype){if(!("min"in r)||!("scale"in r))throw new Error(`Weight ${e.name} with quantization ${r.dtype} doesn't have corresponding metadata min and scale.`)}else{if("float16"!==r.dtype)throw new Error(`Weight ${e.name} has unknown quantization dtype ${r.dtype}. Supported quantization dtypes are: 'uint8', 'uint16', and 'float16'.`);if("float32"!==i)throw new Error(`Weight ${e.name} is quantized with ${r.dtype} which only supports weights of type float32 not ${i}.`)}const a=o.a[r.dtype],s=n.slice(l,l+p*a),u="uint8"===r.dtype?new Uint8Array(s):new Uint16Array(s);if("float32"===i)if("uint8"===r.dtype||"uint16"===r.dtype){f=new Float32Array(u.length);for(let e=0;e<u.length;e++){const t=u[e];f[e]=t*r.scale+r.min}}else{if("float16"!==r.dtype)throw new Error(`Unsupported quantization type ${r.dtype} for weight type float32.`);void 0===c&&(c=j()),f=c(u)}else{if("int32"!==i)throw new Error(`Unsupported dtype in weight '${t}': ${i}`);if("uint8"!==r.dtype&&"uint16"!==r.dtype)throw new Error(`Unsupported quantization type ${r.dtype} for weight type int32.`);f=new Int32Array(u.length);for(let e=0;e<u.length;e++){const t=u[e];f[e]=Math.round(t*r.scale+r.min)}}l+=p*a}else if("string"===i){const t=Object(s.O)(e.shape);f=[];for(let e=0;e<t;e++){const e=new Uint32Array(n.slice(l,l+4))[0];l+=4;const t=new Uint8Array(n.slice(l,l+e));f.push(t),l+=e}}else{const e=o.a[i],s=n.slice(l,l+p*e);if("float32"===i)f=new Float32Array(s);else if("int32"===i)f=new Int32Array(s);else if("bool"===i)f=new Uint8Array(s);else{if("complex64"!==i)throw new Error(`Unsupported dtype in weight '${t}': ${i}`);{f=new Float32Array(s);const e=new Float32Array(f.length/2),n=new Float32Array(f.length/2);for(let t=0;t<e.length;t++)e[t]=f[2*t],n[t]=f[2*t+1];const o=Object(a.a)(e,d,"float32"),i=Object(a.a)(n,d,"float32");u[t]=Object(r.a)(o,i),o.dispose(),i.dispose()}}l+=p*e}"complex64"!==i&&(u[t]=Object(a.a)(f,d,i))}return u}function l(e){if(null===e)throw new Error(`Invalid input value: ${JSON.stringify(e)}`);let t=0;const n=[];e.forEach((e=>{if(t+=e.byteLength,n.push(e.byteLength===e.buffer.byteLength?e:new e.constructor(e)),!(e instanceof Float32Array||e instanceof Int32Array||e instanceof Uint8Array))throw new Error(`Unsupported TypedArray subtype: ${e.constructor.name}`)}));const r=new Uint8Array(t);let a=0;return n.forEach((e=>{r.set(new Uint8Array(e.buffer),a),a+=e.byteLength})),r.buffer}const d="undefined"!=typeof e&&("undefined"==typeof Blob||"undefined"==typeof atob||"undefined"==typeof btoa);function p(t){return d?e.byteLength(t,"utf8"):new Blob([t]).size}function f(t){if(d)return e.from(t).toString("base64");const n=new Uint8Array(t);let r="";for(let e=0,t=n.length;e<t;e++)r+=String.fromCharCode(n[e]);return btoa(r)}function h(t){if(d){const n=e.from(t,"base64");return n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength)}const n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;++e)r.set([n.charCodeAt(e)],e);return r.buffer}function m(e){return i.a.join(e)}function b(e){for(e=e.trim();e.endsWith("/");)e=e.slice(0,e.length-1);const t=e.split("/");return t[t.length-1]}function g(e,t){const n={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,weightsManifest:t};return null!=e.signature&&(n.signature=e.signature),null!=e.userDefinedMetadata&&(n.userDefinedMetadata=e.userDefinedMetadata),null!=e.modelInitializer&&(n.modelInitializer=e.modelInitializer),null!=e.initializerSignature&&(n.initializerSignature=e.initializerSignature),null!=e.trainingConfig&&(n.trainingConfig=e.trainingConfig),n}function y(e,t,n){const r={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy};if(null!=e.trainingConfig&&(r.trainingConfig=e.trainingConfig),null!=e.weightsManifest){if(!t)throw new Error("modelJSON has weightsManifest but weightSpecs is null");if(!n)throw new Error("modelJSON has weightsManifest but weightData is null");r.weightSpecs=t,r.weightData=n}return null!=e.signature&&(r.signature=e.signature),null!=e.userDefinedMetadata&&(r.userDefinedMetadata=e.userDefinedMetadata),null!=e.modelInitializer&&(r.modelInitializer=e.modelInitializer),null!=e.initializerSignature&&(r.initializerSignature=e.initializerSignature),r}async function w(e,t){let n,r;return null!=e.weightsManifest&&([n,r]=await t(e.weightsManifest)),y(e,n,r)}function O(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("Expected JSON model topology, received ArrayBuffer.");return{dateSaved:new Date,modelTopologyType:"JSON",modelTopologyBytes:null==e.modelTopology?0:p(JSON.stringify(e.modelTopology)),weightSpecsBytes:null==e.weightSpecs?0:p(JSON.stringify(e.weightSpecs)),weightDataBytes:null==e.weightData?0:new i.a(e.weightData).byteLength}}function v(e){const t=[];for(const n of e)t.push(...n.weights);return t}function j(){const e=function(){const e=e=>{let t=e<<13,n=0;for(;0==(8388608&t);)n-=8388608,t<<=1;return t&=-8388609,n+=947912704,t|n},t=new Uint32Array(2048);t[0]=0;for(let n=1;n<1024;n++)t[n]=e(n);for(let e=1024;e<2048;e++)t[e]=939524096+(e-1024<<13);return t}(),t=function(){const e=new Uint32Array(64);e[0]=0,e[31]=1199570944,e[32]=2147483648,e[63]=3347054592;for(let t=1;t<31;t++)e[t]=t<<23;for(let t=33;t<63;t++)e[t]=2147483648+(t-32<<23);return e}(),n=function(){const e=new Uint32Array(64);for(let t=0;t<64;t++)e[t]=1024;return e[0]=e[32]=0,e}();return r=>{const a=new ArrayBuffer(4*r.length),s=new Uint32Array(a);for(let a=0;a<r.length;a++){const o=r[a],i=e[n[o>>10]+(1023&o)]+t[o>>10];s[a]=i}return new Float32Array(a)}}}).call(this,n(96).Buffer)},function(e,t,n){"use strict";n.r(t),n.d(t,"concat",(function(){return c}));var r=n(3),a=n(4),s=n(1),o=n(8),i=n(36),u=n(2);const c=Object(u.b)({concat_:function(e,t=0){Object(o.c)(e.length>=1,(()=>"Pass at least one tensor to concat"));const n=Object(s.b)(e,"tensors","concat","string_or_numeric");if("complex64"===n[0].dtype&&n.forEach((e=>{if("complex64"!==e.dtype)throw new Error(`Cannot concatenate complex64 tensors with a tensor\n with dtype ${e.dtype}. `)})),1===n.length)return Object(i.a)(n[0]);const u=n,c={axis:t};return r.a.runKernel(a.D,u,c)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"f",(function(){return d})),n.d(t,"d",(function(){return c})),n.d(t,"e",(function(){return l})),n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return u}));var r=n(3),a=n(17),s=n(1),o=n(8);function i(e){return o.c(o.v(e),(()=>"The f passed in grad(f) must be a function")),(t,n)=>{const a=Object(s.a)(t,"x","tf.grad","string_or_numeric"),i=null!=n?Object(s.a)(n,"dy","tf.grad"):null;return r.a.tidy((()=>{const{value:t,grads:n}=r.a.gradients((()=>e(a)),[a],i);return null!=i&&o.f(t.shape,i.shape,"The shape of dy passed in grad(f)(x, dy) must match the shape returned by f(x)"),f(n),n[0]}))}}function u(e){return o.c(o.v(e),(()=>"The f passed in grads(f) must be a function")),(t,n)=>{o.c(Array.isArray(t),(()=>"The args passed in grads(f)(args) must be an array of `Tensor`s or `TensorLike`s"));const a=Object(s.b)(t,"args","tf.grads","string_or_numeric"),i=null!=n?Object(s.a)(n,"dy","tf.grads"):null;return r.a.tidy((()=>{const{value:t,grads:n}=r.a.gradients((()=>e(...a)),a,i);return null!=i&&o.f(t.shape,i.shape,"The shape of dy passed in grads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),f(n),n}))}}function c(e){return o.c(o.v(e),(()=>"The f passed in valueAndGrad(f) must be a function")),(t,n)=>{o.c(t instanceof a.a,(()=>"The x passed in valueAndGrad(f)(x) must be a tensor")),o.c(null==n||n instanceof a.a,(()=>"The dy passed in valueAndGrad(f)(x, dy) must be a tensor"));const{grads:s,value:i}=r.a.gradients((()=>e(t)),[t],n);return f(s),{grad:s[0],value:i}}}function l(e){return o.c(o.v(e),(()=>"The f passed in valueAndGrads(f) must be a function")),(t,n)=>{o.c(Array.isArray(t)&&t.every((e=>e instanceof a.a)),(()=>"The args passed in valueAndGrads(f)(args) must be array of tensors")),o.c(null==n||n instanceof a.a,(()=>"The dy passed in valueAndGrads(f)(args, dy) must be a tensor"));const s=r.a.gradients((()=>e(...t)),t,n);return null!=n&&o.f(s.value.shape,n.shape,"The shape of dy passed in valueAndGrads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),f(s.grads),s}}function d(e,t){o.c(o.v(e),(()=>"The f passed in variableGrads(f) must be a function")),o.c(null==t||Array.isArray(t)&&t.every((e=>e instanceof a.c)),(()=>"The varList passed in variableGrads(f, varList) must be an array of variables"));const n=null!=t;if(!n){t=[];for(const e in r.a.registeredVariables)t.push(r.a.registeredVariables[e])}const s=n?t.filter((e=>!e.trainable)):null,i=t.length;t=t.filter((e=>e.trainable)),o.c(t.length>0,(()=>`variableGrads() expects at least one of the input variables to be trainable, but none of the ${i} variables is trainable.`));const{value:u,grads:c}=r.a.gradients(e,t,null,!0);o.c(c.some((e=>null!=e)),(()=>"Cannot find a connection between any variable and the result of the loss function y=f(x). Please make sure the operations that use variables are inside the function f passed to minimize().")),o.c(0===u.rank,(()=>`The f passed in variableGrads(f) must return a scalar, but it returned a rank-${u.rank} tensor`));const l={};return t.forEach(((e,t)=>{null!=c[t]&&(l[e.name]=c[t])})),null!=s&&s.forEach((e=>l[e.name]=null)),{value:u,grads:l}}function p(e){return r.a.customGrad(e)}function f(e){if(e.filter((e=>null==e)).length>0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that\n the f you passed encloses all operations that lead from x to y.")}},function(e,t,n){"use strict";n.r(t),n.d(t,"tensor1d",(function(){return o}));var r=n(1),a=n(8),s=n(30);function o(e,t){Object(a.e)(e);const n=Object(r.c)(e,t);if(1!==n.length)throw new Error("tensor1d() requires values to be a flat/TypedArray");return Object(s.a)(e,null,n,t)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"e",(function(){return a})),n.d(t,"d",(function(){return s})),n.d(t,"c",(function(){return o})),n.d(t,"b",(function(){return i}));class r{constructor(){this.saveRouters=[],this.loadRouters=[]}static getInstance(){return null==r.instance&&(r.instance=new r),r.instance}static registerSaveRouter(e){r.getInstance().saveRouters.push(e)}static registerLoadRouter(e){r.getInstance().loadRouters.push(e)}static getSaveHandlers(e){return r.getHandlers(e,"save")}static getLoadHandlers(e,t){return r.getHandlers(e,"load",t)}static getHandlers(e,t,n){const a=[];return("load"===t?r.getInstance().loadRouters:r.getInstance().saveRouters).forEach((t=>{const r=t(e,n);null!==r&&a.push(r)})),a}}const a=e=>r.registerSaveRouter(e),s=e=>r.registerLoadRouter(e),o=e=>r.getSaveHandlers(e),i=(e,t)=>r.getLoadHandlers(e,t)},function(e,t,n){"use strict";n.d(t,"c",(function(){return h})),n.d(t,"b",(function(){return m})),n.d(t,"a",(function(){return b})),n.d(t,"d",(function(){return g}));var r=n(16),a=n(72),s=n(73),o=n(9),i=n(74),u=n(45),c=n(67),l=n(7),d=n(40),p=n(76),f=n(20);function h(e,t,n){if(null==n||"linear"===n)return e;if("relu"===n)return Object(o.mul)(e,Object(p.a)(t));throw new Error(`Cannot compute gradient for fused activation ${n}.`)}function m(e,t){let n=t;const a=r.getReductionAxes(e.shape,t.shape);return a.length>0&&(n=Object(f.a)(n,a)),Object(l.reshape)(n,e.shape)}function b(e,t,n,r){if("linear"===t)return e;if("relu"===t)return Object(u.relu)(e);if("elu"===t)return Object(a.a)(e);if("relu6"===t)return Object(c.relu6)(e);if("prelu"===t)return Object(i.a)(e,n);if("leakyrelu"===t)return Object(s.a)(e,r);if("sigmoid"===t)return Object(d.sigmoid)(e);throw new Error(`Unknown fused activation ${t}.`)}const g=(e,t)=>!(e>0)||"linear"===t},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(3),a=n(4),s=n(1),o=n(2);const i=Object(o.b)({neg_:function(e){const t={x:Object(s.a)(e,"x","neg")};return r.a.runKernel(a.dc,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(17),a=n(8);function s(e,t="float32",n){return t=t||"float32",a.d(e),new r.b(e,t,n)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(6);class a{static join(e){return new a(e).slice()}constructor(e){if(this.shards=[],this.previousShardIndex=0,null==e)return;if(e instanceof Array||(e=[e]),0===(e=e.map((e=>r.isTypedArray(e)?e.buffer:e))).length)return;this.bufferUniformSize=e[0].byteLength;let t=0;for(let n=0;n<e.length;n++){const r=e[n];n!==e.length-1&&r.byteLength!==this.bufferUniformSize&&(this.bufferUniformSize=void 0);const a=t+r.byteLength;this.shards.push({buffer:r,start:t,end:a}),t=a}0===this.shards.length&&(this.byteLength=0),this.byteLength=this.shards[this.shards.length-1].end}slice(e=0,t=this.byteLength){if(0===this.shards.length)return new ArrayBuffer(0);if(e=isNaN(Number(e))?0:e,t=isNaN(Number(t))?0:t,e=Math.max(0,e),(t=Math.min(this.byteLength,t))<=e)return new ArrayBuffer(0);const n=this.findShardForByte(e);if(-1===n)throw new Error(`Could not find start shard for byte ${e}`);const r=new ArrayBuffer(t-e),a=new Uint8Array(r);let s=0;for(let r=n;r<this.shards.length;r++){const n=this.shards[r],o=e+s-n.start,i=s,u=Math.min(t,n.end)-n.start,c=new Uint8Array(n.buffer,o,u-o);if(a.set(c,i),s+=c.length,t<n.end)break}return r}findShardForByte(e){if(0===this.shards.length||e<0||e>=this.byteLength)return-1;if(null!=this.bufferUniformSize)return this.previousShardIndex=Math.floor(e/this.bufferUniformSize),this.previousShardIndex;function t(t){return e<t.start?-1:e>=t.end?1:0}if(0===t(this.shards[this.previousShardIndex]))return this.previousShardIndex;const n=function(e,t){let n=0,r=e.length;for(;n<=r;){const a=Math.floor((r-n)/2)+n,s=t(e[a]);if(0===s)return a;s<0?r=a:n=a+1}return-1}(this.shards,t);return-1===n?-1:(this.previousShardIndex=n,this.previousShardIndex)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(3),a=n(32),s=n(8),o=n(6);function i(e,t,n,i){if(null==i)i=Object(s.s)(e);else if("complex64"===i)throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");if(Object(a.c)(e)||Object(a.b)(e)){if("float32"!==i&&"int32"!==i)throw new Error(`Creating tensor from GPU data only supports 'float32'|'int32' dtype, while the dtype is ${i}.`);return r.a.backend.createTensorFromGPUData(e,t||n,i)}if(!Object(o.isTypedArray)(e)&&!Array.isArray(e)&&"number"!=typeof e&&"boolean"!=typeof e&&"string"!=typeof e)throw new Error("values passed to tensor(values) must be a number/boolean/string or an array of numbers/booleans/strings, or a TypedArray");if(null!=t){Object(s.d)(t);const e=Object(s.O)(t),r=Object(s.O)(n);Object(s.c)(e===r,(()=>`Based on the provided shape, [${t}], the tensor should have ${e} values but has ${r}`));for(let e=0;e<n.length;++e){const r=n[e],a=e!==n.length-1||r!==Object(s.O)(t.slice(e));Object(s.c)(n[e]===t[e]||!a,(()=>`Error creating a new Tensor. Inferred shape (${n}) does not match the provided shape (${t}). `))}}return Object(o.isTypedArray)(e)||Array.isArray(e)||(e=[e]),t=t||n,e="string"!==i?Object(o.toTypedArray)(e,i):Object(o.flatten)(e,[],!0),r.a.makeTensor(e,t,i)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(3),a=n(4),s=n(1),o=n(8),i=n(2);const u=Object(i.b)({complex_:function(e,t){const n=Object(s.a)(e,"real","complex"),i=Object(s.a)(t,"imag","complex");o.f(n.shape,i.shape,`real and imag shapes, ${n.shape} and ${i.shape}, must match in call to tf.complex().`);const u={real:n,imag:i};return r.a.runKernel(a.B,u)}})},function(e,t,n){"use strict";var r,a,s,o,i;n.d(t,"a",(function(){return r})),n.d(t,"e",(function(){return c})),n.d(t,"d",(function(){return l})),n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return p})),function(e){e.R0="R0",e.R1="R1",e.R2="R2",e.R3="R3",e.R4="R4",e.R5="R5",e.R6="R6"}(r||(r={})),function(e){e.float32="float32",e.int32="int32",e.bool="int32",e.complex64="complex64"}(a||(a={})),function(e){e.float32="float32",e.int32="int32",e.bool="bool",e.complex64="complex64"}(s||(s={})),function(e){e.float32="float32",e.int32="float32",e.bool="float32",e.complex64="complex64"}(o||(o={})),function(e){e.float32="complex64",e.int32="complex64",e.bool="complex64",e.complex64="complex64"}(i||(i={}));const u={float32:o,int32:a,bool:s,complex64:i};function c(e,t){if("string"===e||"string"===t){if("string"===e&&"string"===t)return"string";throw new Error(`Can not upcast ${e} with ${t}`)}return u[e][t]}function l(e){return c(e,"int32")}function d(e){return null!=e&&"object"==typeof e&&"texture"in e&&e.texture instanceof WebGLTexture}function p(e){return"undefined"!=typeof GPUBuffer&&null!=e&&"object"==typeof e&&"buffer"in e&&e.buffer instanceof GPUBuffer}},function(e,t,n){"use strict";var r,a;n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return a})),function(e){e[e.float32=0]="float32",e[e.int32=1]="int32",e[e.bool=2]="bool",e[e.string=3]="string",e[e.complex64=4]="complex64"}(r||(r={})),function(e){e[e.linear=0]="linear",e[e.relu=1]="relu",e[e.relu6=2]="relu6",e[e.prelu=3]="prelu",e[e.leakyrelu=4]="leakyrelu",e[e.sigmoid=5]="sigmoid",e[e.elu=6]="elu"}(a||(a={}))},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return x})),n.d(t,"i",(function(){return T})),n.d(t,"c",(function(){return N})),n.d(t,"f",(function(){return A})),n.d(t,"e",(function(){return D})),n.d(t,"d",(function(){return $})),n.d(t,"k",(function(){return R})),n.d(t,"g",(function(){return P})),n.d(t,"h",(function(){return F})),n.d(t,"j",(function(){return B})),n.d(t,"b",(function(){return L}));var r=n(5),a=n(42),s=n(55),o=n(0),i=n(103),u=n(104),c=n(105),l=n(106),d=n(107),p=n(108),f=n(109),h=n(110),m=n(111),b=n(112),g=n(113),y=n(114),w=n(115),O=n(116),v=n(117),j=n(118),_=n(119),S=n(120),k=n(121);class x{static get Instance(){return this._instance||(this._instance=new this)}constructor(){const e=[].concat(...[i,u,c,l,d,p,f,h,m,b,g,y,w,O,v,j,_,S,k].map((e=>e.json)));this.opMappers=e.reduce(((e,t)=>(e[t.tfOpName]=t,e)),{})}transformGraph(e,t={}){const n=e.node,r=[],a=[],s=[],i=n.reduce(((e,t)=>(e[t.name]=this.mapNode(t),t.op.startsWith("Placeholder")?r.push(e[t.name]):"Const"===t.op?a.push(e[t.name]):null!=t.input&&0!==t.input.length||s.push(e[t.name]),e)),{});let u=[];const c=[];let l={},d={};null!=t&&(l=this.mapSignatureEntries(t.inputs),d=this.mapSignatureEntries(t.outputs));const p=Object.keys(i);p.forEach((e=>{const t=i[e];t.inputNames.forEach(((e,n)=>{const[r,,a]=Object(o.b)(e),s=i[r];if(null!=s.outputs){const e=s.outputs.indexOf(a);if(-1!==e){const a=`${r}:${e}`;t.inputNames[n]=a}}t.inputs.push(s),s.children.push(t)}))})),0===Object.keys(d).length?p.forEach((e=>{const t=i[e];0===t.children.length&&c.push(t)})):Object.keys(d).forEach((e=>{const[t]=Object(o.b)(e),n=i[t];null!=n&&(n.signatureKey=d[e],c.push(n))})),Object.keys(l).length>0?Object.keys(l).forEach((e=>{const[t]=Object(o.b)(e),n=i[t];n&&(n.signatureKey=l[e],u.push(n))})):u=r;let f={};null!=e.library&&null!=e.library.function&&(f=e.library.function.reduce(((e,t)=>(e[t.signature.name]=this.mapFunction(t),e)),{}));const h={nodes:i,inputs:u,outputs:c,weights:a,placeholders:r,signature:t,functions:f};return s.length>0&&(h.initNodes=s),h}mapSignatureEntries(e){return Object.keys(e||{}).reduce(((t,n)=>(t[e[n].name]=n,t)),{})}mapNode(e){const t=Object(s.b)(e.op)||this.opMappers[e.op]||{};null==e.attr&&(e.attr={});const n={name:e.name,op:e.op,category:t.category,inputNames:(e.input||[]).map((e=>e.startsWith("^")?e.slice(1):e)),inputs:[],children:[],inputParams:{},attrParams:{},rawAttrs:e.attr,outputs:t.outputs};return null!=t.inputs&&(n.inputParams=t.inputs.reduce(((e,t)=>(e[t.name]={type:t.type,inputIndexStart:t.start,inputIndexEnd:t.end},e)),{})),null!=t.attrs&&(n.attrParams=t.attrs.reduce(((t,n)=>{const r=n.type;let a;switch(n.type){case"string":a=T(e.attr,n.tfName,n.defaultValue),void 0===a&&n.tfDeprecatedName&&(a=T(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"string[]":a=F(e.attr,n.tfName,n.defaultValue),void 0===a&&n.tfDeprecatedName&&(a=F(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"number":a=A(e.attr,n.tfName,n.defaultValue||0),void 0===a&&n.tfDeprecatedName&&(a=A(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"number[]":a=P(e.attr,n.tfName,n.defaultValue),void 0===a&&n.tfDeprecatedName&&(a=P(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool":a=N(e.attr,n.tfName,n.defaultValue),void 0===a&&n.tfDeprecatedName&&(a=N(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool[]":a=L(e.attr,n.tfName,n.defaultValue),void 0===a&&n.tfDeprecatedName&&(a=L(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape":a=R(e.attr,n.tfName,n.defaultValue),void 0===a&&n.tfDeprecatedName&&(a=R(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape[]":a=B(e.attr,n.tfName,n.defaultValue),void 0===a&&n.tfDeprecatedName&&(a=B(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype":a=D(e.attr,n.tfName,n.defaultValue),void 0===a&&n.tfDeprecatedName&&(a=D(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype[]":a=$(e.attr,n.tfName,n.defaultValue),void 0===a&&n.tfDeprecatedName&&(a=$(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"func":a=I(e.attr,n.tfName,n.defaultValue),void 0===a&&n.tfDeprecatedName&&(a=I(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"tensor":case"tensors":break;default:throw new Error(`Unsupported param type: ${n.type} for op: ${e.op}`)}return t[n.name]={value:a,type:r},t}),{})),n}mapFunction(e){const t=e.nodeDef,n=[];let r={};null!=t&&(r=t.reduce(((e,t)=>(e[t.name]=this.mapNode(t),"Const"===t.op&&n.push(e[t.name]),e)),{}));const a=[],s=[];e.signature.inputArg.forEach((e=>{const[t]=Object(o.b)(e.name),n={name:t,op:"Placeholder",inputs:[],inputNames:[],category:"graph",inputParams:{},attrParams:{dtype:{value:M(e.type),type:"dtype"}},children:[]};n.signatureKey=e.name,a.push(n),r[t]=n}));Object.keys(r).forEach((e=>{const t=r[e];t.inputNames.forEach(((e,n)=>{const[a,,s]=Object(o.b)(e),i=r[a];if(null!=i.outputs){const e=i.outputs.indexOf(s);if(-1!==e){const r=`${a}:${e}`;t.inputNames[n]=r}}t.inputs.push(i),i.children.push(t)}))}));const i=e.ret;e.signature.outputArg.forEach((e=>{const[t,n]=Object(o.b)(i[e.name]),a=r[t];null!=a&&(a.defaultOutput=n,s.push(a))}));const u=this.mapArgsToSignature(e);return{nodes:r,inputs:a,outputs:s,weights:n,placeholders:[],signature:u}}mapArgsToSignature(e){return{methodName:e.signature.name,inputs:e.signature.inputArg.reduce(((e,t)=>(e[t.name]=this.mapArgToTensorInfo(t),e)),{}),outputs:e.signature.outputArg.reduce(((t,n)=>(t[n.name]=this.mapArgToTensorInfo(n,e.ret),t)),{})}}mapArgToTensorInfo(e,t){let n=e.name;return null!=t&&(n=t[n]),{name:n,dtype:e.type}}}function E(t,n){const a=Array.isArray(t)?String.fromCharCode.apply(null,t):function(t){const n=Object(r.env)().global;if("undefined"!=typeof n.atob)return n.atob(t);if("undefined"!=typeof e)return new e(t,"base64").toString();throw new Error("Unable to decode base64 in this environment. Missing built-in atob() or Buffer()")}(t);return n?a:a.toLowerCase()}function T(e,t,n,r=!1){const a=e[t];return null!=a?E(a.s,r):n}function N(e,t,n){const r=e[t];return r?r.b:n}function A(e,t,n){const r=e[t]||{},a=null!=r.i?r.i:null!=r.f?r.f:n;return"number"==typeof a?a:parseInt(a,10)}function M(e){switch("string"==typeof e&&(e=a.a[e]),e){case a.a.DT_FLOAT:case a.a.DT_HALF:return"float32";case a.a.DT_INT32:case a.a.DT_INT64:case a.a.DT_INT8:case a.a.DT_UINT8:return"int32";case a.a.DT_BOOL:return"bool";case a.a.DT_DOUBLE:return"float32";case a.a.DT_STRING:return"string";default:return null}}function I(e,t,n){const r=e[t];return r&&r.func?r.func.name:n}function D(e,t,n){const r=e[t];return r&&r.type?M(r.type):n}function $(e,t,n){const r=e[t];return r&&r.list&&r.list.type?r.list.type.map((e=>M(e))):n}function C(e){if(!e.unknownRank)return null!=e.dim?e.dim.map((e=>"number"==typeof e.size?e.size:parseInt(e.size,10))):[]}function R(e,t,n){const r=e[t];return r&&r.shape?C(r.shape):n}function P(e,t,n){const r=e[t];return r?((r.list.f&&r.list.f.length?r.list.f:r.list.i)||[]).map((e=>"number"==typeof e?e:parseInt(e,10))):n}function F(e,t,n,r=!1){const a=e[t];return a&&a.list&&a.list.s?a.list.s.map((e=>E(e,r))):n}function B(e,t,n){const r=e[t];return r&&r.list&&r.list.shape?r.list.shape.map((e=>C(e))):n}function L(e,t,n){const r=e[t];return r&&r.list&&r.list.b?r.list.b:n}}).call(this,n(96).Buffer)},function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(3),a=n(4),s=n(1),o=n(2);const i=Object(o.b)({clone_:function(e){const t={x:Object(s.a)(e,"x","clone","string_or_numeric")};return r.a.runKernel(a.vb,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(5),a=n(33);function s(e,t,n){let s;return{kernelName:e,backendName:"wasm",setupFunc:function(t){s=t.wasm.cwrap(e,null,["number","array","number","number","array","number","number","number"])},kernelFunc:function(e){const{backend:t,inputs:o}=e,{a:i,b:u}=o,c=t.dataIdMap.get(i.dataId).id,l=t.dataIdMap.get(u.dataId).id,d=null!=n?n:i.dtype,p=r.backend_util.assertAndGetBroadcastShape(i.shape,u.shape),f=t.makeOutput(p,d);if(0===r.util.sizeFromShape(p))return f;const h=new Uint8Array(new Int32Array(i.shape).buffer),m=new Uint8Array(new Int32Array(u.shape).buffer),b=t.dataIdMap.get(f.dataId).id;return s(c,h,i.shape.length,l,m,u.shape.length,a.a[i.dtype],b),f}}}},function(e,t,n){"use strict";n.d(t,"c",(function(){return u})),n.d(t,"b",(function(){return c})),n.d(t,"d",(function(){return l})),n.d(t,"f",(function(){return d})),n.d(t,"e",(function(){return p})),n.d(t,"h",(function(){return f})),n.d(t,"g",(function(){return h})),n.d(t,"a",(function(){return m}));var r=n(11),a=n(56),s=n(41);const o=Object(a.a)("kernelRegistry",(()=>new Map)),i=Object(a.a)("gradRegistry",(()=>new Map));function u(e,t){const n=b(e,t);return o.get(n)}function c(e){return i.get(e)}function l(e){const t=o.entries(),n=[];for(;;){const{done:r,value:a}=t.next();if(r)break;const[s,o]=a,[i]=s.split("_");i===e&&n.push(o)}return n}function d(e){const{kernelName:t,backendName:n}=e,r=b(t,n);o.has(r)&&s.b(`The kernel '${t}' for backend '${n}' is already registered`),o.set(r,e)}function p(e){const{kernelName:t}=e;i.has(t)&&Object(r.c)().getBool("DEBUG")&&s.b(`Overriding the gradient for '${t}'`),i.set(t,e)}function f(e,t){const n=b(e,t);if(!o.has(n))throw new Error(`The kernel '${e}' for backend '${t}' is not registered`);o.delete(n)}function h(e){if(!i.has(e))throw new Error(`The gradient '${e}' for backend is not registered`);i.delete(e)}function m(e,t){l(e).forEach((e=>{d(Object.assign({},e,{backendName:t}))}))}function b(e,t){return`${t}_${e}`}},function(e,t,n){"use strict";n.r(t),n.d(t,"pad",(function(){return i}));var r=n(3),a=n(4),s=n(1),o=n(2);const i=Object(o.b)({pad_:function(e,t,n=0){const o=Object(s.a)(e,"x","pad");if(0===o.rank)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");const i={paddings:t,constantValue:n},u={x:o};return r.a.runKernel(a.lc,u,i)}})},function(e,t,n){"use strict";n.r(t),n.d(t,"sigmoid",(function(){return i}));var r=n(3),a=n(4),s=n(1),o=n(2);const i=Object(o.b)({sigmoid_:function(e){const t={x:Object(s.a)(e,"x","sigmoid","float32")};return r.a.runKernel(a.Mc,t)}})},function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s}));var r=n(11);function a(...e){Object(r.c)().getBool("IS_TEST")||Object(r.c)().getBool("PROD")||console.warn(...e)}function s(...e){Object(r.c)().getBool("IS_TEST")||Object(r.c)().getBool("PROD")||console.log(...e)}},function(e,t,n){"use strict";var r,a;n.d(t,"a",(function(){return r})),function(e){e[e.DT_INVALID=0]="DT_INVALID",e[e.DT_FLOAT=1]="DT_FLOAT",e[e.DT_DOUBLE=2]="DT_DOUBLE",e[e.DT_INT32=3]="DT_INT32",e[e.DT_UINT8=4]="DT_UINT8",e[e.DT_INT16=5]="DT_INT16",e[e.DT_INT8=6]="DT_INT8",e[e.DT_STRING=7]="DT_STRING",e[e.DT_COMPLEX64=8]="DT_COMPLEX64",e[e.DT_INT64=9]="DT_INT64",e[e.DT_BOOL=10]="DT_BOOL",e[e.DT_QINT8=11]="DT_QINT8",e[e.DT_QUINT8=12]="DT_QUINT8",e[e.DT_QINT32=13]="DT_QINT32",e[e.DT_BFLOAT16=14]="DT_BFLOAT16",e[e.DT_QINT16=15]="DT_QINT16",e[e.DT_QUINT16=16]="DT_QUINT16",e[e.DT_UINT16=17]="DT_UINT16",e[e.DT_COMPLEX128=18]="DT_COMPLEX128",e[e.DT_HALF=19]="DT_HALF",e[e.DT_RESOURCE=20]="DT_RESOURCE",e[e.DT_VARIANT=21]="DT_VARIANT",e[e.DT_UINT32=22]="DT_UINT32",e[e.DT_UINT64=23]="DT_UINT64",e[e.DT_FLOAT_REF=101]="DT_FLOAT_REF",e[e.DT_DOUBLE_REF=102]="DT_DOUBLE_REF",e[e.DT_INT32_REF=103]="DT_INT32_REF",e[e.DT_UINT8_REF=104]="DT_UINT8_REF",e[e.DT_INT16_REF=105]="DT_INT16_REF",e[e.DT_INT8_REF=106]="DT_INT8_REF",e[e.DT_STRING_REF=107]="DT_STRING_REF",e[e.DT_COMPLEX64_REF=108]="DT_COMPLEX64_REF",e[e.DT_INT64_REF=109]="DT_INT64_REF",e[e.DT_BOOL_REF=110]="DT_BOOL_REF",e[e.DT_QINT8_REF=111]="DT_QINT8_REF",e[e.DT_QUINT8_REF=112]="DT_QUINT8_REF",e[e.DT_QINT32_REF=113]="DT_QINT32_REF",e[e.DT_BFLOAT16_REF=114]="DT_BFLOAT16_REF",e[e.DT_QINT16_REF=115]="DT_QINT16_REF",e[e.DT_QUINT16_REF=116]="DT_QUINT16_REF",e[e.DT_UINT16_REF=117]="DT_UINT16_REF",e[e.DT_COMPLEX128_REF=118]="DT_COMPLEX128_REF",e[e.DT_HALF_REF=119]="DT_HALF_REF",e[e.DT_RESOURCE_REF=120]="DT_RESOURCE_REF",e[e.DT_VARIANT_REF=121]="DT_VARIANT_REF",e[e.DT_UINT32_REF=122]="DT_UINT32_REF",e[e.DT_UINT64_REF=123]="DT_UINT64_REF"}(r||(r={})),function(e){let t;!function(e){e[e.LEGACY=0]="LEGACY",e[e.V1=1]="V1",e[e.V2=2]="V2"}(t=e.CheckpointFormatVersion||(e.CheckpointFormatVersion={}))}(a||(a={}))},function(e,t,n){"use strict";n.r(t),n.d(t,"stack",(function(){return u}));var r=n(3),a=n(4),s=n(1),o=n(8),i=n(2);const u=Object(i.b)({stack_:function(e,t=0){const n=Object(s.b)(e,"tensors","stack","string_or_numeric");o.c(n.length>=1,(()=>"Pass at least one tensor to tf.stack")),n.length>0&&o.c(t<=n[0].rank,(()=>"Axis must be <= rank of the tensor"));const i=n,u={axis:t};return r.a.runKernel(a.kc,i,u)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(1),a=n(30);function s(e,t,n){const s=Object(r.c)(e,n);return Object(a.a)(e,t,s,n)}},function(e,t,n){"use strict";n.r(t),n.d(t,"relu",(function(){return i}));var r=n(3),a=n(4),s=n(1),o=n(2);const i=Object(o.b)({relu_:function(e){const t={x:Object(s.a)(e,"x","relu")};return r.a.runKernel(a.xc,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(3),a=n(4),s=n(1),o=n(2);const i=Object(o.b)({real_:function(e){const t={input:Object(s.a)(e,"input","real")};return r.a.runKernel(a.uc,t)}})},function(e,t,n){"use strict";n.r(t),n.d(t,"reshape",(function(){return a})),n.d(t,"reshapeConfig",(function(){return s}));var r=n(5);function a(e){const{inputs:t,attrs:n}=e,{x:a}=t,{shape:s}=n,o=r.util.sizeFromShape(a.shape),i=r.util.inferFromImplicitShape(s,o);return r.util.assert(o===r.util.sizeFromShape(i),(()=>`new shape: ${i}, old shape: ${a.shape}. New shape and old shape must have the same number of elements.`)),e.backend.incRef(a.dataId),{dataId:a.dataId,shape:i,dtype:a.dtype}}const s={kernelName:r.Reshape,backendName:"wasm",kernelFunc:a}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"d",(function(){return p})),n.d(t,"b",(function(){return d})),n.d(t,"e",(function(){return l})),n.d(t,"c",(function(){return c}));var r=n(8),a=n(25);const s="://";class o{constructor(){this.managers={}}static getInstance(){return null==o.instance&&(o.instance=new o),o.instance}static registerManager(e,t){Object(r.c)(null!=e,(()=>"scheme must not be undefined or null.")),e.endsWith(s)&&(e=e.slice(0,e.indexOf(s))),Object(r.c)(e.length>0,(()=>"scheme must not be an empty string."));const n=o.getInstance();Object(r.c)(null==n.managers[e],(()=>`A model store manager is already registered for scheme '${e}'.`)),n.managers[e]=t}static getManager(e){const t=o.getInstance().managers[e];if(null==t)throw new Error(`Cannot find model manager for scheme '${e}'`);return t}static getSchemes(){return Object.keys(o.getInstance().managers)}}function i(e){if(-1===e.indexOf(s))throw new Error(`The url string provided does not contain a scheme. Supported schemes are: ${o.getSchemes().join(",")}`);return{scheme:e.split(s)[0],path:e.split(s)[1]}}async function u(e,t,n=!1){Object(r.c)(e!==t,(()=>`Old path and new path are the same: '${e}'`));const s=a.a.getLoadHandlers(e);Object(r.c)(s.length>0,(()=>`Copying failed because no load handler is found for source URL ${e}.`)),Object(r.c)(s.length<2,(()=>`Copying failed because more than one (${s.length}) load handlers for source URL ${e}.`));const u=s[0],c=a.a.getSaveHandlers(t);Object(r.c)(c.length>0,(()=>`Copying failed because no save handler is found for destination URL ${t}.`)),Object(r.c)(c.length<2,(()=>`Copying failed because more than one (${s.length}) save handlers for destination URL ${t}.`));const l=c[0],d=i(e).scheme,p=i(e).path,f=d===i(e).scheme,h=await u.load();n&&f&&await o.getManager(d).removeModel(p);const m=await l.save(h);return n&&!f&&await o.getManager(d).removeModel(p),m.modelArtifactsInfo}async function c(){const e=o.getSchemes(),t={};for(const n of e){const e=await o.getManager(n).listModels();for(const r in e){t[n+s+r]=e[r]}}return t}async function l(e){const t=i(e);return o.getManager(t.scheme).removeModel(t.path)}async function d(e,t){return u(e,t,!1)}async function p(e,t){return u(e,t,!0)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(3),a=n(4),s=n(1),o=n(8),i=n(14),u=n(2),c=n(7);const l=Object(u.b)({conv2d_:function(e,t,n,u,l="NHWC",d=[1,1],p){const f=Object(s.a)(e,"x","conv2d","float32"),h=Object(s.a)(t,"filter","conv2d","float32");let m=f,b=!1;3===f.rank&&(b=!0,m=Object(c.reshape)(f,[1,f.shape[0],f.shape[1],f.shape[2]])),o.c(4===m.rank,(()=>`Error in conv2d: input must be rank 4, but got rank ${m.rank}.`)),o.c(4===h.rank,(()=>`Error in conv2d: filter must be rank 4, but got rank ${h.rank}.`)),i.a("conv2d",u,p);const g="NHWC"===l?m.shape[3]:m.shape[1];o.c(g===h.shape[2],(()=>`Error in conv2d: depth of input (${g}) must match input depth for filter ${h.shape[2]}.`)),o.c(i.i(n,d),(()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${d}'`)),o.c(i.j(d),(()=>"Error in conv2D: Dilated rates should be larger than 0.")),o.c(i.j(n),(()=>"Error in conv2D: Strides should be larger than 0."));const y={x:m,filter:h},w={strides:n,pad:u,dataFormat:l,dilations:d,dimRoundingMode:p},O=r.a.runKernel(a.E,y,w);return b?Object(c.reshape)(O,[O.shape[1],O.shape[2],O.shape[3]]):O}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(3),a=n(4),s=n(1),o=n(2);const i=Object(o.b)({imag_:function(e){const t={input:Object(s.a)(e,"input","imag")};return r.a.runKernel(a.wb,t)}})},function(e,t,n){"use strict";n.r(t),n.d(t,"mean",(function(){return i}));var r=n(3),a=n(4),s=n(1),o=n(2);const i=Object(o.b)({mean_:function(e,t=null,n=!1){const o={x:Object(s.a)(e,"x","mean")},i={axis:t,keepDims:n};return r.a.runKernel(a.Wb,o,i)}})},function(e,t,n){"use strict";n.r(t),n.d(t,"minimum",(function(){return l}));var r=n(3),a=n(4),s=n(12),o=n(1),i=n(16),u=n(15),c=n(2);const l=Object(c.b)({minimum_:function(e,t){let n=Object(o.a)(e,"a","minimum"),c=Object(o.a)(t,"b","minimum");[n,c]=Object(s.makeTypesMatch)(n,c),"bool"===n.dtype&&(n=Object(u.a)(n,"int32"),c=Object(u.a)(c,"int32")),Object(i.assertAndGetBroadcastShape)(n.shape,c.shape);const l={a:n,b:c};return r.a.runKernel(a.Yb,l)}})},function(e,t,n){"use strict";n.r(t),n.d(t,"transpose",(function(){return f}));var r=n(3),a=n(13),s=n(4),o=n(1),i=n(8),u=n(31),c=n(50),l=n(27),d=n(2),p=n(46);const f=Object(d.b)({transpose_:function(e,t,n){const d=Object(o.a)(e,"x","transpose");if(null==t&&(t=d.shape.map(((e,t)=>t)).reverse()),i.c(d.rank===t.length,(()=>`Error in transpose: rank of input ${d.rank} must match length of perm ${t}.`)),t.forEach((e=>{i.c(e>=0&&e<d.rank,(()=>"All entries in 'perm' must be between 0 and "+(d.rank-1)+` but got ${t}`))})),d.rank<=1)return d.clone();const f={x:d},h={perm:t};return"complex64"===d.dtype?Object(a.t)((()=>{let e=Object(p.a)(d),t=Object(c.a)(d);return e=r.a.runKernel(s.rd,{x:e},h),t=r.a.runKernel(s.rd,{x:t},h),n&&(t=Object(l.a)(t)),Object(u.a)(e,t)})):r.a.runKernel(s.rd,f,h)}})},function(e,t,n){"use strict";n.r(t),n.d(t,"squeeze",(function(){return i}));var r=n(1),a=n(8),s=n(2),o=n(7);const i=Object(s.b)({squeeze_:function(e,t){const n=Object(r.a)(e,"x","squeeze","string_or_numeric");return Object(o.reshape)(n,Object(a.Q)(n.shape,t).newShape)}})},function(e,t,n){"use strict";n.d(t,"c",(function(){return a})),n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return o}));const r={};function a(e,t){const n={tfOpName:e,category:"custom",inputs:[],attrs:[],customExecutor:t};r[e]=n}function s(e){return r[e]}function o(e){delete r[e]}},function(e,t,n){"use strict";(function(e,r){let a;function s(){if(null==a){let t;if("undefined"!=typeof window)t=window;else if("undefined"!=typeof e)t=e;else if("undefined"!=typeof r)t=r;else{if("undefined"==typeof self)throw new Error("Could not find a global object");t=self}a=t}return a}function o(e,t){const n=function(){const e=s();return null==e._tfGlobals&&(e._tfGlobals=new Map),e._tfGlobals}();if(n.has(e))return n.get(e);{const r=t();return n.set(e,r),n.get(e)}}n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return o}))}).call(this,n(63),n(58))},,function(e,t){var n,r,a=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(n===setTimeout)return setTimeout(e,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(e){n=s}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var u,c=[],l=!1,d=-1;function p(){l&&u&&(l=!1,u.length?c=u.concat(c):d=-1,c.length&&f())}function f(){if(!l){var e=i(p);l=!0;for(var t=c.length;t;){for(u=c,c=[];++d<t;)u&&u[d].run();d=-1,t=c.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function m(){}a.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new h(e,t)),1!==c.length||l||i(f)},h.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=m,a.addListener=m,a.once=m,a.off=m,a.removeListener=m,a.removeAllListeners=m,a.emit=m,a.prependListener=m,a.prependOnceListener=m,a.listeners=function(e){return[]},a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){(function(t){e.exports=t}).call(this,{})},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(3),a=n(4),s=n(1),o=n(8),i=n(14),u=n(2),c=n(7);const l=Object(u.b)({depthwiseConv2d_:function(e,t,n,u,l="NHWC",d=[1,1],p){const f=Object(s.a)(e,"x","depthwiseConv2d","float32"),h=Object(s.a)(t,"filter","depthwiseConv2d","float32");let m=f,b=!1;3===f.rank&&(b=!0,m=Object(c.reshape)(f,[1,f.shape[0],f.shape[1],f.shape[2]])),o.c(4===m.rank,(()=>`Error in depthwiseConv2d: input must be rank 4, but got rank ${m.rank}.`)),o.c(4===h.rank,(()=>`Error in depthwiseConv2d: filter must be rank 4, but got rank ${h.rank}.`));const g="NHWC"===l?m.shape[3]:m.shape[1];o.c(g===h.shape[2],(()=>`Error in depthwiseConv2d: number of input channels (${g}) must match the inChannels dimension in filter ${h.shape[2]}.`)),i.a("depthwiseConv2d",u,p);const y={x:m,filter:h},w={strides:n,pad:u,dataFormat:l,dilations:d,dimRoundingMode:p},O=r.a.runKernel(a.R,y,w);return b?Object(c.reshape)(O,[O.shape[1],O.shape[2],O.shape[3]]):O}})},function(e,t,n){"use strict";(function(e){n(3);var t=n(71),r=n(11);const a=Object(r.c)();a.registerFlag("DEBUG",(()=>!1),(e=>{e&&console.warn("Debugging mode is ON. The output of every math call will be downloaded to CPU and checked for NaNs. This significantly impacts performance.")})),a.registerFlag("IS_BROWSER",(()=>t.isBrowser())),a.registerFlag("IS_NODE",(()=>"undefined"!=typeof e&&"undefined"!=typeof e.versions&&"undefined"!=typeof e.versions.node)),a.registerFlag("IS_CHROME",(()=>"undefined"!=typeof navigator&&null!=navigator&&null!=navigator.userAgent&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor))),a.registerFlag("IS_SAFARI",(()=>"undefined"!=typeof navigator&&null!=navigator&&null!=navigator.userAgent&&/Safari/.test(navigator.userAgent)&&/Apple/.test(navigator.vendor))),a.registerFlag("PROD",(()=>!1)),a.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY",(()=>a.getBool("DEBUG"))),a.registerFlag("DEPRECATION_WARNINGS_ENABLED",(()=>!0)),a.registerFlag("IS_TEST",(()=>!1)),a.registerFlag("CHECK_COMPUTATION_FOR_ERRORS",(()=>a.getBool("DEBUG"))),a.registerFlag("WRAP_TO_IMAGEBITMAP",(()=>!1)),a.registerFlag("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU",(()=>!1)),a.registerFlag("USE_SETTIMEOUTCUSTOM",(()=>!1))}).call(this,n(58))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return a}));class r{constructor(e,t){this.backend=e,this.dataMover=t,this.data=new WeakMap,this.dataIdsCount=0}get(e){return this.data.has(e)||this.dataMover.moveData(this.backend,e),this.data.get(e)}set(e,t){this.dataIdsCount++,this.data.set(e,t)}has(e){return this.data.has(e)}delete(e){return this.dataIdsCount--,this.data.delete(e)}numDataIds(){return this.dataIdsCount}}class a{refCount(e){return s("refCount")}incRef(e){return s("incRef")}timerAvailable(){return!0}time(e){return s("time")}read(e){return s("read")}readSync(e){return s("readSync")}readToGPU(e,t){return s("readToGPU")}numDataIds(){return s("numDataIds")}disposeData(e,t){return s("disposeData")}write(e,t,n){return s("write")}move(e,t,n,r,a){return s("move")}createTensorFromGPUData(e,t,n){return s("createTensorFromGPUData")}memory(){return s("memory")}floatPrecision(){return s("floatPrecision")}epsilon(){return 32===this.floatPrecision()?1e-7:1e-4}dispose(){return s("dispose")}}function s(e){throw new Error(`'${e}' not yet implemented or not found in the registry. This kernel may not be supported by the tfjs backend you have chosen`)}},function(e,t,n){"use strict";n.r(t),n.d(t,"maximum",(function(){return l}));var r=n(3),a=n(4),s=n(12),o=n(1),i=n(16),u=n(15),c=n(2);const l=Object(c.b)({maximum_:function(e,t){let n=Object(o.a)(e,"a","maximum"),c=Object(o.a)(t,"b","maximum");[n,c]=Object(s.makeTypesMatch)(n,c),"bool"===n.dtype&&(n=Object(u.a)(n,"int32"),c=Object(u.a)(c,"int32")),Object(i.assertAndGetBroadcastShape)(n.shape,c.shape);const l={a:n,b:c};return r.a.runKernel(a.Vb,l)}})},function(e,t,n){"use strict";n.r(t),n.d(t,"avgPool",(function(){return d}));var r=n(3),a=n(4),s=n(1),o=n(8),i=n(15),u=n(14),c=n(2),l=n(7);const d=Object(c.b)({avgPool_:function(e,t,n,c,d){const p=Object(s.a)(e,"x","avgPool","float32");o.c(u.i(n,1),(()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${n} and dilations '1'`));let f=p,h=!1;3===p.rank&&(h=!0,f=Object(l.reshape)(p,[1,p.shape[0],p.shape[1],p.shape[2]])),o.c(4===f.rank,(()=>`Error in avgPool: x must be rank 4 but got rank ${f.rank}.`)),u.a("avgPool",c,d);const m={x:f},b={filterSize:t,strides:n,pad:c,dimRoundingMode:d};let g=r.a.runKernel(a.o,m,b);return g=Object(i.a)(g,p.dtype),h?Object(l.reshape)(g,[g.shape[1],g.shape[2],g.shape[3]]):g}})},function(e,t,n){"use strict";n.r(t),n.d(t,"relu6",(function(){return i}));var r=n(3),a=n(4),s=n(1),o=n(2);const i=Object(o.b)({relu6_:function(e){const t={x:Object(s.a)(e,"x","relu6")};return r.a.runKernel(a.yc,t)}})},function(e,t,n){"use strict";n.r(t),n.d(t,"identity",(function(){return a})),n.d(t,"identityConfig",(function(){return s}));var r=n(5);function a(e){const{inputs:{x:t},backend:n}=e;if("string"===t.dtype)return Object(r.tensor)(n.readSync(t.dataId),t.shape,t.dtype);const a=n.makeOutput(t.shape,t.dtype),s=n.typedArrayFromHeap(t);return n.typedArrayFromHeap(a).set(s),a}const s={kernelName:r.Identity,backendName:"wasm",kernelFunc:a}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r={float32:4,float16:2,int32:4,uint16:2,uint8:1,bool:1,complex64:8}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return s}));var r=n(5);function a(e,t,n,a){const s=r.util.getArrayFromDType(n,r.util.sizeFromShape(t));if(a&&"string"!==n){let t=0;e.forEach((e=>{const n=r.util.sizeFromShape(e.shape);s.set(e.vals,t),t+=n}))}else{let a=0;e.forEach((e=>{const o="string"===n?r.backend_util.fromUint8ToStringArray(e.vals):e.vals;let i=0;for(let n=0;n<e.shape[0];++n){const r=n*t[1]+a;for(let t=0;t<e.shape[1];++t)s[r+t]=o[i++]}a+=e.shape[1]}))}return s}function s(e,t,n,a,s){const o=r.slice_util.isSliceContinous(a,t,n),i=r.util.sizeFromShape(n),u=r.util.computeStrides(a);if(o){const n=r.slice_util.computeFlatOffset(t,u);return"string"===s?e.slice(n,n+i):e.subarray(n,n+i)}const c="string"===s?r.backend_util.fromUint8ToStringArray(e):e,l=Object(r.buffer)(a,s,c),d=Object(r.buffer)(n,s);for(let e=0;e<d.size;++e){const n=d.indexToLoc(e),r=n.map(((e,n)=>e+t[n]));d.set(l.get(...r),...n)}return"string"===s?r.backend_util.fromStringArrayToUint8(d.values):d.values}r.Slice},function(e,t,n){"use strict";let r;function a(e){r=e}function s(e){if(void 0!==r)return r;if(e||"undefined"!=typeof navigator&&null!=navigator){if(e||(e=navigator),"ReactNative"===e.product)return!0;const t=e.userAgent||e.vendor||("undefined"!=typeof window?window.opera:"");if(!t){const t=e;return t.userAgentData&&t.userAgentData.mobile}return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))}return!1}function o(){return"undefined"!=typeof window&&null!=window.document||"undefined"!=typeof WorkerGlobalScope}n.r(t),n.d(t,"mockIsMobile",(function(){return a})),n.d(t,"isMobile",(function(){return s})),n.d(t,"isBrowser",(function(){return o}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(3),a=n(4),s=n(1),o=n(2);const i=Object(o.b)({elu_:function(e){const t={x:Object(s.a)(e,"x","elu","float32")};return r.a.runKernel(a.ab,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(3),a=n(4),s=n(1),o=n(2);const i=Object(o.b)({leakyRelu_:function(e,t=.2){const n={x:Object(s.a)(e,"x","leakyRelu")},o={alpha:t};return r.a.runKernel(a.Cb,n,o)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(3),a=n(4),s=n(1),o=n(2);const i=Object(o.b)({prelu_:function(e,t){const n={x:Object(s.a)(e,"x","prelu"),alpha:Object(s.a)(t,"alpha","prelu")};return r.a.runKernel(a.oc,n)}})},function(e,t,n){"use strict";function r(e,t=!1){console.log(e.toString(t))}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(3),a=n(4),s=n(1),o=n(2);const i=Object(o.b)({step_:function(e,t=0){const n={x:Object(s.a)(e,"x","step")},o={alpha:t};return r.a.runKernel(a.ed,n,o)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return h}));n(62);var r=n(11),a=n(21),s=n(25),o=n(29);const i="tensorflowjs",u="models_store",c="model_info_store";function l(){if(!Object(r.c)().getBool("IS_BROWSER"))throw new Error("Failed to obtain IndexedDB factory because the current environmentis not a web browser.");const e="undefined"==typeof window?self:window,t=e.indexedDB||e.mozIndexedDB||e.webkitIndexedDB||e.msIndexedDB||e.shimIndexedDB;if(null==t)throw new Error("The current browser does not appear to support IndexedDB.");return t}function d(e){const t=e.result;t.createObjectStore(u,{keyPath:"modelPath"}),t.createObjectStore(c,{keyPath:"modelPath"})}class p{constructor(e){if(this.indexedDB=l(),null==e||!e)throw new Error("For IndexedDB, modelPath must not be null, undefined or empty.");this.modelPath=e}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");return this.databaseAction(this.modelPath,e)}async load(){return this.databaseAction(this.modelPath)}databaseAction(e,t){return new Promise(((e,n)=>{const r=this.indexedDB.open(i,1);r.onupgradeneeded=()=>d(r),r.onsuccess=()=>{const s=r.result;if(null==t){const t=s.transaction(u,"readonly"),r=t.objectStore(u).get(this.modelPath);r.onsuccess=()=>{if(null==r.result)return s.close(),n(new Error(`Cannot find model with path '${this.modelPath}' in IndexedDB.`));e(r.result.modelArtifacts)},r.onerror=e=>(s.close(),n(r.error)),t.oncomplete=()=>s.close()}else{t.weightData=o.a.join(t.weightData);const r=Object(a.i)(t),i=s.transaction(c,"readwrite");let l,d,p=i.objectStore(c);try{l=p.put({modelPath:this.modelPath,modelArtifactsInfo:r})}catch(e){return n(e)}l.onsuccess=()=>{d=s.transaction(u,"readwrite");const a=d.objectStore(u);let o;try{o=a.put({modelPath:this.modelPath,modelArtifacts:t,modelArtifactsInfo:r})}catch(e){return n(e)}o.onsuccess=()=>e({modelArtifactsInfo:r}),o.onerror=e=>{p=i.objectStore(c);const t=p.delete(this.modelPath);t.onsuccess=()=>(s.close(),n(o.error)),t.onerror=e=>(s.close(),n(o.error))}},l.onerror=e=>(s.close(),n(l.error)),i.oncomplete=()=>{null==d?s.close():d.oncomplete=()=>s.close()}}},r.onerror=e=>n(r.error)}))}}p.URL_SCHEME="indexeddb://";const f=e=>{return Object(r.c)().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(p.URL_SCHEME)?(t=e.slice(p.URL_SCHEME.length),new p(t)):null;var t};s.a.registerSaveRouter(f),s.a.registerLoadRouter(f);class h{constructor(){this.indexedDB=l()}async listModels(){return new Promise(((e,t)=>{const n=this.indexedDB.open(i,1);n.onupgradeneeded=()=>d(n),n.onsuccess=()=>{const r=n.result,a=r.transaction(c,"readonly"),s=a.objectStore(c).getAll();s.onsuccess=()=>{const t={};for(const e of s.result)t[e.modelPath]=e.modelArtifactsInfo;e(t)},s.onerror=e=>(r.close(),t(s.error)),a.oncomplete=()=>r.close()},n.onerror=e=>t(n.error)}))}async removeModel(e){var t;return e=(t=e).startsWith(p.URL_SCHEME)?t.slice(p.URL_SCHEME.length):t,new Promise(((t,n)=>{const r=this.indexedDB.open(i,1);r.onupgradeneeded=()=>d(r),r.onsuccess=()=>{const a=r.result,s=a.transaction(c,"readwrite"),o=s.objectStore(c),i=o.get(e);let l;i.onsuccess=()=>{if(null==i.result)return a.close(),n(new Error(`Cannot find model with path '${e}' in IndexedDB.`));{const r=o.delete(e),s=()=>{l=a.transaction(u,"readwrite");const r=l.objectStore(u).delete(e);r.onsuccess=()=>t(i.result.modelArtifactsInfo),r.onerror=e=>n(i.error)};r.onsuccess=s,r.onerror=e=>(s(),a.close(),n(i.error))}},i.onerror=e=>(a.close(),n(i.error)),s.oncomplete=()=>{null==l?a.close():l.oncomplete=()=>a.close()}},r.onerror=e=>n(r.error)}))}}},function(e,t,n){"use strict";function r(e){return e instanceof Float32Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return y})),n.d(t,"b",(function(){return O}));n(62);var r=n(11),a=n(8),s=n(21),o=n(29),i=n(25);const u="/",c="tensorflowjs_models",l="info",d="model_topology",p="weight_specs",f="weight_data",h="model_metadata";function m(e){return{info:[c,e,l].join(u),topology:[c,e,d].join(u),weightSpecs:[c,e,p].join(u),weightData:[c,e,f].join(u),modelMetadata:[c,e,h].join(u)}}function b(e){for(const t of Object.values(e))window.localStorage.removeItem(t)}function g(e){const t=e.split(u);if(t.length<3)throw new Error(`Invalid key format: ${e}`);return t.slice(1,t.length-1).join(u)}class y{constructor(e){if(!Object(r.c)().getBool("IS_BROWSER")||"undefined"==typeof window||"undefined"==typeof window.localStorage)throw new Error("The current environment does not support local storage.");if(this.LS=window.localStorage,null==e||!e)throw new Error("For local storage, modelPath must not be null, undefined or empty.");this.modelPath=e,this.keys=m(this.modelPath)}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");{const t=JSON.stringify(e.modelTopology),n=JSON.stringify(e.weightSpecs),r=Object(s.i)(e),a=o.a.join(e.weightData);try{this.LS.setItem(this.keys.info,JSON.stringify(r)),this.LS.setItem(this.keys.topology,t),this.LS.setItem(this.keys.weightSpecs,n),this.LS.setItem(this.keys.weightData,Object(s.a)(a));const o={format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,signature:null!=e.signature?e.signature:void 0,userDefinedMetadata:null!=e.userDefinedMetadata?e.userDefinedMetadata:void 0,modelInitializer:null!=e.modelInitializer?e.modelInitializer:void 0,initializerSignature:null!=e.initializerSignature?e.initializerSignature:void 0,trainingConfig:null!=e.trainingConfig?e.trainingConfig:void 0};return this.LS.setItem(this.keys.modelMetadata,JSON.stringify(o)),{modelArtifactsInfo:r}}catch(e){throw b(this.keys),new Error(`Failed to save model '${this.modelPath}' to local storage: size quota being exceeded is a possible cause of this failure: modelTopologyBytes=${r.modelTopologyBytes}, weightSpecsBytes=${r.weightSpecsBytes}, weightDataBytes=${r.weightDataBytes}.`)}}}async load(){const e=JSON.parse(this.LS.getItem(this.keys.info));if(null==e)throw new Error(`In local storage, there is no model with name '${this.modelPath}'`);if("JSON"!==e.modelTopologyType)throw new Error("BrowserLocalStorage does not support loading non-JSON model topology yet.");const t={},n=JSON.parse(this.LS.getItem(this.keys.topology));if(null==n)throw new Error(`In local storage, the topology of model '${this.modelPath}' is missing.`);t.modelTopology=n;const r=JSON.parse(this.LS.getItem(this.keys.weightSpecs));if(null==r)throw new Error(`In local storage, the weight specs of model '${this.modelPath}' are missing.`);t.weightSpecs=r;const a=this.LS.getItem(this.keys.modelMetadata);if(null!=a){const e=JSON.parse(a);t.format=e.format,t.generatedBy=e.generatedBy,t.convertedBy=e.convertedBy,null!=e.signature&&(t.signature=e.signature),null!=e.userDefinedMetadata&&(t.userDefinedMetadata=e.userDefinedMetadata),null!=e.modelInitializer&&(t.modelInitializer=e.modelInitializer),null!=e.initializerSignature&&(t.initializerSignature=e.initializerSignature),null!=e.trainingConfig&&(t.trainingConfig=e.trainingConfig)}const o=this.LS.getItem(this.keys.weightData);if(null==o)throw new Error(`In local storage, the binary weight values of model '${this.modelPath}' are missing.`);return t.weightData=Object(s.b)(o),t}}y.URL_SCHEME="localstorage://";const w=e=>{return Object(r.c)().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(y.URL_SCHEME)?(t=e.slice(y.URL_SCHEME.length),new y(t)):null;var t};i.a.registerSaveRouter(w),i.a.registerLoadRouter(w);class O{constructor(){Object(a.c)(Object(r.c)().getBool("IS_BROWSER"),(()=>"Current environment is not a web browser")),Object(a.c)("undefined"==typeof window||"undefined"!=typeof window.localStorage,(()=>"Current browser does not appear to support localStorage")),this.LS=window.localStorage}async listModels(){const e={},t=c+u,n=u+l;for(let r=0;r<this.LS.length;++r){const a=this.LS.key(r);if(a.startsWith(t)&&a.endsWith(n)){e[g(a)]=JSON.parse(this.LS.getItem(a))}}return e}async removeModel(e){var t;const n=m(e=(t=e).startsWith(y.URL_SCHEME)?t.slice(y.URL_SCHEME.length):t);if(null==this.LS.getItem(n.info))throw new Error(`Cannot find model at path '${e}'`);const r=JSON.parse(this.LS.getItem(n.info));return b(n),r}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(3),a=n(4),s=n(8),o=n(14),i=n(2),u=n(7);const c=Object(i.b)({conv2DBackpropInput_:function(e,t,n,i,c,l="NHWC",d){s.c(e.length===t.rank,(()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`));let p=e,f=t,h=!1;3===t.rank&&(h=!0,f=Object(u.reshape)(t,[1,t.shape[0],t.shape[1],t.shape[2]]),p=[1,e[0],e[1],e[2]]),s.c(4===p.length,(()=>`Error in conv2dDerInput: inShape must be length 4, but got length ${p.length}.`)),s.c(4===f.rank,(()=>`Error in conv2dDerInput: dy must be rank 4, but got rank ${f.rank}`)),s.c(4===n.rank,(()=>`Error in conv2dDerInput: filter must be rank 4, but got rank ${n.rank}`));const m="NHWC"===l?p[3]:p[1],b="NHWC"===l?f.shape[3]:f.shape[1];s.c(m===n.shape[2],(()=>`Error in conv2dDerInput: depth of input (${m}) must match input depth for filter ${n.shape[2]}.`)),s.c(b===n.shape[3],(()=>`Error in conv2dDerInput: depth of output (${b}) must match output depth for filter ${n.shape[3]}.`)),o.a("conv2dDerInput",c,d);const g={dy:f,filter:n},y={strides:i,pad:c,dataFormat:l,dimRoundingMode:d,inputShape:p},w=r.a.runKernel(a.G,g,y);return h?Object(u.reshape)(w,[w.shape[1],w.shape[2],w.shape[3]]):w}})},function(e,t,n){"use strict";n.r(t),n.d(t,"expandDims",(function(){return s})),n.d(t,"expandDimsConfig",(function(){return o}));var r=n(5),a=n(47);function s(e){const{inputs:t,attrs:n,backend:s}=e,{input:o}=t,{dim:i}=n,u=o.shape.length,c=o.shape.slice();let l=i;return i<0&&(r.util.assert(-(u+1)<=i,(()=>`Axis must be in the interval [${-(u+1)}, ${u}]`)),l=u+i+1),c.splice(l,0,1),Object(a.reshape)({inputs:{x:o},backend:s,attrs:{shape:c}})}const o={kernelName:r.ExpandDims,backendName:"wasm",kernelFunc:s}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(5),a=n(33);function s(e,t){let n;return{kernelName:e,backendName:"wasm",setupFunc:function(t){n=t.wasm.cwrap(e,null,["number","number","number"])},kernelFunc:function(e){const{backend:s,inputs:{x:o}}=e,i=s.dataIdMap.get(o.dataId).id,u=s.makeOutput(o.shape,t||o.dtype),c=s.dataIdMap.get(u.dataId).id;return 0===r.util.sizeFromShape(u.shape)||n(i,a.a[o.dtype],c),u}}}},function(e,t,n){var r=n(131),a=n(132),s=n(133),o=n(134),i=n(135),u=n(136),c=n(137);c.alea=r,c.xor128=a,c.xorwow=s,c.xorshift7=o,c.xor4096=i,c.tychei=u,e.exports=c},function(e,t,n){"use strict";n.r(t),n.d(t,"softmax",(function(){return i}));var r=n(3),a=n(4),s=n(1),o=n(2);const i=Object(o.b)({softmax_:function(e,t=-1){const n=Object(s.a)(e,"logits","softmax","float32");if(-1===t&&(t=n.rank-1),t!==n.rank-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and dim was ${t}`);const o={logits:n},i={dim:t};return r.a.runKernel(a.Rc,o,i)}})},function(e,t,n){"use strict";n.r(t),n.d(t,"stridedSlice",(function(){return i}));var r=n(3),a=n(4),s=n(1),o=n(2);const i=Object(o.b)({stridedSlice_:function(e,t,n,o,i=0,u=0,c=0,l=0,d=0){const p={x:Object(s.a)(e,"x","stridedSlice","string_or_numeric")},f={begin:t,end:n,strides:o,beginMask:i,endMask:u,ellipsisMask:c,newAxisMask:l,shrinkAxisMask:d};return r.a.runKernel(a.fd,p,f)}})},function(e,t,n){"use strict";n.r(t),n.d(t,"matMul",(function(){return m}));var r=n(3),a=n(23),s=n(4),o=n(12),i=n(1),u=n(8),c=n(10),l=n(16),d=n(26),p=n(19),f=n(2),h=n(7);const m=Object(f.b)({fusedMatMul_:function({a:e,b:t,transposeA:n=!1,transposeB:f=!1,bias:m,activation:b="linear",preluActivationWeights:g,leakyreluAlpha:y=.2}){if(!1===Object(d.d)(r.a.state.gradientDepth,b)){let r=Object(p.a)(e,t,n,f);return null!=m&&(r=Object(c.add)(r,m)),Object(d.a)(r,b,g,y)}let w=Object(i.a)(e,"a","fused matMul"),O=Object(i.a)(t,"b","fused matMul");[w,O]=Object(o.makeTypesMatch)(w,O);const v=n?w.shape[w.rank-2]:w.shape[w.rank-1],j=f?O.shape[O.rank-1]:O.shape[O.rank-2],_=n?w.shape[w.rank-1]:w.shape[w.rank-2],S=f?O.shape[O.rank-2]:O.shape[O.rank-1],k=w.shape.slice(0,-2),x=O.shape.slice(0,-2),E=u.O(k),T=u.O(x);u.c(v===j,(()=>`Error in fused matMul: inner shapes (${v}) and (${j}) of Tensors with shapes ${w.shape} and ${O.shape} and transposeA=${n} and transposeB=${f} must match.`));const N=l.assertAndGetBroadcastShape(w.shape.slice(0,-2),O.shape.slice(0,-2)).concat([_,S]),A=n?Object(h.reshape)(w,[E,v,_]):Object(h.reshape)(w,[E,_,v]),M=f?Object(h.reshape)(O,[T,S,j]):Object(h.reshape)(O,[T,j,S]);let I,D;null!=m&&(I=Object(i.a)(m,"bias","fused matMul"),[I]=Object(o.makeTypesMatch)(I,w),l.assertAndGetBroadcastShape(N,I.shape)),null!=g&&(D=Object(i.a)(g,"prelu weights","fused matMul"));const $=(e,t)=>{const[r,a,s,o]=t,i=Object(d.c)(Object(h.reshape)(e,s.shape),s,b);let u,c;if(n||f?!n&&f?(u=Object(p.a)(i,a,!1,!1),c=Object(p.a)(i,r,!0,!1)):n&&!f?(u=Object(p.a)(a,i,!1,!0),c=Object(p.a)(r,i,!1,!1)):(u=Object(p.a)(a,i,!0,!0),c=Object(p.a)(i,r,!0,!0)):(u=Object(p.a)(i,a,!1,!0),c=Object(p.a)(r,i,!0,!1)),null!=m){return[u,c,Object(d.b)(o,i)]}return[u,c]},C={a:A,b:M,bias:I,preluActivationWeights:D},R={transposeA:n,transposeB:f,activation:b,leakyreluAlpha:y};if(null==m){const e=Object(a.a)(((e,t,n)=>{const a=r.a.runKernel(s.xd,C,R);return n([e,t,a]),{value:Object(h.reshape)(a,N),gradFunc:$}}));return e(A,M)}{const e=Object(a.a)(((e,t,n,a)=>{const o=r.a.runKernel(s.xd,C,R);return a([e,t,o,n]),{value:Object(h.reshape)(o,N),gradFunc:$}}));return e(A,M,I)}}})},function(e,t,n){"use strict";n.r(t),n.d(t,"depthwiseConv2d",(function(){return y}));var r=n(3),a=n(23),s=n(4),o=n(12),i=n(1),u=n(8),c=n(10),l=n(16),d=n(14),p=n(61),f=n(2),h=n(7);const m=Object(f.b)({depthwiseConv2dNativeBackpropFilter_:function(e,t,n,a,o,i=[1,1],u){let c=e;3===e.rank&&(c=Object(h.reshape)(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let l=t;3===l.rank&&(l=Object(h.reshape)(t,[1,t.shape[0],t.shape[1],t.shape[2]]));const d={x:c,dy:l},p={strides:a,pad:o,dimRoundingMode:u,dilations:i,filterShape:n};return r.a.runKernel(s.S,d,p)}});const b=Object(f.b)({depthwiseConv2dNativeBackpropInput_:function(e,t,n,a,o,i=[1,1],u){let c=t,l=!1;3===t.rank&&(l=!0,c=Object(h.reshape)(t,[1,t.shape[0],t.shape[1],t.shape[2]]));const d={dy:c,filter:n},p={strides:a,pad:o,dimRoundingMode:u,dilations:i,inputShape:e},f=r.a.runKernel(s.T,d,p);return l?Object(h.reshape)(f,[f.shape[1],f.shape[2],f.shape[3]]):f}});var g=n(26);const y=Object(f.b)({fusedDepthwiseConv2d_:function({x:e,filter:t,strides:n,pad:f,dataFormat:y="NHWC",dilations:w=[1,1],dimRoundingMode:O,bias:v,activation:j="linear",preluActivationWeights:_,leakyreluAlpha:S}){if(!1===Object(g.d)(r.a.state.gradientDepth,j)){let r=Object(p.a)(e,t,n,f,y,w,O);return null!=v&&(r=Object(c.add)(r,v)),Object(g.a)(r,j,_,S)}const k=Object(i.a)(e,"x","depthwiseConv2d","float32"),x=Object(i.a)(t,"filter","depthwiseConv2d","float32");let E=k,T=!1;3===k.rank&&(T=!0,E=Object(h.reshape)(k,[1,k.shape[0],k.shape[1],k.shape[2]])),u.c(4===E.rank,(()=>`Error in fused depthwiseConv2d: input must be rank 4, but got rank ${E.rank}.`)),u.c(4===x.rank,(()=>`Error in fused depthwiseConv2d: filter must be rank 4, but got rank ${x.rank}.`)),u.c(E.shape[3]===x.shape[2],(()=>`Error in fused depthwiseConv2d: number of input channels (${E.shape[3]}) must match the inChannels dimension in filter ${x.shape[2]}.`)),null==w&&(w=[1,1]),u.c(d.i(n,w),(()=>`Error in fused depthwiseConv2d: Either strides or dilations must be 1. Got strides ${n} and dilations '${w}'`)),d.a("fused depthwiseConv2d",f,O);const N=d.b(E.shape,x.shape,n,w,f,O,!0);let A,M;null!=v&&(A=Object(i.a)(v,"bias","fused conv2d"),[A]=Object(o.makeTypesMatch)(A,k),l.assertAndGetBroadcastShape(N.outShape,A.shape)),null!=_&&(M=Object(i.a)(_,"prelu weights","fused depthwiseConv2d"));const I=(e,t)=>{u.c(d.k(w),(()=>`Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '${w}'`));const[r,a,s,o]=t,i=Object(g.c)(e,s,j),c=b(a.shape,i,r,n,f,w,O),l=m(a,i,r.shape,n,f,w,O);if(null!=o){return[c,l,Object(g.b)(A,i)]}return[c,l]},D={x:E,filter:x,bias:A,preluActivationWeights:M},$={strides:n,pad:f,dataFormat:y,dilations:w,dimRoundingMode:O,activation:j,leakyreluAlpha:S};if(null==v){const e=Object(a.a)(((e,t,n)=>{let a=r.a.runKernel(s.pb,D,$);return n([t,e,a]),T&&(a=Object(h.reshape)(a,[a.shape[1],a.shape[2],a.shape[3]])),{value:a,gradFunc:I}}));return e(E,x)}{const e=Object(a.a)(((e,t,n,a)=>{let o=r.a.runKernel(s.pb,D,$);return a([t,e,o,n]),T&&(o=Object(h.reshape)(o,[o.shape[1],o.shape[2],o.shape[3]])),{value:o,gradFunc:I}}));return e(E,x,A)}}})},function(e,t,n){"use strict";n.r(t),n.d(t,"conv2d",(function(){return y}));var r=n(3),a=n(23),s=n(4),o=n(12),i=n(1),u=n(8),c=n(10),l=n(16),d=n(49),p=n(14),f=n(2),h=n(7);const m=Object(f.b)({conv2DBackpropFilter_:function(e,t,n,a,o,i="NHWC",c){let l=e;3===e.rank&&(l=Object(h.reshape)(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let d=t;3===d.rank&&(d=Object(h.reshape)(t,[1,t.shape[0],t.shape[1],t.shape[2]])),u.c(4===l.rank,(()=>`Error in conv2dDerFilter: input must be rank 4, but got shape ${l.shape}.`)),u.c(4===d.rank,(()=>`Error in conv2dDerFilter: dy must be rank 4, but got shape ${d.shape}.`)),u.c(4===n.length,(()=>`Error in conv2dDerFilter: filterShape must be length 4, but got ${n}.`));const f="NHWC"===i?l.shape[3]:l.shape[1],m="NHWC"===i?d.shape[3]:d.shape[1];u.c(f===n[2],(()=>`Error in conv2dDerFilter: depth of input ${f}) must match input depth in filter (${n[2]}.`)),u.c(m===n[3],(()=>`Error in conv2dDerFilter: depth of dy (${m}) must match output depth for filter (${n[3]}).`)),p.a("conv2dDerFilter",o,c);const b={x:l,dy:d},g={strides:a,pad:o,dataFormat:i,dimRoundingMode:c,filterShape:n};return r.a.runKernel(s.F,b,g)}});var b=n(80),g=n(26);const y=Object(f.b)({fusedConv2d_:function({x:e,filter:t,strides:n,pad:f,dataFormat:y="NHWC",dilations:w=[1,1],dimRoundingMode:O,bias:v,activation:j="linear",preluActivationWeights:_,leakyreluAlpha:S}){if(j=j||"linear",!1===Object(g.d)(r.a.state.gradientDepth,j)){u.c("NHWC"===y,(()=>`Error in fused conv2d: got dataFormat of ${y} but only NHWC is currently supported for the case of gradient depth is 0 and the activation is not linear.`));let r=Object(d.a)(e,t,n,f,y,w,O);return null!=v&&(r=Object(c.add)(r,v)),Object(g.a)(r,j,_,S)}const k=Object(i.a)(e,"x","conv2d","float32"),x=Object(i.a)(t,"filter","conv2d","float32");let E=k,T=!1;3===k.rank&&(T=!0,E=Object(h.reshape)(k,[1,k.shape[0],k.shape[1],k.shape[2]])),u.c(4===E.rank,(()=>`Error in fused conv2d: input must be rank 4, but got rank ${E.rank}.`)),u.c(4===x.rank,(()=>`Error in fused conv2d: filter must be rank 4, but got rank ${x.rank}.`)),p.a("fused conv2d",f,O);const N="NHWC"===y?E.shape[3]:E.shape[1];u.c(x.shape[2]===N,(()=>`Error in conv2d: depth of input (${N}) must match input depth for filter ${x.shape[2]}.`)),u.c(p.i(n,w),(()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${w}'`));const A=p.b(E.shape,x.shape,n,w,f,O);let M,I;if(null!=v&&(M=Object(i.a)(v,"bias","fused conv2d"),[M]=Object(o.makeTypesMatch)(M,k),"NHWC"===y?l.assertAndGetBroadcastShape(A.outShape,M.shape):(u.c(M.shape.length<=1,(()=>`Error in fused conv2d: only supports scalar or 1-D Tensor bias for NCHW format but got the bias of rank-${M.shape.length}.`)),u.c(0===M.shape.length||M.shape[0]===A.outChannels||1===M.shape[0],(()=>`Error in fused conv2d: bias shape (${M.shape}) is not compatible with the number of output channels (${A.outChannels})`)))),null!=_){const e=_.shape;if(u.c(e.length<=1||3===e.length,(()=>`Error in fused conv2d: only supports scalar, 1-D Tensor or 3-D Tensor PReLU activation weights but got a tensor of rank-${e.length}.`)),1===e.length)u.c(1===e[0]||e[0]===A.outChannels,(()=>`Error in fused conv2d: PReLU activation weights (${e}) is not compatible with the number of output channels (${A.outChannels}).`));else if(3===e.length)try{l.assertAndGetBroadcastShape(e,A.outShape)}catch(t){const n=`Error in fused conv2d: PReLU activation weights (${e}) is not compatible with the output shape of the conv2d (${A.outShape}).`;throw Error(n)}I=Object(i.a)(_,"prelu weights","fused conv2d")}const D=(e,t)=>{u.c("NHWC"===y,(()=>`Error in gradient of fused conv2D: got dataFormat of ${y} but only NHWC is currently supported.`));const[r,a,s,o]=t,i=Object(g.c)(e,s,j);u.c(p.k(w),(()=>`Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${w}'`));const c=[Object(b.a)(a.shape,i,r,n,f),m(a,i,r.shape,n,f)];if(null!=o){const e=Object(g.b)(o,i);c.push(e)}return c},$={x:E,filter:x,bias:M,preluActivationWeights:I},C={strides:n,pad:f,dataFormat:y,dilations:w,dimRoundingMode:O,activation:j,leakyreluAlpha:S};if(null==v){const e=Object(a.a)(((e,t,n)=>{let a=r.a.runKernel(s.ob,$,C);return n([t,e,a]),T&&(a=Object(h.reshape)(a,[a.shape[1],a.shape[2],a.shape[3]])),{value:a,gradFunc:D}}));return e(E,x)}{const e=Object(a.a)(((e,t,n,a)=>{let o=r.a.runKernel(s.ob,$,C);return a([t,e,o,n]),T&&(o=Object(h.reshape)(o,[o.shape[1],o.shape[2],o.shape[3]])),{value:o,gradFunc:D}}));return e(E,x,M)}}})},function(e,t,n){"use strict";n.r(t),n.d(t,"Profiler",(function(){return o})),n.d(t,"checkComputationForErrors",(function(){return i})),n.d(t,"Logger",(function(){return u}));var r=n(11),a=n(6),s=n(8);class o{constructor(e,t){this.backendTimer=e,this.logger=t,null==t&&(this.logger=new u)}profileKernel(e,t,n){let s;const o=()=>{s=n()};let u;const c=a.now();if(this.backendTimer.timerAvailable())u=this.backendTimer.time(o);else{o();for(const e of s)e.dataSync();u=Promise.resolve({kernelMs:a.now()-c})}if(Object(r.c)().getBool("CHECK_COMPUTATION_FOR_ERRORS"))for(let t=0;t<s.length;t++){const n=s[t];n.data().then((t=>{i(t,n.dtype,e)}))}return{kernelName:e,outputs:s,inputs:t,timeMs:u.then((e=>e.kernelMs)),extraInfo:u.then((e=>null!=e.getExtraProfileInfo?e.getExtraProfileInfo():""))}}logKernelProfile(e){const{kernelName:t,outputs:n,timeMs:r,inputs:a,extraInfo:s}=e;n.forEach((e=>{Promise.all([e.data(),r,s]).then((n=>{this.logger.logKernelProfile(t,e,n[0],n[1],a,n[2])}))}))}}function i(e,t,n){if("float32"!==t)return!1;for(let t=0;t<e.length;t++){const r=e[t];if(isNaN(r)||!isFinite(r))return console.warn(`Found ${r} in the result of '${n}'`),!0}return!1}class u{logKernelProfile(e,t,n,r,a,o){const i="number"==typeof r?s.L(`${r}ms`,9):r.error,u=s.L(e,25),c=t.rank,l=t.size,d=s.L(t.shape.toString(),14);let p="";for(const e in a){const n=a[e];if(null!=n){const r=n.shape||t.shape,a=r.length;p+=`${e}: ${a}D ${a>0?r:""} `}}console.log(`%c${u}\t%c${i}\t%c${c}D ${d}\t%c${l}\t%c${p}\t%c${o}`,"font-weight:bold","color:red","color:blue","color: orange","color: green","color: steelblue")}}},function(e,t,n){"use strict";n.r(t),n.d(t,"cast",(function(){return a})),n.d(t,"castConfig",(function(){return s}));var r=n(5);function a(e){const{inputs:{x:t},attrs:{dtype:n},backend:r}=e,a=r.makeOutput(t.shape,n),s=r.typedArrayFromHeap(t);return r.typedArrayFromHeap(a).set(s),a}const s={kernelName:r.Cast,backendName:"wasm",kernelFunc:a}},function(e,t,n){"use strict";n.r(t),n.d(t,"concat",(function(){return i})),n.d(t,"concatConfig",(function(){return u}));var r=n(5),a=n(70),s=n(68),o=n(47);function i(e){const{inputs:t,backend:n}=e,i=r.util.parseAxisParam(e.attrs.axis,t[0].shape)[0],u=t.map((e=>e.shape));r.backend_util.assertParamsConsistent(u,i);let c=r.backend_util.computeOutShape(t.map((e=>e.shape)),i);const l=t.filter((e=>r.util.sizeFromShape(e.shape)>0));if(1===l.length)return Object(s.identity)({inputs:{x:l[0]},backend:n});const d=n.makeOutput(c,t[0].dtype);if(0===r.util.sizeFromShape(c))return d;if("string"===l[0].dtype){const e=l.map((e=>{const t=[-1,r.util.sizeFromShape(e.shape.slice(i))];return Object(o.reshape)({inputs:{x:e},backend:n,attrs:{shape:t}})})),s=e.map((e=>({vals:n.readSync(e.dataId),shape:e.shape})));c=r.backend_util.computeOutShape(e.map((e=>e.shape)),1);const u=1===e[0].shape[0],p=Object(a.a)(s,c,t[0].dtype,u),f=r.backend_util.computeOutShape(l.map((e=>e.shape)),i);d.shape=f;return n.dataIdMap.get(d.dataId).stringBytes=r.backend_util.fromStringArrayToUint8(p),e.forEach((e=>n.disposeData(e.dataId))),d}const p=r.util.sizeFromShape(l[0].shape.slice(0,i));let f=0;const h=l.map((e=>{const t=r.util.sizeFromShape(e.shape.slice(i));return f+=t,t})),m=l.map((e=>n.typedArrayFromHeap(e))),b=n.typedArrayFromHeap(d);for(let e=0;e<p;e++){let t=e*f;for(let n=0;n<m.length;n++){const r=h[n],a=e*r,s=m[n].subarray(a,a+r);b.set(s,t),t+=r}}return d}const u={kernelName:r.Concat,backendName:"wasm",kernelFunc:i}},function(e,t,n){"use strict";n.r(t),n.d(t,"transpose",(function(){return i})),n.d(t,"transposeConfig",(function(){return u}));var r=n(5),a=n(68),s=n(33);let o;function i(e){const{inputs:t,backend:n,attrs:r}=e,[i,u]=function(e,t){const n=[],r=[];for(let a=0;a<e.length;++a)1!==e[a]&&n.push(e[a]),1!==e[t[a]]&&r.push(t[a]);for(let e=0;e<r.length;++e){let t=-1;for(let n=0;n<r.length;++n)r[n]>=e&&(-1===t||r[t]>r[n])&&(t=n);r[t]=e}return[n,r]}(t.x.shape,r.perm);let c=!0;for(let e=0;e<u.length;e++)u[e]!==e&&(c=!1);const l=function(e,t){const n=new Array(e.length);for(let r=0;r<n.length;r++)n[r]=e[t[r]];return n}(t.x.shape,r.perm),d={dataId:t.x.dataId,shape:i,dtype:t.x.dtype};if(c){const e=Object(a.identity)({inputs:t,backend:n});return e.shape=l,e}const p=n.makeOutput(l,d.dtype),f=n.dataIdMap.get(d.dataId).id,h=n.dataIdMap.get(p.dataId).id,m=new Uint8Array(new Int32Array(u).buffer),b=new Uint8Array(new Int32Array(d.shape).buffer);return o(f,b,d.shape.length,s.a[d.dtype],h,m,u.length),p}const u={kernelName:r.Transpose,backendName:"wasm",kernelFunc:i,setupFunc:function(e){o=e.wasm.cwrap(r.Transpose,null,["number","array","number","number","number","array","number"])}}},function(e,t){e.exports=r;var n=null;try{n=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(e){}function r(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function a(e){return!0===(e&&e.__isLong__)}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0}),r.isLong=a;var s={},o={};function i(e,t){var n,r,a;return t?(a=0<=(e>>>=0)&&e<256)&&(r=o[e])?r:(n=c(e,(0|e)<0?-1:0,!0),a&&(o[e]=n),n):(a=-128<=(e|=0)&&e<128)&&(r=s[e])?r:(n=c(e,e<0?-1:0,!1),a&&(s[e]=n),n)}function u(e,t){if(isNaN(e))return t?y:g;if(t){if(e<0)return y;if(e>=h)return _}else{if(e<=-m)return S;if(e+1>=m)return j}return e<0?u(-e,t).neg():c(e%f|0,e/f|0,t)}function c(e,t,n){return new r(e,t,n)}r.fromInt=i,r.fromNumber=u,r.fromBits=c;var l=Math.pow;function d(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return g;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||36<n)throw RangeError("radix");var r;if((r=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===r)return d(e.substring(1),t,n).neg();for(var a=u(l(n,8)),s=g,o=0;o<e.length;o+=8){var i=Math.min(8,e.length-o),c=parseInt(e.substring(o,o+i),n);if(i<8){var p=u(l(n,i));s=s.mul(p).add(u(c))}else s=(s=s.mul(a)).add(u(c))}return s.unsigned=t,s}function p(e,t){return"number"==typeof e?u(e,t):"string"==typeof e?d(e,t):c(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}r.fromString=d,r.fromValue=p;var f=4294967296,h=f*f,m=h/2,b=i(1<<24),g=i(0);r.ZERO=g;var y=i(0,!0);r.UZERO=y;var w=i(1);r.ONE=w;var O=i(1,!0);r.UONE=O;var v=i(-1);r.NEG_ONE=v;var j=c(-1,2147483647,!1);r.MAX_VALUE=j;var _=c(-1,-1,!0);r.MAX_UNSIGNED_VALUE=_;var S=c(0,-2147483648,!1);r.MIN_VALUE=S;var k=r.prototype;k.toInt=function(){return this.unsigned?this.low>>>0:this.low},k.toNumber=function(){return this.unsigned?(this.high>>>0)*f+(this.low>>>0):this.high*f+(this.low>>>0)},k.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(S)){var t=u(e),n=this.div(t),r=n.mul(t).sub(this);return n.toString(e)+r.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var a=u(l(e,6),this.unsigned),s=this,o="";;){var i=s.div(a),c=(s.sub(i.mul(a)).toInt()>>>0).toString(e);if((s=i).isZero())return c+o;for(;c.length<6;)c="0"+c;o=""+c+o}},k.getHighBits=function(){return this.high},k.getHighBitsUnsigned=function(){return this.high>>>0},k.getLowBits=function(){return this.low},k.getLowBitsUnsigned=function(){return this.low>>>0},k.getNumBitsAbs=function(){if(this.isNegative())return this.eq(S)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},k.isZero=function(){return 0===this.high&&0===this.low},k.eqz=k.isZero,k.isNegative=function(){return!this.unsigned&&this.high<0},k.isPositive=function(){return this.unsigned||this.high>=0},k.isOdd=function(){return 1==(1&this.low)},k.isEven=function(){return 0==(1&this.low)},k.equals=function(e){return a(e)||(e=p(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},k.eq=k.equals,k.notEquals=function(e){return!this.eq(e)},k.neq=k.notEquals,k.ne=k.notEquals,k.lessThan=function(e){return this.comp(e)<0},k.lt=k.lessThan,k.lessThanOrEqual=function(e){return this.comp(e)<=0},k.lte=k.lessThanOrEqual,k.le=k.lessThanOrEqual,k.greaterThan=function(e){return this.comp(e)>0},k.gt=k.greaterThan,k.greaterThanOrEqual=function(e){return this.comp(e)>=0},k.gte=k.greaterThanOrEqual,k.ge=k.greaterThanOrEqual,k.compare=function(e){if(a(e)||(e=p(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},k.comp=k.compare,k.negate=function(){return!this.unsigned&&this.eq(S)?S:this.not().add(w)},k.neg=k.negate,k.add=function(e){a(e)||(e=p(e));var t=this.high>>>16,n=65535&this.high,r=this.low>>>16,s=65535&this.low,o=e.high>>>16,i=65535&e.high,u=e.low>>>16,l=0,d=0,f=0,h=0;return f+=(h+=s+(65535&e.low))>>>16,d+=(f+=r+u)>>>16,l+=(d+=n+i)>>>16,l+=t+o,c((f&=65535)<<16|(h&=65535),(l&=65535)<<16|(d&=65535),this.unsigned)},k.subtract=function(e){return a(e)||(e=p(e)),this.add(e.neg())},k.sub=k.subtract,k.multiply=function(e){if(this.isZero())return g;if(a(e)||(e=p(e)),n)return c(n.mul(this.low,this.high,e.low,e.high),n.get_high(),this.unsigned);if(e.isZero())return g;if(this.eq(S))return e.isOdd()?S:g;if(e.eq(S))return this.isOdd()?S:g;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(b)&&e.lt(b))return u(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,r=65535&this.high,s=this.low>>>16,o=65535&this.low,i=e.high>>>16,l=65535&e.high,d=e.low>>>16,f=65535&e.low,h=0,m=0,y=0,w=0;return y+=(w+=o*f)>>>16,m+=(y+=s*f)>>>16,y&=65535,m+=(y+=o*d)>>>16,h+=(m+=r*f)>>>16,m&=65535,h+=(m+=s*d)>>>16,m&=65535,h+=(m+=o*l)>>>16,h+=t*f+r*d+s*l+o*i,c((y&=65535)<<16|(w&=65535),(h&=65535)<<16|(m&=65535),this.unsigned)},k.mul=k.multiply,k.divide=function(e){if(a(e)||(e=p(e)),e.isZero())throw Error("division by zero");var t,r,s;if(n)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?c((this.unsigned?n.div_u:n.div_s)(this.low,this.high,e.low,e.high),n.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?y:g;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return y;if(e.gt(this.shru(1)))return O;s=y}else{if(this.eq(S))return e.eq(w)||e.eq(v)?S:e.eq(S)?w:(t=this.shr(1).div(e).shl(1)).eq(g)?e.isNegative()?w:v:(r=this.sub(e.mul(t)),s=t.add(r.div(e)));if(e.eq(S))return this.unsigned?y:g;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();s=g}for(r=this;r.gte(e);){t=Math.max(1,Math.floor(r.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(t)/Math.LN2),i=o<=48?1:l(2,o-48),d=u(t),f=d.mul(e);f.isNegative()||f.gt(r);)f=(d=u(t-=i,this.unsigned)).mul(e);d.isZero()&&(d=w),s=s.add(d),r=r.sub(f)}return s},k.div=k.divide,k.modulo=function(e){return a(e)||(e=p(e)),n?c((this.unsigned?n.rem_u:n.rem_s)(this.low,this.high,e.low,e.high),n.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},k.mod=k.modulo,k.rem=k.modulo,k.not=function(){return c(~this.low,~this.high,this.unsigned)},k.and=function(e){return a(e)||(e=p(e)),c(this.low&e.low,this.high&e.high,this.unsigned)},k.or=function(e){return a(e)||(e=p(e)),c(this.low|e.low,this.high|e.high,this.unsigned)},k.xor=function(e){return a(e)||(e=p(e)),c(this.low^e.low,this.high^e.high,this.unsigned)},k.shiftLeft=function(e){return a(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?c(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):c(0,this.low<<e-32,this.unsigned)},k.shl=k.shiftLeft,k.shiftRight=function(e){return a(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?c(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):c(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},k.shr=k.shiftRight,k.shiftRightUnsigned=function(e){if(a(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return e<32?c(this.low>>>e|t<<32-e,t>>>e,this.unsigned):c(32===e?t:t>>>e-32,0,this.unsigned)},k.shru=k.shiftRightUnsigned,k.shr_u=k.shiftRightUnsigned,k.toSigned=function(){return this.unsigned?c(this.low,this.high,!1):this},k.toUnsigned=function(){return this.unsigned?this:c(this.low,this.high,!0)},k.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},k.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},k.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},r.fromBytes=function(e,t,n){return n?r.fromBytesLE(e,t):r.fromBytesBE(e,t)},r.fromBytesLE=function(e,t){return new r(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},r.fromBytesBE=function(e,t){return new r(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},function(e,t,n){(function(t,r,a,s){var o,i=(o=(o="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||t,function(e){function t(){return $.buffer!=F&&K($.buffer),B}function i(){return $.buffer!=F&&K($.buffer),L}function u(){return $.buffer!=F&&K($.buffer),z}function c(){return $.buffer!=F&&K($.buffer),W}function l(){return $.buffer!=F&&K($.buffer),U}var d,p,f,h="undefined"!=typeof(e=e||{})?e:{};h.ready=new Promise((function(e,t){d=e,p=t})),"undefined"!=typeof r&&r.listeners&&(f={uncaughtException:r.listeners("uncaughtException"),unhandledRejection:r.listeners("unhandledRejection")});var m,b,g,y=Object.assign({},h),w=[],O=(e,t)=>{throw t},v="object"==typeof window,j="function"==typeof importScripts,_="object"==typeof r&&"object"==typeof r.versions&&"string"==typeof r.versions.node,S=h.ENVIRONMENT_IS_PTHREAD||!1,k="";function x(e){return h.locateFile?h.locateFile(e,k):k+e}if(_){var E=n(98),T=n(99);let e;k=j?T.dirname(k)+"/":a+"/",m=(e,t)=>(e=ue(e)?new URL(e):T.normalize(e),E.readFileSync(e,t?void 0:"utf8")),g=e=>{var t=m(e,!0);return t.buffer||(t=new Uint8Array(t)),t},b=(e,t,n)=>{e=ue(e)?new URL(e):T.normalize(e),E.readFile(e,(function(e,r){e?n(e):t(r.buffer)}))},r.argv.length>1&&r.argv[1].replace(/\\/g,"/"),w=r.argv.slice(2),r.on("uncaughtException",(function(e){if(!(e instanceof de))throw e})),r.on("unhandledRejection",(function(e){throw e})),O=(e,t)=>{if(ee())throw r.exitCode=e,t;var n;(n=t)instanceof de||D("exiting due to exception: "+n),r.exit(e)},h.inspect=function(){return"[Emscripten Module object]"};try{e=n(144)}catch(e){throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'),e}s.Worker=e.Worker}else(v||j)&&(j?k=self.location.href:"undefined"!=typeof document&&document.currentScript&&(k=document.currentScript.src),"undefined"!=typeof o&&o&&(k=o),k=0!==k.indexOf("blob:")?k.substr(0,k.replace(/[?#].*/,"").lastIndexOf("/")+1):"",_||(m=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},j&&(g=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),b=(e,t,n)=>{var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)}));_&&"undefined"==typeof performance&&(s.performance=n(145).performance);var N=console.log.bind(console),A=console.warn.bind(console);_&&(N=e=>E.writeSync(1,e+"\n"),A=e=>E.writeSync(2,e+"\n"));var M,I=h.print||N,D=h.printErr||A;Object.assign(h,y),y=null,h.arguments&&(w=h.arguments),h.thisProgram&&h.thisProgram,h.quit&&(O=h.quit),Atomics.load,Atomics.store,Atomics.compareExchange,h.wasmBinary&&(M=h.wasmBinary);var $,C,R=h.noExitRuntime||!0;"object"!=typeof WebAssembly&&oe("no native wasm support detected");var P,F,B,L,z,W,U,V=!1,G="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function q(e,t,n){for(var r=(t>>>=0)+n,a=t;e[a]&&!(a>=r);)++a;if(a-t>16&&e.buffer&&G)return G.decode(e.buffer instanceof SharedArrayBuffer?e.slice(t,a):e.subarray(t,a));for(var s="";t<a;){var o=e[t++];if(128&o){var i=63&e[t++];if(192!=(224&o)){var u=63&e[t++];if((o=224==(240&o)?(15&o)<<12|i<<6|u:(7&o)<<18|i<<12|u<<6|63&e[t++])<65536)s+=String.fromCharCode(o);else{var c=o-65536;s+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else s+=String.fromCharCode((31&o)<<6|i)}else s+=String.fromCharCode(o)}return s}function H(e,t){return(e>>>=0)?q(i(),e,t):""}function K(e){F=e,h.HEAP8=B=new Int8Array(e),h.HEAP16=new Int16Array(e),h.HEAP32=z=new Int32Array(e),h.HEAPU8=L=new Uint8Array(e),h.HEAPU16=new Uint16Array(e),h.HEAPU32=W=new Uint32Array(e),h.HEAPF32=new Float32Array(e),h.HEAPF64=U=new Float64Array(e)}S&&(F=h.buffer);var Y,J=h.INITIAL_MEMORY||16777216;if(S)$=h.wasmMemory,F=h.buffer;else if(h.wasmMemory)$=h.wasmMemory;else if(!(($=new WebAssembly.Memory({initial:J/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw D("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"),_&&D("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and/or recent version)"),Error("bad memory");$&&(F=$.buffer),J=F.byteLength,K(F);var X=[],Q=[],Z=[];function ee(){return R}function te(){S||ge(Q)}var ne,re=0,ae=null,se=null;function oe(e){h.onAbort&&h.onAbort(e),D(e="Aborted("+e+")"),V=!0,P=1,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw p(t),t}function ie(e){return e.startsWith("data:application/octet-stream;base64,")}function ue(e){return e.startsWith("file://")}function ce(e){try{if(e==ne&&M)return new Uint8Array(M);if(g)return g(e);throw"both async and sync fetching of the wasm failed"}catch(e){oe(e)}}ie(ne="tfjs-backend-wasm-threaded-simd.wasm")||(ne=x(ne));var le={};function de(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function pe(e){var t,n=be.pthreads[e];n||oe(t),be.returnWorkerToPool(n)}function fe(e){var t=be.getNewWorker();if(!t)return 6;be.runningWorkers.push(t),be.pthreads[e.pthread_ptr]=t,t.pthread_ptr=e.pthread_ptr;var n={cmd:"run",start_routine:e.startRoutine,arg:e.arg,pthread_ptr:e.pthread_ptr};return t.runPthread=()=>{_&&t.ref(),t.postMessage(n,e.transferList),delete t.runPthread},t.loaded&&t.runPthread(),0}function he(e){if(S)return xe(1,1,e);P=e,ee()||(be.terminateAllThreads(),h.onExit&&h.onExit(e),V=!0),O(e,new de(e))}var me=function(e,t){if(P=e,!t&&S)throw ye(e),"unwind";he(e)},be={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],pthreads:{},init:function(){S?be.initWorker():be.initMainThread()},initMainThread:function(){for(var e=8;e--;)be.allocateUnusedWorker()},initWorker:function(){R=!1},setExitStatus:function(e){P=e},terminateAllThreads:function(){for(var e of Object.values(be.pthreads))be.returnWorkerToPool(e);for(var e of be.unusedWorkers)e.terminate();be.unusedWorkers=[]},returnWorkerToPool:function(e){var t=e.pthread_ptr;delete be.pthreads[t],be.unusedWorkers.push(e),be.runningWorkers.splice(be.runningWorkers.indexOf(e),1),e.pthread_ptr=0,_&&e.unref(),Ge(t)},receiveObjectTransfer:function(e){},threadInitTLS:function(){be.tlsInitFunctions.forEach((e=>e()))},loadWasmModuleToWorker:function(e,t){e.onmessage=n=>{var r,a=n.data,s=a.cmd;if(e.pthread_ptr&&(be.currentProxiedOperationCallerThread=e.pthread_ptr),a.targetThread&&a.targetThread!=ze()){var o=be.pthreads[a.targetThread];return o?o.postMessage(a,a.transferList):D('Internal error! Worker sent a message "'+s+'" to target pthread '+a.targetThread+", but that thread no longer exists!"),void(be.currentProxiedOperationCallerThread=void 0)}"processProxyingQueue"===s?_e(a.queue):"spawnThread"===s?fe(a):"cleanupThread"===s?pe(a.thread):"killThread"===s?function(e){var t=be.pthreads[e];delete be.pthreads[e],t.terminate(),Ge(e),be.runningWorkers.splice(be.runningWorkers.indexOf(t),1),t.pthread_ptr=0}(a.thread):"cancelThread"===s?(r=a.thread,be.pthreads[r].postMessage({cmd:"cancel"})):"loaded"===s?(e.loaded=!0,_&&e.unref(),t&&t(e),e.runPthread&&e.runPthread()):"print"===s?I("Thread "+a.threadId+": "+a.text):"printErr"===s?D("Thread "+a.threadId+": "+a.text):"alert"===s?alert("Thread "+a.threadId+": "+a.text):"setimmediate"===a.target?e.postMessage(a):"callHandler"===s?h[a.handler](...a.args):s&&D("worker sent an unknown command "+s),be.currentProxiedOperationCallerThread=void 0},e.onerror=e=>{throw D("worker sent an error! "+e.filename+":"+e.lineno+": "+e.message),e},_&&(e.on("message",(function(t){e.onmessage({data:t})})),e.on("error",(function(t){e.onerror(t)})),e.on("detachedExit",(function(){})));var n=[];for(var r of["onExit","onAbort","print","printErr"])h.hasOwnProperty(r)&&n.push(r);e.postMessage({cmd:"load",handlers:n,urlOrBlob:h.mainScriptUrlOrBlob||o,wasmMemory:$,wasmModule:C})},allocateUnusedWorker:function(){var e,t=x("tfjs-backend-wasm-threaded-simd.worker.js");e=new Worker(t),be.unusedWorkers.push(e)},getNewWorker:function(){return 0==be.unusedWorkers.length&&(be.allocateUnusedWorker(),be.loadWasmModuleToWorker(be.unusedWorkers[0])),be.unusedWorkers.pop()}};function ge(e){for(;e.length>0;)e.shift()(h)}function ye(e){if(S)return xe(2,0,e);try{me(e)}catch(e){!function(e){if(e instanceof de||"unwind"==e)return P;O(1,e)}(e)}}h.PThread=be,h.establishStackSpace=function(){var e=ze(),t=u()[e+52>>>2],n=u()[e+56>>>2];He(t,t-n),Ye(t)};var we,Oe=[];function ve(e,t,n,r){return S?xe(3,1,e,t,n,r):je(e,t,n,r)}function je(e,t,n,r){if("undefined"==typeof SharedArrayBuffer)return D("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var a=[];if(S&&0===a.length)return ve(e,t,n,r);var s={startRoutine:n,pthread_ptr:e,arg:r,transferList:a};return S?(s.cmd="spawnThread",postMessage(s,a),0):fe(s)}function _e(e){Atomics.store(u(),e>>2,1),ze()&&Ve(e),Atomics.compareExchange(u(),e>>2,1,0)}function Se(e){Se.shown||(Se.shown={}),Se.shown[e]||(Se.shown[e]=1,_&&(e="warning: "+e),D(e))}function ke(e){var t=Ke(),n=e();return Ye(t),n}function xe(e,t){var n=arguments.length-2,r=arguments;return ke((()=>{for(var a=n,s=Je(8*a),o=s>>3,i=0;i<n;i++){var u=r[2+i];l()[o+i>>>0]=u}return Ue(e,a,s,t)}))}h.invokeEntryPoint=function(e,t){var n,r,a=((r=Oe[n=e])||(n>=Oe.length&&(Oe.length=n+1),Oe[n]=r=Y.get(n)),r)(t);ee()?be.setExitStatus(a):qe(a)},h.executeNotifiedProxyingQueue=_e,we=_?()=>{var e=r.hrtime();return 1e3*e[0]+e[1]/1e6}:()=>performance.timeOrigin+performance.now();var Ee=[];function Te(e){try{return $.grow(e-F.byteLength+65535>>>16),K($.buffer),1}catch(e){}}function Ne(e){return S?xe(4,1,e):52}function Ae(e,t,n,r,a){return S?xe(5,1,e,t,n,r,a):70}var Me=[null,[],[]];function Ie(e,t){var n=Me[e];0===t||10===t?((1===e?I:D)(q(n,0)),n.length=0):n.push(t)}function De(e,t,n,r){if(S)return xe(6,1,e,t,n,r);for(var a=0,s=0;s<n;s++){var o=c()[t>>>2],u=c()[t+4>>>2];t+=8;for(var l=0;l<u;l++)Ie(e,i()[o+l>>>0]);a+=u}return c()[r>>>2]=a,0}function $e(e){return h["_"+e]}function Ce(e,n,r,a,s){var o={string:e=>{var t=0;if(null!=e&&0!==e){var n=1+(e.length<<2);!function(e,t,n){!function(e,t,n,r){if(!(r>0))return 0;n>>>=0;for(var a=n+r-1,s=0;s<e.length;++s){var o=e.charCodeAt(s);if(o>=55296&&o<=57343&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++s)),o<=127){if(n>=a)break;t[n++>>>0]=o}else if(o<=2047){if(n+1>=a)break;t[n++>>>0]=192|o>>6,t[n++>>>0]=128|63&o}else if(o<=65535){if(n+2>=a)break;t[n++>>>0]=224|o>>12,t[n++>>>0]=128|o>>6&63,t[n++>>>0]=128|63&o}else{if(n+3>=a)break;t[n++>>>0]=240|o>>18,t[n++>>>0]=128|o>>12&63,t[n++>>>0]=128|o>>6&63,t[n++>>>0]=128|63&o}}t[n>>>0]=0}(e,i(),t,n)}(e,t=Je(n),n)}return t},array:e=>{var n=Je(e.length);return function(e,n){t().set(e,n>>>0)}(e,n),n}},u=$e(e),c=[],l=0;if(a)for(var d=0;d<a.length;d++){var p=o[r[d]];p?(0===l&&(l=Ke()),c[d]=p(a[d])):c[d]=a[d]}var f=u.apply(null,c);return f=function(e){return 0!==l&&Ye(l),function(e){return"string"===n?H(e):"boolean"===n?Boolean(e):e}(e)}(f)}be.init();var Re,Pe,Fe,Be=[null,he,ye,ve,Ne,Ae,De],Le={__emscripten_init_main_thread_js:function(e){We(e,!j,1,!v),be.threadInitTLS()},__emscripten_thread_cleanup:function(e){S?postMessage({cmd:"cleanupThread",thread:e}):pe(e)},__pthread_create_js:je,_emscripten_default_pthread_stack_size:function(){return 65536},_emscripten_get_now_is_monotonic:function(){return!0},_emscripten_notify_task_queue:function(e,t,n,r){if(e==t)setTimeout((()=>_e(r)));else if(S)postMessage({targetThread:e,cmd:"processProxyingQueue",queue:r});else{var a=be.pthreads[e];if(!a)return;a.postMessage({cmd:"processProxyingQueue",queue:r})}return 1},_emscripten_set_offscreencanvas_size:function(e,t,n){return-1},abort:function(){oe("")},emscripten_check_blocking_allowed:function(){_||j||Se("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")},emscripten_date_now:function(){return Date.now()},emscripten_get_heap_max:function(){return 4294901760},emscripten_get_now:we,emscripten_memcpy_big:function(e,t,n){i().copyWithin(e>>>0,t>>>0,t+n>>>0)},emscripten_num_logical_cores:function(){return _?n(146).cpus().length:navigator.hardwareConcurrency},emscripten_receive_on_main_thread_js:function(e,t,n){Ee.length=t;for(var r=n>>3,a=0;a<t;a++)Ee[a]=l()[r+a>>>0];return(e<0?le[-e-1]:Be[e]).apply(null,Ee)},emscripten_resize_heap:function(e){var t=i().length;if((e>>>=0)<=t)return!1;var n,r,a=4294901760;if(e>a)return!1;for(var s=1;s<=4;s*=2){var o=t*(1+.2/s);if(o=Math.min(o,e+100663296),Te(Math.min(a,(n=Math.max(e,o))+((r=65536)-n%r)%r)))return!0}return!1},emscripten_unwind_to_js_event_loop:function(){throw"unwind"},exit:me,fd_close:Ne,fd_seek:Ae,fd_write:De,memory:$||h.wasmMemory},ze=(function(){var e={env:Le,wasi_snapshot_preview1:Le};function t(e,t){var n,r,a=e.exports;if(h.asm=a,n=h.asm._emscripten_tls_init,be.tlsInitFunctions.push(n),Y=h.asm.__indirect_function_table,r=h.asm.__wasm_call_ctors,Q.unshift(r),C=t,!S){var s=be.unusedWorkers.length;be.unusedWorkers.forEach((function(e){be.loadWasmModuleToWorker(e,(function(){--s||function(e){if(re--,h.monitorRunDependencies&&h.monitorRunDependencies(re),0==re&&(null!==ae&&(clearInterval(ae),ae=null),se)){var t=se;se=null,t()}}()}))}))}}function n(e){t(e.instance,e.module)}function r(t){return function(){if(!M&&(v||j)){if("function"==typeof fetch&&!ue(ne))return fetch(ne,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+ne+"'";return e.arrayBuffer()})).catch((function(){return ce(ne)}));if(b)return new Promise((function(e,t){b(ne,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return ce(ne)}))}().then((function(t){return WebAssembly.instantiate(t,e)})).then((function(e){return e})).then(t,(function(e){D("failed to asynchronously prepare wasm: "+e),oe(e)}))}if(S||(re++,h.monitorRunDependencies&&h.monitorRunDependencies(re)),h.instantiateWasm)try{return h.instantiateWasm(e,t)}catch(e){D("Module.instantiateWasm callback failed with error: "+e),p(e)}(M||"function"!=typeof WebAssembly.instantiateStreaming||ie(ne)||ue(ne)||_||"function"!=typeof fetch?r(n):fetch(ne,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(n,(function(e){return D("wasm streaming compile failed: "+e),D("falling back to ArrayBuffer instantiation"),r(n)}))}))).catch(p)}(),h.___wasm_call_ctors=function(){return(h.___wasm_call_ctors=h.asm.__wasm_call_ctors).apply(null,arguments)},h._init=function(){return(h._init=h.asm.init).apply(null,arguments)},h._init_with_threads_count=function(){return(h._init_with_threads_count=h.asm.init_with_threads_count).apply(null,arguments)},h._get_threads_count=function(){return(h._get_threads_count=h.asm.get_threads_count).apply(null,arguments)},h._register_tensor=function(){return(h._register_tensor=h.asm.register_tensor).apply(null,arguments)},h._dispose_data=function(){return(h._dispose_data=h.asm.dispose_data).apply(null,arguments)},h._dispose=function(){return(h._dispose=h.asm.dispose).apply(null,arguments)},h._Abs=function(){return(h._Abs=h.asm.Abs).apply(null,arguments)},h._Acos=function(){return(h._Acos=h.asm.Acos).apply(null,arguments)},h._Acosh=function(){return(h._Acosh=h.asm.Acosh).apply(null,arguments)},h._Add=function(){return(h._Add=h.asm.Add).apply(null,arguments)},h._AddN=function(){return(h._AddN=h.asm.AddN).apply(null,arguments)},h._All=function(){return(h._All=h.asm.All).apply(null,arguments)},h._Any=function(){return(h._Any=h.asm.Any).apply(null,arguments)},h._ArgMax=function(){return(h._ArgMax=h.asm.ArgMax).apply(null,arguments)},h._ArgMin=function(){return(h._ArgMin=h.asm.ArgMin).apply(null,arguments)},h._Asin=function(){return(h._Asin=h.asm.Asin).apply(null,arguments)},h._Asinh=function(){return(h._Asinh=h.asm.Asinh).apply(null,arguments)},h._Atan=function(){return(h._Atan=h.asm.Atan).apply(null,arguments)},h._Atan2=function(){return(h._Atan2=h.asm.Atan2).apply(null,arguments)},h._Atanh=function(){return(h._Atanh=h.asm.Atanh).apply(null,arguments)},h._AvgPool=function(){return(h._AvgPool=h.asm.AvgPool).apply(null,arguments)},h._AvgPool3D=function(){return(h._AvgPool3D=h.asm.AvgPool3D).apply(null,arguments)},h._AvgPool3DGrad=function(){return(h._AvgPool3DGrad=h.asm.AvgPool3DGrad).apply(null,arguments)},h._AvgPoolGrad=function(){return(h._AvgPoolGrad=h.asm.AvgPoolGrad).apply(null,arguments)},h._BatchMatMul=function(){return(h._BatchMatMul=h.asm.BatchMatMul).apply(null,arguments)},h._Bincount=function(){return(h._Bincount=h.asm.Bincount).apply(null,arguments)},h._BitwiseAnd=function(){return(h._BitwiseAnd=h.asm.BitwiseAnd).apply(null,arguments)},h._Ceil=function(){return(h._Ceil=h.asm.Ceil).apply(null,arguments)},h._ClipByValue=function(){return(h._ClipByValue=h.asm.ClipByValue).apply(null,arguments)},h._Conv2D=function(){return(h._Conv2D=h.asm.Conv2D).apply(null,arguments)},h._Conv2DBackpropInput=function(){return(h._Conv2DBackpropInput=h.asm.Conv2DBackpropInput).apply(null,arguments)},h._Conv3D=function(){return(h._Conv3D=h.asm.Conv3D).apply(null,arguments)},h._Conv3DBackpropFilterV2=function(){return(h._Conv3DBackpropFilterV2=h.asm.Conv3DBackpropFilterV2).apply(null,arguments)},h._Conv3DBackpropInputV2=function(){return(h._Conv3DBackpropInputV2=h.asm.Conv3DBackpropInputV2).apply(null,arguments)},h._Cos=function(){return(h._Cos=h.asm.Cos).apply(null,arguments)},h._Cosh=function(){return(h._Cosh=h.asm.Cosh).apply(null,arguments)},h._CropAndResize=function(){return(h._CropAndResize=h.asm.CropAndResize).apply(null,arguments)},h._Cumprod=function(){return(h._Cumprod=h.asm.Cumprod).apply(null,arguments)},h._Cumsum=function(){return(h._Cumsum=h.asm.Cumsum).apply(null,arguments)},h._DenseBincount=function(){return(h._DenseBincount=h.asm.DenseBincount).apply(null,arguments)},h._DepthToSpace=function(){return(h._DepthToSpace=h.asm.DepthToSpace).apply(null,arguments)},h._DepthwiseConv2dNative=function(){return(h._DepthwiseConv2dNative=h.asm.DepthwiseConv2dNative).apply(null,arguments)},h._Diag=function(){return(h._Diag=h.asm.Diag).apply(null,arguments)},h._Dilation2D=function(){return(h._Dilation2D=h.asm.Dilation2D).apply(null,arguments)},h._Dilation2DBackpropFilter=function(){return(h._Dilation2DBackpropFilter=h.asm.Dilation2DBackpropFilter).apply(null,arguments)},h._Dilation2DBackpropInput=function(){return(h._Dilation2DBackpropInput=h.asm.Dilation2DBackpropInput).apply(null,arguments)},h._Elu=function(){return(h._Elu=h.asm.Elu).apply(null,arguments)},h._EluGrad=function(){return(h._EluGrad=h.asm.EluGrad).apply(null,arguments)},h._Equal=function(){return(h._Equal=h.asm.Equal).apply(null,arguments)},h._Erf=function(){return(h._Erf=h.asm.Erf).apply(null,arguments)},h._Exp=function(){return(h._Exp=h.asm.Exp).apply(null,arguments)},h._Expm1=function(){return(h._Expm1=h.asm.Expm1).apply(null,arguments)},h._FlipLeftRight=function(){return(h._FlipLeftRight=h.asm.FlipLeftRight).apply(null,arguments)},h._Floor=function(){return(h._Floor=h.asm.Floor).apply(null,arguments)},h._FloorDiv=function(){return(h._FloorDiv=h.asm.FloorDiv).apply(null,arguments)},h._FusedBatchNorm=function(){return(h._FusedBatchNorm=h.asm.FusedBatchNorm).apply(null,arguments)},h._FusedConv2D=function(){return(h._FusedConv2D=h.asm.FusedConv2D).apply(null,arguments)},h._FusedDepthwiseConv2D=function(){return(h._FusedDepthwiseConv2D=h.asm.FusedDepthwiseConv2D).apply(null,arguments)},h._Gather=function(){return(h._Gather=h.asm.Gather).apply(null,arguments)},h._GatherNd=function(){return(h._GatherNd=h.asm.GatherNd).apply(null,arguments)},h._Greater=function(){return(h._Greater=h.asm.Greater).apply(null,arguments)},h._GreaterEqual=function(){return(h._GreaterEqual=h.asm.GreaterEqual).apply(null,arguments)},h._IsFinite=function(){return(h._IsFinite=h.asm.IsFinite).apply(null,arguments)},h._IsInf=function(){return(h._IsInf=h.asm.IsInf).apply(null,arguments)},h._IsNan=function(){return(h._IsNan=h.asm.IsNan).apply(null,arguments)},h._LRN=function(){return(h._LRN=h.asm.LRN).apply(null,arguments)},h._LRNGrad=function(){return(h._LRNGrad=h.asm.LRNGrad).apply(null,arguments)},h._LeakyRelu=function(){return(h._LeakyRelu=h.asm.LeakyRelu).apply(null,arguments)},h._Less=function(){return(h._Less=h.asm.Less).apply(null,arguments)},h._LessEqual=function(){return(h._LessEqual=h.asm.LessEqual).apply(null,arguments)},h._LinSpace=function(){return(h._LinSpace=h.asm.LinSpace).apply(null,arguments)},h._Log=function(){return(h._Log=h.asm.Log).apply(null,arguments)},h._Log1p=function(){return(h._Log1p=h.asm.Log1p).apply(null,arguments)},h._LogicalAnd=function(){return(h._LogicalAnd=h.asm.LogicalAnd).apply(null,arguments)},h._LogicalNot=function(){return(h._LogicalNot=h.asm.LogicalNot).apply(null,arguments)},h._LogicalOr=function(){return(h._LogicalOr=h.asm.LogicalOr).apply(null,arguments)},h._LogicalXor=function(){return(h._LogicalXor=h.asm.LogicalXor).apply(null,arguments)},h._Max=function(){return(h._Max=h.asm.Max).apply(null,arguments)},h._MaxPool=function(){return(h._MaxPool=h.asm.MaxPool).apply(null,arguments)},h._MaxPool3D=function(){return(h._MaxPool3D=h.asm.MaxPool3D).apply(null,arguments)},h._MaxPool3DGrad=function(){return(h._MaxPool3DGrad=h.asm.MaxPool3DGrad).apply(null,arguments)},h._MaxPoolGrad=function(){return(h._MaxPoolGrad=h.asm.MaxPoolGrad).apply(null,arguments)},h._MaxPoolWithArgmax=function(){return(h._MaxPoolWithArgmax=h.asm.MaxPoolWithArgmax).apply(null,arguments)},h._Maximum=function(){return(h._Maximum=h.asm.Maximum).apply(null,arguments)},h._Mean=function(){return(h._Mean=h.asm.Mean).apply(null,arguments)},h._Min=function(){return(h._Min=h.asm.Min).apply(null,arguments)},h._Minimum=function(){return(h._Minimum=h.asm.Minimum).apply(null,arguments)},h._MirrorPad=function(){return(h._MirrorPad=h.asm.MirrorPad).apply(null,arguments)},h._Mod=function(){return(h._Mod=h.asm.Mod).apply(null,arguments)},h._Multinomial=function(){return(h._Multinomial=h.asm.Multinomial).apply(null,arguments)},h._Multiply=function(){return(h._Multiply=h.asm.Multiply).apply(null,arguments)},h._Neg=function(){return(h._Neg=h.asm.Neg).apply(null,arguments)},h._NonMaxSuppressionV3=function(){return(h._NonMaxSuppressionV3=h.asm.NonMaxSuppressionV3).apply(null,arguments)},h._NonMaxSuppressionV4=function(){return(h._NonMaxSuppressionV4=h.asm.NonMaxSuppressionV4).apply(null,arguments)},h._NonMaxSuppressionV5=function(){return(h._NonMaxSuppressionV5=h.asm.NonMaxSuppressionV5).apply(null,arguments)},h._NotEqual=function(){return(h._NotEqual=h.asm.NotEqual).apply(null,arguments)},h._OneHot=function(){return(h._OneHot=h.asm.OneHot).apply(null,arguments)},h._PadV2=function(){return(h._PadV2=h.asm.PadV2).apply(null,arguments)},h._Pow=function(){return(h._Pow=h.asm.Pow).apply(null,arguments)},h._Prelu=function(){return(h._Prelu=h.asm.Prelu).apply(null,arguments)},h._Prod=function(){return(h._Prod=h.asm.Prod).apply(null,arguments)},h._RealDiv=function(){return(h._RealDiv=h.asm.RealDiv).apply(null,arguments)},h._Reciprocal=function(){return(h._Reciprocal=h.asm.Reciprocal).apply(null,arguments)},h._Relu=function(){return(h._Relu=h.asm.Relu).apply(null,arguments)},h._Relu6=function(){return(h._Relu6=h.asm.Relu6).apply(null,arguments)},h._ResizeBilinear=function(){return(h._ResizeBilinear=h.asm.ResizeBilinear).apply(null,arguments)},h._ResizeBilinearGrad=function(){return(h._ResizeBilinearGrad=h.asm.ResizeBilinearGrad).apply(null,arguments)},h._ResizeNearestNeighbor=function(){return(h._ResizeNearestNeighbor=h.asm.ResizeNearestNeighbor).apply(null,arguments)},h._ResizeNearestNeighborGrad=function(){return(h._ResizeNearestNeighborGrad=h.asm.ResizeNearestNeighborGrad).apply(null,arguments)},h._Reverse=function(){return(h._Reverse=h.asm.Reverse).apply(null,arguments)},h._RotateWithOffset=function(){return(h._RotateWithOffset=h.asm.RotateWithOffset).apply(null,arguments)},h._Round=function(){return(h._Round=h.asm.Round).apply(null,arguments)},h._Rsqrt=function(){return(h._Rsqrt=h.asm.Rsqrt).apply(null,arguments)},h._ScatterNd=function(){return(h._ScatterNd=h.asm.ScatterNd).apply(null,arguments)},h._SearchSorted=function(){return(h._SearchSorted=h.asm.SearchSorted).apply(null,arguments)},h._SelectV2=function(){return(h._SelectV2=h.asm.SelectV2).apply(null,arguments)},h._Selu=function(){return(h._Selu=h.asm.Selu).apply(null,arguments)},h._Sigmoid=function(){return(h._Sigmoid=h.asm.Sigmoid).apply(null,arguments)},h._Sign=function(){return(h._Sign=h.asm.Sign).apply(null,arguments)},h._Sin=function(){return(h._Sin=h.asm.Sin).apply(null,arguments)},h._Sinh=function(){return(h._Sinh=h.asm.Sinh).apply(null,arguments)},h._Softmax=function(){return(h._Softmax=h.asm.Softmax).apply(null,arguments)},h._Softplus=function(){return(h._Softplus=h.asm.Softplus).apply(null,arguments)},h._SparseFillEmptyRows=function(){return(h._SparseFillEmptyRows=h.asm.SparseFillEmptyRows).apply(null,arguments)},h._SparseReshape=function(){return(h._SparseReshape=h.asm.SparseReshape).apply(null,arguments)},h._SparseSegmentReduction=function(){return(h._SparseSegmentReduction=h.asm.SparseSegmentReduction).apply(null,arguments)},h._SparseToDense=function(){return(h._SparseToDense=h.asm.SparseToDense).apply(null,arguments)},h._Sqrt=function(){return(h._Sqrt=h.asm.Sqrt).apply(null,arguments)},h._Square=function(){return(h._Square=h.asm.Square).apply(null,arguments)},h._SquaredDifference=function(){return(h._SquaredDifference=h.asm.SquaredDifference).apply(null,arguments)},h._Step=function(){return(h._Step=h.asm.Step).apply(null,arguments)},h._StridedSlice=function(){return(h._StridedSlice=h.asm.StridedSlice).apply(null,arguments)},h._Sub=function(){return(h._Sub=h.asm.Sub).apply(null,arguments)},h._Sum=function(){return(h._Sum=h.asm.Sum).apply(null,arguments)},h._Tan=function(){return(h._Tan=h.asm.Tan).apply(null,arguments)},h._Tanh=function(){return(h._Tanh=h.asm.Tanh).apply(null,arguments)},h._TensorScatterUpdate=function(){return(h._TensorScatterUpdate=h.asm.TensorScatterUpdate).apply(null,arguments)},h._Tile=function(){return(h._Tile=h.asm.Tile).apply(null,arguments)},h._TopK=function(){return(h._TopK=h.asm.TopK).apply(null,arguments)},h._Transform=function(){return(h._Transform=h.asm.Transform).apply(null,arguments)},h._Transpose=function(){return(h._Transpose=h.asm.Transpose).apply(null,arguments)},h.__FusedMatMul=function(){return(h.__FusedMatMul=h.asm._FusedMatMul).apply(null,arguments)},h._malloc=function(){return(h._malloc=h.asm.malloc).apply(null,arguments)},h._free=function(){return(h._free=h.asm.free).apply(null,arguments)},h.__emscripten_tls_init=function(){return(h.__emscripten_tls_init=h.asm._emscripten_tls_init).apply(null,arguments)},h._pthread_self=function(){return(ze=h._pthread_self=h.asm.pthread_self).apply(null,arguments)}),We=(h.___errno_location=function(){return(h.___errno_location=h.asm.__errno_location).apply(null,arguments)},h.__emscripten_thread_init=function(){return(We=h.__emscripten_thread_init=h.asm._emscripten_thread_init).apply(null,arguments)}),Ue=(h.__emscripten_thread_crashed=function(){return(h.__emscripten_thread_crashed=h.asm._emscripten_thread_crashed).apply(null,arguments)},h._emscripten_main_thread_process_queued_calls=function(){return(h._emscripten_main_thread_process_queued_calls=h.asm.emscripten_main_thread_process_queued_calls).apply(null,arguments)},h._emscripten_main_browser_thread_id=function(){return(h._emscripten_main_browser_thread_id=h.asm.emscripten_main_browser_thread_id).apply(null,arguments)},h._emscripten_run_in_main_runtime_thread_js=function(){return(Ue=h._emscripten_run_in_main_runtime_thread_js=h.asm.emscripten_run_in_main_runtime_thread_js).apply(null,arguments)}),Ve=(h._emscripten_dispatch_to_thread_=function(){return(h._emscripten_dispatch_to_thread_=h.asm.emscripten_dispatch_to_thread_).apply(null,arguments)},h.__emscripten_proxy_execute_task_queue=function(){return(Ve=h.__emscripten_proxy_execute_task_queue=h.asm._emscripten_proxy_execute_task_queue).apply(null,arguments)}),Ge=h.__emscripten_thread_free_data=function(){return(Ge=h.__emscripten_thread_free_data=h.asm._emscripten_thread_free_data).apply(null,arguments)},qe=h.__emscripten_thread_exit=function(){return(qe=h.__emscripten_thread_exit=h.asm._emscripten_thread_exit).apply(null,arguments)},He=h._emscripten_stack_set_limits=function(){return(He=h._emscripten_stack_set_limits=h.asm.emscripten_stack_set_limits).apply(null,arguments)},Ke=h.stackSave=function(){return(Ke=h.stackSave=h.asm.stackSave).apply(null,arguments)},Ye=h.stackRestore=function(){return(Ye=h.stackRestore=h.asm.stackRestore).apply(null,arguments)},Je=h.stackAlloc=function(){return(Je=h.stackAlloc=h.asm.stackAlloc).apply(null,arguments)};function Xe(e){if(e=e||w,!(re>0)){if(S)return d(h),te(),void startWorker(h);!function(){if(h.preRun)for("function"==typeof h.preRun&&(h.preRun=[h.preRun]);h.preRun.length;)e=h.preRun.shift(),X.unshift(e);var e;ge(X)}(),re>0||(h.setStatus?(h.setStatus("Running..."),setTimeout((function(){setTimeout((function(){h.setStatus("")}),1),t()}),1)):t())}function t(){Re||(Re=!0,h.calledRun=!0,V||(te(),d(h),h.onRuntimeInitialized&&h.onRuntimeInitialized(),function(){if(!S){if(h.postRun)for("function"==typeof h.postRun&&(h.postRun=[h.postRun]);h.postRun.length;)e=h.postRun.shift(),Z.unshift(e);var e;ge(Z)}}()))}}if(h.dynCall_iijjiiii=function(){return(h.dynCall_iijjiiii=h.asm.dynCall_iijjiiii).apply(null,arguments)},h.dynCall_jiji=function(){return(h.dynCall_jiji=h.asm.dynCall_jiji).apply(null,arguments)},h.keepRuntimeAlive=ee,h.wasmMemory=$,h.cwrap=function(e,t,n,r){var a=(n=n||[]).every((e=>"number"===e||"boolean"===e));return"string"!==t&&a&&!r?$e(e):function(){return Ce(e,t,n,arguments)}},h.ExitStatus=de,h.PThread=be,se=function e(){Re||Xe(),Re||(se=e)},h.preInit)for("function"==typeof h.preInit&&(h.preInit=[h.preInit]);h.preInit.length>0;)h.preInit.pop()();if(Xe(),f&&(Pe={uncaughtException:r.listeners("uncaughtException").filter((function(e){return!f.uncaughtException.indexOf(e)>-1})),unhandledRejection:r.listeners("unhandledRejection").filter((function(e){return!f.unhandledRejection.indexOf(e)>-1}))}),"undefined"!=typeof WasmBackendModule)Fe=WasmBackendModule;else{if("undefined"==typeof e)throw new Error("Could not find wasm module in post.js");Fe=e}if(Pe){var Qe=Fe._dispose;Fe._dispose=function(){Qe(),Pe.uncaughtException.forEach((function(e){r.removeListener("uncaughtException",e)})),Pe.unhandledRejection.forEach((function(e){r.removeListener("unhandledRejection",e)}))}}return e.ready});e.exports=i}).call(this,"/index.js",n(58),"/",n(63))},function(e,t,n){(function(t,r,a){var s,o=(s=(s="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||t,function(e){var t,o,i,u="undefined"!=typeof(e=e||{})?e:{};u.ready=new Promise((function(e,n){t=e,o=n})),"undefined"!=typeof r&&r.listeners&&(i={uncaughtException:r.listeners("uncaughtException"),unhandledRejection:r.listeners("unhandledRejection")});var c,l,d,p=Object.assign({},u),f=[],h="object"==typeof window,m="function"==typeof importScripts,b="object"==typeof r&&"object"==typeof r.versions&&"string"==typeof r.versions.node,g="";if(b){var y=n(98),w=n(99);g=m?w.dirname(g)+"/":a+"/",c=(e,t)=>(e=U(e)?new URL(e):w.normalize(e),y.readFileSync(e,t?void 0:"utf8")),d=e=>{var t=c(e,!0);return t.buffer||(t=new Uint8Array(t)),t},l=(e,t,n)=>{e=U(e)?new URL(e):w.normalize(e),y.readFile(e,(function(e,r){e?n(e):t(r.buffer)}))},r.argv.length>1&&r.argv[1].replace(/\\/g,"/"),f=r.argv.slice(2),r.on("uncaughtException",(function(e){if(!(e instanceof G))throw e})),r.on("unhandledRejection",(function(e){throw e})),u.inspect=function(){return"[Emscripten Module object]"}}else(h||m)&&(m?g=self.location.href:"undefined"!=typeof document&&document.currentScript&&(g=document.currentScript.src),s&&(g=s),g=0!==g.indexOf("blob:")?g.substr(0,g.replace(/[?#].*/,"").lastIndexOf("/")+1):"",c=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},m&&(d=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),l=(e,t,n)=>{var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)});var O,v=u.print||console.log.bind(console),j=u.printErr||console.warn.bind(console);Object.assign(u,p),p=null,u.arguments&&(f=u.arguments),u.thisProgram&&u.thisProgram,u.quit&&u.quit,u.wasmBinary&&(O=u.wasmBinary);var _;u.noExitRuntime;"object"!=typeof WebAssembly&&z("no native wasm support detected");var S,k,x,E,T=!1,N="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function A(e,t,n){for(var r=(t>>>=0)+n,a=t;e[a]&&!(a>=r);)++a;if(a-t>16&&e.buffer&&N)return N.decode(e.subarray(t,a));for(var s="";t<a;){var o=e[t++];if(128&o){var i=63&e[t++];if(192!=(224&o)){var u=63&e[t++];if((o=224==(240&o)?(15&o)<<12|i<<6|u:(7&o)<<18|i<<12|u<<6|63&e[t++])<65536)s+=String.fromCharCode(o);else{var c=o-65536;s+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else s+=String.fromCharCode((31&o)<<6|i)}else s+=String.fromCharCode(o)}return s}function M(e,t){return(e>>>=0)?A(x,e,t):""}function I(e){S=e,u.HEAP8=k=new Int8Array(e),u.HEAP16=new Int16Array(e),u.HEAP32=new Int32Array(e),u.HEAPU8=x=new Uint8Array(e),u.HEAPU16=new Uint16Array(e),u.HEAPU32=E=new Uint32Array(e),u.HEAPF32=new Float32Array(e),u.HEAPF64=new Float64Array(e)}u.INITIAL_MEMORY;var D,$,C=[],R=[],P=[],F=0,B=null,L=null;function z(e){u.onAbort&&u.onAbort(e),j(e="Aborted("+e+")"),T=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw o(t),t}function W(e){return e.startsWith("data:application/octet-stream;base64,")}function U(e){return e.startsWith("file://")}function V(e){try{if(e==D&&O)return new Uint8Array(O);if(d)return d(e);throw"both async and sync fetching of the wasm failed"}catch(e){z(e)}}function G(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function q(e){for(;e.length>0;)e.shift()(u)}function H(e){try{return _.grow(e-S.byteLength+65535>>>16),I(_.buffer),1}catch(e){}}W(D="tfjs-backend-wasm.wasm")||($=D,D=u.locateFile?u.locateFile($,g):g+$);var K=[null,[],[]];function Y(e,t){var n=K[e];0===t||10===t?((1===e?v:j)(A(n,0)),n.length=0):n.push(t)}function J(e){return u["_"+e]}function X(e,t,n,r,a){var s={string:e=>{var t=0;if(null!=e&&0!==e){var n=1+(e.length<<2);!function(e,t,n){!function(e,t,n,r){if(!(r>0))return 0;n>>>=0;for(var a=n+r-1,s=0;s<e.length;++s){var o=e.charCodeAt(s);if(o>=55296&&o<=57343&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++s)),o<=127){if(n>=a)break;t[n++>>>0]=o}else if(o<=2047){if(n+1>=a)break;t[n++>>>0]=192|o>>6,t[n++>>>0]=128|63&o}else if(o<=65535){if(n+2>=a)break;t[n++>>>0]=224|o>>12,t[n++>>>0]=128|o>>6&63,t[n++>>>0]=128|63&o}else{if(n+3>=a)break;t[n++>>>0]=240|o>>18,t[n++>>>0]=128|o>>12&63,t[n++>>>0]=128|o>>6&63,t[n++>>>0]=128|63&o}}t[n>>>0]=0}(e,x,t,n)}(e,t=ae(n),n)}return t},array:e=>{var t=ae(e.length);return function(e,t){k.set(e,t>>>0)}(e,t),t}},o=J(e),i=[],u=0;if(r)for(var c=0;c<r.length;c++){var l=s[n[c]];l?(0===u&&(u=ne()),i[c]=l(r[c])):i[c]=r[c]}var d=o.apply(null,i);return d=function(e){return 0!==u&&re(u),function(e){return"string"===t?M(e):"boolean"===t?Boolean(e):e}(e)}(d)}var Q,Z,ee,te={abort:function(){z("")},emscripten_get_heap_max:function(){return 4294901760},emscripten_memcpy_big:function(e,t,n){x.copyWithin(e>>>0,t>>>0,t+n>>>0)},emscripten_resize_heap:function(e){var t,n,r=x.length,a=4294901760;if((e>>>=0)>a)return!1;for(var s=1;s<=4;s*=2){var o=r*(1+.2/s);if(o=Math.min(o,e+100663296),H(Math.min(a,(t=Math.max(e,o))+((n=65536)-t%n)%n)))return!0}return!1},fd_close:function(e){return 52},fd_seek:function(e,t,n,r,a){return 70},fd_write:function(e,t,n,r){for(var a=0,s=0;s<n;s++){var o=E[t>>>2],i=E[t+4>>>2];t+=8;for(var u=0;u<i;u++)Y(e,x[o+u>>>0]);a+=i}return E[r>>>2]=a,0}},ne=(function(){var e={env:te,wasi_snapshot_preview1:te};function t(e,t){var n,r=e.exports;u.asm=r,I((_=u.asm.memory).buffer),u.asm.__indirect_function_table,n=u.asm.__wasm_call_ctors,R.unshift(n),function(e){if(F--,u.monitorRunDependencies&&u.monitorRunDependencies(F),0==F&&(null!==B&&(clearInterval(B),B=null),L)){var t=L;L=null,t()}}()}function n(e){t(e.instance)}function r(t){return function(){if(!O&&(h||m)){if("function"==typeof fetch&&!U(D))return fetch(D,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+D+"'";return e.arrayBuffer()})).catch((function(){return V(D)}));if(l)return new Promise((function(e,t){l(D,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return V(D)}))}().then((function(t){return WebAssembly.instantiate(t,e)})).then((function(e){return e})).then(t,(function(e){j("failed to asynchronously prepare wasm: "+e),z(e)}))}if(F++,u.monitorRunDependencies&&u.monitorRunDependencies(F),u.instantiateWasm)try{return u.instantiateWasm(e,t)}catch(e){j("Module.instantiateWasm callback failed with error: "+e),o(e)}(O||"function"!=typeof WebAssembly.instantiateStreaming||W(D)||U(D)||b||"function"!=typeof fetch?r(n):fetch(D,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(n,(function(e){return j("wasm streaming compile failed: "+e),j("falling back to ArrayBuffer instantiation"),r(n)}))}))).catch(o)}(),u.___wasm_call_ctors=function(){return(u.___wasm_call_ctors=u.asm.__wasm_call_ctors).apply(null,arguments)},u._init=function(){return(u._init=u.asm.init).apply(null,arguments)},u._init_with_threads_count=function(){return(u._init_with_threads_count=u.asm.init_with_threads_count).apply(null,arguments)},u._get_threads_count=function(){return(u._get_threads_count=u.asm.get_threads_count).apply(null,arguments)},u._register_tensor=function(){return(u._register_tensor=u.asm.register_tensor).apply(null,arguments)},u._dispose_data=function(){return(u._dispose_data=u.asm.dispose_data).apply(null,arguments)},u._dispose=function(){return(u._dispose=u.asm.dispose).apply(null,arguments)},u._Abs=function(){return(u._Abs=u.asm.Abs).apply(null,arguments)},u._Acos=function(){return(u._Acos=u.asm.Acos).apply(null,arguments)},u._Acosh=function(){return(u._Acosh=u.asm.Acosh).apply(null,arguments)},u._Add=function(){return(u._Add=u.asm.Add).apply(null,arguments)},u._AddN=function(){return(u._AddN=u.asm.AddN).apply(null,arguments)},u._All=function(){return(u._All=u.asm.All).apply(null,arguments)},u._Any=function(){return(u._Any=u.asm.Any).apply(null,arguments)},u._ArgMax=function(){return(u._ArgMax=u.asm.ArgMax).apply(null,arguments)},u._ArgMin=function(){return(u._ArgMin=u.asm.ArgMin).apply(null,arguments)},u._Asin=function(){return(u._Asin=u.asm.Asin).apply(null,arguments)},u._Asinh=function(){return(u._Asinh=u.asm.Asinh).apply(null,arguments)},u._Atan=function(){return(u._Atan=u.asm.Atan).apply(null,arguments)},u._Atan2=function(){return(u._Atan2=u.asm.Atan2).apply(null,arguments)},u._Atanh=function(){return(u._Atanh=u.asm.Atanh).apply(null,arguments)},u._AvgPool=function(){return(u._AvgPool=u.asm.AvgPool).apply(null,arguments)},u._AvgPool3D=function(){return(u._AvgPool3D=u.asm.AvgPool3D).apply(null,arguments)},u._AvgPool3DGrad=function(){return(u._AvgPool3DGrad=u.asm.AvgPool3DGrad).apply(null,arguments)},u._AvgPoolGrad=function(){return(u._AvgPoolGrad=u.asm.AvgPoolGrad).apply(null,arguments)},u._BatchMatMul=function(){return(u._BatchMatMul=u.asm.BatchMatMul).apply(null,arguments)},u._Bincount=function(){return(u._Bincount=u.asm.Bincount).apply(null,arguments)},u._BitwiseAnd=function(){return(u._BitwiseAnd=u.asm.BitwiseAnd).apply(null,arguments)},u._Ceil=function(){return(u._Ceil=u.asm.Ceil).apply(null,arguments)},u._ClipByValue=function(){return(u._ClipByValue=u.asm.ClipByValue).apply(null,arguments)},u._Conv2D=function(){return(u._Conv2D=u.asm.Conv2D).apply(null,arguments)},u._Conv2DBackpropInput=function(){return(u._Conv2DBackpropInput=u.asm.Conv2DBackpropInput).apply(null,arguments)},u._Conv3D=function(){return(u._Conv3D=u.asm.Conv3D).apply(null,arguments)},u._Conv3DBackpropFilterV2=function(){return(u._Conv3DBackpropFilterV2=u.asm.Conv3DBackpropFilterV2).apply(null,arguments)},u._Conv3DBackpropInputV2=function(){return(u._Conv3DBackpropInputV2=u.asm.Conv3DBackpropInputV2).apply(null,arguments)},u._Cos=function(){return(u._Cos=u.asm.Cos).apply(null,arguments)},u._Cosh=function(){return(u._Cosh=u.asm.Cosh).apply(null,arguments)},u._CropAndResize=function(){return(u._CropAndResize=u.asm.CropAndResize).apply(null,arguments)},u._Cumprod=function(){return(u._Cumprod=u.asm.Cumprod).apply(null,arguments)},u._Cumsum=function(){return(u._Cumsum=u.asm.Cumsum).apply(null,arguments)},u._DenseBincount=function(){return(u._DenseBincount=u.asm.DenseBincount).apply(null,arguments)},u._DepthToSpace=function(){return(u._DepthToSpace=u.asm.DepthToSpace).apply(null,arguments)},u._DepthwiseConv2dNative=function(){return(u._DepthwiseConv2dNative=u.asm.DepthwiseConv2dNative).apply(null,arguments)},u._Diag=function(){return(u._Diag=u.asm.Diag).apply(null,arguments)},u._Dilation2D=function(){return(u._Dilation2D=u.asm.Dilation2D).apply(null,arguments)},u._Dilation2DBackpropFilter=function(){return(u._Dilation2DBackpropFilter=u.asm.Dilation2DBackpropFilter).apply(null,arguments)},u._Dilation2DBackpropInput=function(){return(u._Dilation2DBackpropInput=u.asm.Dilation2DBackpropInput).apply(null,arguments)},u._Elu=function(){return(u._Elu=u.asm.Elu).apply(null,arguments)},u._EluGrad=function(){return(u._EluGrad=u.asm.EluGrad).apply(null,arguments)},u._Equal=function(){return(u._Equal=u.asm.Equal).apply(null,arguments)},u._Erf=function(){return(u._Erf=u.asm.Erf).apply(null,arguments)},u._Exp=function(){return(u._Exp=u.asm.Exp).apply(null,arguments)},u._Expm1=function(){return(u._Expm1=u.asm.Expm1).apply(null,arguments)},u._FlipLeftRight=function(){return(u._FlipLeftRight=u.asm.FlipLeftRight).apply(null,arguments)},u._Floor=function(){return(u._Floor=u.asm.Floor).apply(null,arguments)},u._FloorDiv=function(){return(u._FloorDiv=u.asm.FloorDiv).apply(null,arguments)},u._FusedBatchNorm=function(){return(u._FusedBatchNorm=u.asm.FusedBatchNorm).apply(null,arguments)},u._FusedConv2D=function(){return(u._FusedConv2D=u.asm.FusedConv2D).apply(null,arguments)},u._FusedDepthwiseConv2D=function(){return(u._FusedDepthwiseConv2D=u.asm.FusedDepthwiseConv2D).apply(null,arguments)},u._Gather=function(){return(u._Gather=u.asm.Gather).apply(null,arguments)},u._GatherNd=function(){return(u._GatherNd=u.asm.GatherNd).apply(null,arguments)},u._Greater=function(){return(u._Greater=u.asm.Greater).apply(null,arguments)},u._GreaterEqual=function(){return(u._GreaterEqual=u.asm.GreaterEqual).apply(null,arguments)},u._IsFinite=function(){return(u._IsFinite=u.asm.IsFinite).apply(null,arguments)},u._IsInf=function(){return(u._IsInf=u.asm.IsInf).apply(null,arguments)},u._IsNan=function(){return(u._IsNan=u.asm.IsNan).apply(null,arguments)},u._LRN=function(){return(u._LRN=u.asm.LRN).apply(null,arguments)},u._LRNGrad=function(){return(u._LRNGrad=u.asm.LRNGrad).apply(null,arguments)},u._LeakyRelu=function(){return(u._LeakyRelu=u.asm.LeakyRelu).apply(null,arguments)},u._Less=function(){return(u._Less=u.asm.Less).apply(null,arguments)},u._LessEqual=function(){return(u._LessEqual=u.asm.LessEqual).apply(null,arguments)},u._LinSpace=function(){return(u._LinSpace=u.asm.LinSpace).apply(null,arguments)},u._Log=function(){return(u._Log=u.asm.Log).apply(null,arguments)},u._Log1p=function(){return(u._Log1p=u.asm.Log1p).apply(null,arguments)},u._LogicalAnd=function(){return(u._LogicalAnd=u.asm.LogicalAnd).apply(null,arguments)},u._LogicalNot=function(){return(u._LogicalNot=u.asm.LogicalNot).apply(null,arguments)},u._LogicalOr=function(){return(u._LogicalOr=u.asm.LogicalOr).apply(null,arguments)},u._LogicalXor=function(){return(u._LogicalXor=u.asm.LogicalXor).apply(null,arguments)},u._Max=function(){return(u._Max=u.asm.Max).apply(null,arguments)},u._MaxPool=function(){return(u._MaxPool=u.asm.MaxPool).apply(null,arguments)},u._MaxPool3D=function(){return(u._MaxPool3D=u.asm.MaxPool3D).apply(null,arguments)},u._MaxPool3DGrad=function(){return(u._MaxPool3DGrad=u.asm.MaxPool3DGrad).apply(null,arguments)},u._MaxPoolGrad=function(){return(u._MaxPoolGrad=u.asm.MaxPoolGrad).apply(null,arguments)},u._MaxPoolWithArgmax=function(){return(u._MaxPoolWithArgmax=u.asm.MaxPoolWithArgmax).apply(null,arguments)},u._Maximum=function(){return(u._Maximum=u.asm.Maximum).apply(null,arguments)},u._Mean=function(){return(u._Mean=u.asm.Mean).apply(null,arguments)},u._Min=function(){return(u._Min=u.asm.Min).apply(null,arguments)},u._Minimum=function(){return(u._Minimum=u.asm.Minimum).apply(null,arguments)},u._MirrorPad=function(){return(u._MirrorPad=u.asm.MirrorPad).apply(null,arguments)},u._Mod=function(){return(u._Mod=u.asm.Mod).apply(null,arguments)},u._Multinomial=function(){return(u._Multinomial=u.asm.Multinomial).apply(null,arguments)},u._Multiply=function(){return(u._Multiply=u.asm.Multiply).apply(null,arguments)},u._Neg=function(){return(u._Neg=u.asm.Neg).apply(null,arguments)},u._NonMaxSuppressionV3=function(){return(u._NonMaxSuppressionV3=u.asm.NonMaxSuppressionV3).apply(null,arguments)},u._NonMaxSuppressionV4=function(){return(u._NonMaxSuppressionV4=u.asm.NonMaxSuppressionV4).apply(null,arguments)},u._NonMaxSuppressionV5=function(){return(u._NonMaxSuppressionV5=u.asm.NonMaxSuppressionV5).apply(null,arguments)},u._NotEqual=function(){return(u._NotEqual=u.asm.NotEqual).apply(null,arguments)},u._OneHot=function(){return(u._OneHot=u.asm.OneHot).apply(null,arguments)},u._PadV2=function(){return(u._PadV2=u.asm.PadV2).apply(null,arguments)},u._Pow=function(){return(u._Pow=u.asm.Pow).apply(null,arguments)},u._Prelu=function(){return(u._Prelu=u.asm.Prelu).apply(null,arguments)},u._Prod=function(){return(u._Prod=u.asm.Prod).apply(null,arguments)},u._RealDiv=function(){return(u._RealDiv=u.asm.RealDiv).apply(null,arguments)},u._Reciprocal=function(){return(u._Reciprocal=u.asm.Reciprocal).apply(null,arguments)},u._Relu=function(){return(u._Relu=u.asm.Relu).apply(null,arguments)},u._Relu6=function(){return(u._Relu6=u.asm.Relu6).apply(null,arguments)},u._ResizeBilinear=function(){return(u._ResizeBilinear=u.asm.ResizeBilinear).apply(null,arguments)},u._ResizeBilinearGrad=function(){return(u._ResizeBilinearGrad=u.asm.ResizeBilinearGrad).apply(null,arguments)},u._ResizeNearestNeighbor=function(){return(u._ResizeNearestNeighbor=u.asm.ResizeNearestNeighbor).apply(null,arguments)},u._ResizeNearestNeighborGrad=function(){return(u._ResizeNearestNeighborGrad=u.asm.ResizeNearestNeighborGrad).apply(null,arguments)},u._Reverse=function(){return(u._Reverse=u.asm.Reverse).apply(null,arguments)},u._RotateWithOffset=function(){return(u._RotateWithOffset=u.asm.RotateWithOffset).apply(null,arguments)},u._Round=function(){return(u._Round=u.asm.Round).apply(null,arguments)},u._Rsqrt=function(){return(u._Rsqrt=u.asm.Rsqrt).apply(null,arguments)},u._ScatterNd=function(){return(u._ScatterNd=u.asm.ScatterNd).apply(null,arguments)},u._SearchSorted=function(){return(u._SearchSorted=u.asm.SearchSorted).apply(null,arguments)},u._SelectV2=function(){return(u._SelectV2=u.asm.SelectV2).apply(null,arguments)},u._Selu=function(){return(u._Selu=u.asm.Selu).apply(null,arguments)},u._Sigmoid=function(){return(u._Sigmoid=u.asm.Sigmoid).apply(null,arguments)},u._Sign=function(){return(u._Sign=u.asm.Sign).apply(null,arguments)},u._Sin=function(){return(u._Sin=u.asm.Sin).apply(null,arguments)},u._Sinh=function(){return(u._Sinh=u.asm.Sinh).apply(null,arguments)},u._Softmax=function(){return(u._Softmax=u.asm.Softmax).apply(null,arguments)},u._Softplus=function(){return(u._Softplus=u.asm.Softplus).apply(null,arguments)},u._SparseFillEmptyRows=function(){return(u._SparseFillEmptyRows=u.asm.SparseFillEmptyRows).apply(null,arguments)},u._SparseReshape=function(){return(u._SparseReshape=u.asm.SparseReshape).apply(null,arguments)},u._SparseSegmentReduction=function(){return(u._SparseSegmentReduction=u.asm.SparseSegmentReduction).apply(null,arguments)},u._SparseToDense=function(){return(u._SparseToDense=u.asm.SparseToDense).apply(null,arguments)},u._Sqrt=function(){return(u._Sqrt=u.asm.Sqrt).apply(null,arguments)},u._Square=function(){return(u._Square=u.asm.Square).apply(null,arguments)},u._SquaredDifference=function(){return(u._SquaredDifference=u.asm.SquaredDifference).apply(null,arguments)},u._Step=function(){return(u._Step=u.asm.Step).apply(null,arguments)},u._StridedSlice=function(){return(u._StridedSlice=u.asm.StridedSlice).apply(null,arguments)},u._Sub=function(){return(u._Sub=u.asm.Sub).apply(null,arguments)},u._Sum=function(){return(u._Sum=u.asm.Sum).apply(null,arguments)},u._Tan=function(){return(u._Tan=u.asm.Tan).apply(null,arguments)},u._Tanh=function(){return(u._Tanh=u.asm.Tanh).apply(null,arguments)},u._TensorScatterUpdate=function(){return(u._TensorScatterUpdate=u.asm.TensorScatterUpdate).apply(null,arguments)},u._Tile=function(){return(u._Tile=u.asm.Tile).apply(null,arguments)},u._TopK=function(){return(u._TopK=u.asm.TopK).apply(null,arguments)},u._Transform=function(){return(u._Transform=u.asm.Transform).apply(null,arguments)},u._Transpose=function(){return(u._Transpose=u.asm.Transpose).apply(null,arguments)},u.__FusedMatMul=function(){return(u.__FusedMatMul=u.asm._FusedMatMul).apply(null,arguments)},u._malloc=function(){return(u._malloc=u.asm.malloc).apply(null,arguments)},u._free=function(){return(u._free=u.asm.free).apply(null,arguments)},u.___errno_location=function(){return(u.___errno_location=u.asm.__errno_location).apply(null,arguments)},u.stackSave=function(){return(ne=u.stackSave=u.asm.stackSave).apply(null,arguments)}),re=u.stackRestore=function(){return(re=u.stackRestore=u.asm.stackRestore).apply(null,arguments)},ae=u.stackAlloc=function(){return(ae=u.stackAlloc=u.asm.stackAlloc).apply(null,arguments)};function se(e){function n(){Q||(Q=!0,u.calledRun=!0,T||(q(R),t(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),function(){if(u.postRun)for("function"==typeof u.postRun&&(u.postRun=[u.postRun]);u.postRun.length;)e=u.postRun.shift(),P.unshift(e);var e;q(P)}()))}e=e||f,F>0||(function(){if(u.preRun)for("function"==typeof u.preRun&&(u.preRun=[u.preRun]);u.preRun.length;)e=u.preRun.shift(),C.unshift(e);var e;q(C)}(),F>0||(u.setStatus?(u.setStatus("Running..."),setTimeout((function(){setTimeout((function(){u.setStatus("")}),1),n()}),1)):n()))}if(u.dynCall_iijjiiii=function(){return(u.dynCall_iijjiiii=u.asm.dynCall_iijjiiii).apply(null,arguments)},u.dynCall_jiji=function(){return(u.dynCall_jiji=u.asm.dynCall_jiji).apply(null,arguments)},u.cwrap=function(e,t,n,r){var a=(n=n||[]).every((e=>"number"===e||"boolean"===e));return"string"!==t&&a&&!r?J(e):function(){return X(e,t,n,arguments)}},L=function e(){Q||se(),Q||(L=e)},u.preInit)for("function"==typeof u.preInit&&(u.preInit=[u.preInit]);u.preInit.length>0;)u.preInit.pop()();if(se(),i&&(Z={uncaughtException:r.listeners("uncaughtException").filter((function(e){return!i.uncaughtException.indexOf(e)>-1})),unhandledRejection:r.listeners("unhandledRejection").filter((function(e){return!i.unhandledRejection.indexOf(e)>-1}))}),"undefined"!=typeof e)ee=e;else{if("undefined"==typeof WasmBackendModuleThreadedSimd)throw new Error("Could not find wasm module in post.js");ee=WasmBackendModuleThreadedSimd}if(Z){var oe=ee._dispose;ee._dispose=function(){oe(),Z.uncaughtException.forEach((function(e){r.removeListener("uncaughtException",e)})),Z.unhandledRejection.forEach((function(e){r.removeListener("unhandledRejection",e)}))}}return e.ready});e.exports=o}).call(this,"/index.js",n(58),"/")},function(e,t,n){"use strict";(function(e){var r=n(128),a=n(129),s=n(130);function o(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(e,t){if(o()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return d(this,e)}return c(this,e,t,n)}function c(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=p(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|h(t,n),a=(e=i(e,r)).write(t,n);a!==r&&(e=e.slice(0,a));return e}(e,t,n):function(e,t){if(u.isBuffer(t)){var n=0|f(t.length);return 0===(e=i(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?i(e,0):p(e,t);if("Buffer"===t.type&&s(t.data))return p(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function d(e,t){if(l(t),e=i(e,t<0?0:0|f(t)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function p(e,t){var n=t.length<0?0:0|f(t.length);e=i(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function f(e){if(e>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function h(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return W(e).length;default:if(r)return z(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return A(this,t,n);case"utf8":case"utf-8":return x(this,t,n);case"ascii":return T(this,t,n);case"latin1":case"binary":return N(this,t,n);case"base64":return k(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function b(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,a){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=a?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(a)return-1;n=e.length-1}else if(n<0){if(!a)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,a);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,a);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,a){var s,o=1,i=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,i/=2,u/=2,n/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(a){var l=-1;for(s=n;s<i;s++)if(c(e,s)===c(t,-1===l?0:s-l)){if(-1===l&&(l=s),s-l+1===u)return l*o}else-1!==l&&(s-=s-l),l=-1}else for(n+u>i&&(n=i-u),s=n;s>=0;s--){for(var d=!0,p=0;p<u;p++)if(c(e,s+p)!==c(t,p)){d=!1;break}if(d)return s}return-1}function w(e,t,n,r){n=Number(n)||0;var a=e.length-n;r?(r=Number(r))>a&&(r=a):r=a;var s=t.length;if(s%2!=0)throw new TypeError("Invalid hex string");r>s/2&&(r=s/2);for(var o=0;o<r;++o){var i=parseInt(t.substr(2*o,2),16);if(isNaN(i))return o;e[n+o]=i}return o}function O(e,t,n,r){return U(z(t,e.length-n),e,n,r)}function v(e,t,n,r){return U(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function j(e,t,n,r){return v(e,t,n,r)}function _(e,t,n,r){return U(W(t),e,n,r)}function S(e,t,n,r){return U(function(e,t){for(var n,r,a,s=[],o=0;o<e.length&&!((t-=2)<0);++o)r=(n=e.charCodeAt(o))>>8,a=n%256,s.push(a),s.push(r);return s}(t,e.length-n),e,n,r)}function k(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function x(e,t,n){n=Math.min(e.length,n);for(var r=[],a=t;a<n;){var s,o,i,u,c=e[a],l=null,d=c>239?4:c>223?3:c>191?2:1;if(a+d<=n)switch(d){case 1:c<128&&(l=c);break;case 2:128==(192&(s=e[a+1]))&&(u=(31&c)<<6|63&s)>127&&(l=u);break;case 3:s=e[a+1],o=e[a+2],128==(192&s)&&128==(192&o)&&(u=(15&c)<<12|(63&s)<<6|63&o)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:s=e[a+1],o=e[a+2],i=e[a+3],128==(192&s)&&128==(192&o)&&128==(192&i)&&(u=(15&c)<<18|(63&s)<<12|(63&o)<<6|63&i)>65535&&u<1114112&&(l=u)}null===l?(l=65533,d=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),a+=d}return function(e){var t=e.length;if(t<=E)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=E));return n}(r)}t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=o(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,n){return c(null,e,t,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,n){return function(e,t,n,r){return l(t),t<=0?i(e,t):void 0!==n?"string"==typeof r?i(e,t).fill(n,r):i(e,t).fill(n):i(e,t)}(null,e,t,n)},u.allocUnsafe=function(e){return d(null,e)},u.allocUnsafeSlow=function(e){return d(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,a=0,s=Math.min(n,r);a<s;++a)if(e[a]!==t[a]){n=e[a],r=t[a];break}return n<r?-1:r<n?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!s(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=u.allocUnsafe(t),a=0;for(n=0;n<e.length;++n){var o=e[n];if(!u.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,a),a+=o.length}return r},u.byteLength=h,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)b(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)b(this,t,t+3),b(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)b(this,t,t+7),b(this,t+1,t+6),b(this,t+2,t+5),b(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?x(this,0,e):m.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,n,r,a){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===a&&(a=this.length),t<0||n>e.length||r<0||a>this.length)throw new RangeError("out of range index");if(r>=a&&t>=n)return 0;if(r>=a)return-1;if(t>=n)return 1;if(this===e)return 0;for(var s=(a>>>=0)-(r>>>=0),o=(n>>>=0)-(t>>>=0),i=Math.min(s,o),c=this.slice(r,a),l=e.slice(t,n),d=0;d<i;++d)if(c[d]!==l[d]){s=c[d],o=l[d];break}return s<o?-1:o<s?1:0},u.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},u.prototype.indexOf=function(e,t,n){return g(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return g(this,e,t,n,!1)},u.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var a=this.length-t;if((void 0===n||n>a)&&(n=a),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var s=!1;;)switch(r){case"hex":return w(this,e,t,n);case"utf8":case"utf-8":return O(this,e,t,n);case"ascii":return v(this,e,t,n);case"latin1":case"binary":return j(this,e,t,n);case"base64":return _(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,n);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var E=4096;function T(e,t,n){var r="";n=Math.min(e.length,n);for(var a=t;a<n;++a)r+=String.fromCharCode(127&e[a]);return r}function N(e,t,n){var r="";n=Math.min(e.length,n);for(var a=t;a<n;++a)r+=String.fromCharCode(e[a]);return r}function A(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var a="",s=t;s<n;++s)a+=L(e[s]);return a}function M(e,t,n){for(var r=e.slice(t,n),a="",s=0;s<r.length;s+=2)a+=String.fromCharCode(r[s]+256*r[s+1]);return a}function I(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,n,r,a,s){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||t<s)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function $(e,t,n,r){t<0&&(t=65535+t+1);for(var a=0,s=Math.min(e.length-n,2);a<s;++a)e[n+a]=(t&255<<8*(r?a:1-a))>>>8*(r?a:1-a)}function C(e,t,n,r){t<0&&(t=4294967295+t+1);for(var a=0,s=Math.min(e.length-n,4);a<s;++a)e[n+a]=t>>>8*(r?a:3-a)&255}function R(e,t,n,r,a,s){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function P(e,t,n,r,s){return s||R(e,0,n,4),a.write(e,t,n,r,23,4),n+4}function F(e,t,n,r,s){return s||R(e,0,n,8),a.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=u.prototype;else{var a=t-e;n=new u(a,void 0);for(var s=0;s<a;++s)n[s]=this[s+e]}return n},u.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var r=this[e],a=1,s=0;++s<t&&(a*=256);)r+=this[e+s]*a;return r},u.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var r=this[e+--t],a=1;t>0&&(a*=256);)r+=this[e+--t]*a;return r},u.prototype.readUInt8=function(e,t){return t||I(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||I(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||I(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||I(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var r=this[e],a=1,s=0;++s<t&&(a*=256);)r+=this[e+s]*a;return r>=(a*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var r=t,a=1,s=this[e+--r];r>0&&(a*=256);)s+=this[e+--r]*a;return s>=(a*=128)&&(s-=Math.pow(2,8*t)),s},u.prototype.readInt8=function(e,t){return t||I(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||I(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||I(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||I(e,4,this.length),a.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||I(e,4,this.length),a.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||I(e,8,this.length),a.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||I(e,8,this.length),a.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||D(this,e,t,n,Math.pow(2,8*n)-1,0);var a=1,s=0;for(this[t]=255&e;++s<n&&(a*=256);)this[t+s]=e/a&255;return t+n},u.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||D(this,e,t,n,Math.pow(2,8*n)-1,0);var a=n-1,s=1;for(this[t+a]=255&e;--a>=0&&(s*=256);)this[t+a]=e/s&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):$(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):$(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):C(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var a=Math.pow(2,8*n-1);D(this,e,t,n,a-1,-a)}var s=0,o=1,i=0;for(this[t]=255&e;++s<n&&(o*=256);)e<0&&0===i&&0!==this[t+s-1]&&(i=1),this[t+s]=(e/o>>0)-i&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var a=Math.pow(2,8*n-1);D(this,e,t,n,a-1,-a)}var s=n-1,o=1,i=0;for(this[t+s]=255&e;--s>=0&&(o*=256);)e<0&&0===i&&0!==this[t+s+1]&&(i=1),this[t+s]=(e/o>>0)-i&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):$(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):$(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):C(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return P(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return P(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return F(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return F(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var a,s=r-n;if(this===e&&n<t&&t<r)for(a=s-1;a>=0;--a)e[a+t]=this[a+n];else if(s<1e3||!u.TYPED_ARRAY_SUPPORT)for(a=0;a<s;++a)e[a+t]=this[a+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+s),t);return s},u.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var a=e.charCodeAt(0);a<256&&(e=a)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var s;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(s=t;s<n;++s)this[s]=e;else{var o=u.isBuffer(e)?e:z(new u(e,r).toString()),i=o.length;for(s=0;s<n-t;++s)this[s+t]=o[s%i]}return this};var B=/[^+\/0-9A-Za-z-_]/g;function L(e){return e<16?"0"+e.toString(16):e.toString(16)}function z(e,t){var n;t=t||1/0;for(var r=e.length,a=null,s=[],o=0;o<r;++o){if((n=e.charCodeAt(o))>55295&&n<57344){if(!a){if(n>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&s.push(239,191,189);continue}a=n;continue}if(n<56320){(t-=3)>-1&&s.push(239,191,189),a=n;continue}n=65536+(a-55296<<10|n-56320)}else a&&(t-=3)>-1&&s.push(239,191,189);if(a=null,n<128){if((t-=1)<0)break;s.push(n)}else if(n<2048){if((t-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function W(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(B,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function U(e,t,n,r){for(var a=0;a<r&&!(a+n>=t.length||a>=e.length);++a)t[a+n]=e[a];return a}}).call(this,n(63))},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return a}));const r="undefined"!=typeof requestAnimationFrame?requestAnimationFrame:"undefined"!=typeof e?e:e=>e();function a(){return new Promise((e=>r((()=>e()))))}}).call(this,n(139).setImmediate)},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.r(t),n.d(t,"AdadeltaOptimizer",(function(){return dt})),n.d(t,"AdagradOptimizer",(function(){return ft})),n.d(t,"AdamOptimizer",(function(){return bt})),n.d(t,"AdamaxOptimizer",(function(){return wt})),n.d(t,"MomentumOptimizer",(function(){return vt})),n.d(t,"Optimizer",(function(){return lt})),n.d(t,"OptimizerConstructors",(function(){return _t})),n.d(t,"RMSPropOptimizer",(function(){return jt})),n.d(t,"SGDOptimizer",(function(){return Ot})),n.d(t,"Tensor",(function(){return Z.a})),n.d(t,"TensorBuffer",(function(){return Z.b})),n.d(t,"Variable",(function(){return Z.c})),n.d(t,"Rank",(function(){return St.a})),n.d(t,"sumOutType",(function(){return St.d})),n.d(t,"upcastType",(function(){return St.e})),n.d(t,"abs",(function(){return gt})),n.d(t,"acos",(function(){return kt})),n.d(t,"acosh",(function(){return xt})),n.d(t,"add",(function(){return tt.add})),n.d(t,"addN",(function(){return Et})),n.d(t,"all",(function(){return Tt})),n.d(t,"any",(function(){return Nt})),n.d(t,"argMax",(function(){return At})),n.d(t,"argMin",(function(){return Mt})),n.d(t,"asin",(function(){return It})),n.d(t,"asinh",(function(){return Dt})),n.d(t,"atan",(function(){return $t})),n.d(t,"atan2",(function(){return Ct})),n.d(t,"atanh",(function(){return Rt})),n.d(t,"avgPool",(function(){return Pt.avgPool})),n.d(t,"avgPool3d",(function(){return Lt})),n.d(t,"basicLSTMCell",(function(){return Gt})),n.d(t,"batchToSpaceND",(function(){return qt})),n.d(t,"batchNorm",(function(){return Ht})),n.d(t,"batchNorm2d",(function(){return Kt})),n.d(t,"batchNorm3d",(function(){return Yt})),n.d(t,"batchNorm4d",(function(){return Jt})),n.d(t,"bincount",(function(){return Xt})),n.d(t,"bitwiseAnd",(function(){return Qt})),n.d(t,"broadcastArgs",(function(){return Zt})),n.d(t,"broadcastTo",(function(){return tn})),n.d(t,"buffer",(function(){return nn.a})),n.d(t,"cast",(function(){return U.a})),n.d(t,"ceil",(function(){return rn})),n.d(t,"clipByValue",(function(){return an})),n.d(t,"clone",(function(){return en.a})),n.d(t,"complex",(function(){return sn.a})),n.d(t,"concat",(function(){return zt.concat})),n.d(t,"concat1d",(function(){return on})),n.d(t,"concat2d",(function(){return un})),n.d(t,"concat3d",(function(){return cn})),n.d(t,"concat4d",(function(){return ln})),n.d(t,"conv1d",(function(){return pn})),n.d(t,"conv2d",(function(){return dn.a})),n.d(t,"conv2dTranspose",(function(){return hn})),n.d(t,"conv3d",(function(){return mn})),n.d(t,"conv3dTranspose",(function(){return gn})),n.d(t,"cos",(function(){return yn})),n.d(t,"cosh",(function(){return wn})),n.d(t,"cumprod",(function(){return On})),n.d(t,"cumsum",(function(){return vn})),n.d(t,"denseBincount",(function(){return jn})),n.d(t,"depthToSpace",(function(){return _n})),n.d(t,"depthwiseConv2d",(function(){return Sn.a})),n.d(t,"diag",(function(){return kn})),n.d(t,"dilation2d",(function(){return xn})),n.d(t,"div",(function(){return rt})),n.d(t,"divNoNan",(function(){return Nn})),n.d(t,"dot",(function(){return An})),n.d(t,"einsum",(function(){return Mn})),n.d(t,"elu",(function(){return In.a})),n.d(t,"ensureShape",(function(){return Dn})),n.d(t,"equal",(function(){return En})),n.d(t,"erf",(function(){return $n})),n.d(t,"euclideanNorm",(function(){return Kn})),n.d(t,"exp",(function(){return Yn})),n.d(t,"expandDims",(function(){return Jn})),n.d(t,"expm1",(function(){return Xn})),n.d(t,"eye",(function(){return Zn})),n.d(t,"fill",(function(){return pt})),n.d(t,"floor",(function(){return er})),n.d(t,"floorDiv",(function(){return nt})),n.d(t,"gather",(function(){return tr})),n.d(t,"greater",(function(){return nr})),n.d(t,"greaterEqual",(function(){return rr})),n.d(t,"imag",(function(){return ar.a})),n.d(t,"isFinite",(function(){return sr})),n.d(t,"isInf",(function(){return or})),n.d(t,"isNaN",(function(){return ir})),n.d(t,"leakyRelu",(function(){return ur.a})),n.d(t,"less",(function(){return cr})),n.d(t,"lessEqual",(function(){return lr})),n.d(t,"linspace",(function(){return dr})),n.d(t,"localResponseNormalization",(function(){return pr})),n.d(t,"log",(function(){return fr})),n.d(t,"log1p",(function(){return hr})),n.d(t,"logSigmoid",(function(){return gr})),n.d(t,"logSoftmax",(function(){return yr})),n.d(t,"logSumExp",(function(){return wr})),n.d(t,"logicalAnd",(function(){return Or})),n.d(t,"logicalNot",(function(){return vr})),n.d(t,"logicalOr",(function(){return jr})),n.d(t,"logicalXor",(function(){return _r})),n.d(t,"lowerBound",(function(){return xr})),n.d(t,"matMul",(function(){return V.a})),n.d(t,"max",(function(){return Un})),n.d(t,"maxPool",(function(){return Er})),n.d(t,"maxPool3d",(function(){return Tr})),n.d(t,"maxPoolWithArgmax",(function(){return Nr})),n.d(t,"maximum",(function(){return yt.maximum})),n.d(t,"mean",(function(){return Ar.mean})),n.d(t,"meshgrid",(function(){return Dr})),n.d(t,"min",(function(){return Vn})),n.d(t,"minimum",(function(){return $r.minimum})),n.d(t,"mirrorPad",(function(){return Cr})),n.d(t,"mod",(function(){return Rr})),n.d(t,"moments",(function(){return Pr})),n.d(t,"mul",(function(){return at.mul})),n.d(t,"multiRNNCell",(function(){return Fr})),n.d(t,"multinomial",(function(){return Br})),n.d(t,"neg",(function(){return mr.a})),n.d(t,"notEqual",(function(){return Lr})),n.d(t,"oneHot",(function(){return K})),n.d(t,"ones",(function(){return Ir})),n.d(t,"onesLike",(function(){return zr})),n.d(t,"outerProduct",(function(){return Wr})),n.d(t,"pad",(function(){return Ur.pad})),n.d(t,"pad1d",(function(){return Vr})),n.d(t,"pad2d",(function(){return Gr})),n.d(t,"pad3d",(function(){return qr})),n.d(t,"pad4d",(function(){return Hr})),n.d(t,"pool",(function(){return Yr})),n.d(t,"pow",(function(){return ht})),n.d(t,"prelu",(function(){return Jr.a})),n.d(t,"print",(function(){return Xr.a})),n.d(t,"prod",(function(){return Qr})),n.d(t,"raggedGather",(function(){return Zr})),n.d(t,"raggedRange",(function(){return ea})),n.d(t,"raggedTensorToTensor",(function(){return ta})),n.d(t,"rand",(function(){return na})),n.d(t,"randomGamma",(function(){return ia})),n.d(t,"randomNormal",(function(){return ua})),n.d(t,"randomStandardNormal",(function(){return ca})),n.d(t,"randomUniform",(function(){return la})),n.d(t,"randomUniformInt",(function(){return da})),n.d(t,"range",(function(){return pa})),n.d(t,"real",(function(){return fa.a})),n.d(t,"reciprocal",(function(){return ha})),n.d(t,"relu",(function(){return ma.relu})),n.d(t,"relu6",(function(){return ba.relu6})),n.d(t,"reshape",(function(){return Bt.reshape})),n.d(t,"reverse",(function(){return ga})),n.d(t,"reverse1d",(function(){return ya})),n.d(t,"reverse2d",(function(){return wa})),n.d(t,"reverse3d",(function(){return Oa})),n.d(t,"reverse4d",(function(){return va})),n.d(t,"round",(function(){return ja})),n.d(t,"rsqrt",(function(){return _a})),n.d(t,"scalar",(function(){return ct})),n.d(t,"selu",(function(){return Sa})),n.d(t,"separableConv2d",(function(){return ka})),n.d(t,"setdiff1dAsync",(function(){return xa})),n.d(t,"sigmoid",(function(){return Wt.sigmoid})),n.d(t,"sign",(function(){return Ea})),n.d(t,"sin",(function(){return Ta})),n.d(t,"sinh",(function(){return Na})),n.d(t,"slice",(function(){return Ut})),n.d(t,"slice1d",(function(){return Aa})),n.d(t,"slice2d",(function(){return Ma})),n.d(t,"slice3d",(function(){return Ia})),n.d(t,"slice4d",(function(){return Da})),n.d(t,"softmax",(function(){return $a.softmax})),n.d(t,"softplus",(function(){return br})),n.d(t,"spaceToBatchND",(function(){return Kr})),n.d(t,"fft",(function(){return Ca})),n.d(t,"ifft",(function(){return Ra})),n.d(t,"irfft",(function(){return Pa})),n.d(t,"rfft",(function(){return Ba})),n.d(t,"split",(function(){return Fa})),n.d(t,"sqrt",(function(){return st})),n.d(t,"square",(function(){return ot})),n.d(t,"squaredDifference",(function(){return La})),n.d(t,"squeeze",(function(){return za.squeeze})),n.d(t,"stack",(function(){return Wa.stack})),n.d(t,"step",(function(){return Ua.a})),n.d(t,"stridedSlice",(function(){return Va.stridedSlice})),n.d(t,"sub",(function(){return mt})),n.d(t,"sum",(function(){return Gn.a})),n.d(t,"tan",(function(){return Ga})),n.d(t,"tanh",(function(){return Vt})),n.d(t,"tensor",(function(){return qa.a})),n.d(t,"tensor1d",(function(){return Ha.tensor1d})),n.d(t,"tensor2d",(function(){return Ka})),n.d(t,"tensor3d",(function(){return te})),n.d(t,"tensor4d",(function(){return Ya})),n.d(t,"tensor5d",(function(){return Ja})),n.d(t,"tensor6d",(function(){return Xa})),n.d(t,"tensorScatterUpdate",(function(){return Qa})),n.d(t,"tile",(function(){return Qn})),n.d(t,"topk",(function(){return Za})),n.d(t,"truncatedNormal",(function(){return es})),n.d(t,"unique",(function(){return ts})),n.d(t,"unsortedSegmentSum",(function(){return ns})),n.d(t,"unstack",(function(){return rs})),n.d(t,"upperBound",(function(){return as})),n.d(t,"variable",(function(){return ss})),n.d(t,"where",(function(){return Tn})),n.d(t,"whereAsync",(function(){return is})),n.d(t,"zeros",(function(){return Mr})),n.d(t,"zerosLike",(function(){return it})),n.d(t,"booleanMaskAsync",(function(){return us})),n.d(t,"transpose",(function(){return Y.transpose})),n.d(t,"norm",(function(){return Hn})),n.d(t,"movingAverage",(function(){return cs})),n.d(t,"scatterND",(function(){return ls})),n.d(t,"searchSorted",(function(){return kr})),n.d(t,"sparseToDense",(function(){return ds})),n.d(t,"gatherND",(function(){return ps})),n.d(t,"dropout",(function(){return fs})),n.d(t,"enclosingPowerOfTwo",(function(){return hs})),n.d(t,"cosineWindow",(function(){return ms})),n.d(t,"inTopKAsync",(function(){return bs})),n.d(t,"op",(function(){return H.b})),n.d(t,"OP_SCOPE_SUFFIX",(function(){return H.a})),n.d(t,"image",(function(){return po})),n.d(t,"linalg",(function(){return fo})),n.d(t,"losses",(function(){return ho})),n.d(t,"spectral",(function(){return co})),n.d(t,"fused",(function(){return d})),n.d(t,"signal",(function(){return lo})),n.d(t,"sparse",(function(){return mo})),n.d(t,"string",(function(){return bo})),n.d(t,"Reduction",(function(){return Zs})),n.d(t,"train",(function(){return go})),n.d(t,"enableProdMode",(function(){return et.g})),n.d(t,"enableDebugMode",(function(){return et.f})),n.d(t,"disableDeprecationWarnings",(function(){return et.c})),n.d(t,"deprecationWarn",(function(){return et.b})),n.d(t,"disposeVariables",(function(){return et.e})),n.d(t,"engine",(function(){return et.h})),n.d(t,"memory",(function(){return et.m})),n.d(t,"profile",(function(){return et.n})),n.d(t,"tidy",(function(){return et.t})),n.d(t,"dispose",(function(){return et.d})),n.d(t,"keep",(function(){return et.l})),n.d(t,"time",(function(){return et.u})),n.d(t,"setBackend",(function(){return et.r})),n.d(t,"ready",(function(){return et.o})),n.d(t,"getBackend",(function(){return et.k})),n.d(t,"removeBackend",(function(){return et.q})),n.d(t,"findBackend",(function(){return et.i})),n.d(t,"findBackendFactory",(function(){return et.j})),n.d(t,"registerBackend",(function(){return et.p})),n.d(t,"backend",(function(){return et.a})),n.d(t,"setPlatform",(function(){return et.s})),n.d(t,"getKernel",(function(){return Q.c})),n.d(t,"getGradient",(function(){return Q.b})),n.d(t,"getKernelsForBackend",(function(){return Q.d})),n.d(t,"registerKernel",(function(){return Q.f})),n.d(t,"registerGradient",(function(){return Q.e})),n.d(t,"unregisterKernel",(function(){return Q.h})),n.d(t,"unregisterGradient",(function(){return Q.g})),n.d(t,"copyRegisteredKernels",(function(){return Q.a})),n.d(t,"customGrad",(function(){return ut.a})),n.d(t,"grad",(function(){return ut.b})),n.d(t,"grads",(function(){return ut.c})),n.d(t,"valueAndGrad",(function(){return ut.d})),n.d(t,"valueAndGrads",(function(){return ut.e})),n.d(t,"variableGrads",(function(){return ut.f})),n.d(t,"Environment",(function(){return m.b})),n.d(t,"env",(function(){return m.c})),n.d(t,"ENV",(function(){return m.a})),n.d(t,"version_core",(function(){return Ze})),n.d(t,"nextFrame",(function(){return yo.a})),n.d(t,"browser",(function(){return s})),n.d(t,"io",(function(){return r})),n.d(t,"math",(function(){return a})),n.d(t,"serialization",(function(){return c})),n.d(t,"test_util",(function(){return l})),n.d(t,"util",(function(){return Be})),n.d(t,"backend_util",(function(){return f})),n.d(t,"broadcast_util",(function(){return X})),n.d(t,"tensor_util",(function(){return Fe})),n.d(t,"slice_util",(function(){return u})),n.d(t,"gather_util",(function(){return o})),n.d(t,"scatter_util",(function(){return i})),n.d(t,"device_util",(function(){return Si})),n.d(t,"kernel_impls",(function(){return h})),n.d(t,"KernelBackend",(function(){return ki.b})),n.d(t,"DataStorage",(function(){return ki.a})),n.d(t,"Abs",(function(){return q.a})),n.d(t,"Acos",(function(){return q.b})),n.d(t,"Acosh",(function(){return q.c})),n.d(t,"Add",(function(){return q.d})),n.d(t,"AddN",(function(){return q.e})),n.d(t,"All",(function(){return q.f})),n.d(t,"Any",(function(){return q.g})),n.d(t,"ArgMax",(function(){return q.h})),n.d(t,"ArgMin",(function(){return q.i})),n.d(t,"Asin",(function(){return q.j})),n.d(t,"Asinh",(function(){return q.k})),n.d(t,"Atan",(function(){return q.l})),n.d(t,"Atanh",(function(){return q.n})),n.d(t,"Atan2",(function(){return q.m})),n.d(t,"AvgPool",(function(){return q.o})),n.d(t,"AvgPoolGrad",(function(){return q.r})),n.d(t,"AvgPool3D",(function(){return q.p})),n.d(t,"AvgPool3DGrad",(function(){return q.q})),n.d(t,"BatchMatMul",(function(){return q.s})),n.d(t,"BatchToSpaceND",(function(){return q.t})),n.d(t,"Bincount",(function(){return q.u})),n.d(t,"BitwiseAnd",(function(){return q.v})),n.d(t,"BroadcastTo",(function(){return q.x})),n.d(t,"BroadcastArgs",(function(){return q.w})),n.d(t,"Cast",(function(){return q.y})),n.d(t,"Ceil",(function(){return q.z})),n.d(t,"ClipByValue",(function(){return q.A})),n.d(t,"Complex",(function(){return q.B})),n.d(t,"ComplexAbs",(function(){return q.C})),n.d(t,"Concat",(function(){return q.D})),n.d(t,"Conv2D",(function(){return q.E})),n.d(t,"Conv2DBackpropFilter",(function(){return q.F})),n.d(t,"Conv2DBackpropInput",(function(){return q.G})),n.d(t,"Conv3D",(function(){return q.H})),n.d(t,"Conv3DBackpropFilterV2",(function(){return q.I})),n.d(t,"Conv3DBackpropInputV2",(function(){return q.J})),n.d(t,"Cos",(function(){return q.K})),n.d(t,"Cosh",(function(){return q.L})),n.d(t,"Cumprod",(function(){return q.N})),n.d(t,"Cumsum",(function(){return q.O})),n.d(t,"CropAndResize",(function(){return q.M})),n.d(t,"DenseBincount",(function(){return q.P})),n.d(t,"DepthToSpace",(function(){return q.Q})),n.d(t,"DepthwiseConv2dNative",(function(){return q.R})),n.d(t,"DepthwiseConv2dNativeBackpropFilter",(function(){return q.S})),n.d(t,"DepthwiseConv2dNativeBackpropInput",(function(){return q.T})),n.d(t,"Diag",(function(){return q.U})),n.d(t,"Dilation2D",(function(){return q.V})),n.d(t,"Dilation2DBackpropInput",(function(){return q.X})),n.d(t,"Dilation2DBackpropFilter",(function(){return q.W})),n.d(t,"Draw",(function(){return q.Y})),n.d(t,"RealDiv",(function(){return q.vc})),n.d(t,"Einsum",(function(){return q.Z})),n.d(t,"Elu",(function(){return q.ab})),n.d(t,"EluGrad",(function(){return q.bb})),n.d(t,"Erf",(function(){return q.db})),n.d(t,"Equal",(function(){return q.cb})),n.d(t,"Exp",(function(){return q.eb})),n.d(t,"ExpandDims",(function(){return q.fb})),n.d(t,"Expm1",(function(){return q.gb})),n.d(t,"FFT",(function(){return q.hb})),n.d(t,"Fill",(function(){return q.ib})),n.d(t,"FlipLeftRight",(function(){return q.jb})),n.d(t,"Floor",(function(){return q.kb})),n.d(t,"FloorDiv",(function(){return q.lb})),n.d(t,"FusedBatchNorm",(function(){return q.nb})),n.d(t,"GatherV2",(function(){return q.rb})),n.d(t,"GatherNd",(function(){return q.qb})),n.d(t,"Greater",(function(){return q.sb})),n.d(t,"GreaterEqual",(function(){return q.tb})),n.d(t,"Identity",(function(){return q.vb})),n.d(t,"IFFT",(function(){return q.ub})),n.d(t,"Imag",(function(){return q.wb})),n.d(t,"IsFinite",(function(){return q.xb})),n.d(t,"IsInf",(function(){return q.yb})),n.d(t,"IsNan",(function(){return q.zb})),n.d(t,"LeakyRelu",(function(){return q.Cb})),n.d(t,"Less",(function(){return q.Db})),n.d(t,"LessEqual",(function(){return q.Eb})),n.d(t,"LinSpace",(function(){return q.Fb})),n.d(t,"Log",(function(){return q.Gb})),n.d(t,"Log1p",(function(){return q.Hb})),n.d(t,"LogicalAnd",(function(){return q.Jb})),n.d(t,"LogicalNot",(function(){return q.Kb})),n.d(t,"LogicalOr",(function(){return q.Lb})),n.d(t,"LogicalXor",(function(){return q.Mb})),n.d(t,"LogSoftmax",(function(){return q.Ib})),n.d(t,"LowerBound",(function(){return q.Nb})),n.d(t,"LRN",(function(){return q.Ab})),n.d(t,"LRNGrad",(function(){return q.Bb})),n.d(t,"MatrixBandPart",(function(){return q.Ob})),n.d(t,"Max",(function(){return q.Pb})),n.d(t,"Maximum",(function(){return q.Vb})),n.d(t,"MaxPool",(function(){return q.Qb})),n.d(t,"MaxPoolGrad",(function(){return q.Tb})),n.d(t,"MaxPool3D",(function(){return q.Rb})),n.d(t,"MaxPool3DGrad",(function(){return q.Sb})),n.d(t,"MaxPoolWithArgmax",(function(){return q.Ub})),n.d(t,"Mean",(function(){return q.Wb})),n.d(t,"Min",(function(){return q.Xb})),n.d(t,"Minimum",(function(){return q.Yb})),n.d(t,"MirrorPad",(function(){return q.Zb})),n.d(t,"Mod",(function(){return q.ac})),n.d(t,"Multinomial",(function(){return q.bc})),n.d(t,"Multiply",(function(){return q.cc})),n.d(t,"Neg",(function(){return q.dc})),n.d(t,"NotEqual",(function(){return q.hc})),n.d(t,"NonMaxSuppressionV3",(function(){return q.ec})),n.d(t,"NonMaxSuppressionV4",(function(){return q.fc})),n.d(t,"NonMaxSuppressionV5",(function(){return q.gc})),n.d(t,"OnesLike",(function(){return q.jc})),n.d(t,"OneHot",(function(){return q.ic})),n.d(t,"Pack",(function(){return q.kc})),n.d(t,"PadV2",(function(){return q.lc})),n.d(t,"Pool",(function(){return q.mc})),n.d(t,"Pow",(function(){return q.nc})),n.d(t,"Prelu",(function(){return q.oc})),n.d(t,"Prod",(function(){return q.pc})),n.d(t,"RaggedGather",(function(){return q.qc})),n.d(t,"RaggedRange",(function(){return q.rc})),n.d(t,"RaggedTensorToTensor",(function(){return q.sc})),n.d(t,"Range",(function(){return q.tc})),n.d(t,"Real",(function(){return q.uc})),n.d(t,"Reciprocal",(function(){return q.wc})),n.d(t,"Relu",(function(){return q.xc})),n.d(t,"Reshape",(function(){return q.zc})),n.d(t,"ResizeNearestNeighbor",(function(){return q.Cc})),n.d(t,"ResizeNearestNeighborGrad",(function(){return q.Dc})),n.d(t,"ResizeBilinear",(function(){return q.Ac})),n.d(t,"ResizeBilinearGrad",(function(){return q.Bc})),n.d(t,"Relu6",(function(){return q.yc})),n.d(t,"Reverse",(function(){return q.Ec})),n.d(t,"Round",(function(){return q.Gc})),n.d(t,"Rsqrt",(function(){return q.Hc})),n.d(t,"ScatterNd",(function(){return q.Ic})),n.d(t,"TensorScatterUpdate",(function(){return q.nd})),n.d(t,"SearchSorted",(function(){return q.Jc})),n.d(t,"Select",(function(){return q.Kc})),n.d(t,"Selu",(function(){return q.Lc})),n.d(t,"Slice",(function(){return q.Qc})),n.d(t,"Sin",(function(){return q.Oc})),n.d(t,"Sinh",(function(){return q.Pc})),n.d(t,"Sign",(function(){return q.Nc})),n.d(t,"Sigmoid",(function(){return q.Mc})),n.d(t,"Softplus",(function(){return q.Sc})),n.d(t,"Sqrt",(function(){return q.ad})),n.d(t,"Sum",(function(){return q.kd})),n.d(t,"SpaceToBatchND",(function(){return q.Tc})),n.d(t,"SplitV",(function(){return q.Zc})),n.d(t,"Softmax",(function(){return q.Rc})),n.d(t,"SparseFillEmptyRows",(function(){return q.Uc})),n.d(t,"SparseReshape",(function(){return q.Vc})),n.d(t,"SparseSegmentMean",(function(){return q.Wc})),n.d(t,"SparseSegmentSum",(function(){return q.Xc})),n.d(t,"SparseToDense",(function(){return q.Yc})),n.d(t,"SquaredDifference",(function(){return q.cd})),n.d(t,"Square",(function(){return q.bd})),n.d(t,"StaticRegexReplace",(function(){return q.dd})),n.d(t,"StridedSlice",(function(){return q.fd})),n.d(t,"StringNGrams",(function(){return q.gd})),n.d(t,"StringSplit",(function(){return q.hd})),n.d(t,"StringToHashBucketFast",(function(){return q.id})),n.d(t,"Sub",(function(){return q.jd})),n.d(t,"Tan",(function(){return q.ld})),n.d(t,"Tanh",(function(){return q.md})),n.d(t,"Tile",(function(){return q.od})),n.d(t,"TopK",(function(){return q.pd})),n.d(t,"Transform",(function(){return q.qd})),n.d(t,"Transpose",(function(){return q.rd})),n.d(t,"Unique",(function(){return q.sd})),n.d(t,"Unpack",(function(){return q.td})),n.d(t,"UnsortedSegmentSum",(function(){return q.ud})),n.d(t,"UpperBound",(function(){return q.vd})),n.d(t,"ZerosLike",(function(){return q.wd})),n.d(t,"Step",(function(){return q.ed})),n.d(t,"FromPixels",(function(){return q.mb})),n.d(t,"RotateWithOffset",(function(){return q.Fc})),n.d(t,"_FusedMatMul",(function(){return q.xd})),n.d(t,"FusedConv2D",(function(){return q.ob})),n.d(t,"FusedDepthwiseConv2D",(function(){return q.pb}));var r={};n.r(r),n.d(r,"copyModel",(function(){return z.b})),n.d(r,"listModels",(function(){return z.c})),n.d(r,"moveModel",(function(){return z.d})),n.d(r,"removeModel",(function(){return z.e})),n.d(r,"browserFiles",(function(){return j})),n.d(r,"browserHTTPRequest",(function(){return D})),n.d(r,"CompositeArrayBuffer",(function(){return y.a})),n.d(r,"concatenateArrayBuffers",(function(){return b.d})),n.d(r,"decodeWeights",(function(){return b.e})),n.d(r,"encodeWeights",(function(){return b.f})),n.d(r,"fromMemory",(function(){return P})),n.d(r,"fromMemorySync",(function(){return F})),n.d(r,"getLoadHandlers",(function(){return g.b})),n.d(r,"getModelArtifactsForJSON",(function(){return b.g})),n.d(r,"getModelArtifactsForJSONSync",(function(){return b.h})),n.d(r,"getModelArtifactsInfoForJSON",(function(){return b.i})),n.d(r,"getSaveHandlers",(function(){return g.c})),n.d(r,"getWeightSpecs",(function(){return b.k})),n.d(r,"http",(function(){return I})),n.d(r,"isHTTPScheme",(function(){return A})),n.d(r,"loadWeights",(function(){return E})),n.d(r,"registerLoadRouter",(function(){return g.d})),n.d(r,"registerSaveRouter",(function(){return g.e})),n.d(r,"weightsLoaderFactory",(function(){return T})),n.d(r,"withSaveHandler",(function(){return B})),n.d(r,"withSaveHandlerSync",(function(){return L}));var a={};n.r(a),n.d(a,"confusionMatrix",(function(){return J}));var s={};n.r(s),n.d(s,"fromPixelsAsync",(function(){return oe})),n.d(s,"toPixels",(function(){return ue})),n.d(s,"draw",(function(){return ce})),n.d(s,"fromPixels",(function(){return le}));var o={};n.r(o),n.d(o,"prepareAndValidate",(function(){return de}));var i={};n.r(i),n.d(i,"validateUpdateShape",(function(){return pe})),n.d(i,"validateInput",(function(){return fe})),n.d(i,"calculateShapes",(function(){return he}));var u={};n.r(u),n.d(u,"assertParamsValid",(function(){return me})),n.d(u,"maskToAxes",(function(){return be})),n.d(u,"computeOutShape",(function(){return ge})),n.d(u,"stridesWithElidedDims",(function(){return ye})),n.d(u,"getNormalizedAxes",(function(){return ve})),n.d(u,"startIndicesWithElidedDims",(function(){return je})),n.d(u,"stopIndicesWithElidedDims",(function(){return _e})),n.d(u,"stridesForAxis",(function(){return Se})),n.d(u,"startForAxis",(function(){return ke})),n.d(u,"stopForAxis",(function(){return xe})),n.d(u,"isSliceContinous",(function(){return Ee})),n.d(u,"computeFlatOffset",(function(){return Te})),n.d(u,"parseSliceParams",(function(){return Ne})),n.d(u,"sliceInfo",(function(){return Ae}));var c={};n.r(c),n.d(c,"Serializable",(function(){return $e})),n.d(c,"SerializationMap",(function(){return Ce})),n.d(c,"registerClass",(function(){return Re})),n.d(c,"getRegisteredName",(function(){return Pe}));var l={};n.r(l),n.d(l,"TEST_EPSILON_FLOAT16",(function(){return Le})),n.d(l,"expectArraysClose",(function(){return ze})),n.d(l,"testEpsilon",(function(){return We})),n.d(l,"expectPromiseToFail",(function(){return Ve})),n.d(l,"expectArraysEqual",(function(){return Ge})),n.d(l,"expectNumbersClose",(function(){return qe})),n.d(l,"expectValuesInRange",(function(){return Ke})),n.d(l,"expectArrayBuffersEqual",(function(){return Ye})),n.d(l,"encodeStrings",(function(){return Je})),n.d(l,"createVideoElement",(function(){return Xe})),n.d(l,"play",(function(){return Qe}));var d={};n.r(d),n.d(d,"conv2d",(function(){return gs.conv2d})),n.d(d,"depthwiseConv2d",(function(){return ys.depthwiseConv2d})),n.d(d,"matMul",(function(){return ws.matMul}));var p={};n.r(p),n.d(p,"segOpComputeOptimalWindowSize",(function(){return wi})),n.d(p,"computeOutShape",(function(){return Oi})),n.d(p,"collectGatherOpShapeInfo",(function(){return vi}));var f={};n.r(f),n.d(f,"axesAreInnerMostDims",(function(){return Cn})),n.d(f,"combineLocations",(function(){return Rn})),n.d(f,"computeOutAndReduceShapes",(function(){return Pn})),n.d(f,"expandShapeToKeepDim",(function(){return Fn})),n.d(f,"assertAxesAreInnerMostDims",(function(){return Bn})),n.d(f,"getAxesPermutation",(function(){return Ln})),n.d(f,"getUndoAxesPermutation",(function(){return zn})),n.d(f,"getInnerMostAxes",(function(){return Wn})),n.d(f,"getBroadcastDims",(function(){return X.getBroadcastDims})),n.d(f,"getReductionAxes",(function(){return X.getReductionAxes})),n.d(f,"assertAndGetBroadcastShape",(function(){return X.assertAndGetBroadcastShape})),n.d(f,"assertParamsConsistent",(function(){return wo})),n.d(f,"computeOutShape",(function(){return Oo})),n.d(f,"computeDilation2DInfo",(function(){return Ft.e})),n.d(f,"computePool2DInfo",(function(){return Ft.f})),n.d(f,"computePool3DInfo",(function(){return Ft.g})),n.d(f,"computeConv2DInfo",(function(){return Ft.b})),n.d(f,"computeConv3DInfo",(function(){return Ft.c})),n.d(f,"computeDefaultPad",(function(){return Ft.d})),n.d(f,"tupleValuesAreOne",(function(){return Ft.k})),n.d(f,"eitherStridesOrDilationsAreOne",(function(){return Ft.i})),n.d(f,"stridesOrDilationsArePositive",(function(){return Ft.j})),n.d(f,"convertConv2DDataFormat",(function(){return Ft.h})),n.d(f,"checkPadOnDimRoundingMode",(function(){return Ft.a})),n.d(f,"getFusedDyActivation",(function(){return jo.c})),n.d(f,"getFusedBiasGradient",(function(){return jo.b})),n.d(f,"applyActivation",(function(){return jo.a})),n.d(f,"shouldFuse",(function(){return jo.d})),n.d(f,"RowPartitionType",(function(){return vo})),n.d(f,"combineRaggedTensorToTensorShapes",(function(){return _o})),n.d(f,"getRowPartitionTypesHelper",(function(){return So})),n.d(f,"getRaggedRank",(function(){return ko})),n.d(f,"validateDefaultValueShape",(function(){return xo})),n.d(f,"PARALLELIZE_THRESHOLD",(function(){return Eo})),n.d(f,"computeOptimalWindowSize",(function(){return To})),n.d(f,"slice_util",(function(){return u})),n.d(f,"upcastType",(function(){return St.e})),n.d(f,"getImageCenter",(function(){return No})),n.d(f,"getReshaped",(function(){return Ao})),n.d(f,"getPermuted",(function(){return Mo})),n.d(f,"getReshapedPermuted",(function(){return Io})),n.d(f,"getSliceBeginCoords",(function(){return Do})),n.d(f,"getSliceSize",(function(){return $o})),n.d(f,"prepareAndValidate",(function(){return de})),n.d(f,"validateUpdateShape",(function(){return pe})),n.d(f,"validateInput",(function(){return fe})),n.d(f,"calculateShapes",(function(){return he})),n.d(f,"SELU_SCALEALPHA",(function(){return Co})),n.d(f,"SELU_SCALE",(function(){return Ro})),n.d(f,"ERF_P",(function(){return Po})),n.d(f,"ERF_A1",(function(){return Fo})),n.d(f,"ERF_A2",(function(){return Bo})),n.d(f,"ERF_A3",(function(){return Lo})),n.d(f,"ERF_A4",(function(){return zo})),n.d(f,"ERF_A5",(function(){return Wo})),n.d(f,"warn",(function(){return Uo.b})),n.d(f,"log",(function(){return Uo.a})),n.d(f,"mergeRealAndImagArrays",(function(){return Vo})),n.d(f,"splitRealAndImagArrays",(function(){return Go})),n.d(f,"complexWithEvenIndex",(function(){return qo})),n.d(f,"complexWithOddIndex",(function(){return Ho})),n.d(f,"getComplexWithIndex",(function(){return Ko})),n.d(f,"assignToTypedArray",(function(){return Yo})),n.d(f,"exponents",(function(){return Jo})),n.d(f,"exponent",(function(){return Xo})),n.d(f,"decodeEinsumEquation",(function(){return ei})),n.d(f,"getEinsumPermutation",(function(){return ti})),n.d(f,"checkEinsumDimSizes",(function(){return ni})),n.d(f,"getEinsumComputePath",(function(){return ri})),n.d(f,"isIdentityPermutation",(function(){return ai})),n.d(f,"prepareSplitSize",(function(){return oi})),n.d(f,"getSparseFillEmptyRowsIndicesDenseShapeMismatch",(function(){return ii})),n.d(f,"getSparseFillEmptyRowsNegativeIndexErrorMessage",(function(){return ui})),n.d(f,"getSparseFillEmptyRowsOutOfRangeIndexErrorMessage",(function(){return ci})),n.d(f,"getSparseReshapeMultipleNegativeOneOutputDimErrorMessage",(function(){return li})),n.d(f,"getSparseReshapeNegativeOutputDimErrorMessage",(function(){return di})),n.d(f,"getSparseReshapeEmptyTensorZeroOutputDimErrorMessage",(function(){return pi})),n.d(f,"getSparseReshapeInputOutputMultipleErrorMessage",(function(){return fi})),n.d(f,"getSparseReshapeInputOutputMismatchErrorMessage",(function(){return hi})),n.d(f,"getSparseSegmentReductionNegativeSegmentIdsErrorMessage",(function(){return mi})),n.d(f,"getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage",(function(){return bi})),n.d(f,"getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage",(function(){return gi})),n.d(f,"getSparseSegmentReductionIndicesOutOfRangeErrorMessage",(function(){return yi})),n.d(f,"segment_util",(function(){return p})),n.d(f,"fromUint8ToStringArray",(function(){return ji})),n.d(f,"fromStringArrayToUint8",(function(){return _i}));var h={};n.r(h),n.d(h,"nonMaxSuppressionV3Impl",(function(){return Ds})),n.d(h,"nonMaxSuppressionV4Impl",(function(){return $s})),n.d(h,"nonMaxSuppressionV5Impl",(function(){return Cs})),n.d(h,"whereImpl",(function(){return os}));n(77),n(79),n(62);var m=n(11),b=n(21),g=n(25),y=n(29);function w(e){return new Promise((e=>setTimeout(e))).then(e)}class O{constructor(e){if(!Object(m.c)().getBool("IS_BROWSER"))throw new Error("browserDownloads() cannot proceed because the current environment is not a browser.");e.startsWith(O.URL_SCHEME)&&(e=e.slice(O.URL_SCHEME.length)),null!=e&&0!==e.length||(e="model"),this.modelJsonFileName=e+".json",this.weightDataFileName=e+".weights.bin"}async save(e){if("undefined"==typeof document)throw new Error("Browser downloads are not supported in this environment since `document` is not present");const t=y.a.join(e.weightData),n=window.URL.createObjectURL(new Blob([t],{type:"application/octet-stream"}));if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserDownloads.save() does not support saving model topology in binary formats yet.");{const t=[{paths:["./"+this.weightDataFileName],weights:e.weightSpecs}],r=Object(b.j)(e,t),a=window.URL.createObjectURL(new Blob([JSON.stringify(r)],{type:"application/json"})),s=null==this.modelJsonAnchor?document.createElement("a"):this.modelJsonAnchor;if(s.download=this.modelJsonFileName,s.href=a,await w((()=>s.dispatchEvent(new MouseEvent("click")))),null!=e.weightData){const e=null==this.weightDataAnchor?document.createElement("a"):this.weightDataAnchor;e.download=this.weightDataFileName,e.href=n,await w((()=>e.dispatchEvent(new MouseEvent("click"))))}return{modelArtifactsInfo:Object(b.i)(e)}}}}O.URL_SCHEME="downloads://";class v{constructor(e){if(null==e||e.length<1)throw new Error(`When calling browserFiles, at least 1 file is required, but received ${e}`);this.jsonFile=e[0],this.weightsFiles=e.slice(1)}async load(){return new Promise(((e,t)=>{const n=new FileReader;n.onload=n=>{const r=JSON.parse(n.target.result),a=r.modelTopology;if(null==a)return void t(new Error(`modelTopology field is missing from file ${this.jsonFile.name}`));if(null==r.weightsManifest)return void t(new Error(`weightManifest field is missing from file ${this.jsonFile.name}`));if(0===this.weightsFiles.length)return void e({modelTopology:a});const s=Object(b.g)(r,(e=>this.loadWeights(e)));e(s)},n.onerror=e=>t(`Failed to read model topology and weights manifest JSON from file '${this.jsonFile.name}'. BrowserFiles supports loading Keras-style tf.Model artifacts only.`),n.readAsText(this.jsonFile)}))}loadWeights(e){const t=[],n=[];for(const r of e)t.push(...r.weights),n.push(...r.paths);const r=this.checkManifestAndWeightFiles(e),a=n.map((e=>this.loadWeightsFile(e,r[e])));return Promise.all(a).then((e=>[t,e]))}loadWeightsFile(e,t){return new Promise(((n,r)=>{const a=new FileReader;a.onload=e=>{const t=e.target.result;n(t)},a.onerror=t=>r(`Failed to weights data from file of path '${e}'.`),a.readAsArrayBuffer(t)}))}checkManifestAndWeightFiles(e){const t=[],n=this.weightsFiles.map((e=>Object(b.c)(e.name))),r={};for(const a of e)a.paths.forEach((e=>{const a=Object(b.c)(e);if(-1!==t.indexOf(a))throw new Error(`Duplicate file basename found in weights manifest: '${a}'`);if(t.push(a),-1===n.indexOf(a))throw new Error(`Weight file with basename '${a}' is not provided.`);r[e]=this.weightsFiles[n.indexOf(a)]}));if(t.length!==this.weightsFiles.length)throw new Error(`Mismatch in the number of files in weights manifest (${t.length}) and the number of weight files provided (${this.weightsFiles.length}).`);return r}}function j(e){return new v(e)}g.a.registerSaveRouter((e=>Object(m.c)().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(O.URL_SCHEME)?function(e="model"){return new O(e)}(e.slice(O.URL_SCHEME.length)):null));var _=n(8);function S(e,t,n,r){!function(e){Object(_.c)(null!=e&&Array.isArray(e)&&e.length>0,(()=>"promises must be a none empty array"))}(e),function(e,t){Object(_.c)(e>=0&&e<=1,(()=>`Progress fraction must be in range [0, 1], but got startFraction ${e}`)),Object(_.c)(t>=0&&t<=1,(()=>`Progress fraction must be in range [0, 1], but got endFraction ${t}`)),Object(_.c)(t>=e,(()=>`startFraction must be no more than endFraction, but got startFraction ${e} and endFraction ${t}`))}(n=null==n?0:n,r=null==r?1:r);let a=0;return Promise.all(e.map((s=>(s.then((s=>{const o=n+ ++a/e.length*(r-n);return t(o),s})),s))))}var k=n(69);async function x(e,t){null==t&&(t={});const n=null==t.fetchFunc?Object(m.c)().platform.fetch:t.fetchFunc,r=e.map((e=>n(e,t.requestInit,{isBinary:!0}))),a=(null==t.onProgress?await Promise.all(r):await S(r,t.onProgress,0,.5)).map((e=>e.arrayBuffer()));return null==t.onProgress?await Promise.all(a):await S(a,t.onProgress,.5,1)}async function E(e,t="",n,r){return T((e=>x(e,{requestInit:r})))(e,t,n)}function T(e){return async(t,n="",r)=>{const a=t.map((()=>!1)),s={},o=null!=r?r.map((()=>!1)):[],i=[];if(t.forEach(((e,t)=>{let n=0;e.weights.forEach((e=>{const u="quantization"in e?e.quantization.dtype:e.dtype,c=k.a[u]*_.O(e.shape),l=()=>{a[t]=!0,null==s[t]&&(s[t]=[]),s[t].push({manifestEntry:e,groupOffset:n,sizeBytes:c})};null!=r?r.forEach(((t,n)=>{t===e.name&&(l(),o[n]=!0)})):l(),i.push(e.name),n+=c}))})),!o.every((e=>e))){const e=r.filter(((e,t)=>!o[t]));throw new Error(`Could not find weights in manifest with names: ${e.join(", ")}. \nManifest JSON has weights with names: ${i.join(", ")}.`)}const u=a.reduce(((e,t,n)=>(t&&e.push(n),e)),[]),c=[];u.forEach((e=>{t[e].paths.forEach((e=>{const t=n+(n.endsWith("/")?"":"/")+e;c.push(t)}))}));const l=await e(c),d={};let p=0;return u.forEach((e=>{const n=t[e].paths.length,r=new y.a(l.slice(p,p+n));s[e].forEach((e=>{const t=r.slice(e.groupOffset,e.groupOffset+e.sizeBytes),n=Object(b.e)(t,[e.manifestEntry]);for(const e in n)d[e]=n[e]})),p+=n})),d}}class N{constructor(e,t){if(this.DEFAULT_METHOD="POST",null==t&&(t={}),this.weightPathPrefix=t.weightPathPrefix,this.onProgress=t.onProgress,this.weightUrlConverter=t.weightUrlConverter,null!=t.fetchFunc?(Object(_.c)("function"==typeof t.fetchFunc,(()=>"Must pass a function that matches the signature of `fetch` (see https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)")),this.fetch=t.fetchFunc):this.fetch=Object(m.c)().platform.fetch,Object(_.c)(null!=e&&e.length>0,(()=>"URL path for http must not be null, undefined or empty.")),Array.isArray(e)&&Object(_.c)(2===e.length,(()=>`URL paths for http must have a length of 2, (actual length is ${e.length}).`)),this.path=e,null!=t.requestInit&&null!=t.requestInit.body)throw new Error("requestInit is expected to have no pre-existing body, but has one.");this.requestInit=t.requestInit||{}}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserHTTPRequest.save() does not support saving model topology in binary formats yet.");const t=Object.assign({method:this.DEFAULT_METHOD},this.requestInit);t.body=new FormData;const n=[{paths:["./model.weights.bin"],weights:e.weightSpecs}],r=Object(b.j)(e,n);if(t.body.append("model.json",new Blob([JSON.stringify(r)],{type:"application/json"}),"model.json"),null!=e.weightData){const n=y.a.join(e.weightData);t.body.append("model.weights.bin",new Blob([n],{type:"application/octet-stream"}),"model.weights.bin")}const a=await this.fetch(this.path,t);if(a.ok)return{modelArtifactsInfo:Object(b.i)(e),responses:[a]};throw new Error(`BrowserHTTPRequest.save() failed due to HTTP response status ${a.status}.`)}async load(){const e=await this.fetch(this.path,this.requestInit);if(!e.ok)throw new Error(`Request to ${this.path} failed with status code ${e.status}. Please verify this URL points to the model JSON of the model to load.`);let t;try{t=await e.json()}catch(e){let t=`Failed to parse model JSON of response from ${this.path}.`;throw this.path.endsWith(".pb")?t+=" Your path contains a .pb file extension. Support for .pb models have been removed in TensorFlow.js 1.0 in favor of .json models. You can re-convert your Python TensorFlow model using the TensorFlow.js 1.0 conversion scripts or you can convert your.pb models with the 'pb2json'NPM script in the tensorflow/tfjs-converter repository.":t+=" Please make sure the server is serving valid JSON for this request.",new Error(t)}const n=t.modelTopology,r=t.weightsManifest;if(null==n&&null==r)throw new Error(`The JSON from HTTP path ${this.path} contains neither model topology or manifest for weights.`);return Object(b.g)(t,(e=>this.loadWeights(e)))}async loadWeights(e){const t=Array.isArray(this.path)?this.path[1]:this.path,[n,r]=function(e){const t=e.lastIndexOf("/"),n=e.lastIndexOf("?"),r=e.substring(0,t),a=n>t?e.substring(n):"";return[r+"/",a]}(t),a=this.weightPathPrefix||n,s=Object(b.k)(e),o=[],i=[];for(const t of e)for(const e of t.paths)null!=this.weightUrlConverter?i.push(this.weightUrlConverter(e)):o.push(a+e+r);this.weightUrlConverter&&o.push(...await Promise.all(i));return[s,await x(o,{requestInit:this.requestInit,fetchFunc:this.fetch,onProgress:this.onProgress})]}}function A(e){return null!=e.match(N.URL_SCHEME_REGEX)}N.URL_SCHEME_REGEX=/^https?:\/\//;const M=(e,t)=>{if("undefined"==typeof fetch&&(null==t||null==t.fetchFunc))return null;{let n=!0;if(n=Array.isArray(e)?e.every((e=>A(e))):A(e),n)return I(e,t)}return null};function I(e,t){return new N(e,t)}function D(e,t){return I(e,t)}g.a.registerSaveRouter(M),g.a.registerLoadRouter(M);class ${constructor(e){this.modelArtifacts=e}load(){return this.modelArtifacts}}class C{constructor(e){this.saveHandler=e}save(e){return this.saveHandler(e)}}class R{constructor(e){e.load&&(this.load=()=>Promise.resolve(e.load())),e.save&&(this.save=t=>Promise.resolve(e.save(t)))}}function P(e,t,n,r){const a=arguments;return new R(F(...a))}function F(e,t,n,r){if(1===arguments.length){return null!=e.modelTopology||null!=e.weightSpecs?new $(e):(console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."),new $({modelTopology:e}))}return console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."),new $({modelTopology:e,weightSpecs:t,weightData:n,trainingConfig:r})}function B(e){return new C(e)}function L(e){return new C(e)}var z=n(48),W=n(1),U=n(15),V=n(19),G=n(3),q=n(4),H=n(2);const K=Object(H.b)({oneHot_:function(e,t,n=1,r=0,a="int32"){if(t<2)throw new Error(`Error in oneHot: depth must be >=2, but it is ${t}`);const s={indices:Object(W.a)(e,"indices","oneHot","int32")},o={dtype:a,depth:t,onValue:n,offValue:r};return G.a.runKernel(q.ic,s,o)}});var Y=n(53);const J=Object(H.b)({confusionMatrix_:function(e,t,n){const r=Object(W.a)(e,"labels","confusionMatrix"),a=Object(W.a)(t,"predictions","confusionMatrix");_.c(null==n||n>0&&Number.isInteger(n),(()=>`If provided, numClasses must be a positive integer, but got ${n}`)),_.c(1===r.rank,(()=>`Expected the rank of labels to be 1, but got ${r.rank}`)),_.c(1===a.rank,(()=>`Expected the rank of predictions to be 1, but got ${a.rank}`)),_.c(r.shape[0]===a.shape[0],(()=>`Mismatch in the number of examples: ${r.shape[0]} vs. ${a.shape[0]}. Labels and predictions should have the same number of elements.`)),_.c(n>0&&Number.isInteger(n),(()=>`numClasses is required to be a positive integer, but got ${n}`));const s=K(Object(U.a)(r,"int32"),n),o=K(Object(U.a)(a,"int32"),n),i=Object(Y.transpose)(s),u=Object(V.a)(i,o);return Object(U.a)(u,"int32")}});var X=n(16),Q=n(38),Z=n(17),ee=n(30);function te(e,t,n){if(Object(_.e)(e),null!=t&&3!==t.length)throw new Error("tensor3d() requires shape to have three numbers");const r=Object(W.c)(e,n);if(3!==r.length&&1!==r.length)throw new Error("tensor3d() requires values to be number[][][] or flat/TypedArray");if(1===r.length&&null==t)throw new Error("tensor3d() requires shape to be provided when `values` are a flat array");return Object(ee.a)(e,t,r,n)}let ne,re=!1;function ae(e,t=3){if(t>4)throw new Error("Cannot construct Tensor with more than 4 channels from pixels.");if(null==e)throw new Error("pixels passed to tf.browser.fromPixels() can not be null");let n=!1,r=!1,a=!1,s=!1,o=!1,i=!1;if(e.data instanceof Uint8Array)n=!0;else if("undefined"!=typeof ImageData&&e instanceof ImageData)r=!0;else if("undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement)a=!0;else if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement)s=!0;else if(null!=e.getContext)o=!0;else{if(!("undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap))throw new Error(`pixels passed to tf.browser.fromPixels() must be either an HTMLVideoElement, HTMLImageElement, HTMLCanvasElement, ImageData in browser, or OffscreenCanvas, ImageData in webworker or {data: Uint32Array, width: number, height: number}, but was ${e.constructor.name}`);i=!0}if(null!=Object(Q.c)(q.mb,G.a.backendName)){const n={pixels:e},r={numChannels:t};return G.a.runKernel(q.mb,n,r)}const[u,c]=a?[e.videoWidth,e.videoHeight]:[e.width,e.height];let l,d;if(o)l=e.getContext("2d").getImageData(0,0,u,c).data;else if(r||n)l=e.data;else if(s||a||i){if(null==ne)if("undefined"==typeof document){if("undefined"==typeof OffscreenCanvas||"undefined"==typeof OffscreenCanvasRenderingContext2D)throw new Error("Cannot parse input in current context. Reason: OffscreenCanvas Context2D rendering is not supported.");ne=new OffscreenCanvas(1,1).getContext("2d")}else ne=document.createElement("canvas").getContext("2d",{willReadFrequently:!0});ne.canvas.width=u,ne.canvas.height=c,ne.drawImage(e,0,0,u,c),l=ne.getImageData(0,0,u,c).data}if(4===t)d=new Int32Array(l);else{const e=u*c;d=new Int32Array(e*t);for(let n=0;n<e;n++)for(let e=0;e<t;++e)d[n*t+e]=l[4*n+e]}return te(d,[c,u,t],"int32")}function se(e){return"undefined"!=typeof window&&"undefined"!=typeof ImageBitmap&&window.hasOwnProperty("createImageBitmap")&&!(e instanceof ImageBitmap)&&function(e){return null!=e&&0!==e.width&&0!==e.height}(e)&&!function(e){return null!=e&&e.data instanceof Uint8Array}(e)}async function oe(e,t=3){let n=null;if(Object(m.c)().getBool("WRAP_TO_IMAGEBITMAP")&&se(e)){let t;try{t=await createImageBitmap(e,{premultiplyAlpha:"none"})}catch(e){t=null}n=null!=t&&t.width===e.width&&t.height===e.height?t:e}else n=e;return ae(n,t)}function ie(e){if(2!==e.rank&&3!==e.rank)throw new Error(`toPixels only supports rank 2 or 3 tensors, got rank ${e.rank}.`);const t=2===e.rank?1:e.shape[2];if(t>4||2===t)throw new Error(`toPixels only supports depth of size 1, 3 or 4 but got ${t}`);if("float32"!==e.dtype&&"int32"!==e.dtype)throw new Error(`Unsupported type for toPixels: ${e.dtype}. Please use float32 or int32 tensors.`)}async function ue(e,t){let n=Object(W.a)(e,"img","toPixels");if(!(e instanceof Z.a)){const e=n;n=Object(U.a)(e,"int32"),e.dispose()}ie(n);const[r,a]=n.shape.slice(0,2),s=2===n.rank?1:n.shape[2],o=await n.data(),i="float32"===n.dtype?255:1,u=new Uint8ClampedArray(a*r*4);for(let e=0;e<r*a;++e){const t=[0,0,0,255];for(let r=0;r<s;r++){const a=o[e*s+r];if("float32"===n.dtype){if(a<0||a>1)throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${a}.`)}else if("int32"===n.dtype&&(a<0||a>255))throw new Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${a}.`);1===s?(t[0]=a*i,t[1]=a*i,t[2]=a*i):t[r]=a*i}const r=4*e;u[r+0]=Math.round(t[0]),u[r+1]=Math.round(t[1]),u[r+2]=Math.round(t[2]),u[r+3]=Math.round(t[3])}if(null!=t){if(!re){null!=Object(Q.c)(q.Y,G.a.backendName)&&(console.warn("tf.browser.toPixels is not efficient to draw tensor on canvas. Please try tf.browser.draw instead."),re=!0)}t.width=a,t.height=r;const e=t.getContext("2d"),n=new ImageData(u,a,r);e.putImageData(n,0,0)}return n!==e&&n.dispose(),u}function ce(e,t,n){let r=Object(W.a)(e,"img","draw");if(!(e instanceof Z.a)){const e=r;r=Object(U.a)(e,"int32"),e.dispose()}ie(r),function(e){const t=(null==e?void 0:e.alpha)||1;if(t>1||t<0)throw new Error(`Alpha value ${t} is suppoed to be in range [0 - 1].`)}(null==n?void 0:n.imageOptions);const a={image:r},s={canvas:t,options:n};G.a.runKernel(q.Y,a,s)}const le=Object(H.b)({fromPixels_:ae});function de(e,t){const n=e.shape.length,r=t.shape.length;if(n<1)throw new Error(`tf.gatherND() expects the input to be rank 1 or higher, but the rank was ${n}.`);if(r<1)throw new Error(`tf.gatherND() expects the indices to be rank 1 or higher, but the rank was ${r}.`);if("int32"!==t.dtype)throw new Error(`tf.gatherND() expects the indices to be int32 type, but the dtype was ${t.dtype}.`);if(t.shape[r-1]>n)throw new Error(`index innermost dimension length must be <= tensor rank; saw: ${t.shape[r-1]} vs. ${n}`);if(0===Object(_.O)(e.shape))throw new Error(`Requested more than 0 entries, but input is empty. Input shape: ${e.shape}.`);const a=t.shape,s=a[a.length-1];let o=1;for(let e=0;e<a.length-1;++e)o*=a[e];const i=e.shape,u=a.slice();u.pop();let c=1;for(let e=s;e<n;++e)c*=i[e],u.push(i[e]);const l=[...Object(_.k)(e.shape).map((e=>e/c)),1].slice(0,s);return[u,o,c,l]}function pe(e,t,n){const r=t.rank>1?t.shape[t.rank-1]:1,a=t.rank>1?t.rank-1:1,s=`Must have updates.shape = indices.shape[:batchDim] + shape[sliceDim:], got updates.shape: ${n.shape}, indices.shape: ${t.shape}, shape: ${e}, sliceDim: ${r}, and batchDim: ${a}.`;if(n.rank<a)throw new Error(s+` update.rank < ${a}. `);if(e.length<r+(n.rank-a))throw new Error(s+` Output shape length < ${r+(n.rank-a)}`);if(n.rank!==a+e.length-r)throw new Error(s+" update.rank != "+(a+e.length-r));for(let e=0;e<a;++e)if(n.shape[e]!==t.shape[e])throw new Error(s+` updates.shape[${e}] (${n.shape[e]}) != indices.shape[${e}] (${t.shape[e]}).`);for(let t=0;t<n.rank-a;++t)if(n.shape[t+a]!==e[t+r])throw new Error(s+` updates.shape[${t+a}] (${n.shape[t+a]}) != shape[${t+a}] (${e[t+a]})`)}function fe(e,t,n){if(t.rank<1)throw new Error(`tf.scatterND() expects the indices to be rank 1 or higher, but the rank was ${t.rank}.`);if(e.rank<1)throw new Error(`tf.scatterND() expects the updates to be rank 1 or higher, but the rank was ${e.rank}.`);if("int32"!==t.dtype)throw new Error(`The dtype of 'indices' should be int32, but got dtype: ${t.dtype}`);if(n.length<1)throw new Error(`Output rank must be greater or equal to 1, but got shape: ${n}`);if(0===n.length){if(0===t.size)throw new Error(`Indices specified for empty output. indices shape: ${t.shape}`);if(0===e.size)throw new Error(`Updates specified for empty output. updates shape: ${e.shape}`)}pe(n,t,e)}function he(e,t,n){const r=t.shape.length,a=r>1?t.shape[r-1]:1,s=n.length;let o=1;for(let e=a;e<s;++e)o*=n[e];const i=a<1?1:a;return{sliceRank:a,numUpdates:Object(_.O)(t.shape)/i,sliceSize:o,strides:[...Object(_.k)(n.slice(0,a)),1],outputSize:Object(_.O)(n)}}function me(e,t,n){const r=e.shape.length;_.c(r===t.length,(()=>`Error in slice${r}D: Length of begin ${t} must match the rank of the array (${r}).`)),_.c(r===n.length,(()=>`Error in slice${r}D: Length of size ${n} must match the rank of the array (${r}).`));for(let a=0;a<r;++a)_.c(t[a]+n[a]<=e.shape[a],(()=>`Error in slice${r}D: begin[${a}] + size[${a}] (${t[a]+n[a]}) would overflow input.shape[${a}] (${e.shape[a]})`))}function be(e){const t=[];let n=0;for(;e>0;)1&e&&t.push(n),e/=2,n++;return t}function ge(e,t,n){const r=[];for(let a=0;a<e.length;a++)r[a]=Math.ceil((t[a]-e[a])/n[a]);return r}function ye(e,t,n,r){const a=[...e];for(let e=a.length;e<r.length;e++)a.push(1);for(let e=0;e<n;e++)0===e?a[t]=1:(a.splice(t,0,1),a.pop());return a}function we(e,t,n){return n<=e?n:n-(t-1)}function Oe(e,t){const n=[];for(let r=0;r<e;r++)n.push(t+r);return n}function ve(e,t,n,r,a,s,o,i,u){const c=e.length;let l=new Array(c),d=new Array(c),p=new Array(c);if(t.length&&n>0){const u=t[0],c=n+1;l=je(o,u,c,r,e),d=_e(i,u,c,a,e),p=ye(s,u,c,e)}else for(let t=0;t<c;t++)l[t]=ke(o,r,s,e,t,u),d[t]=xe(i,a,s,e,t,u),p[t]=Se(s,t,u);return{begin:l,end:d,strides:p}}function je(e,t,n,r,a){const s=[...a],o=Oe(n,t);for(let a=0;a<s.length;a++)if(o.indexOf(a)>-1)s[a]=0;else{const o=we(t,n,a);let i=r[o];e&1<<o&&(i=0),s[a]=i}return s}function _e(e,t,n,r,a){const s=[...a],o=Oe(n,t);for(let a=0;a<s.length;a++)if(o.indexOf(a)>-1)s[a]=Number.MAX_SAFE_INTEGER;else{const o=we(t,n,a);let i=r[o];e&1<<o&&(i=Number.MAX_SAFE_INTEGER),s[a]=i}for(let e=0;e<s.length;e++){const t=a[e];s[e]<0&&(s[e]+=t),s[e]=_.j(0,s[e],a[e])}return s}function Se(e,t,n){let r=e[t];return(n&1<<t||null==r)&&(r=1),r}function ke(e,t,n,r,a,s){let o=t[a];const i=n[a]||1;(e&1<<a||s&1<<a||null==o)&&(o=i>0?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER);const u=r[a];return o<0&&(o+=u),o=_.j(0,o,u-1),o}function xe(e,t,n,r,a,s){let o=t[a];const i=n[a]||1;(e&1<<a||s&1<<a||null==o)&&(o=i>0?Number.MAX_SAFE_INTEGER:Number.MIN_SAFE_INTEGER);const u=r[a];return o<0&&(o+=u),o=i>0?_.j(0,o,u):_.j(-1,o,u-1),o}function Ee(e,t,n){let r=n.length;for(let e=0;e<n.length;e++)if(n[e]>1){r=e;break}for(let a=r+1;a<n.length;a++)if(t[a]>0||n[a]!==e[a])return!1;return!0}function Te(e,t){let n=e.length>0?e[e.length-1]:1;for(let r=0;r<e.length-1;r++)n+=e[r]*t[r];return n}function Ne(e,t,n){let r;const a=e.shape.length;let s;return r="number"==typeof t?[t,...new Array(a-1).fill(0)]:t.length<a?t.concat(new Array(a-t.length).fill(0)):t.slice(),r.forEach((e=>{_.c(-1!==e,(()=>"slice() does not support negative begin indexing."))})),s=null==n?new Array(a).fill(-1):"number"==typeof n?[n,...new Array(a-1).fill(-1)]:n.length<a?n.concat(new Array(a-n.length).fill(-1)):n,s=s.map(((t,n)=>t>=0?t:(_.c(-1===t,(()=>`Negative size values should be exactly -1 but got ${t} for the slice() size at index ${n}.`)),e.shape[n]-r[n]))),[r,s]}function Ae(e,t,n,r,a,s,o,i,u){let c;if(null==r?(c=new Array(t.length),c.fill(1)):c=r,null!=o&&0!=(o&o-1))throw new Error("Multiple ellipses in slice is not allowed.");let l=!1;const d={dims:c.length,numAddAxisAfterEllipsis:0,begin:t.slice(),end:n.slice(),strides:c.slice(),beginMask:a,endMask:s,ellipsisMask:o,newAxisMask:i,shrinkAxisMask:u};for(let e=0;e<d.dims;e++)l&&0!=(1<<e&i)&&d.numAddAxisAfterEllipsis++,1<<e&o&&(l=!0);l||(d.ellipsisMask|=1<<d.dims,d.dims++);const p={dims:e.length,beginMask:0,endMask:0,beginValid:!1,endValid:!1};!function(e,t){t.beginMask=0,t.endMask=0,t.shrinkAxisMask=0;let n=0;t.beginValid=null!=e.begin,t.endValid=null!=e.end,t.begin=new Array(t.dims),t.end=new Array(t.dims),t.strides=new Array(t.dims),t.finalShapeGatherIndices=[],t.finalShapeGatherIndicesSparse=[],t.inputShapeGatherIndicesSparse=new Array(t.dims);for(let r=0;r<e.dims;r++)if(1<<r&e.ellipsisMask){const a=Math.min(t.dims-(e.dims-r)+1+e.numAddAxisAfterEllipsis,t.dims);for(;n<a;n++)t.begin[n]=0,t.end[n]=0,t.strides[n]=1,t.beginMask|=1<<n,t.endMask|=1<<n,t.finalShapeGatherIndices.push(n),t.finalShapeGatherIndicesSparse.push(-1),t.inputShapeGatherIndicesSparse[n]=r}else if(1<<r&e.newAxisMask)t.finalShapeGatherIndices.push(-2),t.finalShapeGatherIndicesSparse.push(-1);else{if(n===t.begin.length)throw Error(`Index out of range using input dim ${n}; input has only ${t.dims} dims, ${t.begin.length}.`);null!=e.begin&&(t.begin[n]=e.begin[r]),null!=e.end&&(t.end[n]=e.end[r]),t.strides[n]=e.strides[r],e.beginMask&1<<r&&(t.beginMask|=1<<n),e.endMask&1<<r&&(t.endMask|=1<<n),e.shrinkAxisMask&1<<r?(t.finalShapeGatherIndices.push(-1),t.finalShapeGatherIndicesSparse.push(-1),t.shrinkAxisMask|=1<<n):(t.finalShapeGatherIndices.push(n),t.finalShapeGatherIndicesSparse.push(r)),t.inputShapeGatherIndicesSparse[n]=r,n++}}(d,p);let f=!0,h=!0,m=!0;const b=[],g=[];for(let t=0;t<e.length;++t){if(0===p.strides[t])throw Error(`strides[${t}] must be non-zero`);const n=!!(p.shrinkAxisMask&1<<t),r=e[t];if(-1===r){b.push(n?1:-1);continue}const a=[p.beginMask&1<<t,p.endMask&1<<t],s=[p.strides[t]>0?0:-1,p.strides[t]>0?r:r-1];if(n&&p.strides[t]<=0)throw Error("only stride 1 allowed on non-range indexing.");m=m&&1===p.strides[t];const o=!!(p.beginMask&1<<t&&p.endMask&1<<t);if(p.beginValid&&p.endValid){if(n){const e=p.begin[t]<0?r+p.begin[t]:p.begin[t];if(p.begin[t]=e,p.end[t]=p.begin[t]+1,e<0||e>=r)throw Error(`slice index ${p.begin[t]} of dimension ${t} out of bounds.`)}else p.begin[t]=Me(p.begin[t],0,p.strides[t],r,a,s),p.end[t]=Me(p.end[t],1,p.strides[t],r,a,s);const e=1===p.strides[t]&&0===p.begin[t]&&p.end[t]===r;f=f&&e,h=h&&(0===t&&1===p.strides[t]||e)}else f=f&&1===p.strides[t]&&o,h=h&&(0===t&&1===p.strides[t]||o);let i,u=!1;if(p.beginValid&&p.endValid?(i=p.end[t]-p.begin[t],u=!0):n?(i=1,u=!0):o&&r>=0&&(i=p.strides[t]<0?-r:r,u=!0),u){let e;e=0===i||i<0!=p.strides[t]<0?0:Math.trunc(i/p.strides[t])+(i%p.strides[t]!=0?1:0),b.push(e)}else b.push(-1)}for(let e=0;e<p.finalShapeGatherIndices.length;++e){const t=p.finalShapeGatherIndices[e];t>=0?g.push(b[t]):-2===t&&g.push(1)}return{finalShapeSparse:g.filter(((e,t)=>-2!==p.finalShapeGatherIndices[t])),finalShape:g,isIdentity:f,sliceDim0:h,isSimpleSlice:m,begin:p.begin,end:p.end,strides:p.strides}}function Me(e,t,n,r,a,s){if(a[t])return n>0?s[t]:s[t+1&1];{const t=e<0?r+e:e;return t<s[0]?s[0]:t>s[1]?s[1]:t}}const Ie=new Map,De=new Map;class $e{getClassName(){return this.constructor.className}static fromConfig(e,t){return new e(t)}}class Ce{constructor(){this.classNameMap={}}static getMap(){return null==Ce.instance&&(Ce.instance=new Ce),Ce.instance}static register(e){Ce.getMap().classNameMap[e.className]=[e,e.fromConfig]}}function Re(e,t,n){Object(_.c)(null!=e.className,(()=>"Class being registered does not have the static className property defined.")),Object(_.c)("string"==typeof e.className,(()=>"className is required to be a string, but got type "+typeof e.className)),Object(_.c)(e.className.length>0,(()=>"Class being registered has an empty-string as its className, which is disallowed.")),"undefined"==typeof t&&(t="Custom"),"undefined"==typeof n&&(n=e.className);const r=t+">"+n;return Ce.register(e),Ie.set(r,e),De.set(e,r),e}function Pe(e){return De.has(e)?De.get(e):e.className}var Fe=n(12),Be=n(6);const Le=.1;function ze(e,t,n){return null==n&&(n=We()),Ue(e,t,((e,t)=>He(e,t,n)))}function We(){return 32===G.a.backend.floatPrecision()?.001:Le}function Ue(e,t,n){let r=!0;if((Object(Be.isTypedArray)(e)||Object(Be.isTypedArray)(t))&&(r=!1),Object(Be.isTypedArray)(e)&&Object(Be.isTypedArray)(t)&&(r=!0),r){const n=e.constructor.name,r=t.constructor.name;if(n!==r)throw new Error(`Arrays are of different type. Actual: ${n}. Expected: ${r}`)}if(Array.isArray(e)&&Array.isArray(t)){const n=Object(W.c)(e),r=Object(W.c)(t);if(!Object(_.a)(n,r))throw new Error(`Arrays have different shapes. Actual: [${n}]. Expected: [${r}]`)}const a=Object(Be.isTypedArray)(e)?e:Object(Be.flatten)(e),s=Object(Be.isTypedArray)(t)?t:Object(Be.flatten)(t);if(a.length!==s.length)throw new Error(`Arrays have different lengths actual: ${a.length} vs expected: ${s.length}.\nActual: ${a}.\nExpected: ${s}.`);for(let e=0;e<s.length;++e){const t=a[e],r=s[e];if(!n(t,r))throw new Error(`Arrays differ: actual[${e}] = ${t}, expected[${e}] = ${r}.\nActual: ${a}.\nExpected: ${s}.`)}"undefined"!=typeof expect&&expect().nothing()}function Ve(e,t){e().then((()=>t.fail()),(()=>t())),"undefined"!=typeof expect&&expect().nothing()}function Ge(e,t){const n="string"==typeof t||"number"==typeof t||"boolean"==typeof t?[t]:t;return Object(_.A)(e)||Object(_.A)(e[0])||Object(_.A)(t)||Object(_.A)(t[0])?Ue(e,n,((e,t)=>e==t)):Ue(e,t,((e,t)=>He(e,t,0)))}function qe(e,t,n){if(null==n&&(n=We()),!He(e,t,n))throw new Error(`Numbers differ: actual === ${e}, expected === ${t}`);"undefined"!=typeof expect&&expect().nothing()}function He(e,t,n){return!isFinite(e)&&!isFinite(t)||!(isNaN(e)||isNaN(t)||Math.abs(e-t)>n)}function Ke(e,t,n){for(let r=0;r<e.length;r++)if(e[r]<t||e[r]>n)throw new Error(`Value out of range:${e[r]} low: ${t}, high: ${n}`)}function Ye(e,t){const n=new Float32Array(e),r=new Float32Array(t);if(n.length!==r.length)throw new Error(`Expected ArrayBuffer to be of length ${r.length}, but it was ${n.length}`);for(let e=0;e<r.length;e++)if(n[e]!==r[e])throw new Error(`Expected ArrayBuffer value at ${e} to be ${r[e]} but got ${n[e]} instead`)}function Je(e){for(let t=0;t<e.length;t++){const n=e[t];Array.isArray(n)?Je(n):e[t]=Object(Be.encodeString)(n)}return e}function Xe(e){const t=document.createElement("video");return"playsInline"in t&&(t.playsInline=!0),t.muted=!0,t.loop=!0,t.style.position="fixed",t.style.left="0px",t.style.top="0px",t.preload="auto",t.appendChild(e),new Promise((e=>{t.addEventListener("loadeddata",(n=>e(t))),t.load()}))}async function Qe(e){await e.play(),"requestVideoFrameCallback"in e&&await new Promise((t=>{e.requestVideoFrameCallback(t)}))}const Ze="4.10.0";var et=n(13),tt=n(10);const nt=Object(H.b)({floorDiv_:function(e,t){let n=Object(W.a)(e,"a","floorDiv"),r=Object(W.a)(t,"b","floorDiv");[n,r]=Object(Fe.makeTypesMatch)(n,r);const a={a:n,b:r};return G.a.runKernel(q.lb,a)}});const rt=Object(H.b)({div_:function(e,t){let n=Object(W.a)(e,"a","div"),r=Object(W.a)(t,"b","div");if([n,r]=Object(Fe.makeTypesMatch)(n,r),"int32"===n.dtype&&"int32"===r.dtype)return nt(n,r);const a={a:n,b:r};return G.a.runKernel(q.vc,a,{})}});var at=n(9);const st=Object(H.b)({sqrt_:function(e){const t={x:Object(W.a)(e,"x","sqrt","float32")};return G.a.runKernel(q.ad,t)}});const ot=Object(H.b)({square_:function(e){const t=Object(W.a)(e,"x","square");return G.a.runKernel("Square",{x:t},{})}});const it=Object(H.b)({zerosLike_:function(e){const t={x:Object(W.a)(e,"x","zerosLike")};return G.a.runKernel(q.wd,t)}});var ut=n(23);function ct(e,t){if((Object(Be.isTypedArray)(e)&&"string"!==t||Array.isArray(e))&&"complex64"!==t)throw new Error("Error creating a new Scalar: value must be a primitive (number|boolean|string)");if("string"===t&&Object(Be.isTypedArray)(e)&&!(e instanceof Uint8Array))throw new Error("When making a scalar from encoded string, the value must be `Uint8Array`.");return Object(ee.a)(e,[],[],t)}class lt extends $e{minimize(e,t=!1,n){const{value:r,grads:a}=this.computeGradients(e,n);if(null!=n){const e=n.map((e=>({name:e.name,tensor:a[e.name]})));this.applyGradients(e)}else this.applyGradients(a);return Object(et.d)(a),t?r:(r.dispose(),null)}get iterations(){return null==this.iterations_&&(this.iterations_=0),this.iterations_}incrementIterations(){this.iterations_=this.iterations+1}computeGradients(e,t){return Object(ut.f)(e,t)}dispose(){null!=this.iterations_&&Object(et.d)(this.iterations_)}async saveIterations(){return null==this.iterations_&&(this.iterations_=0),{name:"iter",tensor:ct(this.iterations_,"int32")}}async getWeights(){throw new Error("getWeights() is not implemented for this optimizer yet.")}async setWeights(e){throw new Error(`setWeights() is not implemented for this optimizer class ${this.getClassName()}`)}async extractIterations(e){return this.iterations_=(await e[0].tensor.data())[0],e.slice(1)}}Object.defineProperty(lt,Symbol.hasInstance,{value:e=>null!=e.minimize&&null!=e.computeGradients&&null!=e.applyGradients});class dt extends lt{static get className(){return"Adadelta"}constructor(e,t,n=null){super(),this.learningRate=e,this.rho=t,this.epsilon=n,this.accumulatedGrads=[],this.accumulatedUpdates=[],null==n&&(this.epsilon=G.a.backend.epsilon())}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const r=G.a.registeredVariables[t];null==this.accumulatedGrads[n]&&(this.accumulatedGrads[n]={originalName:`${t}/accum_grad`,variable:Object(et.t)((()=>it(r).variable(false)))}),null==this.accumulatedUpdates[n]&&(this.accumulatedUpdates[n]={originalName:`${t}/accum_var`,variable:Object(et.t)((()=>it(r).variable(false)))});const a=Array.isArray(e)?e[n].tensor:e[t];if(null==a)return;const s=this.accumulatedGrads[n].variable,o=this.accumulatedUpdates[n].variable;Object(et.t)((()=>{const e=Object(tt.add)(Object(at.mul)(s,this.rho),Object(at.mul)(ot(a),1-this.rho)),t=Object(at.mul)(rt(st(Object(tt.add)(o,this.epsilon)),st(Object(tt.add)(s,this.epsilon))),a),n=Object(tt.add)(Object(at.mul)(o,this.rho),Object(at.mul)(ot(t),1-this.rho));s.assign(e),o.assign(n);const i=Object(tt.add)(Object(at.mul)(t,-this.learningRate),r);r.assign(i)}))})),this.incrementIterations()}dispose(){null!=this.accumulatedUpdates&&(Object(et.d)(this.accumulatedGrads.map((e=>e.variable))),Object(et.d)(this.accumulatedUpdates.map((e=>e.variable))))}async getWeights(){const e=[...this.accumulatedGrads,...this.accumulatedUpdates];return[await this.saveIterations()].concat(e.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){const t=(e=await this.extractIterations(e)).length/2;this.accumulatedGrads=e.slice(0,t).map((e=>({originalName:e.name,variable:e.tensor.variable(false)}))),this.accumulatedUpdates=e.slice(t,2*t).map((e=>({originalName:e.name,variable:e.tensor.variable(false)})))}getConfig(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}}static fromConfig(e,t){return new e(t.learningRate,t.rho,t.epsilon)}}function pt(e,t,n){Object(_.d)(e);const r={shape:e,value:t,dtype:n=n||Object(_.s)(t)};return G.a.runKernel(q.ib,{},r)}class ft extends lt{static get className(){return"Adagrad"}constructor(e,t=.1){super(),this.learningRate=e,this.initialAccumulatorValue=t,this.accumulatedGrads=[]}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const r=G.a.registeredVariables[t];if(null==this.accumulatedGrads[n]){const e=!1;this.accumulatedGrads[n]={originalName:`${t}/accumulator`,variable:Object(et.t)((()=>pt(r.shape,this.initialAccumulatorValue).variable(e)))}}const a=Array.isArray(e)?e[n].tensor:e[t];if(null==a)return;const s=this.accumulatedGrads[n].variable;Object(et.t)((()=>{const e=Object(tt.add)(s,ot(a));s.assign(e);const t=Object(tt.add)(Object(at.mul)(rt(a,st(Object(tt.add)(e,G.a.backend.epsilon()))),-this.learningRate),r);r.assign(t)}))})),this.incrementIterations()}dispose(){null!=this.accumulatedGrads&&Object(et.d)(this.accumulatedGrads.map((e=>e.variable)))}async getWeights(){return[await this.saveIterations()].concat(this.accumulatedGrads.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){e=await this.extractIterations(e);this.accumulatedGrads=e.map((e=>({originalName:e.name,variable:e.tensor.variable(false)})))}getConfig(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}}static fromConfig(e,t){return new e(t.learningRate,t.initialAccumulatorValue)}}const ht=Object(H.b)({pow_:function(e,t){let n=Object(W.a)(e,"base","pow"),r=Object(W.a)(t,"exp","pow");[n,r]=Object(Fe.makeTypesMatch)(n,r);const a={a:n,b:r};return G.a.runKernel(q.nc,a)}});const mt=Object(H.b)({sub_:function(e,t){let n=Object(W.a)(e,"a","sub"),r=Object(W.a)(t,"b","sub");[n,r]=Object(Fe.makeTypesMatch)(n,r);const a={a:n,b:r};return G.a.runKernel(q.jd,a)}});class bt extends lt{static get className(){return"Adam"}constructor(e,t,n,r=null){super(),this.learningRate=e,this.beta1=t,this.beta2=n,this.epsilon=r,this.accumulatedFirstMoment=[],this.accumulatedSecondMoment=[],Object(et.t)((()=>{this.accBeta1=ct(t).variable(),this.accBeta2=ct(n).variable()})),null==r&&(this.epsilon=G.a.backend.epsilon())}applyGradients(e){const t=Array.isArray(e)?e.map((e=>e.name)):Object.keys(e);Object(et.t)((()=>{const n=mt(1,this.accBeta1),r=mt(1,this.accBeta2);t.forEach(((t,a)=>{const s=G.a.registeredVariables[t];null==this.accumulatedFirstMoment[a]&&(this.accumulatedFirstMoment[a]={originalName:`${t}/m`,variable:Object(et.t)((()=>it(s).variable(false)))}),null==this.accumulatedSecondMoment[a]&&(this.accumulatedSecondMoment[a]={originalName:`${t}/v`,variable:Object(et.t)((()=>it(s).variable(false)))});const o=Array.isArray(e)?e[a].tensor:e[t];if(null==o)return;const i=this.accumulatedFirstMoment[a].variable,u=this.accumulatedSecondMoment[a].variable,c=Object(tt.add)(Object(at.mul)(i,this.beta1),Object(at.mul)(o,1-this.beta1)),l=Object(tt.add)(Object(at.mul)(u,this.beta2),Object(at.mul)(ot(o),1-this.beta2)),d=rt(c,n),p=rt(l,r);i.assign(c),u.assign(l);const f=Object(tt.add)(Object(at.mul)(rt(d,Object(tt.add)(st(p),this.epsilon)),-this.learningRate),s);s.assign(f)})),this.accBeta1.assign(Object(at.mul)(this.accBeta1,this.beta1)),this.accBeta2.assign(Object(at.mul)(this.accBeta2,this.beta2))})),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.accBeta2.dispose(),null!=this.accumulatedFirstMoment&&Object(et.d)(this.accumulatedFirstMoment.map((e=>e.variable))),null!=this.accumulatedSecondMoment&&Object(et.d)(this.accumulatedSecondMoment.map((e=>e.variable)))}async getWeights(){const e=[...this.accumulatedFirstMoment,...this.accumulatedSecondMoment];return[await this.saveIterations()].concat(e.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){e=await this.extractIterations(e),Object(et.t)((()=>{this.accBeta1.assign(ht(this.beta1,this.iterations_+1)),this.accBeta2.assign(ht(this.beta2,this.iterations_+1))}));const t=e.length/2;this.accumulatedFirstMoment=e.slice(0,t).map((e=>({originalName:e.name,variable:e.tensor.variable(false)}))),this.accumulatedSecondMoment=e.slice(t,2*t).map((e=>({originalName:e.name,variable:e.tensor.variable(false)})))}getConfig(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon}}static fromConfig(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon)}}const gt=Object(H.b)({abs_:function(e){const t=Object(W.a)(e,"x","abs");if("complex64"===t.dtype){const e={x:t};return G.a.runKernel(q.C,e)}{const e={x:t};return G.a.runKernel(q.a,e)}}});var yt=n(65);class wt extends lt{static get className(){return"Adamax"}constructor(e,t,n,r=null,a=0){super(),this.learningRate=e,this.beta1=t,this.beta2=n,this.epsilon=r,this.decay=a,this.accumulatedFirstMoment=[],this.accumulatedWeightedInfNorm=[],Object(et.t)((()=>{this.iteration=ct(0).variable(),this.accBeta1=ct(t).variable()})),null==r&&(this.epsilon=G.a.backend.epsilon())}applyGradients(e){const t=Array.isArray(e)?e.map((e=>e.name)):Object.keys(e);Object(et.t)((()=>{const n=mt(1,this.accBeta1),r=rt(-this.learningRate,Object(tt.add)(Object(at.mul)(this.iteration,this.decay),1));t.forEach(((t,a)=>{const s=G.a.registeredVariables[t];null==this.accumulatedFirstMoment[a]&&(this.accumulatedFirstMoment[a]={originalName:`${t}/m`,variable:it(s).variable(false)}),null==this.accumulatedWeightedInfNorm[a]&&(this.accumulatedWeightedInfNorm[a]={originalName:`${t}/v`,variable:it(s).variable(false)});const o=Array.isArray(e)?e[a].tensor:e[t];if(null==o)return;const i=this.accumulatedFirstMoment[a].variable,u=this.accumulatedWeightedInfNorm[a].variable,c=Object(tt.add)(Object(at.mul)(i,this.beta1),Object(at.mul)(o,1-this.beta1)),l=Object(at.mul)(u,this.beta2),d=gt(o),p=Object(yt.maximum)(l,d);i.assign(c),u.assign(p);const f=Object(tt.add)(Object(at.mul)(rt(r,n),rt(c,Object(tt.add)(p,this.epsilon))),s);s.assign(f)})),this.iteration.assign(Object(tt.add)(this.iteration,1)),this.accBeta1.assign(Object(at.mul)(this.accBeta1,this.beta1))})),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.iteration.dispose(),null!=this.accumulatedFirstMoment&&Object(et.d)(this.accumulatedFirstMoment.map((e=>e.variable))),null!=this.accumulatedWeightedInfNorm&&Object(et.d)(this.accumulatedWeightedInfNorm.map((e=>e.variable)))}async getWeights(){throw new Error("getWeights() is not implemented for Adamax yet.")}async setWeights(e){throw new Error("setWeights() is not implemented for Adamax yet.")}getConfig(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon,decay:this.decay}}static fromConfig(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon,t.decay)}}class Ot extends lt{static get className(){return"SGD"}constructor(e){super(),this.learningRate=e,this.setLearningRate(e)}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const r=Array.isArray(e)?e[n].tensor:e[t];if(null==r)return;const a=G.a.registeredVariables[t];Object(et.t)((()=>{const e=Object(tt.add)(Object(at.mul)(this.c,r),a);a.assign(e)}))})),this.incrementIterations()}setLearningRate(e){this.learningRate=e,null!=this.c&&this.c.dispose(),this.c=Object(et.l)(ct(-e))}dispose(){this.c.dispose()}async getWeights(){return[await this.saveIterations()]}async setWeights(e){if(0!==(e=await this.extractIterations(e)).length)throw new Error("SGD optimizer does not have settable weights.")}getConfig(){return{learningRate:this.learningRate}}static fromConfig(e,t){return new e(t.learningRate)}}class vt extends Ot{static get className(){return"Momentum"}constructor(e,t,n=!1){super(e),this.learningRate=e,this.momentum=t,this.useNesterov=n,this.accumulations=[],this.m=ct(this.momentum)}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const r=G.a.registeredVariables[t];if(null==this.accumulations[n]){const e=!1;this.accumulations[n]={originalName:`${t}/momentum`,variable:Object(et.t)((()=>it(r).variable(e)))}}const a=this.accumulations[n].variable,s=Array.isArray(e)?e[n].tensor:e[t];null!=s&&Object(et.t)((()=>{let e;const t=Object(tt.add)(Object(at.mul)(this.m,a),s);e=this.useNesterov?Object(tt.add)(Object(at.mul)(this.c,Object(tt.add)(s,Object(at.mul)(t,this.m))),r):Object(tt.add)(Object(at.mul)(this.c,t),r),a.assign(t),r.assign(e)}))})),this.incrementIterations()}dispose(){this.m.dispose(),null!=this.accumulations&&Object(et.d)(this.accumulations.map((e=>e.variable)))}setMomentum(e){this.momentum=e}async getWeights(){return[await this.saveIterations()].concat(this.accumulations.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){e=await this.extractIterations(e);this.accumulations=e.map((e=>({originalName:e.name,variable:e.tensor.variable(false)})))}getConfig(){return{learningRate:this.learningRate,momentum:this.momentum,useNesterov:this.useNesterov}}static fromConfig(e,t){return new e(t.learningRate,t.momentum,t.useNesterov)}}class jt extends lt{static get className(){return"RMSProp"}constructor(e,t=.9,n=0,r=null,a=!1){if(super(),this.learningRate=e,this.decay=t,this.momentum=n,this.epsilon=r,this.accumulatedMeanSquares=[],this.accumulatedMoments=[],this.accumulatedMeanGrads=[],this.centered=a,null==r&&(this.epsilon=G.a.backend.epsilon()),null==e)throw new Error("learningRate for RMSPropOptimizer must be defined.")}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const r=G.a.registeredVariables[t],a=!1;null==this.accumulatedMeanSquares[n]&&(this.accumulatedMeanSquares[n]={originalName:`${t}/rms`,variable:Object(et.t)((()=>it(r).variable(a)))}),null==this.accumulatedMoments[n]&&(this.accumulatedMoments[n]={originalName:`${t}/momentum`,variable:Object(et.t)((()=>it(r).variable(a)))}),null==this.accumulatedMeanGrads[n]&&this.centered&&(this.accumulatedMeanGrads[n]={originalName:`${t}/mg`,variable:Object(et.t)((()=>it(r).variable(a)))});const s=Array.isArray(e)?e[n].tensor:e[t];if(null==s)return;const o=this.accumulatedMeanSquares[n].variable,i=this.accumulatedMoments[n].variable;Object(et.t)((()=>{const e=Object(tt.add)(Object(at.mul)(o,this.decay),Object(at.mul)(ot(s),1-this.decay));if(this.centered){const t=this.accumulatedMeanGrads[n].variable,a=Object(tt.add)(Object(at.mul)(t,this.decay),Object(at.mul)(s,1-this.decay)),u=rt(Object(at.mul)(s,this.learningRate),st(mt(e,Object(tt.add)(ot(a),this.epsilon)))),c=Object(tt.add)(Object(at.mul)(i,this.momentum),u);o.assign(e),t.assign(a),i.assign(c);const l=mt(r,c);r.assign(l)}else{const e=Object(tt.add)(Object(at.mul)(o,this.decay),Object(at.mul)(ot(s),1-this.decay)),t=Object(tt.add)(Object(at.mul)(i,this.momentum),rt(Object(at.mul)(s,this.learningRate),st(Object(tt.add)(e,this.epsilon))));o.assign(e),i.assign(t);const n=mt(r,t);r.assign(n)}}))})),this.incrementIterations()}dispose(){null!=this.accumulatedMeanSquares&&Object(et.d)(this.accumulatedMeanSquares.map((e=>e.variable))),null!=this.accumulatedMeanGrads&&this.centered&&Object(et.d)(this.accumulatedMeanGrads.map((e=>e.variable))),null!=this.accumulatedMoments&&Object(et.d)(this.accumulatedMoments.map((e=>e.variable)))}async getWeights(){const e=[...this.accumulatedMeanSquares,...this.accumulatedMoments];return this.centered&&e.push(...this.accumulatedMeanGrads),[await this.saveIterations()].concat(e.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){e=await this.extractIterations(e);const t=this.centered?e.length/3:e.length/2,n=!1;this.accumulatedMeanSquares=e.slice(0,t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)}))),this.accumulatedMoments=e.slice(t,2*t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)}))),this.centered&&(this.accumulatedMeanGrads=e.slice(2*t,3*t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)}))))}getConfig(){return{learningRate:this.learningRate,decay:this.decay,momentum:this.momentum,epsilon:this.epsilon,centered:this.centered}}static fromConfig(e,t){return new e(t.learningRate,t.decay,t.momentum,t.epsilon,t.centered)}}class _t{static sgd(e){return new Ot(e)}static momentum(e,t,n=!1){return new vt(e,t,n)}static rmsprop(e,t=.9,n=0,r=null,a=!1){return new jt(e,t,n,r,a)}static adam(e=.001,t=.9,n=.999,r=null){return new bt(e,t,n,r)}static adadelta(e=.001,t=.95,n=null){return new dt(e,t,n)}static adamax(e=.002,t=.9,n=.999,r=null,a=0){return new wt(e,t,n,r,a)}static adagrad(e,t=.1){return new ft(e,t)}}var St=n(32);const kt=Object(H.b)({acos_:function(e){const t={x:Object(W.a)(e,"x","acos")};return G.a.runKernel(q.b,t)}});const xt=Object(H.b)({acosh_:function(e){const t={x:Object(W.a)(e,"x","acosh")};return G.a.runKernel(q.c,t)}});const Et=Object(H.b)({addN_:function(e){_.c(Array.isArray(e),(()=>"The argument passed to tf.addN() must be a list of tensors")),_.c(e.length>=1,(()=>`Must pass at least one tensor to tf.addN(), but got ${e.length}`));const t=e.map(((e,t)=>Object(W.a)(e,`tensors${t}`,"addN"))),n=t[0];t.forEach((e=>{if(e.dtype!==n.dtype)throw new Error("All tensors passed to tf.addN() must have the same dtype")})),t.forEach((e=>{if(!_.a(e.shape,n.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")}));const r=t;return G.a.runKernel(q.e,r)}});const Tt=Object(H.b)({all_:function(e,t=null,n=!1){const r={x:Object(W.a)(e,"x","all","bool")},a={axis:t,keepDims:n};return G.a.runKernel(q.f,r,a)}});const Nt=Object(H.b)({any_:function(e,t=null,n=!1){const r={x:Object(W.a)(e,"x","any","bool")},a={axis:t,keepDims:n};return G.a.runKernel(q.g,r,a)}});const At=Object(H.b)({argMax_:function(e,t=0){const n={x:Object(W.a)(e,"x","argMax")},r={axis:t};return G.a.runKernel(q.h,n,r)}});const Mt=Object(H.b)({argMin_:function(e,t=0){const n={x:Object(W.a)(e,"x","argMin")},r={axis:t};return G.a.runKernel(q.i,n,r)}});const It=Object(H.b)({asin_:function(e){const t={x:Object(W.a)(e,"x","asin")};return G.a.runKernel(q.j,t)}});const Dt=Object(H.b)({asinh_:function(e){const t={x:Object(W.a)(e,"x","asinh")};return G.a.runKernel(q.k,t)}});const $t=Object(H.b)({atan_:function(e){const t={x:Object(W.a)(e,"x","atan")};return G.a.runKernel(q.l,t)}});const Ct=Object(H.b)({atan2_:function(e,t){let n=Object(W.a)(e,"a","atan2"),r=Object(W.a)(t,"b","atan2");[n,r]=Object(Fe.makeTypesMatch)(n,r);const a={a:n,b:r};return G.a.runKernel(q.m,a)}});const Rt=Object(H.b)({atanh_:function(e){const t={x:Object(W.a)(e,"x","atanh")};return G.a.runKernel(q.n,t)}});var Pt=n(66),Ft=n(14),Bt=n(7);const Lt=Object(H.b)({avgPool3d_:function(e,t,n,r,a,s="NDHWC"){const o=Object(W.a)(e,"x","avgPool3d","float32");let i=o,u=!1;4===o.rank&&(u=!0,i=Object(Bt.reshape)(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]])),_.c(5===i.rank,(()=>`Error in avgPool3d: x must be rank 5 but got rank ${i.rank}.`)),_.c("NDHWC"===s,(()=>`Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of ${s}`)),_.c("number"==typeof n&&n>0||Array.isArray(n)&&n[0]>0&&n[1]>0&&n[2]>0,(()=>`Error in avgPool3d: Stride must be > 0, but got '${n}'`)),Object(Ft.a)("avgPool3d",r,a);const c={x:i},l={filterSize:t,strides:n,pad:r,dimRoundingMode:a,dataFormat:s};let d=G.a.runKernel(q.p,c,l);return d=Object(U.a)(d,i.dtype),u?Object(Bt.reshape)(d,[d.shape[1],d.shape[2],d.shape[3],d.shape[4]]):d}});var zt=n(22),Wt=n(40);const Ut=Object(H.b)({slice_:function(e,t,n){const r=Object(W.a)(e,"x","slice","string_or_numeric");if(0===r.rank)throw new Error("Slicing scalar is not possible");const a={x:r},s={begin:t,size:n};return G.a.runKernel(q.Qc,a,s)}});const Vt=Object(H.b)({tanh_:function(e){const t={x:Object(W.a)(e,"x","tanh","float32")};return G.a.runKernel(q.md,t)}});const Gt=Object(H.b)({basicLSTMCell_:function(e,t,n,r,a,s){const o=Object(W.a)(e,"forgetBias","basicLSTMCell"),i=Object(W.a)(t,"lstmKernel","basicLSTMCell"),u=Object(W.a)(n,"lstmBias","basicLSTMCell"),c=Object(W.a)(r,"data","basicLSTMCell"),l=Object(W.a)(a,"c","basicLSTMCell"),d=Object(W.a)(s,"h","basicLSTMCell"),p=Object(zt.concat)([c,d],1),f=Object(V.a)(p,i),h=Object(tt.add)(f,u),m=h.shape[0],b=h.shape[1]/4,g=[m,b],y=Ut(h,[0,0],g),w=Ut(h,[0,b],g),O=Ut(h,[0,2*b],g),v=Ut(h,[0,3*b],g),j=Object(tt.add)(Object(at.mul)(Object(Wt.sigmoid)(y),Vt(w)),Object(at.mul)(l,Object(Wt.sigmoid)(Object(tt.add)(o,O))));return[j,Object(at.mul)(Vt(j),Object(Wt.sigmoid)(v))]}});const qt=Object(H.b)({batchToSpaceND_:function(e,t,n){const r=Object(W.a)(e,"x","batchToSpaceND"),a=t.reduce(((e,t)=>e*t));_.c(r.rank>=1+t.length,(()=>`input rank is ${r.rank} but should be > than blockShape.length ${t.length}`)),_.c(n.length===t.length,(()=>`crops.length is ${n.length} but should be equal to blockShape.length ${t.length}`)),_.c(r.shape[0]%a==0,(()=>`input tensor batch is ${r.shape[0]} but is not divisible by the product of the elements of blockShape ${t.join(" * ")} === ${a}`));const s={x:r},o={blockShape:t,crops:n};return G.a.runKernel(q.t,s,o)}});const Ht=Object(H.b)({batchNorm_:function(e,t,n,r,a,s){null==s&&(s=.001);const o=Object(W.a)(e,"x","batchNorm"),i=Object(W.a)(t,"mean","batchNorm"),u=Object(W.a)(n,"variance","batchNorm");let c,l;null!=a&&(c=Object(W.a)(a,"scale","batchNorm")),null!=r&&(l=Object(W.a)(r,"offset","batchNorm")),_.c(i.rank===u.rank,(()=>"Batch normalization gradient requires mean and variance to have equal ranks.")),_.c(null==l||i.rank===l.rank,(()=>"Batch normalization gradient requires mean and offset to have equal ranks.")),_.c(null==c||i.rank===c.rank,(()=>"Batch normalization gradient requires mean and scale to have equal ranks."));const d=function(e){let t;return t=0===e.rank||1===e.rank?Object(Bt.reshape)(e,[1,1,1,e.size]):2===e.rank?Object(Bt.reshape)(e,[1,1,e.shape[0],e.shape[1]]):3===e.rank?Object(Bt.reshape)(e,[1,e.shape[0],e.shape[1],e.shape[2]]):e,t}(o),p={x:d,scale:c,offset:l,mean:i,variance:u},f={varianceEpsilon:s},h=G.a.runKernel(q.nb,p,f);return Object(Bt.reshape)(h,o.shape)}});const Kt=Object(H.b)({batchNorm2d_:function(e,t,n,r,a,s){const o=Object(W.a)(e,"x","batchNorm"),i=Object(W.a)(t,"mean","batchNorm"),u=Object(W.a)(n,"variance","batchNorm");let c,l;return null!=a&&(c=Object(W.a)(a,"scale","batchNorm")),null!=r&&(l=Object(W.a)(r,"offset","batchNorm")),_.c(2===o.rank,(()=>`Error in batchNorm2D: x must be rank 2 but got rank ${o.rank}.`)),_.c(2===i.rank||1===i.rank,(()=>`Error in batchNorm2D: mean must be rank 2 or rank 1 but got rank ${i.rank}.`)),_.c(2===u.rank||1===u.rank,(()=>`Error in batchNorm2D: variance must be rank 2 or rank 1 but got rank ${u.rank}.`)),null!=c&&_.c(2===c.rank||1===c.rank,(()=>`Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank ${c.rank}.`)),null!=l&&_.c(2===l.rank||1===l.rank,(()=>`Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank ${l.rank}.`)),Ht(o,i,u,l,c,s)}});const Yt=Object(H.b)({batchNorm3d_:function(e,t,n,r,a,s){const o=Object(W.a)(e,"x","batchNorm"),i=Object(W.a)(t,"mean","batchNorm"),u=Object(W.a)(n,"variance","batchNorm");let c,l;return null!=a&&(c=Object(W.a)(a,"scale","batchNorm")),null!=r&&(l=Object(W.a)(r,"offset","batchNorm")),_.c(3===o.rank,(()=>`Error in batchNorm3D: x must be rank 3 but got rank ${o.rank}.`)),_.c(3===i.rank||1===i.rank,(()=>`Error in batchNorm3D: mean must be rank 3 or rank 1 but got rank ${i.rank}.`)),_.c(3===u.rank||1===u.rank,(()=>`Error in batchNorm3D: variance must be rank 3 or rank 1 but got rank ${u.rank}.`)),null!=c&&_.c(3===c.rank||1===c.rank,(()=>`Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank ${c.rank}.`)),null!=l&&_.c(3===l.rank||1===l.rank,(()=>`Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank ${l.rank}.`)),Ht(o,i,u,l,c,s)}});const Jt=Object(H.b)({batchNorm4d_:function(e,t,n,r,a,s){const o=Object(W.a)(e,"x","batchNorm"),i=Object(W.a)(t,"mean","batchNorm"),u=Object(W.a)(n,"variance","batchNorm");let c,l;return null!=a&&(c=Object(W.a)(a,"scale","batchNorm")),null!=r&&(l=Object(W.a)(r,"offset","batchNorm")),_.c(4===o.rank,(()=>`Error in batchNorm4D: x must be rank 4 but got rank ${o.rank}.`)),_.c(4===i.rank||1===i.rank,(()=>`Error in batchNorm4D: mean must be rank 4 or rank 1 but got rank ${i.rank}.`)),_.c(4===u.rank||1===u.rank,(()=>`Error in batchNorm4D: variance must be rank 4 or rank 1 but got rank ${u.rank}.`)),null!=c&&_.c(4===c.rank||1===c.rank,(()=>`Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank ${c.rank}.`)),null!=l&&_.c(4===l.rank||1===l.rank,(()=>`Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank ${l.rank}.`)),Ht(o,i,u,l,c,s)}});const Xt=Object(H.b)({bincount_:function(e,t,n){const r=Object(W.a)(e,"x","bincount"),a=Object(W.a)(t,"weights","bincount");_.c("int32"===r.dtype,(()=>`Error in bincount: input dtype must be int32, but got ${r.dtype}`)),_.c(n>=0,(()=>`size must be non-negative, but got ${n}.`)),_.c(a.size===r.size||0===a.size,(()=>`Error in bincount: weights must have the same size as input or0-length, but got input shape: ${r.shape}, weights shape: ${a.shape}.`));const s={x:r,weights:a},o={size:n};return G.a.runKernel(q.u,s,o)}});const Qt=Object(H.b)({bitwiseAnd_:function(e,t){const n=Object(W.a)(e,"x","bitwiseAnd"),r=Object(W.a)(t,"y","bitwiseAnd");if(!Object(_.a)(n.shape,r.shape))throw new Error(`BitwiseAnd: Tensors must have the same shape. x: ${n.shape}, y: ${r.shape}`);if("int32"!==n.dtype||"int32"!==r.dtype)throw new Error(`BitwiseAnd: Only supports 'int32' values in tensor, found type of x: ${n.dtype} and type of y: ${r.dtype}`);const a={a:n,b:r};return G.a.runKernel(q.v,a)}});const Zt=Object(H.b)({broadcastArgs_:function(e,t){const n=Object(W.a)(e,"s0","broadcastArgs","int32"),r=Object(W.a)(t,"s1","broadcastArgs","int32");if(1!==n.rank)throw new Error(`broadcastArgs(): first input must be a vector (rank=1). Has rank ${n.rank}`);if(1!==r.rank)throw new Error(`broadcastArgs(): second input must be a vector (rank=1). Has rank ${r.rank}`);const a={s0:n,s1:r};return G.a.runKernel(q.w,a)}});var en=n(36);const tn=Object(H.b)({broadcastTo_:function(e,t){let n=Object(W.a)(e,"broadcastTo","x");const r=n.shape;if(Object(_.d)(t),t.length<n.rank)throw new Error(`broadcastTo(): shape.length=${t.length} < input.rank=${n.rank}.`);if(t.length>n.rank){const e=n.shape.slice();for(;e.length<t.length;)e.unshift(1);n=Object(Bt.reshape)(n,e)}const a=n.shape,s=Array.from(t);for(let e=t.length-1;e>=0;e--)if(a[e]===t[e])s[e]=1;else if(1!==n.shape[e])throw new Error(`broadcastTo(): [${r}] cannot be broadcast to [${t}].`);if(0===s.map(((e,t)=>e>1?t:-1)).filter((e=>e>=0)).length)return Object(en.a)(n);const o={x:n},i={reps:s};return G.a.runKernel(q.od,o,i)}});var nn=n(28);const rn=Object(H.b)({ceil_:function(e){const t={x:Object(W.a)(e,"x","ceil","float32")};return G.a.runKernel(q.z,t)}});const an=Object(H.b)({clipByValue_:function(e,t,n){const r=Object(W.a)(e,"x","clipByValue");if(_.c(t<=n,(()=>`Error in clip: min (${t}) must be less than or equal to max (${n}).`)),t===n)return pt(r.shape,t,r.dtype);const a={x:r},s={clipValueMin:t,clipValueMax:n};return G.a.runKernel(q.A,a,s)}});var sn=n(31);const on=Object(H.b)({concat1d_:function(e){return Object(zt.concat)(e,0)}});const un=Object(H.b)({concat2d_:function(e,t){return Object(zt.concat)(e,t)}});const cn=Object(H.b)({concat3d_:function(e,t){return Object(zt.concat)(e,t)}});const ln=Object(H.b)({concat4d_:function(e,t){return Object(zt.concat)(e,t)}});var dn=n(49);const pn=Object(H.b)({conv1d_:function(e,t,n,r,a="NWC",s=1,o){const i=Object(W.a)(e,"x","conv1d"),u=Object(W.a)(t,"filter","conv1d");let c=i,l=!1;2===i.rank&&(l=!0,c=Object(Bt.reshape)(i,[1,i.shape[0],i.shape[1]])),_.c(3===c.rank,(()=>`Error in conv1d: input must be rank 3, but got rank ${c.rank}.`)),_.c(3===u.rank,(()=>`Error in conv1d: filter must be rank 3, but got rank ${u.rank}.`)),Ft.a("conv1d",r,o),_.c(c.shape[2]===u.shape[1],(()=>`Error in conv1d: depth of input (${c.shape[2]}) must match input depth for filter ${u.shape[1]}.`)),_.c(Ft.i(n,s),(()=>`Error in conv1D: Either stride or dilation must be 1. Got stride ${n} and dilation '${s}'`)),_.c(Ft.j(s),(()=>"Error in conv1D: Dilated rates should be larger than 0.")),_.c(Ft.j(n),(()=>"Error in conv1D: Stride should be larger than 0.")),_.c("NWC"===a,(()=>`Error in conv1d: got dataFormat of ${a} but only NWC is currently supported.`));const d=Object(Bt.reshape)(u,[1,u.shape[0],u.shape[1],u.shape[2]]),p=Object(Bt.reshape)(c,[c.shape[0],1,c.shape[1],c.shape[2]]),f=[1,n],h=[1,s],m=Object(dn.a)(p,d,f,r,"NHWC",h,o);return l?Object(Bt.reshape)(m,[m.shape[2],m.shape[3]]):Object(Bt.reshape)(m,[m.shape[0],m.shape[2],m.shape[3]])}});var fn=n(80);const hn=Object(H.b)({conv2dTranspose_:function(e,t,n,r,a,s){const o=Object(W.a)(e,"x","conv2dTranspose"),i=Object(W.a)(t,"filter","conv2dTranspose");return Object(fn.a)(n,o,i,r,a,"NHWC",s)}});const mn=Object(H.b)({conv3d_:function(e,t,n,r,a="NDHWC",s=[1,1,1]){const o=Object(W.a)(e,"x","conv3d"),i=Object(W.a)(t,"filter","conv3d");let u=o,c=!1;4===o.rank&&(c=!0,u=Object(Bt.reshape)(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]])),_.c(5===u.rank,(()=>`Error in conv3d: input must be rank 5, but got rank ${u.rank}.`)),_.c(5===i.rank,(()=>`Error in conv3d: filter must be rank 5, but got rank ${i.rank}.`)),_.c(u.shape[4]===i.shape[3],(()=>`Error in conv3d: depth of input (${u.shape[4]}) must match input depth for filter ${i.shape[3]}.`)),_.c(Object(Ft.i)(n,s),(()=>`Error in conv3D: Either strides or dilations must be 1. Got strides ${n} and dilations '${s}'`)),_.c("NDHWC"===a,(()=>`Error in conv3d: got dataFormat of ${a} but only NDHWC is currently supported.`)),_.c(Object(Ft.j)(s),(()=>"Error in conv3D: Dilated rates should be larger than 0.")),_.c(Object(Ft.j)(n),(()=>"Error in conv3D: Strides should be larger than 0."));const l={x:u,filter:i},d={strides:n,pad:r,dataFormat:a,dilations:s},p=G.a.runKernel(q.H,l,d);return c?Object(Bt.reshape)(p,[p.shape[1],p.shape[2],p.shape[3],p.shape[4]]):p}});const bn=Object(H.b)({conv3DBackpropInput_:function(e,t,n,r,a){_.c(e.length===t.rank,(()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`));let s=e,o=t,i=!1;4===t.rank&&(i=!0,o=Object(Bt.reshape)(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]]),s=[1,e[0],e[1],e[2],e[3]]);const u=s[4],c=o.shape[4];_.c(5===s.length,(()=>`Error in conv3dDerInput: inShape must be length 5, but got length ${s.length}.`)),_.c(5===o.rank,(()=>`Error in conv3dDerInput: dy must be rank 5, but got rank ${o.rank}`)),_.c(5===n.rank,(()=>`Error in conv3dDerInput: filter must be rank 5, but got rank ${n.rank}`)),_.c(u===n.shape[3],(()=>`Error in conv3dDerInput: depth of input (${u}) must match input depth for filter ${n.shape[3]}.`)),_.c(c===n.shape[4],(()=>`Error in conv3dDerInput: depth of output (${c}) must match output depth for filter ${n.shape[4]}.`));const l={dy:o,filter:n},d={pad:a,strides:r,inputShape:s},p=G.a.runKernel(q.J,l,d);return i?Object(Bt.reshape)(p,[p.shape[1],p.shape[2],p.shape[3],p.shape[4]]):p}});const gn=Object(H.b)({conv3dTranspose_:function(e,t,n,r,a){const s=Object(W.a)(e,"x","conv3dTranspose"),o=Object(W.a)(t,"filter","conv3dTranspose");return bn(n,s,o,r,a)}});const yn=Object(H.b)({cos_:function(e){const t={x:Object(W.a)(e,"x","cos","float32")};return G.a.runKernel(q.K,t)}});const wn=Object(H.b)({cosh_:function(e){const t={x:Object(W.a)(e,"x","cosh","float32")};return G.a.runKernel(q.L,t)}});const On=Object(H.b)({cumprod_:function(e,t=0,n=!1,r=!1){const a={x:Object(W.a)(e,"x","cumprod")},s={axis:t,exclusive:n,reverse:r};return G.a.runKernel(q.N,a,s)}});const vn=Object(H.b)({cumsum_:function(e,t=0,n=!1,r=!1){const a={x:Object(W.a)(e,"x","cumsum")},s={axis:t,exclusive:n,reverse:r};return G.a.runKernel(q.O,a,s)}});const jn=Object(H.b)({denseBincount_:function(e,t,n,r=!1){const a=Object(W.a)(e,"x","denseBincount"),s=Object(W.a)(t,"weights","denseBincount");_.c("int32"===a.dtype,(()=>`Error in denseBincount: input dtype must be int32, but got ${a.dtype}`)),_.c(a.rank<=2,(()=>`Error in denseBincount: input must be at most rank 2, but got rank ${a.rank}.`)),_.c(n>=0,(()=>`size must be non-negative, but got ${n}.`)),_.c(s.size===a.size||0===s.size,(()=>`Error in denseBincount: weights must have the same shape as x or 0-length, but got x shape: ${a.shape}, weights shape: ${s.shape}.`));const o={x:a,weights:s},i={size:n,binaryOutput:r};return G.a.runKernel(q.P,o,i)}});const _n=Object(H.b)({depthToSpace_:function(e,t,n="NHWC"){const r=Object(W.a)(e,"x","depthToSpace","float32"),a="NHWC"===n?r.shape[1]:r.shape[2],s="NHWC"===n?r.shape[2]:r.shape[3],o="NHWC"===n?r.shape[3]:r.shape[1];_.c(t>1,(()=>`blockSize should be > 1 for depthToSpace, but was: ${t}`)),_.c(a*t>=0,(()=>`Negative dimension size caused by overflow when multiplying\n ${a} and ${t} for depthToSpace with input shape\n ${r.shape}`)),_.c(s*t>=0,(()=>`Negative dimension size caused by overflow when multiplying\n ${s} and ${t} for depthToSpace with input shape\n ${r.shape}`)),_.c(o%(t*t)==0,(()=>`Dimension size must be evenly divisible by ${t*t} but is ${o} for depthToSpace with input shape ${r.shape}`));const i={x:r},u={blockSize:t,dataFormat:n};return G.a.runKernel(q.Q,i,u)}});var Sn=n(61);const kn=Object(H.b)({diag_:function(e){const t={x:Object(W.a)(e,"x","diag")};return G.a.runKernel(q.U,t)}});const xn=Object(H.b)({dilation2d_:function(e,t,n,r,a=[1,1],s="NHWC"){const o=Object(W.a)(e,"x","dilation2d"),i=Object(W.a)(t,"filter","dilation2d");_.c(3===o.rank||4===o.rank,(()=>`Error in dilation2d: input must be rank 3 or 4, but got rank ${o.rank}.`)),_.c(3===i.rank,(()=>`Error in dilation2d: filter must be rank 3, but got rank ${i.rank}.`)),_.c("NHWC"===s,(()=>`Error in dilation2d: Only NHWC is currently supported, but got dataFormat of ${s}`));let u=o,c=!1;3===o.rank&&(u=Object(Bt.reshape)(o,[1,o.shape[0],o.shape[1],o.shape[2]]),c=!0),_.c(u.shape[3]===i.shape[2],(()=>`Error in dilation2d: input and filter must have the same depth: ${u.shape[3]} vs ${i.shape[2]}`));const l={x:u,filter:i},d={strides:n,pad:r,dilations:a},p=G.a.runKernel(q.V,l,d);return c?Object(Bt.reshape)(p,[p.shape[1],p.shape[2],p.shape[3]]):p}});const En=Object(H.b)({equal_:function(e,t){let n=Object(W.a)(e,"a","equal","string_or_numeric"),r=Object(W.a)(t,"b","equal","string_or_numeric");[n,r]=Object(Fe.makeTypesMatch)(n,r),Object(X.assertAndGetBroadcastShape)(n.shape,r.shape);const a={a:n,b:r};return G.a.runKernel(q.cb,a)}});const Tn=Object(H.b)({where_:function(e,t,n){const r=Object(W.a)(t,"a","where"),a=Object(W.a)(n,"b","where"),s=Object(W.a)(e,"condition","where","bool"),o=Object(X.assertAndGetBroadcastShape)(Object(X.assertAndGetBroadcastShape)(s.shape,r.shape),a.shape),i={condition:tn(s,o),t:tn(r,o),e:tn(a,o)};return G.a.runKernel(q.Kc,i)}});const Nn=Object(H.b)({divNoNan_:function(e,t){let n=Object(W.a)(e,"a","div"),r=Object(W.a)(t,"b","div");[n,r]=Object(Fe.makeTypesMatch)(n,r);const a=rt(n,r),s=it(a),o=En(r,s);return Tn(o,s,a)}});const An=Object(H.b)({dot_:function(e,t){const n=Object(W.a)(e,"t1","dot"),r=Object(W.a)(t,"t2","dot");_.c(!(1!==n.rank&&2!==n.rank||1!==r.rank&&2!==r.rank),(()=>`Error in dot: inputs must all be rank 1 or 2, but got ranks ${n.rank} and ${r.rank}.`));const a=1===n.rank?n.size:n.shape[1],s=1===r.rank?r.size:r.shape[0];if(_.c(a===s,(()=>`Error in dot: inner dimensions of inputs must match, but got ${a} and ${s}.`)),1===n.rank&&1===r.rank){const e=Object(Bt.reshape)(n,[1,-1]),t=Object(Bt.reshape)(r,[-1,1]),a=Object(V.a)(e,t);return Object(Bt.reshape)(a,[])}if(1===n.rank&&2===r.rank){const e=Object(Bt.reshape)(n,[1,-1]),t=Object(Bt.reshape)(r,[r.shape[0],r.shape[1]]),a=Object(V.a)(e,t);return Object(Bt.reshape)(a,[a.size])}if(2===n.rank&&1===r.rank){const e=Object(Bt.reshape)(r,[-1,1]),t=Object(V.a)(n,e);return Object(Bt.reshape)(t,[t.size])}{const e=Object(Bt.reshape)(r,[r.shape[0],r.shape[1]]);return Object(V.a)(n,e)}}});const Mn=Object(H.b)({einsum_:function(e,...t){const n=t.map(((e,t)=>Object(W.a)(e,`tensors${t}`,"einsum"))),r={equation:e};return G.a.runKernel(q.Z,n,r)}});var In=n(72);const Dn=Object(H.b)({ensureShape_:function(e,t){const n=Object(W.a)(e,"x","ensureShape","string_or_numeric");if(!Object(_.b)(n.shape,t))throw new Error(`EnsureShape: Shape of tensor ${n.shape} is not compatible with expected shape ${t}`);return e}});const $n=Object(H.b)({erf_:function(e){let t=Object(W.a)(e,"x","erf");_.c("int32"===t.dtype||"float32"===t.dtype,(()=>"Input dtype must be `int32` or `float32`.")),"int32"===t.dtype&&(t=Object(U.a)(t,"float32"));const n={x:t};return G.a.runKernel(q.db,n)}});function Cn(e,t){for(let n=0;n<e.length;++n)if(e[e.length-n-1]!==t-1-n)return!1;return!0}function Rn(e,t,n){const r=e.length+t.length,a=[];let s=0,o=0;for(let i=0;i<r;i++)-1===n.indexOf(i)?a.push(e[s++]):a.push(t[o++]);return a}function Pn(e,t){const n=[],r=e.length;for(let a=0;a<r;a++)-1===t.indexOf(a)&&n.push(e[a]);return[n,t.map((t=>e[t]))]}function Fn(e,t){return Rn(e,t.map((e=>1)),t)}function Bn(e,t,n){_.c(Cn(t,n),(()=>`${e} supports only inner-most axes for now. Got axes ${t} and rank-${n} input.`))}function Ln(e,t){if(Cn(e,t))return null;const n=[];for(let r=0;r<t;++r)-1===e.indexOf(r)&&n.push(r);return e.forEach((e=>n.push(e))),n}function zn(e){return e.map(((e,t)=>[t,e])).sort(((e,t)=>e[1]-t[1])).map((e=>e[0]))}function Wn(e,t){const n=[];for(let r=t-e;r<t;++r)n.push(r);return n}const Un=Object(H.b)({max_:function(e,t=null,n=!1){const r={x:Object(W.a)(e,"x","max")},a={reductionIndices:t,keepDims:n};return G.a.runKernel(q.Pb,r,a)}});const Vn=Object(H.b)({min_:function(e,t=null,n=!1){const r={x:Object(W.a)(e,"x","min")},a={axis:t,keepDims:n};return G.a.runKernel(q.Xb,r,a)}});var Gn=n(20);function qn(e,t,n=null){if(0===e.rank)return gt(e);if(1!==e.rank&&null===n)return qn(Object(Bt.reshape)(e,[-1]),t,n);if(1===e.rank||"number"==typeof n||Array.isArray(n)&&1===n.length){if(1===t)return Object(Gn.a)(gt(e),n);if(t===1/0)return Un(gt(e),n);if(t===-1/0)return Vn(gt(e),n);if("euclidean"===t||2===t)return st(Object(Gn.a)(ht(gt(e),ct(2,"int32")),n));throw new Error(`Error in norm: invalid ord value: ${t}`)}if(Array.isArray(n)&&2===n.length){if(1===t)return Un(Object(Gn.a)(gt(e),n[0]),n[1]-1);if(t===1/0)return Un(Object(Gn.a)(gt(e),n[1]),n[0]);if(t===-1/0)return Vn(Object(Gn.a)(gt(e),n[1]),n[0]);if("fro"===t||"euclidean"===t)return st(Object(Gn.a)(ot(e),n));throw new Error(`Error in norm: invalid ord value: ${t}`)}throw new Error(`Error in norm: invalid axis: ${n}`)}const Hn=Object(H.b)({norm_:function(e,t="euclidean",n=null,r=!1){const a=qn(e=Object(W.a)(e,"x","norm"),t,n);let s=a.shape;if(r){const t=Object(_.I)(n,e.shape);s=Fn(a.shape,t)}return Object(Bt.reshape)(a,s)}});const Kn=Object(H.b)({euclideanNorm_:function(e,t=null,n=!1){return Hn(e,"euclidean",t,n)}});const Yn=Object(H.b)({exp_:function(e){const t={x:Object(W.a)(e,"x","exp")};return G.a.runKernel(q.eb,t)}});const Jn=Object(H.b)({expandDims_:function(e,t=0){const n=Object(W.a)(e,"x","expandDims","string_or_numeric");_.c(t<=n.rank,(()=>"Axis must be <= rank of the tensor"));const r={input:n},a={dim:t};return G.a.runKernel(q.fb,r,a)}});const Xn=Object(H.b)({expm1_:function(e){const t={x:Object(W.a)(e,"x","expm1")};return G.a.runKernel(q.gb,t)}});const Qn=Object(H.b)({tile_:function(e,t){const n=Object(W.a)(e,"x","tile","string_or_numeric");_.c(n.rank===t.length,(()=>`Error in transpose: rank of input ${n.rank} must match length of reps ${t}.`));const r={x:n},a={reps:t};return G.a.runKernel(q.od,r,a)}});const Zn=Object(H.b)({eye_:function(e,t,n,r="float32"){null==t&&(t=e);const a=Object(nn.a)([e,t],r),s=e<=t?e:t;for(let e=0;e<s;++e)a.set(1,e,e);const o=Object(Bt.reshape)(a.toTensor(),[e,t]);if(null==n)return o;if(1===n.length)return Qn(Jn(o,0),[n[0],1,1]);if(2===n.length)return Qn(Jn(Jn(o,0),0),[n[0],n[1],1,1]);if(3===n.length)return Qn(Jn(Jn(Jn(o,0),0),0),[n[0],n[1],n[2],1,1]);throw new Error(`eye() currently supports only 1D and 2D batchShapes, but received ${n.length}D.`)}});const er=Object(H.b)({floor_:function(e){const t={x:Object(W.a)(e,"x","floor","float32")};return G.a.runKernel(q.kb,t)}});const tr=Object(H.b)({gather_:function(e,t,n=0,r=0){const a={x:Object(W.a)(e,"x","gather"),indices:Object(W.a)(t,"indices","gather","int32")},s={axis:n,batchDims:r};return G.a.runKernel(q.rb,a,s)}});const nr=Object(H.b)({greater_:function(e,t){let n=Object(W.a)(e,"a","greater","string_or_numeric"),r=Object(W.a)(t,"b","greater","string_or_numeric");[n,r]=Object(Fe.makeTypesMatch)(n,r),Object(X.assertAndGetBroadcastShape)(n.shape,r.shape);const a={a:n,b:r};return G.a.runKernel(q.sb,a)}});const rr=Object(H.b)({greaterEqual_:function(e,t){let n=Object(W.a)(e,"a","greaterEqual","string_or_numeric"),r=Object(W.a)(t,"b","greaterEqual","string_or_numeric");[n,r]=Object(Fe.makeTypesMatch)(n,r),Object(X.assertAndGetBroadcastShape)(n.shape,r.shape);const a={a:n,b:r};return G.a.runKernel(q.tb,a)}});var ar=n(50);const sr=Object(H.b)({isFinite_:function(e){const t={x:Object(W.a)(e,"x","isFinite")};return G.a.runKernel(q.xb,t)}});const or=Object(H.b)({isInf_:function(e){const t={x:Object(W.a)(e,"x","isInf")};return G.a.runKernel(q.yb,t)}});const ir=Object(H.b)({isNaN_:function(e){const t={x:Object(W.a)(e,"x","isNaN")};return G.a.runKernel(q.zb,t)}});var ur=n(73);const cr=Object(H.b)({less_:function(e,t){let n=Object(W.a)(e,"a","less","string_or_numeric"),r=Object(W.a)(t,"b","less","string_or_numeric");[n,r]=Object(Fe.makeTypesMatch)(n,r),Object(X.assertAndGetBroadcastShape)(n.shape,r.shape);const a={a:n,b:r};return G.a.runKernel(q.Db,a)}});const lr=Object(H.b)({lessEqual_:function(e,t){let n=Object(W.a)(e,"a","lessEqual","string_or_numeric"),r=Object(W.a)(t,"b","lessEqual","string_or_numeric");[n,r]=Object(Fe.makeTypesMatch)(n,r),Object(X.assertAndGetBroadcastShape)(n.shape,r.shape);const a={a:n,b:r};return G.a.runKernel(q.Eb,a)}});function dr(e,t,n){if(n<=0)throw new Error("The number of values should be positive.");const r={start:e,stop:t,num:n};return G.a.runKernel(q.Fb,{},r)}const pr=Object(H.b)({localResponseNormalization_:function(e,t=5,n=1,r=1,a=.5){const s=Object(W.a)(e,"x","localResponseNormalization");_.c(4===s.rank||3===s.rank,(()=>`Error in localResponseNormalization: x must be rank 3 or 4 but got\n rank ${s.rank}.`)),_.c(_.w(t),(()=>`Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${t}.`));let o=s,i=!1;3===s.rank&&(i=!0,o=Object(Bt.reshape)(s,[1,s.shape[0],s.shape[1],s.shape[2]]));const u={x:o},c={depthRadius:t,bias:n,alpha:r,beta:a},l=G.a.runKernel(q.Ab,u,c);return i?Object(Bt.reshape)(l,[l.shape[1],l.shape[2],l.shape[3]]):l}});const fr=Object(H.b)({log_:function(e){const t={x:Object(W.a)(e,"x","log","float32")};return G.a.runKernel(q.Gb,t)}});const hr=Object(H.b)({log1p_:function(e){const t={x:Object(W.a)(e,"x","log1p")};return G.a.runKernel(q.Hb,t)}});var mr=n(27);const br=Object(H.b)({softplus_:function(e){const t={x:Object(W.a)(e,"x","softplus")};return G.a.runKernel(q.Sc,t)}});const gr=Object(H.b)({logSigmoid_:function(e){const t=Object(W.a)(e,"x","logSigmoid"),n=Object(ut.a)((e=>({value:Object(mr.a)(br(Object(mr.a)(e))),gradFunc:t=>Object(at.mul)(t,Object(Wt.sigmoid)(Object(mr.a)(e)))})));return n(t)}});const yr=Object(H.b)({logSoftmax_:function(e,t=-1){const n=Object(W.a)(e,"logits","logSoftmax");if(-1===t&&(t=n.rank-1),t!==n.rank-1)throw Error(`Log Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and axis was ${t}`);const r=Object(ut.a)(((e,n)=>{const r=Un(e,t,!0),a=mt(e,r),s=mt(Object(U.a)(a,"float32"),fr(Object(Gn.a)(Yn(a),t,!0)));n([s]);return{value:s,gradFunc:(e,n)=>{const[r]=n,a=Yn(r);return mt(e,Object(at.mul)(Object(Gn.a)(e,t,!0),a))}}}));return r(n)}});const wr=Object(H.b)({logSumExp_:function(e,t=null,n=!1){const r=Object(W.a)(e,"x","logSumExp"),a=Object(_.I)(t,r.shape),s=Un(r,a,!0),o=mt(r,s),i=Yn(o),u=Object(Gn.a)(i,a),c=fr(u),l=Object(tt.add)(Object(Bt.reshape)(s,c.shape),c);if(n){const e=Fn(l.shape,a);return Object(Bt.reshape)(l,e)}return l}});const Or=Object(H.b)({logicalAnd_:function(e,t){const n=Object(W.a)(e,"a","logicalAnd","bool"),r=Object(W.a)(t,"b","logicalAnd","bool");Object(X.assertAndGetBroadcastShape)(n.shape,r.shape);const a={a:n,b:r};return G.a.runKernel(q.Jb,a)}});const vr=Object(H.b)({logicalNot_:function(e){const t={x:Object(W.a)(e,"x","logicalNot","bool")};return G.a.runKernel(q.Kb,t)}});const jr=Object(H.b)({logicalOr_:function(e,t){const n=Object(W.a)(e,"a","logicalOr","bool"),r=Object(W.a)(t,"b","logicalOr","bool");Object(X.assertAndGetBroadcastShape)(n.shape,r.shape);const a={a:n,b:r};return G.a.runKernel(q.Lb,a)}});const _r=Object(H.b)({logicalXor_:function(e,t){const n=Object(W.a)(e,"a","logicalXor","bool"),r=Object(W.a)(t,"b","logicalXor","bool");return Object(X.assertAndGetBroadcastShape)(n.shape,r.shape),Or(jr(e,t),vr(Or(e,t)))}}),Sr=2147483648;const kr=Object(H.b)({searchSorted_:function(e,t,n="left"){const r=Object(W.a)(e,"sortedSequence","searchSorted"),a=Object(W.a)(t,"values","searchSorted"),s=r.shape[r.shape.length-1],o=a.shape[a.shape.length-1],i=Object(Bt.reshape)(r,[-1,s]),u=Object(Bt.reshape)(a,[-1,o]);if(i.rank<2)throw new Error("Sorted input argument must be at least 2-dimensional");if(i.shape[0]!==u.shape[0])throw new Error("Leading dimension of 'sortedSequence' and 'values' must match.");if(Object(_.O)(u.shape)>=Sr)throw new Error("values tensor size must less than 2147483648");if(i.shape[1]>=Sr)throw new Error(`trailing dim_size must less than 2147483648 for int32 output type, was ${i.shape[1]}`);const c={sortedSequence:i,values:u},l={side:n};return G.a.runKernel(q.Jc,c,l)}});function xr(e,t){return kr(e,t,"left")}const Er=Object(H.b)({maxPool_:function(e,t,n,r,a){const s=Object(W.a)(e,"x","maxPool");let o=s,i=!1;3===s.rank&&(i=!0,o=Object(Bt.reshape)(s,[1,s.shape[0],s.shape[1],s.shape[2]])),_.c(4===o.rank,(()=>`Error in maxPool: input must be rank 4 but got rank ${o.rank}.`)),_.c(Ft.i(n,1),(()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${n} and dilations '1'`)),Ft.a("maxPool",r,a);const u={x:o},c={filterSize:t,strides:n,pad:r,dimRoundingMode:a},l=G.a.runKernel(q.Qb,u,c);return i?Object(Bt.reshape)(l,[l.shape[1],l.shape[2],l.shape[3]]):l}});const Tr=Object(H.b)({maxPool3d_:function(e,t=[1,1,1],n,r,a,s="NDHWC"){const o=Object(W.a)(e,"x","maxPool3d");let i=o,u=!1;4===o.rank&&(u=!0,i=Object(Bt.reshape)(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]])),_.c(5===i.rank,(()=>`Error in maxPool3d: x must be rank 5 but got rank ${i.rank}.`)),_.c("NDHWC"===s,(()=>`Error in maxPool3d: Only NDHWC is currently supported, but got dataFormat of ${s}`)),Object(Ft.a)("maxPool3d",r,a);const c={x:i},l={filterSize:t,strides:n,pad:r,dimRoundingMode:a,dataFormat:s},d=G.a.runKernel(q.Rb,c,l);return u?Object(Bt.reshape)(d,[d.shape[1],d.shape[2],d.shape[3],d.shape[4]]):d}});const Nr=Object(H.b)({maxPoolWithArgmax_:function(e,t,n,r,a=!1){const s={x:Object(W.a)(e,"x","maxPoolWithArgmax")},o={filterSize:t,strides:n,pad:r,includeBatchInIndex:a},i=G.a.runKernel(q.Ub,s,o);return{result:i[0],indexes:i[1]}}});var Ar=n(51);function Mr(e,t="float32"){if(Object(_.d)(e),"complex64"===t){const t=Mr(e,"float32"),n=Mr(e,"float32");return Object(sn.a)(t,n)}const n=Object(_.F)(Object(_.O)(e),t);return G.a.makeTensor(n,e,t)}function Ir(e,t="float32"){if(Object(_.d)(e),"complex64"===t){const t=Ir(e,"float32"),n=Mr(e,"float32");return Object(sn.a)(t,n)}const n=Object(_.D)(Object(_.O)(e),t);return G.a.makeTensor(n,e,t)}function Dr(e,t,{indexing:n="xy"}={}){if("xy"!==n&&"ij"!==n)throw new TypeError(`${n} is not a valid third argument to meshgrid`);if(void 0===e)return[];let r=Object(W.a)(e,"x","meshgrid",e instanceof Z.a?e.dtype:"float32");if(void 0===t)return[r];let a=Object(W.a)(t,"y","meshgrid",t instanceof Z.a?t.dtype:"float32");const s=Object(_.O)(r.shape),o=Object(_.O)(a.shape);return"xy"===n?(r=Object(Bt.reshape)(r,[1,-1]),a=Object(Bt.reshape)(a,[-1,1]),[Object(V.a)(Ir([o,1],r.dtype),r),Object(V.a)(a,Ir([1,s],a.dtype))]):(r=Object(Bt.reshape)(r,[-1,1]),a=Object(Bt.reshape)(a,[1,-1]),[Object(V.a)(r,Ir([1,o],r.dtype)),Object(V.a)(Ir([s,1],a.dtype),a)])}var $r=n(52);const Cr=Object(H.b)({mirrorPad_:function(e,t,n){_.c("reflect"===n||"symmetric"===n,(()=>`Invalid mode. Mode must be either reflect or symmetric. Got ${n}.`));const r=Object(W.a)(e,"x","mirrorPad");if(0===r.rank)throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad");_.c(t.length===r.rank,(()=>`Padding doesn't match input. Must be ${r.rank}. Got ${t.length}.`));const a="reflect"===n?1:0;for(let e=0;e<r.rank;e++)_.c(2===t[e].length,(()=>"Invalid number of paddings. Must be length of 2 each.")),_.c(t[e][0]>=0&&t[e][0]<=r.shape[e]-a&&t[e][1]>=0&&t[e][1]<=r.shape[e]-a,(()=>`Padding in dimension ${e} cannot be greater than or equal to ${r.shape[e]-a} or less than 0 for input of shape ${r.shape}`));const s={paddings:t,mode:n},o={x:r};return G.a.runKernel(q.Zb,o,s)}});const Rr=Object(H.b)({mod_:function(e,t){let n=Object(W.a)(e,"a","mod"),r=Object(W.a)(t,"b","mod");[n,r]=Object(Fe.makeTypesMatch)(n,r);const a={a:n,b:r};return G.a.runKernel(q.ac,a)}});const Pr=Object(H.b)({moments_:function(e,t=null,n=!1){e=Object(W.a)(e,"x","moments");const r=Object(_.I)(t,e.shape),a=Object(Ar.mean)(e,r,n);let s=a.shape;n||(s=Fn(a.shape,r));const o=ot(mt(Object(U.a)(e,"float32"),Object(Bt.reshape)(a,s)));return{mean:a,variance:Object(Ar.mean)(o,r,n)}}});const Fr=Object(H.b)({multiRNNCell_:function(e,t,n,r){const a=Object(W.a)(t,"data","multiRNNCell"),s=Object(W.b)(n,"c","multiRNNCell"),o=Object(W.b)(r,"h","multiRNNCell");let i=a;const u=[];for(let t=0;t<e.length;t++){const n=e[t](i,s[t],o[t]);u.push(n[0]),u.push(n[1]),i=n[1]}const c=[],l=[];for(let e=0;e<u.length;e+=2)c.push(u[e]),l.push(u[e+1]);return[c,l]}});const Br=Object(H.b)({multinomial_:function(e,t,n,r=!1){const a=Object(W.a)(e,"logits","multinomial"),s=a.size,o=a.rank;if(s<2)throw new Error(`Error in multinomial: you need at least 2 outcomes, but got ${s}.`);if(o>2)throw new Error(`Rank of probabilities must be 1 or 2, but is ${o}`);n=n||Math.random();const i={logits:1===o?Object(Bt.reshape)(a,[1,-1]):a},u={numSamples:t,seed:n,normalized:r},c=G.a.runKernel(q.bc,i,u);return 1===o?Object(Bt.reshape)(c,[c.size]):c}});const Lr=Object(H.b)({notEqual_:function(e,t){let n=Object(W.a)(e,"a","notEqual","string_or_numeric"),r=Object(W.a)(t,"b","notEqual","string_or_numeric");[n,r]=Object(Fe.makeTypesMatch)(n,r),Object(X.assertAndGetBroadcastShape)(n.shape,r.shape);const a={a:n,b:r};return G.a.runKernel(q.hc,a)}});const zr=Object(H.b)({onesLike_:function(e){const t={x:Object(W.a)(e,"x","onesLike")};return G.a.runKernel(q.jc,t)}});const Wr=Object(H.b)({outerProduct_:function(e,t){const n=Object(W.a)(e,"v1","outerProduct"),r=Object(W.a)(t,"v2","outerProduct");_.c(1===n.rank&&1===r.rank,(()=>`Error in outerProduct: inputs must be rank 1, but got ranks ${n.rank} and ${r.rank}.`));const a=Object(Bt.reshape)(n,[-1,1]),s=Object(Bt.reshape)(r,[1,-1]);return Object(V.a)(a,s)}});var Ur=n(39);const Vr=Object(H.b)({pad1d_:function(e,t,n=0){return Object(_.c)(2===t.length,(()=>"Invalid number of paddings. Must be length of 2.")),Object(Ur.pad)(e,[t],n)}});const Gr=Object(H.b)({pad2d_:function(e,t,n=0){return Object(_.c)(2===t.length&&2===t[0].length&&2===t[1].length,(()=>"Invalid number of paddings. Must be length of 2 each.")),Object(Ur.pad)(e,t,n)}});const qr=Object(H.b)({pad3d_:function(e,t,n=0){return Object(_.c)(3===t.length&&2===t[0].length&&2===t[1].length&&2===t[2].length,(()=>"Invalid number of paddings. Must be length of 2 each.")),Object(Ur.pad)(e,t,n)}});const Hr=Object(H.b)({pad4d_:function(e,t,n=0){return Object(_.c)(4===t.length&&2===t[0].length&&2===t[1].length&&2===t[2].length&&2===t[3].length,(()=>"Invalid number of paddings. Must be length of 2 each.")),Object(Ur.pad)(e,t,n)}});const Kr=Object(H.b)({spaceToBatchND_:function(e,t,n){const r=Object(W.a)(e,"x","spaceToBatchND");_.c(r.rank>=1+t.length,(()=>`input rank ${r.rank} should be > than [blockShape] ${t.length}`)),_.c(n.length===t.length,(()=>`paddings.shape[0] ${n.length} must be equal to [blockShape] ${t.length}`)),_.c(r.shape.reduce(((e,r,a)=>a>0&&a<=t.length?e&&(r+n[a-1][0]+n[a-1][1])%t[a-1]==0:e),!0),(()=>`input spatial dimensions ${r.shape.slice(1)} with paddings ${n.toString()} must be divisible by blockShapes ${t.toString()}`));const a={x:r},s={blockShape:t,paddings:n};return G.a.runKernel(q.Tc,a,s)}});const Yr=Object(H.b)({pool_:function(e,t,n,r,a,s,o){null==a&&(a=[1,1]),null==s&&(s=1),0===r&&(r="valid");const i=Object(W.a)(e,"x","maxPool");let u=i,c=!1;3===i.rank&&(c=!0,u=Object(Bt.reshape)(i,[1,i.shape[0],i.shape[1],i.shape[2]])),_.c(Ft.i(s,a),(()=>`Error in pool: Either strides or dilations must be 1. Got strides ${s} and dilations '${a}'`));const l=Ft.f(u.shape,t,s,a,r),d=[l.dilationHeight,l.dilationWidth];let p;p="same"===r?function(e,t){const n=e.map(((e,n)=>e+(e-1)*(t[n]-1))).map((e=>e-1)),r=n.map((e=>Math.floor(e/2))),a=n.map(((e,t)=>e-r[t]));return n.map(((e,t)=>[r[t],a[t]]))}([l.filterHeight,l.filterWidth],d):[[0,0],[0,0]];const f=1===d[0]&&1===d[1],[h,m]=function(e,t,n){const r=n.map((e=>e[0])),a=n.map((e=>e[1])),s=e.concat(r,a),o=t.map(((e,t)=>(e-s[t]%e)%e)),i=a.map(((e,t)=>e+o[t])),u=t.map(((e,t)=>[r[t],i[t]])),c=t.map(((e,t)=>[0,o[t]]));return[u,c]}([l.inHeight,l.inWidth],d,p),b=f?r:"valid",g=f?u:Kr(u,d,h),y=("avg"===n?()=>Object(Pt.avgPool)(g,t,s,b,o):()=>Er(g,t,s,b,o))(),w=f?y:qt(y,d,m);return c?Object(Bt.reshape)(w,[w.shape[1],w.shape[2],w.shape[3]]):w}});var Jr=n(74),Xr=n(75);const Qr=Object(H.b)({prod_:function(e,t=null,n=!1){let r=Object(W.a)(e,"x","prod");"bool"===r.dtype&&(r=Object(U.a)(r,"int32"));const a={x:r},s={axis:t,keepDims:n};return G.a.runKernel(q.pc,a,s)}});const Zr=Object(H.b)({raggedGather_:function(e,t,n,r){const a={paramsNestedSplits:e.map(((e,t)=>Object(W.a)(e,`tensors${t}`,"raggedGather","int32"))),paramsDenseValues:Object(W.a)(t,"paramsDenseValues","raggedGather"),indices:Object(W.a)(n,"indices","raggedGather","int32")},s={outputRaggedRank:r},o=G.a.runKernel(q.qc,a,s);return{outputNestedSplits:o.slice(0,o.length-1),outputDenseValues:o[o.length-1]}}});const ea=Object(H.b)({raggedRange_:function(e,t,n){const r=Object(W.a)(e,"starts","raggedRange"),a={starts:r,limits:Object(W.a)(t,"limits","raggedRange",r.dtype),deltas:Object(W.a)(n,"deltas","raggedRange",r.dtype)},s=G.a.runKernel(q.rc,a);return{rtNestedSplits:s[0],rtDenseValues:s[1]}}});const ta=Object(H.b)({raggedTensorToTensor_:function(e,t,n,r,a){const s=Object(W.a)(e,"shape","raggedTensorToTensor","int32"),o=Object(W.a)(t,"values","raggedTensorToTensor"),i={shape:s,values:o,defaultValue:Object(W.a)(n,"defaultValue","raggedTensorToTensor",o.dtype),rowPartitionTensors:r.map(((e,t)=>Object(W.a)(e,`tensors${t}`,"raggedTensorToTensor","int32")))},u={rowPartitionTypes:a};return G.a.runKernel(q.sc,i,u)}});const na=Object(H.b)({rand_:function(e,t,n){Object(_.d)(e);const r=Object(_.O)(e);let a=null;if(null==n||"float32"===n)a=new Float32Array(r);else if("int32"===n)a=new Int32Array(r);else{if("bool"!==n)throw new Error(`Unknown data type ${n}`);a=new Uint8Array(r)}for(let e=0;e<r;e++)a[e]=t();return G.a.makeTensor(a,e,n)}});var ra=n(83);class aa{constructor(e,t,n,r,a){this.mean=e,this.stdDev=t,this.dtype=n,this.nextVal=NaN,this.truncated=r,this.truncated&&(this.upper=this.mean+2*this.stdDev,this.lower=this.mean-2*this.stdDev);const s=a||Math.random();this.random=ra.alea(s.toString())}nextValue(){if(!isNaN(this.nextVal)){const e=this.nextVal;return this.nextVal=NaN,e}let e,t,n=!1;for(;!n;){let r,a,s;do{r=2*this.random()-1,a=2*this.random()-1,s=r*r+a*a}while(s>=1||0===s);const o=Math.sqrt(-2*Math.log(s)/s);e=this.mean+this.stdDev*r*o,t=this.mean+this.stdDev*a*o,this.truncated&&!this.isValidTruncated(e)||(n=!0)}return this.truncated&&!this.isValidTruncated(t)||(this.nextVal=this.convertValue(t)),this.convertValue(e)}convertValue(e){return null==this.dtype||"float32"===this.dtype?e:Math.round(e)}isValidTruncated(e){return e<=this.upper&&e>=this.lower}}class sa{constructor(e,t,n,r){this.alpha=e,this.beta=1/t,this.dtype=n;const a=r||Math.random();this.randu=ra.alea(a.toString()),this.randn=new aa(0,1,n,!1,this.randu()),this.d=e<1?e+2/3:e-1/3,this.c=1/Math.sqrt(9*this.d)}nextValue(){let e,t,n,r,a,s;for(;;){do{r=this.randn.nextValue(),s=1+this.c*r}while(s<=0);if(s*=s*s,e=r*r,t=1-.331*e*e,n=.5*e+this.d*(1-s+Math.log(s)),a=this.randu(),a<t||Math.log(a)<n)break}return s=1/this.beta*this.d*s,this.alpha<1&&(s*=Math.pow(this.randu(),1/this.alpha)),this.convertValue(s)}convertValue(e){return"float32"===this.dtype?e:Math.round(e)}}class oa{constructor(e=0,t=1,n,r){if(this.canReturnFloat=()=>null==this.dtype||"float32"===this.dtype,this.min=e,this.range=t-e,this.dtype=n,null==r&&(r=Math.random()),"number"==typeof r&&(r=r.toString()),!this.canReturnFloat()&&this.range<=1)throw new Error(`The difference between ${e} - ${t} <= 1 and dtype is not float`);this.random=ra.alea(r)}convertValue(e){return this.canReturnFloat()?e:Math.round(e)}nextValue(){return this.convertValue(this.min+this.range*this.random())}}const ia=Object(H.b)({randomGamma_:function(e,t,n=1,r="float32",a){if(Object(_.d)(e),null==n&&(n=1),null==r&&(r="float32"),"float32"!==r&&"int32"!==r)throw new Error(`Unsupported data type ${r}`);const s=new sa(t,n,r,a),o=Object(nn.a)(e,r);for(let e=0;e<o.values.length;e++)o.values[e]=s.nextValue();return o.toTensor()}});const ua=Object(H.b)({randomNormal_:function(e,t=0,n=1,r,a){if(Object(_.d)(e),null!=r&&"bool"===r)throw new Error(`Unsupported data type ${r}`);const s=new aa(t,n,r,!1,a),o=Object(nn.a)(e,r);for(let e=0;e<o.values.length;e++)o.values[e]=s.nextValue();return o.toTensor()}});const ca=Object(H.b)({randomStandardNormal_:function(e,t,n){if(null!=t&&"bool"===t)throw new Error(`Unsupported data type ${t}`);return ua(e,0,1,t,n)}});const la=Object(H.b)({randomUniform_:function(e,t=0,n=1,r="float32",a){Object(_.d)(e);const s=Object(nn.a)(e,r),o=new oa(t,n,null,a);for(let e=0;e<s.values.length;e++)s.values[e]=o.nextValue();return s.toTensor()}});const da=Object(H.b)({randomUniformInt_:function(e,t,n,r){return la(e,t,n,"int32",r)}});function pa(e,t,n=1,r="float32"){if(0===n)throw new Error("Cannot have a step of zero");const a={start:e,stop:t,step:n,dtype:r};return G.a.runKernel(q.tc,{},a)}var fa=n(46);const ha=Object(H.b)({reciprocal_:function(e){const t={x:Object(W.a)(e,"x","reciprocal")};return G.a.runKernel(q.wc,t)}});var ma=n(45),ba=n(67);const ga=Object(H.b)({reverse_:function(e,t){const n={x:Object(W.a)(e,"x","reverse")},r={dims:t};return G.a.runKernel(q.Ec,n,r)}});const ya=Object(H.b)({reverse1d_:function(e){const t=Object(W.a)(e,"x","reverse");return _.c(1===t.rank,(()=>`Error in reverse1D: x must be rank 1 but got rank ${t.rank}.`)),ga(t,0)}});const wa=Object(H.b)({reverse2d_:function(e,t){const n=Object(W.a)(e,"x","reverse");return _.c(2===n.rank,(()=>`Error in reverse2D: x must be rank 2 but got rank ${n.rank}.`)),ga(n,t)}});const Oa=Object(H.b)({reverse3d_:function(e,t){const n=Object(W.a)(e,"x","reverse");return _.c(3===n.rank,(()=>`Error in reverse3D: x must be rank 3 but got rank ${n.rank}.`)),ga(n,t)}});const va=Object(H.b)({reverse4d_:function(e,t){const n=Object(W.a)(e,"x","reverse");return _.c(4===n.rank,(()=>`Error in reverse4D: x must be rank 4 but got rank ${n.rank}.`)),ga(n,t)}});const ja=Object(H.b)({round_:function(e){const t={x:Object(W.a)(e,"x","round")};return G.a.runKernel(q.Gc,t)}});const _a=Object(H.b)({rsqrt_:function(e){const t={x:Object(W.a)(e,"x","rsqrt","float32")};return G.a.runKernel(q.Hc,t)}});const Sa=Object(H.b)({selu_:function(e){const t={x:Object(W.a)(e,"x","selu")};return G.a.runKernel(q.Lc,t)}});const ka=Object(H.b)({separableConv2d_:function(e,t,n,r,a,s=[1,1],o="NHWC"){const i=Object(W.a)(e,"x","separableConv2d"),u=Object(W.a)(t,"depthwiseFilter","separableConv2d"),c=Object(W.a)(n,"pointwiseFilter","separableConv2d");let l=i,d=!1;if(3===i.rank&&(d=!0,l=Object(Bt.reshape)(i,[1,i.shape[0],i.shape[1],i.shape[2]])),"NCHW"===o)throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");_.c(4===l.rank,(()=>`Error in separableConv2d: input must be rank 4, but got rank ${l.rank}.`)),_.c(4===u.rank,(()=>`Error in separableConv2d: depthwise filter must be rank 4, but got rank ${u.rank}.`)),_.c(4===c.rank,(()=>`Error in separableConv2d: pointwise filter must be rank 4, but got rank ${u.rank}.`)),_.c(1===c.shape[0],(()=>`Error in separableConv2d: the first dimension of pointwise filter must be 1, but got ${c.shape[0]}.`)),_.c(1===c.shape[1],(()=>`Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${c.shape[1]}.`));const p=u.shape[2],f=u.shape[3];_.c(c.shape[2]===p*f,(()=>`Error in separableConv2d: the third dimension of pointwise filter must be ${p*f}, but got ${c.shape[2]}.`));const h=Object(Sn.a)(l,u,r,a,o,s),m=Object(dn.a)(h,c,1,"valid",o);return d?Object(Bt.reshape)(m,[m.shape[1],m.shape[2],m.shape[3]]):m}});const xa=async function(e,t){const n=Object(W.a)(e,"x","setdiff1d"),r=Object(W.a)(t,"y","setdiff1d");_.c(n.dtype===r.dtype,(()=>`x and y should have the same dtype, but got x (${n.dtype}) and y (${r.dtype}).`)),_.c(1===n.rank,(()=>`x should be 1D tensor, but got x (${n.shape}).`)),_.c(1===r.rank,(()=>`y should be 1D tensor, but got y (${r.shape}).`));const a=await n.data(),s=await r.data(),o=new Set(s);let i=0;for(let e=0;e<a.length;e++)o.has(a[e])||i++;const u=new Z.b([i],n.dtype),c=new Z.b([i],"int32");for(let e=0,t=0;e<a.length;e++)o.has(a[e])||(u.values[t]=a[e],c.values[t]=e,t++);return[u.toTensor(),c.toTensor()]};const Ea=Object(H.b)({sign_:function(e){const t={x:Object(W.a)(e,"x","sign")};return G.a.runKernel(q.Nc,t)}});const Ta=Object(H.b)({sin_:function(e){const t={x:Object(W.a)(e,"x","sin","float32")};return G.a.runKernel(q.Oc,t)}});const Na=Object(H.b)({sinh_:function(e){const t={x:Object(W.a)(e,"x","sinh")};return G.a.runKernel(q.Pc,t)}});const Aa=Object(H.b)({slice1d_:function(e,t,n){const r=Object(W.a)(e,"x","slice1d");return _.c(1===r.rank,(()=>`slice1d expects a rank-1 tensor, but got a rank-${r.rank} tensor`)),Ut(r,[t],[n])}});const Ma=Object(H.b)({slice2d_:function(e,t,n){const r=Object(W.a)(e,"x","slice2d");return _.c(2===r.rank,(()=>`slice2d expects a rank-2 tensor, but got a rank-${r.rank} tensor`)),Ut(r,t,n)}});const Ia=Object(H.b)({slice3d_:function(e,t,n){const r=Object(W.a)(e,"x","slice3d");return _.c(3===r.rank,(()=>`slice3d expects a rank-3 tensor, but got a rank-${r.rank} tensor`)),Ut(r,t,n)}});const Da=Object(H.b)({slice4d_:function(e,t,n){const r=Object(W.a)(e,"x","slice4d");return _.c(4===r.rank,(()=>`slice4d expects a rank-4 tensor, but got a rank-${r.rank} tensor`)),Ut(r,t,n)}});var $a=n(84);const Ca=Object(H.b)({fft_:function(e){Object(_.c)("complex64"===e.dtype,(()=>`The dtype for tf.spectral.fft() must be complex64 but got ${e.dtype}.`));const t={input:e};return G.a.runKernel(q.hb,t)}});const Ra=Object(H.b)({ifft_:function(e){Object(_.c)("complex64"===e.dtype,(()=>`The dtype for tf.spectral.ifft() must be complex64 but got ${e.dtype}.`));const t={input:e};return G.a.runKernel(q.ub,t)}});const Pa=Object(H.b)({irfft_:function(e){const t=e.shape[e.shape.length-1],n=e.size/t;let r;if(t<=2){const a=Object(Bt.reshape)(e,[n,t]);r=Ra(a)}else{const a=[n,2*(t-1)],s=Object(Bt.reshape)(Object(fa.a)(e),[n,t]),o=Object(Bt.reshape)(Object(ar.a)(e),[n,t]),i=ga(Ut(s,[0,1],[n,t-2]),1),u=Object(at.mul)(ga(Ut(o,[0,1],[n,t-2]),1),ct(-1)),c=Object(zt.concat)([s,i],1),l=Object(zt.concat)([o,u],1),d=Object(Bt.reshape)(Object(sn.a)(c,l),[a[0],a[1]]);r=Ra(d)}if(r=Object(fa.a)(r),3===e.rank&&0!==e.shape[0]){const t=r,n=e.shape[0];r=Object(Bt.reshape)(r,[n,r.shape[0]/n,r.shape[1]]),t.dispose()}return r}});const Fa=Object(H.b)({split_:function(e,t,n=0){const r={x:Object(W.a)(e,"x","split")},a={numOrSizeSplits:t,axis:n};return G.a.runKernel(q.Zc,r,a)}});const Ba=Object(H.b)({rfft_:function(e,t){Object(_.c)("float32"===e.dtype,(()=>`The dtype for rfft() must be real value but got ${e.dtype}`));let n=e.shape[e.shape.length-1];const r=e.size/n;let a;if(null!=t&&t<n){const r=e.shape.map((e=>0)),s=e.shape.map((e=>e));s[e.shape.length-1]=t,a=Ut(e,r,s),n=t}else if(null!=t&&t>n){const r=e.shape.map((e=>e));r[e.shape.length-1]=t-n,a=Object(zt.concat)([e,Mr(r)],e.shape.length-1),n=t}else a=e;const s=it(a),o=Object(Bt.reshape)(Object(sn.a)(a,s),[r,n]),i=Ca(o),u=Math.floor(n/2)+1,c=Object(fa.a)(i),l=Object(ar.a)(i),d=Fa(c,[u,n-u],c.shape.length-1),p=Fa(l,[u,n-u],l.shape.length-1),f=a.shape.slice();return f[a.shape.length-1]=u,Object(Bt.reshape)(Object(sn.a)(d[0],p[0]),f)}});const La=Object(H.b)({squaredDifference_:function(e,t){let n=Object(W.a)(e,"a","squaredDifference"),r=Object(W.a)(t,"b","squaredDifference");[n,r]=Object(Fe.makeTypesMatch)(n,r),Object(X.assertAndGetBroadcastShape)(n.shape,r.shape);const a={a:n,b:r};return G.a.runKernel(q.cd,a,{})}});var za=n(54),Wa=n(43),Ua=n(76),Va=n(85);const Ga=Object(H.b)({tan_:function(e){const t={x:Object(W.a)(e,"x","tan","float32")};return G.a.runKernel(q.ld,t)}});var qa=n(44),Ha=n(24);function Ka(e,t,n){if(Object(_.e)(e),null!=t&&2!==t.length)throw new Error("tensor2d() requires shape to have two numbers");const r=Object(W.c)(e,n);if(2!==r.length&&1!==r.length)throw new Error("tensor2d() requires values to be number[][] or flat/TypedArray");if(1===r.length&&null==t)throw new Error("tensor2d() requires shape to be provided when `values` are a flat/TypedArray");return Object(ee.a)(e,t,r,n)}function Ya(e,t,n){if(Object(_.e)(e),null!=t&&4!==t.length)throw new Error("tensor4d() requires shape to have four numbers");const r=Object(W.c)(e,n);if(4!==r.length&&1!==r.length)throw new Error("tensor4d() requires values to be number[][][][] or flat/TypedArray");if(1===r.length&&null==t)throw new Error("tensor4d() requires shape to be provided when `values` are a flat array");return Object(ee.a)(e,t,r,n)}function Ja(e,t,n){if(Object(_.e)(e),null!=t&&5!==t.length)throw new Error("tensor5d() requires shape to have five numbers");const r=Object(W.c)(e,n);if(5!==r.length&&1!==r.length)throw new Error("tensor5d() requires values to be number[][][][][] or flat/TypedArray");if(1===r.length&&null==t)throw new Error("tensor5d() requires shape to be provided when `values` are a flat array");return Object(ee.a)(e,t,r,n)}function Xa(e,t,n){if(Object(_.e)(e),null!=t&&6!==t.length)throw new Error("tensor6d() requires shape to have six numbers");const r=Object(W.c)(e,n);if(6!==r.length&&1!==r.length)throw new Error("tensor6d() requires values to be number[][][][][][] or flat/TypedArray");if(1===r.length&&null==t)throw new Error("tensor6d() requires shape to be provided when `values` are a flat array");return t=t||r,Object(ee.a)(e,t,r,n)}const Qa=Object(H.b)({tensorScatterUpdate_:function(e,t,n){const r=Object(W.a)(e,"tensor","tensorScatterupdate"),a=Object(W.a)(t,"indices","tensorScatterupdate","int32"),s=Object(W.a)(n,"updates","tensorScatterupdate");if(fe(s,a,r.shape),r.dtype!==s.dtype)throw new Error(`tensor and updates must have the same dtype, instead they are ${r.dtype} and ${s.dtype}.`);const o={tensor:r,indices:a,updates:s};return G.a.runKernel(q.nd,o,{})}});const Za=Object(H.b)({topk_:function(e,t=1,n=!0){const r=Object(W.a)(e,"x","topk");if(0===r.rank)throw new Error("topk() expects the input to be of rank 1 or higher");const a=r.shape[r.shape.length-1];if(t<0)throw new Error(`'k' passed to topk() must be >= 0 but got ${t}`);if(t>a)throw new Error(`'k' passed to topk() must be <= the last dimension (${a}) but got ${t}`);const s={x:r},o={k:t,sorted:n},[i,u]=G.a.runKernel(q.pd,s,o);return{values:i,indices:u}}});const es=Object(H.b)({truncatedNormal_:function(e,t=0,n=1,r,a){if(Object(_.d)(e),null!=r&&"bool"===r)throw new Error("Unsupported data type $ { dtype }");const s=new aa(t,n,r,!0,a),o=Object(nn.a)(e,r);for(let e=0;e<o.values.length;e++)o.values[e]=s.nextValue();return o.toTensor()}});const ts=Object(H.b)({unique_:function(e,t=0){const n=Object(W.a)(e,"x","unique","string_or_numeric");Object(_.c)(n.rank>0,(()=>"The input tensor must be at least 1D"));const r={x:n},a={axis:t},[s,o]=G.a.runKernel(q.sd,r,a);return{values:s,indices:o}}});const ns=Object(H.b)({unsortedSegmentSum_:function(e,t,n){const r=Object(W.a)(e,"x","unsortedSegmentSum"),a=Object(W.a)(t,"segmentIds","unsortedSegmentSum","int32");Object(_.c)(Object(_.w)(n),(()=>"numSegments must be of dtype int"));const s={x:r,segmentIds:a},o={numSegments:n};return G.a.runKernel(q.ud,s,o)}});const rs=Object(H.b)({unstack_:function(e,t=0){const n=Object(W.a)(e,"x","unstack","string_or_numeric");_.c(t>=-n.shape.length&&t<n.shape.length,(()=>`Axis = ${t} is not in [-${n.shape.length}, ${n.shape.length})`));const r={value:n},a={axis:t};return G.a.runKernel(q.td,r,a)}});function as(e,t){return kr(e,t,"right")}function ss(e,t=!0,n,r){return G.a.makeVariable(e,t,n,r)}function os(e,t){const n=[];for(let e=0;e<t.length;e++)t[e]&&n.push(e);const r=Object(nn.a)(e,"int32"),a=Object(nn.a)([n.length,e.length],"int32");for(let t=0;t<n.length;t++){const s=r.indexToLoc(n[t]),o=t*e.length;a.values.set(s,o)}return a.toTensor()}const is=async function(e){const t=Object(W.a)(e,"condition","whereAsync","bool"),n=await t.data(),r=os(t.shape,n);return e!==t&&t.dispose(),r};const us=async function(e,t,n){const r=Object(W.a)(e,"tensor","boolMask"),a=Object(W.a)(t,"mask","boolMask","bool"),s=null==n?0:n,o=a.rank,i=r.shape;_.c(o>0,(()=>"mask cannot be scalar")),_.f(i.slice(s,s+o),a.shape,"mask's shape must match the first K dimensions of tensor's shape,");let u=1;for(let e=s;e<s+o;e++)u*=i[e];const c=i.slice(0,s).concat([u],i.slice(s+o)),l=Object(Bt.reshape)(r,c),d=Object(Bt.reshape)(a,[-1]),p=await is(d),f=Object(za.squeeze)(p,[1]),h=tr(l,f,s);return e!==r&&r.dispose(),t!==a&&a.dispose(),f.dispose(),l.dispose(),d.dispose(),p.dispose(),h};const cs=Object(H.b)({movingAverage_:function(e,t,n,r,a=!0){const s=Object(W.a)(e,"v","movingAverage"),o=Object(W.a)(t,"x","movingAverage"),i=Object(W.a)(n,"decay","movingAverage");Object(Fe.assertTypesMatch)(s,o),_.c(_.a(s.shape,o.shape),(()=>"Shape mismatch in v and x"));const u=ct(1),c=mt(u,i);let l=Object(at.mul)(mt(o,s),c);if(a){_.c(null!=r,(()=>"When using zeroDebias: true, step is required."));const e=Object(W.a)(r,"step","movingAverage");l=rt(l,mt(u,ht(i,e)))}return Object(tt.add)(s,l)}});const ls=Object(H.b)({scatterND_:function(e,t,n){Object(_.d)(n);const r=Object(W.a)(e,"indices","scatterND","int32"),a=Object(W.a)(t,"updates","scatterND");fe(a,r,n);const s={indices:r,updates:a},o={shape:n};return G.a.runKernel(q.Ic,s,o)}});const ds=Object(H.b)({sparseToDense_:function(e,t,n,r=0){Object(_.d)(n);const a=Object(W.a)(e,"sparseIndices","sparseToDense","int32"),s=Object(W.a)(t,"sparseValues","sparseToDense","string_or_numeric"),o=Object(W.a)(r,"defaultValue","sparseToDense",s.dtype);!function(e,t,n,r){if("int32"!==e.dtype)throw new Error(`tf.sparseToDense() expects the indices to be int32 type, but the dtype was ${e.dtype}.`);if(e.rank>2)throw new Error(`sparseIndices should be a scalar, vector, or matrix, but got shape ${e.shape}.`);const a=e.rank>0?e.shape[0]:1,s=e.rank>1?e.shape[1]:1;if(n.length!==s)throw new Error(`outputShape has incorrect number of elements:, ${n.length}, should be: ${s}.`);const o=t.size;if(0!==t.rank&&(1!==t.rank||o!==a))throw new Error(`sparseValues has incorrect shape ${t.shape}, should be [] or [${a}]`);if(t.dtype!==r.dtype)throw new Error("sparseValues.dtype must match defaultValues.dtype")}(a,s,n,o);const i={sparseIndices:a,sparseValues:s,defaultValue:o},u={outputShape:n};return G.a.runKernel(q.Yc,i,u)}});const ps=Object(H.b)({gatherND_:function(e,t){const n=Object(W.a)(t,"indices","gatherND","int32"),r={params:Object(W.a)(e,"x","gatherND","string_or_numeric"),indices:n};return G.a.runKernel(q.qb,r)}});const fs=Object(H.b)({dropout_:function(e,t,n,r){const a=Object(W.a)(e,"x","dropout");if(_.c("float32"===a.dtype,(()=>`x has to be a floating point tensor since it's going to be scaled, but got a ${a.dtype} tensor instead.`)),_.c(t>=0&&t<1,(()=>`rate must be a float in the range [0, 1), but got ${t}.`)),0===t)return e instanceof Z.a?a.clone():a;const s=function(e,t){if(null==t)return e.shape.slice();if(_.a(e.shape,t))return t;if(e.shape.length===t.length){const n=[];for(let r=0;r<e.shape.length;r++)null==t[r]&&null!=e.shape[r]?n.push(e.shape[r]):n.push(t[r]);return n}return t}(a,n),o=1-t,i=rt(er(Object(tt.add)(la(s,0,1,"float32",r),o)),o);return Object(at.mul)(a,i)}});function hs(e){return Math.floor(Math.pow(2,Math.ceil(Math.log(e)/Math.log(2))))}function ms(e,t,n){const r=1-e%2,a=new Float32Array(e);for(let s=0;s<e;++s){const o=2*Math.PI*s/(e+r-1);a[s]=t-n*Math.cos(o)}return Object(Ha.tensor1d)(a,"float32")}const bs=async function(e,t,n=1){const r=Object(W.a)(e,"predictions","inTopK"),a=Object(W.a)(t,"targets","inTopK");Object(_.c)(r.rank>1,(()=>`inTopK() expects the predictions to be of rank 2 or higher, but got ${r.rank}`)),Object(_.c)(r.rank-1===a.rank,(()=>`predictions rank should be 1 larger than targets rank, but got predictions rank ${r.rank} and targets rank ${a.rank}`)),Object(_.f)(r.shape.slice(0,r.shape.length-1),a.shape,"predictions's shape should be align with the targets' shape, except the last dimension.");const s=r.shape[r.shape.length-1];Object(_.c)(n>0&&n<=s,(()=>`'k' passed to inTopK() must be > 0 && <= the predictions last dimension (${s}), but got ${n}`));const o=await r.data(),i=await a.data(),[u,c]=[o.length/s,s],l=Object(_.p)("bool",u);for(let e=0;e<u;e++){const t=e*c,r=o.subarray(t,t+c),a=[];for(let e=0;e<r.length;e++)a.push({value:r[e],index:e});a.sort(((e,t)=>t.value-e.value)),l[e]=0;for(let t=0;t<n;t++)if(a[t].index===i[e]){l[e]=1;break}}return e!==r&&r.dispose(),t!==a&&a.dispose(),Object(qa.a)(l,a.shape,"bool")};var gs=n(88),ys=n(87),ws=n(86);const Os=Object(H.b)({hammingWindow_:function(e){return ms(e,.54,.46)}});const vs=Object(H.b)({hannWindow_:function(e){return ms(e,.5,.5)}});const js=Object(H.b)({frame_:function(e,t,n,r=!1,a=0){let s=0;const o=[];for(;s+t<=e.size;)o.push(Ut(e,s,t)),s+=n;if(r)for(;s<e.size;){const r=s+t-e.size,i=Object(zt.concat)([Ut(e,s,t-r),pt([r],a)]);o.push(i),s+=n}return 0===o.length?Ka([],[0,t]):Object(Bt.reshape)(Object(zt.concat)(o),[o.length,t])}});const _s=Object(H.b)({stft_:function(e,t,n,r,a=vs){null==r&&(r=hs(t));const s=js(e,t,n),o=Object(at.mul)(s,a(t));return Ba(o,r)}});const Ss=Object(H.b)({cropAndResize_:function(e,t,n,r,a="bilinear",s=0){const o=Object(W.a)(e,"image","cropAndResize"),i=Object(W.a)(t,"boxes","cropAndResize","float32"),u=Object(W.a)(n,"boxInd","cropAndResize","int32"),c=i.shape[0];_.c(4===o.rank,(()=>`Error in cropAndResize: image must be rank 4,but got rank ${o.rank}.`)),_.c(2===i.rank&&4===i.shape[1],(()=>`Error in cropAndResize: boxes must be have size [${c},4] but had shape ${i.shape}.`)),_.c(1===u.rank&&u.shape[0]===c,(()=>`Error in cropAndResize: boxInd must be have size [${c}] but had shape ${i.shape}.`)),_.c(2===r.length,(()=>`Error in cropAndResize: cropSize must be of length 2, but got length ${r.length}.`)),_.c(r[0]>=1&&r[1]>=1,(()=>`cropSize must be atleast [1,1], but was ${r}`)),_.c("bilinear"===a||"nearest"===a,(()=>`method must be bilinear or nearest, but was ${a}`));const l={image:o,boxes:i,boxInd:u},d={method:a,extrapolationValue:s,cropSize:r};return G.a.runKernel(q.M,l,d)}});const ks=Object(H.b)({flipLeftRight_:function(e){const t=Object(W.a)(e,"image","flipLeftRight","float32");_.c(4===t.rank,(()=>`Error in flipLeftRight: image must be rank 4,but got rank ${t.rank}.`));const n={image:t};return G.a.runKernel(q.jb,n,{})}});const xs=Object(H.b)({grayscaleToRGB_:function(e){const t=Object(W.a)(e,"image","grayscaleToRGB"),n=t.rank-1,r=t.shape[n];_.c(t.rank>=2,(()=>`Error in grayscaleToRGB: images must be at least rank 2, but got rank ${t.rank}.`)),_.c(1===r,(()=>`Error in grayscaleToRGB: last dimension of a grayscale image should be size 1, but got size ${r}.`));const a=new Array(t.rank);return a.fill(1,0,n),a[n]=3,Qn(t,a)}});const Es=Object(H.b)({rgbToGrayscale_:function(e){const t=Object(W.a)(e,"image","RGBToGrayscale"),n=t.rank-1,r=t.shape[n];_.c(t.rank>=2,(()=>`Error in RGBToGrayscale: images must be at least rank 2, but got rank ${t.rank}.`)),_.c(3===r,(()=>`Error in RGBToGrayscale: last dimension of an RGB image should be size 3, but got size ${r}.`));const a=t.dtype,s=Object(U.a)(t,"float32"),o=Object(Ha.tensor1d)([.2989,.587,.114]);let i;switch(t.rank){case 2:i=Mn("ij,j->i",s,o);break;case 3:i=Mn("ijk,k->ij",s,o);break;case 4:i=Mn("ijkl,l->ijk",s,o);break;case 5:i=Mn("ijklm,m->ijkl",s,o);break;case 6:i=Mn("ijklmn,n->ijklm",s,o);break;default:throw new Error("Not a valid tensor rank.")}return i=Jn(i,-1),Object(U.a)(i,a)}});const Ts=Object(H.b)({rotateWithOffset_:function(e,t,n=0,r=.5){const a=Object(W.a)(e,"image","rotateWithOffset","float32");_.c(4===a.rank,(()=>`Error in rotateWithOffset: image must be rank 4,but got rank ${a.rank}.`));const s={image:a},o={radians:t,fillValue:n,center:r};return G.a.runKernel(q.Fc,s,o)}});function Ns(e,t,n,r,a,s){null==r&&(r=.5),null==a&&(a=Number.NEGATIVE_INFINITY),null==s&&(s=0);const o=e.shape[0];return n=Math.min(n,o),_.c(0<=r&&r<=1,(()=>`iouThreshold must be in [0, 1], but was '${r}'`)),_.c(2===e.rank,(()=>`boxes must be a 2D tensor, but was of rank '${e.rank}'`)),_.c(4===e.shape[1],(()=>`boxes must have 4 columns, but 2nd dimension was ${e.shape[1]}`)),_.c(1===t.rank,(()=>"scores must be a 1D tensor")),_.c(t.shape[0]===o,(()=>`scores has incompatible shape with boxes. Expected ${o}, but was ${t.shape[0]}`)),_.c(0<=s&&s<=1,(()=>`softNmsSigma must be in [0, 1], but was '${s}'`)),{maxOutputSize:n,iouThreshold:r,scoreThreshold:a,softNmsSigma:s}}const As=Object(H.b)({nonMaxSuppression_:function(e,t,n,r=.5,a=Number.NEGATIVE_INFINITY){const s=Object(W.a)(e,"boxes","nonMaxSuppression","float32"),o=Object(W.a)(t,"scores","nonMaxSuppression","float32"),i=Ns(s,o,n,r,a),u={maxOutputSize:n=i.maxOutputSize,iouThreshold:r=i.iouThreshold,scoreThreshold:a=i.scoreThreshold};return G.a.runKernel(q.ec,{boxes:s,scores:o},u)}});function Ms(e,t,n){const r=function(e,t,n){return function(e,t,n){let r=0,a=e.length,s=0,o=!1;for(;r<a;){s=r+(a-r>>>1);const i=n(t,e[s]);i>0?r=s+1:(a=s,o=!i)}return o?r:-r-1}(e,t,n||Is)}(e,t,n),a=r<0?-(r+1):r;e.splice(a,0,t)}function Is(e,t){return e>t?1:e<t?-1:0}function Ds(e,t,n,r,a){return Rs(e,t,n,r,a,0)}function $s(e,t,n,r,a,s){return Rs(e,t,n,r,a,0,!1,s,!0)}function Cs(e,t,n,r,a,s){return Rs(e,t,n,r,a,s,!0)}function Rs(e,t,n,r,a,s,o=!1,i=!1,u=!1){const c=[];for(let e=0;e<t.length;e++)t[e]>a&&c.push({score:t[e],boxIndex:e,suppressBeginIndex:0});c.sort(Bs);const l=s>0?-.5/s:0,d=[],p=[];for(;d.length<n&&c.length>0;){const t=c.pop(),{score:n,boxIndex:s,suppressBeginIndex:o}=t;if(n<a)break;let i=!1;for(let n=d.length-1;n>=o;--n){const o=Ps(e,s,d[n]);if(o>=r){i=!0;break}if(t.score=t.score*Fs(r,l,o),t.score<=a)break}t.suppressBeginIndex=d.length,i||(t.score===n?(d.push(s),p.push(t.score)):t.score>a&&Ms(c,t,Bs))}const f=d.length,h=n-f;i&&h>0&&(d.push(...new Array(h).fill(0)),p.push(...new Array(h).fill(0)));const m={selectedIndices:d};return o&&(m.selectedScores=p),u&&(m.validOutputs=f),m}function Ps(e,t,n){const r=e.subarray(4*t,4*t+4),a=e.subarray(4*n,4*n+4),s=Math.min(r[0],r[2]),o=Math.min(r[1],r[3]),i=Math.max(r[0],r[2]),u=Math.max(r[1],r[3]),c=Math.min(a[0],a[2]),l=Math.min(a[1],a[3]),d=Math.max(a[0],a[2]),p=Math.max(a[1],a[3]),f=(i-s)*(u-o),h=(d-c)*(p-l);if(f<=0||h<=0)return 0;const m=Math.max(s,c),b=Math.max(o,l),g=Math.min(i,d),y=Math.min(u,p),w=Math.max(g-m,0)*Math.max(y-b,0);return w/(f+h-w)}function Fs(e,t,n){const r=Math.exp(t*n*n);return n<=e?r:0}function Bs(e,t){return e.score-t.score||e.score===t.score&&t.boxIndex-e.boxIndex}const Ls=async function(e,t,n,r=.5,a=Number.NEGATIVE_INFINITY){const s=Object(W.a)(e,"boxes","nonMaxSuppressionAsync"),o=Object(W.a)(t,"scores","nonMaxSuppressionAsync"),i=Ns(s,o,n,r,a);n=i.maxOutputSize,r=i.iouThreshold,a=i.scoreThreshold;const u=await Promise.all([s.data(),o.data()]),c=u[0],l=u[1],{selectedIndices:d}=Ds(c,l,n,r,a);return s!==e&&s.dispose(),o!==t&&o.dispose(),Object(Ha.tensor1d)(d,"int32")};const zs=Object(H.b)({nonMaxSuppressionWithScore_:function(e,t,n,r=.5,a=Number.NEGATIVE_INFINITY,s=0){const o=Object(W.a)(e,"boxes","nonMaxSuppression"),i=Object(W.a)(t,"scores","nonMaxSuppression"),u=Ns(o,i,n,r,a,s),c={boxes:o,scores:i},l={maxOutputSize:n=u.maxOutputSize,iouThreshold:r=u.iouThreshold,scoreThreshold:a=u.scoreThreshold,softNmsSigma:s=u.softNmsSigma},d=G.a.runKernel(q.gc,c,l);return{selectedIndices:d[0],selectedScores:d[1]}}});const Ws=async function(e,t,n,r=.5,a=Number.NEGATIVE_INFINITY,s=0){const o=Object(W.a)(e,"boxes","nonMaxSuppressionAsync"),i=Object(W.a)(t,"scores","nonMaxSuppressionAsync"),u=Ns(o,i,n,r,a,s);n=u.maxOutputSize,r=u.iouThreshold,a=u.scoreThreshold,s=u.softNmsSigma;const c=await Promise.all([o.data(),i.data()]),l=c[0],d=c[1],{selectedIndices:p,selectedScores:f}=Cs(l,d,n,r,a,s);return o!==e&&o.dispose(),i!==t&&i.dispose(),{selectedIndices:Object(Ha.tensor1d)(p,"int32"),selectedScores:Object(Ha.tensor1d)(f)}};const Us=Object(H.b)({nonMaxSuppressionPadded_:function(e,t,n,r=.5,a=Number.NEGATIVE_INFINITY,s=!1){const o=Object(W.a)(e,"boxes","nonMaxSuppression"),i=Object(W.a)(t,"scores","nonMaxSuppression"),u=Ns(o,i,n,r,a,null),c={boxes:o,scores:i},l={maxOutputSize:u.maxOutputSize,iouThreshold:u.iouThreshold,scoreThreshold:u.scoreThreshold,padToMaxOutputSize:s},d=G.a.runKernel(q.fc,c,l);return{selectedIndices:d[0],validOutputs:d[1]}}});const Vs=async function(e,t,n,r=.5,a=Number.NEGATIVE_INFINITY,s=!1){const o=Object(W.a)(e,"boxes","nonMaxSuppressionAsync"),i=Object(W.a)(t,"scores","nonMaxSuppressionAsync"),u=Ns(o,i,n,r,a,null),c=u.maxOutputSize,l=u.iouThreshold,d=u.scoreThreshold,[p,f]=await Promise.all([o.data(),i.data()]),{selectedIndices:h,validOutputs:m}=$s(p,f,c,l,d,s);return o!==e&&o.dispose(),i!==t&&i.dispose(),{selectedIndices:Object(Ha.tensor1d)(h,"int32"),validOutputs:ct(m,"int32")}};const Gs=Object(H.b)({resizeBilinear_:function(e,t,n=!1,r=!1){const a=Object(W.a)(e,"images","resizeBilinear");_.c(3===a.rank||4===a.rank,(()=>`Error in resizeBilinear: x must be rank 3 or 4, but got rank ${a.rank}.`)),_.c(2===t.length,(()=>`Error in resizeBilinear: new shape must 2D, but got shape ${t}.`)),_.c(!1===r||!1===n,(()=>"Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false."));let s=a,o=!1;3===a.rank&&(o=!0,s=Object(Bt.reshape)(a,[1,a.shape[0],a.shape[1],a.shape[2]]));const[]=t,i={images:s},u={alignCorners:n,halfPixelCenters:r,size:t},c=G.a.runKernel(q.Ac,i,u);return o?Object(Bt.reshape)(c,[c.shape[1],c.shape[2],c.shape[3]]):c}});const qs=Object(H.b)({resizeNearestNeighbor_:function(e,t,n=!1,r=!1){const a=Object(W.a)(e,"images","resizeNearestNeighbor");_.c(3===a.rank||4===a.rank,(()=>`Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank ${a.rank}.`)),_.c(2===t.length,(()=>`Error in resizeNearestNeighbor: new shape must 2D, but got shape ${t}.`)),_.c("float32"===a.dtype||"int32"===a.dtype,(()=>"`images` must have `int32` or `float32` as dtype")),_.c(!1===r||!1===n,(()=>"Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false."));let s=a,o=!1;3===a.rank&&(o=!0,s=Object(Bt.reshape)(a,[1,a.shape[0],a.shape[1],a.shape[2]]));const[]=t,i={images:s},u={alignCorners:n,halfPixelCenters:r,size:t},c=G.a.runKernel(q.Cc,i,u);return o?Object(Bt.reshape)(c,[c.shape[1],c.shape[2],c.shape[3]]):c}});const Hs=Object(H.b)({threshold_:function(e,t="binary",n=!1,r=.5){const a=Object(W.a)(e,"image","threshold"),s=a.shape[0]*a.shape[1];let o,i,u,c,l=Object(at.mul)(Object(Ha.tensor1d)([r]),255);if(_.c(3===a.rank,(()=>`Error in threshold: image must be rank 3,but got rank ${a.rank}.`)),_.c(3===a.shape[2]||1===a.shape[2],(()=>`Error in threshold: image color channel must be equal to 3 or 1but got ${a.shape[2]}.`)),_.c("int32"===a.dtype||"float32"===a.dtype,(()=>`Error in dtype: image dtype must be int32 or float32,but got dtype ${a.dtype}.`)),_.c("otsu"===t||"binary"===t,(()=>`Method must be binary or otsu, but was ${t}`)),3===a.shape[2]){[o,i,u]=Fa(a,[1,1,1],-1);const e=Object(at.mul)(o,.2989),t=Object(at.mul)(i,.587),n=Object(at.mul)(u,.114);c=Object(tt.add)(Object(tt.add)(e,t),n)}else c=e;if("otsu"===t){l=function(e,t){let n,r,a,s,o,i,u=Object(Ha.tensor1d)([-1]),c=Object(Ha.tensor1d)([0]),l=Object(Ha.tensor1d)([0]);for(let d=0;d<e.size-1;d++){n=Ut(e,0,d+1),r=Ut(e,d+1),o=rt(Object(Gn.a)(n),t),i=rt(Object(Gn.a)(r),t);const p=Object(Gn.a)(Object(at.mul)(n,pa(0,n.size)));a=rt(p,Object(Gn.a)(n));const f=pt(r.shape,n.size),h=Object(tt.add)(pa(0,r.size),f),m=Object(at.mul)(r,h);s=rt(Object(Gn.a)(m),Object(Gn.a)(r));const b=mt(a,s),g=mt(a,s),y=Object(at.mul)(o,i);l=Object(at.mul)(Object(at.mul)(y,b),g);const w=nr(l,c);c=Tn(w,l,c),u=Tn(w,Object(Ha.tensor1d)([d]),u)}return u}(Xt(Object(U.a)(ja(c),"int32"),Object(qa.a)([]),256),s)}const d=n?lr(c,l):nr(c,l);return Object(U.a)(Object(at.mul)(d,255),"int32")}});const Ks=Object(H.b)({transform_:function(e,t,n="nearest",r="constant",a=0,s){const o=Object(W.a)(e,"image","transform","float32"),i=Object(W.a)(t,"transforms","transform","float32");_.c(4===o.rank,(()=>`Error in transform: image must be rank 4,but got rank ${o.rank}.`)),_.c(2===i.rank&&(i.shape[0]===o.shape[0]||1===i.shape[0])&&8===i.shape[1],(()=>"Error in transform: Input transform should be batch x 8 or 1 x 8")),_.c(null==s||2===s.length,(()=>`Error in transform: outputShape must be [height, width] or null, but got ${s}.`));const u={image:o,transforms:i},c={interpolation:n,fillMode:r,fillValue:a,outputShape:s};return G.a.runKernel(q.qd,u,c)}});const Ys=Object(H.b)({bandPart_:function(e,t,n){const r=Object(W.a)(e,"a","bandPart");Object(_.c)(r.rank>=2,(()=>`bandPart(): Rank must be at least 2, got ${r.rank}.`));const a=r.shape,[s,o]=r.shape.slice(-2);let i,u;"number"==typeof t?(Object(_.c)(t%1==0,(()=>`bandPart(): numLower must be an integer, got ${t}.`)),Object(_.c)(t<=s,(()=>`bandPart(): numLower (${t}) must not be greater than the number of rows (${s}).`)),i=Object(W.a)(t<0?s:t,"numLower","bandPart")):(Object(_.c)("int32"===t.dtype,(()=>"bandPart(): numLower's dtype must be an int32.")),i=Tn(cr(t,0),s,Object($r.minimum)(t,s))),"number"==typeof n?(Object(_.c)(n%1==0,(()=>`bandPart(): numUpper must be an integer, got ${n}.`)),Object(_.c)(n<=o,(()=>`bandPart(): numUpper (${n}) must not be greater than the number of columns (${o}).`)),u=Object(W.a)(n<0?o:n,"numUpper","bandPart")):(Object(_.c)("int32"===n.dtype,(()=>"bandPart(): numUpper's dtype must be an int32.")),u=Tn(cr(n,0),o,Object($r.minimum)(n,o)));const c=Object(Bt.reshape)(pa(0,s,1,"int32"),[-1,1]),l=pa(0,o,1,"int32"),d=mt(c,l),p=Or(lr(d,i),rr(d,Object(mr.a)(u))),f=Mr([s,o],r.dtype);return Object(Bt.reshape)(Object(Wa.stack)(rs(Object(Bt.reshape)(r,[-1,s,o])).map((e=>Tn(p,e,f)))),a)}});const Js=Object(H.b)({gramSchmidt_:function(e){let t;if(Array.isArray(e)){t=!1,Object(_.c)(null!=e&&e.length>0,(()=>"Gram-Schmidt process: input must not be null, undefined, or empty"));const n=e[0].shape[0];for(let t=1;t<e.length;++t)Object(_.c)(e[t].shape[0]===n,(()=>`Gram-Schmidt: Non-unique lengths found in the input vectors: (${e[t].shape[0]} vs. ${n})`))}else t=!0,e=Fa(e,e.shape[0],0).map((e=>Object(za.squeeze)(e,[0])));Object(_.c)(e.length<=e[0].shape[0],(()=>`Gram-Schmidt: Number of vectors (${e.length}) exceeds number of dimensions (${e[0].shape[0]}).`));const n=[],r=e;for(let t=0;t<e.length;++t)n.push(G.a.tidy((()=>{let e=r[t];if(t>0)for(let r=0;r<t;++r){const t=Object(at.mul)(Object(Gn.a)(Object(at.mul)(n[r],e)),n[r]);e=mt(e,t)}return rt(e,Hn(e,"euclidean"))})));return t?Object(Wa.stack)(n,0):n}});function Xs(e,t=!1){return G.a.tidy((()=>{Object(_.c)(2===e.shape.length,(()=>`qr2d() requires a 2D Tensor, but got a ${e.shape.length}D Tensor.`));const n=e.shape[0],r=e.shape[1];let a=Zn(n),s=Object(en.a)(e);const o=Ka([[1]],[1,1]);let i=Object(en.a)(o);const u=n>=r?r:n;for(let e=0;e<u;++e){const t=s,u=i,c=a;[i,s,a]=G.a.tidy((()=>{const t=Ut(s,[e,e],[n-e,1]),u=Hn(t),c=Ut(s,[e,e],[1,1]),l=Tn(nr(c,0),Ka([[-1]]),Ka([[1]])),d=mt(c,Object(at.mul)(l,u)),p=rt(t,d);i=1===p.shape[0]?Object(en.a)(o):Object(zt.concat)([o,Ut(p,[1,0],[p.shape[0]-1,p.shape[1]])],0);const f=Object(mr.a)(rt(Object(V.a)(l,d),u)),h=Ut(s,[e,0],[n-e,r]),m=Object(at.mul)(f,i),b=Object(Y.transpose)(i);if(0===e)s=mt(h,Object(V.a)(m,Object(V.a)(b,h)));else{const t=mt(h,Object(V.a)(m,Object(V.a)(b,h)));s=Object(zt.concat)([Ut(s,[0,0],[e,r]),t],0)}const g=Object(Y.transpose)(m),y=Ut(a,[0,e],[n,a.shape[1]-e]);if(0===e)a=mt(y,Object(V.a)(Object(V.a)(y,i),g));else{const t=mt(y,Object(V.a)(Object(V.a)(y,i),g));a=Object(zt.concat)([Ut(a,[0,0],[n,e]),t],1)}return[i,s,a]})),Object(et.d)([t,u,c])}return!t&&n>r&&(a=Ut(a,[0,0],[n,r]),s=Ut(s,[0,0],[r,r])),[a,s]}))}const Qs=Object(H.b)({qr_:function(e,t=!1){if(Object(_.c)(e.rank>=2,(()=>`qr() requires input tensor to have a rank >= 2, but got rank ${e.rank}`)),2===e.rank)return Xs(e,t);{const n=e.shape.slice(0,e.shape.length-2).reduce(((e,t)=>e*t)),r=rs(Object(Bt.reshape)(e,[n,e.shape[e.shape.length-2],e.shape[e.shape.length-1]]),0),a=[],s=[];r.forEach((e=>{const[n,r]=Xs(e,t);a.push(n),s.push(r)}));return[Object(Bt.reshape)(Object(Wa.stack)(a,0),e.shape),Object(Bt.reshape)(Object(Wa.stack)(s,0),e.shape)]}}});var Zs;!function(e){e[e.NONE=0]="NONE",e[e.MEAN=1]="MEAN",e[e.SUM=2]="SUM",e[e.SUM_BY_NONZERO_WEIGHTS=3]="SUM_BY_NONZERO_WEIGHTS"}(Zs||(Zs={}));const eo=Object(H.b)({computeWeightedLoss_:function(e,t,n=Zs.SUM_BY_NONZERO_WEIGHTS){const r=Object(W.a)(e,"losses","computeWeightedLoss");let a=null;null!=t&&(a=Object(W.a)(t,"weights","computeWeightedLoss"));const s=null==a?r:Object(at.mul)(r,a);if(n===Zs.NONE)return s;if(n===Zs.SUM)return Object(Gn.a)(s);if(n===Zs.MEAN){if(null==a)return Object(Ar.mean)(s);{const e=r.size/a.size,t=rt(Object(Gn.a)(s),Object(Gn.a)(a));return e>1?rt(t,ct(e)):t}}if(n===Zs.SUM_BY_NONZERO_WEIGHTS){if(null==a)return rt(Object(Gn.a)(s),ct(r.size));{const e=Object(at.mul)(a,Ir(r.shape)),t=Object(U.a)(Object(Gn.a)(Lr(e,ct(0))),"float32");return rt(Object(Gn.a)(s),t)}}throw Error(`Unknown reduction: ${n}`)}});const to=Object(H.b)({absoluteDifference_:function(e,t,n,r=Zs.SUM_BY_NONZERO_WEIGHTS){const a=Object(W.a)(e,"labels","absoluteDifference"),s=Object(W.a)(t,"predictions","absoluteDifference");let o=null;null!=n&&(o=Object(W.a)(n,"weights","absoluteDifference")),Object(_.f)(a.shape,s.shape,"Error in absoluteDifference: ");const i=gt(mt(a,s));return eo(i,o,r)}});const no=Object(H.b)({cosineDistance_:function(e,t,n,r,a=Zs.SUM_BY_NONZERO_WEIGHTS){const s=Object(W.a)(e,"labels","cosineDistance"),o=Object(W.a)(t,"predictions","cosineDistance");let i=null;null!=r&&(i=Object(W.a)(r,"weights","cosineDistance")),Object(_.f)(s.shape,o.shape,"Error in cosineDistance: ");const u=ct(1),c=mt(u,Object(Gn.a)(Object(at.mul)(s,o),n,!0));return eo(c,i,a)}});const ro=Object(H.b)({hingeLoss_:function(e,t,n,r=Zs.SUM_BY_NONZERO_WEIGHTS){let a=Object(W.a)(e,"labels","hingeLoss");const s=Object(W.a)(t,"predictions","hingeLoss");let o=null;null!=n&&(o=Object(W.a)(n,"weights","hingeLoss")),Object(_.f)(a.shape,s.shape,"Error in hingeLoss: ");const i=ct(1);a=mt(Object(at.mul)(ct(2),a),i);const u=Object(ma.relu)(mt(i,Object(at.mul)(a,s)));return eo(u,o,r)}});const ao=Object(H.b)({huberLoss_:function(e,t,n,r=1,a=Zs.SUM_BY_NONZERO_WEIGHTS){const s=Object(W.a)(e,"labels","huberLoss"),o=Object(W.a)(t,"predictions","huberLoss");let i=null;null!=n&&(i=Object(W.a)(n,"weights","huberLoss")),Object(_.f)(s.shape,o.shape,"Error in huberLoss: ");const u=ct(r),c=gt(mt(o,s)),l=Object($r.minimum)(c,u),d=mt(c,l),p=Object(tt.add)(Object(at.mul)(ct(.5),ot(l)),Object(at.mul)(u,d));return eo(p,i,a)}});const so=Object(H.b)({logLoss_:function(e,t,n,r=1e-7,a=Zs.SUM_BY_NONZERO_WEIGHTS){const s=Object(W.a)(e,"labels","logLoss"),o=Object(W.a)(t,"predictions","logLoss");let i=null;null!=n&&(i=Object(W.a)(n,"weights","logLoss")),Object(_.f)(s.shape,o.shape,"Error in logLoss: ");const u=ct(1),c=ct(r),l=Object(mr.a)(Object(at.mul)(s,fr(Object(tt.add)(o,c)))),d=Object(at.mul)(mt(u,s),fr(Object(tt.add)(mt(u,o),c))),p=mt(l,d);return eo(p,i,a)}});const oo=Object(H.b)({meanSquaredError_:function(e,t,n,r=Zs.SUM_BY_NONZERO_WEIGHTS){const a=Object(W.a)(e,"labels","meanSquaredError"),s=Object(W.a)(t,"predictions","meanSquaredError");let o=null;null!=n&&(o=Object(W.a)(n,"weights","meanSquaredError")),Object(_.f)(a.shape,s.shape,"Error in meanSquaredError: ");const i=La(a,s);return eo(i,o,r)}});const io=Object(H.b)({sigmoidCrossEntropy_:function(e,t,n,r=0,a=Zs.SUM_BY_NONZERO_WEIGHTS){let s=Object(W.a)(e,"multiClassLabels","sigmoidCrossEntropy");const o=Object(W.a)(t,"logits","sigmoidCrossEntropy");let i=null;if(null!=n&&(i=Object(W.a)(n,"weights","sigmoidCrossEntropy")),Object(_.f)(s.shape,o.shape,"Error in sigmoidCrossEntropy: "),r>0){const e=ct(r),t=ct(1),n=ct(.5);s=Object(tt.add)(Object(at.mul)(s,mt(t,e)),Object(at.mul)(n,e))}const u=function(e,t){const n=Object(W.a)(e,"labels","sigmoidCrossEntropyWithLogits"),r=Object(W.a)(t,"logits","sigmoidCrossEntropyWithLogits");Object(_.f)(n.shape,r.shape,"Error in sigmoidCrossEntropyWithLogits: ");const a=Object(ma.relu)(r),s=Object(at.mul)(r,n),o=hr(Yn(Object(mr.a)(gt(r))));return Object(tt.add)(mt(a,s),o)}(s,o);return eo(u,i,a)}});const uo=Object(H.b)({softmaxCrossEntropy_:function(e,t,n,r=0,a=Zs.SUM_BY_NONZERO_WEIGHTS){let s=Object(W.a)(e,"onehotLabels","softmaxCrossEntropy");const o=Object(W.a)(t,"logits","softmaxCrossEntropy");let i=null;if(null!=n&&(i=Object(W.a)(n,"weights","softmaxCrossEntropy")),Object(_.f)(s.shape,o.shape,"Error in softmaxCrossEntropy: "),r>0){const e=ct(r),t=ct(1),n=ct(s.shape[1]);s=Object(tt.add)(Object(at.mul)(s,mt(t,e)),rt(e,n))}const u=function(e,t,n=-1){if(-1===n&&(n=t.rank-1),n!==t.rank-1)throw Error(`Softmax cross entropy along a non-last dimension is not yet supported. Labels / logits was rank ${t.rank} and dim was ${n}`);const r=Object(ut.a)(((e,t,r)=>{const a=wr(t,[n],!0),s=mt(Object(U.a)(t,"float32"),a);r([e,s]);const o=Object(mr.a)(Object(at.mul)(s,e));return{value:Object(Gn.a)(o,[n]),gradFunc:(e,t)=>{const[r,a]=t,s=Fn(e.shape,[n]);return[Object(at.mul)(Object(Bt.reshape)(e,s),mt(Object(U.a)(r,"float32"),Yn(a))),Object(at.mul)(Object(Bt.reshape)(e,s),mt(Yn(a),Object(U.a)(r,"float32")))]}}}));return r(e,t)}(s,o);return eo(u,i,a)}});const co={fft:Ca,ifft:Ra,rfft:Ba,irfft:Pa},lo={hammingWindow:Os,hannWindow:vs,frame:js,stft:_s},po={flipLeftRight:ks,grayscaleToRGB:xs,resizeNearestNeighbor:qs,resizeBilinear:Gs,rgbToGrayscale:Es,rotateWithOffset:Ts,cropAndResize:Ss,nonMaxSuppression:As,nonMaxSuppressionAsync:Ls,nonMaxSuppressionWithScore:zs,nonMaxSuppressionWithScoreAsync:Ws,nonMaxSuppressionPadded:Us,nonMaxSuppressionPaddedAsync:Vs,threshold:Hs,transform:Ks},fo={bandPart:Ys,gramSchmidt:Js,qr:Qs},ho={absoluteDifference:to,computeWeightedLoss:eo,cosineDistance:no,hingeLoss:ro,huberLoss:ao,logLoss:so,meanSquaredError:oo,sigmoidCrossEntropy:io,softmaxCrossEntropy:uo},mo={sparseFillEmptyRows:Object(H.b)({sparseFillEmptyRows_:function(e,t,n,r){const a=Object(W.a)(e,"indices","sparseFillEmptyRows","int32"),s=Object(W.a)(t,"values","sparseFillEmptyRows"),o=Object(W.a)(n,"denseShape","sparseFillEmptyRows","int32"),i=Object(W.a)(r,"defaultValue","sparseFillEmptyRows",s.dtype);if(2!==a.rank)throw new Error(`Indices should be Tensor2D but received shape\n ${a.shape}`);if(1!==s.rank)throw new Error(`Values should be Tensor1D but received shape ${s.shape}`);if(1!==o.rank)throw new Error(`Dense shape should be Tensor1D but received shape ${o.shape}`);if(0!==i.rank)throw new Error(`Default value should be a scalar but received shape ${i.shape}`);const u={indices:a,values:s,denseShape:o,defaultValue:i},c=G.a.runKernel(q.Uc,u);return{outputIndices:c[0],outputValues:c[1],emptyRowIndicator:c[2],reverseIndexMap:c[3]}}}),sparseReshape:Object(H.b)({sparseReshape_:function(e,t,n){const r=Object(W.a)(e,"inputIndices","sparseReshape","int32"),a=Object(W.a)(t,"inputShape","sparseReshape","int32"),s=Object(W.a)(n,"newShape","sparseReshape","int32");if(2!==r.rank)throw new Error(`Input indices should be Tensor2D but received shape\n ${r.shape}`);if(1!==a.rank)throw new Error(`Input shape should be Tensor1D but received shape ${a.shape}`);if(1!==s.rank)throw new Error(`New shape should be Tensor1D but received shape ${s.shape}`);const o={inputIndices:r,inputShape:a,newShape:s},i=G.a.runKernel(q.Vc,o);return{outputIndices:i[0],outputShape:i[1]}}}),sparseSegmentMean:Object(H.b)({sparseSegmentMean_:function(e,t,n){const r=Object(W.a)(e,"data","sparseSegmentMean"),a=Object(W.a)(t,"indices","sparseSegmentMean","int32"),s=Object(W.a)(n,"segmentIds","sparseSegmentMean","int32");if(r.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==a.rank)throw new Error(`Indices should be Tensor1D but received shape\n ${a.shape}`);if(1!==s.rank)throw new Error(`Segment ids should be Tensor1D but received shape\n ${s.shape}`);const o={data:r,indices:a,segmentIds:s};return G.a.runKernel(q.Wc,o)}}),sparseSegmentSum:Object(H.b)({sparseSegmentSum_:function(e,t,n){const r=Object(W.a)(e,"data","sparseSegmentSum"),a=Object(W.a)(t,"indices","sparseSegmentSum","int32"),s=Object(W.a)(n,"segmentIds","sparseSegmentSum","int32");if(r.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==a.rank)throw new Error(`Indices should be Tensor1D but received shape\n ${a.shape}`);if(1!==s.rank)throw new Error(`Segment ids should be Tensor1D but received shape\n ${s.shape}`);const o={data:r,indices:a,segmentIds:s};return G.a.runKernel(q.Xc,o)}})},bo={stringNGrams:Object(H.b)({stringNGrams_:function(e,t,n,r,a,s,o,i){const u=Object(W.a)(e,"data","stringNGrams","string");if("string"!==u.dtype)throw new Error("Data must be of datatype string");if(1!==u.shape.length)throw new Error(`Data must be a vector, saw: ${u.shape}`);const c=Object(W.a)(t,"dataSplits","stringNGrams");if("int32"!==c.dtype)throw new Error("Data splits must be of datatype int32");const l={separator:n,nGramWidths:r,leftPad:a,rightPad:s,padWidth:o,preserveShortSequences:i},d={data:u,dataSplits:c},p=G.a.runKernel(q.gd,d,l);return{nGrams:p[0],nGramsSplits:p[1]}}}),stringSplit:Object(H.b)({stringSplit_:function(e,t,n=!0){const r=Object(W.a)(e,"input","stringSplit","string"),a=Object(W.a)(t,"delimiter","stringSplit","string");if(1!==r.rank)throw new Error(`Input should be Tensor1D but received shape ${r.shape}`);if(0!==a.rank)throw new Error(`Delimiter should be a scalar but received shape ${a.shape}`);const s={skipEmpty:n},o={input:r,delimiter:a},i=G.a.runKernel(q.hd,o,s);return{indices:i[0],values:i[1],shape:i[2]}}}),stringToHashBucketFast:Object(H.b)({stringToHashBucketFast_:function(e,t){const n=Object(W.a)(e,"input","stringToHashBucketFast","string"),r={numBuckets:t};if(t<=0)throw new Error("Number of buckets must be at least 1");const a={input:n};return G.a.runKernel(q.id,a,r)}}),staticRegexReplace:Object(H.b)({staticRegexReplace_:function(e,t,n,r=!0){const a=Object(W.a)(e,"input","staticRegexReplace","string"),s={pattern:t,rewrite:n,replaceGlobal:r};return G.a.runKernel(q.dd,{x:a},s)}})},go=_t;var yo=n(97);function wo(e,t){const n=e[0].length;e.forEach(((e,t)=>{_.c(e.length===n,(()=>`Error in concat${n}D: rank of tensors[${t}] must be the same as the rank of the rest (${n})`))})),_.c(t>=0&&t<n,(()=>`Error in concat${n}D: axis must be between 0 and ${n-1}.`));const r=e[0];e.forEach(((e,a)=>{for(let s=0;s<n;s++)_.c(s===t||e[s]===r[s],(()=>`Error in concat${n}D: Shape of tensors[${a}] (${e}) does not match the shape of the rest (${r}) along the non-concatenated axis ${a}.`))}))}function Oo(e,t){const n=e[0].slice();for(let r=1;r<e.length;r++)n[t]+=e[r][t];return n}var vo,jo=n(26);function _o(e,t,n){let r=new Array;if(null==n&&null==t)return r;if(null==t)for(;r.length<e+n.length;)r.push(-1);else r=t.slice();if(null==n)return r;if(e+n.length!==r.length)throw new Error(`rt input.shape and shape=${t} are incompatible: rt input.rank = ${e+n.length}, but shape.rank = ${r.length}`);for(let a=1;a<n.length;++a){const s=n[a],o=r[r.length-n.length+a],i=r[o];if(s>=0)if(i>=0){if(i!==s)throw new Error(`rt input.shape and shape=${t} are incompatible: rt input.shape[${a+e}] = ${s} but shape[${a+e}] = ${i}`)}else r[o]=s}return r}function So(e){const t={FIRST_DIM_SIZE:vo.FIRST_DIM_SIZE,VALUE_ROWIDS:vo.VALUE_ROWIDS,ROW_LENGTHS:vo.ROW_LENGTHS,ROW_SPLITS:vo.ROW_SPLITS,ROW_LIMITS:vo.ROW_LIMITS,ROW_STARTS:vo.ROW_STARTS},n=[];for(const r of e){if(!(r in t))break;n.push(t[r])}return n}function ko(e){return 0===e.length?0:e[0]===vo.FIRST_DIM_SIZE?e.length-1:e.length}function xo(e,t){if(null==e||null==t)return;const n=e.length,r=t.length;if(n>=r)throw new Error(`defaultValue.shape=${e} and ragged tensor flatValues.shape=${t}, are incompatible: defaultValue.rank = ${n} must be less than ragged tensor input flatValues.rank = ${r})`);for(let a=0;a<Math.min(n,r-1);++a){const n=e[a],r=t[a+1];if(n>=0&&r>=0&&1!==n&&n!==r)throw new Error(`defaultValue.shape=${e}, and ragged tensor input flatValues.shape=${t} are incompatible: defaultValue.shape[${a-e.length}] = ${n} but ragged tensor input.flatValues.shape[${a-e.length}] = ${r}`)}}!function(e){e[e.FIRST_DIM_SIZE=0]="FIRST_DIM_SIZE",e[e.VALUE_ROWIDS=1]="VALUE_ROWIDS",e[e.ROW_LENGTHS=2]="ROW_LENGTHS",e[e.ROW_SPLITS=3]="ROW_SPLITS",e[e.ROW_LIMITS=4]="ROW_LIMITS",e[e.ROW_STARTS=5]="ROW_STARTS"}(vo||(vo={}));const Eo=30;function To(e){return e<=Eo?e:Object(_.G)(e,Math.floor(Math.sqrt(e)))}function No(e,t,n){return[n*("number"==typeof e?e:e[0]),t*("number"==typeof e?e:e[1])]}function Ao(e,t,n,r=!0){let a=[];if(r)a=a.concat(t.slice(0)),a.push(e[0]/n),a=a.concat(e.slice(1));else{a=a.concat(e[0]);const n=t.length;for(let r=0;r<n;++r)a=a.concat([e[r+1]/t[r],t[r]]);a=a.concat(e.slice(n+1))}return a}function Mo(e,t,n=!0){const r=[];if(n){r.push(t);for(let n=t+1;n<e;++n)n<=2*t?(r.push(n),r.push(n-(t+1))):r.push(n)}else{const n=[],a=[];for(let r=1;r<e;++r)r>=2*t+1||r%2==1?a.push(r):n.push(r);r.push(...n),r.push(0),r.push(...a)}return r}function Io(e,t,n,r=!0){const a=[];r?a.push(e[0]/n):a.push(e[0]*n);for(let n=1;n<e.length;++n)n<=t.length?r?a.push(t[n-1]*e[n]):a.push(e[n]/t[n-1]):a.push(e[n]);return a}function Do(e,t){const n=[0];for(let r=0;r<t;++r)n.push(e[r][0]);return n}function $o(e,t,n){const r=e.slice(0,1);for(let a=0;a<n;++a)r.push(e[a+1]-t[a][0]-t[a][1]);return r}const Co=1.7580993408473768,Ro=1.0507009873554805,Po=.3275911,Fo=.254829592,Bo=-.284496736,Lo=1.421413741,zo=-1.453152027,Wo=1.061405429;var Uo=n(41);function Vo(e,t){if(e.length!==t.length)throw new Error(`Cannot merge real and imag arrays of different lengths. real:${e.length}, imag: ${t.length}.`);const n=new Float32Array(2*e.length);for(let r=0;r<n.length;r+=2)n[r]=e[r/2],n[r+1]=t[r/2];return n}function Go(e){const t=new Float32Array(e.length/2),n=new Float32Array(e.length/2);for(let r=0;r<e.length;r+=2)t[r/2]=e[r],n[r/2]=e[r+1];return{real:t,imag:n}}function qo(e){const t=Math.ceil(e.length/4),n=new Float32Array(t),r=new Float32Array(t);for(let t=0;t<e.length;t+=4)n[Math.floor(t/4)]=e[t],r[Math.floor(t/4)]=e[t+1];return{real:n,imag:r}}function Ho(e){const t=Math.floor(e.length/4),n=new Float32Array(t),r=new Float32Array(t);for(let t=2;t<e.length;t+=4)n[Math.floor(t/4)]=e[t],r[Math.floor(t/4)]=e[t+1];return{real:n,imag:r}}function Ko(e,t){return{real:e[2*t],imag:e[2*t+1]}}function Yo(e,t,n,r){e[2*r]=t,e[2*r+1]=n}function Jo(e,t){const n=new Float32Array(e/2),r=new Float32Array(e/2);for(let a=0;a<Math.ceil(e/2);a++){const s=(t?2:-2)*Math.PI*(a/e);n[a]=Math.cos(s),r[a]=Math.sin(s)}return{real:n,imag:r}}function Xo(e,t,n){const r=(n?2:-2)*Math.PI*(e/t);return{real:Math.cos(r),imag:Math.sin(r)}}const Qo="->",Zo=/->/g;function ei(e,t){const n=((e=e.replace(/\s/g,"")).length-e.replace(Zo,"").length)/Qo.length;if(n<1)throw new Error("Equations without an arrow are not supported.");if(n>1)throw new Error('Equation must contain exactly one arrow ("->").');const[r,a]=e.split(Qo);Object(_.c)(-1===r.indexOf("..."),(()=>'The ellipsis notation ("...") is not supported yet.'));const s=r.split(","),o=s.length;if(t!==o)throw new Error(`Expected ${o} input tensors, received ${t}`);if(o>2)throw new Error("Support for more than 2 input tensors is not implemented yet.");const i=[];for(let e=0;e<a.length;++e){const t=a[e];if(!s.some((e=>-1!==e.indexOf(t))))throw new Error(`Output subscripts contain the label ${t} not present in the input subscripts.`);-1===i.indexOf(t)&&i.push(t)}for(let e=0;e<r.length;++e){const t=r[e];-1===i.indexOf(t)&&","!==t&&i.push(t)}const u=new Array(s.length);for(let e=0;e<o;++e){if(new Set(s[e].split("")).size!==s[e].length)throw new Error(`Found duplicate axes in input component ${s[e]}. Support for duplicate axes in input is not implemented yet.`);u[e]=[];for(let t=0;t<s[e].length;++t)u[e].push(i.indexOf(s[e][t]))}const c=i.length,l=[];for(let e=a.length;e<c;++e)l.push(e);return{allDims:i,summedDims:l,idDims:u}}function ti(e,t){let n=new Array(e);n.fill(-1);for(let e=0;e<t.length;++e)n[t[e]]=e;const r=[];for(let t=0;t<e;++t)-1===n[t]&&r.push(t);return n=n.filter((e=>-1!==e)),{permutationIndices:n,expandDims:r}}function ni(e,t,n){const r=new Array(e);for(let e=0;e<n.length;++e){const a=n[e].shape;for(let n=0;n<t[e].length;++n)void 0===r[t[e][n]]?r[t[e][n]]=a[n]:Object(_.c)(r[t[e][n]]===a[n],(()=>`Expected dimension ${r[t[e][n]]} at axis ${n} of input shaped ${JSON.stringify(a)}, but got dimension ${a[n]}`))}}function ri(e,t){const n=e,r=[];let a=0;0===e.length&&n.push(-1),a=e.length+1;for(let e=0;e<a;++e)r.push([]);const s=[];for(let e=0;e<n.length;++e){const a=si(t,n[e]);for(const t of a)-1===s.indexOf(t)&&(r[e].push(t),s.push(t))}return{path:n,steps:r}}function ai(e){return e.every(((e,t)=>e===t))}function si(e,t){const n=[];for(let r=0;r<e.length;++r)0!==e[r].length&&-1===e[r].indexOf(t)&&-1!==t||n.push(r);return n}function oi(e,t,n=0){let r=[];if("number"==typeof t)Object(_.c)(e.shape[n]%t==0,(()=>"Number of splits must evenly divide the axis.")),r=new Array(t).fill(e.shape[n]/t);else{const a=t.reduce(((e,t)=>(-1===t&&(e+=1),e)),0);Object(_.c)(a<=1,(()=>"There should be only one negative value in split array."));const s=t.indexOf(-1);if(-1!==s){const r=t.reduce(((e,t)=>t>0?e+t:e));t[s]=e.shape[n]-r}Object(_.c)(e.shape[n]===t.reduce(((e,t)=>e+t)),(()=>"The sum of sizes must match the size of the axis dimension.")),r=t}return r}function ii(e){return`Received SparseTensor with denseShape[0] = 0 but\n indices.shape[0] = ${e}`}function ui(e,t){return`indices(${e}, 0) is invalid: ${t} < 0`}function ci(e,t,n){return`indices(${e}, 0) is invalid: ${t} >= ${n}`}function li(e,t){return`only one output dimension may be -1, not both ${e} and ${t}`}function di(e,t){return`size ${e} must be non-negative, not ${t}`}function pi(){return"reshape cannot infer the missing input size for an empty tensor unless all specified input sizes are non-zero"}function fi(e,t){return`Input to reshape is a SparseTensor with ${Object(_.O)(e)}\n dense values, but the requested shape requires a multiple of ${Object(_.O)(t)}. inputShape=${e} outputShape= ${t}`}function hi(e,t){return`Input to reshape is a tensor with ${Object(_.O)(e)} dense values, but the requested shape has ${Object(_.O)(t)}. inputShape=${e} outputShape=${t}`}function mi(){return"segment ids must be >= 0"}function bi(){return"segment ids are not increasing"}function gi(e,t){return`Segment id ${e} out of range [0, ${t}), possibly because segmentIds input is not sorted.`}function yi(e,t,n){return`Bad: indices[${e}] == ${t} out of range [0, ${n})`}function wi(e,t){let n,r=!1;for(e<=Eo?(n=e,r=!0):n=Object(_.G)(e,Math.floor(Math.sqrt(e)));!r;)n>t||n===e?r=!0:n=Object(_.G)(e,n+1);return n}function Oi(e,t,n){const r=[],a=e.length;for(let s=0;s<a;s++)s!==t?r.push(e[s]):r.push(n);return r}function vi(e,t,n,r){const a=t.shape.length,s=e.shape.length;if(0!==r&&(r<-a||r>a))throw new Error(`Expect batchDims in the range of [-${a}, ${a}], but got ${r}`);if(r<0&&(r+=a),r>s)throw new Error(`batchDims (${r}) must be less than rank(x) (\n ${s}).`);if(n<r)throw new Error(`batchDims (${r}) must be less than or equal to axis (${n}).`);for(let n=0;n<r;++n)if(e.shape[n]!==t.shape[n])throw new Error(`x.shape[${n}]: ${e.shape[n]} should be equal to indices.shape[${n}]: ${t.shape[n]}.`);const o=e.shape[n],i=[];let u=1,c=1,l=1;for(let t=0;t<r;++t)i.push(e.shape[t]),u*=e.shape[t];for(let t=r;t<n;t++)i.push(e.shape[t]),c*=e.shape[t];for(let e=r;e<a;e++)i.push(t.shape[e]);for(let t=n+1;t<s;t++)i.push(e.shape[t]),l*=e.shape[t];return{batchSize:u,sliceSize:l,outerSize:c,dimSize:o,outputShape:i}}function ji(e){try{return e.map((e=>Object(Be.decodeString)(e)))}catch(e){throw new Error(`Failed to decode encoded string bytes into utf-8, error: ${e}`)}}function _i(e){return e.map((e=>Object(Be.encodeString)(e)))}var Si=n(71),ki=n(64)},function(e,t,n){"use strict";n.r(t),n.d(t,"BackendWasm",(function(){return p})),n.d(t,"getThreadsCount",(function(){return x})),n.d(t,"setThreadsCount",(function(){return k})),n.d(t,"setWasmPath",(function(){return v})),n.d(t,"setWasmPaths",(function(){return j})),n.d(t,"version_wasm",(function(){return E}));var r=n(5);const a=Object(r.env)();a.registerFlag("WASM_HAS_SIMD_SUPPORT",(async()=>{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,9,1,7,0,65,0,253,15,26,11]))}catch(e){return!1}})),a.registerFlag("WASM_HAS_MULTITHREAD_SUPPORT",(async()=>{if(a.get("IS_NODE"))return!1;try{return(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(e){return!1}}));var s=n(94),o=n.n(s),i=n(122),u=n(95),c=n.n(u);const l=o.a||s,d=c.a||u;class p extends r.KernelBackend{constructor(e){super(),this.wasm=e,this.dataIdNextNumber=1,this.wasm.tfjs.initWithThreadsCount(_),S=this.wasm.tfjs.getThreadsCount(),this.dataIdMap=new r.DataStorage(this,Object(r.engine)())}write(e,t,n){const r={id:this.dataIdNextNumber++};return this.move(r,e,t,n,1),r}numDataIds(){return this.dataIdMap.numDataIds()}async time(e){const t=r.util.now();e();return{kernelMs:r.util.now()-t}}move(e,t,n,a,s){const o=this.dataIdNextNumber++;if("string"===a){const r=t;return void this.dataIdMap.set(e,{id:o,stringBytes:r,shape:n,dtype:a,memoryOffset:null,refCount:s})}const i=r.util.sizeFromShape(n),u=i*r.util.bytesPerElement(a),c=this.wasm._malloc(u)>>>0;this.dataIdMap.set(e,{id:o,memoryOffset:c,shape:n,dtype:a,refCount:s}),this.wasm.tfjs.registerTensor(o,i,c),null!=t&&this.wasm.HEAPU8.set(new Uint8Array(t.buffer,t.byteOffset,u),c)}async read(e){return this.readSync(e)}readSync(e,t,n){const{memoryOffset:a,dtype:s,shape:o,stringBytes:i}=this.dataIdMap.get(e);if("string"===s)return null!=t&&0!==t||!(null==n||n>=i.length)?i.slice(t,n):i;t=t||0,n=n||r.util.sizeFromShape(o);const u=r.util.bytesPerElement(s);return function(e,t){switch(t){case"float32":return new Float32Array(e);case"int32":return new Int32Array(e);case"bool":return new Uint8Array(e);default:throw new Error(`Unknown dtype ${t}`)}}(this.wasm.HEAPU8.slice(a+t*u,a+n*u).buffer,s)}disposeData(e,t=!1){if(this.dataIdMap.has(e)){const n=this.dataIdMap.get(e);if(n.refCount--,!t&&n.refCount>0)return!1;this.wasm._free(n.memoryOffset),this.wasm.tfjs.disposeData(n.id),this.dataIdMap.delete(e)}return!0}refCount(e){if(this.dataIdMap.has(e)){return this.dataIdMap.get(e).refCount}return 0}incRef(e){const t=this.dataIdMap.get(e);null!=t&&t.refCount++}floatPrecision(){return 32}getMemoryOffset(e){return this.dataIdMap.get(e).memoryOffset}dispose(){this.wasm.tfjs.dispose(),"PThread"in this.wasm&&this.wasm.PThread.terminateAllThreads(),this.wasm=null}memory(){return{unreliable:!1}}makeOutput(e,t,n,a){let s;if(null==n)s=this.write(null!=a?a:null,e,t);else{const a=this.dataIdNextNumber++;s={id:a},this.dataIdMap.set(s,{id:a,memoryOffset:n,shape:e,dtype:t,refCount:1});const o=r.util.sizeFromShape(e);this.wasm.tfjs.registerTensor(a,o,n)}return{dataId:s,shape:e,dtype:t}}typedArrayFromHeap({shape:e,dtype:t,dataId:n}){const a=this.wasm.HEAPU8.buffer,{memoryOffset:s}=this.dataIdMap.get(n),o=r.util.sizeFromShape(e);switch(t){case"float32":return new Float32Array(a,s,o);case"int32":return new Int32Array(a,s,o);case"bool":return new Uint8Array(a,s,o);default:throw new Error(`Unknown dtype ${t}`)}}}function f(e,t,n){if(null!=b)return b;let r="tfjs-backend-wasm.wasm";return e&&t?r="tfjs-backend-wasm-threaded-simd.wasm":e&&(r="tfjs-backend-wasm-simd.wasm"),null!=y&&null!=y[r]?y[r]:n+r}async function h(){const[e,t]=await Promise.all([Object(r.env)().getAsync("WASM_HAS_SIMD_SUPPORT"),Object(r.env)().getAsync("WASM_HAS_MULTITHREAD_SUPPORT")]);return new Promise(((n,a)=>{const s={};var o;s.locateFile=(n,r)=>{if(n.endsWith(".worker.js")){const e=i.wasmWorkerContents.replace(/\n/g,"\\n"),t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}return n.endsWith(".wasm")?f(e,t,null!=g?g:r):r+n},O&&(s.instantiateWasm=(o=f(e,t,null!=g?g:""),(e,t)=>(r.util.fetch(o,{credentials:"same-origin"}).then((n=>{n.ok||e.env.a(`failed to load wasm binary file at '${o}'`),n.arrayBuffer().then((n=>{WebAssembly.instantiate(n,e).then((e=>{t(e.instance,e.module)}))}))})),{})));let u,c=!1;s.onAbort=()=>{if(c)return;if(w)return;w=!0;a({message:"Make sure the server can serve the `.wasm` file relative to the bundled js file. For more details see https://github.com/tensorflow/tfjs/blob/master/tfjs-backend-wasm/README.md#using-bundlers"})},t&&e&&null==b?(s.mainScriptUrlOrBlob=new Blob(["var WasmBackendModuleThreadedSimd = "+l.toString()],{type:"text/javascript"}),u=l(s)):u=d(s),u.then((e=>{c=!0,w=!1;e.tfjs={init:e.cwrap("init",null,[]),initWithThreadsCount:e.cwrap("init_with_threads_count",null,["number"]),getThreadsCount:e.cwrap("get_threads_count","number",[]),registerTensor:e.cwrap("register_tensor",null,["number","number","number"]),disposeData:e.cwrap("dispose_data",null,["number"]),dispose:e.cwrap("dispose",null,[])},n({wasm:e})})).catch(a)}))}const m=["tfjs-backend-wasm.wasm","tfjs-backend-wasm-simd.wasm","tfjs-backend-wasm-threaded-simd.wasm"];let b=null,g=null,y={},w=!1,O=!1;function v(e,t=!1){if(Object(r.deprecationWarn)("setWasmPath has been deprecated in favor of setWasmPaths and will be removed in a future release."),w)throw new Error("The WASM backend was already initialized. Make sure you call `setWasmPath()` before you call `tf.setBackend()` or `tf.ready()`");b=e,O=t}function j(e,t=!1){if(w)throw new Error("The WASM backend was already initialized. Make sure you call `setWasmPaths()` before you call `tf.setBackend()` or `tf.ready()`");if("string"==typeof e)g=e;else{y=e;const t=m.filter((e=>null==y[e]));if(t.length>0)throw new Error(`There were no entries found for the following binaries: ${t.join(",")}. Please either call setWasmPaths with a map providing a path for each binary, or with a string indicating the directory where all the binaries can be found.`)}O=t}let _=-1,S=-1;function k(e){_=e}function x(){if(-1===S)throw new Error("WASM backend not initialized.");return S}const E="4.10.0";Object(r.registerBackend)("wasm",(async()=>{const{wasm:e}=await h();return new p(e)}),2)},function(e,t,n){"use strict";n.r(t);var r=n(3),a=(n(62),n(11)),s=n(77),o=n(79),i=n(48),u=n(78);class c{constructor(){this.messageName="setTimeoutCustom",this.functionRefs=[],this.handledMessageCount=0,this.hasEventListener=!1}fetch(e,t){return fetch(e,t)}now(){return performance.now()}encode(e,t){if("utf-8"!==t&&"utf8"!==t)throw new Error(`Browser's encoder only supports utf-8, but got ${t}`);return null==this.textEncoder&&(this.textEncoder=new TextEncoder),this.textEncoder.encode(e)}decode(e,t){return new TextDecoder(t).decode(e)}setTimeoutCustom(e,t){"undefined"!=typeof window&&Object(a.c)().getBool("USE_SETTIMEOUTCUSTOM")?(this.functionRefs.push(e),setTimeout((()=>{window.postMessage({name:this.messageName,index:this.functionRefs.length-1},"*")}),t),this.hasEventListener||(this.hasEventListener=!0,window.addEventListener("message",(e=>{if(e.source===window&&e.data.name===this.messageName){e.stopPropagation();(0,this.functionRefs[e.data.index])(),this.handledMessageCount++,this.handledMessageCount===this.functionRefs.length&&(this.functionRefs=[],this.handledMessageCount=0)}}),!0))):setTimeout(e,t)}isTypedArray(e){return Object(u.a)(e)}}if(Object(a.c)().get("IS_BROWSER")){Object(a.c)().setPlatform("browser",new c);try{i.a.registerManager(o.a.URL_SCHEME,new o.b)}catch(e){}try{i.a.registerManager(s.a.URL_SCHEME,new s.b)}catch(e){}}n(141);var l=n(28),d=n(15),p=n(36),f=n(75),h=n(17);Object(r.b)();const m={buffer:l.a,cast:d.a,clone:p.a,print:f.a};Object(h.e)(m)},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"Add",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddV2",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddN",category:"arithmetic",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"BiasAdd",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"Sub",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"RealDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Div",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"DivNoNan",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mul",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Maximum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Minimum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Pow",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SquaredDifference",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorMod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"Abs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan2",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Ceil",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ClipByValue",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"clipValueMin",type:"number"},{start:2,name:"clipValueMax",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Complex",category:"basic_math",inputs:[{start:0,name:"real",type:"tensor"},{start:1,name:"imag",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ComplexAbs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Elu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Exp",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Floor",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Imag",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Neg",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Real",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Prelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"alpha",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu6",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Selu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sigmoid",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Rsqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Square",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sign",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Round",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Expm1",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log1p",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Reciprocal",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Softplus",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Erf",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LeakyRelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"alpha",name:"alpha",type:"number",defaultValue:.2},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsNan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsFinite",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsInf",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"EmptyTensorList",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"maxNumElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"LoopCond",category:"control",inputs:[{start:0,name:"pred",type:"tensor"}]},{tfOpName:"Switch",category:"control",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"pred",type:"tensor"}]},{tfOpName:"Merge",category:"control",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"Enter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"frame_name",name:"frameName",type:"string"},{tfName:"is_constant",name:"isConstant",type:"bool"}]},{tfOpName:"Exit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NextIteration",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayV3",category:"control",inputs:[{start:0,name:"size",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"dynamic_size",name:"dynamicSize",type:"bool"},{tfName:"clear_after_read",name:"clearAfterRead",type:"bool"},{tfName:"identical_element_shapes",name:"identicalElementShapes",type:"bool"},{tfName:"tensor_array_name",name:"name",type:"string"}]},{tfOpName:"TensorArrayWriteV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayReadV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayGatherV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"}]},{tfOpName:"TensorArrayScatterV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArrayConcatV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape_except0",name:"elementShapeExcept0",type:"shape",notSupported:!0}]},{tfOpName:"TensorArraySplitV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"tensor",type:"tensor"},{start:2,name:"lengths",type:"number[]"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArraySizeV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}]},{tfOpName:"TensorArrayCloseV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"}]},{tfOpName:"StatelessIf",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"If",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"StatelessWhile",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"While",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"TensorListScatter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListScatterV2",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"},{start:3,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGather",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListSetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListReserve",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListFromTensor",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListStack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"},{tfName:"num_elements",name:"numElements",type:"dtype"}]},{tfOpName:"TensorListSplit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"},{start:2,name:"lengths",type:"number[]"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListConcat",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}],attrs:[{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListConcatV2",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}],attrs:[{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPopBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPushBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListLength",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}]},{tfOpName:"TensorListResize",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"size",type:"number"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"AvgPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[],notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPoolWithArgmax",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"include_batch_in_index",name:"includeBatchInIndex",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AvgPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Conv1D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"stride",name:"stride",type:"number"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NWC"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"dilation",name:"dilation",type:"number",defaultValue:1}]},{tfOpName:"Conv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"useCudnnOnGpu",name:"useCudnnOnGpu",type:"bool"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"_FusedConv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"use_cudnn_on_gpu",name:"useCudnnOnGpu",type:"bool",defaultValue:!0},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"leakyrelu_alpha",name:"leakyreluAlpha",type:"number",defaultValue:.2}]},{tfOpName:"Conv2DBackpropInput",category:"convolution",inputs:[{start:2,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:0,name:"outputShape",type:"number[]"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]",notSupported:!0}]},{tfOpName:"DepthwiseConv2d",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"DepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"FusedDepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]}]},{tfOpName:"Conv3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"Dilation2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"rates",name:"dilations",type:"number[]"},{tfName:"padding",name:"pad",type:"string"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"Fill",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"},{start:1,name:"value",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"LinSpace",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"num",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"OneHot",category:"creation",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"depth",type:"number"},{start:2,name:"onValue",type:"number",defaultValue:1},{start:3,name:"offValue",type:"number",defaultValue:0}],attrs:[{tfName:"axis",name:"axis",type:"number",notSupported:!0},{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"Ones",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"OnesLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"RandomStandardNormal",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"RandomUniform",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"minval",name:"minval",type:"number",defaultValue:0},{tfName:"maxval",name:"maxval",type:"number",defaultValue:1},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"RandomUniformInt",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"minval",name:"minval",type:"number"},{tfName:"maxval",name:"maxval",type:"number"},{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0}]},{tfOpName:"Range",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"step",type:"number",defaultValue:0}],attrs:[{tfName:"Tidx",name:"dtype",type:"dtype"}]},{tfOpName:"TruncatedNormal",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"means",name:"mean",type:"number",defaultValue:0},{tfName:"stddev",name:"stdDev",type:"number",defaultValue:1},{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"Zeros",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"ZerosLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"Multinomial",category:"creation",inputs:[{start:0,name:"logits",type:"tensor"},{start:1,name:"numSamples",type:"number"}],attrs:[{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number"},{tfName:"T",name:"dtype",type:"dtype"},{tfName:"output_dtype",name:"output_dtype",type:"dtype"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"NonMaxSuppressionV2",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV3",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV4",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"T_threshold",name:"threshold",type:"dtype",notSupported:!0},{tfName:"pad_to_max_output_size",name:"padToMaxOutputSize",type:"bool"}]},{tfOpName:"NonMaxSuppressionV5",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"},{start:5,name:"softNmsSigma",type:"number"}]},{tfOpName:"Where",category:"dynamic",inputs:[{start:0,name:"condition",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ListDiff",category:"dynamic",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"LowerBound",category:"evaluation",inputs:[{start:0,name:"sortedSequence",type:"tensor"},{start:1,name:"values",type:"tensor"}]},{tfOpName:"TopKV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"k",type:"number"}],attrs:[{tfName:"sorted",name:"sorted",type:"bool"}]},{tfOpName:"UpperBound",category:"evaluation",inputs:[{start:0,name:"sortedSequence",type:"tensor"},{start:1,name:"values",type:"tensor"}]},{tfOpName:"Unique",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"UniqueV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"PlaceholderWithDefault",category:"graph",inputs:[{start:0,name:"default",type:"tensor"}],attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Placeholder",category:"graph",attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Const",category:"graph"},{tfOpName:"Identity",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IdentityN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Snapshot",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Rank",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Size",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Shape",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"ShapeN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Print",category:"graph",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"data",type:"tensors"}],attrs:[{tfName:"message",name:"message",type:"string"},{tfName:"first_n",name:"firstN",type:"number",notSupported:!0},{tfName:"summarize",name:"summarize",type:"number",defaultValue:3}]},{tfOpName:"NoOp",category:"graph",inputs:[]},{tfOpName:"StopGradient",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"FakeQuantWithMinMaxVars",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"min",name:"min",type:"number"},{tfName:"max",name:"max",type:"number"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"HashTable",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"HashTableV2",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"LookupTableImport",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableImportV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFind",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFindV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableSize",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]},{tfOpName:"LookupTableSizeV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]},{tfOpName:"InitializeTable",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}]},{tfOpName:"InitializeTableV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"ResizeBilinear",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"half_pixel_centers",name:"halfPixelCenters",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ResizeNearestNeighbor",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"half_pixel_centers",name:"halfPixelCenters",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"CropAndResize",category:"image",inputs:[{start:0,name:"image",type:"tensor"},{start:1,name:"boxes",type:"tensor"},{start:2,name:"boxInd",type:"tensor"},{start:3,name:"cropSize",type:"number[]"}],attrs:[{tfName:"method",name:"method",type:"string"},{tfName:"extrapolation_value",name:"extrapolationValue",type:"number"}]},{tfOpName:"ImageProjectiveTransformV3",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"transforms",type:"tensor"},{start:2,name:"outputShape",type:"number[]"},{start:3,name:"fillValue",type:"number"}],attrs:[{tfName:"interpolation",name:"interpolation",type:"string"},{tfName:"fill_mode",name:"fillMode",type:"string"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"Equal",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NotEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Greater",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"GreaterEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Less",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LessEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalAnd",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalNot",category:"logical",inputs:[{start:0,name:"a",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalOr",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Select",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SelectV2",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BitwiseAnd",category:"logical",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"_FusedMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"leakyrelu_alpha",name:"leakyreluAlpha",type:"number",defaultValue:.2},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMulV2",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Transpose",category:"matrices",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"perm",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Einsum",category:"matrices",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"equation",name:"equation",type:"string"},{tfName:"N",name:"n",type:"number",defaultValue:2},{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"MatrixBandPart",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"numLower",type:"tensor"},{start:1,name:"numUpper",type:"tensor"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"EuclideanNorm",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool",defaultValue:!1}]},{tfOpName:"FusedBatchNorm",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV2",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV3",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"LRN",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"depth_radius",name:"radius",type:"number",defaultValue:5},{tfName:"bias",name:"bias",type:"number",defaultValue:1},{tfName:"alpha",name:"alpha",type:"number",defaultValue:1},{tfName:"beta",name:"beta",type:"number",defaultValue:.5}]},{tfOpName:"Softmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"LogSoftmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"Bincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}]},{tfOpName:"DenseBincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}],attrs:[{tfName:"binary_output",name:"binaryOutput",type:"bool"}]},{tfOpName:"Max",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Mean",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Min",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Sum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"All",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Any",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"ArgMax",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"ArgMin",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"Prod",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cumprod",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}],attrs:[{tfName:"exclusive",name:"exclusive",type:"bool"},{tfName:"reverse",name:"reverse",type:"bool"}]},{tfOpName:"Cumsum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}],attrs:[{tfName:"exclusive",name:"exclusive",type:"bool"},{tfName:"reverse",name:"reverse",type:"bool"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"ConcatV2",category:"slice_join",inputs:[{start:0,end:-1,name:"tensors",type:"tensors"},{start:-1,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"Concat",category:"slice_join",inputs:[{start:1,end:0,name:"tensors",type:"tensors"},{start:0,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"GatherV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"axis",type:"number",defaultValue:0}],attrs:[{tfName:"batch_dims",name:"batchDims",type:"number",defaultValue:0}]},{tfOpName:"Gather",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",notSupported:!0}]},{tfOpName:"Reverse",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"dims",type:"bool[]"}]},{tfOpName:"ReverseV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}]},{tfOpName:"Slice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"size",type:"number[]"}]},{tfOpName:"StridedSlice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"end",type:"number[]"},{start:3,name:"strides",type:"number[]"}],attrs:[{tfName:"begin_mask",name:"beginMask",type:"number",defaultValue:0},{tfName:"end_mask",name:"endMask",type:"number",defaultValue:0},{tfName:"new_axis_mask",name:"newAxisMask",type:"number",defaultValue:0},{tfName:"ellipsis_mask",name:"ellipsisMask",type:"number",defaultValue:0},{tfName:"shrink_axis_mask",name:"shrinkAxisMask",type:"number",defaultValue:0}]},{tfOpName:"Pack",category:"slice_join",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0}]},{tfOpName:"Unpack",category:"slice_join",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0},{tfName:"num",name:"num",type:"number",defaultValue:0,notSupported:!0}]},{tfOpName:"Tile",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"reps",type:"number[]"}]},{tfOpName:"Split",category:"slice_join",inputs:[{start:0,name:"axis",type:"number",defaultValue:0},{start:1,name:"x",type:"tensor"}],attrs:[{tfName:"num_split",name:"numOrSizeSplits",type:"number",defaultValue:1}]},{tfOpName:"SplitV",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"numOrSizeSplits",type:"number[]"},{start:2,name:"axis",type:"number",defaultValue:0}]},{tfOpName:"ScatterNd",category:"slice_join",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"shape",type:"number[]"}]},{tfOpName:"GatherNd",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}]},{tfOpName:"SparseToDense",category:"slice_join",inputs:[{start:0,name:"sparseIndices",type:"tensor"},{start:1,name:"outputShape",type:"number[]"},{start:2,name:"sparseValues",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",defaultValue:!1,notSupported:!0}]},{tfOpName:"TensorScatterUpdate",category:"slice_join",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"values",type:"tensor"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"SparseFillEmptyRows",category:"sparse",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"denseShape",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}]},{tfOpName:"SparseReshape",category:"sparse",inputs:[{start:0,name:"inputIndices",type:"tensor"},{start:1,name:"inputShape",type:"tensor"},{start:2,name:"newShape",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SparseSegmentMean",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]},{tfOpName:"SparseSegmentSum",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"FFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"RFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]},{tfOpName:"IRFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"StaticRegexReplace",category:"string",inputs:[{start:0,name:"input",type:"tensor"}],attrs:[{tfName:"pattern",name:"pattern",type:"string"},{tfName:"rewrite",name:"rewrite",type:"string"},{tfName:"replace_global",name:"replaceGlobal",type:"bool"}]},{tfOpName:"StringNGrams",category:"string",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"dataSplits",type:"tensor"}],attrs:[{tfName:"separator",name:"separator",type:"string"},{tfName:"ngram_widths",name:"nGramWidths",type:"number[]"},{tfName:"left_pad",name:"leftPad",type:"string"},{tfName:"right_pad",name:"rightPad",type:"string"},{tfName:"pad_width",name:"padWidth",type:"number"},{tfName:"preserve_short_sequences",name:"preserveShortSequences",type:"bool"}],outputs:["ngrams","ngrams_splits"]},{tfOpName:"StringSplit",category:"string",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"delimiter",type:"tensor"}],attrs:[{tfName:"skip_empty",name:"skipEmpty",type:"bool"}],outputs:["indices","values","shape"]},{tfOpName:"StringToHashBucketFast",category:"string",inputs:[{start:0,name:"input",type:"tensor"}],attrs:[{tfName:"num_buckets",name:"numBuckets",type:"number"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));const r=[{tfOpName:"Cast",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"SrcT",name:"sdtype",type:"dtype",notSupported:!0},{tfName:"DstT",name:"dtype",type:"dtype"}]},{tfOpName:"ExpandDims",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"MirrorPad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"mode",name:"mode",type:"string"}]},{tfOpName:"Pad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"constant_value",name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"PadV2",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"},{start:2,name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"Reshape",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}]},{tfOpName:"EnsureShape",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}]},{tfOpName:"Squeeze",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"axis",tfDeprecatedName:"squeeze_dims",name:"axis",type:"number[]"}]},{tfOpName:"SpaceToBatchND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"paddings",type:"number[]"}]},{tfOpName:"BatchToSpaceND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"crops",type:"number[]"}]},{tfOpName:"DepthToSpace",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"block_size",name:"blockSize",type:"number"},{tfName:"data_format",name:"dataFormat",type:"string"}]},{tfOpName:"BroadcastTo",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}],attrs:[]},{tfOpName:"BroadcastArgs",category:"transformation",inputs:[{start:0,name:"s0",type:"tensor"},{start:1,name:"s1",type:"tensor"}],attrs:[]}]},function(e,t){e.exports.wasmWorkerContents='"use strict";var Module={};var ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";if(ENVIRONMENT_IS_NODE){var nodeWorkerThreads=require("worker_threads");var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",data=>onmessage({data:data}));var fs=require("fs");Object.assign(global,{self:global,require:require,Module:Module,location:{href:__filename},Worker:nodeWorkerThreads.Worker,importScripts:function(f){(0,eval)(fs.readFileSync(f,"utf8")+"//# sourceURL="+f)},postMessage:function(msg){parentPort.postMessage(msg)},performance:global.performance||{now:function(){return Date.now()}}})}var initializedJS=false;var pendingNotifiedProxyingQueues=[];function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");if(ENVIRONMENT_IS_NODE){fs.writeSync(2,text+"\n");return}console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;self.alert=threadAlert;Module["instantiateWasm"]=(info,receiveInstance)=>{var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};self.onunhandledrejection=e=>{throw e.reason??e};self.startWorker=instance=>{Module=instance;postMessage({"cmd":"loaded"})};self.onmessage=e=>{try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;for(const handler of e.data.handlers){Module[handler]=function(){postMessage({cmd:"callHandler",handler:handler,args:[...arguments]})}}Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob=="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}WasmBackendModuleThreadedSimd(Module)}else if(e.data.cmd==="run"){Module["__emscripten_thread_init"](e.data.pthread_ptr,0,0,1);Module["establishStackSpace"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInitTLS();if(!initializedJS){pendingNotifiedProxyingQueues.forEach(queue=>{Module["executeNotifiedProxyingQueue"](queue)});pendingNotifiedProxyingQueues=[];initializedJS=true}try{Module["invokeEntryPoint"](e.data.start_routine,e.data.arg)}catch(ex){if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["__emscripten_thread_exit"](ex.status)}}else{throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processProxyingQueue"){if(initializedJS){Module["executeNotifiedProxyingQueue"](e.data.queue)}else{pendingNotifiedProxyingQueues.push(e.data.queue)}}else if(e.data.cmd){err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){if(Module["__emscripten_thread_crashed"]){Module["__emscripten_thread_crashed"]()}throw ex}};'},,function(e,t,n){"use strict";var r=n(125),a=n(126);let s;const o="/tessdata",i={};function u(e){const t=Math.random().toString(36);return i[t]=e,t}function c(e){if(!i.hasOwnProperty(e))throw new Error(`Object ${e} does not exist`);return i[e]}function l(e){const t=c(e);t.delete&&t.delete(),delete i[e]}function d(e,t){for(let n in t){if(e===t[n])return n}}function p(e){if(!(e instanceof Array))throw new Error('languages must be an array of valid language codes, e.g. ["eng", "deu"]');return s.FS.analyzePath(o).exists||s.FS.mkdir(o),e.forEach((function(e){if(!s.FS.analyzePath("/tessdata/"+e+".traineddata").exists){let t=s.locateFile(`tessdata/${e}.traineddata`);s.FS.createLazyFile(o,e+".traineddata",t,!0,!1)}})),e.join("+")}const f={initialize:async function(e,t,o,i,u){const{captureConsole:c,allowThreads:l,profileTfjsKernels:d}=u||{};c&&(console.log=function(...e){self.postMessage({log:e})},console.error=function(...e){self.postMessage({logError:e})});const p=n(163),f={locateFile:function(e,n){let a;return a=t?(0,r.isRemote)(t)?t:"":i,a+e}};return await Promise.all([p(f),(0,a.initialize)(f.locateFile(""),l,d)]),(0,a.initializeModule)(f),s=f,s.initialize(e||"",o)},getLicenseInfo:function(){return s.getLicenseInfo()},applyFilter:function(e,t){return b(s.applyFilter(y(e),t),m)},rotateImageCcw:function(e,t){return b(s.rotateImageCcw(y(e),t),m)},cropAndRotateImageCcw:function(e,t,n){const r=function(e){const t=[];for(let n=0;n<e.length;++n)t.push(e[n].x,e[n].y);return t}(t);return b(s.cropAndRotateImageCcw(y(e),r,n),m)},detectDocument:async function(e,t,n){const r=new s.DocumentDetector({acceptedAngleScore:t,acceptedSizeScore:n}),a=r.detect(y(e));return r.delete(),await h(a)},detectAndCropDocument:async function(e){return await h(s.detectAndCropDocument(y(e)))},createDocumentDetector:async function(e){return u(new s.DocumentDetector(e||{}))},documentDetectorDetect:async function(e,t){const n=c(e);return await h(n.detect(y(t)))},createBarcodeRecognizer:async function(e){return u(new s.BarcodeRecognizer(e||{}))},recognizeBarcodes:async function(e,t,n){let r,a=!1;"string"==typeof e?r=c(e):(n=t,t=e,r=new s.BarcodeRecognizer(n),a=!0);try{const e=r.recognize(y(t),n||{});if(!e)return null;let o;return e.length?(o=e.map((e=>({format:d(e.format,s.BarcodeFormat),text:e.text,parsedText:e.parsedText,rawBytes:e.rawBytes.data.slice(),quad:e.quad,barcodeImage:m(e.barcodeImage)}))),e.forEach((e=>e.delete()))):o=[],{result:o,originalImage:t}}finally{a&&r.delete()}},beginPdf:async function(e){return u(new s.PdfGenerationContext(e||{}))},addPageToPdf:async function(e,t){b(c(e).addPage(t))},completePdf:async function(e){const t=b(c(e).complete(),m);return l(e),t},beginTiff:async function(e){const t=new s.TiffGenerationContext(e||{});return b(t.begin()),u(t)},addPageToTiff:async function(e,t){return b(c(e).addPage(y(t)))},completeTiff:async function(e){try{const t=c(e).complete();return b(t,m)}finally{l(e)}},createMRZRecognizer:async function(){return u(new s.MrzRecognizerContext)},recognizeMRZ:async function(e,t){return c(e).recognize(y(t))},createBlurDetector:function(){return u(new s.BlurDetectorContext)},estimateBlurriness:function(e,t){return b(c(e).estimateBlurriness(y(t)))},estimateBlurrinessOnBuffer:function(e,t){return f.estimateBlurriness(e,t)},releaseObject:async function(e){l(e)},createOcrEngine:async function(e){const t=p(e);return u(new s.TesseractOcrContext(o,t))},performOcr:async function(e,t){return c(e).performOcr(y(t))},createGenericTextLineScanner:async function(e){e.languages||(e.languages=["eng"]),e.languages=p(e.languages),e.tessdataPath=o;return u(new s.GenericTextLineScanner(e))},recognizeTextLine:async function(e,t){return c(e).recognize(y(t))},cleanTextLineRecognitionQueue:async function(e){c(e).cleanRecognitionQueue()}};async function h(e){if(!e)return{success:!1,detectionStatus:"Error_License"};const t=w[e.status],n={detectionStatus:t,success:(r=t,"OK"===r.substr(0,2))};var r;return n.original=m(e.originalImageJpegData),n.success&&(n.cropped=m(e.croppedImageJpegData),n.polygon=function(e){if(e.length%2!=0)throw Error("pointCoords size is not even.");const t=[];for(let n=0;n<e.length;n+=2)t.push({x:e[n],y:e[n+1]});return t}(e.polygon.data),n.horizontalLines=g(e.horizontalLines.data),n.verticalLines=g(e.verticalLines.data)),e.delete(),n}function m(e){return e&&e.data&&e.data.slice()}function b(e,t){try{if(e.errorMessage){throw new Error(e.errorMessage)}return(t||(e=>e))(e.result)}finally{e.delete()}}function g(e){const t=[];if(!e)return t;if(e.length%4!=0)throw Error("lineCoords size invalid.");for(let n=0;n<e.length;n+=4)t.push({p1:{x:e[n],y:e[n+1]},p2:{x:e[n+2],y:e[n+3]}});return t}function y(e){if(!e)throw new Error("null image data or buffer");return"number"==typeof e.width?e:{data:e,width:-1,height:-1}}const w={0:"NotAcquired",100:"OK",101:"OK_SmallSize",102:"OK_BadAngles",103:"OK_BadAspectRatio",104:"OK_OffCenter",200:"Error_NothingDetected",201:"Error_Brightness",202:"Error_Noise"};onmessage=function(e){const{command:t,args:n,ticket:a}=e.data;s||"initialize"===t?(async()=>await f[t].apply(null,n))().then((e=>{const t=(0,r.gatherTransferables)(e);self.postMessage({ticket:a,result:e},t)})).catch((e=>{const t="number"==typeof e?Error(s.stringFromException(e)):e;console.error(t),self.postMessage({ticket:a,error:t})})):self.postMessage({ticket:a,error:"WASM module not loaded yet."})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gatherTransferables=function(e,t){const n=[];return function e(r){if(!r)return;if(r.constructor===ImageData){const e={data:r.data.slice(),width:r.width,height:r.height};return n.push(e.data.buffer),e}if(r.constructor===ArrayBuffer){const e=t?r.slice(0):r;if(n.push(e),t)return r}else if(ArrayBuffer.isView(r)){let e;if(t){e=new(0,r.constructor)(r.buffer.slice(0))}else e=r;if(n.push(e.buffer),t)return r}else if(Array.isArray(r))for(let t=0;t<r.length;++t){const n=e(r[t]);n&&(r[t]=n)}else if(r.constructor===Object)for(const t in r)if(r.hasOwnProperty(t)){const n=e(r[t]);n&&(r[t]=n)}}(e),n},t.isRemote=function(e){return e.startsWith("http:")||e.startsWith("https:")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initialize=async function(e,t,n){(0,s.setWasmPaths)(e),(0,s.setThreadsCount)(2);const o=await r.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT");t||r.env().setFlags({WASM_HAS_MULTITHREAD_SUPPORT:!1});u.wasm=await r.engine().initializeBackend("wasm").success,u.wasm&&o&&t&&console.log("ScanbotSDK: Using multithreaded backend");u.wasm||o&&t&&(console.log("ScanbotSDK: Multithreaded backend not available, falling back to single-threaded backend."),r.env().setFlags({WASM_HAS_MULTITHREAD_SUPPORT:!1}),u.wasm=await r.engine().initializeBackend("wasm").success);r.engine().findBackendFactory("webgl")&&(u.webgl=await r.engine().initializeBackend("webgl").success);r.engine().setBackendSync=function(e){this.backendName=e,this.backendInstance=this.registry[e],this.setupRegisteredKernels(),this.profiler=new a.Profiler(this.backendInstance)},n?r.enableDebugMode():r.enableProdMode()},t.initializeModule=function(e){e.tfjs={loadModel:l,predict:f,disposeModel:d}};var r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(127)),a=n(89),s=n(101);let o=1;const i={},u={};function c(e){e!==r.getBackend()&&u[e]&&r.engine().setBackendSync(e)}function l(e,t,n,a,s,u){const l=(new TextDecoder).decode(new Uint8Array(e.HEAPU8.buffer,n,a)),d=JSON.parse(l);d.weightData=[new Uint8Array(e.HEAPU8.buffer,s,u).slice()],c(t=e.UTF8ToString(t));const p=r.loadGraphModelSync({load:()=>d}),f=o++,h={model:p,backend:t};return i[f]=h,d.userDefinedMetadata&&(h.inferenceParameters=d.userDefinedMetadata.inferenceParameters),f}function d(e){const{model:t,backend:n}=i[e];c(n),t.dispose(),delete i[e]}const p={0:["int32",Uint8Array],1:["int32",Int8Array],2:["int32",Uint16Array],3:["int32",Int16Array],4:["int32",Int32Array],5:["float32",Float32Array],6:["float32",Float64Array]};function f(e,t,n,a,s,o){const{model:u,backend:l,inferenceParameters:d}=i[t];return c(l),r.tidy((()=>{const t=[],i=e.HEAPU32,c=function(e,t){let n=t/4;function r(){return e[n++]}return function(){const e=r(),t=[];let n=1;for(let a=0;a<e;a++){const e=r();n*=e,t.push(e)}return{shape:t,size:n,depth:r()}}}(i,s);for(let e=0;e<n;e++){const{shape:n,size:s,depth:o}=c(),[u,l]=p[o],f=i[a/4+e],h=new l(i.buffer,f,s);let m=r.tensor(h,n,u);if(d&&d[e]){const{scale:t,bias:n}=d[e];m=r.add(r.mul(m,t),n)}n.length<4&&(m=r.expandDims(m)),t.push(m)}const l=u.predict(t);return function(e,t,n){Array.isArray(t)||(t=[t]);const r=function(t){const n=e._malloc(4*t);return new Uint32Array(e.HEAPU8.buffer,n,t)}(t.length+1);r[0]=t.length;for(let a=0;a<t.length;a++){const s=t[a];if("float32"!==s.dtype)throw new Error("Unsupported dtype: "+s.dtype);let o=n&&1==s.shape[0]?s.shape.slice(1):s.shape;o=1==o[o.length-1]?o.slice(0,-1):o;const i=e.tfjsAllocateCvMat(o,1,5),u=e.tfjsGetCvMatData(i),c=s.dataSync();e.HEAPF32.set(c,u/4),r[a+1]=i}return r.byteOffset}(e,l,o)}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(100);Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})}));var a=n(164);Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}})}));var s=n(101);Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}})})),n(102);var o=n(147),i=n(148),u=n(149),c=n(90),l=n(91),d=n(150),p=n(81),f=n(151),h=n(152),m=n(68),b=n(153),g=n(165),y=n(154),w=n(155),O=n(156),v=n(157),j=n(166),_=n(158),S=n(159),k=n(47),x=n(160),E=n(161),T=n(167),N=n(162),A=n(92);(0,r.registerKernel)(o._fusedMatMulConfig),(0,r.registerKernel)(i.addConfig),(0,r.registerKernel)(u.avgPoolConfig),(0,r.registerKernel)(c.castConfig),(0,r.registerKernel)(l.concatConfig),(0,r.registerKernel)(d.conv2DConfig),(0,r.registerKernel)(p.expandDimsConfig),(0,r.registerKernel)(f.fusedConv2DConfig),(0,r.registerKernel)(h.fusedDepthwiseConv2DConfig),(0,r.registerKernel)(m.identityConfig),(0,r.registerKernel)(b.maximumConfig),(0,r.registerKernel)(g.meanConfig),(0,r.registerKernel)(y.minimumConfig),(0,r.registerKernel)(w.modConfig),(0,r.registerKernel)(O.multiplyConfig),(0,r.registerKernel)(v.packConfig),(0,r.registerKernel)(j.padV2Config),(0,r.registerKernel)(_.reluConfig),(0,r.registerKernel)(S.relu6Config),(0,r.registerKernel)(k.reshapeConfig),(0,r.registerKernel)(x.sigmoidConfig),(0,r.registerKernel)(E.softmaxConfig),(0,r.registerKernel)(T.stridedSliceConfig),(0,r.registerKernel)(N.subConfig),(0,r.registerKernel)(A.transposeConfig)},function(e,t,n){"use strict";t.byteLength=function(e){var t=c(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=c(e),o=r[0],i=r[1],u=new s(function(e,t,n){return 3*(t+n)/4-n}(0,o,i)),l=0,d=i>0?o-4:o;for(n=0;n<d;n+=4)t=a[e.charCodeAt(n)]<<18|a[e.charCodeAt(n+1)]<<12|a[e.charCodeAt(n+2)]<<6|a[e.charCodeAt(n+3)],u[l++]=t>>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===i&&(t=a[e.charCodeAt(n)]<<2|a[e.charCodeAt(n+1)]>>4,u[l++]=255&t);1===i&&(t=a[e.charCodeAt(n)]<<10|a[e.charCodeAt(n+1)]<<4|a[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,a=n%3,s=[],o=16383,i=0,u=n-a;i<u;i+=o)s.push(l(e,i,i+o>u?u:i+o));1===a?(t=e[n-1],s.push(r[t>>2]+r[t<<4&63]+"==")):2===a&&(t=(e[n-2]<<8)+e[n-1],s.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return s.join("")};for(var r=[],a=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,u=o.length;i<u;++i)r[i]=o[i],a[o.charCodeAt(i)]=i;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,n){for(var a,s,o=[],i=t;i<n;i+=3)a=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push(r[(s=a)>>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);return o.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,a){var s,o,i=8*a-r-1,u=(1<<i)-1,c=u>>1,l=-7,d=n?a-1:0,p=n?-1:1,f=e[t+d];for(d+=p,s=f&(1<<-l)-1,f>>=-l,l+=i;l>0;s=256*s+e[t+d],d+=p,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=r;l>0;o=256*o+e[t+d],d+=p,l-=8);if(0===s)s=1-c;else{if(s===u)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,r),s-=c}return(f?-1:1)*o*Math.pow(2,s-r)},t.write=function(e,t,n,r,a,s){var o,i,u,c=8*s-a-1,l=(1<<c)-1,d=l>>1,p=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:s-1,h=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(i=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+d>=1?p/u:p*Math.pow(2,1-d))*u>=2&&(o++,u/=2),o+d>=l?(i=0,o=l):o+d>=1?(i=(t*u-1)*Math.pow(2,a),o+=d):(i=t*Math.pow(2,d-1)*Math.pow(2,a),o=0));a>=8;e[n+f]=255&i,f+=h,i/=256,a-=8);for(o=o<<a|i,c+=a;c>0;e[n+f]=255&o,f+=h,o/=256,c-=8);e[n+f-h]|=128*m}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){(function(e){var r;!function(e,a,s){function o(e){var t,n=this,r=(t=4022871197,function(e){e=String(e);for(var n=0;n<e.length;n++){var r=.02519603282416938*(t+=e.charCodeAt(n));r-=t=r>>>0,t=(r*=t)>>>0,t+=4294967296*(r-=t)}return 2.3283064365386963e-10*(t>>>0)});n.next=function(){var e=2091639*n.s0+2.3283064365386963e-10*n.c;return n.s0=n.s1,n.s1=n.s2,n.s2=e-(n.c=0|e)},n.c=1,n.s0=r(" "),n.s1=r(" "),n.s2=r(" "),n.s0-=r(e),n.s0<0&&(n.s0+=1),n.s1-=r(e),n.s1<0&&(n.s1+=1),n.s2-=r(e),n.s2<0&&(n.s2+=1),r=null}function i(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function u(e,t){var n=new o(e),r=t&&t.state,a=n.next;return a.int32=function(){return 4294967296*n.next()|0},a.double=function(){return a()+11102230246251565e-32*(2097152*a()|0)},a.quick=a,r&&("object"==typeof r&&i(r,n),a.state=function(){return i(n,{})}),a}a&&a.exports?a.exports=u:n(35)&&n(60)?void 0===(r=function(){return u}.call(t,n,t,a))||(a.exports=r):this.alea=u}(0,e,n(35))}).call(this,n(59)(e))},function(e,t,n){(function(e){var r;!function(e,a,s){function o(e){var t=this,n="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:n+=e;for(var r=0;r<n.length+64;r++)t.x^=0|n.charCodeAt(r),t.next()}function i(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t}function u(e,t){var n=new o(e),r=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,r&&("object"==typeof r&&i(r,n),a.state=function(){return i(n,{})}),a}a&&a.exports?a.exports=u:n(35)&&n(60)?void 0===(r=function(){return u}.call(t,n,t,a))||(a.exports=r):this.xor128=u}(0,e,n(35))}).call(this,n(59)(e))},function(e,t,n){(function(e){var r;!function(e,a,s){function o(e){var t=this,n="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,e===(0|e)?t.x=e:n+=e;for(var r=0;r<n.length+64;r++)t.x^=0|n.charCodeAt(r),r==n.length&&(t.d=t.x<<10^t.x>>>4),t.next()}function i(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function u(e,t){var n=new o(e),r=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,r&&("object"==typeof r&&i(r,n),a.state=function(){return i(n,{})}),a}a&&a.exports?a.exports=u:n(35)&&n(60)?void 0===(r=function(){return u}.call(t,n,t,a))||(a.exports=r):this.xorwow=u}(0,e,n(35))}).call(this,n(59)(e))},function(e,t,n){(function(e){var r;!function(e,a,s){function o(e){var t=this;t.next=function(){var e,n,r=t.x,a=t.i;return e=r[a],n=(e^=e>>>7)^e<<24,n^=(e=r[a+1&7])^e>>>10,n^=(e=r[a+3&7])^e>>>3,n^=(e=r[a+4&7])^e<<7,e=r[a+7&7],n^=(e^=e<<13)^e<<9,r[a]=n,t.i=a+1&7,n},function(e,t){var n,r=[];if(t===(0|t))r[0]=t;else for(t=""+t,n=0;n<t.length;++n)r[7&n]=r[7&n]<<15^t.charCodeAt(n)+r[n+1&7]<<13;for(;r.length<8;)r.push(0);for(n=0;n<8&&0===r[n];++n);for(8==n?r[7]=-1:r[n],e.x=r,e.i=0,n=256;n>0;--n)e.next()}(t,e)}function i(e,t){return t.x=e.x.slice(),t.i=e.i,t}function u(e,t){null==e&&(e=+new Date);var n=new o(e),r=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,r&&(r.x&&i(r,n),a.state=function(){return i(n,{})}),a}a&&a.exports?a.exports=u:n(35)&&n(60)?void 0===(r=function(){return u}.call(t,n,t,a))||(a.exports=r):this.xorshift7=u}(0,e,n(35))}).call(this,n(59)(e))},function(e,t,n){(function(e){var r;!function(e,a,s){function o(e){var t=this;t.next=function(){var e,n,r=t.w,a=t.X,s=t.i;return t.w=r=r+1640531527|0,n=a[s+34&127],e=a[s=s+1&127],n^=n<<13,e^=e<<17,n^=n>>>15,e^=e>>>12,n=a[s]=n^e,t.i=s,n+(r^r>>>16)|0},function(e,t){var n,r,a,s,o,i=[],u=128;for(t===(0|t)?(r=t,t=null):(t+="\0",r=0,u=Math.max(u,t.length)),a=0,s=-32;s<u;++s)t&&(r^=t.charCodeAt((s+32)%t.length)),0===s&&(o=r),r^=r<<10,r^=r>>>15,r^=r<<4,r^=r>>>13,s>=0&&(o=o+1640531527|0,a=0==(n=i[127&s]^=r+o)?a+1:0);for(a>=128&&(i[127&(t&&t.length||0)]=-1),a=127,s=512;s>0;--s)r=i[a+34&127],n=i[a=a+1&127],r^=r<<13,n^=n<<17,r^=r>>>15,n^=n>>>12,i[a]=r^n;e.w=o,e.X=i,e.i=a}(t,e)}function i(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function u(e,t){null==e&&(e=+new Date);var n=new o(e),r=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,r&&(r.X&&i(r,n),a.state=function(){return i(n,{})}),a}a&&a.exports?a.exports=u:n(35)&&n(60)?void 0===(r=function(){return u}.call(t,n,t,a))||(a.exports=r):this.xor4096=u}(0,e,n(35))}).call(this,n(59)(e))},function(e,t,n){(function(e){var r;!function(e,a,s){function o(e){var t=this,n="";t.next=function(){var e=t.b,n=t.c,r=t.d,a=t.a;return e=e<<25^e>>>7^n,n=n-r|0,r=r<<24^r>>>8^a,a=a-e|0,t.b=e=e<<20^e>>>12^n,t.c=n=n-r|0,t.d=r<<16^n>>>16^a,t.a=a-e|0},t.a=0,t.b=0,t.c=-1640531527,t.d=1367130551,e===Math.floor(e)?(t.a=e/4294967296|0,t.b=0|e):n+=e;for(var r=0;r<n.length+20;r++)t.b^=0|n.charCodeAt(r),t.next()}function i(e,t){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t}function u(e,t){var n=new o(e),r=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,r&&("object"==typeof r&&i(r,n),a.state=function(){return i(n,{})}),a}a&&a.exports?a.exports=u:n(35)&&n(60)?void 0===(r=function(){return u}.call(t,n,t,a))||(a.exports=r):this.tychei=u}(0,e,n(35))}).call(this,n(59)(e))},function(e,t,n){var r;!function(a,s,o){var i,u=256,c=o.pow(u,6),l=o.pow(2,52),d=2*l,p=255;function f(e,t,n){var r=[],p=g(b((t=1==t?{entropy:!0}:t||{}).entropy?[e,y(s)]:null==e?function(){try{var e;return i&&(e=i.randomBytes)?e=e(u):(e=new Uint8Array(u),(a.crypto||a.msCrypto).getRandomValues(e)),y(e)}catch(e){var t=a.navigator,n=t&&t.plugins;return[+new Date,a,n,a.screen,y(s)]}}():e,3),r),f=new h(r),w=function(){for(var e=f.g(6),t=c,n=0;e<l;)e=(e+n)*u,t*=u,n=f.g(1);for(;e>=d;)e/=2,t/=2,n>>>=1;return(e+n)/t};return w.int32=function(){return 0|f.g(4)},w.quick=function(){return f.g(4)/4294967296},w.double=w,g(y(f.S),s),(t.pass||n||function(e,t,n,r){return r&&(r.S&&m(r,f),e.state=function(){return m(f,{})}),n?(o.random=e,t):e})(w,p,"global"in t?t.global:this==o,t.state)}function h(e){var t,n=e.length,r=this,a=0,s=r.i=r.j=0,o=r.S=[];for(n||(e=[n++]);a<u;)o[a]=a++;for(a=0;a<u;a++)o[a]=o[s=p&s+e[a%n]+(t=o[a])],o[s]=t;(r.g=function(e){for(var t,n=0,a=r.i,s=r.j,o=r.S;e--;)t=o[a=p&a+1],n=n*u+o[p&(o[a]=o[s=p&s+t])+(o[s]=t)];return r.i=a,r.j=s,n})(u)}function m(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function b(e,t){var n,r=[],a=typeof e;if(t&&"object"==a)for(n in e)try{r.push(b(e[n],t-1))}catch(e){}return r.length?r:"string"==a?e:e+"\0"}function g(e,t){for(var n,r=e+"",a=0;a<r.length;)t[p&a]=p&(n^=19*t[p&a])+r.charCodeAt(a++);return y(t)}function y(e){return String.fromCharCode.apply(0,e)}if(g(o.random(),s),e.exports){e.exports=f;try{i=n(138)}catch(e){}}else void 0===(r=function(){return f}.call(t,n,t,e))||(e.exports=r)}("undefined"!=typeof self?self:this,[],Math)},function(e,t){},function(e,t,n){(function(e){var r="undefined"!=typeof e&&e||"undefined"!=typeof self&&self||window,a=Function.prototype.apply;function s(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new s(a.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new s(a.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(140),t.setImmediate="undefined"!=typeof self&&self.setImmediate||"undefined"!=typeof e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||"undefined"!=typeof e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(63))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,a,s,o,i,u=1,c={},l=!1,d=e.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(e);p=p&&p.setTimeout?p:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){h(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((s=new MessageChannel).port1.onmessage=function(e){h(e.data)},r=function(e){s.port2.postMessage(e)}):d&&"onreadystatechange"in d.createElement("script")?(a=d.documentElement,r=function(e){var t=d.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,a.removeChild(t),t=null},a.appendChild(t)}):r=function(e){setTimeout(h,0,e)}:(o="setImmediate$"+Math.random()+"$",i=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&h(+t.data.slice(o.length))},e.addEventListener?e.addEventListener("message",i,!1):e.attachEvent("onmessage",i),r=function(t){e.postMessage(o+t,"*")}),p.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var a={callback:e,args:t};return c[u]=a,r(u),u++},p.clearImmediate=f}function f(e){delete c[e]}function h(e){if(l)setTimeout(h,0,e);else{var t=c[e];if(t){l=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{f(e),l=!1}}}}}("undefined"==typeof self?"undefined"==typeof e?this:e:self)}).call(this,n(63),n(58))},function(e,t,n){"use strict";(function(e){var t=n(11);const r=()=>n(142);let a;class s{constructor(){this.util=n(143),this.textEncoder=new this.util.TextEncoder}fetch(e,n){return null!=Object(t.c)().global.fetch?Object(t.c)().global.fetch(e,n):(null==a&&(a=r()),a(e,n))}now(){const t=e.hrtime();return 1e3*t[0]+t[1]/1e6}encode(e,t){if("utf-8"!==t&&"utf8"!==t)throw new Error(`Node built-in encoder only supports utf-8, but got ${t}`);return this.textEncoder.encode(e)}decode(e,t){return 0===e.length?"":new this.util.TextDecoder(t).decode(e)}isTypedArray(e){return this.util.types.isFloat32Array(e)||this.util.types.isInt32Array(e)||this.util.types.isUint8Array(e)||this.util.types.isUint8ClampedArray(e)}}Object(t.c)().get("IS_NODE")&&!Object(t.c)().get("IS_BROWSER")&&Object(t.c)().setPlatform("node",new s)}).call(this,n(58))},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.r(t),n.d(t,"_fusedMatMulConfig",(function(){return o}));var r=n(5),a=n(33);let s;const o={kernelName:r._FusedMatMul,backendName:"wasm",setupFunc:function(e){s=e.wasm.cwrap(r._FusedMatMul,null,["number","array","number","number","array","number","number","number","number","number","number","number","number"])},kernelFunc:function(e){const{inputs:t,backend:n,attrs:o}=e,{a:i,b:u,bias:c,preluActivationWeights:l}=t;if("float32"!==i.dtype||"float32"!==u.dtype)throw new Error("_FusedMatMul for non non-float32 tensors not yet supported.");const{transposeA:d,transposeB:p,activation:f,leakyreluAlpha:h}=o,m=n.dataIdMap.get(i.dataId).id,b=n.dataIdMap.get(u.dataId).id;let g=0;if(null!=c){const e=n.dataIdMap.get(c.dataId);if(1!==e.shape.length)throw new Error(`_FusedMatMul only supports rank-1 bias but got rank ${e.shape.length}.`);g=e.id}const y=null==l?0:n.dataIdMap.get(l.dataId).id,w=a.b[f];if(null==w)throw new Error(`${f} activation not yet supported for FusedConv2D in the wasm backend.`);const O=d?i.shape[2]:i.shape[1],v=p?u.shape[1]:u.shape[2],j=r.broadcast_util.assertAndGetBroadcastShape(i.shape.slice(0,-2),u.shape.slice(0,-2)),_=n.makeOutput([...j,O,v],i.dtype),S=n.dataIdMap.get(_.dataId).id,k=new Uint8Array(new Int32Array(i.shape).buffer),x=new Uint8Array(new Int32Array(u.shape).buffer);return s(m,k,i.shape.length,b,x,u.shape.length,d,p,w,g,y,h||0,S),_}}},function(e,t,n){"use strict";n.r(t),n.d(t,"addConfig",(function(){return s}));var r=n(5),a=n(37);const s=Object(a.a)(r.Add,!0)},function(e,t,n){"use strict";n.r(t),n.d(t,"avgPoolConfig",(function(){return s}));var r=n(5);let a;const s={kernelName:r.AvgPool,backendName:"wasm",setupFunc:function(e){a=e.wasm.cwrap(r.AvgPool,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number"])},kernelFunc:function(e){const{inputs:t,attrs:n,backend:s}=e,o=t.x,i=s.dataIdMap.get(o.dataId).id,{filterSize:u,strides:c,pad:l,dimRoundingMode:d}=n,p=r.backend_util.computePool2DInfo(o.shape,u,c,1,l,d),f=p.filterHeight,h=p.filterWidth,m=p.padInfo.top,b=p.padInfo.right,g=p.padInfo.bottom,y=p.padInfo.left,w=p.strideHeight,O=p.strideWidth,v=p.inChannels;if("channelsLast"!==p.dataFormat)throw new Error(`wasm backend does not support dataFormat:'${p.dataFormat}'. Please use 'channelsLast'.`);if(1!==p.dilationWidth||1!==p.dilationHeight)throw new Error(`was backend only supports average pooling with dilation = [1, 1], got [${p.dilationHeight}, ${p.dilationWidth}].`);const j=s.makeOutput(p.outShape,"float32"),_=s.dataIdMap.get(j.dataId).id;return a(i,o.shape[0],o.shape[1],o.shape[2],f,h,m,b,g,y,w,O,v,_),j}}},function(e,t,n){"use strict";n.r(t),n.d(t,"conv2DConfig",(function(){return s}));var r=n(5);let a;const s={kernelName:r.Conv2D,backendName:"wasm",setupFunc:function(e){a=e.wasm.cwrap(r.Conv2D,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])},kernelFunc:function(e){const{inputs:t,attrs:n,backend:s}=e,{x:o,filter:i}=t,u=s.dataIdMap.get(o.dataId).id,c=s.dataIdMap.get(i.dataId).id,{strides:l,dilations:d,pad:p,dimRoundingMode:f,dataFormat:h}=n,m=r.backend_util.convertConv2DDataFormat(h),b=r.backend_util.computeConv2DInfo(o.shape,i.shape,l,d,p,f,!1,m),g=b.filterHeight,y=b.filterWidth,w=b.padInfo.top,O=b.padInfo.right,v=b.padInfo.bottom,j=b.padInfo.left,_=b.dilationHeight,S=b.dilationWidth,k=b.strideHeight,x=b.strideWidth,E=b.inChannels,T=b.outChannels,N="SAME"===b.padInfo.type?1:0;if("channelsLast"!==b.dataFormat)throw new Error(`wasm backend Conv2D does not support dataFormat:'${b.dataFormat}'. Please use 'channelsLast'.`);const A=s.makeOutput(b.outShape,"float32"),M=s.dataIdMap.get(A.dataId).id;return a(u,o.shape[0],o.shape[1],o.shape[2],c,g,y,w,O,v,j,N,_,S,k,x,E,T,M),A}}},function(e,t,n){"use strict";n.r(t),n.d(t,"fusedConv2DConfig",(function(){return o}));var r=n(5),a=n(33);let s;const o={kernelName:r.FusedConv2D,backendName:"wasm",setupFunc:function(e){s=e.wasm.cwrap(r.FusedConv2D,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])},kernelFunc:function(e){const{inputs:t,attrs:n,backend:o}=e,{x:i,filter:u,bias:c,preluActivationWeights:l}=t,{strides:d,pad:p,dilations:f,dataFormat:h,dimRoundingMode:m,activation:b,leakyreluAlpha:g}=n,y=r.backend_util.computeConv2DInfo(i.shape,u.shape,d,f,p,m),w=a.b[b];if(null==w)throw new Error(`${b} activation not yet supported for FusedConv2D in the wasm backend.`);const O=o.dataIdMap.get(i.dataId).id,v=o.dataIdMap.get(u.dataId).id,j=y.outChannels;let _=0;if(null!=c){const e=o.dataIdMap.get(c.dataId);if(1!==e.shape.length)throw new Error(`FusedConv2D only supports rank-1 bias but got rank ${e.shape.length}.`);if(e.shape[0]!==j)throw new Error(`FusedConv2D bias shape (${e.shape}) does not match the number of output channels (${j})`);_=e.id}const S=y.filterHeight,k=y.filterWidth,x=y.padInfo.top,E=y.padInfo.right,T=y.padInfo.bottom,N=y.padInfo.left,A=y.dilationHeight,M=y.dilationWidth,I=y.strideHeight,D=y.strideWidth,$=y.inChannels,C="SAME"===y.padInfo.type?1:0,R=y.batchSize,P=y.inHeight,F=y.inWidth;if("NHWC"!==h)throw new Error(`wasm backend FusedConv2D does not support dataFormat:'${h}'. Please use 'NHWC'.`);const B=o.makeOutput(y.outShape,"float32"),L=o.dataIdMap.get(B.dataId).id,z=null==l?0:o.dataIdMap.get(l.dataId).id;return s(O,R,P,F,v,S,k,_,x,E,T,N,C,A,M,I,D,$,j,w,z,g||0,L),B}}},function(e,t,n){"use strict";n.r(t),n.d(t,"fusedDepthwiseConv2DConfig",(function(){return o}));var r=n(5),a=n(33);let s;const o={kernelName:r.FusedDepthwiseConv2D,backendName:"wasm",setupFunc:function(e){s=e.wasm.cwrap(r.FusedDepthwiseConv2D,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])},kernelFunc:function(e){const{inputs:t,attrs:n,backend:o}=e,{x:i,filter:u,bias:c,preluActivationWeights:l}=t,{strides:d,pad:p,dilations:f,dataFormat:h,dimRoundingMode:m,activation:b,leakyreluAlpha:g}=n,y=r.backend_util.computeConv2DInfo(i.shape,u.shape,d,f,p,m,!0),w=a.b[b];if(null==w)throw new Error(`${b} activation not yet supported for FusedDepthwiseConv2D in the wasm backend.`);const O=o.dataIdMap.get(i.dataId).id,v=o.dataIdMap.get(u.dataId).id,j=y.outChannels;let _=0;if(null!=c){const e=o.dataIdMap.get(c.dataId);if(1!==e.shape.length)throw new Error(`FusedDepthwiseConv2D only supports rank-1 bias but got rank ${e.shape.length}.`);if(e.shape[0]!==j)throw new Error(`FusedDepthwiseConv2D bias shape (${e.shape}) does not match the number of output channels (${j})`);_=e.id}const S=y.filterHeight,k=y.filterWidth,x=y.padInfo.top,E=y.padInfo.right,T=y.padInfo.bottom,N=y.padInfo.left,A=y.dilationHeight,M=y.dilationWidth,I=y.strideHeight,D=y.strideWidth,$=y.inChannels,C="SAME"===y.padInfo.type?1:0,R=y.batchSize,P=y.inHeight,F=y.inWidth;if("NHWC"!==h)throw new Error(`wasm backend FusedDepthwiseConv2D does not support dataFormat:'${h}'. Please use 'NHWC'.`);const B=o.makeOutput(y.outShape,"float32"),L=o.dataIdMap.get(B.dataId).id,z=null==l?0:o.dataIdMap.get(l.dataId).id;return s(O,R,P,F,v,S,k,_,x,E,T,N,C,A,M,I,D,$,j,w,z,g||0,L),B}}},function(e,t,n){"use strict";n.r(t),n.d(t,"maximumConfig",(function(){return s}));var r=n(5),a=n(37);const s=Object(a.a)(r.Maximum,!1)},function(e,t,n){"use strict";n.r(t),n.d(t,"minimumConfig",(function(){return s}));var r=n(5),a=n(37);const s=Object(a.a)(r.Minimum,!1)},function(e,t,n){"use strict";n.r(t),n.d(t,"modConfig",(function(){return s}));var r=n(5),a=n(37);const s=Object(a.a)(r.Mod,!0)},function(e,t,n){"use strict";n.r(t),n.d(t,"multiplyConfig",(function(){return s}));var r=n(5),a=n(37);const s=Object(a.a)(r.Multiply,!0)},function(e,t,n){"use strict";n.r(t),n.d(t,"pack",(function(){return o})),n.d(t,"packConfig",(function(){return i}));var r=n(5),a=n(91),s=n(81);function o(e){const{inputs:t,backend:n,attrs:o}=e,{axis:i}=o;if(1===t.length)return Object(s.expandDims)({inputs:{input:t[0]},backend:n,attrs:{dim:i}});const u=t[0].shape,c=t[0].dtype;t.forEach((e=>{r.util.assertShapesMatch(u,e.shape,"All tensors passed to stack must have matching shapes"),r.util.assert(c===e.dtype,(()=>"All tensors passed to stack must have matching dtypes"))}));const l=[],d=t.map((e=>{const t=Object(s.expandDims)({inputs:{input:e},backend:n,attrs:{dim:i}});return l.push(t),t})),p=Object(a.concat)({inputs:d,backend:n,attrs:{axis:i}});return l.forEach((e=>n.disposeData(e.dataId))),p}const i={kernelName:r.Pack,backendName:"wasm",kernelFunc:o}},function(e,t,n){"use strict";n.r(t),n.d(t,"reluConfig",(function(){return s}));var r=n(5),a=n(82);const s=Object(a.a)(r.Relu)},function(e,t,n){"use strict";n.r(t),n.d(t,"relu6Config",(function(){return s}));var r=n(5),a=n(82);const s=Object(a.a)(r.Relu6)},function(e,t,n){"use strict";n.r(t),n.d(t,"sigmoidConfig",(function(){return s}));var r=n(5);let a;const s={kernelName:"Sigmoid",backendName:"wasm",setupFunc:function(e){a=e.wasm.cwrap(r.Sigmoid,null,["number","number"])},kernelFunc:function(e){const{backend:t,inputs:{x:n}}=e,s=t.dataIdMap.get(n.dataId).id,o=t.makeOutput(n.shape,n.dtype),i=t.dataIdMap.get(o.dataId).id;return 0===r.util.sizeFromShape(o.shape)||a(s,i),o}}},function(e,t,n){"use strict";n.r(t),n.d(t,"softmax",(function(){return s})),n.d(t,"softmaxConfig",(function(){return o}));var r=n(5);let a;function s(e){const{backend:t,inputs:{logits:n},attrs:{dim:s}}=e,o=t.dataIdMap.get(n.dataId).id,i=t.makeOutput(n.shape,n.dtype),u=t.dataIdMap.get(i.dataId).id,c=n.shape[s],l=r.util.sizeFromShape(n.shape)/c;return 0===r.util.sizeFromShape(i.shape)||a(o,u,c,l),i}const o={kernelName:r.Softmax,backendName:"wasm",setupFunc:function(e){a=e.wasm.cwrap(r.Softmax,null,["number","number","number","number"])},kernelFunc:s}},function(e,t,n){"use strict";n.r(t),n.d(t,"subConfig",(function(){return s}));var r=n(5),a=n(37);const s=Object(a.a)(r.Sub,!0)},function(e,t,n){"use strict";var r,a=(r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(e={}){var t,n,a=e;a.ready=new Promise(((e,r)=>{t=e,n=r}));var s,o,i,u=Object.assign({},a),c="./this.program",l=(e,t)=>{throw t},d="";d=self.location.href,r&&(d=r),d=0!==d.indexOf("blob:")?d.substr(0,d.replace(/[?#].*/,"").lastIndexOf("/")+1):"",s=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},i=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)},o=(e,t,n)=>{var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)};var p,f=a.print||console.log.bind(console),h=a.printErr||console.error.bind(console);Object.assign(a,u),u=null,a.arguments&&a.arguments,a.thisProgram&&(c=a.thisProgram),a.quit&&(l=a.quit),a.wasmBinary&&(p=a.wasmBinary);var m,b=a.noExitRuntime||!0;"object"!=typeof WebAssembly&&L("no native wasm support detected");var g,y,w,O,v,j,_,S,k,x=!1;function E(){var e=m.buffer;a.HEAP8=g=new Int8Array(e),a.HEAP16=w=new Int16Array(e),a.HEAPU8=y=new Uint8Array(e),a.HEAPU16=O=new Uint16Array(e),a.HEAP32=v=new Int32Array(e),a.HEAPU32=j=new Uint32Array(e),a.HEAPF32=_=new Float32Array(e),a.HEAPF64=S=new Float64Array(e)}var T,N,A,M,I=[],D=[],$=[],C=0,R=null,P=null;function F(e){C++,a.monitorRunDependencies&&a.monitorRunDependencies(C)}function B(e){if(C--,a.monitorRunDependencies&&a.monitorRunDependencies(C),0==C&&(null!==R&&(clearInterval(R),R=null),P)){var t=P;P=null,t()}}function L(e){a.onAbort&&a.onAbort(e),h(e="Aborted("+e+")"),x=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw n(t),t}function z(e){return e.startsWith("data:application/octet-stream;base64,")}function W(e){if(e==T&&p)return new Uint8Array(p);if(i)return i(e);throw"both async and sync fetching of the wasm failed"}function U(e,t,n){return function(e){return p||"function"!=typeof fetch?Promise.resolve().then((()=>W(e))):fetch(e,{credentials:"same-origin"}).then((t=>{if(!t.ok)throw"failed to load wasm binary file at '"+e+"'";return t.arrayBuffer()})).catch((()=>W(e)))}(e).then((e=>WebAssembly.instantiate(e,t))).then((e=>e)).then(n,(e=>{h(`failed to asynchronously prepare wasm: ${e}`),L(e)}))}z(T="ScanbotSDK.Asm-simd.wasm")||(N=T,T=a.locateFile?a.locateFile(N,d):d+N);var V={1696416:e=>gn(function(){return this[me(e)].toString()}.apply((0,eval)("(()=>this)()"))),1696530:(e,t,n,r,s)=>a.tfjs.loadModel(a,e,t,n,r,s),1696587:e=>{a.tfjs.disposeModel(e)},1696616:()=>{console.error("TensorflowJsModelProvider: model not loaded")},1696678:(e,t,n,r,s)=>a.tfjs.predict(a,e,t,n,r,s)};function G(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var q=e=>{for(;e.length>0;)e.shift()(a)},H=[],K=0,Y=0;function J(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){j[this.ptr+4>>2]=e},this.get_type=function(){return j[this.ptr+4>>2]},this.set_destructor=function(e){j[this.ptr+8>>2]=e},this.get_destructor=function(){return j[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,g[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=g[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,g[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=g[this.ptr+13>>0]},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)},this.set_adjusted_ptr=function(e){j[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return j[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Rn(this.get_type()))return j[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var X=e=>{var t=Y;if(!t)return En(0),0;var n=new J(t);n.set_adjusted_ptr(t);var r=n.get_type();if(!r)return En(0),t;for(var a in e){var s=e[a];if(0===s||s===r)break;var o=n.ptr+16;if(Cn(s,r,o))return En(s),t}return En(r),t},Q=()=>{var e=H.pop();e||L("no exception to throw");var t=e.excPtr;throw e.get_rethrown()||(H.push(e),e.set_rethrown(!0),e.set_caught(!1),K++),Y=t},Z={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var n=0,r=e.length-1;r>=0;r--){var a=e[r];"."===a?e.splice(r,1):".."===a?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n;n--)e.unshift("..");return e},normalize:e=>{var t=Z.isAbs(e),n="/"===e.substr(-1);return(e=Z.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=Z.splitPath(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},basename:e=>{if("/"===e)return"/";var t=(e=(e=Z.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments);return Z.normalize(e.join("/"))},join2:(e,t)=>Z.normalize(e+"/"+t)},ee=e=>(ee=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);L("initRandomDevice")})())(e),te={resolve:function(){for(var e="",t=!1,n=arguments.length-1;n>=-1&&!t;n--){var r=n>=0?arguments[n]:he.cwd();if("string"!=typeof r)throw new TypeError("Arguments to path.resolve must be strings");if(!r)return"";e=r+"/"+e,t=Z.isAbs(r)}return(t?"/":"")+(e=Z.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||"."},relative:(e,t)=>{function n(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=te.resolve(e).substr(1),t=te.resolve(t).substr(1);for(var r=n(e.split("/")),a=n(t.split("/")),s=Math.min(r.length,a.length),o=s,i=0;i<s;i++)if(r[i]!==a[i]){o=i;break}var u=[];for(i=o;i<r.length;i++)u.push("..");return(u=u.concat(a.slice(o))).join("/")}},ne="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,re=(e,t,n)=>{for(var r=t+n,a=t;e[a]&&!(a>=r);)++a;if(a-t>16&&e.buffer&&ne)return ne.decode(e.subarray(t,a));for(var s="";t<a;){var o=e[t++];if(128&o){var i=63&e[t++];if(192!=(224&o)){var u=63&e[t++];if((o=224==(240&o)?(15&o)<<12|i<<6|u:(7&o)<<18|i<<12|u<<6|63&e[t++])<65536)s+=String.fromCharCode(o);else{var c=o-65536;s+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else s+=String.fromCharCode((31&o)<<6|i)}else s+=String.fromCharCode(o)}return s},ae=[],se=e=>{for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);r<=127?t++:r<=2047?t+=2:r>=55296&&r<=57343?(t+=4,++n):t+=3}return t},oe=(e,t,n,r)=>{if(!(r>0))return 0;for(var a=n,s=n+r-1,o=0;o<e.length;++o){var i=e.charCodeAt(o);if(i>=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++o)),i<=127){if(n>=s)break;t[n++]=i}else if(i<=2047){if(n+1>=s)break;t[n++]=192|i>>6,t[n++]=128|63&i}else if(i<=65535){if(n+2>=s)break;t[n++]=224|i>>12,t[n++]=128|i>>6&63,t[n++]=128|63&i}else{if(n+3>=s)break;t[n++]=240|i>>18,t[n++]=128|i>>12&63,t[n++]=128|i>>6&63,t[n++]=128|63&i}}return t[n]=0,n-a};function ie(e,t,n){var r=n>0?n:se(e)+1,a=new Array(r),s=oe(e,a,0,a.length);return t&&(a.length=s),a}var ue={ttys:[],init(){},shutdown(){},register(e,t){ue.ttys[e]={input:[],output:[],ops:t},he.registerDevice(e,ue.stream_ops)},stream_ops:{open(e){var t=ue.ttys[e.node.rdev];if(!t)throw new he.ErrnoError(43);e.tty=t,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,t,n,r,a){if(!e.tty||!e.tty.ops.get_char)throw new he.ErrnoError(60);for(var s=0,o=0;o<r;o++){var i;try{i=e.tty.ops.get_char(e.tty)}catch(e){throw new he.ErrnoError(29)}if(void 0===i&&0===s)throw new he.ErrnoError(6);if(null==i)break;s++,t[n+o]=i}return s&&(e.node.timestamp=Date.now()),s},write(e,t,n,r,a){if(!e.tty||!e.tty.ops.put_char)throw new he.ErrnoError(60);try{for(var s=0;s<r;s++)e.tty.ops.put_char(e.tty,t[n+s])}catch(e){throw new he.ErrnoError(29)}return r&&(e.node.timestamp=Date.now()),s}},default_tty_ops:{get_char:e=>(()=>{if(!ae.length){var e=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n"),!e)return null;ae=ie(e,!0)}return ae.shift()})(),put_char(e,t){null===t||10===t?(f(re(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(f(re(e.output,0)),e.output=[])},ioctl_tcgets:e=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ioctl_tcsets:(e,t,n)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,t){null===t||10===t?(h(re(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(h(re(e.output,0)),e.output=[])}}},ce=e=>{e=((e,t)=>Math.ceil(e/t)*t)(e,65536);var t=Nn(65536,e);return t?((e,t)=>(y.fill(0,e,e+t),e))(t,e):0},le={ops_table:null,mount:e=>le.createNode(null,"/",16895,0),createNode(e,t,n,r){if(he.isBlkdev(n)||he.isFIFO(n))throw new he.ErrnoError(63);le.ops_table||(le.ops_table={dir:{node:{getattr:le.node_ops.getattr,setattr:le.node_ops.setattr,lookup:le.node_ops.lookup,mknod:le.node_ops.mknod,rename:le.node_ops.rename,unlink:le.node_ops.unlink,rmdir:le.node_ops.rmdir,readdir:le.node_ops.readdir,symlink:le.node_ops.symlink},stream:{llseek:le.stream_ops.llseek}},file:{node:{getattr:le.node_ops.getattr,setattr:le.node_ops.setattr},stream:{llseek:le.stream_ops.llseek,read:le.stream_ops.read,write:le.stream_ops.write,allocate:le.stream_ops.allocate,mmap:le.stream_ops.mmap,msync:le.stream_ops.msync}},link:{node:{getattr:le.node_ops.getattr,setattr:le.node_ops.setattr,readlink:le.node_ops.readlink},stream:{}},chrdev:{node:{getattr:le.node_ops.getattr,setattr:le.node_ops.setattr},stream:he.chrdev_stream_ops}});var a=he.createNode(e,t,n,r);return he.isDir(a.mode)?(a.node_ops=le.ops_table.dir.node,a.stream_ops=le.ops_table.dir.stream,a.contents={}):he.isFile(a.mode)?(a.node_ops=le.ops_table.file.node,a.stream_ops=le.ops_table.file.stream,a.usedBytes=0,a.contents=null):he.isLink(a.mode)?(a.node_ops=le.ops_table.link.node,a.stream_ops=le.ops_table.link.stream):he.isChrdev(a.mode)&&(a.node_ops=le.ops_table.chrdev.node,a.stream_ops=le.ops_table.chrdev.stream),a.timestamp=Date.now(),e&&(e.contents[t]=a,e.timestamp=a.timestamp),a},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,t){var n=e.contents?e.contents.length:0;if(!(n>=t)){t=Math.max(t,n*(n<1048576?2:1.125)>>>0),0!=n&&(t=Math.max(t,256));var r=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(r.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var n=e.contents;e.contents=new Uint8Array(t),n&&e.contents.set(n.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr(e){var t={};return t.dev=he.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,he.isDir(e.mode)?t.size=4096:he.isFile(e.mode)?t.size=e.usedBytes:he.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&le.resizeFileStorage(e,t.size)},lookup(e,t){throw he.genericErrors[44]},mknod:(e,t,n,r)=>le.createNode(e,t,n,r),rename(e,t,n){if(he.isDir(e.mode)){var r;try{r=he.lookupNode(t,n)}catch(e){}if(r)for(var a in r.contents)throw new he.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=n,t.contents[n]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir(e,t){var n=he.lookupNode(e,t);for(var r in n.contents)throw new he.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir(e){var t=[".",".."];for(var n in e.contents)e.contents.hasOwnProperty(n)&&t.push(n);return t},symlink(e,t,n){var r=le.createNode(e,t,41471,0);return r.link=n,r},readlink(e){if(!he.isLink(e.mode))throw new he.ErrnoError(28);return e.link}},stream_ops:{read(e,t,n,r,a){var s=e.node.contents;if(a>=e.node.usedBytes)return 0;var o=Math.min(e.node.usedBytes-a,r);if(o>8&&s.subarray)t.set(s.subarray(a,a+o),n);else for(var i=0;i<o;i++)t[n+i]=s[a+i];return o},write(e,t,n,r,a,s){if(t.buffer===g.buffer&&(s=!1),!r)return 0;var o=e.node;if(o.timestamp=Date.now(),t.subarray&&(!o.contents||o.contents.subarray)){if(s)return o.contents=t.subarray(n,n+r),o.usedBytes=r,r;if(0===o.usedBytes&&0===a)return o.contents=t.slice(n,n+r),o.usedBytes=r,r;if(a+r<=o.usedBytes)return o.contents.set(t.subarray(n,n+r),a),r}if(le.expandFileStorage(o,a+r),o.contents.subarray&&t.subarray)o.contents.set(t.subarray(n,n+r),a);else for(var i=0;i<r;i++)o.contents[a+i]=t[n+i];return o.usedBytes=Math.max(o.usedBytes,a+r),r},llseek(e,t,n){var r=t;if(1===n?r+=e.position:2===n&&he.isFile(e.node.mode)&&(r+=e.node.usedBytes),r<0)throw new he.ErrnoError(28);return r},allocate(e,t,n){le.expandFileStorage(e.node,t+n),e.node.usedBytes=Math.max(e.node.usedBytes,t+n)},mmap(e,t,n,r,a){if(!he.isFile(e.node.mode))throw new he.ErrnoError(43);var s,o,i=e.node.contents;if(2&a||i.buffer!==g.buffer){if((n>0||n+t<i.length)&&(i=i.subarray?i.subarray(n,n+t):Array.prototype.slice.call(i,n,n+t)),o=!0,!(s=ce(t)))throw new he.ErrnoError(48);g.set(i,s)}else o=!1,s=i.byteOffset;return{ptr:s,allocated:o}},msync:(e,t,n,r,a)=>(le.stream_ops.write(e,t,0,r,n,!1),0)}},de=(e,t,n,r)=>{var a=r?"":`al ${e}`;o(e,(n=>{var r;r=`Loading data file "${e}" failed (no arrayBuffer).`,n||L(r),t(new Uint8Array(n)),a&&B()}),(t=>{if(!n)throw`Loading data file "${e}" failed.`;n()})),a&&F()},pe=a.preloadPlugins||[],fe=(e,t)=>{var n=0;return e&&(n|=365),t&&(n|=146),n},he={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(e,t={}){if(!(e=te.resolve(e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new he.ErrnoError(32);for(var n=e.split("/").filter((e=>!!e)),r=he.root,a="/",s=0;s<n.length;s++){var o=s===n.length-1;if(o&&t.parent)break;if(r=he.lookupNode(r,n[s]),a=Z.join2(a,n[s]),he.isMountpoint(r)&&(!o||o&&t.follow_mount)&&(r=r.mounted.root),!o||t.follow)for(var i=0;he.isLink(r.mode);){var u=he.readlink(a);if(a=te.resolve(Z.dirname(a),u),r=he.lookupPath(a,{recurse_count:t.recurse_count+1}).node,i++>40)throw new he.ErrnoError(32)}}return{path:a,node:r}},getPath(e){for(var t;;){if(he.isRoot(e)){var n=e.mount.mountpoint;return t?"/"!==n[n.length-1]?`${n}/${t}`:n+t:n}t=t?`${e.name}/${t}`:e.name,e=e.parent}},hashName(e,t){for(var n=0,r=0;r<t.length;r++)n=(n<<5)-n+t.charCodeAt(r)|0;return(e+n>>>0)%he.nameTable.length},hashAddNode(e){var t=he.hashName(e.parent.id,e.name);e.name_next=he.nameTable[t],he.nameTable[t]=e},hashRemoveNode(e){var t=he.hashName(e.parent.id,e.name);if(he.nameTable[t]===e)he.nameTable[t]=e.name_next;else for(var n=he.nameTable[t];n;){if(n.name_next===e){n.name_next=e.name_next;break}n=n.name_next}},lookupNode(e,t){var n=he.mayLookup(e);if(n)throw new he.ErrnoError(n,e);for(var r=he.hashName(e.id,t),a=he.nameTable[r];a;a=a.name_next){var s=a.name;if(a.parent.id===e.id&&s===t)return a}return he.lookup(e,t)},createNode(e,t,n,r){var a=new he.FSNode(e,t,n,r);return he.hashAddNode(a),a},destroyNode(e){he.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>49152==(49152&e),flagsToPermissionString(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>he.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup(e){var t=he.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate(e,t){try{return he.lookupNode(e,t),20}catch(e){}return he.nodePermissions(e,"wx")},mayDelete(e,t,n){var r;try{r=he.lookupNode(e,t)}catch(e){return e.errno}var a=he.nodePermissions(e,"wx");if(a)return a;if(n){if(!he.isDir(r.mode))return 54;if(he.isRoot(r)||he.getPath(r)===he.cwd())return 10}else if(he.isDir(r.mode))return 31;return 0},mayOpen:(e,t)=>e?he.isLink(e.mode)?32:he.isDir(e.mode)&&("r"!==he.flagsToPermissionString(t)||512&t)?31:he.nodePermissions(e,he.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=he.MAX_OPEN_FDS;e++)if(!he.streams[e])return e;throw new he.ErrnoError(33)},getStreamChecked(e){var t=he.getStream(e);if(!t)throw new he.ErrnoError(8);return t},getStream:e=>he.streams[e],createStream:(e,t=-1)=>(he.FSStream||(he.FSStream=function(){this.shared={}},he.FSStream.prototype={},Object.defineProperties(he.FSStream.prototype,{object:{get(){return this.node},set(e){this.node=e}},isRead:{get(){return 1!=(2097155&this.flags)}},isWrite:{get(){return 0!=(2097155&this.flags)}},isAppend:{get(){return 1024&this.flags}},flags:{get(){return this.shared.flags},set(e){this.shared.flags=e}},position:{get(){return this.shared.position},set(e){this.shared.position=e}}})),e=Object.assign(new he.FSStream,e),-1==t&&(t=he.nextfd()),e.fd=t,he.streams[t]=e,e),closeStream(e){he.streams[e]=null},chrdev_stream_ops:{open(e){var t=he.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek(){throw new he.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice(e,t){he.devices[e]={stream_ops:t}},getDevice:e=>he.devices[e],getMounts(e){for(var t=[],n=[e];n.length;){var r=n.pop();t.push(r),n.push.apply(n,r.mounts)}return t},syncfs(e,t){"function"==typeof e&&(t=e,e=!1),he.syncFSRequests++,he.syncFSRequests>1&&h(`warning: ${he.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var n=he.getMounts(he.root.mount),r=0;function a(e){return he.syncFSRequests--,t(e)}function s(e){if(e)return s.errored?void 0:(s.errored=!0,a(e));++r>=n.length&&a(null)}n.forEach((t=>{if(!t.type.syncfs)return s(null);t.type.syncfs(t,e,s)}))},mount(e,t,n){var r,a="/"===n,s=!n;if(a&&he.root)throw new he.ErrnoError(10);if(!a&&!s){var o=he.lookupPath(n,{follow_mount:!1});if(n=o.path,r=o.node,he.isMountpoint(r))throw new he.ErrnoError(10);if(!he.isDir(r.mode))throw new he.ErrnoError(54)}var i={type:e,opts:t,mountpoint:n,mounts:[]},u=e.mount(i);return u.mount=i,i.root=u,a?he.root=u:r&&(r.mounted=i,r.mount&&r.mount.mounts.push(i)),u},unmount(e){var t=he.lookupPath(e,{follow_mount:!1});if(!he.isMountpoint(t.node))throw new he.ErrnoError(28);var n=t.node,r=n.mounted,a=he.getMounts(r);Object.keys(he.nameTable).forEach((e=>{for(var t=he.nameTable[e];t;){var n=t.name_next;a.includes(t.mount)&&he.destroyNode(t),t=n}})),n.mounted=null;var s=n.mount.mounts.indexOf(r);n.mount.mounts.splice(s,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod(e,t,n){var r=he.lookupPath(e,{parent:!0}).node,a=Z.basename(e);if(!a||"."===a||".."===a)throw new he.ErrnoError(28);var s=he.mayCreate(r,a);if(s)throw new he.ErrnoError(s);if(!r.node_ops.mknod)throw new he.ErrnoError(63);return r.node_ops.mknod(r,a,t,n)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,he.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,he.mknod(e,t,0)),mkdirTree(e,t){for(var n=e.split("/"),r="",a=0;a<n.length;++a)if(n[a]){r+="/"+n[a];try{he.mkdir(r,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,n)=>("undefined"==typeof n&&(n=t,t=438),t|=8192,he.mknod(e,t,n)),symlink(e,t){if(!te.resolve(e))throw new he.ErrnoError(44);var n=he.lookupPath(t,{parent:!0}).node;if(!n)throw new he.ErrnoError(44);var r=Z.basename(t),a=he.mayCreate(n,r);if(a)throw new he.ErrnoError(a);if(!n.node_ops.symlink)throw new he.ErrnoError(63);return n.node_ops.symlink(n,r,e)},rename(e,t){var n,r,a=Z.dirname(e),s=Z.dirname(t),o=Z.basename(e),i=Z.basename(t);if(n=he.lookupPath(e,{parent:!0}).node,r=he.lookupPath(t,{parent:!0}).node,!n||!r)throw new he.ErrnoError(44);if(n.mount!==r.mount)throw new he.ErrnoError(75);var u,c=he.lookupNode(n,o),l=te.relative(e,s);if("."!==l.charAt(0))throw new he.ErrnoError(28);if("."!==(l=te.relative(t,a)).charAt(0))throw new he.ErrnoError(55);try{u=he.lookupNode(r,i)}catch(e){}if(c!==u){var d=he.isDir(c.mode),p=he.mayDelete(n,o,d);if(p)throw new he.ErrnoError(p);if(p=u?he.mayDelete(r,i,d):he.mayCreate(r,i))throw new he.ErrnoError(p);if(!n.node_ops.rename)throw new he.ErrnoError(63);if(he.isMountpoint(c)||u&&he.isMountpoint(u))throw new he.ErrnoError(10);if(r!==n&&(p=he.nodePermissions(n,"w")))throw new he.ErrnoError(p);he.hashRemoveNode(c);try{n.node_ops.rename(c,r,i)}catch(e){throw e}finally{he.hashAddNode(c)}}},rmdir(e){var t=he.lookupPath(e,{parent:!0}).node,n=Z.basename(e),r=he.lookupNode(t,n),a=he.mayDelete(t,n,!0);if(a)throw new he.ErrnoError(a);if(!t.node_ops.rmdir)throw new he.ErrnoError(63);if(he.isMountpoint(r))throw new he.ErrnoError(10);t.node_ops.rmdir(t,n),he.destroyNode(r)},readdir(e){var t=he.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new he.ErrnoError(54);return t.node_ops.readdir(t)},unlink(e){var t=he.lookupPath(e,{parent:!0}).node;if(!t)throw new he.ErrnoError(44);var n=Z.basename(e),r=he.lookupNode(t,n),a=he.mayDelete(t,n,!1);if(a)throw new he.ErrnoError(a);if(!t.node_ops.unlink)throw new he.ErrnoError(63);if(he.isMountpoint(r))throw new he.ErrnoError(10);t.node_ops.unlink(t,n),he.destroyNode(r)},readlink(e){var t=he.lookupPath(e).node;if(!t)throw new he.ErrnoError(44);if(!t.node_ops.readlink)throw new he.ErrnoError(28);return te.resolve(he.getPath(t.parent),t.node_ops.readlink(t))},stat(e,t){var n=he.lookupPath(e,{follow:!t}).node;if(!n)throw new he.ErrnoError(44);if(!n.node_ops.getattr)throw new he.ErrnoError(63);return n.node_ops.getattr(n)},lstat:e=>he.stat(e,!0),chmod(e,t,n){var r;if(!(r="string"==typeof e?he.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new he.ErrnoError(63);r.node_ops.setattr(r,{mode:4095&t|-4096&r.mode,timestamp:Date.now()})},lchmod(e,t){he.chmod(e,t,!0)},fchmod(e,t){var n=he.getStreamChecked(e);he.chmod(n.node,t)},chown(e,t,n,r){var a;if(!(a="string"==typeof e?he.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new he.ErrnoError(63);a.node_ops.setattr(a,{timestamp:Date.now()})},lchown(e,t,n){he.chown(e,t,n,!0)},fchown(e,t,n){var r=he.getStreamChecked(e);he.chown(r.node,t,n)},truncate(e,t){if(t<0)throw new he.ErrnoError(28);var n;if(!(n="string"==typeof e?he.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new he.ErrnoError(63);if(he.isDir(n.mode))throw new he.ErrnoError(31);if(!he.isFile(n.mode))throw new he.ErrnoError(28);var r=he.nodePermissions(n,"w");if(r)throw new he.ErrnoError(r);n.node_ops.setattr(n,{size:t,timestamp:Date.now()})},ftruncate(e,t){var n=he.getStreamChecked(e);if(0==(2097155&n.flags))throw new he.ErrnoError(28);he.truncate(n.node,t)},utime(e,t,n){var r=he.lookupPath(e,{follow:!0}).node;r.node_ops.setattr(r,{timestamp:Math.max(t,n)})},open(e,t,n){if(""===e)throw new he.ErrnoError(44);var r;if(n="undefined"==typeof n?438:n,n=64&(t="string"==typeof t?(e=>{var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if("undefined"==typeof t)throw new Error(`Unknown file open mode: ${e}`);return t})(t):t)?4095&n|32768:0,"object"==typeof e)r=e;else{e=Z.normalize(e);try{r=he.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var s=!1;if(64&t)if(r){if(128&t)throw new he.ErrnoError(20)}else r=he.mknod(e,n,0),s=!0;if(!r)throw new he.ErrnoError(44);if(he.isChrdev(r.mode)&&(t&=-513),65536&t&&!he.isDir(r.mode))throw new he.ErrnoError(54);if(!s){var o=he.mayOpen(r,t);if(o)throw new he.ErrnoError(o)}512&t&&!s&&he.truncate(r,0),t&=-131713;var i=he.createStream({node:r,path:he.getPath(r),flags:t,seekable:!0,position:0,stream_ops:r.stream_ops,ungotten:[],error:!1});return i.stream_ops.open&&i.stream_ops.open(i),!a.logReadFiles||1&t||(he.readFiles||(he.readFiles={}),e in he.readFiles||(he.readFiles[e]=1)),i},close(e){if(he.isClosed(e))throw new he.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{he.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,t,n){if(he.isClosed(e))throw new he.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new he.ErrnoError(70);if(0!=n&&1!=n&&2!=n)throw new he.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,n),e.ungotten=[],e.position},read(e,t,n,r,a){if(r<0||a<0)throw new he.ErrnoError(28);if(he.isClosed(e))throw new he.ErrnoError(8);if(1==(2097155&e.flags))throw new he.ErrnoError(8);if(he.isDir(e.node.mode))throw new he.ErrnoError(31);if(!e.stream_ops.read)throw new he.ErrnoError(28);var s="undefined"!=typeof a;if(s){if(!e.seekable)throw new he.ErrnoError(70)}else a=e.position;var o=e.stream_ops.read(e,t,n,r,a);return s||(e.position+=o),o},write(e,t,n,r,a,s){if(r<0||a<0)throw new he.ErrnoError(28);if(he.isClosed(e))throw new he.ErrnoError(8);if(0==(2097155&e.flags))throw new he.ErrnoError(8);if(he.isDir(e.node.mode))throw new he.ErrnoError(31);if(!e.stream_ops.write)throw new he.ErrnoError(28);e.seekable&&1024&e.flags&&he.llseek(e,0,2);var o="undefined"!=typeof a;if(o){if(!e.seekable)throw new he.ErrnoError(70)}else a=e.position;var i=e.stream_ops.write(e,t,n,r,a,s);return o||(e.position+=i),i},allocate(e,t,n){if(he.isClosed(e))throw new he.ErrnoError(8);if(t<0||n<=0)throw new he.ErrnoError(28);if(0==(2097155&e.flags))throw new he.ErrnoError(8);if(!he.isFile(e.node.mode)&&!he.isDir(e.node.mode))throw new he.ErrnoError(43);if(!e.stream_ops.allocate)throw new he.ErrnoError(138);e.stream_ops.allocate(e,t,n)},mmap(e,t,n,r,a){if(0!=(2&r)&&0==(2&a)&&2!=(2097155&e.flags))throw new he.ErrnoError(2);if(1==(2097155&e.flags))throw new he.ErrnoError(2);if(!e.stream_ops.mmap)throw new he.ErrnoError(43);return e.stream_ops.mmap(e,t,n,r,a)},msync:(e,t,n,r,a)=>e.stream_ops.msync?e.stream_ops.msync(e,t,n,r,a):0,munmap:e=>0,ioctl(e,t,n){if(!e.stream_ops.ioctl)throw new he.ErrnoError(59);return e.stream_ops.ioctl(e,t,n)},readFile(e,t={}){if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error(`Invalid encoding type "${t.encoding}"`);var n,r=he.open(e,t.flags),a=he.stat(e).size,s=new Uint8Array(a);return he.read(r,s,0,a,0),"utf8"===t.encoding?n=re(s,0):"binary"===t.encoding&&(n=s),he.close(r),n},writeFile(e,t,n={}){n.flags=n.flags||577;var r=he.open(e,n.flags,n.mode);if("string"==typeof t){var a=new Uint8Array(se(t)+1),s=oe(t,a,0,a.length);he.write(r,a,0,s,void 0,n.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");he.write(r,t,0,t.byteLength,void 0,n.canOwn)}he.close(r)},cwd:()=>he.currentPath,chdir(e){var t=he.lookupPath(e,{follow:!0});if(null===t.node)throw new he.ErrnoError(44);if(!he.isDir(t.node.mode))throw new he.ErrnoError(54);var n=he.nodePermissions(t.node,"x");if(n)throw new he.ErrnoError(n);he.currentPath=t.path},createDefaultDirectories(){he.mkdir("/tmp"),he.mkdir("/home"),he.mkdir("/home/web_user")},createDefaultDevices(){he.mkdir("/dev"),he.registerDevice(he.makedev(1,3),{read:()=>0,write:(e,t,n,r,a)=>r}),he.mkdev("/dev/null",he.makedev(1,3)),ue.register(he.makedev(5,0),ue.default_tty_ops),ue.register(he.makedev(6,0),ue.default_tty1_ops),he.mkdev("/dev/tty",he.makedev(5,0)),he.mkdev("/dev/tty1",he.makedev(6,0));var e=new Uint8Array(1024),t=0,n=()=>(0===t&&(t=ee(e).byteLength),e[--t]);he.createDevice("/dev","random",n),he.createDevice("/dev","urandom",n),he.mkdir("/dev/shm"),he.mkdir("/dev/shm/tmp")},createSpecialDirectories(){he.mkdir("/proc");var e=he.mkdir("/proc/self");he.mkdir("/proc/self/fd"),he.mount({mount(){var t=he.createNode(e,"fd",16895,73);return t.node_ops={lookup(e,t){var n=+t,r=he.getStreamChecked(n),a={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>r.path}};return a.parent=a,a}},t}},{},"/proc/self/fd")},createStandardStreams(){a.stdin?he.createDevice("/dev","stdin",a.stdin):he.symlink("/dev/tty","/dev/stdin"),a.stdout?he.createDevice("/dev","stdout",null,a.stdout):he.symlink("/dev/tty","/dev/stdout"),a.stderr?he.createDevice("/dev","stderr",null,a.stderr):he.symlink("/dev/tty1","/dev/stderr"),he.open("/dev/stdin",0),he.open("/dev/stdout",1),he.open("/dev/stderr",1)},ensureErrnoError(){he.ErrnoError||(he.ErrnoError=function(e,t){this.name="ErrnoError",this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},he.ErrnoError.prototype=new Error,he.ErrnoError.prototype.constructor=he.ErrnoError,[44].forEach((e=>{he.genericErrors[e]=new he.ErrnoError(e),he.genericErrors[e].stack="<generic error, no stack>"})))},staticInit(){he.ensureErrnoError(),he.nameTable=new Array(4096),he.mount(le,{},"/"),he.createDefaultDirectories(),he.createDefaultDevices(),he.createSpecialDirectories(),he.filesystems={MEMFS:le}},init(e,t,n){he.init.initialized=!0,he.ensureErrnoError(),a.stdin=e||a.stdin,a.stdout=t||a.stdout,a.stderr=n||a.stderr,he.createStandardStreams()},quit(){he.init.initialized=!1;for(var e=0;e<he.streams.length;e++){var t=he.streams[e];t&&he.close(t)}},findObject(e,t){var n=he.analyzePath(e,t);return n.exists?n.object:null},analyzePath(e,t){try{e=(r=he.lookupPath(e,{follow:!t})).path}catch(e){}var n={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var r=he.lookupPath(e,{parent:!0});n.parentExists=!0,n.parentPath=r.path,n.parentObject=r.node,n.name=Z.basename(e),r=he.lookupPath(e,{follow:!t}),n.exists=!0,n.path=r.path,n.object=r.node,n.name=r.node.name,n.isRoot="/"===r.path}catch(e){n.error=e.errno}return n},createPath(e,t,n,r){e="string"==typeof e?e:he.getPath(e);for(var a=t.split("/").reverse();a.length;){var s=a.pop();if(s){var o=Z.join2(e,s);try{he.mkdir(o)}catch(e){}e=o}}return o},createFile(e,t,n,r,a){var s=Z.join2("string"==typeof e?e:he.getPath(e),t),o=fe(r,a);return he.create(s,o)},createDataFile(e,t,n,r,a,s){var o=t;e&&(e="string"==typeof e?e:he.getPath(e),o=t?Z.join2(e,t):e);var i=fe(r,a),u=he.create(o,i);if(n){if("string"==typeof n){for(var c=new Array(n.length),l=0,d=n.length;l<d;++l)c[l]=n.charCodeAt(l);n=c}he.chmod(u,146|i);var p=he.open(u,577);he.write(p,n,0,n.length,0,s),he.close(p),he.chmod(u,i)}return u},createDevice(e,t,n,r){var a=Z.join2("string"==typeof e?e:he.getPath(e),t),s=fe(!!n,!!r);he.createDevice.major||(he.createDevice.major=64);var o=he.makedev(he.createDevice.major++,0);return he.registerDevice(o,{open(e){e.seekable=!1},close(e){r&&r.buffer&&r.buffer.length&&r(10)},read(e,t,r,a,s){for(var o=0,i=0;i<a;i++){var u;try{u=n()}catch(e){throw new he.ErrnoError(29)}if(void 0===u&&0===o)throw new he.ErrnoError(6);if(null==u)break;o++,t[r+i]=u}return o&&(e.node.timestamp=Date.now()),o},write(e,t,n,a,s){for(var o=0;o<a;o++)try{r(t[n+o])}catch(e){throw new he.ErrnoError(29)}return a&&(e.node.timestamp=Date.now()),o}}),he.mkdev(a,s,o)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!s)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=ie(s(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new he.ErrnoError(29)}},createLazyFile(e,t,n,r,a){function s(){this.lengthKnown=!1,this.chunks=[]}if(s.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,n=e/this.chunkSize|0;return this.getter(n)[t]}},s.prototype.setDataGetter=function(e){this.getter=e},s.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",n,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+n+". Status: "+e.status);var t,r=Number(e.getResponseHeader("Content-length")),a=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,s=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,o=1048576;a||(o=r);var i=this;i.setDataGetter((e=>{var t=e*o,a=(e+1)*o-1;if(a=Math.min(a,r-1),"undefined"==typeof i.chunks[e]&&(i.chunks[e]=((e,t)=>{if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>r-1)throw new Error("only "+r+" bytes available! programmer error!");var a=new XMLHttpRequest;if(a.open("GET",n,!1),r!==o&&a.setRequestHeader("Range","bytes="+e+"-"+t),a.responseType="arraybuffer",a.overrideMimeType&&a.overrideMimeType("text/plain; charset=x-user-defined"),a.send(null),!(a.status>=200&&a.status<300||304===a.status))throw new Error("Couldn't load "+n+". Status: "+a.status);return void 0!==a.response?new Uint8Array(a.response||[]):ie(a.responseText||"",!0)})(t,a)),"undefined"==typeof i.chunks[e])throw new Error("doXHR failed!");return i.chunks[e]})),!s&&r||(o=r=1,r=this.getter(0).length,o=r,f("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=r,this._chunkSize=o,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){var o=new s;Object.defineProperties(o,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var i={isDevice:!1,contents:o}}else i={isDevice:!1,url:n};var u=he.createFile(e,t,i,r,a);i.contents?u.contents=i.contents:i.url&&(u.contents=null,u.url=i.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var c={};function l(e,t,n,r,a){var s=e.node.contents;if(a>=s.length)return 0;var o=Math.min(s.length-a,r);if(s.slice)for(var i=0;i<o;i++)t[n+i]=s[a+i];else for(i=0;i<o;i++)t[n+i]=s.get(a+i);return o}return Object.keys(u.stream_ops).forEach((e=>{var t=u.stream_ops[e];c[e]=function(){return he.forceLoadFile(u),t.apply(null,arguments)}})),c.read=(e,t,n,r,a)=>(he.forceLoadFile(u),l(e,t,n,r,a)),c.mmap=(e,t,n,r,a)=>{he.forceLoadFile(u);var s=ce(t);if(!s)throw new he.ErrnoError(48);return l(e,g,s,t,n),{ptr:s,allocated:!0}},u.stream_ops=c,u}},me=(e,t)=>e?re(y,e,t):"",be={DEFAULT_POLLMASK:5,calculateAt(e,t,n){if(Z.isAbs(t))return t;var r;if(r=-100===e?he.cwd():be.getStreamFromFD(e).path,0==t.length){if(!n)throw new he.ErrnoError(44);return r}return Z.join2(r,t)},doStat(e,t,n){try{var r=e(t)}catch(e){if(e&&e.node&&Z.normalize(t)!==Z.normalize(he.getPath(e.node)))return-54;throw e}v[n>>2]=r.dev,v[n+4>>2]=r.mode,j[n+8>>2]=r.nlink,v[n+12>>2]=r.uid,v[n+16>>2]=r.gid,v[n+20>>2]=r.rdev,M=[r.size>>>0,(A=r.size,+Math.abs(A)>=1?A>0?+Math.floor(A/4294967296)>>>0:~~+Math.ceil((A-+(~~A>>>0))/4294967296)>>>0:0)],v[n+24>>2]=M[0],v[n+28>>2]=M[1],v[n+32>>2]=4096,v[n+36>>2]=r.blocks;var a=r.atime.getTime(),s=r.mtime.getTime(),o=r.ctime.getTime();return M=[Math.floor(a/1e3)>>>0,(A=Math.floor(a/1e3),+Math.abs(A)>=1?A>0?+Math.floor(A/4294967296)>>>0:~~+Math.ceil((A-+(~~A>>>0))/4294967296)>>>0:0)],v[n+40>>2]=M[0],v[n+44>>2]=M[1],j[n+48>>2]=a%1e3*1e3,M=[Math.floor(s/1e3)>>>0,(A=Math.floor(s/1e3),+Math.abs(A)>=1?A>0?+Math.floor(A/4294967296)>>>0:~~+Math.ceil((A-+(~~A>>>0))/4294967296)>>>0:0)],v[n+56>>2]=M[0],v[n+60>>2]=M[1],j[n+64>>2]=s%1e3*1e3,M=[Math.floor(o/1e3)>>>0,(A=Math.floor(o/1e3),+Math.abs(A)>=1?A>0?+Math.floor(A/4294967296)>>>0:~~+Math.ceil((A-+(~~A>>>0))/4294967296)>>>0:0)],v[n+72>>2]=M[0],v[n+76>>2]=M[1],j[n+80>>2]=o%1e3*1e3,M=[r.ino>>>0,(A=r.ino,+Math.abs(A)>=1?A>0?+Math.floor(A/4294967296)>>>0:~~+Math.ceil((A-+(~~A>>>0))/4294967296)>>>0:0)],v[n+88>>2]=M[0],v[n+92>>2]=M[1],0},doMsync(e,t,n,r,a){if(!he.isFile(t.node.mode))throw new he.ErrnoError(43);if(2&r)return 0;var s=y.slice(e,e+n);he.msync(t,s,a,n,r)},varargs:void 0,get(){var e=v[be.varargs>>2];return be.varargs+=4,e},getp:()=>be.get(),getStr:e=>me(e),getStreamFromFD:e=>he.getStreamChecked(e)},ge={},ye=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function we(e){return this.fromWireType(v[e>>2])}var Oe={},ve={},je={},_e=void 0,Se=e=>{throw new _e(e)},ke=(e,t,n)=>{function r(t){var r=n(t);r.length!==e.length&&Se("Mismatched type converter count");for(var a=0;a<e.length;++a)Me(e[a],r[a])}e.forEach((function(e){je[e]=t}));var a=new Array(t.length),s=[],o=0;t.forEach(((e,t)=>{ve.hasOwnProperty(e)?a[t]=ve[e]:(s.push(e),Oe.hasOwnProperty(e)||(Oe[e]=[]),Oe[e].push((()=>{a[t]=ve[e],++o===s.length&&r(a)})))})),0===s.length&&r(a)},xe={},Ee=void 0,Te=e=>{for(var t="",n=e;y[n];)t+=Ee[y[n++]];return t},Ne=void 0,Ae=e=>{throw new Ne(e)};function Me(e,t,n={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(e,t,n={}){var r=t.name;if(e||Ae(`type "${r}" must have a positive integer typeid pointer`),ve.hasOwnProperty(e)){if(n.ignoreDuplicateRegistrations)return;Ae(`Cannot register type '${r}' twice`)}if(ve[e]=t,delete je[e],Oe.hasOwnProperty(e)){var a=Oe[e];delete Oe[e],a.forEach((e=>e()))}}(e,t,n)}var Ie=8;function De(e){if(!(this instanceof tt))return!1;if(!(e instanceof tt))return!1;for(var t=this.$$.ptrType.registeredClass,n=this.$$.ptr,r=e.$$.ptrType.registeredClass,a=e.$$.ptr;t.baseClass;)n=t.upcast(n),t=t.baseClass;for(;r.baseClass;)a=r.upcast(a),r=r.baseClass;return t===r&&n===a}var $e=e=>{Ae(e.$$.ptrType.registeredClass.name+" instance already deleted")},Ce=!1,Re=e=>{},Pe=e=>{e.count.value-=1,0===e.count.value&&(e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)})(e)},Fe=(e,t,n)=>{if(t===n)return e;if(void 0===n.baseClass)return null;var r=Fe(e,t,n.baseClass);return null===r?null:n.downcast(r)},Be={},Le=()=>Object.keys(qe).length,ze=()=>{var e=[];for(var t in qe)qe.hasOwnProperty(t)&&e.push(qe[t]);return e},We=[],Ue=()=>{for(;We.length;){var e=We.pop();e.$$.deleteScheduled=!1,e.delete()}},Ve=void 0,Ge=e=>{Ve=e,We.length&&Ve&&Ve(Ue)},qe={},He=(e,t)=>(t=((e,t)=>{for(void 0===t&&Ae("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t})(e,t),qe[t]),Ke=(e,t)=>(t.ptrType&&t.ptr||Se("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&Se("Both smartPtrType and smartPtr must be specified"),t.count={value:1},Je(Object.create(e,{$$:{value:t}})));function Ye(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var n=He(this.registeredClass,t);if(void 0!==n){if(0===n.$$.count.value)return n.$$.ptr=t,n.$$.smartPtr=e,n.clone();var r=n.clone();return this.destructor(e),r}function a(){return this.isSmartPointer?Ke(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):Ke(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var s,o=this.registeredClass.getActualType(t),i=Be[o];if(!i)return a.call(this);s=this.isConst?i.constPointerType:i.pointerType;var u=Fe(t,this.registeredClass,s.registeredClass);return null===u?a.call(this):this.isSmartPointer?Ke(s.registeredClass.instancePrototype,{ptrType:s,ptr:u,smartPtrType:this,smartPtr:e}):Ke(s.registeredClass.instancePrototype,{ptrType:s,ptr:u})}var Je=e=>"undefined"==typeof FinalizationRegistry?(Je=e=>e,e):(Ce=new FinalizationRegistry((e=>{Pe(e.$$)})),Je=e=>{var t=e.$$;if(t.smartPtr){var n={$$:t};Ce.register(e,n,e)}return e},Re=e=>Ce.unregister(e),Je(e));function Xe(){if(this.$$.ptr||$e(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=Je(Object.create(Object.getPrototypeOf(this),{$$:{value:(e=this.$$,{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType})}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t}function Qe(){this.$$.ptr||$e(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Ae("Object already scheduled for deletion"),Re(this),Pe(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function Ze(){return!this.$$.ptr}function et(){return this.$$.ptr||$e(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Ae("Object already scheduled for deletion"),We.push(this),1===We.length&&Ve&&Ve(Ue),this.$$.deleteScheduled=!0,this}function tt(){}var nt=e=>{if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=48&&t<=57?`_${e}`:e};function rt(e,t){return{[e=nt(e)]:function(){return t.apply(this,arguments)}}[e]}var at=(e,t,n)=>{if(void 0===e[t].overloadTable){var r=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||Ae(`Function '${n}' called with an invalid number of arguments (${arguments.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[r.argCount]=r}},st=(e,t,n)=>{a.hasOwnProperty(e)?((void 0===n||void 0!==a[e].overloadTable&&void 0!==a[e].overloadTable[n])&&Ae(`Cannot register public name '${e}' twice`),at(a,e,e),a.hasOwnProperty(n)&&Ae(`Cannot register multiple overloads of a function with the same number of arguments (${n})!`),a[e].overloadTable[n]=t):(a[e]=t,void 0!==n&&(a[e].numArguments=n))};function ot(e,t,n,r,a,s,o,i){this.name=e,this.constructor=t,this.instancePrototype=n,this.rawDestructor=r,this.baseClass=a,this.getActualType=s,this.upcast=o,this.downcast=i,this.pureVirtualFunctions=[]}var it=(e,t,n)=>{for(;t!==n;)t.upcast||Ae(`Expected null or instance of ${n.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e};function ut(e,t){if(null===t)return this.isReference&&Ae(`null is not a valid ${this.name}`),0;t.$$||Ae(`Cannot pass "${Rt(t)}" as a ${this.name}`),t.$$.ptr||Ae(`Cannot pass deleted object as a pointer of type ${this.name}`);var n=t.$$.ptrType.registeredClass;return it(t.$$.ptr,n,this.registeredClass)}function ct(e,t){var n;if(null===t)return this.isReference&&Ae(`null is not a valid ${this.name}`),this.isSmartPointer?(n=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,n),n):0;t.$$||Ae(`Cannot pass "${Rt(t)}" as a ${this.name}`),t.$$.ptr||Ae(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&Ae(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass;if(n=it(t.$$.ptr,r,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&Ae("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?n=t.$$.smartPtr:Ae(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:n=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)n=t.$$.smartPtr;else{var a=t.clone();n=this.rawShare(n,Dt.toHandle((()=>a.delete()))),null!==e&&e.push(this.rawDestructor,n)}break;default:Ae("Unsupporting sharing policy")}return n}function lt(e,t){if(null===t)return this.isReference&&Ae(`null is not a valid ${this.name}`),0;t.$$||Ae(`Cannot pass "${Rt(t)}" as a ${this.name}`),t.$$.ptr||Ae(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&Ae(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var n=t.$$.ptrType.registeredClass;return it(t.$$.ptr,n,this.registeredClass)}function dt(e){return this.fromWireType(j[e>>2])}function pt(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e}function ft(e){this.rawDestructor&&this.rawDestructor(e)}var ht=e=>{null!==e&&e.delete()};function mt(e,t,n,r,a,s,o,i,u,c,l){this.name=e,this.registeredClass=t,this.isReference=n,this.isConst=r,this.isSmartPointer=a,this.pointeeType=s,this.sharingPolicy=o,this.rawGetPointee=i,this.rawConstructor=u,this.rawShare=c,this.rawDestructor=l,a||void 0!==t.baseClass?this.toWireType=ct:r?(this.toWireType=ut,this.destructorFunction=null):(this.toWireType=lt,this.destructorFunction=null)}var bt=(e,t,n)=>{a.hasOwnProperty(e)||Se("Replacing nonexistant public symbol"),void 0!==a[e].overloadTable&&void 0!==n?a[e].overloadTable[n]=t:(a[e]=t,a[e].argCount=n)},gt=[],yt=e=>{var t=gt[e];return t||(e>=gt.length&&(gt.length=e+1),gt[e]=t=k.get(e)),t},wt=(e,t,n)=>e.includes("j")?((e,t,n)=>{var r=a["dynCall_"+e];return n&&n.length?r.apply(null,[t].concat(n)):r.call(null,t)})(e,t,n):yt(t).apply(null,n),Ot=(e,t)=>{var n,r,a,s=(e=Te(e)).includes("j")?(n=e,r=t,a=[],function(){return a.length=0,Object.assign(a,arguments),wt(n,r,a)}):yt(t);return"function"!=typeof s&&Ae(`unknown function pointer with signature ${e}: ${t}`),s},vt=void 0,jt=e=>{var t=Tn(e),n=Te(t);return kn(t),n},_t=(e,t)=>{var n=[],r={};throw t.forEach((function e(t){r[t]||ve[t]||(je[t]?je[t].forEach(e):(n.push(t),r[t]=!0))})),new vt(`${e}: `+n.map(jt).join([", "]))},St=(e,t)=>{for(var n=[],r=0;r<e;r++)n.push(j[t+4*r>>2]);return n};function kt(e,t){if(!(e instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof e} which is not a function`);var n=rt(e.name||"unknownFunctionName",(function(){}));n.prototype=e.prototype;var r=new n,a=e.apply(r,t);return a instanceof Object?a:r}function xt(e,t,n,r,a,s){var o=t.length;o<2&&Ae("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var i=null!==t[1]&&null!==n,u=!1,c=1;c<t.length;++c)if(null!==t[c]&&void 0===t[c].destructorFunction){u=!0;break}var l="void"!==t[0].name,d="",p="";for(c=0;c<o-2;++c)d+=(0!==c?", ":"")+"arg"+c,p+=(0!==c?", ":"")+"arg"+c+"Wired";var f=`\n return function ${nt(e)}(${d}) {\n if (arguments.length !== ${o-2}) {\n throwBindingError('function ${e} called with ' + arguments.length + ' arguments, expected ${o-2}');\n }`;u&&(f+="var destructors = [];\n");var h=u?"destructors":"null",m=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],b=[Ae,r,a,ye,t[0],t[1]];for(i&&(f+="var thisWired = classParam.toWireType("+h+", this);\n"),c=0;c<o-2;++c)f+="var arg"+c+"Wired = argType"+c+".toWireType("+h+", arg"+c+"); // "+t[c+2].name+"\n",m.push("argType"+c),b.push(t[c+2]);if(i&&(p="thisWired"+(p.length>0?", ":"")+p),f+=(l||s?"var rv = ":"")+"invoker(fn"+(p.length>0?", ":"")+p+");\n",u)f+="runDestructors(destructors);\n";else for(c=i?1:2;c<t.length;++c){var g=1===c?"thisWired":"arg"+(c-2)+"Wired";null!==t[c].destructorFunction&&(f+=g+"_dtor("+g+"); // "+t[c].name+"\n",m.push(g+"_dtor"),b.push(t[c].destructorFunction))}return l&&(f+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),f+="}\n",m.push(f),kt(Function,m).apply(null,b)}var Et=(e,t,n)=>(e instanceof Object||Ae(`${n} with invalid "this": ${e}`),e instanceof t.registeredClass.constructor||Ae(`${n} incompatible with "this" of type ${e.constructor.name}`),e.$$.ptr||Ae(`cannot call emscripten binding method ${n} on deleted object`),it(e.$$.ptr,e.$$.ptrType.registeredClass,t.registeredClass));function Tt(){this.allocated=[void 0],this.freelist=[]}var Nt,At=new Tt,Mt=e=>{e>=At.reserved&&0==--At.get(e).refcount&&At.free(e)},It=()=>{for(var e=0,t=At.reserved;t<At.allocated.length;++t)void 0!==At.allocated[t]&&++e;return e},Dt={toValue:e=>(e||Ae("Cannot use deleted val. handle = "+e),At.get(e).value),toHandle:e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return At.allocate({refcount:1,value:e})}}},$t=(e,t,n)=>{switch(t){case 1:return n?function(e){return this.fromWireType(g[e>>0])}:function(e){return this.fromWireType(y[e>>0])};case 2:return n?function(e){return this.fromWireType(w[e>>1])}:function(e){return this.fromWireType(O[e>>1])};case 4:return n?function(e){return this.fromWireType(v[e>>2])}:function(e){return this.fromWireType(j[e>>2])};default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Ct=(e,t)=>{var n=ve[e];return void 0===n&&Ae(t+" has unknown type "+jt(e)),n},Rt=e=>{if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e},Pt=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(_[e>>2])};case 8:return function(e){return this.fromWireType(S[e>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},Ft=(e,t,n)=>{switch(t){case 1:return n?e=>g[e>>0]:e=>y[e>>0];case 2:return n?e=>w[e>>1]:e=>O[e>>1];case 4:return n?e=>v[e>>2]:e=>j[e>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Bt=(e,t,n)=>oe(e,y,t,n),Lt="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,zt=(e,t)=>{for(var n=e,r=n>>1,a=r+t/2;!(r>=a)&&O[r];)++r;if((n=r<<1)-e>32&&Lt)return Lt.decode(y.subarray(e,n));for(var s="",o=0;!(o>=t/2);++o){var i=w[e+2*o>>1];if(0==i)break;s+=String.fromCharCode(i)}return s},Wt=(e,t,n)=>{if(void 0===n&&(n=2147483647),n<2)return 0;for(var r=t,a=(n-=2)<2*e.length?n/2:e.length,s=0;s<a;++s){var o=e.charCodeAt(s);w[t>>1]=o,t+=2}return w[t>>1]=0,t-r},Ut=e=>2*e.length,Vt=(e,t)=>{for(var n=0,r="";!(n>=t/4);){var a=v[e+4*n>>2];if(0==a)break;if(++n,a>=65536){var s=a-65536;r+=String.fromCharCode(55296|s>>10,56320|1023&s)}else r+=String.fromCharCode(a)}return r},Gt=(e,t,n)=>{if(void 0===n&&(n=2147483647),n<4)return 0;for(var r=t,a=r+n-4,s=0;s<e.length;++s){var o=e.charCodeAt(s);if(o>=55296&&o<=57343&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++s)),v[t>>2]=o,(t+=4)+4>a)break}return v[t>>2]=0,t-r},qt=e=>{for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);r>=55296&&r<=57343&&++n,t+=4}return t},Ht={},Kt=e=>{var t=Ht[e];return void 0===t?Te(e):t},Yt=[],Jt=()=>"object"==typeof globalThis?globalThis:Function("return this")(),Xt=[],Qt=e=>e%4==0&&(e%100!=0||e%400==0),Zt=[0,31,60,91,121,152,182,213,244,274,305,335],en=[0,31,59,90,120,151,181,212,243,273,304,334],tn=(e,t)=>t+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*t:NaN,nn=e=>{var t=se(e)+1,n=Sn(t);return n&&Bt(e,n,t),n},rn=[],an=(e,t,n)=>{var r=((e,t)=>{var n;for(rn.length=0;n=y[e++];)t+=105!=n&&t%8?4:0,rn.push(105==n?v[t>>2]:S[t>>3]),t+=105==n?4:8;return rn})(t,n);return V[e].apply(null,r)};Nt=()=>performance.now();var sn,on,un,cn=e=>{var t=(e-m.buffer.byteLength+65535)/65536;try{return m.grow(t),E(),1}catch(e){}},ln={},dn=()=>{if(!dn.strings){var 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",_:c||"./this.program"};for(var t in ln)void 0===ln[t]?delete e[t]:e[t]=ln[t];var n=[];for(var t in e)n.push(`${t}=${e[t]}`);dn.strings=n}return dn.strings},pn=e=>{b||(a.onExit&&a.onExit(e),x=!0),l(e,new G(e))},fn=(e,t)=>{pn(e)},hn=[31,29,31,30,31,30,31,31,30,31,30,31],mn=[31,28,31,30,31,30,31,31,30,31,30,31],bn=(e,t,n,r)=>{var a=j[r+40>>2],s={tm_sec:v[r>>2],tm_min:v[r+4>>2],tm_hour:v[r+8>>2],tm_mday:v[r+12>>2],tm_mon:v[r+16>>2],tm_year:v[r+20>>2],tm_wday:v[r+24>>2],tm_yday:v[r+28>>2],tm_isdst:v[r+32>>2],tm_gmtoff:v[r+36>>2],tm_zone:a?me(a):""},o=me(n),i={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var u in i)o=o.replace(new RegExp(u,"g"),i[u]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],l=["January","February","March","April","May","June","July","August","September","October","November","December"];function d(e,t,n){for(var r="number"==typeof e?e.toString():e||"";r.length<t;)r=n[0]+r;return r}function p(e,t){return d(e,t,"0")}function f(e,t){function n(e){return e<0?-1:e>0?1:0}var r;return 0===(r=n(e.getFullYear()-t.getFullYear()))&&0===(r=n(e.getMonth()-t.getMonth()))&&(r=n(e.getDate()-t.getDate())),r}function h(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function m(e){var t=((e,t)=>{for(var n=new Date(e.getTime());t>0;){var r=Qt(n.getFullYear()),a=n.getMonth(),s=(r?hn:mn)[a];if(!(t>s-n.getDate()))return n.setDate(n.getDate()+t),n;t-=s-n.getDate()+1,n.setDate(1),a<11?n.setMonth(a+1):(n.setMonth(0),n.setFullYear(n.getFullYear()+1))}return n})(new Date(e.tm_year+1900,0,1),e.tm_yday),n=new Date(t.getFullYear(),0,4),r=new Date(t.getFullYear()+1,0,4),a=h(n),s=h(r);return f(a,t)<=0?f(s,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var b={"%a":e=>c[e.tm_wday].substring(0,3),"%A":e=>c[e.tm_wday],"%b":e=>l[e.tm_mon].substring(0,3),"%B":e=>l[e.tm_mon],"%C":e=>p((e.tm_year+1900)/100|0,2),"%d":e=>p(e.tm_mday,2),"%e":e=>d(e.tm_mday,2," "),"%g":e=>m(e).toString().substring(2),"%G":e=>m(e),"%H":e=>p(e.tm_hour,2),"%I":e=>{var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),p(t,2)},"%j":e=>p(e.tm_mday+((e,t)=>{for(var n=0,r=0;r<=t;n+=e[r++]);return n})(Qt(e.tm_year+1900)?hn:mn,e.tm_mon-1),3),"%m":e=>p(e.tm_mon+1,2),"%M":e=>p(e.tm_min,2),"%n":()=>"\n","%p":e=>e.tm_hour>=0&&e.tm_hour<12?"AM":"PM","%S":e=>p(e.tm_sec,2),"%t":()=>"\t","%u":e=>e.tm_wday||7,"%U":e=>{var t=e.tm_yday+7-e.tm_wday;return p(Math.floor(t/7),2)},"%V":e=>{var t=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&t++,t){if(53==t){var n=(e.tm_wday+371-e.tm_yday)%7;4==n||3==n&&Qt(e.tm_year)||(t=1)}}else{t=52;var r=(e.tm_wday+7-e.tm_yday-1)%7;(4==r||5==r&&Qt(e.tm_year%400-1))&&t++}return p(t,2)},"%w":e=>e.tm_wday,"%W":e=>{var t=e.tm_yday+7-(e.tm_wday+6)%7;return p(Math.floor(t/7),2)},"%y":e=>(e.tm_year+1900).toString().substring(2),"%Y":e=>e.tm_year+1900,"%z":e=>{var t=e.tm_gmtoff,n=t>=0;return t=(t=Math.abs(t)/60)/60*100+t%60,(n?"+":"-")+String("0000"+t).slice(-4)},"%Z":e=>e.tm_zone,"%%":()=>"%"};for(var u in o=o.replace(/%%/g,"\0\0"),b)o.includes(u)&&(o=o.replace(new RegExp(u,"g"),b[u](s)));var y,w,O=ie(o=o.replace(/\0\0/g,"%"),!1);return O.length>t?0:(y=O,w=e,g.set(y,w),O.length-1)},gn=nn,yn=function(e,t,n,r){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=he.nextInode++,this.name=t,this.mode=n,this.node_ops={},this.stream_ops={},this.rdev=r},wn=365,On=146;Object.defineProperties(yn.prototype,{read:{get:function(){return(this.mode&wn)===wn},set:function(e){e?this.mode|=wn:this.mode&=-366}},write:{get:function(){return(this.mode&On)===On},set:function(e){e?this.mode|=On:this.mode&=-147}},isFolder:{get:function(){return he.isDir(this.mode)}},isDevice:{get:function(){return he.isChrdev(this.mode)}}}),he.FSNode=yn,he.createPreloadedFile=(e,t,n,r,a,s,o,i,u,c)=>{var l=t?te.resolve(Z.join2(e,t)):e;function d(n){function d(n){c&&c(),i||he.createDataFile(e,t,n,r,a,u),s&&s(),B()}((e,t,n,r)=>{"undefined"!=typeof Browser&&Browser.init();var a=!1;return pe.forEach((s=>{a||s.canHandle(t)&&(s.handle(e,t,n,r),a=!0)})),a})(n,l,d,(()=>{o&&o(),B()}))||d(n)}F(),"string"==typeof n?de(n,(e=>d(e)),o):d(n)},he.staticInit(),_e=a.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},(()=>{for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);Ee=e})(),Ne=a.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},tt.prototype.isAliasOf=De,tt.prototype.clone=Xe,tt.prototype.delete=Qe,tt.prototype.isDeleted=Ze,tt.prototype.deleteLater=et,a.getInheritedInstanceCount=Le,a.getLiveInheritedInstances=ze,a.flushPendingDeletes=Ue,a.setDelayFunction=Ge,mt.prototype.getPointee=pt,mt.prototype.destructor=ft,mt.prototype.argPackAdvance=Ie,mt.prototype.readValueFromPointer=dt,mt.prototype.deleteObject=ht,mt.prototype.fromWireType=Ye,vt=a.UnboundTypeError=(sn=Error,(un=rt(on="UnboundTypeError",(function(e){this.name=on,this.message=e;var t=new Error(e).stack;void 0!==t&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))}))).prototype=Object.create(sn.prototype),un.prototype.constructor=un,un.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},un),Object.assign(Tt.prototype,{get(e){return this.allocated[e]},has(e){return void 0!==this.allocated[e]},allocate(e){var t=this.freelist.pop()||this.allocated.length;return this.allocated[t]=e,t},free(e){this.allocated[e]=void 0,this.freelist.push(e)}}),At.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),At.reserved=At.allocated.length,a.count_emval_handles=It;var vn,jn={r:e=>{var t=new J(e);return t.get_caught()||(t.set_caught(!0),K--),t.set_rethrown(!1),H.push(t),$n(t.excPtr),t.get_exception_ptr()},lb:()=>{if(!H.length)return 0;var e=H[H.length-1];return $n(e.excPtr),e.excPtr},s:()=>{An(0,0);var e=H.pop();Dn(e.excPtr),Y=0},a:()=>X([]),f:e=>X([e]),o:(e,t)=>X([e,t]),ma:Q,kb:e=>{if(e){var t=new J(e);H.push(t),t.set_rethrown(!0),Q()}},p:(e,t,n)=>{throw new J(e).init(t,n),K++,Y=e},mb:()=>K,c:e=>{throw Y||(Y=e),Y},rb:function(e,t,n,r,a){try{for(var s=0,o=t?v[t>>2]:0,i=t?v[t+4>>2]:0,u=n?v[n>>2]:0,c=n?v[n+4>>2]:0,l=r?v[r>>2]:0,d=r?v[r+4>>2]:0,p=0,f=0,h=0,m=0,b=0,g=0,y=(t?v[t>>2]:0)|(n?v[n>>2]:0)|(r?v[r>>2]:0),w=(t?v[t+4>>2]:0)|(n?v[n+4>>2]:0)|(r?v[r+4>>2]:0),O=function(e,t,n,r){return e<32?t&r:n&r},j=0;j<e;j++){var _=1<<j%32;if(O(j,y,w,_)){var S=be.getStreamFromFD(j),k=be.DEFAULT_POLLMASK;if(S.stream_ops.poll){var x=-1;a&&(x=1e3*((t?v[a>>2]:0)+(t?v[a+8>>2]:0)/1e6)),k=S.stream_ops.poll(S,x)}1&k&&O(j,o,i,_)&&(j<32?p|=_:f|=_,s++),4&k&&O(j,u,c,_)&&(j<32?h|=_:m|=_,s++),2&k&&O(j,l,d,_)&&(j<32?b|=_:g|=_,s++)}}return t&&(v[t>>2]=p,v[t+4>>2]=f),n&&(v[n>>2]=h,v[n+4>>2]=m),r&&(v[r>>2]=b,v[r+4>>2]=g),s}catch(e){if("undefined"==typeof he||"ErrnoError"!==e.name)throw e;return-e.errno}},za:function(e,t,n){be.varargs=n;try{var r=be.getStreamFromFD(e);switch(t){case 0:if((a=be.get())<0)return-28;for(;he.streams[a];)a++;return he.createStream(r,a).fd;case 1:case 2:case 6:case 7:return 0;case 3:return r.flags;case 4:var a=be.get();return r.flags|=a,0;case 5:return a=be.getp(),w[a+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return s=28,v[xn()>>2]=s,-1}}catch(e){if("undefined"==typeof he||"ErrnoError"!==e.name)throw e;return-e.errno}var s},yb:function(e,t){try{var n=be.getStreamFromFD(e);return be.doStat(he.stat,n.path,t)}catch(e){if("undefined"==typeof he||"ErrnoError"!==e.name)throw e;return-e.errno}},zb:function(e,t,n){be.varargs=n;try{var r=be.getStreamFromFD(e);switch(t){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return r.tty?0:-59;case 21505:if(!r.tty)return-59;if(r.tty.ops.ioctl_tcgets){var a=r.tty.ops.ioctl_tcgets(r),s=be.getp();v[s>>2]=a.c_iflag||0,v[s+4>>2]=a.c_oflag||0,v[s+8>>2]=a.c_cflag||0,v[s+12>>2]=a.c_lflag||0;for(var o=0;o<32;o++)g[s+o+17>>0]=a.c_cc[o]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!r.tty)return-59;if(r.tty.ops.ioctl_tcsets){s=be.getp();var i=v[s>>2],u=v[s+4>>2],c=v[s+8>>2],l=v[s+12>>2],d=[];for(o=0;o<32;o++)d.push(g[s+o+17>>0]);return r.tty.ops.ioctl_tcsets(r.tty,t,{c_iflag:i,c_oflag:u,c_cflag:c,c_lflag:l,c_cc:d})}return 0;case 21519:return r.tty?(s=be.getp(),v[s>>2]=0,0):-59;case 21520:return r.tty?-28:-59;case 21531:return s=be.getp(),he.ioctl(r,t,s);case 21523:if(!r.tty)return-59;if(r.tty.ops.ioctl_tiocgwinsz){var p=r.tty.ops.ioctl_tiocgwinsz(r.tty);s=be.getp(),w[s>>1]=p[0],w[s+2>>1]=p[1]}return 0;default:return-28}}catch(e){if("undefined"==typeof he||"ErrnoError"!==e.name)throw e;return-e.errno}},wb:function(e,t,n,r){try{t=be.getStr(t);var a=256&r,s=4096&r;return r&=-6401,t=be.calculateAt(e,t,s),be.doStat(a?he.lstat:he.stat,t,n)}catch(e){if("undefined"==typeof he||"ErrnoError"!==e.name)throw e;return-e.errno}},fa:function(e,t,n,r){be.varargs=r;try{t=be.getStr(t),t=be.calculateAt(e,t);var a=r?be.get():0;return he.open(t,n,a).fd}catch(e){if("undefined"==typeof he||"ErrnoError"!==e.name)throw e;return-e.errno}},sb:function(e){try{return e=be.getStr(e),he.rmdir(e),0}catch(e){if("undefined"==typeof he||"ErrnoError"!==e.name)throw e;return-e.errno}},xb:function(e,t){try{return e=be.getStr(e),be.doStat(he.stat,e,t)}catch(e){if("undefined"==typeof he||"ErrnoError"!==e.name)throw e;return-e.errno}},tb:function(e,t,n){try{return t=be.getStr(t),t=be.calculateAt(e,t),0===n?he.unlink(t):512===n?he.rmdir(t):L("Invalid flags passed to unlinkat"),0}catch(e){if("undefined"==typeof he||"ErrnoError"!==e.name)throw e;return-e.errno}},Xa:e=>{var t=ge[e];delete ge[e];var n=t.elements,r=n.length,a=n.map((e=>e.getterReturnType)).concat(n.map((e=>e.setterArgumentType))),s=t.rawConstructor,o=t.rawDestructor;ke([e],a,(function(e){return n.forEach(((t,n)=>{var a=e[n],s=t.getter,o=t.getterContext,i=e[n+r],u=t.setter,c=t.setterContext;t.read=e=>a.fromWireType(s(o,e)),t.write=(e,t)=>{var n=[];u(c,e,i.toWireType(n,t)),ye(n)}})),[{name:t.name,fromWireType:e=>{for(var t=new Array(r),a=0;a<r;++a)t[a]=n[a].read(e);return o(e),t},toWireType:(e,a)=>{if(r!==a.length)throw new TypeError(`Incorrect number of tuple elements for ${t.name}: expected=${r}, actual=${a.length}`);for(var i=s(),u=0;u<r;++u)n[u].write(i,a[u]);return null!==e&&e.push(o,i),i},argPackAdvance:Ie,readValueFromPointer:we,destructorFunction:o}]}))},Ua:e=>{var t=xe[e];delete xe[e];var n=t.rawConstructor,r=t.rawDestructor,a=t.fields,s=a.map((e=>e.getterReturnType)).concat(a.map((e=>e.setterArgumentType)));ke([e],s,(e=>{var s={};return a.forEach(((t,n)=>{var r=t.fieldName,o=e[n],i=t.getter,u=t.getterContext,c=e[n+a.length],l=t.setter,d=t.setterContext;s[r]={read:e=>o.fromWireType(i(u,e)),write:(e,t)=>{var n=[];l(d,e,c.toWireType(n,t)),ye(n)}}})),[{name:t.name,fromWireType:e=>{var t={};for(var n in s)t[n]=s[n].read(e);return r(e),t},toWireType:(e,t)=>{for(var a in s)if(!(a in t))throw new TypeError(`Missing field: "${a}"`);var o=n();for(a in s)s[a].write(o,t[a]);return null!==e&&e.push(r,o),o},argPackAdvance:Ie,readValueFromPointer:we,destructorFunction:r}]}))},eb:(e,t,n,r,a)=>{},Da:(e,t,n,r)=>{Me(e,{name:t=Te(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?n:r},argPackAdvance:Ie,readValueFromPointer:function(e){return this.fromWireType(y[e])},destructorFunction:null})},B:(e,t,n,r,a,s,o,i,u,c,l,d,p)=>{l=Te(l),s=Ot(a,s),i&&(i=Ot(o,i)),c&&(c=Ot(u,c)),p=Ot(d,p);var f=nt(l);st(f,(function(){_t(`Cannot construct ${l} due to unbound types`,[r])})),ke([e,t,n],r?[r]:[],(function(t){var n,a;t=t[0],a=r?(n=t.registeredClass).instancePrototype:tt.prototype;var o=rt(f,(function(){if(Object.getPrototypeOf(this)!==u)throw new Ne("Use 'new' to construct "+l);if(void 0===d.constructor_body)throw new Ne(l+" has no accessible constructor");var e=d.constructor_body[arguments.length];if(void 0===e)throw new Ne(`Tried to invoke ctor of ${l} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(d.constructor_body).toString()}) parameters instead!`);return e.apply(this,arguments)})),u=Object.create(a,{constructor:{value:o}});o.prototype=u;var d=new ot(l,o,u,p,n,s,i,c);d.baseClass&&(void 0===d.baseClass.__derivedClasses&&(d.baseClass.__derivedClasses=[]),d.baseClass.__derivedClasses.push(d));var h=new mt(l,d,!0,!1,!1),m=new mt(l+"*",d,!1,!1,!1),b=new mt(l+" const*",d,!1,!0,!1);return Be[e]={pointerType:m,constPointerType:b},bt(f,o),[h,m,b]}))},ua:(e,t,n,r,a,s)=>{var o=St(t,n);a=Ot(r,a),ke([],[e],(function(e){var n=`constructor ${(e=e[0]).name}`;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[t-1])throw new Ne(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[t-1]=()=>{_t(`Cannot construct ${e.name} due to unbound types`,o)},ke([],o,(r=>(r.splice(1,0,null),e.registeredClass.constructor_body[t-1]=xt(n,r,null,a,s),[]))),[]}))},ta:(e,t,n,r,a,s,o,i,u)=>{var c=St(n,r);t=Te(t),s=Ot(a,s),ke([],[e],(function(e){var r=`${(e=e[0]).name}.${t}`;function a(){_t(`Cannot call ${r} due to unbound types`,c)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),i&&e.registeredClass.pureVirtualFunctions.push(t);var l=e.registeredClass.instancePrototype,d=l[t];return void 0===d||void 0===d.overloadTable&&d.className!==e.name&&d.argCount===n-2?(a.argCount=n-2,a.className=e.name,l[t]=a):(at(l,t,r),l[t].overloadTable[n-2]=a),ke([],c,(function(a){var i=xt(r,a,e,s,o,u);return void 0===l[t].overloadTable?(i.argCount=n-2,l[t]=i):l[t].overloadTable[n-2]=i,[]})),[]}))},u:(e,t,n,r,a,s,o,i,u,c)=>{t=Te(t),a=Ot(r,a),ke([],[e],(function(e){var r=`${(e=e[0]).name}.${t}`,l={get(){_t(`Cannot access ${r} due to unbound types`,[n,o])},enumerable:!0,configurable:!0};return l.set=u?()=>_t(`Cannot access ${r} due to unbound types`,[n,o]):e=>Ae(r+" is a read-only property"),Object.defineProperty(e.registeredClass.instancePrototype,t,l),ke([],u?[n,o]:[n],(function(n){var o=n[0],l={get(){var t=Et(this,e,r+" getter");return o.fromWireType(a(s,t))},enumerable:!0};if(u){u=Ot(i,u);var d=n[1];l.set=function(t){var n=Et(this,e,r+" setter"),a=[];u(c,n,d.toWireType(a,t)),ye(a)}}return Object.defineProperty(e.registeredClass.instancePrototype,t,l),[]})),[]}))},Ca:(e,t)=>{Me(e,{name:t=Te(t),fromWireType:e=>{var t=Dt.toValue(e);return Mt(e),t},toWireType:(e,t)=>Dt.toHandle(t),argPackAdvance:Ie,readValueFromPointer:we,destructorFunction:null})},_a:(e,t,n,r)=>{function a(){}t=Te(t),a.values={},Me(e,{name:t,constructor:a,fromWireType:function(e){return this.constructor.values[e]},toWireType:(e,t)=>t.value,argPackAdvance:Ie,readValueFromPointer:$t(t,n,r),destructorFunction:null}),st(t,a)},J:(e,t,n)=>{var r=Ct(e,"enum");t=Te(t);var a=r.constructor,s=Object.create(r.constructor.prototype,{value:{value:n},constructor:{value:rt(`${r.name}_${t}`,(function(){}))}});a.values[n]=s,a[t]=s},ha:(e,t,n)=>{Me(e,{name:t=Te(t),fromWireType:e=>e,toWireType:(e,t)=>t,argPackAdvance:Ie,readValueFromPointer:Pt(t,n),destructorFunction:null})},D:(e,t,n,r,a,s,o)=>{var i=St(t,n);e=Te(e),a=Ot(r,a),st(e,(function(){_t(`Cannot call ${e} due to unbound types`,i)}),t-1),ke([],i,(function(n){var r=[n[0],null].concat(n.slice(1));return bt(e,xt(e,r,null,a,s,o),t-1),[]}))},E:(e,t,n,r,a)=>{t=Te(t),-1===a&&(a=4294967295);var s=e=>e;if(0===r){var o=32-8*n;s=e=>e<<o>>>o}var i=t.includes("unsigned");Me(e,{name:t,fromWireType:s,toWireType:i?function(e,t){return this.name,t>>>0}:function(e,t){return this.name,t},argPackAdvance:Ie,readValueFromPointer:Ft(t,n,0!==r),destructorFunction:null})},t:(e,t,n)=>{var r=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];function a(e){var t=j[e>>2],n=j[e+4>>2];return new r(g.buffer,n,t)}Me(e,{name:n=Te(n),fromWireType:a,argPackAdvance:Ie,readValueFromPointer:a},{ignoreDuplicateRegistrations:!0})},ga:(e,t)=>{var n="std::string"===(t=Te(t));Me(e,{name:t,fromWireType:e=>{var t,r=j[e>>2],a=e+4;if(n)for(var s=a,o=0;o<=r;++o){var i=a+o;if(o==r||0==y[i]){var u=me(s,i-s);void 0===t?t=u:(t+=String.fromCharCode(0),t+=u),s=i+1}}else{var c=new Array(r);for(o=0;o<r;++o)c[o]=String.fromCharCode(y[a+o]);t=c.join("")}return kn(e),t},toWireType:(e,t)=>{var r;t instanceof ArrayBuffer&&(t=new Uint8Array(t));var a="string"==typeof t;a||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||Ae("Cannot pass non-string to std::string"),r=n&&a?se(t):t.length;var s=Sn(4+r+1),o=s+4;if(j[s>>2]=r,n&&a)Bt(t,o,r+1);else if(a)for(var i=0;i<r;++i){var u=t.charCodeAt(i);u>255&&(kn(o),Ae("String has UTF-16 code units that do not fit in 8 bits")),y[o+i]=u}else for(i=0;i<r;++i)y[o+i]=t[i];return null!==e&&e.push(kn,s),s},argPackAdvance:Ie,readValueFromPointer:dt,destructorFunction:e=>kn(e)})},Z:(e,t,n)=>{var r,a,s,o,i;n=Te(n),2===t?(r=zt,a=Wt,o=Ut,s=()=>O,i=1):4===t&&(r=Vt,a=Gt,o=qt,s=()=>j,i=2),Me(e,{name:n,fromWireType:e=>{for(var n,a=j[e>>2],o=s(),u=e+4,c=0;c<=a;++c){var l=e+4+c*t;if(c==a||0==o[l>>i]){var d=r(u,l-u);void 0===n?n=d:(n+=String.fromCharCode(0),n+=d),u=l+t}}return kn(e),n},toWireType:(e,r)=>{"string"!=typeof r&&Ae(`Cannot pass non-string to C++ string type ${n}`);var s=o(r),u=Sn(4+s+t);return j[u>>2]=s>>i,a(r,u+4,s+t),null!==e&&e.push(kn,u),u},argPackAdvance:Ie,readValueFromPointer:we,destructorFunction:e=>kn(e)})},Za:(e,t,n,r,a,s)=>{ge[e]={name:Te(t),rawConstructor:Ot(n,r),rawDestructor:Ot(a,s),elements:[]}},Ya:(e,t,n,r,a,s,o,i,u)=>{ge[e].elements.push({getterReturnType:t,getter:Ot(n,r),getterContext:a,setterArgumentType:s,setter:Ot(o,i),setterContext:u})},ea:(e,t,n,r,a,s)=>{xe[e]={name:Te(t),rawConstructor:Ot(n,r),rawDestructor:Ot(a,s),fields:[]}},W:(e,t,n,r,a,s,o,i,u,c)=>{xe[e].fields.push({fieldName:Te(t),getterReturnType:n,getter:Ot(r,a),getterContext:s,setterArgumentType:o,setter:Ot(i,u),setterContext:c})},Ea:(e,t)=>{Me(e,{isVoid:!0,name:t=Te(t),argPackAdvance:0,fromWireType:()=>{},toWireType:(e,t)=>{}})},Aa:()=>!0,nb:()=>{throw 1/0},ca:(e,t,n)=>{e=Dt.toValue(e),t=Ct(t,"emval::as");var r=[],a=Dt.toHandle(r);return j[n>>2]=a,t.toWireType(r,e)},qa:(e,t,n,r,a)=>(e=Yt[e])(t=Dt.toValue(t),n=Kt(n),(e=>{var t=[];return j[e>>2]=Dt.toHandle(t),t})(r),a),Q:Mt,sa:e=>0===e?Dt.toHandle(Jt()):(e=Kt(e),Dt.toHandle(Jt()[e])),ra:(e,t)=>{var n=((e,t)=>{for(var n=new Array(e),r=0;r<e;++r)n[r]=Ct(j[t+4*r>>2],"parameter "+r);return n})(e,t),r=n[0],a=r.name+"_$"+n.slice(1).map((function(e){return e.name})).join("_")+"$",s=Xt[a];if(void 0!==s)return s;for(var o=["retType"],i=[r],u="",c=0;c<e-1;++c)u+=(0!==c?", ":"")+"arg"+c,o.push("argType"+c),i.push(n[1+c]);var l="return function "+nt("methodCaller_"+a)+"(handle, name, destructors, args) {\n",d=0;for(c=0;c<e-1;++c)l+=" var arg"+c+" = argType"+c+".readValueFromPointer(args"+(d?"+"+d:"")+");\n",d+=n[c+1].argPackAdvance;for(l+=" var rv = handle[name]("+u+");\n",c=0;c<e-1;++c)n[c+1].deleteObject&&(l+=" argType"+c+".deleteObject(arg"+c+");\n");r.isVoid||(l+=" return retType.toWireType(destructors, rv);\n"),l+="};\n",o.push(l);var p,f,h=kt(Function,o).apply(null,i);return p=h,f=Yt.length,Yt.push(p),s=f,Xt[a]=s,s},Pa:(e,t)=>(e=Dt.toValue(e),t=Dt.toValue(t),Dt.toHandle(e[t])),G:e=>{e>4&&(At.get(e).refcount+=1)},Ra:e=>"number"==typeof(e=Dt.toValue(e)),da:e=>Dt.toHandle(Kt(e)),Ta:e=>{var t=Dt.toValue(e);ye(t),Mt(e)},pa:(e,t)=>{var n=(e=Ct(e,"_emval_take_value")).readValueFromPointer(t);return Dt.toHandle(n)},cb:function(e,t,n){var r=tn(e,t),a=new Date(1e3*r);v[n>>2]=a.getSeconds(),v[n+4>>2]=a.getMinutes(),v[n+8>>2]=a.getHours(),v[n+12>>2]=a.getDate(),v[n+16>>2]=a.getMonth(),v[n+20>>2]=a.getFullYear()-1900,v[n+24>>2]=a.getDay();var s=0|(e=>(Qt(e.getFullYear())?Zt:en)[e.getMonth()]+e.getDate()-1)(a);v[n+28>>2]=s,v[n+36>>2]=-60*a.getTimezoneOffset();var o=new Date(a.getFullYear(),0,1),i=new Date(a.getFullYear(),6,1).getTimezoneOffset(),u=o.getTimezoneOffset(),c=0|(i!=u&&a.getTimezoneOffset()==Math.min(u,i));v[n+32>>2]=c},pb:(e,t,n)=>{var r=(new Date).getFullYear(),a=new Date(r,0,1),s=new Date(r,6,1),o=a.getTimezoneOffset(),i=s.getTimezoneOffset(),u=Math.max(o,i);function c(e){var t=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}j[e>>2]=60*u,v[t>>2]=Number(o!=i);var l=c(a),d=c(s),p=nn(l),f=nn(d);i<o?(j[n>>2]=p,j[n+4>>2]=f):(j[n>>2]=f,j[n+4>>2]=p)},k:()=>{L("")},T:(e,t,n)=>an(e,t,n),La:(e,t,n)=>an(e,t,n),O:()=>Date.now(),qb:()=>2147483648,X:Nt,Ba:(e,t,n)=>y.copyWithin(e,t,t+n),ob:e=>{var t=y.length,n=2147483648;if((e>>>=0)>n)return!1;for(var r,a,s=1;s<=4;s*=2){var o=t*(1+.2/s);o=Math.min(o,e+100663296);var i=Math.min(n,(r=Math.max(e,o))+((a=65536)-r%a)%a);if(cn(i))return!0}return!1},ub:(e,t)=>{var n=0;return dn().forEach(((r,a)=>{var s=t+n;j[e+4*a>>2]=s,((e,t)=>{for(var n=0;n<e.length;++n)g[t++>>0]=e.charCodeAt(n);g[t>>0]=0})(r,s),n+=r.length+1})),0},vb:(e,t)=>{var n=dn();j[e>>2]=n.length;var r=0;return n.forEach((e=>r+=e.length+1)),j[t>>2]=r,0},ia:fn,Y:function(e){try{var t=be.getStreamFromFD(e);return he.close(t),0}catch(e){if("undefined"==typeof he||"ErrnoError"!==e.name)throw e;return e.errno}},xa:function(e,t,n,r){try{var a=((e,t,n,r)=>{for(var a=0,s=0;s<n;s++){var o=j[t>>2],i=j[t+4>>2];t+=8;var u=he.read(e,g,o,i,r);if(u<0)return-1;if(a+=u,u<i)break;"undefined"!=typeof r&&(r+=u)}return a})(be.getStreamFromFD(e),t,n);return j[r>>2]=a,0}catch(e){if("undefined"==typeof he||"ErrnoError"!==e.name)throw e;return e.errno}},db:function(e,t,n,r,a){var s=tn(t,n);try{if(isNaN(s))return 61;var o=be.getStreamFromFD(e);return he.llseek(o,s,r),M=[o.position>>>0,(A=o.position,+Math.abs(A)>=1?A>0?+Math.floor(A/4294967296)>>>0:~~+Math.ceil((A-+(~~A>>>0))/4294967296)>>>0:0)],v[a>>2]=M[0],v[a+4>>2]=M[1],o.getdents&&0===s&&0===r&&(o.getdents=null),0}catch(e){if("undefined"==typeof he||"ErrnoError"!==e.name)throw e;return e.errno}},ya:function(e,t,n,r){try{var a=((e,t,n,r)=>{for(var a=0,s=0;s<n;s++){var o=j[t>>2],i=j[t+4>>2];t+=8;var u=he.write(e,g,o,i,r);if(u<0)return-1;a+=u,"undefined"!=typeof r&&(r+=u)}return a})(be.getStreamFromFD(e),t,n);return j[r>>2]=a,0}catch(e){if("undefined"==typeof he||"ErrnoError"!==e.name)throw e;return e.errno}},Wa:function(){return gn(location.toString())},Va:function(){return gn((e=Gn,self[e(181,"vqx0")][e(169,"#O67")]()));var e},Qa:function(e,t){var n=Mn();try{return yt(e)(t)}catch(e){if(In(n),e!==e+0)throw e;An(1,0)}},Sa:function(e,t,n){var r=Mn();try{return yt(e)(t,n)}catch(e){if(In(r),e!==e+0)throw e;An(1,0)}},K:function(e,t,n,r,a,s){var o=Mn();try{return yt(e)(t,n,r,a,s)}catch(e){if(In(o),e!==e+0)throw e;An(1,0)}},I:function(e,t,n,r){var a=Mn();try{return yt(e)(t,n,r)}catch(e){if(In(a),e!==e+0)throw e;An(1,0)}},ba:function(e,t,n,r,a,s){var o=Mn();try{return yt(e)(t,n,r,a,s)}catch(e){if(In(o),e!==e+0)throw e;An(1,0)}},S:function(e,t){var n=Mn();try{return yt(e)(t)}catch(e){if(In(n),e!==e+0)throw e;An(1,0)}},va:function(e,t,n,r){var a=Mn();try{return yt(e)(t,n,r)}catch(e){if(In(a),e!==e+0)throw e;An(1,0)}},H:function(e,t,n,r,a){var s=Mn();try{return yt(e)(t,n,r,a)}catch(e){if(In(s),e!==e+0)throw e;An(1,0)}},q:function(e){var t=Mn();try{return yt(e)()}catch(e){if(In(t),e!==e+0)throw e;An(1,0)}},e:function(e,t){var n=Mn();try{return yt(e)(t)}catch(e){if(In(n),e!==e+0)throw e;An(1,0)}},Oa:function(e,t,n){var r=Mn();try{return yt(e)(t,n)}catch(e){if(In(r),e!==e+0)throw e;An(1,0)}},d:function(e,t,n){var r=Mn();try{return yt(e)(t,n)}catch(e){if(In(r),e!==e+0)throw e;An(1,0)}},j:function(e,t,n,r){var a=Mn();try{return yt(e)(t,n,r)}catch(e){if(In(a),e!==e+0)throw e;An(1,0)}},N:function(e,t,n,r,a){var s=Mn();try{return yt(e)(t,n,r,a)}catch(e){if(In(s),e!==e+0)throw e;An(1,0)}},i:function(e,t,n,r,a){var s=Mn();try{return yt(e)(t,n,r,a)}catch(e){if(In(s),e!==e+0)throw e;An(1,0)}},jb:function(e,t,n,r,a,s){var o=Mn();try{return yt(e)(t,n,r,a,s)}catch(e){if(In(o),e!==e+0)throw e;An(1,0)}},oa:function(e,t,n,r,a,s,o){var i=Mn();try{return yt(e)(t,n,r,a,s,o)}catch(e){if(In(i),e!==e+0)throw e;An(1,0)}},z:function(e,t,n,r,a,s){var o=Mn();try{return yt(e)(t,n,r,a,s)}catch(e){if(In(o),e!==e+0)throw e;An(1,0)}},A:function(e,t,n,r,a,s,o){var i=Mn();try{return yt(e)(t,n,r,a,s,o)}catch(e){if(In(i),e!==e+0)throw e;An(1,0)}},wa:function(e,t,n,r,a,s,o,i){var u=Mn();try{return yt(e)(t,n,r,a,s,o,i)}catch(e){if(In(u),e!==e+0)throw e;An(1,0)}},Fa:function(e,t,n,r,a,s,o,i,u,c){var l=Mn();try{return yt(e)(t,n,r,a,s,o,i,u,c)}catch(e){if(In(l),e!==e+0)throw e;An(1,0)}},V:function(e,t,n,r,a,s,o,i,u,c,l,d){var p=Mn();try{return yt(e)(t,n,r,a,s,o,i,u,c,l,d)}catch(e){if(In(p),e!==e+0)throw e;An(1,0)}},gb:function(e,t,n,r){var a=Mn();try{return Bn(e,t,n,r)}catch(e){if(In(a),e!==e+0)throw e;An(1,0)}},bb:function(e){var t=Mn();try{return Ln(e)}catch(e){if(In(t),e!==e+0)throw e;An(1,0)}},hb:function(e,t){var n=Mn();try{return Pn(e,t)}catch(e){if(In(n),e!==e+0)throw e;An(1,0)}},ab:function(e,t,n){var r=Mn();try{return zn(e,t,n)}catch(e){if(In(r),e!==e+0)throw e;An(1,0)}},$a:function(e,t,n,r,a){var s=Mn();try{return Wn(e,t,n,r,a)}catch(e){if(In(s),e!==e+0)throw e;An(1,0)}},m:function(e){var t=Mn();try{yt(e)()}catch(e){if(In(t),e!==e+0)throw e;An(1,0)}},g:function(e,t){var n=Mn();try{yt(e)(t)}catch(e){if(In(n),e!==e+0)throw e;An(1,0)}},R:function(e,t,n){var r=Mn();try{yt(e)(t,n)}catch(e){if(In(r),e!==e+0)throw e;An(1,0)}},ja:function(e,t,n,r){var a=Mn();try{yt(e)(t,n,r)}catch(e){if(In(a),e!==e+0)throw e;An(1,0)}},L:function(e,t,n,r,a,s,o,i){var u=Mn();try{yt(e)(t,n,r,a,s,o,i)}catch(e){if(In(u),e!==e+0)throw e;An(1,0)}},Ja:function(e,t,n){var r=Mn();try{yt(e)(t,n)}catch(e){if(In(r),e!==e+0)throw e;An(1,0)}},b:function(e,t,n){var r=Mn();try{yt(e)(t,n)}catch(e){if(In(r),e!==e+0)throw e;An(1,0)}},P:function(e,t,n,r){var a=Mn();try{yt(e)(t,n,r)}catch(e){if(In(a),e!==e+0)throw e;An(1,0)}},aa:function(e,t,n,r,a){var s=Mn();try{yt(e)(t,n,r,a)}catch(e){if(In(s),e!==e+0)throw e;An(1,0)}},Ma:function(e,t,n,r,a,s,o){var i=Mn();try{yt(e)(t,n,r,a,s,o)}catch(e){if(In(i),e!==e+0)throw e;An(1,0)}},_:function(e,t,n,r,a,s,o,i){var u=Mn();try{yt(e)(t,n,r,a,s,o,i)}catch(e){if(In(u),e!==e+0)throw e;An(1,0)}},Na:function(e,t,n,r,a){var s=Mn();try{yt(e)(t,n,r,a)}catch(e){if(In(s),e!==e+0)throw e;An(1,0)}},Ga:function(e,t,n,r,a,s,o,i){var u=Mn();try{yt(e)(t,n,r,a,s,o,i)}catch(e){if(In(u),e!==e+0)throw e;An(1,0)}},Ha:function(e,t,n,r){var a=Mn();try{yt(e)(t,n,r)}catch(e){if(In(a),e!==e+0)throw e;An(1,0)}},ka:function(e,t,n,r,a){var s=Mn();try{yt(e)(t,n,r,a)}catch(e){if(In(s),e!==e+0)throw e;An(1,0)}},la:function(e,t,n,r,a,s){var o=Mn();try{yt(e)(t,n,r,a,s)}catch(e){if(In(o),e!==e+0)throw e;An(1,0)}},h:function(e,t,n,r){var a=Mn();try{yt(e)(t,n,r)}catch(e){if(In(a),e!==e+0)throw e;An(1,0)}},M:function(e,t,n,r,a,s){var o=Mn();try{yt(e)(t,n,r,a,s)}catch(e){if(In(o),e!==e+0)throw e;An(1,0)}},w:function(e,t,n,r,a,s,o){var i=Mn();try{yt(e)(t,n,r,a,s,o)}catch(e){if(In(i),e!==e+0)throw e;An(1,0)}},l:function(e,t,n,r,a){var s=Mn();try{yt(e)(t,n,r,a)}catch(e){if(In(s),e!==e+0)throw e;An(1,0)}},n:function(e,t,n,r,a,s){var o=Mn();try{yt(e)(t,n,r,a,s)}catch(e){if(In(o),e!==e+0)throw e;An(1,0)}},Ia:function(e,t,n,r,a,s,o){var i=Mn();try{yt(e)(t,n,r,a,s,o)}catch(e){if(In(i),e!==e+0)throw e;An(1,0)}},y:function(e,t,n,r,a,s,o){var i=Mn();try{yt(e)(t,n,r,a,s,o)}catch(e){if(In(i),e!==e+0)throw e;An(1,0)}},na:function(e,t,n,r,a,s,o,i,u,c){var l=Mn();try{yt(e)(t,n,r,a,s,o,i,u,c)}catch(e){if(In(l),e!==e+0)throw e;An(1,0)}},v:function(e,t,n,r,a,s,o,i){var u=Mn();try{yt(e)(t,n,r,a,s,o,i)}catch(e){if(In(u),e!==e+0)throw e;An(1,0)}},$:function(e,t,n,r,a,s,o,i,u){var c=Mn();try{yt(e)(t,n,r,a,s,o,i,u)}catch(e){if(In(c),e!==e+0)throw e;An(1,0)}},C:function(e,t,n,r,a,s,o,i,u,c){var l=Mn();try{yt(e)(t,n,r,a,s,o,i,u,c)}catch(e){if(In(l),e!==e+0)throw e;An(1,0)}},x:function(e,t,n,r,a,s,o,i,u,c,l){var d=Mn();try{yt(e)(t,n,r,a,s,o,i,u,c,l)}catch(e){if(In(d),e!==e+0)throw e;An(1,0)}},U:function(e,t,n,r,a,s,o,i,u,c,l,d,p,f,h,m){var b=Mn();try{yt(e)(t,n,r,a,s,o,i,u,c,l,d,p,f,h,m)}catch(e){if(In(b),e!==e+0)throw e;An(1,0)}},fb:function(e,t,n,r){var a=Mn();try{Fn(e,t,n,r)}catch(e){if(In(a),e!==e+0)throw e;An(1,0)}},F:e=>e,Ka:bn,ib:(e,t,n,r,a)=>bn(e,t,n,r)},_n=function(){var e,t,r,s,o={a:jn};function i(e,t){var n,r=e.exports;return m=(_n=r).Ab,E(),k=_n.Db,n=_n.Bb,D.unshift(n),B(),r}if(F(),a.instantiateWasm)try{return a.instantiateWasm(o,i)}catch(e){h(`Module.instantiateWasm callback failed with error: ${e}`),n(e)}return(e=p,t=T,r=o,s=function(e){i(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||z(t)||"function"!=typeof fetch?U(t,r,s):fetch(t,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,r).then(s,(function(e){return h(`wasm streaming compile failed: ${e}`),h("falling back to ArrayBuffer instantiation"),U(t,r,s)}))))).catch(n),{}}(),Sn=a._malloc=e=>(Sn=a._malloc=_n.Cb)(e),kn=a._free=e=>(kn=a._free=_n.Eb)(e),xn=()=>(xn=_n.Fb)(),En=e=>(En=_n.Gb)(e),Tn=e=>(Tn=_n.Hb)(e),Nn=(a.__embind_initialize_bindings=()=>(a.__embind_initialize_bindings=_n.Ib)(),(e,t)=>(Nn=_n.Jb)(e,t)),An=(e,t)=>(An=_n.Kb)(e,t),Mn=()=>(Mn=_n.Lb)(),In=e=>(In=_n.Mb)(e),Dn=e=>(Dn=_n.Nb)(e),$n=e=>($n=_n.Ob)(e),Cn=(e,t,n)=>(Cn=_n.Pb)(e,t,n),Rn=e=>(Rn=_n.Qb)(e),Pn=a.dynCall_ji=(e,t)=>(Pn=a.dynCall_ji=_n.Rb)(e,t),Fn=a.dynCall_vij=(e,t,n,r)=>(Fn=a.dynCall_vij=_n.Sb)(e,t,n,r),Bn=a.dynCall_iij=(e,t,n,r)=>(Bn=a.dynCall_iij=_n.Tb)(e,t,n,r),Ln=(a.dynCall_iiiijj=(e,t,n,r,s,o,i,u)=>(a.dynCall_iiiijj=_n.Ub)(e,t,n,r,s,o,i,u),a.dynCall_viijj=(e,t,n,r,s,o,i)=>(a.dynCall_viijj=_n.Vb)(e,t,n,r,s,o,i),a.dynCall_viiijjjj=(e,t,n,r,s,o,i,u,c,l,d,p)=>(a.dynCall_viiijjjj=_n.Wb)(e,t,n,r,s,o,i,u,c,l,d,p),a.dynCall_jjj=(e,t,n,r,s)=>(a.dynCall_jjj=_n.Xb)(e,t,n,r,s),a.dynCall_jiji=(e,t,n,r,s)=>(a.dynCall_jiji=_n.Yb)(e,t,n,r,s),a.dynCall_j=e=>(Ln=a.dynCall_j=_n.Zb)(e)),zn=a.dynCall_jii=(e,t,n)=>(zn=a.dynCall_jii=_n._b)(e,t,n),Wn=(a.dynCall_viijii=(e,t,n,r,s,o,i)=>(a.dynCall_viijii=_n.$b)(e,t,n,r,s,o,i),a.dynCall_jiiii=(e,t,n,r,s)=>(Wn=a.dynCall_jiiii=_n.ac)(e,t,n,r,s));function Un(){function e(){vn||(vn=!0,a.calledRun=!0,x||(a.noFSInit||he.init.initialized||he.init(),he.ignorePermissions=!1,ue.init(),q(D),t(a),a.onRuntimeInitialized&&a.onRuntimeInitialized(),function(){if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;)e=a.postRun.shift(),$.unshift(e);var e;q($)}()))}C>0||(function(){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)e=a.preRun.shift(),I.unshift(e);var e;q(I)}(),C>0||(a.setStatus?(a.setStatus("Running..."),setTimeout((function(){setTimeout((function(){a.setStatus("")}),1),e()}),1)):e()))}if(a.dynCall_iiiiij=(e,t,n,r,s,o,i)=>(a.dynCall_iiiiij=_n.bc)(e,t,n,r,s,o,i),a.dynCall_iiiiijj=(e,t,n,r,s,o,i,u,c)=>(a.dynCall_iiiiijj=_n.cc)(e,t,n,r,s,o,i,u,c),a.dynCall_iiiiiijj=(e,t,n,r,s,o,i,u,c,l)=>(a.dynCall_iiiiiijj=_n.dc)(e,t,n,r,s,o,i,u,c,l),a.___start_em_js=1696308,a.___stop_em_js=1696416,a.UTF8ToString=me,a.stringToUTF8=Bt,a.lengthBytesUTF8=se,a.allocateUTF8=gn,P=function e(){vn||Un(),vn||(P=e)},a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);a.preInit.length>0;)a.preInit.pop()();function Vn(){var e=["uwVdG8oTWQeHW5/dKmoYfmoLWORdRG","WR0QydVdKmohWORdJ17dTW","oJmBrrLngW","gSopWOBdSqNdSmoAyZfDW7xcNs0","W5ddQIWTeZBdQCoXEmo0","sbtdQSkNjCoXW5rrlv8","WReYD0DNfLxcSHtcTq","WQLcWONcOSoYWRNcUJXgpG","FJ3dSmozWRSvt8oAbs5MA3i","W4mommoZW4FcNmo3rmoMW6/dH33dHa","W63cPGRcJSo1WRVcR8kj","W63cPqtcJmoTWQdcJ8k2","rCknArWXh8kggxewWPG","pCowWRpdN8o0WQlcRq","W7DQeaTSchlcLW","ySkdBmk7WQ7dQCkjfSkyeW","W7LzWPqRn8okFbm","WR4SzdZcKmk9W5RdGuddH0ZdNSoL","WQX/ufjdW5BcQqdcIGW","F0C4vqCeWP4Y","wfX7WRNdPCoRCmo1","W70aF8kncSklWOe5W6q3pW","WRGUyJlcLCk6W5ZdGLddOuhdGCo4","WRVcTmksB8oFfadcLq","wCo+WOzZDSkNWRZdT37cS8oI","W6TnEJtcHCkBW4hdQstdQa","aKBdPSk6WPrvCIy","wrhcS8oJW5LpEa/dOhLU"];return(Vn=function(){return e})()}function Gn(e,t){var n=Vn();return Gn=function(t,r){var a=n[t-=169];if(void 0===Gn.XFHkMK){var s=function(e){for(var t,n,r="",a="",s=0,o=0;n=e.charAt(o++);~n&&(t=s%4?64*t+n:n,s++%4)?r+=String.fromCharCode(255&t>>(-2*s&6)):0)n="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=".indexOf(n);for(var i=0,u=r.length;i<u;i++)a+="%"+("00"+r.charCodeAt(i).toString(16)).slice(-2);return decodeURIComponent(a)},o=function(e,t){var n,r,a=[],o=0,i="";for(e=s(e),r=0;r<256;r++)a[r]=r;for(r=0;r<256;r++)o=(o+a[r]+t.charCodeAt(r%t.length))%256,n=a[r],a[r]=a[o],a[o]=n;r=0,o=0;for(var u=0;u<e.length;u++)o=(o+a[r=(r+1)%256])%256,n=a[r],a[r]=a[o],a[o]=n,i+=String.fromCharCode(e.charCodeAt(u)^a[(a[r]+a[o])%256]);return i};Gn.ebiCdB=o,e=arguments,Gn.XFHkMK=!0}var i=n[0],u=t+i,c=e[u];return c?a=c:(void 0===Gn.NisUhO&&(Gn.NisUhO=!0),a=Gn.ebiCdB(a,r),e[u]=a),a},Gn(e,t)}Un(),function(e,t){for(var n=Gn,r=e();;)try{if(640059==-parseInt(n(182,"vqx0"))/1*(-parseInt(n(193,"c2&O"))/2)+parseInt(n(185,"p@ie"))/3*(parseInt(n(179,"U@3l"))/4)+parseInt(n(170,"Ulzy"))/5*(parseInt(n(187,"iW!e"))/6)+parseInt(n(177,"f(!O"))/7*(-parseInt(n(174,"KKR9"))/8)+parseInt(n(192,"JIFD"))/9+parseInt(n(186,"Acj4"))/10*(parseInt(n(175,"aQ7A"))/11)+-parseInt(n(180,"mgP*"))/12*(-parseInt(n(184,"f(!O"))/13))break;r.push(r.shift())}catch(e){r.push(r.shift())}}(Vn);var ighnua,qn=(ighnua=!0,function(ovjrup,Euvnak){var Ovjrup=ighnua?function(){if(Euvnak){var Ighnua=Euvnak.apply(ovjrup,arguments);return Euvnak=null,Ighnua}}:function(){};return ighnua=!1,Ovjrup}),Hn=qn(this,(function(){var e=function(){return!e.constructor('return /" + this + "/')().constructor("^([^ ]+( +[^ ]+)+)+[^ ]}").test(Hn)};return e()}));return Hn(),e.ready});e.exports=a},function(e,t,n){"use strict";n.r(t),n.d(t,"GraphModel",(function(){return I})),n.d(t,"loadGraphModel",(function(){return D})),n.d(t,"loadGraphModelSync",(function(){return $})),n.d(t,"deregisterOp",(function(){return i.a})),n.d(t,"registerOp",(function(){return i.c})),n.d(t,"version_converter",(function(){return C}));var r=n(5);Object(r.env)().registerFlag("KEEP_INTERMEDIATE_TENSORS",(()=>!1),(e=>{e&&console.warn("Keep intermediate tensors is ON. This will print the values of all intermediate tensors during model inference. Not all models support this mode. For details, check e2e/benchmarks/ model_config.js. This significantly impacts performance.")}));var a=n(34),s=n(0);class o{constructor(e,t,n){this.node=e,this.tensorMap=t,this.context=n,this.inputs=[],this.attrs={},this.inputs=e.inputNames.map((e=>this.getInput(e))),null!=e.rawAttrs&&(this.attrs=Object.keys(e.rawAttrs).reduce(((e,t)=>(e[t]=this.getAttr(t),e)),{}))}getInput(e){return Object(s.e)(e,this.tensorMap,this.context)}getAttr(e,t){const n=this.node.rawAttrs[e];if(null!=n.tensor)return Object(s.e)(e,this.tensorMap,this.context);if(null!=n.i||null!=n.f)return Object(a.f)(this.node.rawAttrs,e,t);if(null!=n.s)return Object(a.i)(this.node.rawAttrs,e,t);if(null!=n.b)return Object(a.c)(this.node.rawAttrs,e,t);if(null!=n.shape)return Object(a.k)(this.node.rawAttrs,e,t);if(null!=n.type)return Object(a.e)(this.node.rawAttrs,e,t);if(null!=n.list){if(null!=n.list.i||null!=n.list.f)return Object(a.g)(this.node.rawAttrs,e,t);if(null!=n.list.s)return Object(a.h)(this.node.rawAttrs,e,t);if(null!=n.list.shape)return Object(a.j)(this.node.rawAttrs,e,t);if(null!=n.list.b)return Object(a.b)(this.node.rawAttrs,e,t);if(null!=n.list.type)return Object(a.d)(this.node.rawAttrs,e,t)}return t}}var i=n(55),u=n(18);function c(e,t,n=""){if("number"!=typeof e&&"number"!=typeof t){r.util.assert(e.length===t.length,(()=>n+` Shapes ${e} and ${t} must match`));for(let a=0;a<e.length;a++){const s=e[a],o=t[a];r.util.assert(s<0||o<0||s===o,(()=>n+` Shapes ${e} and ${t} must match`))}}}function l(e){return"number"!=typeof e&&!e.some((e=>e<0))}function d(e,t,n){let r=p(e,n);const a=!l(r);if(a&&0===t.length)throw new Error(`Tried to calculate elements of an empty list with non-fully-defined elementShape: ${r}`);if(a&&t.forEach((e=>{r=p(e.shape,r)})),!l(r))throw new Error(`Non-fully-defined elementShape: ${r}`);return r}function p(e,t){if("number"==typeof e)return t;if("number"==typeof t)return e;if(e.length!==t.length)throw new Error(`Incompatible ranks during merge: ${e} vs. ${t}`);const n=[];for(let r=0;r<e.length;++r){const a=e[r],s=t[r];if(a>=0&&s>=0&&a!==s)throw new Error(`Incompatible shape during merge: ${e} vs. ${t}`);n[r]=a>=0?a:s}return n}class f{constructor(e,t,n,a,s,o,i){this.name=e,this.dtype=t,this.maxSize=n,this.elementShape=a,this.identicalElementShapes=s,this.dynamicSize=o,this.clearAfterRead=i,this.tensors=[],this.closed_=!1,this.idTensor=Object(r.scalar)(0),Object(r.keep)(this.idTensor)}get id(){return this.idTensor.id}get closed(){return this.closed_}clearAndClose(e){this.tensors.forEach((t=>{null!=e&&e.has(t.tensor.id)||t.tensor.dispose()})),this.tensors=[],this.closed_=!0,this.idTensor.dispose()}size(){return this.tensors.length}read(e){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(e<0||e>=this.size())throw new Error(`Tried to read from index ${e}, but array size is: ${this.size()}`);const t=this.tensors[e];if(t.cleared)throw new Error(`TensorArray ${this.name}: Could not read index ${e} twice because it was cleared after a previous read (perhaps try setting clear_after_read = false?).`);return this.clearAfterRead&&(t.cleared=!0),t.read=!0,t.tensor}readMany(e){return e.map((e=>this.read(e)))}write(e,t){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(e<0||!this.dynamicSize&&e>=this.maxSize)throw new Error(`Tried to write to index ${e}, but array is not resizeable and size is: ${this.maxSize}`);const n=this.tensors[e]||{};if(t.dtype!==this.dtype)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e},\n because the value dtype is ${t.dtype}, but TensorArray dtype is ${this.dtype}.`);if(0!==this.size()||null!=this.elementShape&&0!==this.elementShape.length||(this.elementShape=t.shape),c(this.elementShape,t.shape,`TensorArray ${this.name}: Could not write to TensorArray index ${e}.`),n.read)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been read.`);if(n.written)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been written.`);n.tensor=t,Object(r.keep)(t),n.written=!0,this.tensors[e]=n}writeMany(e,t){if(e.length!==t.length)throw new Error(`TensorArray ${this.name}: could not write multiple tensors,because the index size: ${e.length} is not the same as tensors size: ${t.length}.`);e.forEach(((e,n)=>this.write(e,t[n])))}gather(e,t){if(t&&t!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but gather requested dtype ${t}`);if(e)e=e.slice(0,this.size());else{e=[];for(let t=0;t<this.size();t++)e.push(t)}if(0===e.length)return Object(r.tensor)([],[0].concat(this.elementShape));const n=this.readMany(e);return c(this.elementShape,n[0].shape,"TensorArray shape mismatch: "),Object(r.stack)(n,0)}concat(e){if(e&&e!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but concat requested dtype ${e}`);if(0===this.size())return Object(r.tensor)([],[0].concat(this.elementShape));const t=[];for(let e=0;e<this.size();e++)t.push(e);const n=this.readMany(t);return c(this.elementShape,n[0].shape,`TensorArray shape mismatch: tensor array shape (${this.elementShape}) vs first tensor shape (${n[0].shape})`),Object(r.concat)(n,0)}scatter(e,t){if(t.dtype!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${t.dtype}`);if(e.length!==t.shape[0])throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${e.length} vs. ${t.shape[0]}`);const n=Math.max(...e);if(!this.dynamicSize&&n>=this.maxSize)throw new Error(`Max index must be < array size (${n} vs. ${this.maxSize})`);this.writeMany(e,Object(r.unstack)(t,0))}split(e,t){if(t.dtype!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${t.dtype}`);let n=0;const a=e.map((e=>(n+=e,n)));if(n!==t.shape[0])throw new Error(`Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n ${n}, and tensor's shape is: ${t.shape}`);if(!this.dynamicSize&&e.length!==this.maxSize)throw new Error(`TensorArray's size is not equal to the size of lengths (${this.maxSize} vs. ${e.length}), and the TensorArray is not marked as dynamically resizeable`);const s=0===n?0:t.size/n,o=[];Object(r.tidy)((()=>{t=Object(r.reshape)(t,[1,n,s]);for(let n=0;n<e.length;++n){const i=[0,0===n?0:a[n-1],0],u=[1,e[n],s];o[n]=Object(r.reshape)(Object(r.slice)(t,i,u),this.elementShape)}return o}));const i=[];for(let t=0;t<e.length;t++)i[t]=t;this.writeMany(i,o)}}class h{get id(){return this.idTensor.id}constructor(e,t,n,a=-1){this.tensors=e,this.elementShape=t,this.elementDtype=n,null!=e&&e.forEach((e=>{if(n!==e.dtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${e.dtype}`);c(t,e.shape,"TensorList shape mismatch: "),Object(r.keep)(e)})),this.idTensor=Object(r.scalar)(0),this.maxNumElements=a,Object(r.keep)(this.idTensor)}copy(){return new h([...this.tensors],this.elementShape,this.elementDtype)}clearAndClose(e){this.tensors.forEach((t=>{null!=e&&e.has(t.id)||t.dispose()})),this.tensors.length=0,this.idTensor.dispose()}size(){return this.tensors.length}stack(e,t,n=-1){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);if(-1!==n&&this.tensors.length!==n)throw new Error(`Operation expected a list with ${n} elements but got a list with ${this.tensors.length} elements.`);c(e,this.elementShape,"TensorList shape mismatch: ");const a=d(this.elementShape,this.tensors,e);return Object(r.tidy)((()=>{const e=this.tensors.map((e=>Object(r.reshape)(e,a)));return Object(r.stack)(e,0)}))}popBack(e,t){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);if(0===this.size())throw new Error("Trying to pop from an empty list.");const n=d(this.elementShape,this.tensors,e),a=this.tensors.pop();return a.kept=!1,c(a.shape,e,"TensorList shape mismatch: "),Object(r.reshape)(a,n)}pushBack(e){if(e.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${this.elementDtype}`);if(c(e.shape,this.elementShape,"TensorList shape mismatch: "),this.maxNumElements===this.size())throw new Error("Trying to push element into a full list.");Object(r.keep)(e),this.tensors.push(e)}resize(e){if(e<0)throw new Error(`TensorListResize expects size to be non-negative. Got: ${e}`);if(-1!==this.maxNumElements&&e>this.maxNumElements)throw new Error(`TensorListResize input size ${e} is greater maxNumElement ${this.maxNumElements}.`);const t=new h([],this.elementShape,this.elementDtype,this.maxNumElements);t.tensors.length=e;for(let n=0;n<Math.min(this.tensors.length,e);++n)t.tensors[n]=this.tensors[n];return t}getItem(e,t,n){if(n!==this.elementDtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${this.elementDtype}`);if(e<0||e>this.tensors.length)throw new Error(`Trying to access element ${e} in a list with ${this.tensors.length} elements.`);if(null==this.tensors[e])throw new Error(`element at index ${e} is null.`);c(this.tensors[e].shape,t,"TensorList shape mismatch: ");const a=d(this.elementShape,this.tensors,t);return Object(r.reshape)(this.tensors[e],a)}setItem(e,t){if(t.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t.dtype}, but list elements ${this.elementDtype}`);if(e<0||-1!==this.maxNumElements&&e>=this.maxNumElements)throw new Error(`Trying to set element ${e} in a list with max ${this.maxNumElements} elements.`);c(this.elementShape,t.shape,"TensorList shape mismatch: "),Object(r.keep)(t),null!=this.tensors[e]&&(this.tensors[e].kept=!1),this.tensors[e]=t}gather(e,t,n){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);c(this.elementShape,n,"TensorList shape mismatch: "),e=e.slice(0,this.size());const a=d(this.elementShape,this.tensors,n);return 0===e.length?Object(r.tensor)([],[0].concat(a)):Object(r.tidy)((()=>{const t=e.map((e=>Object(r.reshape)(this.tensors[e],a)));return Object(r.stack)(t,0)}))}concat(e,t){if(e&&e!==this.elementDtype)throw new Error(`TensorList dtype is ${this.elementDtype} but concat requested dtype ${e}`);c(this.elementShape,t,"TensorList shape mismatch: ");const n=d(this.elementShape,this.tensors,t);return 0===this.size()?Object(r.tensor)([],[0].concat(n)):Object(r.tidy)((()=>{const e=this.tensors.map((e=>Object(r.reshape)(e,n)));return Object(r.concat)(e,0)}))}}const m=async(e,t,n)=>{switch(e.op){case"If":case"StatelessIf":{const r=Object(s.d)("thenBranch",e,t,n),a=Object(s.d)("elseBranch",e,t,n),o=Object(s.d)("cond",e,t,n),i=Object(s.d)("args",e,t,n);return(await o.data())[0]?n.functionMap[r].executeFunctionAsync(i,n.tensorArrayMap,n.tensorListMap):n.functionMap[a].executeFunctionAsync(i,n.tensorArrayMap,n.tensorListMap)}case"While":case"StatelessWhile":{const r=Object(s.d)("body",e,t,n),a=Object(s.d)("cond",e,t,n),o=Object(s.d)("args",e,t,n),i=await n.functionMap[a].executeFunctionAsync(o,n.tensorArrayMap,n.tensorListMap),u=o.map((e=>e.id));let c=await i[0].data();i.forEach((e=>{e.kept||-1!==u.indexOf(e.id)||e.dispose()}));let l=o;for(;c[0];){const e=l;l=await n.functionMap[r].executeFunctionAsync(l,n.tensorArrayMap,n.tensorListMap);const t=l.map((e=>e.id));e.forEach((e=>{e.kept||-1!==u.indexOf(e.id)||-1!==t.indexOf(e.id)||e.dispose()}));const s=await n.functionMap[a].executeFunctionAsync(l,n.tensorArrayMap,n.tensorListMap);c=await s[0].data(),s.forEach((e=>{e.kept||-1!==u.indexOf(e.id)||-1!==t.indexOf(e.id)||e.dispose()}))}return l}case"LoopCond":{const r=Object(s.d)("pred",e,t,n);return[Object(s.a)(r)]}case"Switch":{const r=Object(s.d)("pred",e,t,n);let a=Object(s.d)("data",e,t,n);return a.kept||(a=Object(s.a)(a)),(await r.data())[0]?[void 0,a]:[a,void 0]}case"Merge":{const r=e.inputNames.find((e=>void 0!==Object(s.e)(e,t,n)));if(r){const e=Object(s.e)(r,t,n);return[Object(s.a)(e)]}return}case"Enter":{const r=Object(s.d)("frameName",e,t,n),a=Object(s.d)("tensor",e,t,n);return n.enterFrame(r),[Object(s.a)(a)]}case"Exit":{const r=Object(s.d)("tensor",e,t,n);return n.exitFrame(),[Object(s.a)(r)]}case"NextIteration":{const r=Object(s.d)("tensor",e,t,n);return n.nextIteration(),[Object(s.a)(r)]}case"TensorArrayV3":{const a=Object(s.d)("size",e,t,n),o=Object(s.d)("dtype",e,t,n),i=Object(s.d)("elementShape",e,t,n),u=Object(s.d)("dynamicSize",e,t,n),c=Object(s.d)("clearAfterRead",e,t,n),l=Object(s.d)("identicalElementShapes",e,t,n),d=Object(s.d)("name",e,t,n),p=new f(d,o,a,i,l,u,c);return n.addTensorArray(p),[p.idTensor,Object(r.scalar)(1)]}case"TensorArrayWriteV3":{const r=Object(s.d)("tensorArrayId",e,t,n),a=Object(s.d)("index",e,t,n),o=Object(s.d)("tensor",e,t,n),i=n.getTensorArray(r.id);return i.write(a,o),[i.idTensor]}case"TensorArrayReadV3":{const r=Object(s.d)("tensorArrayId",e,t,n),a=Object(s.d)("index",e,t,n);return[n.getTensorArray(r.id).read(a)]}case"TensorArrayGatherV3":{const r=Object(s.d)("tensorArrayId",e,t,n),a=Object(s.d)("indices",e,t,n),o=Object(s.d)("dtype",e,t,n);return[n.getTensorArray(r.id).gather(a,o)]}case"TensorArrayScatterV3":{const r=Object(s.d)("tensorArrayId",e,t,n),a=Object(s.d)("indices",e,t,n),o=Object(s.d)("tensor",e,t,n),i=n.getTensorArray(r.id);return i.scatter(a,o),[i.idTensor]}case"TensorArrayConcatV3":{const r=Object(s.d)("tensorArrayId",e,t,n),a=n.getTensorArray(r.id),o=Object(s.d)("dtype",e,t,n);return[a.concat(o)]}case"TensorArraySplitV3":{const r=Object(s.d)("tensorArrayId",e,t,n),a=Object(s.d)("tensor",e,t,n),o=Object(s.d)("lengths",e,t,n),i=n.getTensorArray(r.id);return i.split(o,a),[i.idTensor]}case"TensorArraySizeV3":{const a=Object(s.d)("tensorArrayId",e,t,n),o=n.getTensorArray(a.id);return[Object(r.scalar)(o.size(),"int32")]}case"TensorArrayCloseV3":{const r=Object(s.d)("tensorArrayId",e,t,n),a=n.getTensorArray(r.id);return a.clearAndClose(),[a.idTensor]}case"TensorListSetItem":{const r=Object(s.d)("tensorListId",e,t,n),a=Object(s.d)("index",e,t,n),o=Object(s.d)("tensor",e,t,n),i=n.getTensorList(r.id);return i.setItem(a,o),[i.idTensor]}case"TensorListGetItem":{const r=Object(s.d)("tensorListId",e,t,n),a=Object(s.d)("index",e,t,n),o=Object(s.d)("elementShape",e,t,n),i=Object(s.d)("elementDType",e,t,n);return[n.getTensorList(r.id).getItem(a,o,i)]}case"TensorListScatterV2":case"TensorListScatter":{const a=Object(s.d)("indices",e,t,n),o=function(e,t,n,a){if(t.length!==e.shape[0])throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${t.length} vs. ${e.shape[0]}`);const s=Math.max(...t);if(null!=a&&-1!==a&&s>=a)throw new Error(`Max index must be < array size (${s} vs. ${a})`);const o=new h([],n,e.dtype,a),i=Object(r.unstack)(e,0);return t.forEach(((e,t)=>{o.setItem(e,i[t])})),o}(Object(s.d)("tensor",e,t,n),a,Object(s.d)("elementShape",e,t,n),Object(s.d)("numElements",e,t,n));return n.addTensorList(o),[o.idTensor]}case"TensorListReserve":case"EmptyTensorList":{const r=Object(s.d)("elementShape",e,t,n),a=Object(s.d)("elementDType",e,t,n);let o;o="TensorListReserve"===e.op?"numElements":"maxNumElements";const i=Object(s.d)(o,e,t,n),u=function(e,t,n,r){return new h([],e,t,r)}(r,a,0,"TensorListReserve"===e.op?-1:i);return n.addTensorList(u),[u.idTensor]}case"TensorListGather":{const r=Object(s.d)("tensorListId",e,t,n),a=Object(s.d)("indices",e,t,n),o=Object(s.d)("elementShape",e,t,n),i=Object(s.d)("elementDType",e,t,n);return[n.getTensorList(r.id).gather(a,i,o)]}case"TensorListStack":{const r=Object(s.d)("tensorListId",e,t,n),a=Object(s.d)("elementShape",e,t,n),o=Object(s.d)("elementDType",e,t,n),i=Object(s.d)("numElements",e,t,n);return[n.getTensorList(r.id).stack(a,o,i)]}case"TensorListFromTensor":{const a=function(e,t,n){const a=e.dtype;if(e.shape.length<1)throw new Error(`Tensor must be at least a vector, but saw shape: ${e.shape}`);if(e.dtype!==n)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${n}`);c(e.shape.slice(1),t,"TensorList shape mismatch: ");const s=Object(r.unstack)(e);return new h(s,t,a)}(Object(s.d)("tensor",e,t,n),Object(s.d)("elementShape",e,t,n),Object(s.d)("elementDType",e,t,n));return n.addTensorList(a),[a.idTensor]}case"TensorListConcat":case"TensorListConcatV2":{const r=Object(s.d)("tensorListId",e,t,n),a=n.getTensorList(r.id),o=Object(s.d)("dtype",e,t,n),i=Object(s.d)("elementShape",e,t,n);return[a.concat(o,i)]}case"TensorListPushBack":{const r=Object(s.d)("tensorListId",e,t,n),a=Object(s.d)("tensor",e,t,n),o=n.getTensorList(r.id);return o.pushBack(a),[o.idTensor]}case"TensorListPopBack":{const r=Object(s.d)("tensorListId",e,t,n),a=Object(s.d)("elementShape",e,t,n),o=Object(s.d)("elementDType",e,t,n);return[n.getTensorList(r.id).popBack(a,o)]}case"TensorListSplit":{const a=Object(s.d)("tensor",e,t,n),o=Object(s.d)("elementShape",e,t,n),i=function(e,t,n){let a=0;const s=t.map((e=>(a+=e,a)));if(a!==e.shape[0])throw new Error(`Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n ${a}, and tensor's shape is: ${e.shape}`);const o=p(e.shape.slice(1),n),i=0===a?0:e.size/a,u=Object(r.tidy)((()=>{const n=[];e=Object(r.reshape)(e,[1,a,i]);for(let a=0;a<t.length;++a){const u=[0,0===a?0:s[a-1],0],c=[1,t[a],i];n[a]=Object(r.reshape)(Object(r.slice)(e,u,c),o)}return e.dispose(),n})),c=new h([],n,e.dtype,t.length);for(let e=0;e<u.length;e++)c.setItem(e,u[e]);return c}(a,Object(s.d)("lengths",e,t,n),o);return n.addTensorList(i),[i.idTensor]}case"TensorListLength":{const a=Object(s.d)("tensorListId",e,t,n),o=n.getTensorList(a.id);return[Object(r.scalar)(o.size(),"int32")]}case"TensorListResize":{const r=Object(s.d)("tensorListId",e,t,n),a=Object(s.d)("size",e,t,n),o=n.getTensorList(r.id).resize(a);return n.addTensorList(o),[o.idTensor]}default:throw TypeError(`Node type ${e.op} is not implemented`)}};function b(e,t,n){const[r,a]=Object(s.d)("fusedOps",e,t,n),o="biasadd"===r,i=!o,u="prelu"===a,c="fusedbatchnorm"===r,l=Object(s.d)("numArgs",e,t,n);if(o){if(u&&2!==l)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!u&&o&&1!==l)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd must have one extra argument: bias.")}if(c)throw new Error("FusedConv2d and DepthwiseConv2d with FusedBatchNorm is not supported");const d=Object(s.d)("strides",e,t,n),p=Object(s.c)(e,t,n),f=Object(s.d)("dataFormat",e,t,n).toUpperCase(),h=Object(s.d)("dilations",e,t,n);let[m,b]=Object(s.d)("args",e,t,n);i&&(b=m,m=void 0);return{stride:d,pad:p,dataFormat:f,dilations:h,biasArg:m,preluArg:b,activationFunc:a,leakyreluAlpha:Object(s.d)("leakyreluAlpha",e,t,n)}}function g(e,t,n){return{boxes:Object(s.d)("boxes",e,t,n),scores:Object(s.d)("scores",e,t,n),maxOutputSize:Object(s.d)("maxOutputSize",e,t,n),iouThreshold:Object(s.d)("iouThreshold",e,t,n),scoreThreshold:Object(s.d)("scoreThreshold",e,t,n),softNmsSigma:Object(s.d)("softNmsSigma",e,t,n)}}class y{get id(){return this.handle.id}constructor(e,t){this.keyDType=e,this.valueDType=t,this.handle=Object(r.scalar)(0),this.tensorMap=new Map,Object(r.keep)(this.handle)}clearAndClose(){this.tensorMap.forEach((e=>e.dispose())),this.tensorMap.clear(),this.handle.dispose()}size(){return this.tensorMap.size}tensorSize(){return u.scalar(this.size(),"int32")}async import(e,t){this.checkKeyAndValueTensor(e,t);const n=await e.data();return this.tensorMap.forEach((e=>e.dispose())),this.tensorMap.clear(),Object(r.tidy)((()=>{const e=Object(r.unstack)(t),a=n.length,s=e.length;r.util.assert(a===s,(()=>`The number of elements doesn't match, keys has ${a} elements, the values has ${s} elements.`));for(let t=0;t<a;t++){const a=n[t],s=e[t];Object(r.keep)(s),this.tensorMap.set(a,s)}return this.handle}))}async find(e,t){this.checkKeyAndValueTensor(e,t);const n=await e.data();return Object(r.tidy)((()=>{const e=[];for(let r=0;r<n.length;r++){const a=n[r],s=this.findWithDefault(a,t);e.push(s)}return Object(r.stack)(e)}))}findWithDefault(e,t){const n=this.tensorMap.get(e);return null!=n?n:t}checkKeyAndValueTensor(e,t){if(e.dtype!==this.keyDType)throw new Error(`Expect key dtype ${this.keyDType}, but got ${e.dtype}`);if(t.dtype!==this.valueDType)throw new Error(`Expect value dtype ${this.valueDType}, but got ${t.dtype}`)}}function w(e,t,n,a,c=r.tidy){const l=((e,t,n)=>{switch(e.category){case"arithmetic":return c((()=>((e,t,n,r=u)=>{switch(e.op){case"BiasAdd":case"AddV2":case"Add":return[r.add(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"AddN":return[r.addN(Object(s.d)("tensors",e,t,n))];case"FloorMod":case"Mod":return[r.mod(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"Mul":return[r.mul(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"RealDiv":case"Div":return[r.div(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"DivNoNan":return[r.divNoNan(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"FloorDiv":return[r.floorDiv(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"Sub":return[r.sub(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"Minimum":return[r.minimum(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"Maximum":return[r.maximum(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"Pow":return[r.pow(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"SquaredDifference":return[r.squaredDifference(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"basic_math":return c((()=>((e,t,n,r=u)=>{switch(e.op){case"Abs":case"ComplexAbs":return[r.abs(Object(s.d)("x",e,t,n))];case"Acos":return[r.acos(Object(s.d)("x",e,t,n))];case"Acosh":return[r.acosh(Object(s.d)("x",e,t,n))];case"Asin":return[r.asin(Object(s.d)("x",e,t,n))];case"Asinh":return[r.asinh(Object(s.d)("x",e,t,n))];case"Atan":return[r.atan(Object(s.d)("x",e,t,n))];case"Atan2":return[r.atan2(Object(s.d)("x",e,t,n),Object(s.d)("y",e,t,n))];case"Atanh":return[r.atanh(Object(s.d)("x",e,t,n))];case"Ceil":return[r.ceil(Object(s.d)("x",e,t,n))];case"Complex":return[r.complex(Object(s.d)("real",e,t,n),Object(s.d)("imag",e,t,n))];case"Cos":return[r.cos(Object(s.d)("x",e,t,n))];case"Cosh":return[r.cosh(Object(s.d)("x",e,t,n))];case"Elu":return[r.elu(Object(s.d)("x",e,t,n))];case"Erf":return[r.erf(Object(s.d)("x",e,t,n))];case"Exp":return[r.exp(Object(s.d)("x",e,t,n))];case"Expm1":return[r.expm1(Object(s.d)("x",e,t,n))];case"Floor":return[r.floor(Object(s.d)("x",e,t,n))];case"Log":return[r.log(Object(s.d)("x",e,t,n))];case"Log1p":return[r.log1p(Object(s.d)("x",e,t,n))];case"Imag":return[r.imag(Object(s.d)("x",e,t,n))];case"Neg":return[r.neg(Object(s.d)("x",e,t,n))];case"Reciprocal":return[r.reciprocal(Object(s.d)("x",e,t,n))];case"Real":return[r.real(Object(s.d)("x",e,t,n))];case"Relu":return[r.relu(Object(s.d)("x",e,t,n))];case"Round":return[r.round(Object(s.d)("x",e,t,n))];case"Selu":return[r.selu(Object(s.d)("x",e,t,n))];case"Sigmoid":return[r.sigmoid(Object(s.d)("x",e,t,n))];case"Sin":return[r.sin(Object(s.d)("x",e,t,n))];case"Sign":return[r.sign(Object(s.d)("x",e,t,n))];case"Sinh":return[r.sinh(Object(s.d)("x",e,t,n))];case"Softplus":return[r.softplus(Object(s.d)("x",e,t,n))];case"Sqrt":return[r.sqrt(Object(s.d)("x",e,t,n))];case"Square":return[r.square(Object(s.d)("x",e,t,n))];case"Tanh":return[r.tanh(Object(s.d)("x",e,t,n))];case"Tan":return[r.tan(Object(s.d)("x",e,t,n))];case"ClipByValue":return[r.clipByValue(Object(s.d)("x",e,t,n),Object(s.d)("clipValueMin",e,t,n),Object(s.d)("clipValueMax",e,t,n))];case"Relu6":return[r.relu6(Object(s.d)("x",e,t,n))];case"Rsqrt":return[r.rsqrt(Object(s.e)(e.inputNames[0],t,n))];case"LeakyRelu":return[r.leakyRelu(Object(s.d)("x",e,t,n),Object(s.d)("alpha",e,t,n))];case"Prelu":return[r.prelu(Object(s.d)("x",e,t,n),Object(s.d)("alpha",e,t,n))];case"IsNan":return[r.isNaN(Object(s.e)(e.inputNames[0],t,n))];case"IsInf":return[r.isInf(Object(s.e)(e.inputNames[0],t,n))];case"IsFinite":return[r.isFinite(Object(s.e)(e.inputNames[0],t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"control":return m(e,t,n);case"convolution":return c((()=>((e,t,n,r=u)=>{switch(e.op){case"Conv1D":{const a=Object(s.d)("stride",e,t,n),o=Object(s.d)("pad",e,t,n),i=Object(s.d)("dataFormat",e,t,n).toUpperCase(),u=Object(s.d)("dilation",e,t,n);return[r.conv1d(Object(s.d)("x",e,t,n),Object(s.d)("filter",e,t,n),a,o,i,u)]}case"Conv2D":{const a=Object(s.d)("strides",e,t,n),o=Object(s.c)(e,t,n),i=Object(s.d)("dataFormat",e,t,n).toUpperCase(),u=Object(s.d)("dilations",e,t,n);return[r.conv2d(Object(s.d)("x",e,t,n),Object(s.d)("filter",e,t,n),[a[1],a[2]],o,i,[u[1],u[2]])]}case"_FusedConv2D":{const{stride:a,pad:o,dataFormat:i,dilations:u,biasArg:c,preluArg:l,activationFunc:d,leakyreluAlpha:p}=b(e,t,n);return[r.fused.conv2d({x:Object(s.d)("x",e,t,n),filter:Object(s.d)("filter",e,t,n),strides:[a[1],a[2]],pad:o,dataFormat:i,dilations:[u[1],u[2]],bias:c,activation:d,preluActivationWeights:l,leakyreluAlpha:p})]}case"FusedDepthwiseConv2dNative":{const{stride:a,pad:o,dataFormat:i,dilations:u,biasArg:c,preluArg:l,activationFunc:d,leakyreluAlpha:p}=b(e,t,n);return[r.fused.depthwiseConv2d({x:Object(s.d)("x",e,t,n),filter:Object(s.d)("filter",e,t,n),strides:[a[1],a[2]],pad:o,dataFormat:i,dilations:[u[1],u[2]],bias:c,activation:d,preluActivationWeights:l,leakyreluAlpha:p})]}case"Conv2DBackpropInput":case"Conv2dTranspose":{const a=Object(s.d)("outputShape",e,t,n),o=Object(s.d)("strides",e,t,n),i=Object(s.c)(e,t,n);return[r.conv2dTranspose(Object(s.d)("x",e,t,n),Object(s.d)("filter",e,t,n),a,[o[1],o[2]],i)]}case"DepthwiseConv2dNative":case"DepthwiseConv2d":{const a=Object(s.d)("strides",e,t,n),o=Object(s.c)(e,t,n),i=Object(s.d)("dilations",e,t,n),u=Object(s.d)("dataFormat",e,t,n).toUpperCase();return[r.depthwiseConv2d(Object(s.d)("input",e,t,n),Object(s.d)("filter",e,t,n),[a[1],a[2]],o,u,[i[1],i[2]])]}case"Conv3D":{const a=Object(s.d)("strides",e,t,n),o=Object(s.d)("pad",e,t,n),i=Object(s.d)("dataFormat",e,t,n).toUpperCase(),u=Object(s.d)("dilations",e,t,n);return[r.conv3d(Object(s.d)("x",e,t,n),Object(s.d)("filter",e,t,n),[a[1],a[2],a[3]],o,i,[u[1],u[2],u[3]])]}case"AvgPool":{const a=Object(s.d)("strides",e,t,n),o=Object(s.d)("pad",e,t,n),i=Object(s.d)("kernelSize",e,t,n);return[r.avgPool(Object(s.d)("x",e,t,n),[i[1],i[2]],[a[1],a[2]],o)]}case"MaxPool":{const a=Object(s.d)("strides",e,t,n),o=Object(s.d)("pad",e,t,n),i=Object(s.d)("kernelSize",e,t,n);return[r.maxPool(Object(s.d)("x",e,t,n),[i[1],i[2]],[a[1],a[2]],o)]}case"MaxPoolWithArgmax":{const a=Object(s.d)("strides",e,t,n),o=Object(s.d)("pad",e,t,n),i=Object(s.d)("kernelSize",e,t,n),u=Object(s.d)("includeBatchInIndex",e,t,n),{result:c,indexes:l}=r.maxPoolWithArgmax(Object(s.d)("x",e,t,n),[i[1],i[2]],[a[1],a[2]],o,u);return[c,l]}case"AvgPool3D":{const a=Object(s.d)("strides",e,t,n),o=Object(s.d)("pad",e,t,n),i=Object(s.d)("kernelSize",e,t,n);return[r.avgPool3d(Object(s.d)("x",e,t,n),[i[1],i[2],i[3]],[a[1],a[2],a[3]],o)]}case"MaxPool3D":{const a=Object(s.d)("strides",e,t,n),o=Object(s.d)("pad",e,t,n),i=Object(s.d)("kernelSize",e,t,n);return[r.maxPool3d(Object(s.d)("x",e,t,n),[i[1],i[2],i[3]],[a[1],a[2],a[3]],o)]}case"Dilation2D":{const a=Object(s.d)("strides",e,t,n),o=Object(s.d)("pad",e,t,n),i=Object(s.d)("dilations",e,t,n),u=a[1],c=a[2],l=i[1],d=i[2];return[r.dilation2d(Object(s.d)("x",e,t,n),Object(s.d)("filter",e,t,n),[u,c],o,[l,d],"NHWC")]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"creation":return c((()=>((e,t,n,r=u)=>{switch(e.op){case"Fill":{const a=Object(s.d)("shape",e,t,n),o=Object(s.d)("dtype",e,t,n),i=Object(s.d)("value",e,t,n);return[r.fill(a,i,o)]}case"LinSpace":{const a=Object(s.d)("start",e,t,n),o=Object(s.d)("stop",e,t,n),i=Object(s.d)("num",e,t,n);return[r.linspace(a,o,i)]}case"Multinomial":{const a=Object(s.d)("logits",e,t,n),o=Object(s.d)("numSamples",e,t,n),i=Object(s.d)("seed",e,t,n);return[r.multinomial(a,o,i)]}case"OneHot":{const a=Object(s.d)("indices",e,t,n),o=Object(s.d)("depth",e,t,n),i=Object(s.d)("onValue",e,t,n),u=Object(s.d)("offValue",e,t,n),c=Object(s.d)("dtype",e,t,n);return[r.oneHot(a,o,i,u,c)]}case"Ones":return[r.ones(Object(s.d)("shape",e,t,n),Object(s.d)("dtype",e,t,n))];case"OnesLike":return[r.onesLike(Object(s.d)("x",e,t,n))];case"RandomStandardNormal":return[r.randomStandardNormal(Object(s.d)("shape",e,t,n),Object(s.d)("dtype",e,t,n),Object(s.d)("seed",e,t,n))];case"RandomUniform":return[r.randomUniform(Object(s.d)("shape",e,t,n),Object(s.d)("minval",e,t,n),Object(s.d)("maxval",e,t,n),Object(s.d)("dtype",e,t,n))];case"RandomUniformInt":return[r.randomUniformInt(Object(s.d)("shape",e,t,n),Object(s.d)("minval",e,t,n),Object(s.d)("maxval",e,t,n),Object(s.d)("seed",e,t,n))];case"Range":{const a=Object(s.d)("start",e,t,n),o=Object(s.d)("stop",e,t,n),i=Object(s.d)("step",e,t,n);return[r.range(a,o,i,Object(s.d)("dtype",e,t,n))]}case"TruncatedNormal":{const a=Object(s.d)("shape",e,t,n),o=Object(s.d)("mean",e,t,n),i=Object(s.d)("stdDev",e,t,n),u=Object(s.d)("seed",e,t,n);return[r.truncatedNormal(a,o,i,Object(s.d)("dtype",e,t,n),u)]}case"Zeros":return[r.zeros(Object(s.d)("shape",e,t,n),Object(s.d)("dtype",e,t,n))];case"ZerosLike":return[r.zerosLike(Object(s.d)("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"dynamic":return(async(e,t,n,r,a=u)=>{switch(e.op){case"NonMaxSuppressionV5":{const{boxes:r,scores:s,maxOutputSize:o,iouThreshold:i,scoreThreshold:u,softNmsSigma:c}=g(e,t,n),l=await a.image.nonMaxSuppressionWithScoreAsync(r,s,o,i,u,c);return[l.selectedIndices,l.selectedScores]}case"NonMaxSuppressionV4":{const{boxes:r,scores:o,maxOutputSize:i,iouThreshold:u,scoreThreshold:c}=g(e,t,n),l=Object(s.d)("padToMaxOutputSize",e,t,n),d=await a.image.nonMaxSuppressionPaddedAsync(r,o,i,u,c,l);return[d.selectedIndices,d.validOutputs]}case"NonMaxSuppressionV3":case"NonMaxSuppressionV2":{const{boxes:r,scores:s,maxOutputSize:o,iouThreshold:i,scoreThreshold:u}=g(e,t,n);return[await a.image.nonMaxSuppressionAsync(r,s,o,i,u)]}case"Where":{const r=a.cast(Object(s.d)("condition",e,t,n),"bool"),o=[await a.whereAsync(r)];return r.dispose(),o}case"ListDiff":return a.setdiff1dAsync(Object(s.d)("x",e,t,n),Object(s.d)("y",e,t,n));default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n);case"evaluation":return c((()=>((e,t,n,r=u)=>{switch(e.op){case"LowerBound":{const a=Object(s.d)("sortedSequence",e,t,n),o=Object(s.d)("values",e,t,n);return[r.lowerBound(a,o)]}case"TopKV2":{const a=Object(s.d)("x",e,t,n),o=Object(s.d)("k",e,t,n),i=Object(s.d)("sorted",e,t,n),u=r.topk(a,o,i);return[u.values,u.indices]}case"UpperBound":{const a=Object(s.d)("sortedSequence",e,t,n),o=Object(s.d)("values",e,t,n);return[r.upperBound(a,o)]}case"Unique":{const a=Object(s.d)("x",e,t,n),o=r.unique(a);return[o.values,o.indices]}case"UniqueV2":{const a=Object(s.d)("x",e,t,n),o=Object(s.d)("axis",e,t,n),i=r.unique(a,o);return[i.values,i.indices]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"image":return c((()=>((e,t,n,r=u)=>{switch(e.op){case"ResizeBilinear":{const a=Object(s.d)("images",e,t,n),o=Object(s.d)("size",e,t,n),i=Object(s.d)("alignCorners",e,t,n),u=Object(s.d)("halfPixelCenters",e,t,n);return[r.image.resizeBilinear(a,[o[0],o[1]],i,u)]}case"ResizeNearestNeighbor":{const a=Object(s.d)("images",e,t,n),o=Object(s.d)("size",e,t,n),i=Object(s.d)("alignCorners",e,t,n),u=Object(s.d)("halfPixelCenters",e,t,n);return[r.image.resizeNearestNeighbor(a,[o[0],o[1]],i,u)]}case"CropAndResize":{const a=Object(s.d)("image",e,t,n),o=Object(s.d)("boxes",e,t,n),i=Object(s.d)("boxInd",e,t,n),u=Object(s.d)("cropSize",e,t,n),c=Object(s.d)("method",e,t,n),l=Object(s.d)("extrapolationValue",e,t,n);return[r.image.cropAndResize(a,o,i,u,c,l)]}case"ImageProjectiveTransformV3":{const a=Object(s.d)("images",e,t,n),o=Object(s.d)("transforms",e,t,n),i=Object(s.d)("outputShape",e,t,n),u=Object(s.d)("fillValue",e,t,n),c=Object(s.d)("interpolation",e,t,n),l=Object(s.d)("fillMode",e,t,n);return[r.image.transform(a,o,c.toLowerCase(),l.toLowerCase(),u,i)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"graph":return c((()=>((e,t,n,r=u)=>{switch(e.op){case"Const":return t[e.name];case"PlaceholderWithDefault":const a=Object(s.d)("default",e,t,n);return[Object(s.e)(e.name,t,n)||a];case"Placeholder":return[Object(s.e)(e.name,t,n)];case"Identity":case"StopGradient":case"FakeQuantWithMinMaxVars":{const r=Object(s.d)("x",e,t,n);return[Object(s.a)(r)]}case"IdentityN":return Object(s.d)("x",e,t,n).map((e=>Object(s.a)(e)));case"Snapshot":const o=Object(s.d)("x",e,t,n);return[Object(s.a)(o)];case"Shape":return[r.tensor1d(Object(s.d)("x",e,t,n).shape,"int32")];case"ShapeN":return Object(s.d)("x",e,t,n).map((e=>r.tensor1d(e.shape)));case"Size":return[r.scalar(Object(s.d)("x",e,t,n).size,"int32")];case"Rank":return[r.scalar(Object(s.d)("x",e,t,n).rank,"int32")];case"NoOp":return[r.scalar(1)];case"Print":const i=Object(s.d)("x",e,t,n),u=Object(s.d)("data",e,t,n),c=Object(s.d)("message",e,t,n),l=Object(s.d)("summarize",e,t,n);console.warn("The graph has a tf.print() operation,usually used for debugging, which slows down performance."),console.log(c);for(let e=0;e<u.length;e++)console.log(Array.prototype.slice.call(u[e].dataSync()).slice(0,l));return[i];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"logical":return c((()=>((e,t,n,r=u)=>{switch(e.op){case"Equal":return[r.equal(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"NotEqual":return[r.notEqual(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"Greater":return[r.greater(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"GreaterEqual":return[r.greaterEqual(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"Less":return[r.less(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"LessEqual":return[r.lessEqual(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"LogicalAnd":return[r.logicalAnd(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"LogicalNot":return[r.logicalNot(Object(s.d)("a",e,t,n))];case"LogicalOr":return[r.logicalOr(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"Select":case"SelectV2":return[r.where(Object(s.d)("condition",e,t,n),Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];case"BitwiseAnd":return[r.bitwiseAnd(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"matrices":return c((()=>((e,t,n,r=u)=>{switch(e.op){case"BatchMatMul":case"BatchMatMulV2":case"MatMul":return[r.matMul(Object(s.d)("a",e,t,n),Object(s.d)("b",e,t,n),Object(s.d)("transposeA",e,t,n),Object(s.d)("transposeB",e,t,n))];case"Einsum":return[r.einsum(Object(s.d)("equation",e,t,n),...Object(s.d)("tensors",e,t,n))];case"Transpose":return[r.transpose(Object(s.d)("x",e,t,n),Object(s.d)("perm",e,t,n))];case"_FusedMatMul":const[a,o]=Object(s.d)("fusedOps",e,t,n),i="biasadd"===a,u="prelu"===o,c=Object(s.d)("numArgs",e,t,n),l=Object(s.d)("leakyreluAlpha",e,t,n);if(i){if(u&&2!==c)throw new Error("Fused MatMul with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!u&&1!==c)throw new Error("Fused MatMul with BiasAdd must have one extra argument: bias.")}const[d,p]=Object(s.d)("args",e,t,n);return[r.fused.matMul({a:Object(s.d)("a",e,t,n),b:Object(s.d)("b",e,t,n),transposeA:Object(s.d)("transposeA",e,t,n),transposeB:Object(s.d)("transposeB",e,t,n),bias:d,activation:o,preluActivationWeights:p,leakyreluAlpha:l})];case"MatrixBandPart":return[r.linalg.bandPart(Object(s.d)("a",e,t,n),Object(s.d)("numLower",e,t,n),Object(s.d)("numUpper",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"normalization":return c((()=>((e,t,n,r=u)=>{switch(e.op){case"EuclideanNorm":return[r.euclideanNorm(Object(s.d)("x",e,t,n),Object(s.d)("axis",e,t,n),Object(s.d)("keepDims",e,t,n))];case"FusedBatchNorm":case"FusedBatchNormV2":case"FusedBatchNormV3":return[r.batchNorm(Object(s.d)("x",e,t,n),Object(s.d)("mean",e,t,n),Object(s.d)("variance",e,t,n),Object(s.d)("offset",e,t,n),Object(s.d)("scale",e,t,n),Object(s.d)("epsilon",e,t,n))];case"LRN":return[r.localResponseNormalization(Object(s.d)("x",e,t,n),Object(s.d)("radius",e,t,n),Object(s.d)("bias",e,t,n),Object(s.d)("alpha",e,t,n),Object(s.d)("beta",e,t,n))];case"Softmax":return[r.softmax(Object(s.d)("x",e,t,n))];case"LogSoftmax":return[r.logSoftmax(Object(s.d)("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"ragged":return c((()=>((e,t,n,r=u)=>{switch(e.op){case"RaggedGather":{const{outputNestedSplits:a,outputDenseValues:o}=r.raggedGather(Object(s.d)("paramsNestedSplits",e,t,n),Object(s.d)("paramsDenseValues",e,t,n),Object(s.d)("indices",e,t,n),Object(s.d)("outputRaggedRank",e,t,n));return a.concat(o)}case"RaggedRange":{const{rtNestedSplits:a,rtDenseValues:o}=r.raggedRange(Object(s.d)("starts",e,t,n),Object(s.d)("limits",e,t,n),Object(s.d)("splits",e,t,n));return[a,o]}case"RaggedTensorToTensor":return[r.raggedTensorToTensor(Object(s.d)("shape",e,t,n),Object(s.d)("values",e,t,n),Object(s.d)("defaultValue",e,t,n),Object(s.d)("rowPartitionTensors",e,t,n),Object(s.d)("rowPartitionTypes",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"reduction":return c((()=>((e,t,n,r=u)=>{switch(e.op){case"Max":{const a=Object(s.d)("axis",e,t,n),o=Object(s.d)("keepDims",e,t,n);return[r.max(Object(s.d)("x",e,t,n),a,o)]}case"Mean":{const a=Object(s.d)("axis",e,t,n),o=Object(s.d)("keepDims",e,t,n);return[r.mean(Object(s.d)("x",e,t,n),a,o)]}case"Min":{const a=Object(s.d)("axis",e,t,n),o=Object(s.d)("keepDims",e,t,n);return[r.min(Object(s.d)("x",e,t,n),a,o)]}case"Sum":{const a=Object(s.d)("axis",e,t,n),o=Object(s.d)("keepDims",e,t,n);return[r.sum(Object(s.d)("x",e,t,n),a,o)]}case"All":{const a=Object(s.d)("axis",e,t,n),o=Object(s.d)("keepDims",e,t,n);return[r.all(Object(s.d)("x",e,t,n),a,o)]}case"Any":{const a=Object(s.d)("axis",e,t,n),o=Object(s.d)("keepDims",e,t,n);return[r.any(Object(s.d)("x",e,t,n),a,o)]}case"ArgMax":{const a=Object(s.d)("axis",e,t,n);return[r.argMax(Object(s.d)("x",e,t,n),a)]}case"ArgMin":{const a=Object(s.d)("axis",e,t,n);return[r.argMin(Object(s.d)("x",e,t,n),a)]}case"Prod":{const a=Object(s.d)("axis",e,t,n),o=Object(s.d)("keepDims",e,t,n);return[r.prod(Object(s.d)("x",e,t,n),a,o)]}case"Cumprod":{const a=Object(s.d)("axis",e,t,n),o=Object(s.d)("exclusive",e,t,n),i=Object(s.d)("reverse",e,t,n);return[r.cumprod(Object(s.d)("x",e,t,n),a,o,i)]}case"Cumsum":{const a=Object(s.d)("axis",e,t,n),o=Object(s.d)("exclusive",e,t,n),i=Object(s.d)("reverse",e,t,n);return[r.cumsum(Object(s.d)("x",e,t,n),a,o,i)]}case"Bincount":const a=Object(s.d)("x",e,t,n),o=Object(s.d)("weights",e,t,n),i=Object(s.d)("size",e,t,n);return[r.bincount(a,o,i)];case"DenseBincount":{const a=Object(s.d)("x",e,t,n),o=Object(s.d)("weights",e,t,n),i=Object(s.d)("size",e,t,n),u=Object(s.d)("binaryOutput",e,t,n);return[r.denseBincount(a,o,i,u)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"slice_join":return c((()=>((e,t,n,a=u)=>{switch(e.op){case"ConcatV2":case"Concat":{const r=Object(s.d)("n",e,t,n),o=Object(s.d)("axis",e,t,n);let i=Object(s.d)("tensors",e,t,n);return i=i.slice(0,r),[a.concat(i,o)]}case"Gather":{const r=Object(s.d)("x",e,t,n),o=Object(s.d)("indices",e,t,n);return[a.gather(r,a.cast(o,"int32"),0)]}case"GatherV2":{const r=Object(s.d)("axis",e,t,n),o=Object(s.d)("batchDims",e,t,n),i=Object(s.d)("x",e,t,n),u=Object(s.d)("indices",e,t,n);return[a.gather(i,a.cast(u,"int32"),r,o)]}case"Reverse":{const r=Object(s.d)("dims",e,t,n),o=[];for(let e=0;e<r.length;e++)r[e]&&o.push(e);const i=Object(s.d)("x",e,t,n);return[a.reverse(i,o)]}case"ReverseV2":{const r=Object(s.d)("axis",e,t,n),o=Object(s.d)("x",e,t,n);return[a.reverse(o,r)]}case"Slice":{const r=Object(s.d)("begin",e,t,n),o=Object(s.d)("size",e,t,n);return[a.slice(Object(s.d)("x",e,t,n),r,o)]}case"StridedSlice":{const r=Object(s.d)("begin",e,t,n),o=Object(s.d)("end",e,t,n),i=Object(s.d)("strides",e,t,n),u=Object(s.d)("beginMask",e,t,n),c=Object(s.d)("endMask",e,t,n),l=Object(s.d)("ellipsisMask",e,t,n),d=Object(s.d)("newAxisMask",e,t,n),p=Object(s.d)("shrinkAxisMask",e,t,n),f=Object(s.d)("x",e,t,n);return[a.stridedSlice(f,r,o,i,u,c,l,d,p)]}case"Pack":return Object(r.tidy)((()=>{const o=Object(s.d)("axis",e,t,n),i=Object(s.d)("tensors",e,t,n),u=i[0].shape,c=a.squeeze(i[0]).shape,l=i.map((e=>{const t=r.util.arraysEqual(e.shape,u);if(!t&&!r.util.arraysEqual(a.squeeze(e).shape,c))throw new Error("the input tensors shape does not match");return t?e:a.reshape(e,u)}));return[a.stack(l,o)]}));case"Unpack":{const r=Object(s.d)("axis",e,t,n),o=Object(s.d)("tensor",e,t,n);return a.unstack(o,r)}case"Tile":{const r=Object(s.d)("reps",e,t,n);return[a.tile(Object(s.d)("x",e,t,n),r)]}case"Split":case"SplitV":{const r=Object(s.d)("axis",e,t,n),o=Object(s.d)("numOrSizeSplits",e,t,n),i=Object(s.d)("x",e,t,n);return a.split(i,o,r)}case"ScatterNd":{const r=Object(s.d)("indices",e,t,n),o=Object(s.d)("values",e,t,n),i=Object(s.d)("shape",e,t,n);return[a.scatterND(r,o,i)]}case"GatherNd":{const r=Object(s.d)("x",e,t,n),o=Object(s.d)("indices",e,t,n);return[a.gatherND(r,o)]}case"SparseToDense":{const r=Object(s.d)("sparseIndices",e,t,n),o=Object(s.d)("outputShape",e,t,n),i=Object(s.d)("sparseValues",e,t,n),u=Object(s.d)("defaultValue",e,t,n);return[a.sparseToDense(r,i,o,i.dtype===u.dtype?u:a.cast(u,i.dtype))]}case"TensorScatterUpdate":{const r=Object(s.d)("indices",e,t,n),o=Object(s.d)("values",e,t,n),i=Object(s.d)("tensor",e,t,n);return[a.tensorScatterUpdate(i,r,o)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"sparse":return c((()=>((e,t,n,r=u)=>{switch(e.op){case"SparseFillEmptyRows":{const{outputIndices:a,outputValues:o,emptyRowIndicator:i,reverseIndexMap:u}=r.sparse.sparseFillEmptyRows(Object(s.d)("indices",e,t,n),Object(s.d)("values",e,t,n),Object(s.d)("denseShape",e,t,n),Object(s.d)("defaultValue",e,t,n));return[a,o,i,u]}case"SparseReshape":{const{outputIndices:a,outputShape:o}=r.sparse.sparseReshape(Object(s.d)("inputIndices",e,t,n),Object(s.d)("inputShape",e,t,n),Object(s.d)("newShape",e,t,n));return[a,o]}case"SparseSegmentMean":return[r.sparse.sparseSegmentMean(Object(s.d)("data",e,t,n),Object(s.d)("indices",e,t,n),Object(s.d)("segmentIds",e,t,n))];case"SparseSegmentSum":return[r.sparse.sparseSegmentSum(Object(s.d)("data",e,t,n),Object(s.d)("indices",e,t,n),Object(s.d)("segmentIds",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"spectral":return c((()=>((e,t,n,r=u)=>{switch(e.op){case"FFT":return[r.fft(Object(s.d)("x",e,t,n))];case"IFFT":return[r.ifft(Object(s.d)("x",e,t,n))];case"RFFT":return[r.rfft(Object(s.d)("x",e,t,n))];case"IRFFT":return[r.irfft(Object(s.d)("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"string":return c((()=>((e,t,n,r=u)=>{switch(e.op){case"StaticRegexReplace":return[r.string.staticRegexReplace(Object(s.d)("input",e,t,n),Object(s.d)("pattern",e,t,n),Object(s.d)("rewrite",e,t,n),Object(s.d)("replaceGlobal",e,t,n))];case"StringNGrams":{const{nGrams:a,nGramsSplits:o}=r.string.stringNGrams(Object(s.d)("data",e,t,n),Object(s.d)("dataSplits",e,t,n),Object(s.d)("separator",e,t,n),Object(s.d)("nGramWidths",e,t,n),Object(s.d)("leftPad",e,t,n),Object(s.d)("rightPad",e,t,n),Object(s.d)("padWidth",e,t,n),Object(s.d)("preserveShortSequences",e,t,n));return[a,o]}case"StringSplit":{const{indices:a,values:o,shape:i}=r.string.stringSplit(Object(s.d)("input",e,t,n),Object(s.d)("delimiter",e,t,n),Object(s.d)("skipEmpty",e,t,n));return[a,o,i]}case"StringToHashBucketFast":return[r.string.stringToHashBucketFast(Object(s.d)("input",e,t,n),Object(s.d)("numBuckets",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"transformation":return c((()=>((e,t,n,r=u)=>{switch(e.op){case"Cast":return[r.cast(Object(s.d)("x",e,t,n),Object(s.d)("dtype",e,t,n))];case"ExpandDims":{const a=Object(s.d)("axis",e,t,n);return[r.expandDims(Object(s.d)("x",e,t,n),a)]}case"Squeeze":{const a=Object(s.d)("axis",e,t,n);return[r.squeeze(Object(s.d)("x",e,t,n),a)]}case"Reshape":return[r.reshape(Object(s.d)("x",e,t,n),Object(s.d)("shape",e,t,n))];case"EnsureShape":return[r.ensureShape(Object(s.d)("x",e,t,n),Object(s.d)("shape",e,t,n))];case"MirrorPad":return[r.mirrorPad(Object(s.d)("x",e,t,n),Object(s.d)("padding",e,t,n),Object(s.d)("mode",e,t,n))];case"PadV2":case"Pad":return[r.pad(Object(s.d)("x",e,t,n),Object(s.d)("padding",e,t,n),Object(s.d)("constantValue",e,t,n))];case"SpaceToBatchND":{const a=Object(s.d)("blockShape",e,t,n),o=Object(s.d)("paddings",e,t,n);return[r.spaceToBatchND(Object(s.d)("x",e,t,n),a,o)]}case"BatchToSpaceND":{const a=Object(s.d)("blockShape",e,t,n),o=Object(s.d)("crops",e,t,n);return[r.batchToSpaceND(Object(s.d)("x",e,t,n),a,o)]}case"DepthToSpace":{const a=Object(s.d)("blockSize",e,t,n),o=Object(s.d)("dataFormat",e,t,n).toUpperCase();return[r.depthToSpace(Object(s.d)("x",e,t,n),a,o)]}case"BroadcastTo":return[r.broadcastTo(Object(s.d)("x",e,t,n),Object(s.d)("shape",e,t,n))];case"BroadcastArgs":return[r.broadcastArgs(Object(s.d)("s0",e,t,n),Object(s.d)("s1",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"hash_table":return(async(e,t,n,r)=>{switch(e.op){case"HashTable":case"HashTableV2":{const a=r.getHashTableHandleByName(e.name);if(null!=a)return[a];{const a=Object(s.d)("keyDType",e,t,n),o=Object(s.d)("valueDType",e,t,n),i=new y(a,o);return r.addHashTable(e.name,i),[i.handle]}}case"InitializeTable":case"InitializeTableV2":case"LookupTableImport":case"LookupTableImportV2":{const a=Object(s.d)("tableHandle",e,t,n,r),o=Object(s.d)("keys",e,t,n),i=Object(s.d)("values",e,t,n),u=r.getHashTableById(a.id);return[await u.import(o,i)]}case"LookupTableFind":case"LookupTableFindV2":{const a=Object(s.d)("tableHandle",e,t,n,r),o=Object(s.d)("keys",e,t,n),i=Object(s.d)("defaultValue",e,t,n),u=r.getHashTableById(a.id);return[await u.find(o,i)]}case"LookupTableSize":case"LookupTableSizeV2":{const a=Object(s.d)("tableHandle",e,t,n,r);return[r.getHashTableById(a.id).tensorSize()]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n,a);case"custom":const l=Object(i.b)(e.op);if(l&&l.customExecutor)return l.customExecutor(new o(e,t,n));throw TypeError(`Custom op ${e.op} is not registered.`);default:throw TypeError(`Unknown op '${e.op}'. File an issue at https://github.com/tensorflow/tfjs/issues so we can add it, or register a custom execution with tf.registerOp()`)}})(e,t,n);return r.util.isPromise(l)?l.then((e=>[].concat(e))):[].concat(l)}class O{constructor(e={},t={},n={},r={},a){this.weightMap=e,this.tensorArrayMap=t,this.tensorListMap=n,this.functionMap=r,this.parseNodeNameCache=a,this.rootContext={id:0,frameName:"",iterationId:0},this.contexts=[this.rootContext],this.lastId=0,this.generateCurrentContextIds()}newFrame(e,t){return{id:e,frameName:t,iterationId:0}}set currentContext(e){this.contexts!==e&&(this.contexts=e,this.generateCurrentContextIds())}get currentContext(){return this.contexts}get currentContextId(){return this._currentContextIds[0]}get currentContextIds(){return this._currentContextIds}generateCurrentContextIds(){const e=[];for(let t=0;t<this.contexts.length-1;t++){const n=this.contexts.slice(0,this.contexts.length-t);e.push(this.contextIdforContexts(n))}e.push(""),this._currentContextIds=e}contextIdforContexts(e){return e?e.map((e=>0===e.id&&0===e.iterationId?"":`${e.frameName}-${e.iterationId}`)).join("/"):""}enterFrame(e){this.contexts&&(this.lastId++,this.contexts=this.contexts.slice(),this.contexts.push(this.newFrame(this.lastId,e)),this._currentContextIds.unshift(this.contextIdforContexts(this.contexts)))}exitFrame(){if(!(this.contexts&&this.contexts.length>1))throw new Error("Cannot exit frame, the context is empty");this.contexts=this.contexts.slice(),this.contexts.splice(-1),this.currentContextIds.shift()}nextIteration(){if(!(this.contexts&&this.contexts.length>0))throw new Error("Cannot increase frame iteration, the context is empty");{this.contexts=this.contexts.slice(),this.lastId++;const e=Object.assign({},this.contexts[this.contexts.length-1]);e.iterationId+=1,e.id=this.lastId,this.contexts.splice(-1,1,e),this._currentContextIds.splice(0,1,this.contextIdforContexts(this.contexts))}}getWeight(e){return this.weightMap[e]}addTensorArray(e){this.tensorArrayMap[e.id]=e}getTensorArray(e){return this.tensorArrayMap[e]}addTensorList(e){this.tensorListMap[e.id]=e}getTensorList(e){return this.tensorListMap[e]}dispose(e){for(const t in this.tensorArrayMap)this.tensorArrayMap[t].clearAndClose(e);for(const t in this.tensorListMap)this.tensorListMap[t].clearAndClose(e)}}function v(e,t,n,r){const a=new Set,o=[];let i=null,u=null;const c=new Set,l=new Set(Object.keys(e).map((e=>Object(s.g)(e)[0])));r=r||[];const d=new Set(r.map((e=>Object(s.g)(e.name)[0]))),p=[...t];for(;p.length>0;){const e=p.pop();(E(e)||T(e)||N(e))&&null==i&&(i=e,u=i.children.map((e=>e.name)).filter((e=>a.has(e)))),a.add(e.name),null==n[e.name]&&(l.has(e.name)||d.has(e.name)||(0!==e.inputs.length?e.inputs.forEach((e=>{c.has(e.name)||(c.add(e.name),p.push(e))})):o.push(e.name)))}return{inputs:e,outputs:t,usedNodes:a,missingInputs:o,dynamicNode:i,syncInputs:u}}function j(e,t){const{usedNodes:n,inputs:r}=t,a=Object.keys(r).map((e=>Object(s.g)(e)[0])).map((t=>e.nodes[t])),o=e.initNodes||[],i=e=>n.has("string"==typeof e?e:e.name);function u(e){return[...new Map(e.map((e=>[e.name,e]))).values()]}const c=u([...a,...e.weights,...o]).filter(i),l=u([...c,...Object.values(e.nodes)]).filter(i),d=new Map(l.map((e=>[e.name,e]))),p={};for(const e of l){p[e.name]=p[e.name]||0;for(const t of e.children)i(t)||(p[t.name]=Number.POSITIVE_INFINITY),p[t.name]=(p[t.name]||0)+1}const f=Object.entries(p).filter((([,e])=>0===e)).map((([e])=>e)),h=[...f];for(;f.length>0;){const e=f.pop(),t=d.get(e);for(const e of t.children.filter(i))0==--p[e.name]&&(h.push(e.name),f.push(e.name))}const m=function(e,t){const n=new Map(e.map((e=>[e.name,e]))),r=t.map((e=>e.name)),a=new Set(r);for(;r.length>0;){const e=r.pop(),t=n.get(e);for(const e of t.children)n.has(e.name)&&!a.has(e.name)&&(a.add(e.name),r.push(e.name))}return e.filter((e=>a.has(e.name)))}(h.map((e=>d.get(e))),c);return function(e,t){const n=new Map(e.map(((e,t)=>[e.name,t]))),r=new Set(t.map((e=>e.name))),a=e=>r.has("string"==typeof e?e:e.name),s=new Set(e.map((e=>e.name))),o=e=>s.has("string"==typeof e?e:e.name);for(const t of e){for(const e of t.children.filter(o)){if(!n.has(e.name))throw new _(`Child ${e.name} of node ${t.name} is unreachable.`);if(n.get(t.name)>n.get(e.name))throw new _(`Node ${t.name} is scheduled to run after its child ${e.name}.`)}if(!a(t))for(const e of t.inputs){if(!n.has(e.name))throw new _(`Input ${e.name} of node ${t.name} is unreachable.`);if(n.get(e.name)>n.get(t.name))throw new _(`Node ${t.name} is scheduled to run before its input ${e.name}.`)}}}(m,c),m}class _ extends Error{constructor(e){super(`NodesExecutionOrderError: ${e}`)}}const S=new Set(["Switch","Merge","Enter","Exit","NextIteration","StatelessIf","StatelessWhile","if","While"]),k=new Set(["NonMaxSuppressionV2","NonMaxSuppressionV3","NonMaxSuppressionV5","Where"]),x=new Set(["HashTable","HashTableV2","LookupTableImport","LookupTableImportV2","LookupTableFind","LookupTableFindV2","LookupTableSize","LookupTableSizeV2"]);function E(e){return S.has(e.op)}function T(e){return k.has(e.op)}function N(e){return x.has(e.op)}class A{get weightIds(){return this.parent?this.parent.weightIds:this._weightIds}get functionExecutorMap(){return this.parent?this.parent.functionExecutorMap:this._functionExecutorMap}get weightMap(){return this.parent?this.parent.weightMap:this._weightMap}set weightMap(e){const t=Object.keys(e).map((t=>e[t].map((e=>e.id))));this._weightIds=[].concat(...t),this._weightMap=e}set resourceManager(e){this._resourceManager=e}get inputs(){return this._inputs.map((e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0})))}get outputs(){return this._outputs.map((e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0})))}get inputNodes(){return this._inputs.map((e=>e.signatureKey||e.name))}get outputNodes(){return this._outputs.map((e=>{const t=e.signatureKey||e.name;return e.defaultOutput?`${t}:${e.defaultOutput}`:t}))}get functions(){return Object.keys(this._functions).reduce(((e,t)=>(e[t]=this._functions[t].signature,e)),{})}constructor(e,t){this.graph=e,this.parent=t,this.compiledMap=new Map,this.parseNodeNameCache=new Map,this._weightMap={},this.SEPARATOR=",",this._functions={},this._functionExecutorMap={},this.keepIntermediateTensors=!1,this._outputs=e.outputs,this._inputs=e.inputs,this._initNodes=e.initNodes,this._signature=e.signature,this._functions=e.functions,null!=e.functions&&Object.keys(e.functions).forEach((t=>{this._functionExecutorMap[t]=new A(e.functions[t],this)}))}getCompilationKey(e,t){const n=e.map((e=>e.name)).sort(),r=t.map((e=>e.name)).sort();return n.join(this.SEPARATOR)+"--"+r.join(this.SEPARATOR)}compile(e,t){const n=v(e,t,this.weightMap,this._initNodes),{missingInputs:r,dynamicNode:a,syncInputs:s}=n;if(null!=a)throw new Error(`This execution contains the node '${a.name}', which has the dynamic op '${a.op}'. Please use model.executeAsync() instead. Alternatively, to avoid the dynamic ops, specify the inputs [${s}]`);if(r.length>0){const n=t.map((e=>e.name)),a=Object.keys(e);throw new Error(`Cannot compute the outputs [${n}] from the provided inputs [${a}]. Missing the following inputs: [${r}]`)}const o=j(this.graph,n),i=function(e){const t=new Map(e.map(((e,t)=>[e.name,t]))),n=Number.MAX_SAFE_INTEGER,r=e.map(((e,t)=>E(e)?n:t)),a=e=>{const n=r[t.get(e.name)];return null==n?-1:n},s=e.map(((e,t)=>e.children.map(a).reduce(((e,t)=>Math.max(e,t)),r[t]))),o=new Map;for(let t=0;t<e.length;++t){const r=s[t];if(r===n)continue;const a=e[t],i=e[r];o.has(i.name)||o.set(i.name,[]),o.get(i.name).push(a)}return o}(o);return{orderedNodes:o,nodeLiveUntilMap:i}}cloneAndKeepTensor(e){if(null==e)return null;const t=e.clone();return Object(r.keep)(t),t}cloneTensorList(e){if(!e)return null;return e.map((e=>this.cloneAndKeepTensor(e)))}cloneTensorMap(e){return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,this.cloneTensorList(t)])))}execute(e,t){this.disposeIntermediateTensors(),e=this.mapInputs(e);const n=Object.keys(e).sort();this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t);const a=n.map((e=>this.graph.nodes[Object(s.g)(e)[0]])),o=t.map((e=>Object(s.g)(e)[0])),i=new Set(o);let u=o.map((e=>this.graph.nodes[e]));0===u.length&&(u=this._outputs);const c=this.getCompilationKey(a,u);let l=this.compiledMap.get(c);null==l&&(l=this.compile(e,u),this.compiledMap.set(c,l));try{this.keepIntermediateTensors=Object(r.env)().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(e){this.keepIntermediateTensors=!1,console.warn(e.message)}const d={},p={};return Object(r.tidy)((()=>{const n=new O(this.weightMap,d,p,this.functionExecutorMap,this.parseNodeNameCache),a=Object.assign({},this.weightMap);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap)),Object.keys(e).forEach((t=>{const[r,o]=Object(s.g)(t,n),i=[];i[o]=e[t],a[r]=i,this.keepIntermediateTensors&&(this.clonedTensorsMap[r]=this.cloneTensorList(i))}));const o=this.getFrozenTensorIds(a),{orderedNodes:u,nodeLiveUntilMap:c}=l;for(const e of u){if(a[e.name])continue;const t=w(e,a,n,this._resourceManager);if(r.util.isPromise(t))throw new Error(`The execution of the op '${e.op}' returned a promise. Please use model.executeAsync() instead.`);a[e.name]=t,this.keepIntermediateTensors&&(this.clonedTensorsMap[e.name]=this.cloneTensorList(t)),this.checkTensorForDisposalWithNodeLiveUntilInfo(e,a,n,o,i,c.get(e.name))}return null==this.parent&&n.dispose(o),t.map((e=>Object(s.e)(e,a,n)))}))}getFrozenTensorIds(e){const t=[].concat.apply([],Object.keys(e).map((t=>e[t])).map((e=>e.map((e=>e.id)))));return new Set(t)}checkTensorForDisposal(e,t,n,r,a,o,i){if(!E(t)&&!o.has(e)){for(const r of n[e])null!=r&&(i[r.id]=(i[r.id]||0)+t.children.length);for(const e of t.inputs){if(E(e))continue;const t=Object(s.f)(e.name,n,r);if(null!=t)for(const e of t){if(!e||e.kept||a.has(e.id))continue;const t=i[e.id];1===t?(e.dispose(),delete i[e.id]):null!=t&&i[e.id]--}}}}checkTensorForDisposalWithNodeLiveUntilInfo(e,t,n,r,a,o){function i(e){return E(e)||a.has(e.name)}if(!E(e)&&null!=o)for(const e of o){if(i(e))continue;const a=Object(s.f)(e.name,t,n);for(const e of a)!e||e.kept||r.has(e.id)||e.dispose()}}async executeAsync(e,t){return this._executeAsync(e,t)}disposeIntermediateTensors(){this.clonedTensorsMap&&(Object.values(this.clonedTensorsMap).forEach((e=>{for(const t of e)t&&!t.isDisposed&&t.dispose()})),this.clonedTensorsMap=null)}getIntermediateTensors(){return this.clonedTensorsMap}async _executeAsync(e,t,n=!1,a={},o={}){this.disposeIntermediateTensors(),n||(e=this.mapInputs(e),this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t));try{this.keepIntermediateTensors=Object(r.env)().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(e){this.keepIntermediateTensors=!1,console.warn(e.message)}const i=new O(this.weightMap,a,o,this.functionExecutorMap,this.parseNodeNameCache);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap));const u=await this.executeWithControlFlow(e,i,t,n),c=t.map((e=>Object(s.e)(e,u,i))),l=c.map((e=>e.id)),d=Object.keys(e).map((t=>e[t].id)),p=new Set([...l,...d,...this.weightIds]);return Object.values(u).forEach((e=>{e.forEach((e=>{!e||e.isDisposed||p.has(e.id)||e.dispose()}))})),null==this.parent&&i.dispose(p),c}async executeFunctionAsync(e,t,n){const r=e.reduce(((e,t,n)=>(e[this.inputs[n].name]=t,e)),{});return this._executeAsync(r,this.outputNodes,!0,t,n)}async executeWithControlFlow(e,t,n,r){const a=Object.keys(e),o=a.map((e=>this.graph.nodes[Object(s.g)(e)[0]])),i=n.map((e=>Object(s.g)(e)[0])),u=new Set(i);let c=i.map((e=>this.graph.nodes[e]));0===c.length&&(c=this._outputs);const{usedNodes:l,missingInputs:d,dynamicNode:p,syncInputs:f}=v(e,c,this.weightMap,this._initNodes),h=[...o,...this.graph.weights,...this._initNodes||[]].map((e=>({node:e,contexts:t.currentContext}))),m=Object.assign({},this.weightMap);Object.keys(e).forEach((t=>{const[n,r]=Object(s.g)(t),a=[];a[r]=e[t],m[n]=a}));const b={},g=this.getFrozenTensorIds(m),y={};for(;h.length>0;){const e=this.processStack(o,h,t,m,y,g,u,b,l);await Promise.all(e)}null!=p||r||console.warn("This model execution did not contain any nodes with control flow or dynamic output shapes. You can use model.execute() instead.");const w=c.filter((e=>!E(e)&&!Object(s.e)(e.name,m,t))).map((e=>e.name));if(w.length>0){let e="";throw null!=p&&(e=`Alternatively, to avoid the dynamic ops, use model.execute() and specify the inputs [${f}]`),new Error(`Cannot compute the outputs [${w}] from the provided inputs [${a}]. Consider providing the following inputs: [${d}]. ${e}`)}return m}processStack(e,t,n,a,o,i,u,c,l){const d=[];for(;t.length>0;){const e=t.pop();n.currentContext=e.contexts;let p="";if("Enter"===e.node.op&&Object(s.d)("isConstant",e.node,a,n)&&([p]=Object(s.b)(e.node.name,n)),null==a[e.node.name]){const f=w(e.node,a,n,this._resourceManager);p||([p]=Object(s.b)(e.node.name,n));const h=n.currentContext;r.util.isPromise(f)?d.push(f.then((r=>(a[p]=r,this.keepIntermediateTensors&&(this.clonedTensorsMap[p]=this.cloneTensorList(r)),n.currentContext=h,this.checkTensorForDisposal(p,e.node,a,n,i,u,c),this.processChildNodes(e.node,t,n,a,o,l),r)))):(a[p]=f,this.keepIntermediateTensors&&(this.clonedTensorsMap[p]=this.cloneTensorList(f)),this.checkTensorForDisposal(p,e.node,a,n,i,u,c),this.processChildNodes(e.node,t,n,a,o,l))}else this.processChildNodes(e.node,t,n,a,o,l)}return d}processChildNodes(e,t,n,r,a,o){e.children.forEach((e=>{const[i]=Object(s.b)(e.name,n);!a[i]&&o.has(e.name)&&("Merge"===e.op?e.inputNames.some((e=>!!Object(s.e)(e,r,n)))&&(a[i]=!0,t.push({contexts:n.currentContext,node:e})):e.inputNames.every((e=>!!Object(s.e)(e,r,n)))&&(a[i]=!0,t.push({contexts:n.currentContext,node:e})))}))}dispose(){Object.keys(this.weightMap).forEach((e=>this.weightMap[e].forEach((e=>e.dispose()))))}checkInputShapeAndType(e){Object.keys(e).forEach((t=>{const n=e[t],[a]=Object(s.g)(t),o=this.graph.nodes[a];if(o.attrParams.shape&&o.attrParams.shape.value){const e=o.attrParams.shape.value,t=e.length===n.shape.length&&n.shape.every(((t,n)=>-1===e[n]||e[n]===t));r.util.assert(t,(()=>`The shape of dict['${o.name}'] provided in model.execute(dict) must be [${e}], but was [${n.shape}]`))}o.attrParams.dtype&&o.attrParams.dtype.value&&r.util.assert(n.dtype===o.attrParams.dtype.value,(()=>`The dtype of dict['${o.name}'] provided in model.execute(dict) must be ${o.attrParams.dtype.value}, but was ${n.dtype}`))}))}mapInputs(e){var t,n;const r={};for(const a in e){const s=null===(n=null===(t=this._signature)||void 0===t?void 0:t.inputs)||void 0===n?void 0:n[a];null!=s?r[s.name]=e[a]:r[a]=e[a]}return r}checkInputs(e){const t=Object.keys(e).filter((e=>{const[t]=Object(s.g)(e);return null==this.graph.nodes[t]}));if(t.length>0)throw new Error(`The dict provided in model.execute(dict) has keys: [${t}] that are not part of graph`)}mapOutputs(e){return e.map((e=>{var t,n;const r=null===(n=null===(t=this._signature)||void 0===t?void 0:t.outputs)||void 0===n?void 0:n[e];return null!=r?r.name:e}),{})}checkOutputs(e){e.forEach((e=>{const[t]=Object(s.g)(e);if(!this.graph.nodes[t])throw new Error(`The output '${e}' is not found in the graph`)}))}}class M{constructor(e={},t={}){this.hashTableNameToHandle=e,this.hashTableMap=t}addHashTable(e,t){this.hashTableNameToHandle[e]=t.handle,this.hashTableMap[t.id]=t}getHashTableHandleByName(e){return this.hashTableNameToHandle[e]}getHashTableById(e){return this.hashTableMap[e]}dispose(){for(const e in this.hashTableMap)this.hashTableMap[e].clearAndClose(),delete this.hashTableMap[e];for(const e in this.hashTableNameToHandle)this.hashTableNameToHandle[e].dispose(),delete this.hashTableNameToHandle[e]}}class I{get modelVersion(){return this.version}get inputNodes(){return this.executor.inputNodes}get outputNodes(){return this.executor.outputNodes}get inputs(){return this.executor.inputs}get outputs(){return this.executor.outputs}get weights(){return this.executor.weightMap}get metadata(){return this.artifacts.userDefinedMetadata}get modelSignature(){return this.signature}get modelStructuredOutputKeys(){return this.structuredOutputKeys}constructor(e,t={},n=r.io){this.modelUrl=e,this.loadOptions=t,this.version="n/a",this.io=n,null==t&&(this.loadOptions={}),this.resourceManager=new M}findIOHandler(){const e=this.modelUrl;if(null!=e.load)this.handler=e;else if(null!=this.loadOptions.requestInit)this.handler=this.io.browserHTTPRequest(e,this.loadOptions);else{const t=this.io.getLoadHandlers(e,this.loadOptions);if(0===t.length)t.push(this.io.browserHTTPRequest(e,this.loadOptions));else if(t.length>1)throw new Error(`Found more than one (${t.length}) load handlers for URL '${[e]}'`);this.handler=t[0]}}load(){if(this.findIOHandler(),null==this.handler.load)throw new Error("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");const e=this.handler.load();return r.util.isPromise(e)?e.then((e=>this.loadSync(e))):this.loadSync(e)}loadSync(e){this.artifacts=e;const t=this.artifacts.modelTopology;let n=this.artifacts.signature;if(null!=this.artifacts.userDefinedMetadata){const e=this.artifacts.userDefinedMetadata;null!=e.signature&&(n=e.signature),null!=e.structuredOutputKeys&&(this.structuredOutputKeys=e.structuredOutputKeys)}this.signature=n,this.version=`${t.versions.producer}.${t.versions.minConsumer}`;const r=this.io.decodeWeights(this.artifacts.weightData,this.artifacts.weightSpecs);if(this.executor=new A(a.a.Instance.transformGraph(t,this.signature)),this.executor.weightMap=this.convertTensorMapToTensorsMap(r),this.executor.resourceManager=this.resourceManager,null!=e.modelInitializer&&null!=e.modelInitializer.node){const t=a.a.Instance.transformGraph(e.modelInitializer);this.initializer=new A(t),this.initializer.weightMap=this.executor.weightMap,this.initializer.resourceManager=this.resourceManager,this.initializerSignature=e.initializerSignature}return!0}async save(e,t){if("string"==typeof e){const t=this.io.getSaveHandlers(e);if(0===t.length)throw new Error(`Cannot find any save handlers for URL '${e}'`);if(t.length>1)throw new Error(`Found more than one (${t.length}) save handlers for URL '${e}'`);e=t[0]}if(null==e.save)throw new Error("GraphModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");return e.save(this.artifacts)}addStructuredOutputNames(e){if(this.structuredOutputKeys){const t=e instanceof r.Tensor?[e]:e,n={};return t.forEach(((e,t)=>n[this.structuredOutputKeys[t]]=e)),n}return e}predict(e,t){const n=this.execute(e,this.outputNodes);return this.addStructuredOutputNames(n)}async predictAsync(e,t){const n=await this.executeAsync(e,this.outputNodes);return this.addStructuredOutputNames(n)}normalizeInputs(e){var t;if(!(e instanceof r.Tensor||Array.isArray(e))){const n=null===(t=this.signature)||void 0===t?void 0:t.inputs;if(null!=n)for(const t in n){const r=n[t];null!=r.resourceId&&(e[t]=this.resourceIdToCapturedInput[r.resourceId])}return e}e=Array.isArray(e)?e:[e];const n=Object.keys(this.resourceIdToCapturedInput).length;if(e.length+n!==this.inputNodes.length)throw new Error(`Input tensor count mismatch, the graph model has ${this.inputNodes.length-n} non-resource placeholders, while there are ${e.length} input tensors provided.`);let a=0;return this.inputNodes.reduce(((t,n)=>{var r,s,o;const i=null===(o=null===(s=null===(r=this.signature)||void 0===r?void 0:r.inputs)||void 0===s?void 0:s[n])||void 0===o?void 0:o.resourceId;return t[n]=null!=i?this.resourceIdToCapturedInput[i]:e[a++],t}),{})}normalizeOutputs(e){return e=e||this.outputNodes,Array.isArray(e)?e:[e]}executeInitializerGraph(){return null==this.initializer?[]:null==this.initializerSignature?this.initializer.execute({},[]):this.initializer.execute({},Object.keys(this.initializerSignature.outputs))}async executeInitializerGraphAsync(){return null==this.initializer?[]:null==this.initializerSignature?this.initializer.executeAsync({},[]):this.initializer.executeAsync({},Object.keys(this.initializerSignature.outputs))}setResourceIdToCapturedInput(e){if(this.resourceIdToCapturedInput={},this.initializerSignature){const t=this.initializerSignature.outputs,n=Object.keys(t);for(let r=0;r<n.length;r++){const a=t[n[r]];this.resourceIdToCapturedInput[a.resourceId]=e[r]}}}execute(e,t){null==this.resourceIdToCapturedInput&&this.setResourceIdToCapturedInput(this.executeInitializerGraph()),e=this.normalizeInputs(e),t=this.normalizeOutputs(t);const n=this.executor.execute(e,t);return n.length>1?n:n[0]}async executeAsync(e,t){null==this.resourceIdToCapturedInput&&this.setResourceIdToCapturedInput(await this.executeInitializerGraphAsync()),e=this.normalizeInputs(e),t=this.normalizeOutputs(t);const n=await this.executor.executeAsync(e,t);return n.length>1?n:n[0]}getIntermediateTensors(){return this.executor.getIntermediateTensors()}disposeIntermediateTensors(){this.executor.disposeIntermediateTensors()}convertTensorMapToTensorsMap(e){return Object.keys(e).reduce(((t,n)=>(t[n]=[e[n]],t)),{})}dispose(){this.executor.dispose(),this.initializer&&(this.initializer.dispose(),this.resourceIdToCapturedInput&&Object(r.dispose)(this.resourceIdToCapturedInput)),this.resourceManager.dispose()}}async function D(e,t={},n=r.io){if(null==e)throw new Error("modelUrl in loadGraphModel() cannot be null. Please provide a url or an IOHandler that loads the model");null==t&&(t={}),t.fromTFHub&&"string"==typeof e&&(e=function(e){e.endsWith("/")||(e+="/");return`${e}model.json?tfjs-format=file`}(e));const a=new I(e,t,n);return await a.load(),a}function $(e){if(null==e)throw new Error("modelUrl in loadGraphModelSync() cannot be null. Please provide model artifacts or an IOHandler that loads the model");let t;if(e instanceof Array){const[n,a]=e;if(!n)throw new Error("modelJSON must be the first element of the array");if(!(a&&a instanceof ArrayBuffer))throw new Error("An ArrayBuffer of weights must be the second element of the array");if(!("modelTopology"in n))throw new Error("Model JSON is missing 'modelTopology'");if(!("weightsManifest"in n))throw new Error("Model JSON is missing 'weightsManifest'");const s=r.io.getWeightSpecs(n.weightsManifest),o=r.io.getModelArtifactsForJSONSync(n,s,a);t=r.io.fromMemorySync(o)}else if("load"in e)t=e;else{if(!("modelTopology"in e&&"weightSpecs"in e&&"weightData"in e))throw new Error("Unknown model format");t=r.io.fromMemorySync(e)}const n=new I(t);return n.load(),n}const C="4.10.0"},function(e,t,n){"use strict";n.r(t),n.d(t,"mean",(function(){return i})),n.d(t,"meanConfig",(function(){return u}));var r=n(5),a=n(90),s=n(92);let o;function i(e){const{backend:t,inputs:n,attrs:i}=e,{axis:u,keepDims:c}=i,{x:l}=n,d=t.dataIdMap.get(l.dataId).id;let p=d,f=l;const{transposed:h,axes:m,originalAxes:b,inputWasTransposed:g}=function(e,t,n){const a=e.shape,o=e.shape.length,i=r.util.parseAxisParam(t,a);let u=i;const c=r.backend_util.getAxesPermutation(u,o);let l=null,d=!1;if(null!=c){const t=new Array(o);for(let e=0;e<t.length;e++)t[e]=a[c[e]];u=r.backend_util.getInnerMostAxes(u.length,o),l=Object(s.transpose)({inputs:{x:e},attrs:{perm:c},backend:n});const i=n.dataIdMap.get(e.dataId).id;n.dataIdMap.get(l.dataId).id!==i&&(d=!0)}return{transposed:l,originalAxes:i,axes:u,inputWasTransposed:d}}(l,u,t);let y=m;if(g){const e=t.dataIdMap.get(h.dataId).id;e!==d&&(f=h,p=e,y=r.backend_util.getInnerMostAxes(y.length,f.shape.length))}r.backend_util.assertAxesAreInnerMostDims("mean",y,f.shape.length);const[w,O]=r.backend_util.computeOutAndReduceShapes(f.shape,y),v=r.util.sizeFromShape(O);let j=f;"float32"!==f.dtype&&(j=Object(a.cast)({backend:t,inputs:{x:f},attrs:{dtype:"float32"}}),p=t.dataIdMap.get(j.dataId).id);const _=t.makeOutput(w,"float32");if(0!==r.util.sizeFromShape(f.shape)){const e=t.dataIdMap.get(_.dataId).id;o(p,v,e)}if(g&&t.disposeData(h.dataId),c){const e=r.backend_util.expandShapeToKeepDim(_.shape,b);_.shape=e}return"float32"!==f.dtype&&t.disposeData(j.dataId),_}const u={kernelName:r.Mean,backendName:"wasm",setupFunc:function(e){o=e.wasm.cwrap(r.Mean,null,["number, number, number"])},kernelFunc:i}},function(e,t,n){"use strict";n.r(t),n.d(t,"padV2Config",(function(){return i}));var r=n(5);function a(e){const{attrs:{shape:t,value:n,dtype:r},backend:a}=e,s=a.makeOutput(t,r);return a.typedArrayFromHeap(s).fill(n),s}r.Fill;var s=n(33);let o;const i={kernelName:r.PadV2,backendName:"wasm",kernelFunc:function(e){const{inputs:{x:t},backend:n,attrs:{paddings:i,constantValue:u}}=e,c=i.map(((e,n)=>e[0]+t.shape[n]+e[1]));if(0===r.util.sizeFromShape(t.shape))return a({backend:n,attrs:{shape:c,value:u,dtype:t.dtype}});const l=n.dataIdMap.get(t.dataId).id,d=n.makeOutput(c,t.dtype),p=n.dataIdMap.get(d.dataId).id,f=new Uint8Array(new Int32Array(t.shape).buffer),h=i.map((e=>e[0])),m=i.map((e=>e[1])),b=new Uint8Array(new Int32Array(h).buffer),g=new Uint8Array(new Int32Array(m).buffer);return o(l,f,t.shape.length,s.a[t.dtype],b,g,u,p),d},setupFunc:function(e){o=e.wasm.cwrap(r.PadV2,null,["number","array","number","number","array","array","number","number"])}}},function(e,t,n){"use strict";n.r(t),n.d(t,"stridedSlice",(function(){return u})),n.d(t,"stridedSliceConfig",(function(){return c}));var r=n(5),a=n(47),s=n(70);function o(e){const{inputs:{x:t},attrs:{begin:n,size:a},backend:o}=e,[i,u]=r.slice_util.parseSliceParams(t,n,a),c=r.slice_util.isSliceContinous(t.shape,i,u),l=o.readSync(t.dataId),d=o.makeOutput(u,t.dtype),p=r.util.computeStrides(t.shape),f=o.dataIdMap.get(d.dataId);if(c){const e=r.slice_util.computeFlatOffset(i,p);if("string"===t.dtype)f.stringBytes=l.slice(e,e+r.util.sizeFromShape(u));else{o.typedArrayFromHeap(d).set(l.subarray(e,e+r.util.sizeFromShape(u)))}return d}if("string"===t.dtype){const e=Object(s.b)(l,i,u,t.shape,t.dtype);return f.stringBytes=e,d}const h=o.typedArrayFromHeap(d),m=t.shape.length;if(2===m)!function(e,t,n,r,a){let s=0;const o=r[0],i=r[1],u=o+a[0];for(let r=o;r<u;r++){const o=r*t+i;n.set(e.subarray(o,o+a[1]),s),s+=a[1]}}(l,p[0],h,i,u);else if(3===m)!function(e,t,n,r,a,s){let o=0;const i=a[0],u=a[1],c=a[2],l=i+s[0],d=u+s[1];for(let a=i;a<l;a++)for(let i=u;i<d;i++){const u=a*t+i*n+c;r.set(e.subarray(u,u+s[2]),o),o+=s[2]}}(l,p[0],p[1],h,i,u);else if(4===m)!function(e,t,n,r,a,s,o){let i=0;const u=s[0],c=s[1],l=s[2],d=u+o[0],p=c+o[1],f=l+o[2],h=s[3];for(let s=u;s<d;s++)for(let u=c;u<p;u++)for(let c=l;c<f;c++){const l=s*t+u*n+c*r+h;a.set(e.subarray(l,l+o[3]),i),i+=o[3]}}(l,p[0],p[1],p[2],h,i,u);else{const e=Object(s.b)(l,i,u,t.shape,t.dtype);h.set(e)}return d}r.Slice;let i;function u(e){const{backend:t,inputs:n,attrs:s}=e,{x:u}=n,{begin:c,end:l,strides:d,beginMask:p,endMask:f,ellipsisMask:h,newAxisMask:m,shrinkAxisMask:b}=s,{finalShapeSparse:g,finalShape:y,isIdentity:w,sliceDim0:O,isSimpleSlice:v,begin:j,end:_,strides:S}=r.slice_util.sliceInfo(u.shape,c,l,d,p,f,h,m,b);let k;if(w)k=Object(a.reshape)({inputs:{x:u},backend:t,attrs:{shape:y}});else if(O||v){r.util.assert(u.shape.length>=1,(()=>`Input must have rank at least 1, got: ${u.shape.length}`));const e=r.slice_util.computeOutShape(j,_,S),n=o({inputs:{x:u},backend:t,attrs:{begin:j,size:e}});k=Object(a.reshape)({inputs:{x:n},backend:t,attrs:{shape:y}}),t.disposeData(n.dataId)}else{const e=t.makeOutput(g,"float32"),n=t.dataIdMap.get(u.dataId).id,s=new Uint8Array(new Int32Array(r.util.computeStrides(u.shape)).buffer),o=new Uint8Array(new Int32Array(j).buffer),c=new Uint8Array(new Int32Array(_).buffer),l=new Uint8Array(new Int32Array(S).buffer),d=new Uint8Array(new Int32Array(g).buffer),p=new Uint8Array(new Int32Array(r.util.computeStrides(g)).buffer),f=t.dataIdMap.get(e.dataId).id;i(n,s,u.shape.length,o,c,l,d,p,g.length,f),k=Object(a.reshape)({inputs:{x:e},backend:t,attrs:{shape:y}}),t.disposeData(e.dataId)}return k}const c={kernelName:r.StridedSlice,backendName:"wasm",setupFunc:function(e){i=e.wasm.cwrap(r.StridedSlice,null,["number","array","number","array","array","array","array","array","number","number"])},kernelFunc:u}}]);
|