hzwl-easy-player
Version:
基于Vue 3的视频播放器组件,支持单屏和多屏播放模式
1 lines • 515 kB
JavaScript
!function(e){"function"==typeof define&&define.amd?define(["crypto-js"],e):e()}((function(){"use strict";var e,t=(e="undefined"==typeof document&&"undefined"==typeof location?new(require("url").URL)("file:"+__filename).href:"undefined"==typeof document?location.href:document.currentScript&&document.currentScript.src||new URL("decoder-pro-mt.js",document.baseURI).href,function(t){var r,i;(t=void 0!==(t=t||{})?t:{}).ready=new Promise((function(e,t){r=e,i=t})),(t=void 0!==t?t:{}).locateFile=function(e){return"decoder-pro-mt-worker.wasm"==e&&"undefined"!=typeof EASYPLAYER_PRO_MT_WORKER_WASM_URL&&""!=EASYPLAYER_PRO_MT_WORKER_WASM_URL?EASYPLAYER_PRO_MT_WORKER_WASM_URL:e};var n,o,s,a,d,l,u=Object.assign({},t),c="./this.program",f=(e,t)=>{throw t},h="object"==typeof window,p="function"==typeof importScripts,m="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,_=t.ENVIRONMENT_IS_PTHREAD||!1,g="";function y(e){return t.locateFile?t.locateFile(e,g):g+e}if(m){let e;g=p?require("path").dirname(g)+"/":__dirname+"/",l=()=>{d||(a=require("fs"),d=require("path"))},n=function(e,t){return l(),e=d.normalize(e),a.readFileSync(e,t?void 0:"utf8")},s=e=>{var t=n(e,!0);return t.buffer||(t=new Uint8Array(t)),t},o=(e,t,r)=>{l(),e=d.normalize(e),a.readFile(e,(function(e,i){e?r(e):t(i.buffer)}))},process.argv.length>1&&(c=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",(function(e){if(!(e instanceof fe))throw e})),process.on("unhandledRejection",(function(e){throw e})),f=(e,t)=>{if(Z())throw process.exitCode=e,t;var r;(r=t)instanceof fe||S("exiting due to exception: "+r),process.exit(e)},t.inspect=function(){return"[Emscripten Module object]"};try{e=require("worker_threads")}catch(e){throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'),e}global.Worker=e.Worker}else(h||p)&&(p?g=self.location.href:"undefined"!=typeof document&&document.currentScript&&(g=document.currentScript.src),e&&(g=e),g=0!==g.indexOf("blob:")?g.substr(0,g.replace(/[?#].*/,"").lastIndexOf("/")+1):"",m||(n=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},p&&(s=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),o=(e,t,r)=>{var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=()=>{200==i.status||0==i.status&&i.response?t(i.response):r()},i.onerror=r,i.send(null)}));m&&"undefined"==typeof performance&&(global.performance=require("perf_hooks").performance);var v=console.log.bind(console),b=console.warn.bind(console);m&&(l(),v=e=>a.writeSync(1,e+"\n"),b=e=>a.writeSync(2,e+"\n"));var w=t.print||v,S=t.printErr||b;Object.assign(t,u),u=null,t.arguments&&t.arguments,t.thisProgram&&(c=t.thisProgram),t.quit&&(f=t.quit);var E,A=4;t.wasmBinary&&(E=t.wasmBinary);var U,T,x=t.noExitRuntime||!0;"object"!=typeof WebAssembly&&ie("no native wasm support detected");var B,k=!1;function C(e,t){e||ie(t)}var D,P,F,I,L,M,R,N,z,O="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function G(e,t,r){for(var i=t+r,n=t;e[n]&&!(n>=i);)++n;if(n-t>16&&e.buffer&&O)return O.decode(e.buffer instanceof SharedArrayBuffer?e.slice(t,n):e.subarray(t,n));for(var o="";t<n;){var s=e[t++];if(128&s){var a=63&e[t++];if(192!=(224&s)){var d=63&e[t++];if((s=224==(240&s)?(15&s)<<12|a<<6|d:(7&s)<<18|a<<12|d<<6|63&e[t++])<65536)o+=String.fromCharCode(s);else{var l=s-65536;o+=String.fromCharCode(55296|l>>10,56320|1023&l)}}else o+=String.fromCharCode((31&s)<<6|a)}else o+=String.fromCharCode(s)}return o}function $(e,t){return e?G(F,e,t):""}function H(e,t,r,i){if(!(i>0))return 0;for(var n=r,o=r+i-1,s=0;s<e.length;++s){var a=e.charCodeAt(s);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++s)),a<=127){if(r>=o)break;t[r++]=a}else if(a<=2047){if(r+1>=o)break;t[r++]=192|a>>6,t[r++]=128|63&a}else if(a<=65535){if(r+2>=o)break;t[r++]=224|a>>12,t[r++]=128|a>>6&63,t[r++]=128|63&a}else{if(r+3>=o)break;t[r++]=240|a>>18,t[r++]=128|a>>12&63,t[r++]=128|a>>6&63,t[r++]=128|63&a}}return t[r]=0,r-n}function V(e){for(var t=0,r=0;r<e.length;++r){var i=e.charCodeAt(r);i<=127?t++:i<=2047?t+=2:i>=55296&&i<=57343?(t+=4,++r):t+=3}return t}_&&(D=t.buffer);var W,j,q=t.INITIAL_MEMORY||268435456;if(_)U=t.wasmMemory,D=t.buffer;else if(t.wasmMemory)U=t.wasmMemory;else if(!((U=new WebAssembly.Memory({initial:q/65536,maximum:q/65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw S("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),m&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");U&&(D=U.buffer),q=D.byteLength,D=W=D,t.HEAP8=P=new Int8Array(W),t.HEAP16=I=new Int16Array(W),t.HEAP32=M=new Int32Array(W),t.HEAPU8=F=new Uint8Array(W),t.HEAPU16=L=new Uint16Array(W),t.HEAPU32=R=new Uint32Array(W),t.HEAPF32=N=new Float32Array(W),t.HEAPF64=z=new Float64Array(W);var Y=[],K=[],X=[];function Z(){return x}function J(){_||(t.noFSInit||we.init.initialized||we.init(),we.ignorePermissions=!1,Te(K))}var Q=0,ee=null;function te(e){Q++,t.monitorRunDependencies&&t.monitorRunDependencies(Q)}function re(e){if(Q--,t.monitorRunDependencies&&t.monitorRunDependencies(Q),0==Q&&ee){var r=ee;ee=null,r()}}function ie(e){_?postMessage({cmd:"onAbort",arg:e}):t.onAbort&&t.onAbort(e),S(e="Aborted("+e+")"),k=!0,B=1,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw i(r),r}var ne,oe,se,ae="data:application/octet-stream;base64,";function de(e){return e.startsWith(ae)}function le(e){return e.startsWith("file://")}function ue(e){try{if(e==ne&&E)return new Uint8Array(E);if(s)return s(e);throw"both async and sync fetching of the wasm failed"}catch(e){ie(e)}}t.locateFile?de(ne="decoder-pro-mt-worker.wasm")||(ne=y(ne)):ne=new URL("decoder-pro-mt-worker.wasm","undefined"==typeof document&&"undefined"==typeof location?new(require("url").URL)("file:"+__filename).href:"undefined"==typeof document?location.href:document.currentScript&&document.currentScript.src||new URL("decoder-pro-mt.js",document.baseURI).href).toString();var ce={};function fe(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function he(e){var t=Ue.pthreads[e];C(t),Ue.returnWorkerToPool(t)}function pe(e){var t=Ue.getNewWorker();if(!t)return 6;Ue.runningWorkers.push(t),Ue.pthreads[e.pthread_ptr]=t,t.pthread_ptr=e.pthread_ptr;var r={cmd:"run",start_routine:e.startRoutine,arg:e.arg,pthread_ptr:e.pthread_ptr};return t.runPthread=()=>{r.time=performance.now(),t.postMessage(r,e.transferList)},t.loaded&&(t.runPthread(),delete t.runPthread),0}var me={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var r=0,i=e.length-1;i>=0;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:e=>{var t=me.isAbs(e),r="/"===e.substr(-1);return(e=me.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=me.splitPath(e),r=t[0],i=t[1];return r||i?(i&&(i=i.substr(0,i.length-1)),r+i):"."},basename:e=>{if("/"===e)return"/";var t=(e=(e=me.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments,0);return me.normalize(e.join("/"))},join2:(e,t)=>me.normalize(e+"/"+t)},_e={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var i=r>=0?arguments[r]:we.cwd();if("string"!=typeof i)throw new TypeError("Arguments to path.resolve must be strings");if(!i)return"";e=i+"/"+e,t=me.isAbs(i)}return(t?"/":"")+(e=me.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||"."},relative:(e,t)=>{function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=_e.resolve(e).substr(1),t=_e.resolve(t).substr(1);for(var i=r(e.split("/")),n=r(t.split("/")),o=Math.min(i.length,n.length),s=o,a=0;a<o;a++)if(i[a]!==n[a]){s=a;break}var d=[];for(a=s;a<i.length;a++)d.push("..");return(d=d.concat(n.slice(s))).join("/")}};function ge(e,t,r){var i=r>0?r:V(e)+1,n=new Array(i),o=H(e,n,0,n.length);return t&&(n.length=o),n}var ye={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){ye.ttys[e]={input:[],output:[],ops:t},we.registerDevice(e,ye.stream_ops)},stream_ops:{open:function(e){var t=ye.ttys[e.node.rdev];if(!t)throw new we.ErrnoError(43);e.tty=t,e.seekable=!1},close:function(e){e.tty.ops.flush(e.tty)},flush:function(e){e.tty.ops.flush(e.tty)},read:function(e,t,r,i,n){if(!e.tty||!e.tty.ops.get_char)throw new we.ErrnoError(60);for(var o=0,s=0;s<i;s++){var a;try{a=e.tty.ops.get_char(e.tty)}catch(e){throw new we.ErrnoError(29)}if(void 0===a&&0===o)throw new we.ErrnoError(6);if(null==a)break;o++,t[r+s]=a}return o&&(e.node.timestamp=Date.now()),o},write:function(e,t,r,i,n){if(!e.tty||!e.tty.ops.put_char)throw new we.ErrnoError(60);try{for(var o=0;o<i;o++)e.tty.ops.put_char(e.tty,t[r+o])}catch(e){throw new we.ErrnoError(29)}return i&&(e.node.timestamp=Date.now()),o}},default_tty_ops:{get_char:function(e){if(!e.input.length){var t=null;if(m){var r=Buffer.alloc(256),i=0;try{i=a.readSync(process.stdin.fd,r,0,256,-1)}catch(e){if(!e.toString().includes("EOF"))throw e;i=0}t=i>0?r.slice(0,i).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n");if(!t)return null;e.input=ge(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(w(G(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(w(G(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(S(G(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(S(G(e.output,0)),e.output=[])}}};function ve(e){e=function(e,t){return Math.ceil(e/t)*t}(e,65536);var t=kr(65536,e);return t?(function(e,t){F.fill(0,e,e+t)}(t,e),t):0}var be={ops_table:null,mount:function(e){return be.createNode(null,"/",16895,0)},createNode:function(e,t,r,i){if(we.isBlkdev(r)||we.isFIFO(r))throw new we.ErrnoError(63);be.ops_table||(be.ops_table={dir:{node:{getattr:be.node_ops.getattr,setattr:be.node_ops.setattr,lookup:be.node_ops.lookup,mknod:be.node_ops.mknod,rename:be.node_ops.rename,unlink:be.node_ops.unlink,rmdir:be.node_ops.rmdir,readdir:be.node_ops.readdir,symlink:be.node_ops.symlink},stream:{llseek:be.stream_ops.llseek}},file:{node:{getattr:be.node_ops.getattr,setattr:be.node_ops.setattr},stream:{llseek:be.stream_ops.llseek,read:be.stream_ops.read,write:be.stream_ops.write,allocate:be.stream_ops.allocate,mmap:be.stream_ops.mmap,msync:be.stream_ops.msync}},link:{node:{getattr:be.node_ops.getattr,setattr:be.node_ops.setattr,readlink:be.node_ops.readlink},stream:{}},chrdev:{node:{getattr:be.node_ops.getattr,setattr:be.node_ops.setattr},stream:we.chrdev_stream_ops}});var n=we.createNode(e,t,r,i);return we.isDir(n.mode)?(n.node_ops=be.ops_table.dir.node,n.stream_ops=be.ops_table.dir.stream,n.contents={}):we.isFile(n.mode)?(n.node_ops=be.ops_table.file.node,n.stream_ops=be.ops_table.file.stream,n.usedBytes=0,n.contents=null):we.isLink(n.mode)?(n.node_ops=be.ops_table.link.node,n.stream_ops=be.ops_table.link.stream):we.isChrdev(n.mode)&&(n.node_ops=be.ops_table.chrdev.node,n.stream_ops=be.ops_table.chrdev.stream),n.timestamp=Date.now(),e&&(e.contents[t]=n,e.timestamp=n.timestamp),n},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage:function(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var i=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(i.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr:function(e){var t={};return t.dev=we.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,we.isDir(e.mode)?t.size=4096:we.isFile(e.mode)?t.size=e.usedBytes:we.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&be.resizeFileStorage(e,t.size)},lookup:function(e,t){throw we.genericErrors[44]},mknod:function(e,t,r,i){return be.createNode(e,t,r,i)},rename:function(e,t,r){if(we.isDir(e.mode)){var i;try{i=we.lookupNode(t,r)}catch(e){}if(i)for(var n in i.contents)throw new we.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=r,t.contents[r]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink:function(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir:function(e,t){var r=we.lookupNode(e,t);for(var i in r.contents)throw new we.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir:function(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink:function(e,t,r){var i=be.createNode(e,t,41471,0);return i.link=r,i},readlink:function(e){if(!we.isLink(e.mode))throw new we.ErrnoError(28);return e.link}},stream_ops:{read:function(e,t,r,i,n){var o=e.node.contents;if(n>=e.node.usedBytes)return 0;var s=Math.min(e.node.usedBytes-n,i);if(s>8&&o.subarray)t.set(o.subarray(n,n+s),r);else for(var a=0;a<s;a++)t[r+a]=o[n+a];return s},write:function(e,t,r,i,n,o){if(!i)return 0;var s=e.node;if(s.timestamp=Date.now(),t.subarray&&(!s.contents||s.contents.subarray)){if(o)return s.contents=t.subarray(r,r+i),s.usedBytes=i,i;if(0===s.usedBytes&&0===n)return s.contents=t.slice(r,r+i),s.usedBytes=i,i;if(n+i<=s.usedBytes)return s.contents.set(t.subarray(r,r+i),n),i}if(be.expandFileStorage(s,n+i),s.contents.subarray&&t.subarray)s.contents.set(t.subarray(r,r+i),n);else for(var a=0;a<i;a++)s.contents[n+a]=t[r+a];return s.usedBytes=Math.max(s.usedBytes,n+i),i},llseek:function(e,t,r){var i=t;if(1===r?i+=e.position:2===r&&we.isFile(e.node.mode)&&(i+=e.node.usedBytes),i<0)throw new we.ErrnoError(28);return i},allocate:function(e,t,r){be.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap:function(e,t,r,i,n){if(!we.isFile(e.node.mode))throw new we.ErrnoError(43);var o,s,a=e.node.contents;if(2&n||a.buffer!==D){if((r>0||r+t<a.length)&&(a=a.subarray?a.subarray(r,r+t):Array.prototype.slice.call(a,r,r+t)),s=!0,!(o=ve(t)))throw new we.ErrnoError(48);P.set(a,o)}else s=!1,o=a.byteOffset;return{ptr:o,allocated:s}},msync:function(e,t,r,i,n){if(!we.isFile(e.node.mode))throw new we.ErrnoError(43);return 2&n||be.stream_ops.write(e,t,0,i,r,!1),0}}},we={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(e=_e.resolve(we.cwd(),e)))return{path:"",node:null};if(t=Object.assign({follow_mount:!0,recurse_count:0},t),t.recurse_count>8)throw new we.ErrnoError(32);for(var r=me.normalizeArray(e.split("/").filter((e=>!!e)),!1),i=we.root,n="/",o=0;o<r.length;o++){var s=o===r.length-1;if(s&&t.parent)break;if(i=we.lookupNode(i,r[o]),n=me.join2(n,r[o]),we.isMountpoint(i)&&(!s||s&&t.follow_mount)&&(i=i.mounted.root),!s||t.follow)for(var a=0;we.isLink(i.mode);){var d=we.readlink(n);if(n=_e.resolve(me.dirname(n),d),i=we.lookupPath(n,{recurse_count:t.recurse_count+1}).node,a++>40)throw new we.ErrnoError(32)}}return{path:n,node:i}},getPath:e=>{for(var t;;){if(we.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?r+"/"+t:r+t:r}t=t?e.name+"/"+t:e.name,e=e.parent}},hashName:(e,t)=>{for(var r=0,i=0;i<t.length;i++)r=(r<<5)-r+t.charCodeAt(i)|0;return(e+r>>>0)%we.nameTable.length},hashAddNode:e=>{var t=we.hashName(e.parent.id,e.name);e.name_next=we.nameTable[t],we.nameTable[t]=e},hashRemoveNode:e=>{var t=we.hashName(e.parent.id,e.name);if(we.nameTable[t]===e)we.nameTable[t]=e.name_next;else for(var r=we.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:(e,t)=>{var r=we.mayLookup(e);if(r)throw new we.ErrnoError(r,e);for(var i=we.hashName(e.id,t),n=we.nameTable[i];n;n=n.name_next){var o=n.name;if(n.parent.id===e.id&&o===t)return n}return we.lookup(e,t)},createNode:(e,t,r,i)=>{var n=new we.FSNode(e,t,r,i);return we.hashAddNode(n),n},destroyNode:e=>{we.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>49152==(49152&e),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:e=>{var t=we.flagModes[e];if(void 0===t)throw new Error("Unknown file open mode: "+e);return t},flagsToPermissionString:e=>{var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>we.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup:e=>{var t=we.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate:(e,t)=>{try{return we.lookupNode(e,t),20}catch(e){}return we.nodePermissions(e,"wx")},mayDelete:(e,t,r)=>{var i;try{i=we.lookupNode(e,t)}catch(e){return e.errno}var n=we.nodePermissions(e,"wx");if(n)return n;if(r){if(!we.isDir(i.mode))return 54;if(we.isRoot(i)||we.getPath(i)===we.cwd())return 10}else if(we.isDir(i.mode))return 31;return 0},mayOpen:(e,t)=>e?we.isLink(e.mode)?32:we.isDir(e.mode)&&("r"!==we.flagsToPermissionString(t)||512&t)?31:we.nodePermissions(e,we.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:we.MAX_OPEN_FDS;for(var r=e;r<=t;r++)if(!we.streams[r])return r;throw new we.ErrnoError(33)},getStream:e=>we.streams[e],createStream:(e,t,r)=>{we.FSStream||(we.FSStream=function(){this.shared={}},we.FSStream.prototype={},Object.defineProperties(we.FSStream.prototype,{object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}},flags:{get:function(){return this.shared.flags},set:function(e){this.shared.flags=e}},position:{get:function(){return this.shared.position},set:function(e){this.shared.position=e}}})),e=Object.assign(new we.FSStream,e);var i=we.nextfd(t,r);return e.fd=i,we.streams[i]=e,e},closeStream:e=>{we.streams[e]=null},chrdev_stream_ops:{open:e=>{var t=we.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new we.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice:(e,t)=>{we.devices[e]={stream_ops:t}},getDevice:e=>we.devices[e],getMounts:e=>{for(var t=[],r=[e];r.length;){var i=r.pop();t.push(i),r.push.apply(r,i.mounts)}return t},syncfs:(e,t)=>{"function"==typeof e&&(t=e,e=!1),we.syncFSRequests++,we.syncFSRequests>1&&S("warning: "+we.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=we.getMounts(we.root.mount),i=0;function n(e){return we.syncFSRequests--,t(e)}function o(e){if(e)return o.errored?void 0:(o.errored=!0,n(e));++i>=r.length&&n(null)}r.forEach((t=>{if(!t.type.syncfs)return o(null);t.type.syncfs(t,e,o)}))},mount:(e,t,r)=>{var i,n="/"===r,o=!r;if(n&&we.root)throw new we.ErrnoError(10);if(!n&&!o){var s=we.lookupPath(r,{follow_mount:!1});if(r=s.path,i=s.node,we.isMountpoint(i))throw new we.ErrnoError(10);if(!we.isDir(i.mode))throw new we.ErrnoError(54)}var a={type:e,opts:t,mountpoint:r,mounts:[]},d=e.mount(a);return d.mount=a,a.root=d,n?we.root=d:i&&(i.mounted=a,i.mount&&i.mount.mounts.push(a)),d},unmount:e=>{var t=we.lookupPath(e,{follow_mount:!1});if(!we.isMountpoint(t.node))throw new we.ErrnoError(28);var r=t.node,i=r.mounted,n=we.getMounts(i);Object.keys(we.nameTable).forEach((e=>{for(var t=we.nameTable[e];t;){var r=t.name_next;n.includes(t.mount)&&we.destroyNode(t),t=r}})),r.mounted=null;var o=r.mount.mounts.indexOf(i);r.mount.mounts.splice(o,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod:(e,t,r)=>{var i=we.lookupPath(e,{parent:!0}).node,n=me.basename(e);if(!n||"."===n||".."===n)throw new we.ErrnoError(28);var o=we.mayCreate(i,n);if(o)throw new we.ErrnoError(o);if(!i.node_ops.mknod)throw new we.ErrnoError(63);return i.node_ops.mknod(i,n,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,we.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,we.mknod(e,t,0)),mkdirTree:(e,t)=>{for(var r=e.split("/"),i="",n=0;n<r.length;++n)if(r[n]){i+="/"+r[n];try{we.mkdir(i,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>(void 0===r&&(r=t,t=438),t|=8192,we.mknod(e,t,r)),symlink:(e,t)=>{if(!_e.resolve(e))throw new we.ErrnoError(44);var r=we.lookupPath(t,{parent:!0}).node;if(!r)throw new we.ErrnoError(44);var i=me.basename(t),n=we.mayCreate(r,i);if(n)throw new we.ErrnoError(n);if(!r.node_ops.symlink)throw new we.ErrnoError(63);return r.node_ops.symlink(r,i,e)},rename:(e,t)=>{var r,i,n=me.dirname(e),o=me.dirname(t),s=me.basename(e),a=me.basename(t);if(r=we.lookupPath(e,{parent:!0}).node,i=we.lookupPath(t,{parent:!0}).node,!r||!i)throw new we.ErrnoError(44);if(r.mount!==i.mount)throw new we.ErrnoError(75);var d,l=we.lookupNode(r,s),u=_e.relative(e,o);if("."!==u.charAt(0))throw new we.ErrnoError(28);if("."!==(u=_e.relative(t,n)).charAt(0))throw new we.ErrnoError(55);try{d=we.lookupNode(i,a)}catch(e){}if(l!==d){var c=we.isDir(l.mode),f=we.mayDelete(r,s,c);if(f)throw new we.ErrnoError(f);if(f=d?we.mayDelete(i,a,c):we.mayCreate(i,a))throw new we.ErrnoError(f);if(!r.node_ops.rename)throw new we.ErrnoError(63);if(we.isMountpoint(l)||d&&we.isMountpoint(d))throw new we.ErrnoError(10);if(i!==r&&(f=we.nodePermissions(r,"w")))throw new we.ErrnoError(f);we.hashRemoveNode(l);try{r.node_ops.rename(l,i,a)}catch(e){throw e}finally{we.hashAddNode(l)}}},rmdir:e=>{var t=we.lookupPath(e,{parent:!0}).node,r=me.basename(e),i=we.lookupNode(t,r),n=we.mayDelete(t,r,!0);if(n)throw new we.ErrnoError(n);if(!t.node_ops.rmdir)throw new we.ErrnoError(63);if(we.isMountpoint(i))throw new we.ErrnoError(10);t.node_ops.rmdir(t,r),we.destroyNode(i)},readdir:e=>{var t=we.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new we.ErrnoError(54);return t.node_ops.readdir(t)},unlink:e=>{var t=we.lookupPath(e,{parent:!0}).node;if(!t)throw new we.ErrnoError(44);var r=me.basename(e),i=we.lookupNode(t,r),n=we.mayDelete(t,r,!1);if(n)throw new we.ErrnoError(n);if(!t.node_ops.unlink)throw new we.ErrnoError(63);if(we.isMountpoint(i))throw new we.ErrnoError(10);t.node_ops.unlink(t,r),we.destroyNode(i)},readlink:e=>{var t=we.lookupPath(e).node;if(!t)throw new we.ErrnoError(44);if(!t.node_ops.readlink)throw new we.ErrnoError(28);return _e.resolve(we.getPath(t.parent),t.node_ops.readlink(t))},stat:(e,t)=>{var r=we.lookupPath(e,{follow:!t}).node;if(!r)throw new we.ErrnoError(44);if(!r.node_ops.getattr)throw new we.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>we.stat(e,!0),chmod:(e,t,r)=>{var i;if(!(i="string"==typeof e?we.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new we.ErrnoError(63);i.node_ops.setattr(i,{mode:4095&t|-4096&i.mode,timestamp:Date.now()})},lchmod:(e,t)=>{we.chmod(e,t,!0)},fchmod:(e,t)=>{var r=we.getStream(e);if(!r)throw new we.ErrnoError(8);we.chmod(r.node,t)},chown:(e,t,r,i)=>{var n;if(!(n="string"==typeof e?we.lookupPath(e,{follow:!i}).node:e).node_ops.setattr)throw new we.ErrnoError(63);n.node_ops.setattr(n,{timestamp:Date.now()})},lchown:(e,t,r)=>{we.chown(e,t,r,!0)},fchown:(e,t,r)=>{var i=we.getStream(e);if(!i)throw new we.ErrnoError(8);we.chown(i.node,t,r)},truncate:(e,t)=>{if(t<0)throw new we.ErrnoError(28);var r;if(!(r="string"==typeof e?we.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new we.ErrnoError(63);if(we.isDir(r.mode))throw new we.ErrnoError(31);if(!we.isFile(r.mode))throw new we.ErrnoError(28);var i=we.nodePermissions(r,"w");if(i)throw new we.ErrnoError(i);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:(e,t)=>{var r=we.getStream(e);if(!r)throw new we.ErrnoError(8);if(0==(2097155&r.flags))throw new we.ErrnoError(28);we.truncate(r.node,t)},utime:(e,t,r)=>{var i=we.lookupPath(e,{follow:!0}).node;i.node_ops.setattr(i,{timestamp:Math.max(t,r)})},open:(e,r,i)=>{if(""===e)throw new we.ErrnoError(44);var n;if(i=void 0===i?438:i,i=64&(r="string"==typeof r?we.modeStringToFlags(r):r)?4095&i|32768:0,"object"==typeof e)n=e;else{e=me.normalize(e);try{n=we.lookupPath(e,{follow:!(131072&r)}).node}catch(e){}}var o=!1;if(64&r)if(n){if(128&r)throw new we.ErrnoError(20)}else n=we.mknod(e,i,0),o=!0;if(!n)throw new we.ErrnoError(44);if(we.isChrdev(n.mode)&&(r&=-513),65536&r&&!we.isDir(n.mode))throw new we.ErrnoError(54);if(!o){var s=we.mayOpen(n,r);if(s)throw new we.ErrnoError(s)}512&r&&!o&&we.truncate(n,0),r&=-131713;var a=we.createStream({node:n,path:we.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return a.stream_ops.open&&a.stream_ops.open(a),!t.logReadFiles||1&r||(we.readFiles||(we.readFiles={}),e in we.readFiles||(we.readFiles[e]=1)),a},close:e=>{if(we.isClosed(e))throw new we.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{we.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek:(e,t,r)=>{if(we.isClosed(e))throw new we.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new we.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new we.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read:(e,t,r,i,n)=>{if(i<0||n<0)throw new we.ErrnoError(28);if(we.isClosed(e))throw new we.ErrnoError(8);if(1==(2097155&e.flags))throw new we.ErrnoError(8);if(we.isDir(e.node.mode))throw new we.ErrnoError(31);if(!e.stream_ops.read)throw new we.ErrnoError(28);var o=void 0!==n;if(o){if(!e.seekable)throw new we.ErrnoError(70)}else n=e.position;var s=e.stream_ops.read(e,t,r,i,n);return o||(e.position+=s),s},write:(e,t,r,i,n,o)=>{if(i<0||n<0)throw new we.ErrnoError(28);if(we.isClosed(e))throw new we.ErrnoError(8);if(0==(2097155&e.flags))throw new we.ErrnoError(8);if(we.isDir(e.node.mode))throw new we.ErrnoError(31);if(!e.stream_ops.write)throw new we.ErrnoError(28);e.seekable&&1024&e.flags&&we.llseek(e,0,2);var s=void 0!==n;if(s){if(!e.seekable)throw new we.ErrnoError(70)}else n=e.position;var a=e.stream_ops.write(e,t,r,i,n,o);return s||(e.position+=a),a},allocate:(e,t,r)=>{if(we.isClosed(e))throw new we.ErrnoError(8);if(t<0||r<=0)throw new we.ErrnoError(28);if(0==(2097155&e.flags))throw new we.ErrnoError(8);if(!we.isFile(e.node.mode)&&!we.isDir(e.node.mode))throw new we.ErrnoError(43);if(!e.stream_ops.allocate)throw new we.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap:(e,t,r,i,n)=>{if(0!=(2&i)&&0==(2&n)&&2!=(2097155&e.flags))throw new we.ErrnoError(2);if(1==(2097155&e.flags))throw new we.ErrnoError(2);if(!e.stream_ops.mmap)throw new we.ErrnoError(43);return e.stream_ops.mmap(e,t,r,i,n)},msync:(e,t,r,i,n)=>e&&e.stream_ops.msync?e.stream_ops.msync(e,t,r,i,n):0,munmap:e=>0,ioctl:(e,t,r)=>{if(!e.stream_ops.ioctl)throw new we.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error('Invalid encoding type "'+t.encoding+'"');var r,i=we.open(e,t.flags),n=we.stat(e).size,o=new Uint8Array(n);return we.read(i,o,0,n,0),"utf8"===t.encoding?r=G(o,0):"binary"===t.encoding&&(r=o),we.close(i),r},writeFile:function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r.flags=r.flags||577;var i=we.open(e,r.flags,r.mode);if("string"==typeof t){var n=new Uint8Array(V(t)+1),o=H(t,n,0,n.length);we.write(i,n,0,o,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");we.write(i,t,0,t.byteLength,void 0,r.canOwn)}we.close(i)},cwd:()=>we.currentPath,chdir:e=>{var t=we.lookupPath(e,{follow:!0});if(null===t.node)throw new we.ErrnoError(44);if(!we.isDir(t.node.mode))throw new we.ErrnoError(54);var r=we.nodePermissions(t.node,"x");if(r)throw new we.ErrnoError(r);we.currentPath=t.path},createDefaultDirectories:()=>{we.mkdir("/tmp"),we.mkdir("/home"),we.mkdir("/home/web_user")},createDefaultDevices:()=>{we.mkdir("/dev"),we.registerDevice(we.makedev(1,3),{read:()=>0,write:(e,t,r,i,n)=>i}),we.mkdev("/dev/null",we.makedev(1,3)),ye.register(we.makedev(5,0),ye.default_tty_ops),ye.register(we.makedev(6,0),ye.default_tty1_ops),we.mkdev("/dev/tty",we.makedev(5,0)),we.mkdev("/dev/tty1",we.makedev(6,0));var e=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return()=>(crypto.getRandomValues(e),e[0])}if(m)try{var t=require("crypto");return()=>t.randomBytes(1)[0]}catch(e){}return()=>ie("randomDevice")}();we.createDevice("/dev","random",e),we.createDevice("/dev","urandom",e),we.mkdir("/dev/shm"),we.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{we.mkdir("/proc");var e=we.mkdir("/proc/self");we.mkdir("/proc/self/fd"),we.mount({mount:()=>{var t=we.createNode(e,"fd",16895,73);return t.node_ops={lookup:(e,t)=>{var r=+t,i=we.getStream(r);if(!i)throw new we.ErrnoError(8);var n={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>i.path}};return n.parent=n,n}},t}},{},"/proc/self/fd")},createStandardStreams:()=>{t.stdin?we.createDevice("/dev","stdin",t.stdin):we.symlink("/dev/tty","/dev/stdin"),t.stdout?we.createDevice("/dev","stdout",null,t.stdout):we.symlink("/dev/tty","/dev/stdout"),t.stderr?we.createDevice("/dev","stderr",null,t.stderr):we.symlink("/dev/tty1","/dev/stderr"),we.open("/dev/stdin",0),we.open("/dev/stdout",1),we.open("/dev/stderr",1)},ensureErrnoError:()=>{we.ErrnoError||(we.ErrnoError=function(e,t){this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},we.ErrnoError.prototype=new Error,we.ErrnoError.prototype.constructor=we.ErrnoError,[44].forEach((e=>{we.genericErrors[e]=new we.ErrnoError(e),we.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:()=>{we.ensureErrnoError(),we.nameTable=new Array(4096),we.mount(be,{},"/"),we.createDefaultDirectories(),we.createDefaultDevices(),we.createSpecialDirectories(),we.filesystems={MEMFS:be}},init:(e,r,i)=>{we.init.initialized=!0,we.ensureErrnoError(),t.stdin=e||t.stdin,t.stdout=r||t.stdout,t.stderr=i||t.stderr,we.createStandardStreams()},quit:()=>{we.init.initialized=!1;for(var e=0;e<we.streams.length;e++){var t=we.streams[e];t&&we.close(t)}},getMode:(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},findObject:(e,t)=>{var r=we.analyzePath(e,t);return r.exists?r.object:null},analyzePath:(e,t)=>{try{e=(i=we.lookupPath(e,{follow:!t})).path}catch(e){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var i=we.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=i.path,r.parentObject=i.node,r.name=me.basename(e),i=we.lookupPath(e,{follow:!t}),r.exists=!0,r.path=i.path,r.object=i.node,r.name=i.node.name,r.isRoot="/"===i.path}catch(e){r.error=e.errno}return r},createPath:(e,t,r,i)=>{e="string"==typeof e?e:we.getPath(e);for(var n=t.split("/").reverse();n.length;){var o=n.pop();if(o){var s=me.join2(e,o);try{we.mkdir(s)}catch(e){}e=s}}return s},createFile:(e,t,r,i,n)=>{var o=me.join2("string"==typeof e?e:we.getPath(e),t),s=we.getMode(i,n);return we.create(o,s)},createDataFile:(e,t,r,i,n,o)=>{var s=t;e&&(e="string"==typeof e?e:we.getPath(e),s=t?me.join2(e,t):e);var a=we.getMode(i,n),d=we.create(s,a);if(r){if("string"==typeof r){for(var l=new Array(r.length),u=0,c=r.length;u<c;++u)l[u]=r.charCodeAt(u);r=l}we.chmod(d,146|a);var f=we.open(d,577);we.write(f,r,0,r.length,0,o),we.close(f),we.chmod(d,a)}return d},createDevice:(e,t,r,i)=>{var n=me.join2("string"==typeof e?e:we.getPath(e),t),o=we.getMode(!!r,!!i);we.createDevice.major||(we.createDevice.major=64);var s=we.makedev(we.createDevice.major++,0);return we.registerDevice(s,{open:e=>{e.seekable=!1},close:e=>{i&&i.buffer&&i.buffer.length&&i(10)},read:(e,t,i,n,o)=>{for(var s=0,a=0;a<n;a++){var d;try{d=r()}catch(e){throw new we.ErrnoError(29)}if(void 0===d&&0===s)throw new we.ErrnoError(6);if(null==d)break;s++,t[i+a]=d}return s&&(e.node.timestamp=Date.now()),s},write:(e,t,r,n,o)=>{for(var s=0;s<n;s++)try{i(t[r+s])}catch(e){throw new we.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),s}}),we.mkdev(n,o,s)},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(!n)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=ge(n(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new we.ErrnoError(29)}},createLazyFile:(e,t,r,i,n)=>{function o(){this.lengthKnown=!1,this.chunks=[]}if(o.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}},o.prototype.setDataGetter=function(e){this.getter=e},o.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+r+". Status: "+e.status);var t,i=Number(e.getResponseHeader("Content-length")),n=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,o=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,s=1048576;n||(s=i);var a=this;a.setDataGetter((e=>{var t=e*s,n=(e+1)*s-1;if(n=Math.min(n,i-1),void 0===a.chunks[e]&&(a.chunks[e]=((e,t)=>{if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>i-1)throw new Error("only "+i+" bytes available! programmer error!");var n=new XMLHttpRequest;if(n.open("GET",r,!1),i!==s&&n.setRequestHeader("Range","bytes="+e+"-"+t),n.responseType="arraybuffer",n.overrideMimeType&&n.overrideMimeType("text/plain; charset=x-user-defined"),n.send(null),!(n.status>=200&&n.status<300||304===n.status))throw new Error("Couldn't load "+r+". Status: "+n.status);return void 0!==n.response?new Uint8Array(n.response||[]):ge(n.responseText||"",!0)})(t,n)),void 0===a.chunks[e])throw new Error("doXHR failed!");return a.chunks[e]})),!o&&i||(s=i=1,i=this.getter(0).length,s=i,w("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=i,this._chunkSize=s,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!p)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var s=new o;Object.defineProperties(s,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var a={isDevice:!1,contents:s}}else a={isDevice:!1,url:r};var d=we.createFile(e,t,a,i,n);a.contents?d.contents=a.contents:a.url&&(d.contents=null,d.url=a.url),Object.defineProperties(d,{usedBytes:{get:function(){return this.contents.length}}});var l={};function u(e,t,r,i,n){var o=e.node.contents;if(n>=o.length)return 0;var s=Math.min(o.length-n,i);if(o.slice)for(var a=0;a<s;a++)t[r+a]=o[n+a];else for(a=0;a<s;a++)t[r+a]=o.get(n+a);return s}return Object.keys(d.stream_ops).forEach((e=>{var t=d.stream_ops[e];l[e]=function(){return we.forceLoadFile(d),t.apply(null,arguments)}})),l.read=(e,t,r,i,n)=>(we.forceLoadFile(d),u(e,t,r,i,n)),l.mmap=(e,t,r,i,n)=>{we.forceLoadFile(d);var o=ve(t);if(!o)throw new we.ErrnoError(48);return u(e,P,o,t,r),{ptr:o,allocated:!0}},d.stream_ops=l,d},createPreloadedFile:(e,t,r,i,n,s,a,d,l,u)=>{var c=t?_e.resolve(me.join2(e,t)):e;function f(r){function o(r){u&&u(),d||we.createDataFile(e,t,r,i,n,l),s&&s(),re()}Browser.handledByPreloadPlugin(r,c,o,(()=>{a&&a(),re()}))||o(r)}te(),"string"==typeof r?function(e,t,r,i){var n=i?"":"al "+e;o(e,(r=>{C(r,'Loading data file "'+e+'" failed (no arrayBuffer).'),t(new Uint8Array(r)),n&&re()}),(t=>{if(!r)throw'Loading data file "'+e+'" failed.';r()})),n&&te()}(r,(e=>f(e)),a):f(r)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var i=we.indexedDB();try{var n=i.open(we.DB_NAME(),we.DB_VERSION)}catch(e){return r(e)}n.onupgradeneeded=()=>{w("creating db"),n.result.createObjectStore(we.DB_STORE_NAME)},n.onsuccess=()=>{var i=n.result.transaction([we.DB_STORE_NAME],"readwrite"),o=i.objectStore(we.DB_STORE_NAME),s=0,a=0,d=e.length;function l(){0==a?t():r()}e.forEach((e=>{var t=o.put(we.analyzePath(e).object.contents,e);t.onsuccess=()=>{++s+a==d&&l()},t.onerror=()=>{a++,s+a==d&&l()}})),i.onerror=r},n.onerror=r},loadFilesFromDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var i=we.indexedDB();try{var n=i.open(we.DB_NAME(),we.DB_VERSION)}catch(e){return r(e)}n.onupgradeneeded=r,n.onsuccess=()=>{var i=n.result;try{var o=i.transaction([we.DB_STORE_NAME],"readonly")}catch(e){return void r(e)}var s=o.objectStore(we.DB_STORE_NAME),a=0,d=0,l=e.length;function u(){0==d?t():r()}e.forEach((e=>{var t=s.get(e);t.onsuccess=()=>{we.analyzePath(e).exists&&we.unlink(e),we.createDataFile(me.dirname(e),me.basename(e),t.result,!0,!0,!0),++a+d==l&&u()},t.onerror=()=>{d++,a+d==l&&u()}})),o.onerror=r},n.onerror=r}},Se={DEFAULT_POLLMASK:5,calculateAt:function(e,t,r){if(me.isAbs(t))return t;var i;if(-100===e)i=we.cwd();else{var n=we.getStream(e);if(!n)throw new we.ErrnoError(8);i=n.path}if(0==t.length){if(!r)throw new we.ErrnoError(44);return i}return me.join2(i,t)},doStat:function(e,t,r){try{var i=e(t)}catch(e){if(e&&e.node&&me.normalize(t)!==me.normalize(we.getPath(e.node)))return-54;throw e}return M[r>>2]=i.dev,M[r+4>>2]=0,M[r+8>>2]=i.ino,M[r+12>>2]=i.mode,M[r+16>>2]=i.nlink,M[r+20>>2]=i.uid,M[r+24>>2]=i.gid,M[r+28>>2]=i.rdev,M[r+32>>2]=0,se=[i.size>>>0,(oe=i.size,+Math.abs(oe)>=1?oe>0?(0|Math.min(+Math.floor(oe/4294967296),4294967295))>>>0:~~+Math.ceil((oe-+(~~oe>>>0))/4294967296)>>>0:0)],M[r+40>>2]=se[0],M[r+44>>2]=se[1],M[r+48>>2]=4096,M[r+52>>2]=i.blocks,se=[Math.floor(i.atime.getTime()/1e3)>>>0,(oe=Math.floor(i.atime.getTime()/1e3),+Math.abs(oe)>=1?oe>0?(0|Math.min(+Math.floor(oe/4294967296),4294967295))>>>0:~~+Math.ceil((oe-+(~~oe>>>0))/4294967296)>>>0:0)],M[r+56>>2]=se[0],M[r+60>>2]=se[1],M[r+64>>2]=0,se=[Math.floor(i.mtime.getTime()/1e3)>>>0,(oe=Math.floor(i.mtime.getTime()/1e3),+Math.abs(oe)>=1?oe>0?(0|Math.min(+Math.floor(oe/4294967296),4294967295))>>>0:~~+Math.ceil((oe-+(~~oe>>>0))/4294967296)>>>0:0)],M[r+72>>2]=se[0],M[r+76>>2]=se[1],M[r+80>>2]=0,se=[Math.floor(i.ctime.getTime()/1e3)>>>0,(oe=Math.floor(i.ctime.getTime()/1e3),+Math.abs(oe)>=1?oe>0?(0|Math.min(+Math.floor(oe/4294967296),4294967295))>>>0:~~+Math.ceil((oe-+(~~oe>>>0))/4294967296)>>>0:0)],M[r+88>>2]=se[0],M[r+92>>2]=se[1],M[r+96>>2]=0,se=[i.ino>>>0,(oe=i.ino,+Math.abs(oe)>=1?oe>0?(0|Math.min(+Math.floor(oe/4294967296),4294967295))>>>0:~~+Math.ceil((oe-+(~~oe>>>0))/4294967296)>>>0:0)],M[r+104>>2]=se[0],M[r+108>>2]=se[1],0},doMsync:function(e,t,r,i,n){var o=F.slice(e,e+r);we.msync(t,o,n,r,i)},varargs:void 0,get:function(){return Se.varargs+=4,M[Se.varargs-4>>2]},getStr:function(e){return $(e)},getStreamFromFD:function(e){var t=we.getStream(e);if(!t)throw new we.ErrnoError(8);return t}};function Ee(e){if(_)return lr(1,1,e);B=e,Z()||(Ue.terminateAllThreads(),t.onExit&&t.onExit(e),k=!0),f(e,new fe(e))}var Ae=function(e,t){if(B=e,!t&&_)throw xe(e),"unwind";Ee(e)},Ue={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],pthreads:{},init:function(){_?Ue.initWorker():Ue.initMainThread()},initMainThread:function(){},initWorker:function(){x=!1},setExitStatus:function(e){B=e},terminateAllThreads:function(){for(var e in Ue.pthreads)(r=Ue.pthreads[e])&&Ue.returnWorkerToPool(r);for(var t=0;t<Ue.unusedWorkers.length;++t){var r;(r=Ue.unusedWorkers[t]).terminate()}Ue.unusedWorkers=[]},returnWorkerToPool:function(e){var t=e.pthread_ptr;delete Ue.pthreads[t],Ue.unusedWorkers.push(e),Ue.runningWorkers.splice(Ue.runningWorkers.indexOf(e),1),e.pthread_ptr=0,Lr(t)},receiveObjectTransfer:function(e){},threadInitTLS:function(){for(var e in Ue.tlsInitFunctions)Ue.tlsInitFunctions.hasOwnProperty(e)&&Ue.tlsInitFunctions[e]()},loadWasmModuleToWorker:function(e,r){e.onmessage=i=>{var n,o=i.data,s=o.cmd;if(e.pthread_ptr&&(Ue.currentProxiedOperationCallerThread=e.pthread_ptr),o.targetThread&&o.targetThread!=Br()){var a=Ue.pthreads[o.targetThread];return a?a.postMessage(o,o.transferList):S('Internal error! Worker sent a message "'+s+'" to target pthread '+o.targetThread+", but that thread no longer exists!"),void(Ue.currentProxiedOperationCallerThread=void 0)}"processProxyingQueue"===s?ir(o.queue):"spawnThread"===s?pe(o):"cleanupThread"===s?he(o.thread):"killThread"===s?function(e){var t=Ue.pthreads[e];delete Ue.pthreads[e],t.terminate(),Lr(e),Ue.runningWorkers.splice(Ue.runningWorkers.indexOf(t),1),t.pthread_ptr=0}(o.thread):"cancelThread"===s?(n=o.thread,Ue.pthreads[n].postMessage({cmd:"cancel"})):"loaded"===s?(e.loaded=!0,r&&r(e),e.runPthread&&(e.runPthread(),delete e.runPthread)):"print"===s?w("Thread "+o.threadId+": "+o.text):"printErr"===s?S("Thread "+o.threadId+": "+o.text):"alert"===s?alert("Thread "+o.threadId+": "+o.text):"setimmediate"===o.target?e.postMessage(o):"onAbort"===s?t.onAbort&&t.onAbort(o.arg):s&&S("worker sent an unknown command "+s),Ue.currentProxiedOperationCallerThread=void 0},e.onerror=e=>{throw S("worker sent an error! "+e.filename+":"+e.lineno+": "+e.message),e},m&&(e.on("message",(function(t){e.onmessage({data:t})})),e.on("error",(function(t){e.onerror(t)})),e.on("detachedExit",(function(){}))),e.postMessage({cmd:"load",urlOrBlob:t.mainScriptUrlOrBlob,wasmMemory:U,wasmModule:T})},allocateUnusedWorker:function(){if(t.locateFile){var e=y("decoder-pro-mt-worker.worker.js");Ue.unusedWorkers.push(new Worker(e))}else Ue.unusedWorkers.push(new Worker(new URL("decoder-pro-mt-worker.worker.js","undefined"==typeof document&&"undefined"==typeof location?new(require("url").URL)("file:"+__filename).href:"undefined"==typeof document?location.href:document.currentScript&&document.currentScript.src||new URL("decoder-pro-mt.js",document.baseURI).href)))},getNewWorker:function(){return 0==Ue.unusedWorkers.length&&(Ue.allocateUnusedWorker(),Ue.loadWasmModuleToWorker(Ue.unusedWorkers[0])),Ue.unusedWorkers.pop()}};function Te(e){for(;e.length>0;)e.shift()(t)}function xe(e){if(_)return lr(2,0,e);try{Ae(e)}catch(e){!function(e){if(e instanceof fe||"unwind"==e)return B;f(1,e)}(e)}}t.PThread=Ue,t.establishStackSpace=function(){var e=Br(),t=M[e+44>>2],r=M[e+48>>2];Rr(t,t-r),zr(t)};var Be=[];function ke(e){var t=Be[e];return t||(e>=Be.length&&(Be.length=e+1),Be[e]=t=j.get(e)),t}function Ce(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){R[this.ptr+4>>2]=e},this.get_type=function(){return R[this.ptr+4>>2]},this.set_destructor=function(e){R[this.ptr+8>>2]=e},this.get_destructor=function(){return R[this.ptr+8>>2]},this.set_refcount=function(e){M[this.ptr>>2]=e},this.set_caught=function(e){e=e?1:0,P[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=P[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,P[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=P[this.ptr+13>>0]},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){Atomics.add(M,this.ptr+0>>2,1)},this.release_ref=function(){return 1===Atomics.sub(M,this.ptr+0>>2,1)},this.set_adjusted_ptr=function(e){R[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return R[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Gr(this.get_type()))return R[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}function De(e,t,r,i){return _?lr(3,1,e,t,r,i):Pe(e,t,r,i)}function Pe(e,t,r,i){if("undefined"==typeof SharedArrayBuffer)return S("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var n=[];if(_&&0===n.length)return De(e,t,r,i);var o={startRoutine:r,pthread_ptr:e,arg:i,transferList:n};return _?(o.cmd="spawnThread",postMessage(o,n),0):pe(o)}function Fe(e,t,r){if(_)return lr(4,1,e,t,r);Se.varargs=r;try{var i=Se.getStreamFromFD(e);switch(t){case 0:return(n=Se.get())<0?-28:we.createStream(i,n).fd;case 1:case 2:case 6:case 7:return 0;case 3:return i.flags;case 4:var n=Se.get();return i.flags|=n,0;case 5:return n=Se.get(),I[n+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return o=28,M[xr()>>2]=o,-1}}catch(e){if(void 0===we||!(e instanceof we.ErrnoError))throw e;return-e.errno}var o}function Ie(e,t,r,i){if(_)return lr(5,1,e,t,r,i);Se.varargs=i;try{t=Se.getStr(t),t=Se.calculateAt(e,t);var n=i?Se.get():0;return we.open(t,r,n).fd}catch(e){if(void 0===we||!(e instanceof we.ErrnoError))throw e;return-e.errno}}function Le(e){switch(e){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+e)}}t.invokeEntryPoint=function(e,t){var r=ke(e)(t);Z()?Ue.setExitStatus(r):Mr(r)};var Me=void 0;function Re(e){for(var t="",r=e;F[r];)t+=Me[F[r++]];return t}var Ne={},ze={},Oe={},Ge=48,$e=57;function He(e){if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=Ge&&t<=$e?"_"+e:e}function Ve(e,t){return e=He(e),new Function("body","return function "+e+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(t)}function We(e,t){var r=Ve(t,(function(e){this.name=t,this.message=e;var r=new Error(e).stack;void 0!==r&&(this.stack=this.toString()+"\n"+r.replace(/^Error(:[^\n]*)?\n/,""))}));return r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},r}var je=void 0;function qe(e){throw new je(e)}var Ye=void 0;function Ke(e){throw new Ye(e)}function Xe(e,t,r){function i(t){var i=r(t);i.length!==e.length&&Ke("Mismatched type converter count");for(var n=0;n<e.length;++n)Ze(e[n],i[n])}e.forEach((function(e){Oe[e]=t}));var n=new Array(t.length),o=[],s=0;t.forEach(((e,t)=>{ze.hasOwnProperty(e)?n[t]=ze[e]:(o.push(e),Ne.hasOwnProperty(e)||(Ne[e]=[]),Ne[e].push((()=>{n[t]=ze[e],++s===o.length&&i(n)})))})),0===o.length&&i(n)}function Ze(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");var i=t.name;if(e||qe('type "'+i+'" must have a positive integer typeid pointer'),ze.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;qe("Cannot register type '"+i+"' twice")}if(ze[e]=t,delete Oe[e],Ne.hasOwnProperty(e)){var n=Ne[e];delete Ne[e],n.forEach((e=>e()))}}function Je(e){if(!(this instanceof bt))return!1;if(!(e instanceof bt))return!1;for(var t=this.$$.ptrType.registeredClass,r=this.$$.ptr,i=e.$$.ptrType.registeredClass,n=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;i.baseClass;)n=i.upcast(n),i=i.baseClass;return t===i&&r===n}function Qe(e){qe(e.$$.ptrType.registeredClass.name+" instance already deleted")}var et=!1;function tt(e){}function rt(e){e.count.value-=1,0===e.count.value&&function(e){e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)}(e)}function it(e,t,r){if(t===r)return e;if(void 0===r.baseClass)return null;var i=it(e,t,r.baseClass);return null===i?null:r.downcast(i)}var nt={};function ot(){return Object.keys(ct).length}function st(){var e=[];for(var t in ct)ct.hasOwnProperty(t)&&e.push(ct[t]);return e}var at=[];function dt(){for(;at.length;){var e=at.pop();e.$$.deleteScheduled=!1,e.delete()}}var lt=void 0;function ut(e){lt=e,at.length&<&<(dt)}var ct={};function ft(e,t){return t=function(e,t){for(void 0===t&&qe("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t}(e,t),ct[t]}function ht(e,t){return t.ptrType&&t.ptr||Ke("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&Ke("Both smartPtrType and smartPtr must be specified"),t.count={value:1},mt(Object.create(e,{$$:{value:t}}))}function pt(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=ft(this.registeredClass,t);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var i=r.clone();return this.destructor(e),i}function n(){return this.isSmartPointer?ht(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):ht(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var o,s=this.registeredClass.getActualType(t),a=nt[s];if(!a)return n.call(this);o=this.isConst?a.constPointerType:a.pointerType;var d=it(t,this.registeredClass,o.registeredClass);return null===d?n.call(this):this.isSmartPointer?ht(o.registeredClass.instancePrototype,{ptrType:o,ptr:d,smartPtrType:this,smartPtr:e}):