hzwl-easy-player
Version:
基于Vue 3的视频播放器组件,支持单屏和多屏播放模式
1 lines • 507 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.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.wasm"==e&&"undefined"!=typeof EASYPLAYER_PRO_WASM_URL&&""!=EASYPLAYER_PRO_WASM_URL?EASYPLAYER_PRO_WASM_URL:e};var n,o,s,a,d,l,u=Object.assign({},t),c="./this.program",f="object"==typeof window,h="function"==typeof importScripts,p="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,m="";p?(m=h?require("path").dirname(m)+"/":__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 ee))throw e})),process.on("unhandledRejection",(function(e){throw e})),t.inspect=function(){return"[Emscripten Module object]"}):(f||h)&&(h?m=self.location.href:"undefined"!=typeof document&&document.currentScript&&(m=document.currentScript.src),e&&(m=e),m=0!==m.indexOf("blob:")?m.substr(0,m.replace(/[?#].*/,"").lastIndexOf("/")+1):"",n=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},h&&(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)});var _=t.print||console.log.bind(console),g=t.printErr||console.warn.bind(console);Object.assign(t,u),u=null,t.arguments&&t.arguments,t.thisProgram&&(c=t.thisProgram),t.quit&&t.quit;var y,v,b=4;t.wasmBinary&&(y=t.wasmBinary),t.noExitRuntime,"object"!=typeof WebAssembly&&W("no native wasm support detected");var w=!1;function S(e,t){e||W(t)}var E,A,U,x,T,B,k,C,D,P,F="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function I(e,t,r){for(var i=t+r,n=t;e[n]&&!(n>=i);)++n;if(n-t>16&&e.buffer&&F)return F.decode(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 L(e,t){return e?I(U,e,t):""}function M(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 R(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}t.INITIAL_MEMORY;var N=[],z=[],O=[],G=0,$=null;function H(e){G++,t.monitorRunDependencies&&t.monitorRunDependencies(G)}function V(e){if(G--,t.monitorRunDependencies&&t.monitorRunDependencies(G),0==G&&$){var r=$;$=null,r()}}function W(e){t.onAbort&&t.onAbort(e),g(e="Aborted("+e+")"),w=!0,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw i(r),r}var j,q,Y,K,X="data:application/octet-stream;base64,";function Z(e){return e.startsWith(X)}function J(e){return e.startsWith("file://")}function Q(e){try{if(e==j&&y)return new Uint8Array(y);if(s)return s(e);throw"both async and sync fetching of the wasm failed"}catch(e){W(e)}}function ee(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function te(e){for(;e.length>0;)e.shift()(t)}function re(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){k[this.ptr+4>>2]=e},this.get_type=function(){return k[this.ptr+4>>2]},this.set_destructor=function(e){k[this.ptr+8>>2]=e},this.get_destructor=function(){return k[this.ptr+8>>2]},this.set_refcount=function(e){B[this.ptr>>2]=e},this.set_caught=function(e){e=e?1:0,A[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=A[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,A[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=A[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(){var e=B[this.ptr>>2];B[this.ptr>>2]=e+1},this.release_ref=function(){var e=B[this.ptr>>2];return B[this.ptr>>2]=e-1,1===e},this.set_adjusted_ptr=function(e){k[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return k[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Xt(this.get_type()))return k[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}t.locateFile?Z(j="decoder-pro.wasm")||(q=j,j=t.locateFile?t.locateFile(q,m):m+q):j=new URL("decoder-pro.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.js",document.baseURI).href).toString();var ie={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=ie.isAbs(e),r="/"===e.substr(-1);return(e=ie.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=ie.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=ie.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments,0);return ie.normalize(e.join("/"))},join2:(e,t)=>ie.normalize(e+"/"+t)},ne={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var i=r>=0?arguments[r]:le.cwd();if("string"!=typeof i)throw new TypeError("Arguments to path.resolve must be strings");if(!i)return"";e=i+"/"+e,t=ie.isAbs(i)}return(t?"/":"")+(e=ie.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=ne.resolve(e).substr(1),t=ne.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 oe(e,t,r){var i=r>0?r:R(e)+1,n=new Array(i),o=M(e,n,0,n.length);return t&&(n.length=o),n}var se={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){se.ttys[e]={input:[],output:[],ops:t},le.registerDevice(e,se.stream_ops)},stream_ops:{open:function(e){var t=se.ttys[e.node.rdev];if(!t)throw new le.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 le.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 le.ErrnoError(29)}if(void 0===a&&0===o)throw new le.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 le.ErrnoError(60);try{for(var o=0;o<i;o++)e.tty.ops.put_char(e.tty,t[r+o])}catch(e){throw new le.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(p){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=oe(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(_(I(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(_(I(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(g(I(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(g(I(e.output,0)),e.output=[])}}};function ae(e){e=function(e,t){return Math.ceil(e/t)*t}(e,65536);var t=Kt(65536,e);return t?(function(e,t){U.fill(0,e,e+t)}(t,e),t):0}var de={ops_table:null,mount:function(e){return de.createNode(null,"/",16895,0)},createNode:function(e,t,r,i){if(le.isBlkdev(r)||le.isFIFO(r))throw new le.ErrnoError(63);de.ops_table||(de.ops_table={dir:{node:{getattr:de.node_ops.getattr,setattr:de.node_ops.setattr,lookup:de.node_ops.lookup,mknod:de.node_ops.mknod,rename:de.node_ops.rename,unlink:de.node_ops.unlink,rmdir:de.node_ops.rmdir,readdir:de.node_ops.readdir,symlink:de.node_ops.symlink},stream:{llseek:de.stream_ops.llseek}},file:{node:{getattr:de.node_ops.getattr,setattr:de.node_ops.setattr},stream:{llseek:de.stream_ops.llseek,read:de.stream_ops.read,write:de.stream_ops.write,allocate:de.stream_ops.allocate,mmap:de.stream_ops.mmap,msync:de.stream_ops.msync}},link:{node:{getattr:de.node_ops.getattr,setattr:de.node_ops.setattr,readlink:de.node_ops.readlink},stream:{}},chrdev:{node:{getattr:de.node_ops.getattr,setattr:de.node_ops.setattr},stream:le.chrdev_stream_ops}});var n=le.createNode(e,t,r,i);return le.isDir(n.mode)?(n.node_ops=de.ops_table.dir.node,n.stream_ops=de.ops_table.dir.stream,n.contents={}):le.isFile(n.mode)?(n.node_ops=de.ops_table.file.node,n.stream_ops=de.ops_table.file.stream,n.usedBytes=0,n.contents=null):le.isLink(n.mode)?(n.node_ops=de.ops_table.link.node,n.stream_ops=de.ops_table.link.stream):le.isChrdev(n.mode)&&(n.node_ops=de.ops_table.chrdev.node,n.stream_ops=de.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=le.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,le.isDir(e.mode)?t.size=4096:le.isFile(e.mode)?t.size=e.usedBytes:le.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&&de.resizeFileStorage(e,t.size)},lookup:function(e,t){throw le.genericErrors[44]},mknod:function(e,t,r,i){return de.createNode(e,t,r,i)},rename:function(e,t,r){if(le.isDir(e.mode)){var i;try{i=le.lookupNode(t,r)}catch(e){}if(i)for(var n in i.contents)throw new le.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=le.lookupNode(e,t);for(var i in r.contents)throw new le.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=de.createNode(e,t,41471,0);return i.link=r,i},readlink:function(e){if(!le.isLink(e.mode))throw new le.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(de.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&&le.isFile(e.node.mode)&&(i+=e.node.usedBytes),i<0)throw new le.ErrnoError(28);return i},allocate:function(e,t,r){de.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap:function(e,t,r,i,n){if(!le.isFile(e.node.mode))throw new le.ErrnoError(43);var o,s,a=e.node.contents;if(2&n||a.buffer!==E){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=ae(t)))throw new le.ErrnoError(48);A.set(a,o)}else s=!1,o=a.byteOffset;return{ptr:o,allocated:s}},msync:function(e,t,r,i,n){if(!le.isFile(e.node.mode))throw new le.ErrnoError(43);return 2&n||de.stream_ops.write(e,t,0,i,r,!1),0}}},le={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=ne.resolve(le.cwd(),e)))return{path:"",node:null};if(t=Object.assign({follow_mount:!0,recurse_count:0},t),t.recurse_count>8)throw new le.ErrnoError(32);for(var r=ie.normalizeArray(e.split("/").filter((e=>!!e)),!1),i=le.root,n="/",o=0;o<r.length;o++){var s=o===r.length-1;if(s&&t.parent)break;if(i=le.lookupNode(i,r[o]),n=ie.join2(n,r[o]),le.isMountpoint(i)&&(!s||s&&t.follow_mount)&&(i=i.mounted.root),!s||t.follow)for(var a=0;le.isLink(i.mode);){var d=le.readlink(n);if(n=ne.resolve(ie.dirname(n),d),i=le.lookupPath(n,{recurse_count:t.recurse_count+1}).node,a++>40)throw new le.ErrnoError(32)}}return{path:n,node:i}},getPath:e=>{for(var t;;){if(le.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)%le.nameTable.length},hashAddNode:e=>{var t=le.hashName(e.parent.id,e.name);e.name_next=le.nameTable[t],le.nameTable[t]=e},hashRemoveNode:e=>{var t=le.hashName(e.parent.id,e.name);if(le.nameTable[t]===e)le.nameTable[t]=e.name_next;else for(var r=le.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:(e,t)=>{var r=le.mayLookup(e);if(r)throw new le.ErrnoError(r,e);for(var i=le.hashName(e.id,t),n=le.nameTable[i];n;n=n.name_next){var o=n.name;if(n.parent.id===e.id&&o===t)return n}return le.lookup(e,t)},createNode:(e,t,r,i)=>{var n=new le.FSNode(e,t,r,i);return le.hashAddNode(n),n},destroyNode:e=>{le.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=le.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)=>le.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=le.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate:(e,t)=>{try{return le.lookupNode(e,t),20}catch(e){}return le.nodePermissions(e,"wx")},mayDelete:(e,t,r)=>{var i;try{i=le.lookupNode(e,t)}catch(e){return e.errno}var n=le.nodePermissions(e,"wx");if(n)return n;if(r){if(!le.isDir(i.mode))return 54;if(le.isRoot(i)||le.getPath(i)===le.cwd())return 10}else if(le.isDir(i.mode))return 31;return 0},mayOpen:(e,t)=>e?le.isLink(e.mode)?32:le.isDir(e.mode)&&("r"!==le.flagsToPermissionString(t)||512&t)?31:le.nodePermissions(e,le.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]:le.MAX_OPEN_FDS;for(var r=e;r<=t;r++)if(!le.streams[r])return r;throw new le.ErrnoError(33)},getStream:e=>le.streams[e],createStream:(e,t,r)=>{le.FSStream||(le.FSStream=function(){this.shared={}},le.FSStream.prototype={},Object.defineProperties(le.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 le.FSStream,e);var i=le.nextfd(t,r);return e.fd=i,le.streams[i]=e,e},closeStream:e=>{le.streams[e]=null},chrdev_stream_ops:{open:e=>{var t=le.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new le.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice:(e,t)=>{le.devices[e]={stream_ops:t}},getDevice:e=>le.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),le.syncFSRequests++,le.syncFSRequests>1&&g("warning: "+le.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=le.getMounts(le.root.mount),i=0;function n(e){return le.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&&le.root)throw new le.ErrnoError(10);if(!n&&!o){var s=le.lookupPath(r,{follow_mount:!1});if(r=s.path,i=s.node,le.isMountpoint(i))throw new le.ErrnoError(10);if(!le.isDir(i.mode))throw new le.ErrnoError(54)}var a={type:e,opts:t,mountpoint:r,mounts:[]},d=e.mount(a);return d.mount=a,a.root=d,n?le.root=d:i&&(i.mounted=a,i.mount&&i.mount.mounts.push(a)),d},unmount:e=>{var t=le.lookupPath(e,{follow_mount:!1});if(!le.isMountpoint(t.node))throw new le.ErrnoError(28);var r=t.node,i=r.mounted,n=le.getMounts(i);Object.keys(le.nameTable).forEach((e=>{for(var t=le.nameTable[e];t;){var r=t.name_next;n.includes(t.mount)&&le.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=le.lookupPath(e,{parent:!0}).node,n=ie.basename(e);if(!n||"."===n||".."===n)throw new le.ErrnoError(28);var o=le.mayCreate(i,n);if(o)throw new le.ErrnoError(o);if(!i.node_ops.mknod)throw new le.ErrnoError(63);return i.node_ops.mknod(i,n,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,le.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,le.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{le.mkdir(i,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>(void 0===r&&(r=t,t=438),t|=8192,le.mknod(e,t,r)),symlink:(e,t)=>{if(!ne.resolve(e))throw new le.ErrnoError(44);var r=le.lookupPath(t,{parent:!0}).node;if(!r)throw new le.ErrnoError(44);var i=ie.basename(t),n=le.mayCreate(r,i);if(n)throw new le.ErrnoError(n);if(!r.node_ops.symlink)throw new le.ErrnoError(63);return r.node_ops.symlink(r,i,e)},rename:(e,t)=>{var r,i,n=ie.dirname(e),o=ie.dirname(t),s=ie.basename(e),a=ie.basename(t);if(r=le.lookupPath(e,{parent:!0}).node,i=le.lookupPath(t,{parent:!0}).node,!r||!i)throw new le.ErrnoError(44);if(r.mount!==i.mount)throw new le.ErrnoError(75);var d,l=le.lookupNode(r,s),u=ne.relative(e,o);if("."!==u.charAt(0))throw new le.ErrnoError(28);if("."!==(u=ne.relative(t,n)).charAt(0))throw new le.ErrnoError(55);try{d=le.lookupNode(i,a)}catch(e){}if(l!==d){var c=le.isDir(l.mode),f=le.mayDelete(r,s,c);if(f)throw new le.ErrnoError(f);if(f=d?le.mayDelete(i,a,c):le.mayCreate(i,a))throw new le.ErrnoError(f);if(!r.node_ops.rename)throw new le.ErrnoError(63);if(le.isMountpoint(l)||d&&le.isMountpoint(d))throw new le.ErrnoError(10);if(i!==r&&(f=le.nodePermissions(r,"w")))throw new le.ErrnoError(f);le.hashRemoveNode(l);try{r.node_ops.rename(l,i,a)}catch(e){throw e}finally{le.hashAddNode(l)}}},rmdir:e=>{var t=le.lookupPath(e,{parent:!0}).node,r=ie.basename(e),i=le.lookupNode(t,r),n=le.mayDelete(t,r,!0);if(n)throw new le.ErrnoError(n);if(!t.node_ops.rmdir)throw new le.ErrnoError(63);if(le.isMountpoint(i))throw new le.ErrnoError(10);t.node_ops.rmdir(t,r),le.destroyNode(i)},readdir:e=>{var t=le.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new le.ErrnoError(54);return t.node_ops.readdir(t)},unlink:e=>{var t=le.lookupPath(e,{parent:!0}).node;if(!t)throw new le.ErrnoError(44);var r=ie.basename(e),i=le.lookupNode(t,r),n=le.mayDelete(t,r,!1);if(n)throw new le.ErrnoError(n);if(!t.node_ops.unlink)throw new le.ErrnoError(63);if(le.isMountpoint(i))throw new le.ErrnoError(10);t.node_ops.unlink(t,r),le.destroyNode(i)},readlink:e=>{var t=le.lookupPath(e).node;if(!t)throw new le.ErrnoError(44);if(!t.node_ops.readlink)throw new le.ErrnoError(28);return ne.resolve(le.getPath(t.parent),t.node_ops.readlink(t))},stat:(e,t)=>{var r=le.lookupPath(e,{follow:!t}).node;if(!r)throw new le.ErrnoError(44);if(!r.node_ops.getattr)throw new le.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>le.stat(e,!0),chmod:(e,t,r)=>{var i;if(!(i="string"==typeof e?le.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new le.ErrnoError(63);i.node_ops.setattr(i,{mode:4095&t|-4096&i.mode,timestamp:Date.now()})},lchmod:(e,t)=>{le.chmod(e,t,!0)},fchmod:(e,t)=>{var r=le.getStream(e);if(!r)throw new le.ErrnoError(8);le.chmod(r.node,t)},chown:(e,t,r,i)=>{var n;if(!(n="string"==typeof e?le.lookupPath(e,{follow:!i}).node:e).node_ops.setattr)throw new le.ErrnoError(63);n.node_ops.setattr(n,{timestamp:Date.now()})},lchown:(e,t,r)=>{le.chown(e,t,r,!0)},fchown:(e,t,r)=>{var i=le.getStream(e);if(!i)throw new le.ErrnoError(8);le.chown(i.node,t,r)},truncate:(e,t)=>{if(t<0)throw new le.ErrnoError(28);var r;if(!(r="string"==typeof e?le.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new le.ErrnoError(63);if(le.isDir(r.mode))throw new le.ErrnoError(31);if(!le.isFile(r.mode))throw new le.ErrnoError(28);var i=le.nodePermissions(r,"w");if(i)throw new le.ErrnoError(i);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:(e,t)=>{var r=le.getStream(e);if(!r)throw new le.ErrnoError(8);if(0==(2097155&r.flags))throw new le.ErrnoError(28);le.truncate(r.node,t)},utime:(e,t,r)=>{var i=le.lookupPath(e,{follow:!0}).node;i.node_ops.setattr(i,{timestamp:Math.max(t,r)})},open:(e,r,i)=>{if(""===e)throw new le.ErrnoError(44);var n;if(i=void 0===i?438:i,i=64&(r="string"==typeof r?le.modeStringToFlags(r):r)?4095&i|32768:0,"object"==typeof e)n=e;else{e=ie.normalize(e);try{n=le.lookupPath(e,{follow:!(131072&r)}).node}catch(e){}}var o=!1;if(64&r)if(n){if(128&r)throw new le.ErrnoError(20)}else n=le.mknod(e,i,0),o=!0;if(!n)throw new le.ErrnoError(44);if(le.isChrdev(n.mode)&&(r&=-513),65536&r&&!le.isDir(n.mode))throw new le.ErrnoError(54);if(!o){var s=le.mayOpen(n,r);if(s)throw new le.ErrnoError(s)}512&r&&!o&&le.truncate(n,0),r&=-131713;var a=le.createStream({node:n,path:le.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||(le.readFiles||(le.readFiles={}),e in le.readFiles||(le.readFiles[e]=1)),a},close:e=>{if(le.isClosed(e))throw new le.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{le.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek:(e,t,r)=>{if(le.isClosed(e))throw new le.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new le.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new le.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 le.ErrnoError(28);if(le.isClosed(e))throw new le.ErrnoError(8);if(1==(2097155&e.flags))throw new le.ErrnoError(8);if(le.isDir(e.node.mode))throw new le.ErrnoError(31);if(!e.stream_ops.read)throw new le.ErrnoError(28);var o=void 0!==n;if(o){if(!e.seekable)throw new le.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 le.ErrnoError(28);if(le.isClosed(e))throw new le.ErrnoError(8);if(0==(2097155&e.flags))throw new le.ErrnoError(8);if(le.isDir(e.node.mode))throw new le.ErrnoError(31);if(!e.stream_ops.write)throw new le.ErrnoError(28);e.seekable&&1024&e.flags&&le.llseek(e,0,2);var s=void 0!==n;if(s){if(!e.seekable)throw new le.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(le.isClosed(e))throw new le.ErrnoError(8);if(t<0||r<=0)throw new le.ErrnoError(28);if(0==(2097155&e.flags))throw new le.ErrnoError(8);if(!le.isFile(e.node.mode)&&!le.isDir(e.node.mode))throw new le.ErrnoError(43);if(!e.stream_ops.allocate)throw new le.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 le.ErrnoError(2);if(1==(2097155&e.flags))throw new le.ErrnoError(2);if(!e.stream_ops.mmap)throw new le.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 le.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=le.open(e,t.flags),n=le.stat(e).size,o=new Uint8Array(n);return le.read(i,o,0,n,0),"utf8"===t.encoding?r=I(o,0):"binary"===t.encoding&&(r=o),le.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=le.open(e,r.flags,r.mode);if("string"==typeof t){var n=new Uint8Array(R(t)+1),o=M(t,n,0,n.length);le.write(i,n,0,o,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");le.write(i,t,0,t.byteLength,void 0,r.canOwn)}le.close(i)},cwd:()=>le.currentPath,chdir:e=>{var t=le.lookupPath(e,{follow:!0});if(null===t.node)throw new le.ErrnoError(44);if(!le.isDir(t.node.mode))throw new le.ErrnoError(54);var r=le.nodePermissions(t.node,"x");if(r)throw new le.ErrnoError(r);le.currentPath=t.path},createDefaultDirectories:()=>{le.mkdir("/tmp"),le.mkdir("/home"),le.mkdir("/home/web_user")},createDefaultDevices:()=>{le.mkdir("/dev"),le.registerDevice(le.makedev(1,3),{read:()=>0,write:(e,t,r,i,n)=>i}),le.mkdev("/dev/null",le.makedev(1,3)),se.register(le.makedev(5,0),se.default_tty_ops),se.register(le.makedev(6,0),se.default_tty1_ops),le.mkdev("/dev/tty",le.makedev(5,0)),le.mkdev("/dev/tty1",le.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(p)try{var t=require("crypto");return()=>t.randomBytes(1)[0]}catch(e){}return()=>W("randomDevice")}();le.createDevice("/dev","random",e),le.createDevice("/dev","urandom",e),le.mkdir("/dev/shm"),le.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{le.mkdir("/proc");var e=le.mkdir("/proc/self");le.mkdir("/proc/self/fd"),le.mount({mount:()=>{var t=le.createNode(e,"fd",16895,73);return t.node_ops={lookup:(e,t)=>{var r=+t,i=le.getStream(r);if(!i)throw new le.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?le.createDevice("/dev","stdin",t.stdin):le.symlink("/dev/tty","/dev/stdin"),t.stdout?le.createDevice("/dev","stdout",null,t.stdout):le.symlink("/dev/tty","/dev/stdout"),t.stderr?le.createDevice("/dev","stderr",null,t.stderr):le.symlink("/dev/tty1","/dev/stderr"),le.open("/dev/stdin",0),le.open("/dev/stdout",1),le.open("/dev/stderr",1)},ensureErrnoError:()=>{le.ErrnoError||(le.ErrnoError=function(e,t){this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},le.ErrnoError.prototype=new Error,le.ErrnoError.prototype.constructor=le.ErrnoError,[44].forEach((e=>{le.genericErrors[e]=new le.ErrnoError(e),le.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:()=>{le.ensureErrnoError(),le.nameTable=new Array(4096),le.mount(de,{},"/"),le.createDefaultDirectories(),le.createDefaultDevices(),le.createSpecialDirectories(),le.filesystems={MEMFS:de}},init:(e,r,i)=>{le.init.initialized=!0,le.ensureErrnoError(),t.stdin=e||t.stdin,t.stdout=r||t.stdout,t.stderr=i||t.stderr,le.createStandardStreams()},quit:()=>{le.init.initialized=!1;for(var e=0;e<le.streams.length;e++){var t=le.streams[e];t&&le.close(t)}},getMode:(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},findObject:(e,t)=>{var r=le.analyzePath(e,t);return r.exists?r.object:null},analyzePath:(e,t)=>{try{e=(i=le.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=le.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=i.path,r.parentObject=i.node,r.name=ie.basename(e),i=le.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:le.getPath(e);for(var n=t.split("/").reverse();n.length;){var o=n.pop();if(o){var s=ie.join2(e,o);try{le.mkdir(s)}catch(e){}e=s}}return s},createFile:(e,t,r,i,n)=>{var o=ie.join2("string"==typeof e?e:le.getPath(e),t),s=le.getMode(i,n);return le.create(o,s)},createDataFile:(e,t,r,i,n,o)=>{var s=t;e&&(e="string"==typeof e?e:le.getPath(e),s=t?ie.join2(e,t):e);var a=le.getMode(i,n),d=le.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}le.chmod(d,146|a);var f=le.open(d,577);le.write(f,r,0,r.length,0,o),le.close(f),le.chmod(d,a)}return d},createDevice:(e,t,r,i)=>{var n=ie.join2("string"==typeof e?e:le.getPath(e),t),o=le.getMode(!!r,!!i);le.createDevice.major||(le.createDevice.major=64);var s=le.makedev(le.createDevice.major++,0);return le.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 le.ErrnoError(29)}if(void 0===d&&0===s)throw new le.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 le.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),s}}),le.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=oe(n(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new le.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||[]):oe(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,_("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(!h)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=le.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 le.forceLoadFile(d),t.apply(null,arguments)}})),l.read=(e,t,r,i,n)=>(le.forceLoadFile(d),u(e,t,r,i,n)),l.mmap=(e,t,r,i,n)=>{le.forceLoadFile(d);var o=ae(t);if(!o)throw new le.ErrnoError(48);return u(e,A,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?ne.resolve(ie.join2(e,t)):e;function f(r){function o(r){u&&u(),d||le.createDataFile(e,t,r,i,n,l),s&&s(),V()}Browser.handledByPreloadPlugin(r,c,o,(()=>{a&&a(),V()}))||o(r)}H(),"string"==typeof r?function(e,t,r,i){var n=i?"":"al "+e;o(e,(r=>{S(r,'Loading data file "'+e+'" failed (no arrayBuffer).'),t(new Uint8Array(r)),n&&V()}),(t=>{if(!r)throw'Loading data file "'+e+'" failed.';r()})),n&&H()}(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=le.indexedDB();try{var n=i.open(le.DB_NAME(),le.DB_VERSION)}catch(e){return r(e)}n.onupgradeneeded=()=>{_("creating db"),n.result.createObjectStore(le.DB_STORE_NAME)},n.onsuccess=()=>{var i=n.result.transaction([le.DB_STORE_NAME],"readwrite"),o=i.objectStore(le.DB_STORE_NAME),s=0,a=0,d=e.length;function l(){0==a?t():r()}e.forEach((e=>{var t=o.put(le.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=le.indexedDB();try{var n=i.open(le.DB_NAME(),le.DB_VERSION)}catch(e){return r(e)}n.onupgradeneeded=r,n.onsuccess=()=>{var i=n.result;try{var o=i.transaction([le.DB_STORE_NAME],"readonly")}catch(e){return void r(e)}var s=o.objectStore(le.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=()=>{le.analyzePath(e).exists&&le.unlink(e),le.createDataFile(ie.dirname(e),ie.basename(e),t.result,!0,!0,!0),++a+d==l&&u()},t.onerror=()=>{d++,a+d==l&&u()}})),o.onerror=r},n.onerror=r}},ue={DEFAULT_POLLMASK:5,calculateAt:function(e,t,r){if(ie.isAbs(t))return t;var i;if(-100===e)i=le.cwd();else{var n=le.getStream(e);if(!n)throw new le.ErrnoError(8);i=n.path}if(0==t.length){if(!r)throw new le.ErrnoError(44);return i}return ie.join2(i,t)},doStat:function(e,t,r){try{var i=e(t)}catch(e){if(e&&e.node&&ie.normalize(t)!==ie.normalize(le.getPath(e.node)))return-54;throw e}return B[r>>2]=i.dev,B[r+4>>2]=0,B[r+8>>2]=i.ino,B[r+12>>2]=i.mode,B[r+16>>2]=i.nlink,B[r+20>>2]=i.uid,B[r+24>>2]=i.gid,B[r+28>>2]=i.rdev,B[r+32>>2]=0,K=[i.size>>>0,(Y=i.size,+Math.abs(Y)>=1?Y>0?(0|Math.min(+Math.floor(Y/4294967296),4294967295))>>>0:~~+Math.ceil((Y-+(~~Y>>>0))/4294967296)>>>0:0)],B[r+40>>2]=K[0],B[r+44>>2]=K[1],B[r+48>>2]=4096,B[r+52>>2]=i.blocks,K=[Math.floor(i.atime.getTime()/1e3)>>>0,(Y=Math.floor(i.atime.getTime()/1e3),+Math.abs(Y)>=1?Y>0?(0|Math.min(+Math.floor(Y/4294967296),4294967295))>>>0:~~+Math.ceil((Y-+(~~Y>>>0))/4294967296)>>>0:0)],B[r+56>>2]=K[0],B[r+60>>2]=K[1],B[r+64>>2]=0,K=[Math.floor(i.mtime.getTime()/1e3)>>>0,(Y=Math.floor(i.mtime.getTime()/1e3),+Math.abs(Y)>=1?Y>0?(0|Math.min(+Math.floor(Y/4294967296),4294967295))>>>0:~~+Math.ceil((Y-+(~~Y>>>0))/4294967296)>>>0:0)],B[r+72>>2]=K[0],B[r+76>>2]=K[1],B[r+80>>2]=0,K=[Math.floor(i.ctime.getTime()/1e3)>>>0,(Y=Math.floor(i.ctime.getTime()/1e3),+Math.abs(Y)>=1?Y>0?(0|Math.min(+Math.floor(Y/4294967296),4294967295))>>>0:~~+Math.ceil((Y-+(~~Y>>>0))/4294967296)>>>0:0)],B[r+88>>2]=K[0],B[r+92>>2]=K[1],B[r+96>>2]=0,K=[i.ino>>>0,(Y=i.ino,+Math.abs(Y)>=1?Y>0?(0|Math.min(+Math.floor(Y/4294967296),4294967295))>>>0:~~+Math.ceil((Y-+(~~Y>>>0))/4294967296)>>>0:0)],B[r+104>>2]=K[0],B[r+108>>2]=K[1],0},doMsync:function(e,t,r,i,n){var o=U.slice(e,e+r);le.msync(t,o,n,r,i)},varargs:void 0,get:function(){return ue.varargs+=4,B[ue.varargs-4>>2]},getStr:function(e){return L(e)},getStreamFromFD:function(e){var t=le.getStream(e);if(!t)throw new le.ErrnoError(8);return t}};function ce(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)}}var fe=void 0;function he(e){for(var t="",r=e;U[r];)t+=fe[U[r++]];return t}var pe={},me={},_e={},ge=48,ye=57;function ve(e){if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=ge&&t<=ye?"_"+e:e}function be(e,t){return e=ve(e),new Function("body","return function "+e+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(t)}function we(e,t){var r=be(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 Se=void 0;function Ee(e){throw new Se(e)}var Ae=void 0;function Ue(e){throw new Ae(e)}function xe(e,t,r){function i(t){var i=r(t);i.length!==e.length&&Ue("Mismatched type converter count");for(var n=0;n<e.length;++n)Te(e[n],i[n])}e.forEach((function(e){_e[e]=t}));var n=new Array(t.length),o=[],s=0;t.forEach(((e,t)=>{me.hasOwnProperty(e)?n[t]=me[e]:(o.push(e),pe.hasOwnProperty(e)||(pe[e]=[]),pe[e].push((()=>{n[t]=me[e],++s===o.length&&i(n)})))})),0===o.length&&i(n)}function Te(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||Ee('type "'+i+'" must have a positive integer typeid pointer'),me.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;Ee("Cannot register type '"+i+"' twice")}if(me[e]=t,delete _e[e],pe.hasOwnProperty(e)){var n=pe[e];delete pe[e],n.forEach((e=>e()))}}function Be(e){if(!(this instanceof Xe))return!1;if(!(e instanceof Xe))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 ke(e){Ee(e.$$.ptrType.registeredClass.name+" instance already deleted")}var Ce=!1;function De(e){}function Pe(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 Fe(e,t,r){if(t===r)return e;if(void 0===r.baseClass)return null;var i=Fe(e,t,r.baseClass);return null===i?null:r.downcast(i)}var Ie={};function Le(){return Object.keys(Ge).length}function Me(){var e=[];for(var t in Ge)Ge.hasOwnProperty(t)&&e.push(Ge[t]);return e}var Re=[];function Ne(){for(;Re.length;){var e=Re.pop();e.$$.deleteScheduled=!1,e.delete()}}var ze=void 0;function Oe(e){ze=e,Re.length&&ze&&ze(Ne)}var Ge={};function $e(e,t){return t=function(e,t){for(void 0===t&&Ee("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t}(e,t),Ge[t]}function He(e,t){return t.ptrType&&t.ptr||Ue("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&Ue("Both smartPtrType and smartPtr must be specified"),t.count={value:1},We(Object.create(e,{$$:{value:t}}))}function Ve(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=$e(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?He(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):He(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var o,s=this.registeredClass.getActualType(t),a=Ie[s];if(!a)return n.call(this);o=this.isConst?a.constPointerType:a.pointerType;var d=Fe(t,this.registeredClass,o.registeredClass);return null===d?n.call(this):this.isSmartPointer?He(o.registeredClass.instancePrototype,{ptrType:o,ptr:d,smartPtrType:this,smartPtr:e}):He(o.registeredClass.instancePrototype,{ptrType:o,ptr:d})}function We(e){return"undefined"==typeof FinalizationRegistry?(We=e=>e,e):(Ce=new FinalizationRegistry((e=>{Pe(e.$$)})),We=e=>{var t=e.$$;if(t.smartPtr){var r={$$:t};Ce.register(e,r,e)}return e},De=e=>Ce.unregister(e),We(e))}function je(){if(this.$$.ptr||ke(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=We(Object.create(Object.getPrototypeOf(this),{$$:{value:(e=this.$$,{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType})}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t}function qe(){this.$$.ptr||ke(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Ee("Object already scheduled for deletion"),De(this),Pe(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function Ye(){return!this.$$.ptr}function Ke(){return this.$$.ptr||ke(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Ee("Object already scheduled for deletion"),Re.push(this),1===Re.length&&ze&&ze(Ne),this.$$.deleteScheduled=!0,this}function Xe(){}function Ze(e,t,r){if(void 0===e[t].overloadTable){var i=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||Ee("Function '"+r+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+e[t].overloadTable+")!"),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[i.argCount]=i}}function Je(e,t,r,i,n,o,s,a){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=i,this.baseClass=n,this.getActualType=o,this.upcast=s,this.downcast=a,this.pureVirtualFunctions=[]}function Qe(e,t,r){for(;t!==r;)t.upcast||Ee("Expected null or instance of "+r.name+", got an instance of "+t.name),e=t.upcast(e),t=t.baseClass;return e}function et(e,t){if(null===t)return this.isReference&&Ee("null is not a valid "+this.name),0;t.$$||Ee('Cannot pass "'+Ut(t)+'" as a '+this.name),t.$$.ptr||Ee("Cannot pass deleted object as a pointer of type "+this.name);var r=t.$$.ptrType.registeredClass;return Qe(t.$$.ptr,r,this.registeredClass)}function tt(e,t){var r;if(null===t)return this.isReference&&Ee("null is not a valid "+this.name),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t.$$||Ee('Cannot pass "'+Ut(t)+'" as a '+this.name),t.$$.ptr||Ee("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&t.$$.ptrType.isConst&&Ee("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);var i=t.$$.ptrType.registeredClass;if(r=Qe(t.$$.ptr,i,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&Ee("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:Ee("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var n=t.clone();r=this.rawShare(r,At.toHandle((function(){n.delete()}))),null!==e&&e.push(this.rawDestructor,r)}break;default:Ee("Unsupporting sharing policy")}return r}function rt(e,t){if(null===t)return this.isReference&&Ee("null is not a valid "+this.name),0;t.$$||Ee('Cannot pass "'+Ut(t)+'" as a '+this.name),t.$$.ptr||Ee("Cannot pass deleted object as a pointer of type "+this.name),t.$$.ptrType.isConst&&Ee("Cannot convert argument of type "+t.$$.ptrType.name+" to parameter type "+this.name);var r=t.$$.ptrType.registeredClass;return Qe(t.$$.ptr,r,this.registeredClass)}function it(e){return this.fromWireType(B[e>>2])}function nt(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e}function ot(e){this.rawDestructor&&this.rawDestructor(e)}function st(e){null!==e&&e.delete()}function at(e,t,r,i,n,o,s,a,d,l,u){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=i,this.isSmartPointer=n,this.pointeeType=o,this.sharingPolicy=s,this.rawGetPointee=a,this.rawConstructor=d,this.rawShare=l,this.rawDestructor=u,n||void 0!==t.baseClass?this.toWireType=tt:i?(this.toWireType=et,this.destructorFunction=null):(this.toWireType=rt,this.destructorFunction=null)}var dt=[];function lt(e){var t=dt[e];return t||(e>=dt.length&&(dt.length=e+1),dt[e]=t=P.get(e)),t}function ut(e,r,i){return e.includes("j")?function(e,r,i){var n=t["dynCall_"+e];return i&&i.length?n.apply(null,[r].concat(i)):n.call(null,r)}(e,r,i):lt(r).apply(null,i)}function ct(e,t){var r,i,n,o=(e=he(e)).includes("j")?(r=e,i=t,n=[],function(){return n.length=0,Object.assign(n,arguments),ut(r,i,n)}):lt(t);return"function"!=typeof o&&Ee("unknown function pointer with signature "+e+": "+t),o}var ft=void 0;function ht(e){var t=qt(e),r=he(t);return Vt(t),r}function pt(e,t){var r=[],i={};throw t.forEach((function e(t){i[t]||me[t]||(_e[t]?_e[t].forEach(e):(r.push(t),i[t]=!0))})),new ft(e+": "+r.map(ht).join([", "]))}function mt(e,t){for(var r=[],i=0;i<e;i++)r.push(k[t+4*i>>2]);return r}function _t(e){for(;e.length;){var t=e.pop();e.pop()(t)}}function gt(e,t){if(!(e instanceof Function))throw new TypeError("new_ called with constructor type "+typeof e+" which is not a function");var r=be(e.name||"unknownFunctionName",(function(){}));r.prototype=e.prototype;var i=new r,n=e.apply(i,t);return n instanceof Object?n:i}function yt(e,t,r,i,n){var o=t.length;o<2&&Ee("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var s=null!==t[1]&&null!==r,a=!1,d=1;d<t.length;++d)if(null!==t[d]&&void 0===t[d].destructorFunction){a=!0;break}var l="void"!==t[0].name,u="",c="";for(d=0;d<o-2;++d)u+=(0!==d?", ":"")+"arg"+d,c+=(0!==d?", ":"")+"arg"+d+"Wired";var f="return function "+ve(e)+"("+u+") {\nif (arguments.length !== "+(o-2)+") {\nthrowBindingError('function "+e+" called with ' + arguments.length + ' arguments, expected "+(o-2)+" args!');\n}\n";a&&(f+="var destructors = [];\n");var h=a?"destructors":"null",p=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],m=[Ee,i,n,_t,t[0],t[1]];for(s&&(f+="var thisWired = classParam.toWireType("+h+", this);\n"),d=0;d<o-2;++d)f+="var arg"+d+"Wired = argType"+d+".toWireType("+h+", arg"+d+"); // "+t[d+2].name+"\n",p.push("argType"+d),m.push(t[d+2]);if(s&&(c="thisWired"+(c.length>0?", ":"")+c),f+=(l?"var rv = ":"")+"invoker(fn"+(c.length>0?", ":"")+c+");\n",a)f+="runDestructors(destructors);\n";else for(d=s?1:2;d<t.length;++d){var _=1===d?"thisWired":"arg"+(d-2)+"Wired";null!==t[d].destructorFunction&&(f+=_+"_dtor("+_+"); // "+t[d].name+"\n",p.push(_+"_dtor"),