UNPKG

ofd_parser_dev.js

Version:
1 lines 75.4 kB
!function(r,e){var n;n="undefined"!=typeof __webpack_public_path__||"undefined"!=typeof __webpack_public_path__?"undefined"!=typeof __non_webpack_require__?__non_webpack_require__:void 0:"undefined"!=typeof require?require:void 0;var t=r&&r.process,o="OfdParser";"object"==typeof exports&&"object"==typeof module?module.exports=e(n,t):"function"==typeof define&&define.amd?define([],(function(){return e(n,t)})):"object"==typeof exports?exports[o]=e(n,t):r[o]=e(n,t)}(function(r){if("undefined"!=typeof globalThis)return globalThis;var e=function(){return this}();if(!e&&function(){var r;try{r=new Function}catch(r){return!1}return"function"==typeof r}()&&(e=new Function("return this")()),!e){if("undefined"==typeof __webpack_public_path__&&"undefined"!=typeof global)return global;if("undefined"!=typeof window)return window;if("undefined"!=typeof self)return self}return e||r}(this),(function(r,e,n){var t="";try{t=document.currentScript.src}catch(r){}function o(o){o=void 0!==o?o:{};var i,a={};for(i in o)o.hasOwnProperty(i)&&(a[i]=o[i]);var u,s,c,f,l,d=[],p="./this.program",m=function(r,e){throw e},h="object"==typeof window,v="function"==typeof importScripts,y="object"==typeof e&&"object"==typeof e.versions&&"string"==typeof e.versions.node,g="";y?(g=v?r("path").dirname(g)+"/":__dirname+"/",u=function(e,n){return f||(f=r("fs")),l||(l=r("path")),e=l.normalize(e),f.readFileSync(e,n?null:"utf8")},c=function(r){var e=u(r,!0);return e.buffer||(e=new Uint8Array(e)),S(e.buffer),e},s=function(e,n,t){f||(f=r("fs")),l||(l=r("path")),e=l.normalize(e),f.readFile(e,(function(r,e){r?t(r):n(e.buffer)}))},e.argv.length>1&&(p=e.argv[1].replace(/\\/g,"/")),d=e.argv.slice(2),void 0!==n&&(n.exports=o),e.on("uncaughtException",(function(r){if(!(r instanceof Ne))throw r})),e.on("unhandledRejection",(function(r){throw r})),m=function(r,n){if(er())throw e.exitCode=r,n;var t;(t=n)instanceof Ne||_("exiting due to exception: "+t),e.exit(r)},o.inspect=function(){return"[Emscripten Module object]"}):(h||v)&&(g=0!==(g=v?self.location.href:t).indexOf("blob:")?g.substr(0,g.replace(/[?#].*/,"").lastIndexOf("/")+1):"",u=function(r){var e=new XMLHttpRequest;return e.open("GET",r,!1),e.send(null),e.responseText},v&&(c=function(r){var e=new XMLHttpRequest;return e.open("GET",r,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),s=function(r,e,n){var t=new XMLHttpRequest;t.open("GET",r,!0),t.responseType="arraybuffer",t.onload=function(){200==t.status||0==t.status&&t.response?e(t.response):n()},t.onerror=n,t.send(null)});var w=o.print||console.log.bind(console),_=o.printErr||console.warn.bind(console);for(i in a)a.hasOwnProperty(i)&&(o[i]=a[i]);a=null,o.arguments&&(d=o.arguments),o.thisProgram&&(p=o.thisProgram),o.quit&&(m=o.quit);var E,b=0;o.wasmBinary&&(E=o.wasmBinary);var k,F=o.noExitRuntime||!0;"object"!=typeof WebAssembly&&ur("no native wasm support detected");var T=!1;function S(r,e){r||ur("Assertion failed: "+e)}var D="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function A(r,e,n){for(var t=e+n,o=e;r[o]&&!(o>=t);)++o;if(o-e>16&&r.subarray&&D)return D.decode(r.subarray(e,o));for(var i="";e<o;){var a=r[e++];if(128&a){var u=63&r[e++];if(192!=(224&a)){var s=63&r[e++];if((a=224==(240&a)?(15&a)<<12|u<<6|s:(7&a)<<18|u<<12|s<<6|63&r[e++])<65536)i+=String.fromCharCode(a);else{var c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|u)}else i+=String.fromCharCode(a)}return i}function C(r,e){return r?A(x,r,e):""}function P(r,e,n,t){if(!(t>0))return 0;for(var o=n,i=n+t-1,a=0;a<r.length;++a){var u=r.charCodeAt(a);if(u>=55296&&u<=57343)u=65536+((1023&u)<<10)|1023&r.charCodeAt(++a);if(u<=127){if(n>=i)break;e[n++]=u}else if(u<=2047){if(n+1>=i)break;e[n++]=192|u>>6,e[n++]=128|63&u}else if(u<=65535){if(n+2>=i)break;e[n++]=224|u>>12,e[n++]=128|u>>6&63,e[n++]=128|63&u}else{if(n+3>=i)break;e[n++]=240|u>>18,e[n++]=128|u>>12&63,e[n++]=128|u>>6&63,e[n++]=128|63&u}}return e[n]=0,n-o}function M(r,e,n){return P(r,x,e,n)}function j(r){for(var e=0,n=0;n<r.length;++n){var t=r.charCodeAt(n);t>=55296&&t<=57343&&(t=65536+((1023&t)<<10)|1023&r.charCodeAt(++n)),t<=127?++e:e+=t<=2047?2:t<=65535?3:4}return e}var R,O,x,z,B,I,N,W,L,U="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function G(r,e){for(var n=r,t=n>>1,o=t+e/2;!(t>=o)&&B[t];)++t;if((n=t<<1)-r>32&&U)return U.decode(x.subarray(r,n));for(var i="",a=0;!(a>=e/2);++a){var u=z[r+2*a>>1];if(0==u)break;i+=String.fromCharCode(u)}return i}function H(r,e,n){if(void 0===n&&(n=2147483647),n<2)return 0;for(var t=e,o=(n-=2)<2*r.length?n/2:r.length,i=0;i<o;++i){var a=r.charCodeAt(i);z[e>>1]=a,e+=2}return z[e>>1]=0,e-t}function Y(r){return 2*r.length}function q(r,e){for(var n=0,t="";!(n>=e/4);){var o=I[r+4*n>>2];if(0==o)break;if(++n,o>=65536){var i=o-65536;t+=String.fromCharCode(55296|i>>10,56320|1023&i)}else t+=String.fromCharCode(o)}return t}function V(r,e,n){if(void 0===n&&(n=2147483647),n<4)return 0;for(var t=e,o=t+n-4,i=0;i<r.length;++i){var a=r.charCodeAt(i);if(a>=55296&&a<=57343)a=65536+((1023&a)<<10)|1023&r.charCodeAt(++i);if(I[e>>2]=a,(e+=4)+4>o)break}return I[e>>2]=0,e-t}function X(r){for(var e=0,n=0;n<r.length;++n){var t=r.charCodeAt(n);t>=55296&&t<=57343&&++n,e+=4}return e}function K(r){var e=j(r)+1,n=Ae(e);return n&&P(r,O,n,e),n}function $(r){R=r,o.HEAP8=O=new Int8Array(r),o.HEAP16=z=new Int16Array(r),o.HEAP32=I=new Int32Array(r),o.HEAPU8=x=new Uint8Array(r),o.HEAPU16=B=new Uint16Array(r),o.HEAPU32=N=new Uint32Array(r),o.HEAPF32=W=new Float32Array(r),o.HEAPF64=L=new Float64Array(r)}o.INITIAL_MEMORY;var J,Z=[],Q=[],rr=[];function er(){return F||!1}var nr=0,tr=null,or=null;function ir(r){nr++,o.monitorRunDependencies&&o.monitorRunDependencies(nr)}function ar(r){if(nr--,o.monitorRunDependencies&&o.monitorRunDependencies(nr),0==nr&&(null!==tr&&(clearInterval(tr),tr=null),or)){var e=or;or=null,e()}}function ur(r){throw o.onAbort&&o.onAbort(r),_(r="Aborted("+r+")"),T=!0,1,r+=". Build with -s ASSERTIONS=1 for more info.",new WebAssembly.RuntimeError(r)}o.preloadedImages={},o.preloadedAudios={};var sr,cr,fr,lr;function dr(r){return r.startsWith("data:application/octet-stream;base64,")}function pr(r){return r.startsWith("file://")}function mr(r){try{if(r==sr&&E)return new Uint8Array(E);if(c)return c(r);throw"both async and sync fetching of the wasm failed"}catch(r){ur(r)}}function hr(r){for(;r.length>0;){var e=r.shift();if("function"!=typeof e){var n=e.func;"number"==typeof n?void 0===e.arg?yr(n)():yr(n)(e.arg):n(void 0===e.arg?null:e.arg)}else e(o)}}dr(sr="OfdParser.wasm")||(cr=sr,sr=o.locateFile?o.locateFile(cr,g):g+cr);var vr=[];function yr(r){var e=vr[r];return e||(r>=vr.length&&(vr.length=r+1),vr[r]=e=J.get(r)),e}function gr(r){this.excPtr=r,this.ptr=r-16,this.set_type=function(r){I[this.ptr+4>>2]=r},this.get_type=function(){return I[this.ptr+4>>2]},this.set_destructor=function(r){I[this.ptr+8>>2]=r},this.get_destructor=function(){return I[this.ptr+8>>2]},this.set_refcount=function(r){I[this.ptr>>2]=r},this.set_caught=function(r){r=r?1:0,O[this.ptr+12>>0]=r},this.get_caught=function(){return 0!=O[this.ptr+12>>0]},this.set_rethrown=function(r){r=r?1:0,O[this.ptr+13>>0]=r},this.get_rethrown=function(){return 0!=O[this.ptr+13>>0]},this.init=function(r,e){this.set_type(r),this.set_destructor(e),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var r=I[this.ptr>>2];I[this.ptr>>2]=r+1},this.release_ref=function(){var r=I[this.ptr>>2];return I[this.ptr>>2]=r-1,1===r}}function wr(r){return I[Pe()>>2]=r,r}var _r={splitPath:function(r){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(r).slice(1)},normalizeArray:function(r,e){for(var n=0,t=r.length-1;t>=0;t--){var o=r[t];"."===o?r.splice(t,1):".."===o?(r.splice(t,1),n++):n&&(r.splice(t,1),n--)}if(e)for(;n;n--)r.unshift("..");return r},normalize:function(r){var e="/"===r.charAt(0),n="/"===r.substr(-1);return(r=_r.normalizeArray(r.split("/").filter((function(r){return!!r})),!e).join("/"))||e||(r="."),r&&n&&(r+="/"),(e?"/":"")+r},dirname:function(r){var e=_r.splitPath(r),n=e[0],t=e[1];return n||t?(t&&(t=t.substr(0,t.length-1)),n+t):"."},basename:function(r){if("/"===r)return"/";var e=(r=(r=_r.normalize(r)).replace(/\/$/,"")).lastIndexOf("/");return-1===e?r:r.substr(e+1)},extname:function(r){return _r.splitPath(r)[3]},join:function(){var r=Array.prototype.slice.call(arguments,0);return _r.normalize(r.join("/"))},join2:function(r,e){return _r.normalize(r+"/"+e)}};var Er={resolve:function(){for(var r="",e=!1,n=arguments.length-1;n>=-1&&!e;n--){var t=n>=0?arguments[n]:Tr.cwd();if("string"!=typeof t)throw new TypeError("Arguments to path.resolve must be strings");if(!t)return"";r=t+"/"+r,e="/"===t.charAt(0)}return(e?"/":"")+(r=_r.normalizeArray(r.split("/").filter((function(r){return!!r})),!e).join("/"))||"."},relative:function(r,e){function n(r){for(var e=0;e<r.length&&""===r[e];e++);for(var n=r.length-1;n>=0&&""===r[n];n--);return e>n?[]:r.slice(e,n-e+1)}r=Er.resolve(r).substr(1),e=Er.resolve(e).substr(1);for(var t=n(r.split("/")),o=n(e.split("/")),i=Math.min(t.length,o.length),a=i,u=0;u<i;u++)if(t[u]!==o[u]){a=u;break}var s=[];for(u=a;u<t.length;u++)s.push("..");return(s=s.concat(o.slice(a))).join("/")}},br={ttys:[],init:function(){},shutdown:function(){},register:function(r,e){br.ttys[r]={input:[],output:[],ops:e},Tr.registerDevice(r,br.stream_ops)},stream_ops:{open:function(r){var e=br.ttys[r.node.rdev];if(!e)throw new Tr.ErrnoError(43);r.tty=e,r.seekable=!1},close:function(r){r.tty.ops.flush(r.tty)},flush:function(r){r.tty.ops.flush(r.tty)},read:function(r,e,n,t,o){if(!r.tty||!r.tty.ops.get_char)throw new Tr.ErrnoError(60);for(var i=0,a=0;a<t;a++){var u;try{u=r.tty.ops.get_char(r.tty)}catch(r){throw new Tr.ErrnoError(29)}if(void 0===u&&0===i)throw new Tr.ErrnoError(6);if(null==u)break;i++,e[n+a]=u}return i&&(r.node.timestamp=Date.now()),i},write:function(r,e,n,t,o){if(!r.tty||!r.tty.ops.put_char)throw new Tr.ErrnoError(60);try{for(var i=0;i<t;i++)r.tty.ops.put_char(r.tty,e[n+i])}catch(r){throw new Tr.ErrnoError(29)}return t&&(r.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(r){if(!r.input.length){var n=null;if(y){var t=Buffer.alloc(256),o=0;try{o=f.readSync(e.stdin.fd,t,0,256,null)}catch(r){if(!r.toString().includes("EOF"))throw r;o=0}n=o>0?t.slice(0,o).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(n=window.prompt("Input: "))&&(n+="\n"):"function"==typeof readline&&null!==(n=readline())&&(n+="\n");if(!n)return null;r.input=Te(n,!0)}return r.input.shift()},put_char:function(r,e){null===e||10===e?(w(A(r.output,0)),r.output=[]):0!=e&&r.output.push(e)},flush:function(r){r.output&&r.output.length>0&&(w(A(r.output,0)),r.output=[])}},default_tty1_ops:{put_char:function(r,e){null===e||10===e?(_(A(r.output,0)),r.output=[]):0!=e&&r.output.push(e)},flush:function(r){r.output&&r.output.length>0&&(_(A(r.output,0)),r.output=[])}}};function kr(r){r=function(r,e){return Math.ceil(r/e)*e}(r,65536);var e=Ie(65536,r);return e?(function(r,e){x.fill(0,r,r+e)}(e,r),e):0}var Fr={ops_table:null,mount:function(r){return Fr.createNode(null,"/",16895,0)},createNode:function(r,e,n,t){if(Tr.isBlkdev(n)||Tr.isFIFO(n))throw new Tr.ErrnoError(63);Fr.ops_table||(Fr.ops_table={dir:{node:{getattr:Fr.node_ops.getattr,setattr:Fr.node_ops.setattr,lookup:Fr.node_ops.lookup,mknod:Fr.node_ops.mknod,rename:Fr.node_ops.rename,unlink:Fr.node_ops.unlink,rmdir:Fr.node_ops.rmdir,readdir:Fr.node_ops.readdir,symlink:Fr.node_ops.symlink},stream:{llseek:Fr.stream_ops.llseek}},file:{node:{getattr:Fr.node_ops.getattr,setattr:Fr.node_ops.setattr},stream:{llseek:Fr.stream_ops.llseek,read:Fr.stream_ops.read,write:Fr.stream_ops.write,allocate:Fr.stream_ops.allocate,mmap:Fr.stream_ops.mmap,msync:Fr.stream_ops.msync}},link:{node:{getattr:Fr.node_ops.getattr,setattr:Fr.node_ops.setattr,readlink:Fr.node_ops.readlink},stream:{}},chrdev:{node:{getattr:Fr.node_ops.getattr,setattr:Fr.node_ops.setattr},stream:Tr.chrdev_stream_ops}});var o=Tr.createNode(r,e,n,t);return Tr.isDir(o.mode)?(o.node_ops=Fr.ops_table.dir.node,o.stream_ops=Fr.ops_table.dir.stream,o.contents={}):Tr.isFile(o.mode)?(o.node_ops=Fr.ops_table.file.node,o.stream_ops=Fr.ops_table.file.stream,o.usedBytes=0,o.contents=null):Tr.isLink(o.mode)?(o.node_ops=Fr.ops_table.link.node,o.stream_ops=Fr.ops_table.link.stream):Tr.isChrdev(o.mode)&&(o.node_ops=Fr.ops_table.chrdev.node,o.stream_ops=Fr.ops_table.chrdev.stream),o.timestamp=Date.now(),r&&(r.contents[e]=o,r.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(r){return r.contents?r.contents.subarray?r.contents.subarray(0,r.usedBytes):new Uint8Array(r.contents):new Uint8Array(0)},expandFileStorage:function(r,e){var n=r.contents?r.contents.length:0;if(!(n>=e)){e=Math.max(e,n*(n<1048576?2:1.125)>>>0),0!=n&&(e=Math.max(e,256));var t=r.contents;r.contents=new Uint8Array(e),r.usedBytes>0&&r.contents.set(t.subarray(0,r.usedBytes),0)}},resizeFileStorage:function(r,e){if(r.usedBytes!=e)if(0==e)r.contents=null,r.usedBytes=0;else{var n=r.contents;r.contents=new Uint8Array(e),n&&r.contents.set(n.subarray(0,Math.min(e,r.usedBytes))),r.usedBytes=e}},node_ops:{getattr:function(r){var e={};return e.dev=Tr.isChrdev(r.mode)?r.id:1,e.ino=r.id,e.mode=r.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=r.rdev,Tr.isDir(r.mode)?e.size=4096:Tr.isFile(r.mode)?e.size=r.usedBytes:Tr.isLink(r.mode)?e.size=r.link.length:e.size=0,e.atime=new Date(r.timestamp),e.mtime=new Date(r.timestamp),e.ctime=new Date(r.timestamp),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr:function(r,e){void 0!==e.mode&&(r.mode=e.mode),void 0!==e.timestamp&&(r.timestamp=e.timestamp),void 0!==e.size&&Fr.resizeFileStorage(r,e.size)},lookup:function(r,e){throw Tr.genericErrors[44]},mknod:function(r,e,n,t){return Fr.createNode(r,e,n,t)},rename:function(r,e,n){if(Tr.isDir(r.mode)){var t;try{t=Tr.lookupNode(e,n)}catch(r){}if(t)for(var o in t.contents)throw new Tr.ErrnoError(55)}delete r.parent.contents[r.name],r.parent.timestamp=Date.now(),r.name=n,e.contents[n]=r,e.timestamp=r.parent.timestamp,r.parent=e},unlink:function(r,e){delete r.contents[e],r.timestamp=Date.now()},rmdir:function(r,e){var n=Tr.lookupNode(r,e);for(var t in n.contents)throw new Tr.ErrnoError(55);delete r.contents[e],r.timestamp=Date.now()},readdir:function(r){var e=[".",".."];for(var n in r.contents)r.contents.hasOwnProperty(n)&&e.push(n);return e},symlink:function(r,e,n){var t=Fr.createNode(r,e,41471,0);return t.link=n,t},readlink:function(r){if(!Tr.isLink(r.mode))throw new Tr.ErrnoError(28);return r.link}},stream_ops:{read:function(r,e,n,t,o){var i=r.node.contents;if(o>=r.node.usedBytes)return 0;var a=Math.min(r.node.usedBytes-o,t);if(a>8&&i.subarray)e.set(i.subarray(o,o+a),n);else for(var u=0;u<a;u++)e[n+u]=i[o+u];return a},write:function(r,e,n,t,o,i){if(e.buffer===O.buffer&&(i=!1),!t)return 0;var a=r.node;if(a.timestamp=Date.now(),e.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=e.subarray(n,n+t),a.usedBytes=t,t;if(0===a.usedBytes&&0===o)return a.contents=e.slice(n,n+t),a.usedBytes=t,t;if(o+t<=a.usedBytes)return a.contents.set(e.subarray(n,n+t),o),t}if(Fr.expandFileStorage(a,o+t),a.contents.subarray&&e.subarray)a.contents.set(e.subarray(n,n+t),o);else for(var u=0;u<t;u++)a.contents[o+u]=e[n+u];return a.usedBytes=Math.max(a.usedBytes,o+t),t},llseek:function(r,e,n){var t=e;if(1===n?t+=r.position:2===n&&Tr.isFile(r.node.mode)&&(t+=r.node.usedBytes),t<0)throw new Tr.ErrnoError(28);return t},allocate:function(r,e,n){Fr.expandFileStorage(r.node,e+n),r.node.usedBytes=Math.max(r.node.usedBytes,e+n)},mmap:function(r,e,n,t,o,i){if(0!==e)throw new Tr.ErrnoError(28);if(!Tr.isFile(r.node.mode))throw new Tr.ErrnoError(43);var a,u,s=r.node.contents;if(2&i||s.buffer!==R){if((t>0||t+n<s.length)&&(s=s.subarray?s.subarray(t,t+n):Array.prototype.slice.call(s,t,t+n)),u=!0,!(a=kr(n)))throw new Tr.ErrnoError(48);O.set(s,a)}else u=!1,a=s.byteOffset;return{ptr:a,allocated:u}},msync:function(r,e,n,t,o){if(!Tr.isFile(r.node.mode))throw new Tr.ErrnoError(43);if(2&o)return 0;Fr.stream_ops.write(r,e,0,t,n,!1);return 0}}};var Tr={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:function(r,e){if(e=e||{},!(r=Er.resolve(Tr.cwd(),r)))return{path:"",node:null};var n={follow_mount:!0,recurse_count:0};for(var t in n)void 0===e[t]&&(e[t]=n[t]);if(e.recurse_count>8)throw new Tr.ErrnoError(32);for(var o=_r.normalizeArray(r.split("/").filter((function(r){return!!r})),!1),i=Tr.root,a="/",u=0;u<o.length;u++){var s=u===o.length-1;if(s&&e.parent)break;if(i=Tr.lookupNode(i,o[u]),a=_r.join2(a,o[u]),Tr.isMountpoint(i)&&(!s||s&&e.follow_mount)&&(i=i.mounted.root),!s||e.follow)for(var c=0;Tr.isLink(i.mode);){var f=Tr.readlink(a);if(a=Er.resolve(_r.dirname(a),f),i=Tr.lookupPath(a,{recurse_count:e.recurse_count}).node,c++>40)throw new Tr.ErrnoError(32)}}return{path:a,node:i}},getPath:function(r){for(var e;;){if(Tr.isRoot(r)){var n=r.mount.mountpoint;return e?"/"!==n[n.length-1]?n+"/"+e:n+e:n}e=e?r.name+"/"+e:r.name,r=r.parent}},hashName:function(r,e){for(var n=0,t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t)|0;return(r+n>>>0)%Tr.nameTable.length},hashAddNode:function(r){var e=Tr.hashName(r.parent.id,r.name);r.name_next=Tr.nameTable[e],Tr.nameTable[e]=r},hashRemoveNode:function(r){var e=Tr.hashName(r.parent.id,r.name);if(Tr.nameTable[e]===r)Tr.nameTable[e]=r.name_next;else for(var n=Tr.nameTable[e];n;){if(n.name_next===r){n.name_next=r.name_next;break}n=n.name_next}},lookupNode:function(r,e){var n=Tr.mayLookup(r);if(n)throw new Tr.ErrnoError(n,r);for(var t=Tr.hashName(r.id,e),o=Tr.nameTable[t];o;o=o.name_next){var i=o.name;if(o.parent.id===r.id&&i===e)return o}return Tr.lookup(r,e)},createNode:function(r,e,n,t){var o=new Tr.FSNode(r,e,n,t);return Tr.hashAddNode(o),o},destroyNode:function(r){Tr.hashRemoveNode(r)},isRoot:function(r){return r===r.parent},isMountpoint:function(r){return!!r.mounted},isFile:function(r){return 32768==(61440&r)},isDir:function(r){return 16384==(61440&r)},isLink:function(r){return 40960==(61440&r)},isChrdev:function(r){return 8192==(61440&r)},isBlkdev:function(r){return 24576==(61440&r)},isFIFO:function(r){return 4096==(61440&r)},isSocket:function(r){return 49152==(49152&r)},flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:function(r){var e=Tr.flagModes[r];if(void 0===e)throw new Error("Unknown file open mode: "+r);return e},flagsToPermissionString:function(r){var e=["r","w","rw"][3&r];return 512&r&&(e+="w"),e},nodePermissions:function(r,e){return Tr.ignorePermissions||(!e.includes("r")||292&r.mode)&&(!e.includes("w")||146&r.mode)&&(!e.includes("x")||73&r.mode)?0:2},mayLookup:function(r){var e=Tr.nodePermissions(r,"x");return e||(r.node_ops.lookup?0:2)},mayCreate:function(r,e){try{Tr.lookupNode(r,e);return 20}catch(r){}return Tr.nodePermissions(r,"wx")},mayDelete:function(r,e,n){var t;try{t=Tr.lookupNode(r,e)}catch(r){return r.errno}var o=Tr.nodePermissions(r,"wx");if(o)return o;if(n){if(!Tr.isDir(t.mode))return 54;if(Tr.isRoot(t)||Tr.getPath(t)===Tr.cwd())return 10}else if(Tr.isDir(t.mode))return 31;return 0},mayOpen:function(r,e){return r?Tr.isLink(r.mode)?32:Tr.isDir(r.mode)&&("r"!==Tr.flagsToPermissionString(e)||512&e)?31:Tr.nodePermissions(r,Tr.flagsToPermissionString(e)):44},MAX_OPEN_FDS:4096,nextfd:function(r,e){r=r||0,e=e||Tr.MAX_OPEN_FDS;for(var n=r;n<=e;n++)if(!Tr.streams[n])return n;throw new Tr.ErrnoError(33)},getStream:function(r){return Tr.streams[r]},createStream:function(r,e,n){Tr.FSStream||(Tr.FSStream=function(){},Tr.FSStream.prototype={object:{get:function(){return this.node},set:function(r){this.node=r}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}});var t=new Tr.FSStream;for(var o in r)t[o]=r[o];r=t;var i=Tr.nextfd(e,n);return r.fd=i,Tr.streams[i]=r,r},closeStream:function(r){Tr.streams[r]=null},chrdev_stream_ops:{open:function(r){var e=Tr.getDevice(r.node.rdev);r.stream_ops=e.stream_ops,r.stream_ops.open&&r.stream_ops.open(r)},llseek:function(){throw new Tr.ErrnoError(70)}},major:function(r){return r>>8},minor:function(r){return 255&r},makedev:function(r,e){return r<<8|e},registerDevice:function(r,e){Tr.devices[r]={stream_ops:e}},getDevice:function(r){return Tr.devices[r]},getMounts:function(r){for(var e=[],n=[r];n.length;){var t=n.pop();e.push(t),n.push.apply(n,t.mounts)}return e},syncfs:function(r,e){"function"==typeof r&&(e=r,r=!1),Tr.syncFSRequests++,Tr.syncFSRequests>1&&_("warning: "+Tr.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var n=Tr.getMounts(Tr.root.mount),t=0;function o(r){return Tr.syncFSRequests--,e(r)}function i(r){if(r)return i.errored?void 0:(i.errored=!0,o(r));++t>=n.length&&o(null)}n.forEach((function(e){if(!e.type.syncfs)return i(null);e.type.syncfs(e,r,i)}))},mount:function(r,e,n){var t,o="/"===n,i=!n;if(o&&Tr.root)throw new Tr.ErrnoError(10);if(!o&&!i){var a=Tr.lookupPath(n,{follow_mount:!1});if(n=a.path,t=a.node,Tr.isMountpoint(t))throw new Tr.ErrnoError(10);if(!Tr.isDir(t.mode))throw new Tr.ErrnoError(54)}var u={type:r,opts:e,mountpoint:n,mounts:[]},s=r.mount(u);return s.mount=u,u.root=s,o?Tr.root=s:t&&(t.mounted=u,t.mount&&t.mount.mounts.push(u)),s},unmount:function(r){var e=Tr.lookupPath(r,{follow_mount:!1});if(!Tr.isMountpoint(e.node))throw new Tr.ErrnoError(28);var n=e.node,t=n.mounted,o=Tr.getMounts(t);Object.keys(Tr.nameTable).forEach((function(r){for(var e=Tr.nameTable[r];e;){var n=e.name_next;o.includes(e.mount)&&Tr.destroyNode(e),e=n}})),n.mounted=null;var i=n.mount.mounts.indexOf(t);n.mount.mounts.splice(i,1)},lookup:function(r,e){return r.node_ops.lookup(r,e)},mknod:function(r,e,n){var t=Tr.lookupPath(r,{parent:!0}).node,o=_r.basename(r);if(!o||"."===o||".."===o)throw new Tr.ErrnoError(28);var i=Tr.mayCreate(t,o);if(i)throw new Tr.ErrnoError(i);if(!t.node_ops.mknod)throw new Tr.ErrnoError(63);return t.node_ops.mknod(t,o,e,n)},create:function(r,e){return e=void 0!==e?e:438,e&=4095,e|=32768,Tr.mknod(r,e,0)},mkdir:function(r,e){return e=void 0!==e?e:511,e&=1023,e|=16384,Tr.mknod(r,e,0)},mkdirTree:function(r,e){for(var n=r.split("/"),t="",o=0;o<n.length;++o)if(n[o]){t+="/"+n[o];try{Tr.mkdir(t,e)}catch(r){if(20!=r.errno)throw r}}},mkdev:function(r,e,n){return void 0===n&&(n=e,e=438),e|=8192,Tr.mknod(r,e,n)},symlink:function(r,e){if(!Er.resolve(r))throw new Tr.ErrnoError(44);var n=Tr.lookupPath(e,{parent:!0}).node;if(!n)throw new Tr.ErrnoError(44);var t=_r.basename(e),o=Tr.mayCreate(n,t);if(o)throw new Tr.ErrnoError(o);if(!n.node_ops.symlink)throw new Tr.ErrnoError(63);return n.node_ops.symlink(n,t,r)},rename:function(r,e){var n,t,o=_r.dirname(r),i=_r.dirname(e),a=_r.basename(r),u=_r.basename(e);if(n=Tr.lookupPath(r,{parent:!0}).node,t=Tr.lookupPath(e,{parent:!0}).node,!n||!t)throw new Tr.ErrnoError(44);if(n.mount!==t.mount)throw new Tr.ErrnoError(75);var s,c=Tr.lookupNode(n,a),f=Er.relative(r,i);if("."!==f.charAt(0))throw new Tr.ErrnoError(28);if("."!==(f=Er.relative(e,o)).charAt(0))throw new Tr.ErrnoError(55);try{s=Tr.lookupNode(t,u)}catch(r){}if(c!==s){var l=Tr.isDir(c.mode),d=Tr.mayDelete(n,a,l);if(d)throw new Tr.ErrnoError(d);if(d=s?Tr.mayDelete(t,u,l):Tr.mayCreate(t,u))throw new Tr.ErrnoError(d);if(!n.node_ops.rename)throw new Tr.ErrnoError(63);if(Tr.isMountpoint(c)||s&&Tr.isMountpoint(s))throw new Tr.ErrnoError(10);if(t!==n&&(d=Tr.nodePermissions(n,"w")))throw new Tr.ErrnoError(d);Tr.hashRemoveNode(c);try{n.node_ops.rename(c,t,u)}catch(r){throw r}finally{Tr.hashAddNode(c)}}},rmdir:function(r){var e=Tr.lookupPath(r,{parent:!0}).node,n=_r.basename(r),t=Tr.lookupNode(e,n),o=Tr.mayDelete(e,n,!0);if(o)throw new Tr.ErrnoError(o);if(!e.node_ops.rmdir)throw new Tr.ErrnoError(63);if(Tr.isMountpoint(t))throw new Tr.ErrnoError(10);e.node_ops.rmdir(e,n),Tr.destroyNode(t)},readdir:function(r){var e=Tr.lookupPath(r,{follow:!0}).node;if(!e.node_ops.readdir)throw new Tr.ErrnoError(54);return e.node_ops.readdir(e)},unlink:function(r){var e=Tr.lookupPath(r,{parent:!0}).node,n=_r.basename(r),t=Tr.lookupNode(e,n),o=Tr.mayDelete(e,n,!1);if(o)throw new Tr.ErrnoError(o);if(!e.node_ops.unlink)throw new Tr.ErrnoError(63);if(Tr.isMountpoint(t))throw new Tr.ErrnoError(10);e.node_ops.unlink(e,n),Tr.destroyNode(t)},readlink:function(r){var e=Tr.lookupPath(r).node;if(!e)throw new Tr.ErrnoError(44);if(!e.node_ops.readlink)throw new Tr.ErrnoError(28);return Er.resolve(Tr.getPath(e.parent),e.node_ops.readlink(e))},stat:function(r,e){var n=Tr.lookupPath(r,{follow:!e}).node;if(!n)throw new Tr.ErrnoError(44);if(!n.node_ops.getattr)throw new Tr.ErrnoError(63);return n.node_ops.getattr(n)},lstat:function(r){return Tr.stat(r,!0)},chmod:function(r,e,n){var t;"string"==typeof r?t=Tr.lookupPath(r,{follow:!n}).node:t=r;if(!t.node_ops.setattr)throw new Tr.ErrnoError(63);t.node_ops.setattr(t,{mode:4095&e|-4096&t.mode,timestamp:Date.now()})},lchmod:function(r,e){Tr.chmod(r,e,!0)},fchmod:function(r,e){var n=Tr.getStream(r);if(!n)throw new Tr.ErrnoError(8);Tr.chmod(n.node,e)},chown:function(r,e,n,t){var o;"string"==typeof r?o=Tr.lookupPath(r,{follow:!t}).node:o=r;if(!o.node_ops.setattr)throw new Tr.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:function(r,e,n){Tr.chown(r,e,n,!0)},fchown:function(r,e,n){var t=Tr.getStream(r);if(!t)throw new Tr.ErrnoError(8);Tr.chown(t.node,e,n)},truncate:function(r,e){if(e<0)throw new Tr.ErrnoError(28);var n;"string"==typeof r?n=Tr.lookupPath(r,{follow:!0}).node:n=r;if(!n.node_ops.setattr)throw new Tr.ErrnoError(63);if(Tr.isDir(n.mode))throw new Tr.ErrnoError(31);if(!Tr.isFile(n.mode))throw new Tr.ErrnoError(28);var t=Tr.nodePermissions(n,"w");if(t)throw new Tr.ErrnoError(t);n.node_ops.setattr(n,{size:e,timestamp:Date.now()})},ftruncate:function(r,e){var n=Tr.getStream(r);if(!n)throw new Tr.ErrnoError(8);if(0==(2097155&n.flags))throw new Tr.ErrnoError(28);Tr.truncate(n.node,e)},utime:function(r,e,n){var t=Tr.lookupPath(r,{follow:!0}).node;t.node_ops.setattr(t,{timestamp:Math.max(e,n)})},open:function(r,e,n,t,i){if(""===r)throw new Tr.ErrnoError(44);var a;if(n=void 0===n?438:n,n=64&(e="string"==typeof e?Tr.modeStringToFlags(e):e)?4095&n|32768:0,"object"==typeof r)a=r;else{r=_r.normalize(r);try{a=Tr.lookupPath(r,{follow:!(131072&e)}).node}catch(r){}}var u=!1;if(64&e)if(a){if(128&e)throw new Tr.ErrnoError(20)}else a=Tr.mknod(r,n,0),u=!0;if(!a)throw new Tr.ErrnoError(44);if(Tr.isChrdev(a.mode)&&(e&=-513),65536&e&&!Tr.isDir(a.mode))throw new Tr.ErrnoError(54);if(!u){var s=Tr.mayOpen(a,e);if(s)throw new Tr.ErrnoError(s)}512&e&&Tr.truncate(a,0),e&=-131713;var c=Tr.createStream({node:a,path:Tr.getPath(a),id:a.id,flags:e,mode:a.mode,seekable:!0,position:0,stream_ops:a.stream_ops,node_ops:a.node_ops,ungotten:[],error:!1},t,i);return c.stream_ops.open&&c.stream_ops.open(c),!o.logReadFiles||1&e||(Tr.readFiles||(Tr.readFiles={}),r in Tr.readFiles||(Tr.readFiles[r]=1)),c},close:function(r){if(Tr.isClosed(r))throw new Tr.ErrnoError(8);r.getdents&&(r.getdents=null);try{r.stream_ops.close&&r.stream_ops.close(r)}catch(r){throw r}finally{Tr.closeStream(r.fd)}r.fd=null},isClosed:function(r){return null===r.fd},llseek:function(r,e,n){if(Tr.isClosed(r))throw new Tr.ErrnoError(8);if(!r.seekable||!r.stream_ops.llseek)throw new Tr.ErrnoError(70);if(0!=n&&1!=n&&2!=n)throw new Tr.ErrnoError(28);return r.position=r.stream_ops.llseek(r,e,n),r.ungotten=[],r.position},read:function(r,e,n,t,o){if(t<0||o<0)throw new Tr.ErrnoError(28);if(Tr.isClosed(r))throw new Tr.ErrnoError(8);if(1==(2097155&r.flags))throw new Tr.ErrnoError(8);if(Tr.isDir(r.node.mode))throw new Tr.ErrnoError(31);if(!r.stream_ops.read)throw new Tr.ErrnoError(28);var i=void 0!==o;if(i){if(!r.seekable)throw new Tr.ErrnoError(70)}else o=r.position;var a=r.stream_ops.read(r,e,n,t,o);return i||(r.position+=a),a},write:function(r,e,n,t,o,i){if(t<0||o<0)throw new Tr.ErrnoError(28);if(Tr.isClosed(r))throw new Tr.ErrnoError(8);if(0==(2097155&r.flags))throw new Tr.ErrnoError(8);if(Tr.isDir(r.node.mode))throw new Tr.ErrnoError(31);if(!r.stream_ops.write)throw new Tr.ErrnoError(28);r.seekable&&1024&r.flags&&Tr.llseek(r,0,2);var a=void 0!==o;if(a){if(!r.seekable)throw new Tr.ErrnoError(70)}else o=r.position;var u=r.stream_ops.write(r,e,n,t,o,i);return a||(r.position+=u),u},allocate:function(r,e,n){if(Tr.isClosed(r))throw new Tr.ErrnoError(8);if(e<0||n<=0)throw new Tr.ErrnoError(28);if(0==(2097155&r.flags))throw new Tr.ErrnoError(8);if(!Tr.isFile(r.node.mode)&&!Tr.isDir(r.node.mode))throw new Tr.ErrnoError(43);if(!r.stream_ops.allocate)throw new Tr.ErrnoError(138);r.stream_ops.allocate(r,e,n)},mmap:function(r,e,n,t,o,i){if(0!=(2&o)&&0==(2&i)&&2!=(2097155&r.flags))throw new Tr.ErrnoError(2);if(1==(2097155&r.flags))throw new Tr.ErrnoError(2);if(!r.stream_ops.mmap)throw new Tr.ErrnoError(43);return r.stream_ops.mmap(r,e,n,t,o,i)},msync:function(r,e,n,t,o){return r&&r.stream_ops.msync?r.stream_ops.msync(r,e,n,t,o):0},munmap:function(r){return 0},ioctl:function(r,e,n){if(!r.stream_ops.ioctl)throw new Tr.ErrnoError(59);return r.stream_ops.ioctl(r,e,n)},readFile:function(r,e){if((e=e||{}).flags=e.flags||0,e.encoding=e.encoding||"binary","utf8"!==e.encoding&&"binary"!==e.encoding)throw new Error('Invalid encoding type "'+e.encoding+'"');var n,t=Tr.open(r,e.flags),o=Tr.stat(r).size,i=new Uint8Array(o);return Tr.read(t,i,0,o,0),"utf8"===e.encoding?n=A(i,0):"binary"===e.encoding&&(n=i),Tr.close(t),n},writeFile:function(r,e,n){(n=n||{}).flags=n.flags||577;var t=Tr.open(r,n.flags,n.mode);if("string"==typeof e){var o=new Uint8Array(j(e)+1),i=P(e,o,0,o.length);Tr.write(t,o,0,i,void 0,n.canOwn)}else{if(!ArrayBuffer.isView(e))throw new Error("Unsupported data type");Tr.write(t,e,0,e.byteLength,void 0,n.canOwn)}Tr.close(t)},cwd:function(){return Tr.currentPath},chdir:function(r){var e=Tr.lookupPath(r,{follow:!0});if(null===e.node)throw new Tr.ErrnoError(44);if(!Tr.isDir(e.node.mode))throw new Tr.ErrnoError(54);var n=Tr.nodePermissions(e.node,"x");if(n)throw new Tr.ErrnoError(n);Tr.currentPath=e.path},createDefaultDirectories:function(){Tr.mkdir("/tmp"),Tr.mkdir("/home"),Tr.mkdir("/home/web_user")},createDefaultDevices:function(){Tr.mkdir("/dev"),Tr.registerDevice(Tr.makedev(1,3),{read:function(){return 0},write:function(r,e,n,t,o){return t}}),Tr.mkdev("/dev/null",Tr.makedev(1,3)),br.register(Tr.makedev(5,0),br.default_tty_ops),br.register(Tr.makedev(6,0),br.default_tty1_ops),Tr.mkdev("/dev/tty",Tr.makedev(5,0)),Tr.mkdev("/dev/tty1",Tr.makedev(6,0));var e=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return function(){return crypto.getRandomValues(e),e[0]}}if(y)try{var n=r("crypto");return function(){return n.randomBytes(1)[0]}}catch(r){}return function(){ur("randomDevice")}}();Tr.createDevice("/dev","random",e),Tr.createDevice("/dev","urandom",e),Tr.mkdir("/dev/shm"),Tr.mkdir("/dev/shm/tmp")},createSpecialDirectories:function(){Tr.mkdir("/proc");var r=Tr.mkdir("/proc/self");Tr.mkdir("/proc/self/fd"),Tr.mount({mount:function(){var e=Tr.createNode(r,"fd",16895,73);return e.node_ops={lookup:function(r,e){var n=+e,t=Tr.getStream(n);if(!t)throw new Tr.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:function(){return t.path}}};return o.parent=o,o}},e}},{},"/proc/self/fd")},createStandardStreams:function(){o.stdin?Tr.createDevice("/dev","stdin",o.stdin):Tr.symlink("/dev/tty","/dev/stdin"),o.stdout?Tr.createDevice("/dev","stdout",null,o.stdout):Tr.symlink("/dev/tty","/dev/stdout"),o.stderr?Tr.createDevice("/dev","stderr",null,o.stderr):Tr.symlink("/dev/tty1","/dev/stderr");Tr.open("/dev/stdin",0),Tr.open("/dev/stdout",1),Tr.open("/dev/stderr",1)},ensureErrnoError:function(){Tr.ErrnoError||(Tr.ErrnoError=function(r,e){this.node=e,this.setErrno=function(r){this.errno=r},this.setErrno(r),this.message="FS error"},Tr.ErrnoError.prototype=new Error,Tr.ErrnoError.prototype.constructor=Tr.ErrnoError,[44].forEach((function(r){Tr.genericErrors[r]=new Tr.ErrnoError(r),Tr.genericErrors[r].stack="<generic error, no stack>"})))},staticInit:function(){Tr.ensureErrnoError(),Tr.nameTable=new Array(4096),Tr.mount(Fr,{},"/"),Tr.createDefaultDirectories(),Tr.createDefaultDevices(),Tr.createSpecialDirectories(),Tr.filesystems={MEMFS:Fr}},init:function(r,e,n){Tr.init.initialized=!0,Tr.ensureErrnoError(),o.stdin=r||o.stdin,o.stdout=e||o.stdout,o.stderr=n||o.stderr,Tr.createStandardStreams()},quit:function(){Tr.init.initialized=!1;var r=o._fflush;r&&r(0);for(var e=0;e<Tr.streams.length;e++){var n=Tr.streams[e];n&&Tr.close(n)}},getMode:function(r,e){var n=0;return r&&(n|=365),e&&(n|=146),n},findObject:function(r,e){var n=Tr.analyzePath(r,e);return n.exists?n.object:null},analyzePath:function(r,e){try{r=(t=Tr.lookupPath(r,{follow:!e})).path}catch(r){}var n={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var t=Tr.lookupPath(r,{parent:!0});n.parentExists=!0,n.parentPath=t.path,n.parentObject=t.node,n.name=_r.basename(r),t=Tr.lookupPath(r,{follow:!e}),n.exists=!0,n.path=t.path,n.object=t.node,n.name=t.node.name,n.isRoot="/"===t.path}catch(r){n.error=r.errno}return n},createPath:function(r,e,n,t){r="string"==typeof r?r:Tr.getPath(r);for(var o=e.split("/").reverse();o.length;){var i=o.pop();if(i){var a=_r.join2(r,i);try{Tr.mkdir(a)}catch(r){}r=a}}return a},createFile:function(r,e,n,t,o){var i=_r.join2("string"==typeof r?r:Tr.getPath(r),e),a=Tr.getMode(t,o);return Tr.create(i,a)},createDataFile:function(r,e,n,t,o,i){var a=e?_r.join2("string"==typeof r?r:Tr.getPath(r),e):r,u=Tr.getMode(t,o),s=Tr.create(a,u);if(n){if("string"==typeof n){for(var c=new Array(n.length),f=0,l=n.length;f<l;++f)c[f]=n.charCodeAt(f);n=c}Tr.chmod(s,146|u);var d=Tr.open(s,577);Tr.write(d,n,0,n.length,0,i),Tr.close(d),Tr.chmod(s,u)}return s},createDevice:function(r,e,n,t){var o=_r.join2("string"==typeof r?r:Tr.getPath(r),e),i=Tr.getMode(!!n,!!t);Tr.createDevice.major||(Tr.createDevice.major=64);var a=Tr.makedev(Tr.createDevice.major++,0);return Tr.registerDevice(a,{open:function(r){r.seekable=!1},close:function(r){t&&t.buffer&&t.buffer.length&&t(10)},read:function(r,e,t,o,i){for(var a=0,u=0;u<o;u++){var s;try{s=n()}catch(r){throw new Tr.ErrnoError(29)}if(void 0===s&&0===a)throw new Tr.ErrnoError(6);if(null==s)break;a++,e[t+u]=s}return a&&(r.node.timestamp=Date.now()),a},write:function(r,e,n,o,i){for(var a=0;a<o;a++)try{t(e[n+a])}catch(r){throw new Tr.ErrnoError(29)}return o&&(r.node.timestamp=Date.now()),a}}),Tr.mkdev(o,i,a)},forceLoadFile:function(r){if(r.isDevice||r.isFolder||r.link||r.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(!u)throw new Error("Cannot load without read() or XMLHttpRequest.");try{r.contents=Te(u(r.url),!0),r.usedBytes=r.contents.length}catch(r){throw new Tr.ErrnoError(29)}},createLazyFile:function(r,e,n,t,o){function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(r){if(!(r>this.length-1||r<0)){var e=r%this.chunkSize,n=r/this.chunkSize|0;return this.getter(n)[e]}},i.prototype.setDataGetter=function(r){this.getter=r},i.prototype.cacheLength=function(){var r=new XMLHttpRequest;if(r.open("HEAD",n,!1),r.send(null),!(r.status>=200&&r.status<300||304===r.status))throw new Error("Couldn't load "+n+". Status: "+r.status);var e,t=Number(r.getResponseHeader("Content-length")),o=(e=r.getResponseHeader("Accept-Ranges"))&&"bytes"===e,i=(e=r.getResponseHeader("Content-Encoding"))&&"gzip"===e,a=1048576;o||(a=t);var u=this;u.setDataGetter((function(r){var e=r*a,o=(r+1)*a-1;if(o=Math.min(o,t-1),void 0===u.chunks[r]&&(u.chunks[r]=function(r,e){if(r>e)throw new Error("invalid range ("+r+", "+e+") or no bytes requested!");if(e>t-1)throw new Error("only "+t+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",n,!1),t!==a&&o.setRequestHeader("Range","bytes="+r+"-"+e),"undefined"!=typeof Uint8Array&&(o.responseType="arraybuffer"),o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+n+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):Te(o.responseText||"",!0)}(e,o)),void 0===u.chunks[r])throw new Error("doXHR failed!");return u.chunks[r]})),!i&&t||(a=t=1,t=this.getter(0).length,a=t,w("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=t,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!v)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new i;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var u={isDevice:!1,contents:a}}else u={isDevice:!1,url:n};var s=Tr.createFile(r,e,u,t,o);u.contents?s.contents=u.contents:u.url&&(s.contents=null,s.url=u.url),Object.defineProperties(s,{usedBytes:{get:function(){return this.contents.length}}});var c={};return Object.keys(s.stream_ops).forEach((function(r){var e=s.stream_ops[r];c[r]=function(){return Tr.forceLoadFile(s),e.apply(null,arguments)}})),c.read=function(r,e,n,t,o){Tr.forceLoadFile(s);var i=r.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,t);if(i.slice)for(var u=0;u<a;u++)e[n+u]=i[o+u];else for(u=0;u<a;u++)e[n+u]=i.get(o+u);return a},s.stream_ops=c,s},createPreloadedFile:function(r,e,n,t,i,a,u,c,f,l){Browser.init();var d=e?Er.resolve(_r.join2(r,e)):r;function p(n){function s(n){l&&l(),c||Tr.createDataFile(r,e,n,t,i,f),a&&a(),ar()}var p=!1;o.preloadPlugins.forEach((function(r){p||r.canHandle(d)&&(r.handle(n,d,s,(function(){u&&u(),ar()})),p=!0)})),p||s(n)}ir(),"string"==typeof n?function(r,e,n,t){var o=t?"":"al "+r;s(r,(function(n){S(n,'Loading data file "'+r+'" failed (no arrayBuffer).'),e(new Uint8Array(n)),o&&ar()}),(function(e){if(!n)throw'Loading data file "'+r+'" failed.';n()})),o&&ir()}(n,(function(r){p(r)}),u):p(n)},indexedDB:function(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB},DB_NAME:function(){return"EM_FS_"+window.location.pathname},DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:function(r,e,n){e=e||function(){},n=n||function(){};var t=Tr.indexedDB();try{var o=t.open(Tr.DB_NAME(),Tr.DB_VERSION)}catch(r){return n(r)}o.onupgradeneeded=function(){w("creating db"),o.result.createObjectStore(Tr.DB_STORE_NAME)},o.onsuccess=function(){var t=o.result.transaction([Tr.DB_STORE_NAME],"readwrite"),i=t.objectStore(Tr.DB_STORE_NAME),a=0,u=0,s=r.length;function c(){0==u?e():n()}r.forEach((function(r){var e=i.put(Tr.analyzePath(r).object.contents,r);e.onsuccess=function(){++a+u==s&&c()},e.onerror=function(){u++,a+u==s&&c()}})),t.onerror=n},o.onerror=n},loadFilesFromDB:function(r,e,n){e=e||function(){},n=n||function(){};var t=Tr.indexedDB();try{var o=t.open(Tr.DB_NAME(),Tr.DB_VERSION)}catch(r){return n(r)}o.onupgradeneeded=n,o.onsuccess=function(){var t=o.result;try{var i=t.transaction([Tr.DB_STORE_NAME],"readonly")}catch(r){return void n(r)}var a=i.objectStore(Tr.DB_STORE_NAME),u=0,s=0,c=r.length;function f(){0==s?e():n()}r.forEach((function(r){var e=a.get(r);e.onsuccess=function(){Tr.analyzePath(r).exists&&Tr.unlink(r),Tr.createDataFile(_r.dirname(r),_r.basename(r),e.result,!0,!0,!0),++u+s==c&&f()},e.onerror=function(){s++,u+s==c&&f()}})),i.onerror=n},o.onerror=n}},Sr={mappings:{},DEFAULT_POLLMASK:5,calculateAt:function(r,e,n){if("/"===e[0])return e;var t;if(-100===r)t=Tr.cwd();else{var o=Tr.getStream(r);if(!o)throw new Tr.ErrnoError(8);t=o.path}if(0==e.length){if(!n)throw new Tr.ErrnoError(44);return t}return _r.join2(t,e)},doStat:function(r,e,n){try{var t=r(e)}catch(r){if(r&&r.node&&_r.normalize(e)!==_r.normalize(Tr.getPath(r.node)))return-54;throw r}return I[n>>2]=t.dev,I[n+4>>2]=0,I[n+8>>2]=t.ino,I[n+12>>2]=t.mode,I[n+16>>2]=t.nlink,I[n+20>>2]=t.uid,I[n+24>>2]=t.gid,I[n+28>>2]=t.rdev,I[n+32>>2]=0,lr=[t.size>>>0,(fr=t.size,+Math.abs(fr)>=1?fr>0?(0|Math.min(+Math.floor(fr/4294967296),4294967295))>>>0:~~+Math.ceil((fr-+(~~fr>>>0))/4294967296)>>>0:0)],I[n+40>>2]=lr[0],I[n+44>>2]=lr[1],I[n+48>>2]=4096,I[n+52>>2]=t.blocks,I[n+56>>2]=t.atime.getTime()/1e3|0,I[n+60>>2]=0,I[n+64>>2]=t.mtime.getTime()/1e3|0,I[n+68>>2]=0,I[n+72>>2]=t.ctime.getTime()/1e3|0,I[n+76>>2]=0,lr=[t.ino>>>0,(fr=t.ino,+Math.abs(fr)>=1?fr>0?(0|Math.min(+Math.floor(fr/4294967296),4294967295))>>>0:~~+Math.ceil((fr-+(~~fr>>>0))/4294967296)>>>0:0)],I[n+80>>2]=lr[0],I[n+84>>2]=lr[1],0},doMsync:function(r,e,n,t,o){var i=x.slice(r,r+n);Tr.msync(e,i,o,n,t)},doMkdir:function(r,e){return"/"===(r=_r.normalize(r))[r.length-1]&&(r=r.substr(0,r.length-1)),Tr.mkdir(r,e,0),0},doMknod:function(r,e,n){switch(61440&e){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return Tr.mknod(r,e,n),0},doReadlink:function(r,e,n){if(n<=0)return-28;var t=Tr.readlink(r),o=Math.min(n,j(t)),i=O[e+o];return M(t,e,n+1),O[e+o]=i,o},doAccess:function(r,e){if(-8&e)return-28;var n;if(!(n=Tr.lookupPath(r,{follow:!0}).node))return-44;var t="";return 4&e&&(t+="r"),2&e&&(t+="w"),1&e&&(t+="x"),t&&Tr.nodePermissions(n,t)?-2:0},doDup:function(r,e,n){var t=Tr.getStream(n);return t&&Tr.close(t),Tr.open(r,e,0,n,n).fd},doReadv:function(r,e,n,t){for(var o=0,i=0;i<n;i++){var a=I[e+8*i>>2],u=I[e+(8*i+4)>>2],s=Tr.read(r,O,a,u,t);if(s<0)return-1;if(o+=s,s<u)break}return o},doWritev:function(r,e,n,t){for(var o=0,i=0;i<n;i++){var a=I[e+8*i>>2],u=I[e+(8*i+4)>>2],s=Tr.write(r,O,a,u,t);if(s<0)return-1;o+=s}return o},varargs:void 0,get:function(){return Sr.varargs+=4,I[Sr.varargs-4>>2]},getStr:function(r){return C(r)},getStreamFromFD:function(r){var e=Tr.getStream(r);if(!e)throw new Tr.ErrnoError(8);return e},get64:function(r,e){return r}};function Dr(){return 0}function Ar(r){switch(r){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+r)}}var Cr=void 0;function Pr(r){for(var e="",n=r;x[n];)e+=Cr[x[n++]];return e}var Mr={},jr={},Rr={};function Or(r){if(void 0===r)return"_unknown";var e=(r=r.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return e>=48&&e<=57?"_"+r:r}function xr(r,e){return r=Or(r),new Function("body","return function "+r+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(e)}function zr(r,e){var n=xr(e,(function(r){this.name=e,this.message=r;var n=new Error(r).stack;void 0!==n&&(this.stack=this.toString()+"\n"+n.replace(/^Error(:[^\n]*)?\n/,""))}));return n.prototype=Object.create(r.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},n}var Br=void 0;function Ir(r){throw new Br(r)}var Nr=void 0;function Wr(r){throw new Nr(r)}function Lr(r,e,n){if(n=n||{},!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");var t=e.name;if(r||Ir('type "'+t+'" must have a positive integer typeid pointer'),jr.hasOwnProperty(r)){if(n.ignoreDuplicateRegistrations)return;Ir("Cannot register type '"+t+"' twice")}if(jr[r]=e,delete Rr[r],Mr.hasOwnProperty(r)){var o=Mr[r];delete Mr[r],o.forEach((function(r){r()}))}}var Ur=[],Gr=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function Hr(r){r>4&&0==--Gr[r].refcount&&(Gr[r]=void 0,Ur.push(r))}function Yr(){for(var r=0,e=5;e<Gr.length;++e)void 0!==Gr[e]&&++r;return r}function qr(){for(var r=5;r<Gr.length;++r)if(void 0!==Gr[r])return Gr[r];return null}var Vr=function(r){return r||Ir("Cannot use deleted val. handle = "+r),Gr[r].value},Xr=function(r){switch(r){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var e=Ur.length?Ur.pop():Gr.length;return Gr[e]={refcount:1,value:r},e}};function Kr(r){return this.fromWireType(N[r>>2])}function $r(r){if(null===r)return"null";var e=typeof r;return"object"===e||"array"===e||"function"===e?r.toString():""+r}function Jr(r,e){switch(e){case 2:return function(r){return this.fromWireType(W[r>>2])};case 3:return function(r){return this.fromWireType(L[r>>3])};default:throw new TypeError("Unknown float type: "+r)}}function Zr(r,e){if(!(r instanceof Function))throw new TypeError("new_ called with constructor type "+typeof r+" which is not a function");var n=xr(r.name||"unknownFunctionName",(function(){}));n.prototype=r.prototype;var t=new n,o=r.apply(t,e);return o instanceof Object?o:t}function Qr(r){for(;r.length;){var e=r.pop();r.pop()(e)}}function re(r,e,n){o.hasOwnProperty(r)?((void 0===n||void 0!==o[r].overloadTable&&void 0!==o[r].overloadTable[n])&&Ir("Cannot register public name '"+r+"' twice"),function(r,e,n){if(void 0===r[e].overloadTable){var t=r[e];r[e]=function(){return r[e].overloadTable.hasOwnProperty(arguments.length)||Ir("Function '"+n+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+r[e].overloadTable+")!"),r[e].overloadTable[arguments.length].apply(this,arguments)},r[e].overloadTable=[],r[e].overloadTable[t.argCount]=t}}(o,r,r),o.hasOwnProperty(n)&&Ir("Cannot register multiple overloads of a function with the same number of arguments ("+n+")!"),o[r].overloadTable[n]=e):(o[r]=e,void 0!==n&&(o[r].numArguments=n))}function ee(r,e,n){return r.includes("j")?function(r,e,n){var t=o["dynCall_"+r];return n&&n.length?t.apply(null,[e].concat(n)):t.call(null,e)}(r,e,n):yr(e).apply(null,n)}function ne(r,e){var n,t,o,i=(r=Pr(r)).includes("j")?(n=r,t=e,o=[],function(){o.length=arguments.length;for(var r=0;r<arguments.length;r++)o[r]=arguments[r];return ee(n,t,o)}):yr(e);return"function"!=typeof i&&Ir("unknown function pointer with signature "+r+": "+e),i}var te=void 0;function oe(r){var e=Me(r),n=Pr(e);return Ce(e),n}function ie(r,e,n){switch(e){case 0:return n?function(r){return O[r]}:function(r){return x[r]};case 1:return n?function(r){return z[r>>1]}:function(r){return B[r>>1]};case 2:return n?function(r){return I[r>>2]}:function(r){return N[r>>2]};default:throw new TypeError("Unknown integer type: "+r)}}function ae(r,e){var n=jr[r];return void 0===n&&Ir(e+" has unknown type "+oe(r)),n}var ue={};function se(r){var e=ue[r];return void 0===e?Pr(r):e}var ce,fe=[];function le(){return"object"==typeof globalThis?globalThis:Function("return this")()}ce=y?function(){var r=e.hrtime();return 1e3*r[0]+r[1]/1e6}:function(){return performance.now()};function de(r){try{return k.grow(r-R.byteLength+65535>>>16),$(k.buffer),1}catch(r){}}var pe={};function me(){if(!me.strings){var r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:p||"./this.program"};for(var e in pe)void 0===pe[e]?delete r[e]:r[e]=pe[e];var n=[];for(var e in r)n.push(e+"="+r[e]);me.strings=n}return me.strings}function he(){he.called||(he.called=!0,function(){var r=(new Date).getFullYear(),e=new Date(r,0,1),n=new Date(r,6,1),t=e.getTimezoneOffset(),o=n.getTimezoneOffset(),i=Math.max(t,o);function a(r){var e=r.toTimeString().match(/\(([A-Za-z ]+)\)$/);return e?e[1]:"GMT"}I[Oe()>>2]=60*i,I[Re()>>2]=Number(t!=o);var u=a(e),s=a(n),c=K(u),f=K(s);o<t?(I[je()>>2]=c,I[je()+4>>2]=f):(I[je()>>2]=f,I[je()+4>>2]=c)}())}function ve(r){return r%4==0&&(r%100!=0||r%400==0)}function ye(r,e){for(var n=0,t=0;t<=e;n+=r[t++]);return n}var ge=[31,29,31,30,31,30,31,31,30,31,30,31],we=[31,28,31,30,31,30,31,31,30,31,30,31];function _e(r,e){for(var n=new Date(r.getTime());e>0;){var t=ve(n.getFullYear()),o=n.getMonth(),i=(t?ge:we)[o];if(!(e>i-n.getDate()))return n.setDate(n.getDate()+e),n;e-=i-n.getDate()+1,n.setDate(1),o<11?n.setMonth(o+1):(n.setMonth(0),n.setFullYear(n.getFullYear()+1))}return n}function Ee(r,e,n,t){var o=I[t+40>>2],i={tm_sec:I[t>>2],tm_min:I[t+4>>2],tm_hour:I[t+8>>2],tm_mday:I[t+12>>2],tm_mon:I[t+16>>2],tm_year:I[t+20>>2],tm_wday:I[t+24>>2],tm_yday:I[t+28>>2],tm_isdst:I[t+32>>2],tm_gmtoff:I[t+36>>2],tm_zone:o?C(o):""},a=C(n),u={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var s in u)a=a.replace(new RegExp(s,"g"),u[s]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],f=["January","February","March","April","May","June","July","August","September","October","November","December"];function l(r,e,n){for(var t="number"==typeof r?r.toString():r||"";t.length<e;)t=n[0]+t;return t}function d(r,e){return l(r,e,"0")}function p(r,e){function n(r){return r<0?-1:r>0?1:0}var t;return 0===(t=n(r.getFullYear()-e.getFullYear()))&&0===(t=n(r.getMonth()-e.getMonth()))&&(t=n(r.getDate()-e.getDate())),t}function m(r){switch(r.getDay()){case 0:return new Date(r.getFullYear()-1,11,29);case 1:return r;case 2:return new Date(r.getFullYear(),0,3);case 3:return new Date(r.getFullYear(),0,2);case 4:return new Date(r.getFullYear(),0,1);case 5:return new Date(r.getFullYear()-1,11,31);case 6:return new Date(r.getFullYear()-1,11,30)}}function h(r){var e=_e(new Date(r.tm_year+1900,0,1),r.tm_yday),n=new Date(e.getFullYear(),0,4),t=new Date(e.getFullYear()+1,0,4),o=m(n),i=m(t);return p(o,e)<=0?p(i,e)<=0?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}var v={"%a":function(r){return c[r.tm_wday].substring(0,3)},"%A":function(r){return c[r.tm_wday]},"%b":function(r){return f[r.tm_mon].substring(0,3)},"%B":function(r){return f[r.t