-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdecoder.js
9 lines (9 loc) · 98.8 KB
/
decoder.js
1
2
3
4
5
6
7
8
9
/*
*
* decoder.js v1.0.2
* Copyright (c) 2024-7-31 Ezviz-OpenBiz
*
* https://github.com/Ezviz-OpenBiz/EZUIKit-flv
*
*/
!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var r=!0;if((o=void 0!==o?o:{}).ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");var t,n,o={print:function(e){},printErr:function(e){postMessage({cmd:"wasmError",message:e})}},a=Object.assign({},o),i="./this.program",s="";if("undefined"!=typeof document&&document.currentScript&&(s=document.currentScript.src),s=s.startsWith("blob:")?"":s.substr(0,s.replace(/[?#].*/,"").lastIndexOf("/")+1),"object"!=typeof window&&"function"!=typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");t=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},n=(e,r,t)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?r(n.response):t()},n.onerror=t,n.send(null)};var l,d,u,c=o.print||console.log.bind(console),f=o.printErr||console.error.bind(console);Object.assign(o,a),a=null,l="fetchSettings",Object.getOwnPropertyDescriptor(o,l)&&R(`\`Module.${l}\` was supplied but \`${l}\` not included in INCOMING_MODULE_JS_API`),o.arguments&&o.arguments,G("arguments","arguments_"),o.thisProgram&&(i=o.thisProgram),G("thisProgram","thisProgram"),o.quit&&o.quit,G("quit","quit_"),T(void 0===o.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),T(void 0===o.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),T(void 0===o.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),T(void 0===o.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),T(void 0===o.read,"Module.read option was removed (modify read_ in JS)"),T(void 0===o.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),T(void 0===o.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),T(void 0===o.setWindowTitle,"Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)"),T(void 0===o.TOTAL_MEMORY,"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),G("asm","wasmExports"),G("read","read_"),G("readAsync","readAsync"),G("readBinary","readBinary"),G("setWindowTitle","setWindowTitle"),T(!0,"worker environment detected but not enabled at build time. Add `worker` to `-sENVIRONMENT` to enable."),T(!0,"node environment detected but not enabled at build time. Add `node` to `-sENVIRONMENT` to enable."),T(!0,"shell environment detected but not enabled at build time. Add `shell` to `-sENVIRONMENT` to enable."),o.wasmBinary&&(d=o.wasmBinary),G("wasmBinary","wasmBinary"),"object"!=typeof WebAssembly&&f("no native wasm support detected");var m,p,h,g,v,y,E,w,b=!1;function T(e,r){e||R("Assertion failed"+(r?": "+r:""))}function _(){var e=u.buffer;o.HEAP8=m=new Int8Array(e),o.HEAP16=h=new Int16Array(e),o.HEAPU8=p=new Uint8Array(e),o.HEAPU16=g=new Uint16Array(e),o.HEAP32=v=new Int32Array(e),o.HEAPU32=y=new Uint32Array(e),o.HEAPF32=E=new Float32Array(e),o.HEAPF64=w=new Float64Array(e)}function C(){if(!b){var e=lt();0==e&&(e+=4);var r=y[e>>2],t=y[e+4>>2];34821223==r&&2310721022==t||R(`Stack overflow! Stack cookie has been overwritten at ${J(e)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${J(t)} ${J(r)}`),1668509029!=y[0]&&R("Runtime error: The application has corrupted its heap memory area (address zero)!")}}T(!o.STACK_SIZE,"STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time"),T("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,"JS engine does not provide full typed array support"),T(!o.wasmMemory,"Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally"),T(!o.INITIAL_MEMORY,"Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically"),function(){var e=new Int16Array(1),r=new Int8Array(e.buffer);if(e[0]=25459,115!==r[0]||99!==r[1])throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)"}();var S=[],P=[],k=[],A=!1;T(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),T(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),T(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),T(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var F=0,D=null,O=null,M={};function $(e){for(var r=e;;){if(!M[e])return e;e=r+Math.random()}}function N(e){var r,t;F++,null===(r=(t=o).monitorRunDependencies)||void 0===r||r.call(t,F),e?(T(!M[e]),M[e]=1,null===D&&"undefined"!=typeof setInterval&&(D=setInterval((()=>{if(b)return clearInterval(D),void(D=null);var e=!1;for(var r in M)e||(e=!0,f("still waiting on run dependencies:")),f(`dependency: ${r}`);e&&f("(end of list)")}),1e4))):f("warning: run dependency added without ID")}function I(e){var r,t;if(F--,null===(r=(t=o).monitorRunDependencies)||void 0===r||r.call(t,F),e?(T(M[e]),delete M[e]):f("warning: run dependency removed without ID"),0==F&&(null!==D&&(clearInterval(D),D=null),O)){var n=O;O=null,n()}}function R(e){var r,t;throw null===(r=(t=o).onAbort)||void 0===r||r.call(t,e),f(e="Aborted("+e+")"),b=!0,new WebAssembly.RuntimeError(e)}var L,U,x,B=e=>e.startsWith("data:application/octet-stream;base64,"),j=e=>e.startsWith("file://");function W(e,r){return(...t)=>{T(A,`native function \`${e}\` called before runtime initialization`);var n=rt[e];return T(n,`exported native function \`${e}\` not found`),T(t.length<=r,`native function \`${e}\` called with ${t.length} args but expects ${r}`),n(...t)}}function z(){var e,r="decoder.wasm";return B(r)?r:(e=r,o.locateFile?o.locateFile(e,s):s+e)}function H(e){if(e==L&&d)return new Uint8Array(d);throw"both async and sync fetching of the wasm failed"}function V(e,t,n){return function(e){return!d&&r&&"function"==typeof fetch?fetch(e,{credentials:"same-origin"}).then((r=>{if(!r.ok)throw`failed to load wasm binary file at '${e}'`;return r.arrayBuffer()})).catch((()=>H(e))):Promise.resolve().then((()=>H(e)))}(e).then((e=>WebAssembly.instantiate(e,t))).then(n,(e=>{f(`failed to asynchronously prepare wasm: ${e}`),j(L)&&f(`warning: Loading from a file URI (${L}) is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing`),R(e)}))}function G(e,r,t=!0){Object.getOwnPropertyDescriptor(o,e)||Object.defineProperty(o,e,{configurable:!0,get(){R(`\`Module.${e}\` has been replaced by \`${r}\``+(t?" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)":""))}})}function Y(e){return"FS_createPath"===e||"FS_createDataFile"===e||"FS_createPreloadedFile"===e||"FS_unlink"===e||"addRunDependency"===e||"FS_createLazyFile"===e||"FS_createDevice"===e||"removeRunDependency"===e}function q(e,r){"undefined"!=typeof globalThis&&Object.defineProperty(globalThis,e,{configurable:!0,get(){Z(`\`${e}\` is not longer defined by emscripten. ${r}`)}})}function X(e){Object.getOwnPropertyDescriptor(o,e)||Object.defineProperty(o,e,{configurable:!0,get(){var r=`'${e}' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)`;Y(e)&&(r+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),R(r)}})}q("buffer","Please use HEAP8.buffer or wasmMemory.buffer"),q("asm","Please use wasmExports instead");var K=e=>{for(;e.length>0;)e.shift()(o)};o.noExitRuntime;var J=e=>(T("number"==typeof e),"0x"+(e>>>=0).toString(16).padStart(8,"0")),Z=e=>{Z.shown||={},Z.shown[e]||(Z.shown[e]=1,f(e))},Q="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,ee=(e,r,t)=>{for(var n=r+t,o=r;e[o]&&!(o>=n);)++o;if(o-r>16&&e.buffer&&Q)return Q.decode(e.subarray(r,o));for(var a="";r<o;){var i=e[r++];if(128&i){var s=63&e[r++];if(192!=(224&i)){var l=63&e[r++];if(224==(240&i)?i=(15&i)<<12|s<<6|l:(240!=(248&i)&&Z("Invalid UTF-8 leading byte "+J(i)+" encountered when deserializing a UTF-8 string in wasm memory to a JS string!"),i=(7&i)<<18|s<<12|l<<6|63&e[r++]),i<65536)a+=String.fromCharCode(i);else{var d=i-65536;a+=String.fromCharCode(55296|d>>10,56320|1023&d)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a},re=(e,r)=>(T("number"==typeof e,`UTF8ToString expects a number (got ${typeof e})`),e?ee(p,e,r):"");function te(){T(null!=Ee.varargs);var e=v[+Ee.varargs>>2];return Ee.varargs+=4,e}var ne=te,oe={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=oe.isAbs(e),t="/"===e.substr(-1);return(e=oe.normalizeArray(e.split("/").filter((e=>!!e)),!r).join("/"))||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=oe.splitPath(e),t=r[0],n=r[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:e=>{if("/"===e)return"/";var r=(e=(e=oe.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===r?e:e.substr(r+1)},join:(...e)=>oe.normalize(e.join("/")),join2:(e,r)=>oe.normalize(e+"/"+r)},ae=e=>(ae=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);R("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: (array) => { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };")})())(e),ie={resolve:(...e)=>{for(var r="",t=!1,n=e.length-1;n>=-1&&!t;n--){var o=n>=0?e[n]:ye.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");if(!o)return"";r=o+"/"+r,t=oe.isAbs(o)}return(t?"/":"")+(r=oe.normalizeArray(r.split("/").filter((e=>!!e)),!t).join("/"))||"."},relative:(e,r)=>{function t(e){for(var r=0;r<e.length&&""===e[r];r++);for(var t=e.length-1;t>=0&&""===e[t];t--);return r>t?[]:e.slice(r,t-r+1)}e=ie.resolve(e).substr(1),r=ie.resolve(r).substr(1);for(var n=t(e.split("/")),o=t(r.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s<a;s++)if(n[s]!==o[s]){i=s;break}var l=[];for(s=i;s<n.length;s++)l.push("..");return(l=l.concat(o.slice(i))).join("/")}},se=[],le=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n<=127?r++:n<=2047?r+=2:n>=55296&&n<=57343?(r+=4,++t):r+=3}return r},de=(e,r,t,n)=>{if(T("string"==typeof e,`stringToUTF8Array expects a string (got ${typeof e})`),!(n>0))return 0;for(var o=t,a=t+n-1,i=0;i<e.length;++i){var s=e.charCodeAt(i);if(s>=55296&&s<=57343)s=65536+((1023&s)<<10)|1023&e.charCodeAt(++i);if(s<=127){if(t>=a)break;r[t++]=s}else if(s<=2047){if(t+1>=a)break;r[t++]=192|s>>6,r[t++]=128|63&s}else if(s<=65535){if(t+2>=a)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|63&s}else{if(t+3>=a)break;s>1114111&&Z("Invalid Unicode code point "+J(s)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."),r[t++]=240|s>>18,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s}}return r[t]=0,t-o};function ue(e,r,t){var n=le(e)+1,o=new Array(n),a=de(e,o,0,o.length);return o.length=a,o}var ce={ttys:[],init(){},shutdown(){},register(e,r){ce.ttys[e]={input:[],output:[],ops:r},ye.registerDevice(e,ce.stream_ops)},stream_ops:{open(e){var r=ce.ttys[e.node.rdev];if(!r)throw new ye.ErrnoError(43);e.tty=r,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,r,t,n,o){if(!e.tty||!e.tty.ops.get_char)throw new ye.ErrnoError(60);for(var a=0,i=0;i<n;i++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new ye.ErrnoError(29)}if(void 0===s&&0===a)throw new ye.ErrnoError(6);if(null==s)break;a++,r[t+i]=s}return a&&(e.node.timestamp=Date.now()),a},write(e,r,t,n,o){if(!e.tty||!e.tty.ops.put_char)throw new ye.ErrnoError(60);try{for(var a=0;a<n;a++)e.tty.ops.put_char(e.tty,r[t+a])}catch(e){throw new ye.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),a}},default_tty_ops:{get_char:e=>(()=>{if(!se.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;se=ue(e)}return se.shift()})(),put_char(e,r){null===r||10===r?(c(ee(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(c(ee(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,r,t)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,r){null===r||10===r?(f(ee(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(f(ee(e.output,0)),e.output=[])}}},fe=e=>{R("internal error: mmapAlloc called but `emscripten_builtin_memalign` native symbol not exported")},me={ops_table:null,mount:e=>me.createNode(null,"/",16895,0),createNode(e,r,t,n){if(ye.isBlkdev(t)||ye.isFIFO(t))throw new ye.ErrnoError(63);me.ops_table||={dir:{node:{getattr:me.node_ops.getattr,setattr:me.node_ops.setattr,lookup:me.node_ops.lookup,mknod:me.node_ops.mknod,rename:me.node_ops.rename,unlink:me.node_ops.unlink,rmdir:me.node_ops.rmdir,readdir:me.node_ops.readdir,symlink:me.node_ops.symlink},stream:{llseek:me.stream_ops.llseek}},file:{node:{getattr:me.node_ops.getattr,setattr:me.node_ops.setattr},stream:{llseek:me.stream_ops.llseek,read:me.stream_ops.read,write:me.stream_ops.write,allocate:me.stream_ops.allocate,mmap:me.stream_ops.mmap,msync:me.stream_ops.msync}},link:{node:{getattr:me.node_ops.getattr,setattr:me.node_ops.setattr,readlink:me.node_ops.readlink},stream:{}},chrdev:{node:{getattr:me.node_ops.getattr,setattr:me.node_ops.setattr},stream:ye.chrdev_stream_ops}};var o=ye.createNode(e,r,t,n);return ye.isDir(o.mode)?(o.node_ops=me.ops_table.dir.node,o.stream_ops=me.ops_table.dir.stream,o.contents={}):ye.isFile(o.mode)?(o.node_ops=me.ops_table.file.node,o.stream_ops=me.ops_table.file.stream,o.usedBytes=0,o.contents=null):ye.isLink(o.mode)?(o.node_ops=me.ops_table.link.node,o.stream_ops=me.ops_table.link.stream):ye.isChrdev(o.mode)&&(o.node_ops=me.ops_table.chrdev.node,o.stream_ops=me.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[r]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){r=Math.max(r,t*(t<1048576?2:1.125)>>>0),0!=t&&(r=Math.max(r,256));var n=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,r){if(e.usedBytes!=r)if(0==r)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr(e){var r={};return r.dev=ye.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,ye.isDir(e.mode)?r.size=4096:ye.isFile(e.mode)?r.size=e.usedBytes:ye.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.timestamp),r.mtime=new Date(e.timestamp),r.ctime=new Date(e.timestamp),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr(e,r){void 0!==r.mode&&(e.mode=r.mode),void 0!==r.timestamp&&(e.timestamp=r.timestamp),void 0!==r.size&&me.resizeFileStorage(e,r.size)},lookup(e,r){throw ye.genericErrors[44]},mknod:(e,r,t,n)=>me.createNode(e,r,t,n),rename(e,r,t){if(ye.isDir(e.mode)){var n;try{n=ye.lookupNode(r,t)}catch(e){}if(n)for(var o in n.contents)throw new ye.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=t,r.contents[t]=e,r.timestamp=e.parent.timestamp,e.parent=r},unlink(e,r){delete e.contents[r],e.timestamp=Date.now()},rmdir(e,r){var t=ye.lookupNode(e,r);for(var n in t.contents)throw new ye.ErrnoError(55);delete e.contents[r],e.timestamp=Date.now()},readdir(e){var r=[".",".."];for(var t of Object.keys(e.contents))r.push(t);return r},symlink(e,r,t){var n=me.createNode(e,r,41471,0);return n.link=t,n},readlink(e){if(!ye.isLink(e.mode))throw new ye.ErrnoError(28);return e.link}},stream_ops:{read(e,r,t,n,o){var a=e.node.contents;if(o>=e.node.usedBytes)return 0;var i=Math.min(e.node.usedBytes-o,n);if(T(i>=0),i>8&&a.subarray)r.set(a.subarray(o,o+i),t);else for(var s=0;s<i;s++)r[t+s]=a[o+s];return i},write(e,r,t,n,o,a){if(T(!(r instanceof ArrayBuffer)),r.buffer===m.buffer&&(a=!1),!n)return 0;var i=e.node;if(i.timestamp=Date.now(),r.subarray&&(!i.contents||i.contents.subarray)){if(a)return T(0===o,"canOwn must imply no weird position inside the file"),i.contents=r.subarray(t,t+n),i.usedBytes=n,n;if(0===i.usedBytes&&0===o)return i.contents=r.slice(t,t+n),i.usedBytes=n,n;if(o+n<=i.usedBytes)return i.contents.set(r.subarray(t,t+n),o),n}if(me.expandFileStorage(i,o+n),i.contents.subarray&&r.subarray)i.contents.set(r.subarray(t,t+n),o);else for(var s=0;s<n;s++)i.contents[o+s]=r[t+s];return i.usedBytes=Math.max(i.usedBytes,o+n),n},llseek(e,r,t){var n=r;if(1===t?n+=e.position:2===t&&ye.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new ye.ErrnoError(28);return n},allocate(e,r,t){me.expandFileStorage(e.node,r+t),e.node.usedBytes=Math.max(e.node.usedBytes,r+t)},mmap(e,r,t,n,o){if(!ye.isFile(e.node.mode))throw new ye.ErrnoError(43);var a,i,s=e.node.contents;if(2&o||s.buffer!==m.buffer){if((t>0||t+r<s.length)&&(s=s.subarray?s.subarray(t,t+r):Array.prototype.slice.call(s,t,t+r)),i=!0,!(a=fe()))throw new ye.ErrnoError(48);m.set(s,a)}else i=!1,a=s.byteOffset;return{ptr:a,allocated:i}},msync:(e,r,t,n,o)=>(me.stream_ops.write(e,r,0,n,t,!1),0)}},pe=o.preloadPlugins||[],he=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},ge={0:"Success",1:"Arg list too long",2:"Permission denied",3:"Address already in use",4:"Address not available",5:"Address family not supported by protocol family",6:"No more processes",7:"Socket already connected",8:"Bad file number",9:"Trying to read unreadable message",10:"Mount device busy",11:"Operation canceled",12:"No children",13:"Connection aborted",14:"Connection refused",15:"Connection reset by peer",16:"File locking deadlock error",17:"Destination address required",18:"Math arg out of domain of func",19:"Quota exceeded",20:"File exists",21:"Bad address",22:"File too large",23:"Host is unreachable",24:"Identifier removed",25:"Illegal byte sequence",26:"Connection already in progress",27:"Interrupted system call",28:"Invalid argument",29:"I/O error",30:"Socket is already connected",31:"Is a directory",32:"Too many symbolic links",33:"Too many open files",34:"Too many links",35:"Message too long",36:"Multihop attempted",37:"File or path name too long",38:"Network interface is not configured",39:"Connection reset by network",40:"Network is unreachable",41:"Too many open files in system",42:"No buffer space available",43:"No such device",44:"No such file or directory",45:"Exec format error",46:"No record locks available",47:"The link has been severed",48:"Not enough core",49:"No message of desired type",50:"Protocol not available",51:"No space left on device",52:"Function not implemented",53:"Socket is not connected",54:"Not a directory",55:"Directory not empty",56:"State not recoverable",57:"Socket operation on non-socket",59:"Not a typewriter",60:"No such device or address",61:"Value too large for defined data type",62:"Previous owner died",63:"Not super-user",64:"Broken pipe",65:"Protocol error",66:"Unknown protocol",67:"Protocol wrong type for socket",68:"Math result not representable",69:"Read only file system",70:"Illegal seek",71:"No such process",72:"Stale file handle",73:"Connection timed out",74:"Text file busy",75:"Cross-device link",100:"Device not a stream",101:"Bad font file fmt",102:"Invalid slot",103:"Invalid request code",104:"No anode",105:"Block device required",106:"Channel number out of range",107:"Level 3 halted",108:"Level 3 reset",109:"Link number out of range",110:"Protocol driver not attached",111:"No CSI structure available",112:"Level 2 halted",113:"Invalid exchange",114:"Invalid request descriptor",115:"Exchange full",116:"No data (for no delay io)",117:"Timer expired",118:"Out of streams resources",119:"Machine is not on the network",120:"Package not installed",121:"The object is remote",122:"Advertise error",123:"Srmount error",124:"Communication error on send",125:"Cross mount point (not really error)",126:"Given log. name not unique",127:"f.d. invalid for this operation",128:"Remote address changed",129:"Can access a needed shared lib",130:"Accessing a corrupted shared lib",131:".lib section in a.out corrupted",132:"Attempting to link in too many libs",133:"Attempting to exec a shared library",135:"Streams pipe error",136:"Too many users",137:"Socket type not supported",138:"Not supported",139:"Protocol family not supported",140:"Can't send after socket shutdown",141:"Too many references",142:"Host is down",148:"No medium (in tape drive)",156:"Level 2 not synchronized"},ve={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135},ye={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class extends Error{constructor(e){for(var r in super(ge[e]),this.name="ErrnoError",this.errno=e,ve)if(ve[r]===e){this.code=r;break}}},genericErrors:{},filesystems:null,syncFSRequests:0,FSStream:class{constructor(){this.shared={}}get object(){return this.node}set object(e){this.node=e}get isRead(){return 1!=(2097155&this.flags)}get isWrite(){return!!(2097155&this.flags)}get isAppend(){return 1024&this.flags}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{constructor(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=ye.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n,this.readMode=365,this.writeMode=146}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return ye.isDir(this.mode)}get isDevice(){return ye.isChrdev(this.mode)}},lookupPath(e,r={}){if(!(e=ie.resolve(e)))return{path:"",node:null};if((r=Object.assign({follow_mount:!0,recurse_count:0},r)).recurse_count>8)throw new ye.ErrnoError(32);for(var t=e.split("/").filter((e=>!!e)),n=ye.root,o="/",a=0;a<t.length;a++){var i=a===t.length-1;if(i&&r.parent)break;if(n=ye.lookupNode(n,t[a]),o=oe.join2(o,t[a]),ye.isMountpoint(n)&&(!i||i&&r.follow_mount)&&(n=n.mounted.root),!i||r.follow)for(var s=0;ye.isLink(n.mode);){var l=ye.readlink(o);if(o=ie.resolve(oe.dirname(o),l),n=ye.lookupPath(o,{recurse_count:r.recurse_count+1}).node,s++>40)throw new ye.ErrnoError(32)}}return{path:o,node:n}},getPath(e){for(var r;;){if(ye.isRoot(e)){var t=e.mount.mountpoint;return r?"/"!==t[t.length-1]?`${t}/${r}`:t+r:t}r=r?`${e.name}/${r}`:e.name,e=e.parent}},hashName(e,r){for(var t=0,n=0;n<r.length;n++)t=(t<<5)-t+r.charCodeAt(n)|0;return(e+t>>>0)%ye.nameTable.length},hashAddNode(e){var r=ye.hashName(e.parent.id,e.name);e.name_next=ye.nameTable[r],ye.nameTable[r]=e},hashRemoveNode(e){var r=ye.hashName(e.parent.id,e.name);if(ye.nameTable[r]===e)ye.nameTable[r]=e.name_next;else for(var t=ye.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=ye.mayLookup(e);if(t)throw new ye.ErrnoError(t);for(var n=ye.hashName(e.id,r),o=ye.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===r)return o}return ye.lookup(e,r)},createNode(e,r,t,n){T("object"==typeof e);var o=new ye.FSNode(e,r,t,n);return ye.hashAddNode(o),o},destroyNode(e){ye.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&~e),flagsToPermissionString(e){var r=["r","w","rw"][3&e];return 512&e&&(r+="w"),r},nodePermissions:(e,r)=>ye.ignorePermissions||(!r.includes("r")||292&e.mode)&&(!r.includes("w")||146&e.mode)&&(!r.includes("x")||73&e.mode)?0:2,mayLookup(e){if(!ye.isDir(e.mode))return 54;var r=ye.nodePermissions(e,"x");return r||(e.node_ops.lookup?0:2)},mayCreate(e,r){try{ye.lookupNode(e,r);return 20}catch(e){}return ye.nodePermissions(e,"wx")},mayDelete(e,r,t){var n;try{n=ye.lookupNode(e,r)}catch(e){return e.errno}var o=ye.nodePermissions(e,"wx");if(o)return o;if(t){if(!ye.isDir(n.mode))return 54;if(ye.isRoot(n)||ye.getPath(n)===ye.cwd())return 10}else if(ye.isDir(n.mode))return 31;return 0},mayOpen:(e,r)=>e?ye.isLink(e.mode)?32:ye.isDir(e.mode)&&("r"!==ye.flagsToPermissionString(r)||512&r)?31:ye.nodePermissions(e,ye.flagsToPermissionString(r)):44,MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=ye.MAX_OPEN_FDS;e++)if(!ye.streams[e])return e;throw new ye.ErrnoError(33)},getStreamChecked(e){var r=ye.getStream(e);if(!r)throw new ye.ErrnoError(8);return r},getStream:e=>ye.streams[e],createStream:(e,r=-1)=>(e=Object.assign(new ye.FSStream,e),-1==r&&(r=ye.nextfd()),e.fd=r,ye.streams[r]=e,e),closeStream(e){ye.streams[e]=null},dupStream(e,r=-1){var t,n,o=ye.createStream(e,r);return null===(t=o.stream_ops)||void 0===t||null===(n=t.dup)||void 0===n||n.call(t,o),o},chrdev_stream_ops:{open(e){var r,t,n=ye.getDevice(e.node.rdev);e.stream_ops=n.stream_ops,null===(r=(t=e.stream_ops).open)||void 0===r||r.call(t,e)},llseek(){throw new ye.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,r)=>e<<8|r,registerDevice(e,r){ye.devices[e]={stream_ops:r}},getDevice:e=>ye.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push(...n.mounts)}return r},syncfs(e,r){"function"==typeof e&&(r=e,e=!1),ye.syncFSRequests++,ye.syncFSRequests>1&&f(`warning: ${ye.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=ye.getMounts(ye.root.mount),n=0;function o(e){return T(ye.syncFSRequests>0),ye.syncFSRequests--,r(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,o(e));++n>=t.length&&o(null)}t.forEach((r=>{if(!r.type.syncfs)return a(null);r.type.syncfs(r,e,a)}))},mount(e,r,t){if("string"==typeof e)throw e;var n,o="/"===t,a=!t;if(o&&ye.root)throw new ye.ErrnoError(10);if(!o&&!a){var i=ye.lookupPath(t,{follow_mount:!1});if(t=i.path,n=i.node,ye.isMountpoint(n))throw new ye.ErrnoError(10);if(!ye.isDir(n.mode))throw new ye.ErrnoError(54)}var s={type:e,opts:r,mountpoint:t,mounts:[]},l=e.mount(s);return l.mount=s,s.root=l,o?ye.root=l:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),l},unmount(e){var r=ye.lookupPath(e,{follow_mount:!1});if(!ye.isMountpoint(r.node))throw new ye.ErrnoError(28);var t=r.node,n=t.mounted,o=ye.getMounts(n);Object.keys(ye.nameTable).forEach((e=>{for(var r=ye.nameTable[e];r;){var t=r.name_next;o.includes(r.mount)&&ye.destroyNode(r),r=t}})),t.mounted=null;var a=t.mount.mounts.indexOf(n);T(-1!==a),t.mount.mounts.splice(a,1)},lookup:(e,r)=>e.node_ops.lookup(e,r),mknod(e,r,t){var n=ye.lookupPath(e,{parent:!0}).node,o=oe.basename(e);if(!o||"."===o||".."===o)throw new ye.ErrnoError(28);var a=ye.mayCreate(n,o);if(a)throw new ye.ErrnoError(a);if(!n.node_ops.mknod)throw new ye.ErrnoError(63);return n.node_ops.mknod(n,o,r,t)},create:(e,r)=>(r=void 0!==r?r:438,r&=4095,r|=32768,ye.mknod(e,r,0)),mkdir:(e,r)=>(r=void 0!==r?r:511,r&=1023,r|=16384,ye.mknod(e,r,0)),mkdirTree(e,r){for(var t=e.split("/"),n="",o=0;o<t.length;++o)if(t[o]){n+="/"+t[o];try{ye.mkdir(n,r)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,r,t)=>(void 0===t&&(t=r,r=438),r|=8192,ye.mknod(e,r,t)),symlink(e,r){if(!ie.resolve(e))throw new ye.ErrnoError(44);var t=ye.lookupPath(r,{parent:!0}).node;if(!t)throw new ye.ErrnoError(44);var n=oe.basename(r),o=ye.mayCreate(t,n);if(o)throw new ye.ErrnoError(o);if(!t.node_ops.symlink)throw new ye.ErrnoError(63);return t.node_ops.symlink(t,n,e)},rename(e,r){var t,n,o=oe.dirname(e),a=oe.dirname(r),i=oe.basename(e),s=oe.basename(r);if(t=ye.lookupPath(e,{parent:!0}).node,n=ye.lookupPath(r,{parent:!0}).node,!t||!n)throw new ye.ErrnoError(44);if(t.mount!==n.mount)throw new ye.ErrnoError(75);var l,d=ye.lookupNode(t,i),u=ie.relative(e,a);if("."!==u.charAt(0))throw new ye.ErrnoError(28);if("."!==(u=ie.relative(r,o)).charAt(0))throw new ye.ErrnoError(55);try{l=ye.lookupNode(n,s)}catch(e){}if(d!==l){var c=ye.isDir(d.mode),f=ye.mayDelete(t,i,c);if(f)throw new ye.ErrnoError(f);if(f=l?ye.mayDelete(n,s,c):ye.mayCreate(n,s))throw new ye.ErrnoError(f);if(!t.node_ops.rename)throw new ye.ErrnoError(63);if(ye.isMountpoint(d)||l&&ye.isMountpoint(l))throw new ye.ErrnoError(10);if(n!==t&&(f=ye.nodePermissions(t,"w")))throw new ye.ErrnoError(f);ye.hashRemoveNode(d);try{t.node_ops.rename(d,n,s)}catch(e){throw e}finally{ye.hashAddNode(d)}}},rmdir(e){var r=ye.lookupPath(e,{parent:!0}).node,t=oe.basename(e),n=ye.lookupNode(r,t),o=ye.mayDelete(r,t,!0);if(o)throw new ye.ErrnoError(o);if(!r.node_ops.rmdir)throw new ye.ErrnoError(63);if(ye.isMountpoint(n))throw new ye.ErrnoError(10);r.node_ops.rmdir(r,t),ye.destroyNode(n)},readdir(e){var r=ye.lookupPath(e,{follow:!0}).node;if(!r.node_ops.readdir)throw new ye.ErrnoError(54);return r.node_ops.readdir(r)},unlink(e){var r=ye.lookupPath(e,{parent:!0}).node;if(!r)throw new ye.ErrnoError(44);var t=oe.basename(e),n=ye.lookupNode(r,t),o=ye.mayDelete(r,t,!1);if(o)throw new ye.ErrnoError(o);if(!r.node_ops.unlink)throw new ye.ErrnoError(63);if(ye.isMountpoint(n))throw new ye.ErrnoError(10);r.node_ops.unlink(r,t),ye.destroyNode(n)},readlink(e){var r=ye.lookupPath(e).node;if(!r)throw new ye.ErrnoError(44);if(!r.node_ops.readlink)throw new ye.ErrnoError(28);return ie.resolve(ye.getPath(r.parent),r.node_ops.readlink(r))},stat(e,r){var t=ye.lookupPath(e,{follow:!r}).node;if(!t)throw new ye.ErrnoError(44);if(!t.node_ops.getattr)throw new ye.ErrnoError(63);return t.node_ops.getattr(t)},lstat:e=>ye.stat(e,!0),chmod(e,r,t){var n;"string"==typeof e?n=ye.lookupPath(e,{follow:!t}).node:n=e;if(!n.node_ops.setattr)throw new ye.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&r|-4096&n.mode,timestamp:Date.now()})},lchmod(e,r){ye.chmod(e,r,!0)},fchmod(e,r){var t=ye.getStreamChecked(e);ye.chmod(t.node,r)},chown(e,r,t,n){var o;"string"==typeof e?o=ye.lookupPath(e,{follow:!n}).node:o=e;if(!o.node_ops.setattr)throw new ye.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(e,r,t){ye.chown(e,r,t,!0)},fchown(e,r,t){var n=ye.getStreamChecked(e);ye.chown(n.node,r,t)},truncate(e,r){if(r<0)throw new ye.ErrnoError(28);var t;"string"==typeof e?t=ye.lookupPath(e,{follow:!0}).node:t=e;if(!t.node_ops.setattr)throw new ye.ErrnoError(63);if(ye.isDir(t.mode))throw new ye.ErrnoError(31);if(!ye.isFile(t.mode))throw new ye.ErrnoError(28);var n=ye.nodePermissions(t,"w");if(n)throw new ye.ErrnoError(n);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate(e,r){var t=ye.getStreamChecked(e);if(!(2097155&t.flags))throw new ye.ErrnoError(28);ye.truncate(t.node,r)},utime(e,r,t){var n=ye.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(r,t)})},open(e,r,t){if(""===e)throw new ye.ErrnoError(44);var n;if(t=void 0===t?438:t,t=64&(r="string"==typeof r?(e=>{var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===r)throw new Error(`Unknown file open mode: ${e}`);return r})(r):r)?4095&t|32768:0,"object"==typeof e)n=e;else{e=oe.normalize(e);try{n=ye.lookupPath(e,{follow:!(131072&r)}).node}catch(e){}}var a=!1;if(64&r)if(n){if(128&r)throw new ye.ErrnoError(20)}else n=ye.mknod(e,t,0),a=!0;if(!n)throw new ye.ErrnoError(44);if(ye.isChrdev(n.mode)&&(r&=-513),65536&r&&!ye.isDir(n.mode))throw new ye.ErrnoError(54);if(!a){var i=ye.mayOpen(n,r);if(i)throw new ye.ErrnoError(i)}512&r&&!a&&ye.truncate(n,0),r&=-131713;var s=ye.createStream({node:n,path:ye.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!o.logReadFiles||1&r||(ye.readFiles||(ye.readFiles={}),e in ye.readFiles||(ye.readFiles[e]=1)),s},close(e){if(ye.isClosed(e))throw new ye.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{ye.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,r,t){if(ye.isClosed(e))throw new ye.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new ye.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new ye.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,n,o){if(T(t>=0),n<0||o<0)throw new ye.ErrnoError(28);if(ye.isClosed(e))throw new ye.ErrnoError(8);if(1==(2097155&e.flags))throw new ye.ErrnoError(8);if(ye.isDir(e.node.mode))throw new ye.ErrnoError(31);if(!e.stream_ops.read)throw new ye.ErrnoError(28);var a=void 0!==o;if(a){if(!e.seekable)throw new ye.ErrnoError(70)}else o=e.position;var i=e.stream_ops.read(e,r,t,n,o);return a||(e.position+=i),i},write(e,r,t,n,o,a){if(T(t>=0),n<0||o<0)throw new ye.ErrnoError(28);if(ye.isClosed(e))throw new ye.ErrnoError(8);if(!(2097155&e.flags))throw new ye.ErrnoError(8);if(ye.isDir(e.node.mode))throw new ye.ErrnoError(31);if(!e.stream_ops.write)throw new ye.ErrnoError(28);e.seekable&&1024&e.flags&&ye.llseek(e,0,2);var i=void 0!==o;if(i){if(!e.seekable)throw new ye.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,r,t,n,o,a);return i||(e.position+=s),s},allocate(e,r,t){if(ye.isClosed(e))throw new ye.ErrnoError(8);if(r<0||t<=0)throw new ye.ErrnoError(28);if(!(2097155&e.flags))throw new ye.ErrnoError(8);if(!ye.isFile(e.node.mode)&&!ye.isDir(e.node.mode))throw new ye.ErrnoError(43);if(!e.stream_ops.allocate)throw new ye.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap(e,r,t,n,o){if(2&n&&!(2&o)&&2!=(2097155&e.flags))throw new ye.ErrnoError(2);if(1==(2097155&e.flags))throw new ye.ErrnoError(2);if(!e.stream_ops.mmap)throw new ye.ErrnoError(43);return e.stream_ops.mmap(e,r,t,n,o)},msync:(e,r,t,n,o)=>(T(t>=0),e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,o):0),ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new ye.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){if(r.flags=r.flags||0,r.encoding=r.encoding||"binary","utf8"!==r.encoding&&"binary"!==r.encoding)throw new Error(`Invalid encoding type "${r.encoding}"`);var t,n=ye.open(e,r.flags),o=ye.stat(e).size,a=new Uint8Array(o);return ye.read(n,a,0,o,0),"utf8"===r.encoding?t=ee(a,0):"binary"===r.encoding&&(t=a),ye.close(n),t},writeFile(e,r,t={}){t.flags=t.flags||577;var n=ye.open(e,t.flags,t.mode);if("string"==typeof r){var o=new Uint8Array(le(r)+1),a=de(r,o,0,o.length);ye.write(n,o,0,a,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(r))throw new Error("Unsupported data type");ye.write(n,r,0,r.byteLength,void 0,t.canOwn)}ye.close(n)},cwd:()=>ye.currentPath,chdir(e){var r=ye.lookupPath(e,{follow:!0});if(null===r.node)throw new ye.ErrnoError(44);if(!ye.isDir(r.node.mode))throw new ye.ErrnoError(54);var t=ye.nodePermissions(r.node,"x");if(t)throw new ye.ErrnoError(t);ye.currentPath=r.path},createDefaultDirectories(){ye.mkdir("/tmp"),ye.mkdir("/home"),ye.mkdir("/home/web_user")},createDefaultDevices(){ye.mkdir("/dev"),ye.registerDevice(ye.makedev(1,3),{read:()=>0,write:(e,r,t,n,o)=>n}),ye.mkdev("/dev/null",ye.makedev(1,3)),ce.register(ye.makedev(5,0),ce.default_tty_ops),ce.register(ye.makedev(6,0),ce.default_tty1_ops),ye.mkdev("/dev/tty",ye.makedev(5,0)),ye.mkdev("/dev/tty1",ye.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(0===r&&(r=ae(e).byteLength),e[--r]);ye.createDevice("/dev","random",t),ye.createDevice("/dev","urandom",t),ye.mkdir("/dev/shm"),ye.mkdir("/dev/shm/tmp")},createSpecialDirectories(){ye.mkdir("/proc");var e=ye.mkdir("/proc/self");ye.mkdir("/proc/self/fd"),ye.mount({mount(){var r=ye.createNode(e,"fd",16895,73);return r.node_ops={lookup(e,r){var t=+r,n=ye.getStreamChecked(t),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},r}},{},"/proc/self/fd")},createStandardStreams(){o.stdin?ye.createDevice("/dev","stdin",o.stdin):ye.symlink("/dev/tty","/dev/stdin"),o.stdout?ye.createDevice("/dev","stdout",null,o.stdout):ye.symlink("/dev/tty","/dev/stdout"),o.stderr?ye.createDevice("/dev","stderr",null,o.stderr):ye.symlink("/dev/tty1","/dev/stderr");var e=ye.open("/dev/stdin",0),r=ye.open("/dev/stdout",1),t=ye.open("/dev/stderr",1);T(0===e.fd,`invalid handle for stdin (${e.fd})`),T(1===r.fd,`invalid handle for stdout (${r.fd})`),T(2===t.fd,`invalid handle for stderr (${t.fd})`)},staticInit(){[44].forEach((e=>{ye.genericErrors[e]=new ye.ErrnoError(e),ye.genericErrors[e].stack="<generic error, no stack>"})),ye.nameTable=new Array(4096),ye.mount(me,{},"/"),ye.createDefaultDirectories(),ye.createDefaultDevices(),ye.createSpecialDirectories(),ye.filesystems={MEMFS:me}},init(e,r,t){T(!ye.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)"),ye.init.initialized=!0,o.stdin=e||o.stdin,o.stdout=r||o.stdout,o.stderr=t||o.stderr,ye.createStandardStreams()},quit(){ye.init.initialized=!1,at(0);for(var e=0;e<ye.streams.length;e++){var r=ye.streams[e];r&&ye.close(r)}},findObject(e,r){var t=ye.analyzePath(e,r);return t.exists?t.object:null},analyzePath(e,r){try{e=(n=ye.lookupPath(e,{follow:!r})).path}catch(e){}var t={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=ye.lookupPath(e,{parent:!0});t.parentExists=!0,t.parentPath=n.path,t.parentObject=n.node,t.name=oe.basename(e),n=ye.lookupPath(e,{follow:!r}),t.exists=!0,t.path=n.path,t.object=n.node,t.name=n.node.name,t.isRoot="/"===n.path}catch(e){t.error=e.errno}return t},createPath(e,r,t,n){e="string"==typeof e?e:ye.getPath(e);for(var o=r.split("/").reverse();o.length;){var a=o.pop();if(a){var i=oe.join2(e,a);try{ye.mkdir(i)}catch(e){}e=i}}return i},createFile(e,r,t,n,o){var a=oe.join2("string"==typeof e?e:ye.getPath(e),r),i=he(n,o);return ye.create(a,i)},createDataFile(e,r,t,n,o,a){var i=r;e&&(e="string"==typeof e?e:ye.getPath(e),i=r?oe.join2(e,r):e);var s=he(n,o),l=ye.create(i,s);if(t){if("string"==typeof t){for(var d=new Array(t.length),u=0,c=t.length;u<c;++u)d[u]=t.charCodeAt(u);t=d}ye.chmod(l,146|s);var f=ye.open(l,577);ye.write(f,t,0,t.length,0,a),ye.close(f),ye.chmod(l,s)}},createDevice(e,r,t,n){var o=oe.join2("string"==typeof e?e:ye.getPath(e),r),a=he(!!t,!!n);ye.createDevice.major||(ye.createDevice.major=64);var i=ye.makedev(ye.createDevice.major++,0);return ye.registerDevice(i,{open(e){e.seekable=!1},close(e){var r;null!=n&&null!==(r=n.buffer)&&void 0!==r&&r.length&&n(10)},read(e,r,n,o,a){for(var i=0,s=0;s<o;s++){var l;try{l=t()}catch(e){throw new ye.ErrnoError(29)}if(void 0===l&&0===i)throw new ye.ErrnoError(6);if(null==l)break;i++,r[n+s]=l}return i&&(e.node.timestamp=Date.now()),i},write(e,r,t,o,a){for(var i=0;i<o;i++)try{n(r[t+i])}catch(e){throw new ye.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),i}}),ye.mkdev(o,a,i)},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(!t)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=ue(t(e.url)),e.usedBytes=e.contents.length}catch(e){throw new ye.ErrnoError(29)}},createLazyFile(e,r,t,n,o){if("undefined"!=typeof XMLHttpRequest)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a={isDevice:!1,url:t},i=ye.createFile(e,r,a,n,o);a.contents?i.contents=a.contents:a.url&&(i.contents=null,i.url=a.url),Object.defineProperties(i,{usedBytes:{get:function(){return this.contents.length}}});var s={};function l(e,r,t,n,o){var a=e.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(T(i>=0),a.slice)for(var s=0;s<i;s++)r[t+s]=a[o+s];else for(s=0;s<i;s++)r[t+s]=a.get(o+s);return i}return Object.keys(i.stream_ops).forEach((e=>{var r=i.stream_ops[e];s[e]=(...e)=>(ye.forceLoadFile(i),r(...e))})),s.read=(e,r,t,n,o)=>(ye.forceLoadFile(i),l(e,r,t,n,o)),s.mmap=(e,r,t,n,o)=>{ye.forceLoadFile(i);var a=fe();if(!a)throw new ye.ErrnoError(48);return l(e,m,a,r,t),{ptr:a,allocated:!0}},i.stream_ops=s,i},absolutePath(){R("FS.absolutePath has been removed; use PATH_FS.resolve instead")},createFolder(){R("FS.createFolder has been removed; use FS.mkdir instead")},createLink(){R("FS.createLink has been removed; use FS.symlink instead")},joinPath(){R("FS.joinPath has been removed; use PATH.join instead")},mmapAlloc(){R("FS.mmapAlloc has been replaced by the top level function mmapAlloc")},standardizePath(){R("FS.standardizePath has been removed; use PATH.normalize instead")}},Ee={DEFAULT_POLLMASK:5,calculateAt(e,r,t){if(oe.isAbs(r))return r;var n;-100===e?n=ye.cwd():n=Ee.getStreamFromFD(e).path;if(0==r.length){if(!t)throw new ye.ErrnoError(44);return n}return oe.join2(n,r)},doStat(e,r,t){var n=e(r);v[t>>2]=n.dev,v[t+4>>2]=n.mode,y[t+8>>2]=n.nlink,v[t+12>>2]=n.uid,v[t+16>>2]=n.gid,v[t+20>>2]=n.rdev,x=[n.size>>>0,(U=n.size,+Math.abs(U)>=1?U>0?+Math.floor(U/4294967296)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],v[t+24>>2]=x[0],v[t+28>>2]=x[1],v[t+32>>2]=4096,v[t+36>>2]=n.blocks;var o=n.atime.getTime(),a=n.mtime.getTime(),i=n.ctime.getTime();return x=[Math.floor(o/1e3)>>>0,(U=Math.floor(o/1e3),+Math.abs(U)>=1?U>0?+Math.floor(U/4294967296)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],v[t+40>>2]=x[0],v[t+44>>2]=x[1],y[t+48>>2]=o%1e3*1e3,x=[Math.floor(a/1e3)>>>0,(U=Math.floor(a/1e3),+Math.abs(U)>=1?U>0?+Math.floor(U/4294967296)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],v[t+56>>2]=x[0],v[t+60>>2]=x[1],y[t+64>>2]=a%1e3*1e3,x=[Math.floor(i/1e3)>>>0,(U=Math.floor(i/1e3),+Math.abs(U)>=1?U>0?+Math.floor(U/4294967296)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],v[t+72>>2]=x[0],v[t+76>>2]=x[1],y[t+80>>2]=i%1e3*1e3,x=[n.ino>>>0,(U=n.ino,+Math.abs(U)>=1?U>0?+Math.floor(U/4294967296)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],v[t+88>>2]=x[0],v[t+92>>2]=x[1],0},doMsync(e,r,t,n,o){if(!ye.isFile(r.node.mode))throw new ye.ErrnoError(43);if(2&n)return 0;var a=p.slice(e,e+t);ye.msync(r,a,o,t,n)},getStreamFromFD:e=>ye.getStreamChecked(e),varargs:void 0,getStr:e=>re(e)};var we,be,Te,_e=e=>{for(var r="",t=e;p[t];)r+=we[p[t++]];return r},Ce={},Se={},Pe={},ke=e=>{throw new be(e)},Ae=e=>{throw new Te(e)},Fe=(e,r,t)=>{function n(r){var n=t(r);n.length!==e.length&&Ae("Mismatched type converter count");for(var o=0;o<e.length;++o)De(e[o],n[o])}e.forEach((function(e){Pe[e]=r}));var o=new Array(r.length),a=[],i=0;r.forEach(((e,r)=>{Se.hasOwnProperty(e)?o[r]=Se[e]:(a.push(e),Ce.hasOwnProperty(e)||(Ce[e]=[]),Ce[e].push((()=>{o[r]=Se[e],++i===a.length&&n(o)})))})),0===a.length&&n(o)};function De(e,r,t={}){if(!("argPackAdvance"in r))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(e,r,t={}){var n=r.name;if(e||ke(`type "${n}" must have a positive integer typeid pointer`),Se.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;ke(`Cannot register type '${n}' twice`)}if(Se[e]=r,delete Pe[e],Ce.hasOwnProperty(e)){var o=Ce[e];delete Ce[e],o.forEach((e=>e()))}}(e,r,t)}var Oe,Me=e=>{ke(e.$$.ptrType.registeredClass.name+" instance already deleted")},$e=!1,Ne=e=>{},Ie=e=>{e.count.value-=1,0===e.count.value&&(e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)})(e)},Re=(e,r,t)=>{if(r===t)return e;if(void 0===t.baseClass)return null;var n=Re(e,r,t.baseClass);return null===n?null:t.downcast(n)},Le={},Ue=()=>Object.keys(ze).length,xe=()=>{var e=[];for(var r in ze)ze.hasOwnProperty(r)&&e.push(ze[r]);return e},Be=[],je=()=>{for(;Be.length;){var e=Be.pop();e.$$.deleteScheduled=!1,e.delete()}},We=e=>{Oe=e,Be.length&&Oe&&Oe(je)},ze={},He=(e,r)=>(r=((e,r)=>{for(void 0===r&&ke("ptr should not be undefined");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r})(e,r),ze[r]),Ve=(e,r)=>(r.ptrType&&r.ptr||Ae("makeClassHandle requires ptr and ptrType"),!!r.smartPtrType!==!!r.smartPtr&&Ae("Both smartPtrType and smartPtr must be specified"),r.count={value:1},Ye(Object.create(e,{$$:{value:r,writable:!0}})));function Ge(e){var r=this.getPointee(e);if(!r)return this.destructor(e),null;var t=He(this.registeredClass,r);if(void 0!==t){if(0===t.$$.count.value)return t.$$.ptr=r,t.$$.smartPtr=e,t.clone();var n=t.clone();return this.destructor(e),n}function o(){return this.isSmartPointer?Ve(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:e}):Ve(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var a,i=this.registeredClass.getActualType(r),s=Le[i];if(!s)return o.call(this);a=this.isConst?s.constPointerType:s.pointerType;var l=Re(r,this.registeredClass,a.registeredClass);return null===l?o.call(this):this.isSmartPointer?Ve(a.registeredClass.instancePrototype,{ptrType:a,ptr:l,smartPtrType:this,smartPtr:e}):Ve(a.registeredClass.instancePrototype,{ptrType:a,ptr:l})}var Ye=e=>"undefined"==typeof FinalizationRegistry?(Ye=e=>e,e):($e=new FinalizationRegistry((e=>{Ie(e.$$)})),Ye=e=>{var r=e.$$;if(!!r.smartPtr){var t={$$:r},n=r.ptrType.registeredClass;t.leakWarning=new Error(`Embind found a leaked C++ instance ${n.name} <${J(r.ptr)}>.\nWe'll free it automatically in this case, but this functionality is not reliable across various environments.\nMake sure to invoke .delete() manually once you're done with the instance instead.\nOriginally allocated`),"captureStackTrace"in Error&&Error.captureStackTrace(t.leakWarning,Ge),$e.register(e,t,e)}return e},Ne=e=>$e.unregister(e),Ye(e));function qe(){}var Xe=(e,r)=>Object.defineProperty(r,"name",{value:e}),Ke=(e,r,t)=>{if(void 0===e[r].overloadTable){var n=e[r];e[r]=function(...n){return e[r].overloadTable.hasOwnProperty(n.length)||ke(`Function '${t}' called with an invalid number of arguments (${n.length}) - expects one of (${e[r].overloadTable})!`),e[r].overloadTable[n.length].apply(this,n)},e[r].overloadTable=[],e[r].overloadTable[n.argCount]=n}};function Je(e,r,t,n,o,a,i,s){this.name=e,this.constructor=r,this.instancePrototype=t,this.rawDestructor=n,this.baseClass=o,this.getActualType=a,this.upcast=i,this.downcast=s,this.pureVirtualFunctions=[]}var Ze=(e,r,t)=>{for(;r!==t;)r.upcast||ke(`Expected null or instance of ${t.name}, got an instance of ${r.name}`),e=r.upcast(e),r=r.baseClass;return e};function Qe(e,r){if(null===r)return this.isReference&&ke(`null is not a valid ${this.name}`),0;r.$$||ke(`Cannot pass "${_r(r)}" as a ${this.name}`),r.$$.ptr||ke(`Cannot pass deleted object as a pointer of type ${this.name}`);var t=r.$$.ptrType.registeredClass;return Ze(r.$$.ptr,t,this.registeredClass)}function er(e,r){var t;if(null===r)return this.isReference&&ke(`null is not a valid ${this.name}`),this.isSmartPointer?(t=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,t),t):0;r&&r.$$||ke(`Cannot pass "${_r(r)}" as a ${this.name}`),r.$$.ptr||ke(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&r.$$.ptrType.isConst&&ke(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);var n=r.$$.ptrType.registeredClass;if(t=Ze(r.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===r.$$.smartPtr&&ke("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?t=r.$$.smartPtr:ke(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:t=r.$$.smartPtr;break;case 2:if(r.$$.smartPtrType===this)t=r.$$.smartPtr;else{var o=r.clone();t=this.rawShare(t,br.toHandle((()=>o.delete()))),null!==e&&e.push(this.rawDestructor,t)}break;default:ke("Unsupporting sharing policy")}return t}function rr(e,r){if(null===r)return this.isReference&&ke(`null is not a valid ${this.name}`),0;r.$$||ke(`Cannot pass "${_r(r)}" as a ${this.name}`),r.$$.ptr||ke(`Cannot pass deleted object as a pointer of type ${this.name}`),r.$$.ptrType.isConst&&ke(`Cannot convert argument of type ${r.$$.ptrType.name} to parameter type ${this.name}`);var t=r.$$.ptrType.registeredClass;return Ze(r.$$.ptr,t,this.registeredClass)}function tr(e){return this.fromWireType(y[e>>2])}function nr(e,r,t,n,o,a,i,s,l,d,u){this.name=e,this.registeredClass=r,this.isReference=t,this.isConst=n,this.isSmartPointer=o,this.pointeeType=a,this.sharingPolicy=i,this.rawGetPointee=s,this.rawConstructor=l,this.rawShare=d,this.rawDestructor=u,o||void 0!==r.baseClass?this.toWireType=er:n?(this.toWireType=Qe,this.destructorFunction=null):(this.toWireType=rr,this.destructorFunction=null)}var or,ar,ir=e=>or.get(e),sr=(e,r,t=[])=>e.includes("j")?((e,r,t)=>(T("dynCall_"+(e=e.replace(/p/g,"i"))in o,`bad function pointer type - dynCall function not found for sig '${e}'`),null!=t&&t.length?T(t.length===e.substring(1).replace(/j/g,"--").length):T(1==e.length),(0,o["dynCall_"+e])(r,...t)))(e,r,t):(T(ir(r),`missing table entry in dynCall: ${r}`),ir(r)(...t)),lr=(e,r)=>{var t,n,o=(e=_e(e)).includes("j")?(n=r,T((t=e).includes("j")||t.includes("p"),"getDynCaller should only be called with i64 sigs"),(...e)=>sr(t,n,e)):ir(r);return"function"!=typeof o&&ke(`unknown function pointer with signature ${e}: ${r}`),o},dr=e=>{var r=ot(e),t=_e(r);return tt(r),t},ur=(e,r)=>{var t=[],n={};throw r.forEach((function e(r){n[r]||Se[r]||(Pe[r]?Pe[r].forEach(e):(t.push(r),n[r]=!0))})),new ar(`${e}: `+t.map(dr).join([", "]))},cr=(e,r)=>{for(var t=[],n=0;n<e;n++)t.push(y[r+4*n>>2]);return t},fr=e=>{for(;e.length;){var r=e.pop();e.pop()(r)}};function mr(e){for(var r=1;r<e.length;++r)if(null!==e[r]&&void 0===e[r].destructorFunction)return!0;return!1}function pr(e,r){if(!(e instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof e} which is not a function`);var t=Xe(e.name||"unknownFunctionName",(function(){}));t.prototype=e.prototype;var n=new t,o=e.apply(n,r);return o instanceof Object?o:n}function hr(e,r,t,n,o,a){var i=r.length;i<2&&ke("argTypes array size mismatch! Must at least get return value and 'this' types!"),T(!a,"Async bindings are only supported with JSPI.");for(var s=null!==r[1]&&null!==t,l=mr(r),d="void"!==r[0].name,u=[e,ke,n,o,fr,r[0],r[1]],c=0;c<i-2;++c)u.push(r[c+2]);if(!l)for(c=s?1:2;c<r.length;++c)null!==r[c].destructorFunction&&u.push(r[c].destructorFunction);let[f,m]=function(e,r,t,n){for(var o=mr(e),a=e.length,i="",s="",l=0;l<a-2;++l)i+=(0!==l?", ":"")+"arg"+l,s+=(0!==l?", ":"")+"arg"+l+"Wired";var d=`\n return function (${i}) {\n if (arguments.length !== ${a-2}) {\n throwBindingError('function ' + humanName + ' called with ' + arguments.length + ' arguments, expected ${a-2}');\n }`;o&&(d+="var destructors = [];\n");var u=o?"destructors":"null",c=["humanName","throwBindingError","invoker","fn","runDestructors","retType","classParam"];for(r&&(d+="var thisWired = classParam['toWireType']("+u+", this);\n"),l=0;l<a-2;++l)d+="var arg"+l+"Wired = argType"+l+"['toWireType']("+u+", arg"+l+");\n",c.push("argType"+l);if(r&&(s="thisWired"+(s.length>0?", ":"")+s),d+=(t||n?"var rv = ":"")+"invoker(fn"+(s.length>0?", ":"")+s+");\n",o)d+="runDestructors(destructors);\n";else for(l=r?1:2;l<e.length;++l){var f=1===l?"thisWired":"arg"+(l-2)+"Wired";null!==e[l].destructorFunction&&(d+=`${f}_dtor(${f});\n`,c.push(`${f}_dtor`))}return t&&(d+="var ret = retType['fromWireType'](rv);\nreturn ret;\n"),d+="}\n",[c,d=`if (arguments.length !== ${c.length}){ throw new Error(humanName + "Expected ${c.length} closure arguments " + arguments.length + " given."); }\n${d}`]}(r,s,d,a);f.push(m);var p=pr(Function,f)(...u);return Xe(e,p)}var gr=(e,r,t)=>(e instanceof Object||ke(`${t} with invalid "this": ${e}`),e instanceof r.registeredClass.constructor||ke(`${t} incompatible with "this" of type ${e.constructor.name}`),e.$$.ptr||ke(`cannot call emscripten binding method ${t} on deleted object`),Ze(e.$$.ptr,e.$$.ptrType.registeredClass,r.registeredClass)),vr=[],yr=[],Er=e=>{e>9&&0==--yr[e+1]&&(T(void 0!==yr[e],"Decref for unallocated handle."),yr[e]=void 0,vr.push(e))},wr=()=>yr.length/2-5-vr.length,br={toValue:e=>(e||ke("Cannot use deleted val. handle = "+e),T(2===e||void 0!==yr[e]&&e%2==0,`invalid handle: ${e}`),yr[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const r=vr.pop()||yr.length;return yr[r]=e,yr[r+1]=1,r}}}},Tr={name:"emscripten::val",fromWireType:e=>{var r=br.toValue(e);return Er(e),r},toWireType:(e,r)=>br.toHandle(r),argPackAdvance:8,readValueFromPointer:tr,destructorFunction:null},_r=e=>{if(null===e)return"null";var r=typeof e;return"object"===r||"array"===r||"function"===r?e.toString():""+e},Cr=(e,r)=>{switch(r){case 4:return function(e){return this.fromWireType(E[e>>2])};case 8:return function(e){return this.fromWireType(w[e>>3])};default:throw new TypeError(`invalid float width (${r}): ${e}`)}},Sr=(e,r,t)=>{switch(r){case 1:return t?e=>m[e]:e=>p[e];case 2:return t?e=>h[e>>1]:e=>g[e>>1];case 4:return t?e=>v[e>>2]:e=>y[e>>2];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},Pr=(e,r,t)=>(T("number"==typeof t,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),de(e,p,r,t)),kr="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,Ar=(e,r)=>{T(e%2==0,"Pointer passed to UTF16ToString must be aligned to two bytes!");for(var t=e,n=t>>1,o=n+r/2;!(n>=o)&&g[n];)++n;if((t=n<<1)-e>32&&kr)return kr.decode(p.subarray(e,t));for(var a="",i=0;!(i>=r/2);++i){var s=h[e+2*i>>1];if(0==s)break;a+=String.fromCharCode(s)}return a},Fr=(e,r,t)=>{if(T(r%2==0,"Pointer passed to stringToUTF16 must be aligned to two bytes!"),T("number"==typeof t,"stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),t??=2147483647,t<2)return 0;for(var n=r,o=(t-=2)<2*e.length?t/2:e.length,a=0;a<o;++a){var i=e.charCodeAt(a);h[r>>1]=i,r+=2}return h[r>>1]=0,r-n},Dr=e=>2*e.length,Or=(e,r)=>{T(e%4==0,"Pointer passed to UTF32ToString must be aligned to four bytes!");for(var t=0,n="";!(t>=r/4);){var o=v[e+4*t>>2];if(0==o)break;if(++t,o>=65536){var a=o-65536;n+=String.fromCharCode(55296|a>>10,56320|1023&a)}else n+=String.fromCharCode(o)}return n},Mr=(e,r,t)=>{if(T(r%4==0,"Pointer passed to stringToUTF32 must be aligned to four bytes!"),T("number"==typeof t,"stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),t??=2147483647,t<4)return 0;for(var n=r,o=n+t-4,a=0;a<e.length;++a){var i=e.charCodeAt(a);if(i>=55296&&i<=57343)i=65536+((1023&i)<<10)|1023&e.charCodeAt(++a);if(v[r>>2]=i,(r+=4)+4>o)break}return v[r>>2]=0,r-n},$r=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n>=55296&&n<=57343&&++t,r+=4}return r},Nr=(e,r)=>{var t=Se[e];return void 0===t&&ke(`${r} has unknown type ${dr(e)}`),t},Ir=(e,r,t)=>{var n=[],o=e.toWireType(n,t);return n.length&&(y[r>>2]=br.toHandle(n)),o},Rr={},Lr=[],Ur=(e,r)=>(T(e==e>>>0||e==(0|e)),T(r===(0|r)),r+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*r:NaN);var xr=[0,31,60,91,121,152,182,213,244,274,305,335],Br=[0,31,59,90,120,151,181,212,243,273,304,334],jr=e=>{var r;return((r=e.getFullYear())%4==0&&(r%100!=0||r%400==0)?xr:Br)[e.getMonth()]+e.getDate()-1};var Wr=(e,r)=>(T(r===(0|r)),(e>>>0)+4294967296*r),zr=(e,r)=>{if(e<=0)return e;var t=r<=32?Math.abs(1<<r-1):Math.pow(2,r-1);return e>=t&&(r<=32||e>t)&&(e=-2*t+e),e},Hr=(e,r)=>e>=0?e:r<=32?2*Math.abs(1<<r-1)+e:Math.pow(2,r)+e,Vr=e=>{for(var r=e;p[r];)++r;return r-e},Gr=(e,r)=>{T(!(3&r));var t=e,n=r;function o(e){var r;return n=function(e,r){return"double"===r||"i64"===r?7&e&&(T(4==(7&e)),e+=4):T(!(3&e)),e}(n,e),"double"===e?(r=w[n>>3],n+=8):"i64"==e?(r=[v[n>>2],v[n+4>>2]],n+=8):(T(!(3&n)),e="i32",r=v[n>>2],n+=4),r}for(var a,i,s,l,d,u,c=[];;){var f=t;if(0===(a=m[t]))break;if(i=m[t+1],37==a){var h=!1,g=!1,y=!1,E=!1,b=!1;e:for(;;){switch(i){case 43:h=!0;break;case 45:g=!0;break;case 35:y=!0;break;case 48:if(E)break e;E=!0;break;case 32:b=!0;break;default:break e}t++,i=m[t+1]}var _=0;if(42==i)_=o("i32"),t++,i=m[t+1];else for(;i>=48&&i<=57;)_=10*_+(i-48),t++,i=m[t+1];var C,S=!1,P=-1;if(46==i){if(P=0,S=!0,t++,42==(i=m[t+1]))P=o("i32"),t++;else for(;;){var k=m[t+1];if(k<48||k>57)break;P=10*P+(k-48),t++}i=m[t+1]}switch(P<0&&(P=6,S=!1),String.fromCharCode(i)){case"h":104==m[t+2]?(t++,C=1):C=2;break;case"l":108==m[t+2]?(t++,C=8):C=4;break;case"L":case"q":case"j":C=8;break;case"z":case"t":case"I":C=4;break;default:C=null}switch(C&&t++,i=m[t+1],String.fromCharCode(i)){case"d":case"i":case"u":case"o":case"x":case"X":case"p":var A=100==i||105==i;if(s=o("i"+8*(C=C||4)),8==C&&(s=117==i?(d=s[0],u=s[1],(d>>>0)+4294967296*(u>>>0)):Wr(s[0],s[1])),C<=4){var F=Math.pow(256,C)-1;s=(A?zr:Hr)(s&F,8*C)}var D=Math.abs(s),O="";if(100==i||105==i)N=zr(s,8*C).toString(10);else if(117==i)N=Hr(s,8*C).toString(10),s=Math.abs(s);else if(111==i)N=(y?"0":"")+D.toString(8);else if(120==i||88==i){if(O=y&&0!=s?"0x":"",s<0){s=-s,N=(D-1).toString(16);for(var M=[],$=0;$<N.length;$++)M.push((15-parseInt(N[$],16)).toString(16));for(N=M.join("");N.length<2*C;)N="f"+N}else N=D.toString(16);88==i&&(O=O.toUpperCase(),N=N.toUpperCase())}else 112==i&&(0===D?N="(nil)":(O="0x",N=D.toString(16)));if(S)for(;N.length<P;)N="0"+N;for(s>=0&&(h?O="+"+O:b&&(O=" "+O)),"-"==N.charAt(0)&&(O="-"+O,N=N.substr(1));O.length+N.length<_;)g?N+=" ":E?N="0"+N:O=" "+O;(N=O+N).split("").forEach((function(e){c.push(e.charCodeAt(0))}));break;case"f":case"F":case"e":case"E":case"g":case"G":var N;if(s=o("double"),isNaN(s))N="nan",E=!1;else if(isFinite(s)){var I=!1,R=Math.min(P,20);if(103==i||71==i){I=!0,P=P||1;var L=parseInt(s.toExponential(R).split("e")[1],10);P>L&&L>=-4?(i=(103==i?"f":"F").charCodeAt(0),P-=L+1):(i=(103==i?"e":"E").charCodeAt(0),P--),R=Math.min(P,20)}101==i||69==i?(N=s.toExponential(R),/[eE][-+]\d$/.test(N)&&(N=N.slice(0,-1)+"0"+N.slice(-1))):102!=i&&70!=i||(N=s.toFixed(R),0===s&&((l=s)<0||0===l&&1/l==-1/0)&&(N="-"+N));var U=N.split("e");if(I&&!y)for(;U[0].length>1&&U[0].includes(".")&&("0"==U[0].slice(-1)||"."==U[0].slice(-1));)U[0]=U[0].slice(0,-1);else for(y&&-1==N.indexOf(".")&&(U[0]+=".");P>R++;)U[0]+="0";N=U[0]+(U.length>1?"e"+U[1]:""),69==i&&(N=N.toUpperCase()),s>=0&&(h?N="+"+N:b&&(N=" "+N))}else N=(s<0?"-":"")+"inf",E=!1;for(;N.length<_;)g?N+=" ":N=!E||"-"!=N[0]&&"+"!=N[0]?(E?"0":" ")+N:N[0]+"0"+N.slice(1);i<97&&(N=N.toUpperCase()),N.split("").forEach((function(e){c.push(e.charCodeAt(0))}));break;case"s":var x=o("i8*"),B=x?Vr(x):6;if(S&&(B=Math.min(B,P)),!g)for(;B<_--;)c.push(32);if(x)for($=0;$<B;$++)c.push(p[x++]);else c=c.concat(ue("(null)".substr(0,B)));if(g)for(;B<_--;)c.push(32);break;case"c":for(g&&c.push(o("i8"));--_>0;)c.push(32);g||c.push(o("i8"));break;case"n":var j=o("i32*");v[j>>2]=c.length;break;case"%":c.push(a);break;default:for($=f;$<t+2;$++)c.push(m[$])}t+=2}else c.push(a),t+=1}return c};function Yr(e){var r=(new Error).stack.toString(),t=r.lastIndexOf("_emscripten_log"),n=r.lastIndexOf("_emscripten_get_callstack"),o=r.indexOf("\n",Math.max(t,n))+1;r=r.slice(o),8&e&&"undefined"==typeof emscripten_source_map&&(Z('Source map information is not available, emscripten_log with EM_LOG_C_STACK will be ignored. Build with "--pre-js $EMSCRIPTEN/src/emscripten-source-map.min.js" linker flag to add source map loading to code.'),e^=8,e|=16);var a=r.split("\n");r="";var i=new RegExp("\\s*(.*?)@(.*?):([0-9]+):([0-9]+)"),s=new RegExp("\\s*(.*?)@(.*):(.*)(:(.*))?"),l=new RegExp("\\s*at (.*?) \\((.*):(.*):(.*)\\)");for(var d in a){var u=a[d],c="",f="",m=0,p=0,h=l.exec(u);if(h&&5==h.length)c=h[1],f=h[2],m=h[3],p=h[4];else{if((h=i.exec(u))||(h=s.exec(u)),!(h&&h.length>=4)){r+=u+"\n";continue}c=h[1],f=h[2],m=h[3],p=0|h[4]}var g=!1;if(8&e){var v,y=emscripten_source_map.originalPositionFor({line:m,column:p});(g=null===(v=y)||void 0===v?void 0:v.source)&&(64&e&&(y.source=y.source.substring(y.source.replace(/\\/g,"/").lastIndexOf("/")+1)),r+=` at ${c} (${y.source}:${y.line}:${y.column})\n`)}(16&e||!g)&&(64&e&&(f=f.substring(f.replace(/\\/g,"/").lastIndexOf("/")+1)),r+=(g?` = ${c}`:` at ${c}`)+` (${f}:${m}:${p})\n`)}return r=r.replace(/\s+$/,"")}var qr=e=>{var r=u.buffer,t=(e-r.byteLength+65535)/65536;try{return u.grow(t),_(),1}catch(t){f(`growMemory: Attempted to grow heap from ${r.byteLength} bytes to ${e} bytes, but got error: ${t}`)}},Xr={},Kr=()=>{if(!Kr.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",_:i||"./this.program"};for(var r in Xr)void 0===Xr[r]?delete e[r]:e[r]=Xr[r];var t=[];for(var r in e)t.push(`${r}=${e[r]}`);Kr.strings=t}return Kr.strings};var Jr,Zr,Qr;ye.createPreloadedFile=(e,r,t,o,a,i,s,l,d,u)=>{var c=r?ie.resolve(oe.join2(e,r)):e,f=$(`cp ${c}`);function m(t){function n(t){null==u||u(),l||((e,r,t,n,o,a)=>{ye.createDataFile(e,r,t,n,o,a)})(e,r,t,o,a,d),null==i||i(),I(f)}((e,r,t,n)=>{"undefined"!=typeof Browser&&Browser.init();var o=!1;return pe.forEach((a=>{o||a.canHandle(r)&&(a.handle(e,r,t,n),o=!0)})),o})(t,c,n,(()=>{null==s||s(),I(f)}))||n(t)}N(f),"string"==typeof t?((e,r,t,o)=>{var a=$(`al ${e}`);n(e,(t=>{T(t,`Loading data file "${e}" failed (no arrayBuffer).`),r(new Uint8Array(t)),a&&I(a)}),(r=>{if(!t)throw`Loading data file "${e}" failed.`;t()})),a&&N(a)})(t,m,s):m(t)},ye.staticInit(),(()=>{for(var e=new Array(256),r=0;r<256;++r)e[r]=String.fromCharCode(r);we=e})(),be=o.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},Te=o.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},Object.assign(qe.prototype,{isAliasOf(e){if(!(this instanceof qe))return!1;if(!(e instanceof qe))return!1;var r=this.$$.ptrType.registeredClass,t=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,o=e.$$.ptr;r.baseClass;)t=r.upcast(t),r=r.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return r===n&&t===o},clone(){if(this.$$.ptr||Me(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,r=Ye(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 r.$$.count.value+=1,r.$$.deleteScheduled=!1,r},delete(){this.$$.ptr||Me(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ke("Object already scheduled for deletion"),Ne(this),Ie(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Me(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ke("Object already scheduled for deletion"),Be.push(this),1===Be.length&&Oe&&Oe(je),this.$$.deleteScheduled=!0,this}}),o.getInheritedInstanceCount=Ue,o.getLiveInheritedInstances=xe,o.flushPendingDeletes=je,o.setDelayFunction=We,Object.assign(nr.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){var r;null===(r=this.rawDestructor)||void 0===r||r.call(this,e)},argPackAdvance:8,readValueFromPointer:tr,fromWireType:Ge}),ar=o.UnboundTypeError=(Jr=Error,(Qr=Xe(Zr="UnboundTypeError",(function(e){this.name=Zr,this.message=e;var r=new Error(e).stack;void 0!==r&&(this.stack=this.toString()+"\n"+r.replace(/^Error(:[^\n]*)?\n/,""))}))).prototype=Object.create(Jr.prototype),Qr.prototype.constructor=Qr,Qr.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},Qr),yr.push(0,1,void 0,1,null,1,!0,1,!1,1),T(10===yr.length),o.count_emval_handles=wr;var et={__assert_fail:(e,r,t,n)=>{R(`Assertion failed: ${re(e)}, at: `+[r?re(r):"unknown filename",t,n?re(n):"unknown function"])},__syscall_fcntl64:function(e,r,t){Ee.varargs=t;try{var n=Ee.getStreamFromFD(e);switch(r){case 0:if((o=te())<0)return-28;for(;ye.streams[o];)o++;return ye.dupStream(n,o).fd;case 1:case 2:case 13:case 14:return 0;case 3:return n.flags;case 4:var o=te();return n.flags|=o,0;case 12:o=ne();return h[o+0>>1]=2,0}return-28}catch(e){if(void 0===ye||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_openat:function(e,r,t,n){Ee.varargs=n;try{r=Ee.getStr(r),r=Ee.calculateAt(e,r);var o=n?te():0;return ye.open(r,t,o).fd}catch(e){if(void 0===ye||"ErrnoError"!==e.name)throw e;return-e.errno}},_abort_js:()=>{R("native code called abort()")},_embind_register_bigint:(e,r,t,n,o)=>{},_embind_register_bool:(e,r,t,n)=>{De(e,{name:r=_e(r),fromWireType:function(e){return!!e},toWireType:function(e,r){return r?t:n},argPackAdvance:8,readValueFromPointer:function(e){return this.fromWireType(p[e])},destructorFunction:null})},_embind_register_class:(e,r,t,n,a,i,s,l,d,u,c,f,m)=>{c=_e(c),i=lr(a,i),l&&=lr(s,l),u&&=lr(d,u),m=lr(f,m);var p=(e=>{if(void 0===e)return"_unknown";var r=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return r>=48&&r<=57?`_${e}`:e})(c);((e,r,t)=>{o.hasOwnProperty(e)?(ke(`Cannot register public name '${e}' twice`),Ke(o,e,e),o.hasOwnProperty(t)&&ke(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),o[e].overloadTable[t]=r):o[e]=r})(p,(function(){ur(`Cannot construct ${c} due to unbound types`,[n])})),Fe([e,r,t],n?[n]:[],(r=>{var t,a;r=r[0],a=n?(t=r.registeredClass).instancePrototype:qe.prototype;var s=Xe(c,(function(...e){if(Object.getPrototypeOf(this)!==d)throw new be("Use 'new' to construct "+c);if(void 0===f.constructor_body)throw new be(c+" has no accessible constructor");var r=f.constructor_body[e.length];if(void 0===r)throw new be(`Tried to invoke ctor of ${c} with invalid number of parameters (${e.length}) - expected (${Object.keys(f.constructor_body).toString()}) parameters instead!`);return r.apply(this,e)})),d=Object.create(a,{constructor:{value:s}});s.prototype=d;var f=new Je(c,s,d,m,t,i,l,u);f.baseClass&&(f.baseClass.__derivedClasses??=[],f.baseClass.__derivedClasses.push(f));var h=new nr(c,f,!0,!1,!1),g=new nr(c+"*",f,!1,!1,!1),v=new nr(c+" const*",f,!1,!0,!1);return Le[e]={pointerType:g,constPointerType:v},((e,r,t)=>{o.hasOwnProperty(e)||Ae("Replacing nonexistent public symbol"),void 0!==o[e].overloadTable&&void 0!==t?o[e].overloadTable[t]=r:(o[e]=r,o[e].argCount=t)})(p,s),[h,g,v]}))},_embind_register_class_constructor:(e,r,t,n,o,a)=>{T(r>0);var i=cr(r,t);o=lr(n,o),Fe([],[e],(e=>{var t=`constructor ${(e=e[0]).name}`;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[r-1])throw new be(`Cannot register multiple constructors with identical number of parameters (${r-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[r-1]=()=>{ur(`Cannot construct ${e.name} due to unbound types`,i)},Fe([],i,(n=>(n.splice(1,0,null),e.registeredClass.constructor_body[r-1]=hr(t,n,null,o,a),[]))),[]}))},_embind_register_class_function:(e,r,t,n,o,a,i,s,l)=>{var d=cr(t,n);r=(e=>{const r=(e=e.trim()).indexOf("(");return-1!==r?(T(")"==e[e.length-1],"Parentheses for argument names should match."),e.substr(0,r)):e})(r=_e(r)),a=lr(o,a),Fe([],[e],(e=>{var n=`${(e=e[0]).name}.${r}`;function o(){ur(`Cannot call ${n} due to unbound types`,d)}r.startsWith("@@")&&(r=Symbol[r.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(r);var u=e.registeredClass.instancePrototype,c=u[r];return void 0===c||void 0===c.overloadTable&&c.className!==e.name&&c.argCount===t-2?(o.argCount=t-2,o.className=e.name,u[r]=o):(Ke(u,r,n),u[r].overloadTable[t-2]=o),Fe([],d,(o=>{var s=hr(n,o,e,a,i,l);return void 0===u[r].overloadTable?(s.argCount=t-2,u[r]=s):u[r].overloadTable[t-2]=s,[]})),[]}))},_embind_register_class_property:(e,r,t,n,o,a,i,s,l,d)=>{r=_e(r),o=lr(n,o),Fe([],[e],(e=>{var n=`${(e=e[0]).name}.${r}`,u={get(){ur(`Cannot access ${n} due to unbound types`,[t,i])},enumerable:!0,configurable:!0};return u.set=l?()=>ur(`Cannot access ${n} due to unbound types`,[t,i]):e=>ke(n+" is a read-only property"),Object.defineProperty(e.registeredClass.instancePrototype,r,u),Fe([],l?[t,i]:[t],(t=>{var i=t[0],u={get(){var r=gr(this,e,n+" getter");return i.fromWireType(o(a,r))},enumerable:!0};if(l){l=lr(s,l);var c=t[1];u.set=function(r){var t=gr(this,e,n+" setter"),o=[];l(d,t,c.toWireType(o,r)),fr(o)}}return Object.defineProperty(e.registeredClass.instancePrototype,r,u),[]})),[]}))},_embind_register_emval:e=>De(e,Tr),_embind_register_float:(e,r,t)=>{De(e,{name:r=_e(r),fromWireType:e=>e,toWireType:(e,r)=>{if("number"!=typeof r&&"boolean"!=typeof r)throw new TypeError(`Cannot convert ${_r(r)} to ${(void 0).name}`);return r},argPackAdvance:8,readValueFromPointer:Cr(r,t),destructorFunction:null})},_embind_register_integer:(e,r,t,n,o)=>{r=_e(r),-1===o&&(o=4294967295);var a=e=>e;if(0===n){var i=32-8*t;a=e=>e<<i>>>i}var s=r.includes("unsigned"),l=(e,t)=>{if("number"!=typeof e&&"boolean"!=typeof e)throw new TypeError(`Cannot convert "${_r(e)}" to ${t}`);if(e<n||e>o)throw new TypeError(`Passing a number "${_r(e)}" from JS side to C/C++ side to an argument of type "${r}", which is outside the valid range [${n}, ${o}]!`)};De(e,{name:r,fromWireType:a,toWireType:s?function(e,r){return l(r,this.name),r>>>0}:function(e,r){return l(r,this.name),r},argPackAdvance:8,readValueFromPointer:Sr(r,t,0!==n),destructorFunction:null})},_embind_register_memory_view:(e,r,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][r];function o(e){var r=y[e>>2],t=y[e+4>>2];return new n(m.buffer,t,r)}De(e,{name:t=_e(t),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},_embind_register_std_string:(e,r)=>{var t="std::string"===(r=_e(r));De(e,{name:r,fromWireType(e){var r,n=y[e>>2],o=e+4;if(t)for(var a=o,i=0;i<=n;++i){var s=o+i;if(i==n||0==p[s]){var l=re(a,s-a);void 0===r?r=l:(r+=String.fromCharCode(0),r+=l),a=s+1}}else{var d=new Array(n);for(i=0;i<n;++i)d[i]=String.fromCharCode(p[o+i]);r=d.join("")}return tt(e),r},toWireType(e,r){var n;r instanceof ArrayBuffer&&(r=new Uint8Array(r));var o="string"==typeof r;o||r instanceof Uint8Array||r instanceof Uint8ClampedArray||r instanceof Int8Array||ke("Cannot pass non-string to std::string"),n=t&&o?le(r):r.length;var a=nt(4+n+1),i=a+4;if(y[a>>2]=n,t&&o)Pr(r,i,n+1);else if(o)for(var s=0;s<n;++s){var l=r.charCodeAt(s);l>255&&(tt(i),ke("String has UTF-16 code units that do not fit in 8 bits")),p[i+s]=l}else for(s=0;s<n;++s)p[i+s]=r[s];return null!==e&&e.push(tt,a),a},argPackAdvance:8,readValueFromPointer:tr,destructorFunction(e){tt(e)}})},_embind_register_std_wstring:(e,r,t)=>{var n,o,a,i;t=_e(t),2===r?(n=Ar,o=Fr,i=Dr,a=e=>g[e>>1]):4===r&&(n=Or,o=Mr,i=$r,a=e=>y[e>>2]),De(e,{name:t,fromWireType:e=>{for(var t,o=y[e>>2],i=e+4,s=0;s<=o;++s){var l=e+4+s*r;if(s==o||0==a(l)){var d=n(i,l-i);void 0===t?t=d:(t+=String.fromCharCode(0),t+=d),i=l+r}}return tt(e),t},toWireType:(e,n)=>{"string"!=typeof n&&ke(`Cannot pass non-string to C++ string type ${t}`);var a=i(n),s=nt(4+a+r);return y[s>>2]=a/r,o(n,s+4,a+r),null!==e&&e.push(tt,s),s},argPackAdvance:8,readValueFromPointer:tr,destructorFunction(e){tt(e)}})},_embind_register_void:(e,r)=>{De(e,{isVoid:!0,name:r=_e(r),argPackAdvance:0,fromWireType:()=>{},toWireType:(e,r)=>{}})},_emval_as:(e,r,t)=>(e=br.toValue(e),r=Nr(r,"emval::as"),Ir(r,t,e)),_emval_call_method:(e,r,t,n,o)=>{var a,i;return(e=Lr[e])(r=br.toValue(r),r[t=void 0===(i=Rr[a=t])?_e(a):i],n,o)},_emval_decref:Er,_emval_get_method_caller:(e,r,t)=>{var n=((e,r)=>{for(var t=new Array(e),n=0;n<e;++n)t[n]=Nr(y[r+4*n>>2],"parameter "+n);return t})(e,r),o=n.shift();e--;var a="return function (obj, func, destructorsRef, args) {\n",i=0,s=[];0===t&&s.push("obj");for(var l=["retType"],d=[o],u=0;u<e;++u)s.push("arg"+u),l.push("argType"+u),d.push(n[u]),a+=` var arg${u} = argType${u}.readValueFromPointer(args${i?"+"+i:""});\n`,i+=n[u].argPackAdvance;a+=` var rv = ${1===t?"new func":"func.call"}(${s.join(", ")});\n`,o.isVoid||(l.push("emval_returnValue"),d.push(Ir),a+=" return emval_returnValue(retType, destructorsRef, rv);\n"),a+="};\n",l.push(a);var c,f,m=pr(Function,l)(...d),p=`methodCaller<(${n.map((e=>e.name)).join(", ")}) => ${o.name}>`;return c=Xe(p,m),f=Lr.length,Lr.push(c),f},_emval_run_destructors:e=>{var r=br.toValue(e);fr(r),Er(e)},_emval_take_value:(e,r)=>{var t=(e=Nr(e,"_emval_take_value")).readValueFromPointer(r);return br.toHandle(t)},_gmtime_js:function(e,r,t){var n=Ur(e,r),o=new Date(1e3*n);v[t>>2]=o.getUTCSeconds(),v[t+4>>2]=o.getUTCMinutes(),v[t+8>>2]=o.getUTCHours(),v[t+12>>2]=o.getUTCDate(),v[t+16>>2]=o.getUTCMonth(),v[t+20>>2]=o.getUTCFullYear()-1900,v[t+24>>2]=o.getUTCDay();var a=Date.UTC(o.getUTCFullYear(),0,1,0,0,0,0),i=(o.getTime()-a)/864e5|0;v[t+28>>2]=i},_localtime_js:function(e,r,t){var n=Ur(e,r),o=new Date(1e3*n);v[t>>2]=o.getSeconds(),v[t+4>>2]=o.getMinutes(),v[t+8>>2]=o.getHours(),v[t+12>>2]=o.getDate(),v[t+16>>2]=o.getMonth(),v[t+20>>2]=o.getFullYear()-1900,v[t+24>>2]=o.getDay();var a=0|jr(o);v[t+28>>2]=a,v[t+36>>2]=-60*o.getTimezoneOffset();var i=new Date(o.getFullYear(),0,1),s=new Date(o.getFullYear(),6,1).getTimezoneOffset(),l=i.getTimezoneOffset(),d=0|(s!=l&&o.getTimezoneOffset()==Math.min(l,s));v[t+32>>2]=d},_mktime_js:function(e){var r,t=(()=>{var r=new Date(v[e+20>>2]+1900,v[e+16>>2],v[e+12>>2],v[e+8>>2],v[e+4>>2],v[e>>2],0),t=v[e+32>>2],n=r.getTimezoneOffset(),o=new Date(r.getFullYear(),0,1),a=new Date(r.getFullYear(),6,1).getTimezoneOffset(),i=o.getTimezoneOffset(),s=Math.min(i,a);if(t<0)v[e+32>>2]=Number(a!=i&&s==n);else if(t>0!=(s==n)){var l=Math.max(i,a),d=t>0?s:l;r.setTime(r.getTime()+6e4*(d-n))}v[e+24>>2]=r.getDay();var u=0|jr(r);v[e+28>>2]=u,v[e>>2]=r.getSeconds(),v[e+4>>2]=r.getMinutes(),v[e+8>>2]=r.getHours(),v[e+12>>2]=r.getDate(),v[e+16>>2]=r.getMonth(),v[e+20>>2]=r.getYear();var c=r.getTime();return isNaN(c)?-1:c/1e3})();return U=t,r=+Math.abs(U)>=1?U>0?+Math.floor(U/4294967296)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0,it(r),t>>>0},_tzset_js:(e,r,t,n)=>{var o=(new Date).getFullYear(),a=new Date(o,0,1),i=new Date(o,6,1),s=a.getTimezoneOffset(),l=i.getTimezoneOffset(),d=Math.max(s,l);y[e>>2]=60*d,v[r>>2]=Number(s!=l);var u=e=>e.toLocaleTimeString(void 0,{hour12:!1,timeZoneName:"short"}).split(" ")[1],c=u(a),f=u(i);T(c),T(f),T(le(c)<=16,`timezone name truncated to fit in TZNAME_MAX (${c})`),T(le(f)<=16,`timezone name truncated to fit in TZNAME_MAX (${f})`),l<s?(Pr(c,t,17),Pr(f,n,17)):(Pr(c,n,17),Pr(f,t,17))},emscripten_date_now:()=>Date.now(),emscripten_log:(e,r,t)=>{var n=Gr(r,t);((e,r)=>{24&e&&(r=r.replace(/\s+$/,""),r+=(r.length>0?"\n":"")+Yr(e)),1&e||(6&e?f(r):c(r))})(e,ee(n,0))},emscripten_resize_heap:e=>{var r=p.length;T((e>>>=0)>r);var t=2147483648;if(e>t)return f(`Cannot enlarge memory, requested ${e} bytes, but the limit is 2147483648 bytes!`),!1;for(var n,o,a=1;a<=4;a*=2){var i=r*(1+.2/a);i=Math.min(i,e+100663296);var s=Math.min(t,(n=Math.max(e,i))+((o=65536)-n%o)%o);if(qr(s))return!0}return f(`Failed to grow the heap from ${r} bytes to ${s} bytes, not enough memory!`),!1},environ_get:(e,r)=>{var t=0;return Kr().forEach(((n,o)=>{var a=r+t;y[e+4*o>>2]=a,((e,r)=>{for(var t=0;t<e.length;++t)T(e.charCodeAt(t)===(255&e.charCodeAt(t))),m[r++]=e.charCodeAt(t);m[r]=0})(n,a),t+=n.length+1})),0},environ_sizes_get:(e,r)=>{var t=Kr();y[e>>2]=t.length;var n=0;return t.forEach((e=>n+=e.length+1)),y[r>>2]=n,0},fd_close:function(e){try{var r=Ee.getStreamFromFD(e);return ye.close(r),0}catch(e){if(void 0===ye||"ErrnoError"!==e.name)throw e;return e.errno}},fd_fdstat_get:function(e,r){try{var t=Ee.getStreamFromFD(e),n=t.tty?2:ye.isDir(t.mode)?3:ye.isLink(t.mode)?7:4;return m[r]=n,h[r+2>>1]=0,x=[0,(U=0,+Math.abs(U)>=1?U>0?+Math.floor(U/4294967296)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],v[r+8>>2]=x[0],v[r+12>>2]=x[1],x=[0,(U=0,+Math.abs(U)>=1?U>0?+Math.floor(U/4294967296)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],v[r+16>>2]=x[0],v[r+20>>2]=x[1],0}catch(e){if(void 0===ye||"ErrnoError"!==e.name)throw e;return e.errno}},fd_read:function(e,r,t,n){try{var o=((e,r,t,n)=>{for(var o=0,a=0;a<t;a++){var i=y[r>>2],s=y[r+4>>2];r+=8;var l=ye.read(e,m,i,s,n);if(l<0)return-1;if(o+=l,l<s)break}return o})(Ee.getStreamFromFD(e),r,t);return y[n>>2]=o,0}catch(e){if(void 0===ye||"ErrnoError"!==e.name)throw e;return e.errno}},fd_seek:function(e,r,t,n,o){var a=Ur(r,t);try{if(isNaN(a))return 61;var i=Ee.getStreamFromFD(e);return ye.llseek(i,a,n),x=[i.position>>>0,(U=i.position,+Math.abs(U)>=1?U>0?+Math.floor(U/4294967296)>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],v[o>>2]=x[0],v[o+4>>2]=x[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0}catch(e){if(void 0===ye||"ErrnoError"!==e.name)throw e;return e.errno}},fd_write:function(e,r,t,n){try{var o=((e,r,t,n)=>{for(var o=0,a=0;a<t;a++){var i=y[r>>2],s=y[r+4>>2];r+=8;var l=ye.write(e,m,i,s,n);if(l<0)return-1;o+=l}return o})(Ee.getStreamFromFD(e),r,t);return y[n>>2]=o,0}catch(e){if(void 0===ye||"ErrnoError"!==e.name)throw e;return e.errno}}},rt=function(){var e={env:et,wasi_snapshot_preview1:et};function r(e,r){var t;return rt=e.exports,T(u=rt.memory,"memory not found in wasm exports"),_(),T(or=rt.__indirect_function_table,"table not found in wasm exports"),t=rt.__wasm_call_ctors,P.unshift(t),I("wasm-instantiate"),rt}N("wasm-instantiate");var t,n,a,i=o;if(o.instantiateWasm)try{return o.instantiateWasm(e,r)}catch(e){return f(`Module.instantiateWasm callback failed with error: ${e}`),!1}return L||(L=z()),t=L,n=e,a=function(e){T(o===i,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),i=null,r(e.instance)},d||"function"!=typeof WebAssembly.instantiateStreaming||B(t)||"function"!=typeof fetch?V(t,n,a):fetch(t,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,n).then(a,(function(e){return f(`wasm streaming compile failed: ${e}`),f("falling back to ArrayBuffer instantiation"),V(t,n,a)})))),{}}(),tt=W("free",1),nt=W("malloc",1),ot=W("__getTypeName",1),at=W("fflush",1),it=W("_emscripten_tempret_set",1),st=()=>(st=rt.emscripten_stack_init)(),lt=()=>(lt=rt.emscripten_stack_get_end)();o.dynCall_ijiii=W("dynCall_ijiii",6),o.dynCall_viiijj=W("dynCall_viiijj",8),o.dynCall_jij=W("dynCall_jij",4),o.dynCall_jii=W("dynCall_jii",3),o.dynCall_jiji=W("dynCall_jiji",5),o._ff_h264_cabac_tables=119404;["writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromI64","readI53FromU64","stackAlloc","getTempRet0","exitJS","arraySum","addDays","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","readEmAsmArgs","jstoi_q","listenOnce","autoResumeAudioContext","setWasmTableEntry","handleException","keepRuntimeAlive","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","asmjsMangle","HandleAllocator","getNativeTypeSize","STACK_SIZE","STACK_ALIGN","POINTER_SIZE","ASSERTIONS","getCFunc","ccall","cwrap","uleb128Encode","sigToWasmTypes","generateFuncType","convertJsFunctionToWasm","getEmptyTableSlot","updateTableMap","getFunctionAddress","addFunction","removeFunction","intArrayToString","AsciiToString","stringToNewUTF8","stringToUTF8OnStack","writeArrayToMemory","registerKeyEventCallback","maybeCStringToJsString","findEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","convertPCtoSourceLocation","checkWasiClock","wasiRightsToMuslOFlags","wasiOFlagsToMuslOFlags","createDyncallWrapper","safeSetTimeout","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","getPromise","makePromise","idsToPromises","makePromiseCallback","ExceptionInfo","findMatchingCatch","Browser_asyncPrepareDataCounter","setMainLoop","getSocketFromFD","getSocketAddress","FS_unlink","FS_mkdirTree","_setNetworkCallback","heapObjectForWebGLType","toTypedArrayIndex","webgl_enable_ANGLE_instanced_arrays","webgl_enable_OES_vertex_array_object","webgl_enable_WEBGL_draw_buffers","webgl_enable_WEBGL_multi_draw","emscriptenWebGLGet","computeUnpackAlignedImageSize","colorChannelsInGlTextureFormat","emscriptenWebGLGetTexPixelData","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","__glGetActiveAttribOrUniform","writeGLArray","registerWebGlEventCallback","runAndAbortIfError","ALLOC_NORMAL","ALLOC_STACK","allocate","writeStringToMemory","writeAsciiToMemory","setErrNo","demangle","stackTrace","getFunctionArgsName","createJsInvokerSignature","registerInheritedInstance","unregisterInheritedInstance","enumReadValueFromPointer","emval_get_global"].forEach((function(e){"undefined"==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,e)||Object.defineProperty(globalThis,e,{configurable:!0,get(){var r=`\`${e}\` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line`,t=e;t.startsWith("_")||(t="$"+e),r+=` (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='${t}')`,Y(e)&&(r+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),Z(r)}}),X(e)}));var dt;function ut(){var e;st(),T(!(3&(e=lt()))),0==e&&(e+=4),y[e>>2]=34821223,y[e+4>>2]=2310721022,y[0]=1668509029}function ct(){function e(){dt||(dt=!0,o.calledRun=!0,b||(T(!A),A=!0,C(),o.noFSInit||ye.init.initialized||ye.init(),ye.ignorePermissions=!1,K(P),o.onRuntimeInitialized&&o.onRuntimeInitialized(),T(!o._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(C(),o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)e=o.postRun.shift(),k.unshift(e);var e;K(k)}()))}F>0||(ut(),function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)e=o.preRun.shift(),S.unshift(e);var e;K(S)}(),F>0||(o.setStatus?(o.setStatus("Running..."),setTimeout((function(){setTimeout((function(){o.setStatus("")}),1),e()}),1)):e(),C()))}if(["run","addOnPreRun","addOnInit","addOnPreMain","addOnExit","addOnPostRun","addRunDependency","removeRunDependency","FS_createFolder","FS_createPath","FS_createLazyFile","FS_createLink","FS_createDevice","FS_readFile","out","err","callMain","abort","wasmMemory","wasmExports","writeStackCookie","checkStackCookie","convertI32PairToI53","convertI32PairToI53Checked","convertU32PairToI53","stackSave","stackRestore","setTempRet0","ptrToString","zeroMemory","getHeapMax","growMemory","ENV","MONTH_DAYS_REGULAR","MONTH_DAYS_LEAP","MONTH_DAYS_REGULAR_CUMULATIVE","MONTH_DAYS_LEAP_CUMULATIVE","isLeapYear","ydayFromDate","ERRNO_CODES","ERRNO_MESSAGES","DNS","Protocols","Sockets","initRandomFill","randomFill","timers","warnOnce","emscriptenLog","readEmAsmArgsArray","jstoi_s","getExecutableName","dynCallLegacy","getDynCaller","dynCall","getWasmTableEntry","asyncLoad","alignMemory","mmapAlloc","wasmTable","noExitRuntime","freeTableIndexes","functionsInTableMap","reallyNegative","unSign","strLen","reSign","formatString","setValue","getValue","PATH","PATH_FS","UTF8Decoder","UTF8ArrayToString","UTF8ToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","intArrayFromString","stringToAscii","UTF16Decoder","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","JSEvents","specialHTMLTargets","findCanvasEventTarget","currentFullscreenStrategy","restoreOldWindowedStyle","jsStackTrace","getCallstack","UNWIND_CACHE","ExitStatus","getEnvStrings","doReadv","doWritev","promiseMap","uncaughtExceptionCount","exceptionLast","exceptionCaught","Browser","getPreloadedImageData__data","wget","SYSCALLS","preloadPlugins","FS_createPreloadedFile","FS_modeStringToFlags","FS_getMode","FS_stdin_getChar_buffer","FS_stdin_getChar","FS","FS_createDataFile","MEMFS","TTY","PIPEFS","SOCKFS","tempFixedLengthArray","miniTempWebGLFloatBuffers","miniTempWebGLIntBuffers","GL","AL","GLUT","EGL","GLEW","IDBStore","SDL","SDL_gfx","allocateUTF8","allocateUTF8OnStack","InternalError","BindingError","throwInternalError","throwBindingError","registeredTypes","awaitingDependencies","typeDependencies","tupleRegistrations","structRegistrations","sharedRegisterType","whenDependentTypesAreResolved","embind_charCodes","embind_init_charCodes","readLatin1String","getTypeName","getFunctionName","heap32VectorToArray","requireRegisteredType","usesDestructorStack","createJsInvoker","UnboundTypeError","PureVirtualError","GenericWireTypeSize","EmValType","init_embind","throwUnboundTypeError","ensureOverloadTable","exposePublicSymbol","replacePublicSymbol","extendError","createNamedFunction","embindRepr","registeredInstances","getBasestPointer","getInheritedInstance","getInheritedInstanceCount","getLiveInheritedInstances","registeredPointers","registerType","integerReadValueFromPointer","floatReadValueFromPointer","readPointer","runDestructors","newFunc","craftInvokerFunction","embind__requireFunction","genericPointerToWireType","constNoSmartPtrRawPointerToWireType","nonConstNoSmartPtrRawPointerToWireType","init_RegisteredPointer","RegisteredPointer","RegisteredPointer_fromWireType","runDestructor","releaseClassHandle","finalizationRegistry","detachFinalizer_deps","detachFinalizer","attachFinalizer","makeClassHandle","init_ClassHandle","ClassHandle","throwInstanceAlreadyDeleted","deletionQueue","flushPendingDeletes","delayFunction","setDelayFunction","RegisteredClass","shallowCopyInternalPointer","downcastPointer","upcastPointer","validateThis","char_0","char_9","makeLegalFunctionName","emval_freelist","emval_handles","emval_symbols","init_emval","count_emval_handles","getStringOrSymbol","Emval","emval_returnValue","emval_lookupTypes","emval_methodCallers","emval_addMethodCaller","reflectConstruct"].forEach(X),O=function e(){dt||ct(),dt||(O=e)},o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();ct();var ft=e(o);const mt={videoBuffer:200,videoBufferDelay:1e3,scaleMode:1,debug:!1,loadingTimeout:10,heartTimeout:5,timeout:10,loadingTimeoutReplay:!0,heartTimeoutReplay:!0,loadingTimeoutReplayTimes:3,heartTimeoutReplayTimes:3,keepScreenOn:!1,isNotMute:!1,hasAudio:!0,volume:.5,hasVideo:!0,decoder:"decoder.js",staticPath:"",url:"",rotate:0,forceNoOffscreen:!0,protocol:1,demuxType:"flv",useMSE:!1,autoWasm:!0,wasmDecodeErrorReplay:!0,openWebglAlignment:!1,wasmDecodeAudioSyncVideo:!1,useWebFullScreen:!0,loggerOptions:{level:"INFO"}},pt="initVideo",ht="render",gt="playAudio",vt="initAudio",yt="audioCode",Et="videoCode",wt=1,bt=2,Tt="init",_t="decode",Ct="audioDecode",St="videoDecode",Pt="close",kt="updateConfig",At="key",Ft="delta";var Dt;Dt={exports:{}},function(){var e="undefined"!=typeof window&&void 0!==window.document?window.document:{},r=Dt.exports,t=function(){for(var r,t=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],n=0,o=t.length,a={};n<o;n++)if((r=t[n])&&r[1]in e){for(n=0;n<r.length;n++)a[t[0][n]]=r[n];return a}return!1}(),n={change:t.fullscreenchange,error:t.fullscreenerror},o={request:function(r,n){return new Promise(function(o,a){var i=function(){this.off("change",i),o()}.bind(this);this.on("change",i);var s=(r=r||e.documentElement)[t.requestFullscreen](n);s instanceof Promise&&s.then(i).catch(a)}.bind(this))},exit:function(){return new Promise(function(r,n){if(this.isFullscreen){var o=function(){this.off("change",o),r()}.bind(this);this.on("change",o);var a=e[t.exitFullscreen]();a instanceof Promise&&a.then(o).catch(n)}else r()}.bind(this))},toggle:function(e,r){return this.isFullscreen?this.exit():this.request(e,r)},onchange:function(e){this.on("change",e)},onerror:function(e){this.on("error",e)},on:function(r,t){var o=n[r];o&&e.addEventListener(o,t,!1)},off:function(r,t){var o=n[r];o&&e.removeEventListener(o,t,!1)},raw:t};t?(Object.defineProperties(o,{isFullscreen:{get:function(){return Boolean(e[t.fullscreenElement])}},element:{enumerable:!0,get:function(){return e[t.fullscreenElement]}},isEnabled:{enumerable:!0,get:function(){return Boolean(e[t.fullscreenEnabled])}}}),r?Dt.exports=o:window.screenfull=o):r?Dt.exports={isEnabled:!1}:window.screenfull={isEnabled:!1}}(),(()=>{try{if("object"==typeof WebAssembly&&"function"==typeof WebAssembly.instantiate){const e=new WebAssembly.Module(Uint8Array.of(0,97,115,109,1,0,0,0));if(e instanceof WebAssembly.Module)return new WebAssembly.Instance(e)instanceof WebAssembly.Instance}}catch(e){}})(),Date.now||(Date.now=function(){return(new Date).getTime()}),ft.postRun=function(){let e=[],r=[],t={};"VideoEncoder"in self&&(t={hasInit:!1,isEmitInfo:!1,offscreenCanvas:null,offscreenCanvasCtx:null,decoder:new VideoDecoder({output:function(e){t.isEmitInfo||(n.opt.debug,postMessage({cmd:pt,w:e.codedWidth,h:e.codedHeight}),t.isEmitInfo=!0,t.offscreenCanvas=new OffscreenCanvas(e.codedWidth,e.codedHeight),t.offscreenCanvasCtx=t.offscreenCanvas.getContext("2d")),t.offscreenCanvasCtx.drawImage(e,0,0,e.codedWidth,e.codedHeight);const r=t.offscreenCanvas.transferToImageBitmap();postMessage({cmd:ht,buffer:r,delay:n.delay,ts:0},[r]),setTimeout((function(){e.close?e.close():e.destroy()}),100)},error:function(e){}}),decode:function(e,r){const o=e[0]>>4==1;if(t.hasInit){const n=new EncodedVideoChunk({data:e.slice(5),timestamp:r,type:o?At:Ft});t.decoder.decode(n)}else if(o&&0===e[1]){const r=15&e[0];n.setVideoCodec(r);const o=function(e){const r=e.subarray(1,4);let t="avc1.";for(let e=0;e<3;e++){let n=r[e].toString(16);n.length<2&&(n="0"+n),t+=n}return{codec:t,description:e}}(e.slice(5));t.decoder.configure(o),t.hasInit=!0}},reset(){t.hasInit=!1,t.isEmitInfo=!1,t.offscreenCanvas=null,t.offscreenCanvasCtx=null}});const n={opt:{debug:mt.debug,useOffscreen:mt.useOffscreen,useWCS:mt.useWCS,videoBuffer:mt.videoBuffer,openWebglAlignment:mt.openWebglAlignment,videoBufferDelay:mt.videoBufferDelay},useOffscreen:function(){return n.opt.useOffscreen&&"undefined"!=typeof OffscreenCanvas},initAudioPlanar:function(e,t){postMessage({cmd:vt,sampleRate:t,channels:e});const n=[];let o=0;this.playAudioPlanar=function(t,a,i){let s=a;const l=[];let d=0;for(let e=0;e<2;e++){const r=ft.HEAPU32[(t>>2)+e]>>2;l[e]=ft.HEAPF32.subarray(r,r+s)}if(o){if(!(s>=(a=1024-o)))return o+=s,r[0]=Float32Array.of(...r[0],...l[0]),void(2===e&&(r[1]=Float32Array.of(...r[1],...l[1])));n[0]=Float32Array.of(...r[0],...l[0].subarray(0,a)),2===e&&(n[1]=Float32Array.of(...r[1],...l[1].subarray(0,a))),postMessage({cmd:gt,buffer:n,ts:i},n.map((e=>e.buffer))),d=a,s-=a}for(o=s;o>=1024;o-=1024)n[0]=l[0].slice(d,d+=1024),2===e&&(n[1]=l[1].slice(d-1024,d)),postMessage({cmd:gt,buffer:n,ts:i},n.map((e=>e.buffer)));o&&(r[0]=l[0].slice(d),2===e&&(r[1]=l[1].slice(d)))}},setVideoCodec:function(e){postMessage({cmd:Et,code:e})},setAudioCodec:function(e){postMessage({cmd:yt,code:e})},setVideoSize:function(e,r){postMessage({cmd:pt,w:e,h:r});const t=e*r,o=t>>2;n.useOffscreen()?(this.offscreenCanvas=new OffscreenCanvas(e,r),this.offscreenCanvasGL=this.offscreenCanvas.getContext("webgl"),this.webglObj=((e,r)=>{var t=["attribute vec4 vertexPos;","attribute vec4 texturePos;","varying vec2 textureCoord;","void main()","{","gl_Position = vertexPos;","textureCoord = texturePos.xy;","}"].join("\n"),n=["precision highp float;","varying highp vec2 textureCoord;","uniform sampler2D ySampler;","uniform sampler2D uSampler;","uniform sampler2D vSampler;","const mat4 YUV2RGB = mat4","(","1.1643828125, 0, 1.59602734375, -.87078515625,","1.1643828125, -.39176171875, -.81296875, .52959375,","1.1643828125, 2.017234375, 0, -1.081390625,","0, 0, 0, 1",");","void main(void) {","highp float y = texture2D(ySampler, textureCoord).r;","highp float u = texture2D(uSampler, textureCoord).r;","highp float v = texture2D(vSampler, textureCoord).r;","gl_FragColor = vec4(y, u, v, 1) * YUV2RGB;","}"].join("\n");r&&e.pixelStorei(e.UNPACK_ALIGNMENT,1);var o=e.createShader(e.VERTEX_SHADER);e.shaderSource(o,t),e.compileShader(o),e.getShaderParameter(o,e.COMPILE_STATUS);var a=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(a,n),e.compileShader(a),e.getShaderParameter(a,e.COMPILE_STATUS);var i=e.createProgram();e.attachShader(i,o),e.attachShader(i,a),e.linkProgram(i),e.getProgramParameter(i,e.LINK_STATUS),e.useProgram(i);var s=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,s),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,1,-1,1,1,-1,-1,-1]),e.STATIC_DRAW);var l=e.getAttribLocation(i,"vertexPos");e.enableVertexAttribArray(l),e.vertexAttribPointer(l,2,e.FLOAT,!1,0,0);var d=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,d),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,0,0,0,1,1,0,1]),e.STATIC_DRAW);var u=e.getAttribLocation(i,"texturePos");function c(r,t){var n=e.createTexture();return e.bindTexture(e.TEXTURE_2D,n),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.bindTexture(e.TEXTURE_2D,null),e.uniform1i(e.getUniformLocation(i,r),t),n}e.enableVertexAttribArray(u),e.vertexAttribPointer(u,2,e.FLOAT,!1,0,0);var f=c("ySampler",0),m=c("uSampler",1),p=c("vSampler",2);return{render:function(r,t,n,o,a){e.viewport(0,0,r,t),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,f),e.texImage2D(e.TEXTURE_2D,0,e.LUMINANCE,r,t,0,e.LUMINANCE,e.UNSIGNED_BYTE,n),e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,m),e.texImage2D(e.TEXTURE_2D,0,e.LUMINANCE,r/2,t/2,0,e.LUMINANCE,e.UNSIGNED_BYTE,o),e.activeTexture(e.TEXTURE2),e.bindTexture(e.TEXTURE_2D,p),e.texImage2D(e.TEXTURE_2D,0,e.LUMINANCE,r/2,t/2,0,e.LUMINANCE,e.UNSIGNED_BYTE,a),e.drawArrays(e.TRIANGLE_STRIP,0,4)},destroy:function(){try{e.deleteProgram(i),e.deleteBuffer(s),e.deleteBuffer(d),e.deleteTexture(f),e.deleteTexture(m),e.deleteTexture(p)}catch(e){}}}})(this.offscreenCanvasGL,n.opt.openWebglAlignment),this.draw=function(n,a,i,s){const l=ft.HEAPU8.subarray(a,a+t),d=ft.HEAPU8.subarray(i,i+o),u=ft.HEAPU8.subarray(s,s+o);this.webglObj.render(e,r,l,d,u);const c=this.offscreenCanvas.transferToImageBitmap();postMessage({cmd:ht,buffer:c,delay:this.delay,ts:n},[c])}):this.draw=function(e,r,n,a,i,s){const l=[Uint8Array.from(ft.HEAPU8.subarray(r,r+t)),Uint8Array.from(ft.HEAPU8.subarray(n,n+o)),Uint8Array.from(ft.HEAPU8.subarray(a,a+o))];postMessage({cmd:ht,output:l,delay:this.delay,ts:e},l.map((e=>e.buffer)))}},getDelay:function(e){if(!e)return-1;if(this.firstTimestamp){if(e){const r=Date.now()-this.startTimestamp,t=e-this.firstTimestamp;this.delay=r>=t?r-t:t-r}}else this.firstTimestamp=e,this.startTimestamp=Date.now(),this.delay=-1;return this.delay},resetDelay:function(){this.firstTimestamp=null,this.startTimestamp=null,this.delay=-1},init:function(){n.opt.debug;const r=e=>{n.opt.useWCS&&n.useOffscreen()&&e.type===bt&&t.decode?t.decode(e.payload,e.ts):e.decoder.decode(e.payload,e.ts)};this.stopId=setInterval((()=>{if(e.length)if(this.dropping){let t=e.shift();for(t&&t.type===wt&&0===t.payload[1]&&r(t);!t.isIFrame&&e.length;)t=e.shift(),t.type===wt&&0===t.payload[1]&&r(t);t.isIFrame&&(this.dropping=!1,r(t))}else{let t=e[0];if(-1===this.getDelay(t.ts))e.shift(),r(t);else if(this.delay>n.opt.videoBuffer+n.opt.videoBufferDelay)this.resetDelay(),this.dropping=!0;else for(;e.length&&(t=e[0],this.getDelay(t.ts)>n.opt.videoBuffer);)e.shift(),r(t)}}),10)},close:function(){var i,s,l,d;n.opt.debug,clearInterval(this.stopId),this.stopId=null,null==o||null===(i=o.clear)||void 0===i||i.call(o),null==a||null===(s=a.clear)||void 0===s||s.call(a),null===(l=t)||void 0===l||null===(d=l.reset)||void 0===d||d.call(l),this.firstTimestamp=null,this.startTimestamp=null,this.delay=-1,this.dropping=!1,this.webglObj&&(this.webglObj.destroy(),this.offscreenCanvas=null,this.offscreenCanvasGL=null,this.offscreenCanvasCtx=null),e=[],r=[],delete this.playAudioPlanar,delete this.draw},pushBuffer:function(r,t){t.type===wt?e.push({ts:t.ts,payload:r,decoder:o,type:wt}):t.type===bt&&e.push({ts:t.ts,payload:r,decoder:a,type:bt,isIFrame:t.isIFrame})}},o=new ft.AudioDecoder(n),a=new ft.VideoDecoder(n);self.onmessage=function(e){const r=e.data;switch(r.cmd){case Tt:try{n.opt=Object.assign(n.opt,JSON.parse(r.opt))}catch(e){}o.sample_rate=r.sampleRate,n.init();break;case _t:n.pushBuffer(r.buffer,r.options);break;case Ct:o.decode(r.buffer,r.ts);break;case St:a.decode(r.buffer,r.ts);break;case Pt:n.close();break;case kt:n.opt[r.key]=r.value}}},ft.onRuntimeInitialized=function(){setTimeout((()=>{postMessage({cmd:Tt})}),10)}}));