import { dirname } from "path";
import { fileURLToPath } from "url";
import { createRequire } from "module";
const require = createRequire(import.meta.url);

var Vips = (() => {
  var _scriptDir = import.meta.url;
  
  return (
function(Vips) {
  Vips = Vips || {};


var k;k||(k=typeof Vips !== 'undefined' ? Vips : {});var aa,ba;k.ready=new Promise(function(a,b){aa=a;ba=b});var ca=Object.assign({},k),da=[],ea="./this.program",fa=(a,b)=>{throw b;},ha="object"==typeof window,ia="function"==typeof importScripts,r="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,v=k.ENVIRONMENT_IS_PTHREAD||!1,w="";function ja(a){return k.locateFile?k.locateFile(a,w):w+a}var ka,la,ma,fs,na,oa;
if(r){w=ia?require("path").dirname(w)+"/":dirname(fileURLToPath(import.meta.url))+"/";oa=()=>{na||(fs=require("fs"),na=require("path"))};ka=function(b,c){oa();b=na.normalize(b);return fs.readFileSync(b,c?void 0:"utf8")};ma=b=>{b=ka(b,!0);b.buffer||(b=new Uint8Array(b));return b};la=(b,c,d)=>{oa();b=na.normalize(b);fs.readFile(b,function(e,f){e?d(e):c(f.buffer)})};1<process.argv.length&&(ea=process.argv[1].replace(/\\/g,"/"));da=process.argv.slice(2);fa=(b,c)=>{if(pa())throw process.exitCode=b,c;c instanceof qa||y("exiting due to exception: "+
c);process.exit(b)};k.inspect=function(){return"[Emscripten Module object]"};let a;try{a=require("worker_threads")}catch(b){throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'),b;}global.Worker=a.Worker}else if(ha||ia)ia?w=self.location.href:"undefined"!=typeof document&&document.currentScript&&(w=document.currentScript.src),_scriptDir&&(w=_scriptDir),0!==w.indexOf("blob:")?w=w.substr(0,w.replace(/[?#].*/,"").lastIndexOf("/")+
1):w="",r||(ka=a=>{var b=new XMLHttpRequest;b.open("GET",a,!1);b.send(null);return b.responseText},ia&&(ma=a=>{var b=new XMLHttpRequest;b.open("GET",a,!1);b.responseType="arraybuffer";b.send(null);return new Uint8Array(b.response)}),la=(a,b,c)=>{var d=new XMLHttpRequest;d.open("GET",a,!0);d.responseType="arraybuffer";d.onload=()=>{200==d.status||0==d.status&&d.response?b(d.response):c()};d.onerror=c;d.send(null)});r&&"undefined"==typeof performance&&(global.performance=require("perf_hooks").performance);
var ra=console.log.bind(console),sa=console.warn.bind(console);r&&(oa(),ra=a=>fs.writeSync(1,a+"\n"),sa=a=>fs.writeSync(2,a+"\n"));var ta=k.print||ra,y=k.printErr||sa;Object.assign(k,ca);ca=null;k.arguments&&(da=k.arguments);k.thisProgram&&(ea=k.thisProgram);k.quit&&(fa=k.quit);var ua,va=[],wa,xa=0,ya;k.wasmBinary&&(ya=k.wasmBinary);var noExitRuntime=k.noExitRuntime||!1;"object"!=typeof WebAssembly&&z("no native wasm support detected");var za,Aa,Ba=!1,Ca=new TextDecoder("utf8");
function Da(a){for(var b=0;a[b]&&!(NaN<=b);)++b;return Ca.decode(a.buffer?a.buffer instanceof SharedArrayBuffer?a.slice(0,b):a.subarray(0,b):new Uint8Array(a.slice(0,b)))}function A(a,b){if(!a)return"";b=a+b;for(var c=a;!(c>=b)&&B[c];)++c;return Ca.decode(B.slice(a,c))}
function Ea(a,b,c,d){if(!(0<d))return 0;var e=c;d=c+d-1;for(var f=0;f<a.length;++f){var g=a.charCodeAt(f);if(55296<=g&&57343>=g){var h=a.charCodeAt(++f);g=65536+((g&1023)<<10)|h&1023}if(127>=g){if(c>=d)break;b[c++]=g}else{if(2047>=g){if(c+1>=d)break;b[c++]=192|g>>6}else{if(65535>=g){if(c+2>=d)break;b[c++]=224|g>>12}else{if(c+3>=d)break;b[c++]=240|g>>18;b[c++]=128|g>>12&63}b[c++]=128|g>>6&63}b[c++]=128|g&63}}b[c]=0;return c-e}
function Fa(a){for(var b=0,c=0;c<a.length;++c){var d=a.charCodeAt(c);55296<=d&&57343>=d&&(d=65536+((d&1023)<<10)|a.charCodeAt(++c)&1023);127>=d?++b:b=2047>=d?b+2:65535>=d?b+3:b+4}return b}var Ga=new TextDecoder("utf-16le");function Ha(a,b){var c=a>>1;for(b=c+b/2;!(c>=b)&&Ia[c];)++c;return Ga.decode(B.slice(a,c<<1))}function Ja(a,b,c){void 0===c&&(c=2147483647);if(2>c)return 0;c-=2;var d=b;c=c<2*a.length?c/2:a.length;for(var e=0;e<c;++e)Ka[b>>1]=a.charCodeAt(e),b+=2;Ka[b>>1]=0;return b-d}
function La(a){return 2*a.length}function Ma(a,b){for(var c=0,d="";!(c>=b/4);){var e=D[a+4*c>>2];if(0==e)break;++c;65536<=e?(e-=65536,d+=String.fromCharCode(55296|e>>10,56320|e&1023)):d+=String.fromCharCode(e)}return d}function Na(a,b,c){void 0===c&&(c=2147483647);if(4>c)return 0;var d=b;c=d+c-4;for(var e=0;e<a.length;++e){var f=a.charCodeAt(e);if(55296<=f&&57343>=f){var g=a.charCodeAt(++e);f=65536+((f&1023)<<10)|g&1023}D[b>>2]=f;b+=4;if(b+4>c)break}D[b>>2]=0;return b-d}
function Oa(a){for(var b=0,c=0;c<a.length;++c){var d=a.charCodeAt(c);55296<=d&&57343>=d&&++c;b+=4}return b}function Pa(a){var b=Fa(a)+1,c=Qa(b);c&&Ea(a,E,c,b);return c}function Ra(a){var b=Fa(a)+1,c=Sa(b);Ea(a,E,c,b);return c}var Ta,E,B,Ka,Ia,D,F,Ua,Va,Wa,Xa;v&&(Ta=k.buffer);var Ya=k.INITIAL_MEMORY||1073741824;
if(v)za=k.wasmMemory,Ta=k.buffer;else if(k.wasmMemory)za=k.wasmMemory;else if(za=new WebAssembly.Memory({initial:Ya/65536,maximum:Ya/65536,shared:!0}),!(za.buffer instanceof SharedArrayBuffer))throw y("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),r&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),
Error("bad memory");za&&(Ta=za.buffer);Ya=Ta.byteLength;var Za=Ta;Ta=Za;k.HEAP8=E=new Int8Array(Za);k.HEAP16=Ka=new Int16Array(Za);k.HEAP32=D=new Int32Array(Za);k.HEAPU8=B=new Uint8Array(Za);k.HEAPU16=Ia=new Uint16Array(Za);k.HEAPU32=F=new Uint32Array(Za);k.HEAPF32=Ua=new Float32Array(Za);k.HEAPF64=Xa=new Float64Array(Za);k.HEAP64=Va=new BigInt64Array(Za);k.HEAPU64=Wa=new BigUint64Array(Za);var $a,ab=[],bb=[],cb=[],db=[],eb=[],fb=0;function pa(){return noExitRuntime||0<fb}
function gb(){v||(k.noFSInit||FS.init.jd||FS.init(),FS.Vd=!1,G.root=FS.mount(G,{},null),hb(bb))}function ib(){v||(jb(),hb(db),FS.Te(),H.de())}function kb(){var a=k.preRun.shift();ab.unshift(a)}var lb=0,mb=null,nb=null;function ob(){lb++;k.monitorRunDependencies&&k.monitorRunDependencies(lb)}function pb(){lb--;k.monitorRunDependencies&&k.monitorRunDependencies(lb);if(0==lb&&(null!==mb&&(clearInterval(mb),mb=null),nb)){var a=nb;nb=null;a()}}k.preloadedImages={};k.preloadedAudios={};
function z(a){if(v)postMessage({cmd:"onAbort",arg:a});else if(k.onAbort)k.onAbort(a);a="Aborted("+a+")";y(a);Ba=!0;a=new WebAssembly.RuntimeError(a+". Build with -s ASSERTIONS=1 for more info.");ba(a);throw a;}function qb(){return rb.startsWith("data:application/octet-stream;base64,")}var rb;k.locateFile?(rb="../vips.wasm",qb()||(rb=ja(rb))):rb=(fileURLToPath(new URL("../vips.wasm",import.meta.url)));
function sb(){var a=rb;try{if(a==rb&&ya)return new Uint8Array(ya);if(ma)return ma(a);throw"both async and sync fetching of the wasm failed";}catch(b){z(b)}}function tb(){return ya||!ha&&!ia||"function"!=typeof fetch?Promise.resolve().then(function(){return sb()}):fetch(rb,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+rb+"'";return a.arrayBuffer()}).catch(function(){return sb()})}var ub={};
function vb(a){for(var b=Ia[a+6>>1];13===b;){var c=F[a+8>>2],d=F[c>>2];if(0===d){b=0;break}else if(0===F[(c>>2)+1])a=d,b=Ia[d+6>>1];else break}return[a,b]}function hb(a){for(;0<a.length;){var b=a.shift();if("function"==typeof b)b(k);else{var c=b.rf;"number"==typeof c?void 0===b.Ec?I(c)():I(c)(b.Ec):c(void 0===b.Ec?null:b.Ec)}}}function wb(a){var b=J();a=a();M(b);return a}function xb(a){var b=H.jc[a];b&&(D[a>>2]=0,H.ce(b.worker))}
function yb(a){var b=H.Be();if(!b)return 6;H.Mc.push(b);var c=H.jc[a.qd]={worker:b,xd:a.qd};b.Cc=c;var d={cmd:"run",start_routine:a.ef,arg:a.Ec,threadInfoStruct:a.qd};b.Lc=()=>{d.time=performance.now();b.postMessage(d,a.kf)};b.loaded&&(b.Lc(),delete b.Lc);return 0}function zb(a){a instanceof qa||"unwind"==a||fa(1,a)}
var H={cc:[],Mc:[],Xc:[],init:function(){v?H.He():H.Ge()},Ge:function(){for(var a=Ab()+3,b=0;b<a;++b)H.Bd()},He:function(){H.receiveObjectTransfer=H.We;H.threadInit=H.ee;H.setExitStatus=H.$e;noExitRuntime=!1},jc:{},$e:function(){},de:function(){for(var a in H.jc){var b=H.jc[a];b&&b.worker&&H.ce(b.worker)}for(a=0;a<H.cc.length;++a)H.cc[a].terminate();H.cc=[]},ce:function(a){H.Ye(function(){delete H.jc[a.Cc.xd];H.cc.push(a);H.Mc.splice(H.Mc.indexOf(a),1);Bb(a.Cc.xd);a.Cc=void 0})},Ye:function(a){D[Cb>>
2]=0;try{a()}finally{D[Cb>>2]=1}},We:function(){},ee:function(){for(var a in H.Xc)if(H.Xc.hasOwnProperty(a))H.Xc[a]()},Wd:function(a,b){a.onmessage=c=>{c=c.data;var d=c.cmd;a.Cc&&(H.te=a.Cc.xd);if(c.targetThread&&c.targetThread!=Db()){var e=H.jc[c.zf];e?e.worker.postMessage(c,c.transferList):y('Internal error! Worker sent a message "'+d+'" to target pthread '+c.targetThread+", but that thread no longer exists!")}else if("processProxyingQueue"===d)Eb(c.queue),Atomics.sub(D,c.queue>>2,1);else if("spawnThread"===
d)yb(c);else if("cleanupThread"===d)xb(c.thread);else if("killThread"===d)c=c.thread,D[c>>2]=0,d=H.jc[c],delete H.jc[c],d.worker.terminate(),Bb(c),H.Mc.splice(H.Mc.indexOf(d.worker),1),d.worker.Cc=void 0;else if("cancelThread"===d)H.jc[c.thread].worker.postMessage({cmd:"cancel"});else if("loaded"===d)a.loaded=!0,b&&b(a),a.Lc&&(a.Lc(),delete a.Lc);else if("print"===d)ta("Thread "+c.threadId+": "+c.text);else if("printErr"===d)y("Thread "+c.threadId+": "+c.text);else if("alert"===d)alert("Thread "+
c.threadId+": "+c.text);else if("setimmediate"===c.target)a.postMessage(c);else if("onAbort"===d){if(k.onAbort)k.onAbort(c.arg)}else d&&y("worker sent an unknown command "+d);H.te=void 0};a.onerror=c=>{y("worker sent an error! "+c.filename+":"+c.lineno+": "+c.message);throw c;};r&&(a.on("message",function(c){a.onmessage({data:c})}),a.on("error",function(c){a.onerror(c)}),a.on("detachedExit",function(){}));a.postMessage({cmd:"load",urlOrBlob:k.mainScriptUrlOrBlob,wasmMemory:za,wasmModule:Aa})},Bd:function(){if(k.locateFile){var a=
ja("vips.worker.mjs");H.cc.push(new Worker(a))}else H.cc.push(new Worker(new URL("vips.worker.mjs",import.meta.url)))},Be:function(){0==H.cc.length&&(H.Bd(),H.Wd(H.cc[0]));return H.cc.pop()}};k.establishStackSpace=function(){var a=Db(),b=D[a+44>>2];Fb(b,b-D[a+48>>2]);M(b)};function Gb(a){if(v)return N(1,0,a);try{Hb(a)}catch(b){zb(b)}}var Ib=[];function I(a){var b=Ib[a];b||(a>=Ib.length&&(Ib.length=a+1),Ib[a]=b=$a.get(a));return b}k.invokeEntryPoint=function(a,b){return I(a)(b)};
function Jb(a,b,c,d){return v?N(2,1,a,b,c,d):Kb(a,b,c,d)}function Kb(a,b,c,d){if("undefined"==typeof SharedArrayBuffer)return y("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var e=[];if(v&&0===e.length)return Jb(a,b,c,d);a={ef:c,qd:a,Ec:d,kf:e};return v?(a.pf="spawnThread",postMessage(a,e),0):yb(a)}
function Lb(a,b){for(var c=0,d=a.length-1;0<=d;d--){var e=a[d];"."===e?a.splice(d,1):".."===e?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c;c--)a.unshift("..");return a}function Mb(a){var b="/"===a.charAt(0),c="/"===a.substr(-1);(a=Lb(a.split("/").filter(function(d){return!!d}),!b).join("/"))||b||(a=".");a&&c&&(a+="/");return(b?"/":"")+a}
function Nb(a){var b=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);a=b[0];b=b[1];if(!a&&!b)return".";b&&(b=b.substr(0,b.length-1));return a+b}function Ob(a){if("/"===a)return"/";a=Mb(a);a=a.replace(/\/$/,"");var b=a.lastIndexOf("/");return-1===b?a:a.substr(b+1)}function Pb(){var a=Array.prototype.slice.call(arguments,0);return Mb(a.join("/"))}function O(a,b){return Mb(a+"/"+b)}
function Qb(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var a=new Uint8Array(1);return function(){crypto.getRandomValues(a);return a[0]}}if(r)try{var b=require("crypto");return function(){return b.randomBytes(1)[0]}}catch(c){}return function(){z("randomDevice")}}
function Rb(){for(var a="",b=!1,c=arguments.length-1;-1<=c&&!b;c--){b=0<=c?arguments[c]:FS.cwd();if("string"!=typeof b)throw new TypeError("Arguments to path.resolve must be strings");if(!b)return"";a=b+"/"+a;b="/"===b.charAt(0)}a=Lb(a.split("/").filter(function(d){return!!d}),!b).join("/");return(b?"/":"")+a||"."}
function Sb(a,b){function c(g){for(var h=0;h<g.length&&""===g[h];h++);for(var l=g.length-1;0<=l&&""===g[l];l--);return h>l?[]:g.slice(h,l-h+1)}a=Rb(a).substr(1);b=Rb(b).substr(1);a=c(a.split("/"));b=c(b.split("/"));for(var d=Math.min(a.length,b.length),e=d,f=0;f<d;f++)if(a[f]!==b[f]){e=f;break}d=[];for(f=e;f<a.length;f++)d.push("..");d=d.concat(b.slice(e));return d.join("/")}var Tb=[];function Ub(a,b){Tb[a]={input:[],output:[],Bc:b};FS.registerDevice(a,Vb)}
var Vb={open:function(a){var b=Tb[a.node.rdev];if(!b)throw new FS.Gb(43);a.tty=b;a.seekable=!1},close:function(a){a.tty.Bc.flush(a.tty)},flush:function(a){a.tty.Bc.flush(a.tty)},read:function(a,b,c,d){if(!a.tty||!a.tty.Bc.Sd)throw new FS.Gb(60);for(var e=0,f=0;f<d;f++){try{var g=a.tty.Bc.Sd(a.tty)}catch(h){throw new FS.Gb(29);}if(void 0===g&&0===e)throw new FS.Gb(6);if(null===g||void 0===g)break;e++;b[c+f]=g}e&&(a.node.timestamp=Date.now());return e},write:function(a,b,c,d){if(!a.tty||!a.tty.Bc.rd)throw new FS.Gb(60);
try{for(var e=0;e<d;e++)a.tty.Bc.rd(a.tty,b[c+e])}catch(f){throw new FS.Gb(29);}d&&(a.node.timestamp=Date.now());return e}},Xb={Sd:function(a){if(!a.input.length){var b=null;if(r){var c=Buffer.alloc(256),d=0;try{d=fs.readSync(process.stdin.fd,c,0,256,-1)}catch(e){if(e.toString().includes("EOF"))d=0;else throw e;}0<d?b=c.slice(0,d).toString("utf-8"):b=null}else"undefined"!=typeof window&&"function"==typeof window.prompt?(b=window.prompt("Input: "),null!==b&&(b+="\n")):"function"==typeof readline&&
(b=readline(),null!==b&&(b+="\n"));if(!b)return null;a.input=Wb(b,!0)}return a.input.shift()},rd:function(a,b){null===b||10===b?(ta(Da(a.output)),a.output=[]):0!=b&&a.output.push(b)},flush:function(a){a.output&&0<a.output.length&&(ta(Da(a.output)),a.output=[])}},Yb={rd:function(a,b){null===b||10===b?(y(Da(a.output)),a.output=[]):0!=b&&a.output.push(b)},flush:function(a){a.output&&0<a.output.length&&(y(Da(a.output)),a.output=[])}};
function Zb(a){a=65536*Math.ceil(a/65536);var b=$b(65536,a);if(!b)return 0;B.fill(0,b,b+a);return b}
var P={ic:null,mount:function(){return P.createNode(null,"/",16895,0)},createNode:function(a,b,c,d){if(FS.isBlkdev(c)||FS.isFIFO(c))throw new FS.Gb(63);P.ic||(P.ic={dir:{node:{Zb:P.Jb.Zb,Sb:P.Jb.Sb,lookup:P.Jb.lookup,$b:P.Jb.$b,rename:P.Jb.rename,unlink:P.Jb.unlink,rmdir:P.Jb.rmdir,readdir:P.Jb.readdir,symlink:P.Jb.symlink},stream:{llseek:P.Ib.llseek}},file:{node:{Zb:P.Jb.Zb,Sb:P.Jb.Sb},stream:{llseek:P.Ib.llseek,read:P.Ib.read,write:P.Ib.write,yc:P.Ib.yc,mc:P.Ib.mc,nc:P.Ib.nc}},link:{node:{Zb:P.Jb.Zb,
Sb:P.Jb.Sb,readlink:P.Jb.readlink},stream:{}},Dd:{node:{Zb:P.Jb.Zb,Sb:P.Jb.Sb},stream:FS.me}});c=FS.createNode(a,b,c,d);FS.isDir(c.mode)?(c.Jb=P.ic.dir.node,c.Ib=P.ic.dir.stream,c.Kb={}):FS.isFile(c.mode)?(c.Jb=P.ic.file.node,c.Ib=P.ic.file.stream,c.Ob=0,c.Kb=null):FS.isLink(c.mode)?(c.Jb=P.ic.link.node,c.Ib=P.ic.link.stream):FS.isChrdev(c.mode)&&(c.Jb=P.ic.Dd.node,c.Ib=P.ic.Dd.stream);c.timestamp=Date.now();a&&(a.Kb[b]=c,a.timestamp=c.timestamp);return c},sf:function(a){return a.Kb?a.Kb.subarray?
a.Kb.subarray(0,a.Ob):new Uint8Array(a.Kb):new Uint8Array(0)},Ld:function(a,b){var c=a.Kb?a.Kb.length:0;c>=b||(b=Math.max(b,c*(1048576>c?2:1.125)>>>0),0!=c&&(b=Math.max(b,256)),c=a.Kb,a.Kb=new Uint8Array(b),0<a.Ob&&a.Kb.set(c.subarray(0,a.Ob),0))},Xe:function(a,b){if(a.Ob!=b)if(0==b)a.Kb=null,a.Ob=0;else{var c=a.Kb;a.Kb=new Uint8Array(b);c&&a.Kb.set(c.subarray(0,Math.min(b,a.Ob)));a.Ob=b}},Jb:{Zb:function(a){var b={};b.dev=FS.isChrdev(a.mode)?a.id:1;b.ino=a.id;b.mode=a.mode;b.nlink=1;b.uid=0;b.gid=
0;b.rdev=a.rdev;FS.isDir(a.mode)?b.size=4096:FS.isFile(a.mode)?b.size=a.Ob:FS.isLink(a.mode)?b.size=a.link.length:b.size=0;b.atime=new Date(a.timestamp);b.mtime=new Date(a.timestamp);b.ctime=new Date(a.timestamp);b.sc=4096;b.blocks=Math.ceil(b.size/b.sc);return b},Sb:function(a,b){void 0!==b.mode&&(a.mode=b.mode);void 0!==b.timestamp&&(a.timestamp=b.timestamp);void 0!==b.size&&P.Xe(a,b.size)},lookup:function(){throw FS.ed[44];},$b:function(a,b,c,d){return P.createNode(a,b,c,d)},rename:function(a,
b,c){if(FS.isDir(a.mode)){try{var d=FS.lc(b,c)}catch(f){}if(d)for(var e in d.Kb)throw new FS.Gb(55);}delete a.parent.Kb[a.name];a.parent.timestamp=Date.now();a.name=c;b.Kb[c]=a;b.timestamp=a.parent.timestamp;a.parent=b},unlink:function(a,b){delete a.Kb[b];a.timestamp=Date.now()},rmdir:function(a,b){var c=FS.lc(a,b),d;for(d in c.Kb)throw new FS.Gb(55);delete a.Kb[b];a.timestamp=Date.now()},readdir:function(a){var b=[".",".."],c;for(c in a.Kb)a.Kb.hasOwnProperty(c)&&b.push(c);return b},symlink:function(a,
b,c){a=P.createNode(a,b,41471,0);a.link=c;return a},readlink:function(a){if(!FS.isLink(a.mode))throw new FS.Gb(28);return a.link}},Ib:{read:function(a,b,c,d,e){var f=a.node.Kb;if(e>=a.node.Ob)return 0;a=Math.min(a.node.Ob-e,d);if(8<a&&f.subarray)b.set(f.subarray(e,e+a),c);else for(d=0;d<a;d++)b[c+d]=f[e+d];return a},write:function(a,b,c,d,e,f){if(!d)return 0;a=a.node;a.timestamp=Date.now();if(b.subarray&&(!a.Kb||a.Kb.subarray)){if(f)return a.Kb=b.subarray(c,c+d),a.Ob=d;if(0===a.Ob&&0===e)return a.Kb=
b.slice(c,c+d),a.Ob=d;if(e+d<=a.Ob)return a.Kb.set(b.subarray(c,c+d),e),d}P.Ld(a,e+d);if(a.Kb.subarray&&b.subarray)a.Kb.set(b.subarray(c,c+d),e);else for(f=0;f<d;f++)a.Kb[e+f]=b[c+f];a.Ob=Math.max(a.Ob,e+d);return d},llseek:function(a,b,c){1===c?b+=a.position:2===c&&FS.isFile(a.node.mode)&&(b+=a.node.Ob);if(0>b)throw new FS.Gb(28);return b},yc:function(a,b,c){P.Ld(a.node,b+c);a.node.Ob=Math.max(a.node.Ob,b+c)},mc:function(a,b,c,d,e,f){if(0!==b)throw new FS.Gb(28);if(!FS.isFile(a.node.mode))throw new FS.Gb(43);
a=a.node.Kb;if(f&2||a.buffer!==Ta){if(0<d||d+c<a.length)a.subarray?a=a.subarray(d,d+c):a=Array.prototype.slice.call(a,d,d+c);d=!0;c=Zb(c);if(!c)throw new FS.Gb(48);E.set(a,c)}else d=!1,c=a.byteOffset;return{Nb:c,ad:d}},nc:function(a,b,c,d,e){if(!FS.isFile(a.node.mode))throw new FS.Gb(43);if(e&2)return 0;P.Ib.write(a,b,0,d,c,!1);return 0}}};
function ac(a,b,c){var d="al "+a;la(a,function(e){e||z('Loading data file "'+a+'" failed (no arrayBuffer).');b(new Uint8Array(e));d&&pb(d)},function(){if(c)c();else throw'Loading data file "'+a+'" failed.';});d&&ob(d)}
var bc={},NODEFS={Uc:!1,wd:()=>{NODEFS.Uc=!!process.platform.match(/^win/);var a=process.binding("constants");a.fs&&(a=a.fs);NODEFS.Od={1024:a.O_APPEND,64:a.O_CREAT,128:a.O_EXCL,256:a.O_NOCTTY,0:a.O_RDONLY,2:a.O_RDWR,4096:a.O_SYNC,512:a.O_TRUNC,1:a.O_WRONLY,131072:a.O_NOFOLLOW}},Tb:a=>bc[a.code],mount:a=>NODEFS.createNode(null,"/",NODEFS.pc(a.pd.root),0),createNode:(a,b,c)=>{if(!FS.isDir(c)&&!FS.isFile(c)&&!FS.isLink(c))throw new FS.Gb(28);a=FS.createNode(a,b,c);a.Jb=NODEFS.Jb;a.Ib=NODEFS.Ib;return a},
pc:a=>{try{var b=fs.lstatSync(a);NODEFS.Uc&&(b.mode=b.mode|(b.mode&292)>>2)}catch(c){if(!c.code)throw c;throw new FS.Gb(NODEFS.Tb(c));}return b.mode},Xb:a=>{for(var b=[];a.parent!==a;)b.push(a.name),a=a.parent;b.push(a.mount.pd.root);b.reverse();return Pb.apply(null,b)},Nd:a=>{a&=-2721793;var b=0,c;for(c in NODEFS.Od)a&c&&(b|=NODEFS.Od[c],a^=c);if(a)throw new FS.Gb(28);return b},Jb:{Zb:a=>{a=NODEFS.Xb(a);try{var b=fs.lstatSync(a)}catch(c){if(!c.code)throw c;throw new FS.Gb(NODEFS.Tb(c));}NODEFS.Uc&&
!b.sc&&(b.sc=4096);NODEFS.Uc&&!b.blocks&&(b.blocks=(b.size+b.sc-1)/b.sc|0);return{dev:b.dev,ino:b.ino,mode:b.mode,nlink:b.nlink,uid:b.uid,gid:b.gid,rdev:b.rdev,size:b.size,atime:b.atime,mtime:b.mtime,ctime:b.ctime,sc:b.sc,blocks:b.blocks}},Sb:(a,b)=>{var c=NODEFS.Xb(a);try{void 0!==b.mode&&(fs.chmodSync(c,b.mode),a.mode=b.mode),void 0!==b.size&&fs.truncateSync(c,b.size)}catch(d){if(!d.code)throw d;throw new FS.Gb(NODEFS.Tb(d));}},lookup:(a,b)=>{var c=O(NODEFS.Xb(a),b);c=NODEFS.pc(c);return NODEFS.createNode(a,
b,c)},$b:(a,b,c,d)=>{a=NODEFS.createNode(a,b,c,d);b=NODEFS.Xb(a);try{FS.isDir(a.mode)?fs.mkdirSync(b,a.mode):fs.writeFileSync(b,"",{mode:a.mode})}catch(e){if(!e.code)throw e;throw new FS.Gb(NODEFS.Tb(e));}return a},rename:(a,b,c)=>{var d=NODEFS.Xb(a);b=O(NODEFS.Xb(b),c);try{fs.renameSync(d,b)}catch(e){if(!e.code)throw e;throw new FS.Gb(NODEFS.Tb(e));}a.name=c},unlink:(a,b)=>{a=O(NODEFS.Xb(a),b);try{fs.unlinkSync(a)}catch(c){if(!c.code)throw c;throw new FS.Gb(NODEFS.Tb(c));}},rmdir:(a,b)=>{a=O(NODEFS.Xb(a),
b);try{fs.rmdirSync(a)}catch(c){if(!c.code)throw c;throw new FS.Gb(NODEFS.Tb(c));}},readdir:a=>{a=NODEFS.Xb(a);try{return fs.readdirSync(a)}catch(b){if(!b.code)throw b;throw new FS.Gb(NODEFS.Tb(b));}},symlink:(a,b,c)=>{a=O(NODEFS.Xb(a),b);try{fs.symlinkSync(c,a)}catch(d){if(!d.code)throw d;throw new FS.Gb(NODEFS.Tb(d));}},readlink:a=>{var b=NODEFS.Xb(a);try{return b=fs.readlinkSync(b),b=na.relative(na.resolve(a.mount.pd.root),b)}catch(c){if(!c.code)throw c;if("UNKNOWN"===c.code)throw new FS.Gb(28);
throw new FS.Gb(NODEFS.Tb(c));}}},Ib:{open:a=>{var b=NODEFS.Xb(a.node);try{FS.isFile(a.node.mode)&&(a.Wb=fs.openSync(b,NODEFS.Nd(a.flags)))}catch(c){if(!c.code)throw c;throw new FS.Gb(NODEFS.Tb(c));}},close:a=>{try{FS.isFile(a.node.mode)&&a.Wb&&fs.closeSync(a.Wb)}catch(b){if(!b.code)throw b;throw new FS.Gb(NODEFS.Tb(b));}},read:(a,b,c,d,e)=>{if(0===d)return 0;try{return fs.readSync(a.Wb,Buffer.from(b.buffer),c,d,e)}catch(f){throw new FS.Gb(NODEFS.Tb(f));}},write:(a,b,c,d,e)=>{try{return fs.writeSync(a.Wb,
Buffer.from(b.buffer),c,d,e)}catch(f){throw new FS.Gb(NODEFS.Tb(f));}},llseek:(a,b,c)=>{if(1===c)b+=a.position;else if(2===c&&FS.isFile(a.node.mode))try{b+=fs.fstatSync(a.Wb).size}catch(d){throw new FS.Gb(NODEFS.Tb(d));}if(0>b)throw new FS.Gb(28);return b},mc:(a,b,c,d)=>{if(0!==b)throw new FS.Gb(28);if(!FS.isFile(a.node.mode))throw new FS.Gb(43);b=Zb(c);NODEFS.Ib.read(a,E,b,c,d);return{Nb:b,ad:!0}},nc:(a,b,c,d,e)=>{if(!FS.isFile(a.node.mode))throw new FS.Gb(43);if(e&2)return 0;NODEFS.Ib.write(a,b,
0,d,c,!1);return 0}}},cc={lookup:function(a,b){return FS.lookupPath(a.path+"/"+b).node},lookupPath:function(a,b){b=b||{};b.parent&&(a=na.dirname(a));b=fs.lstatSync(a);var c=NODEFS.pc(a);return{path:a,node:{id:b.ino,mode:c,Jb:cc,path:a}}},Gd:function(){FS.streams[0]={fd:0,Wb:0,position:0,path:"",flags:0,tty:!0,seekable:!1};for(var a=1;3>a;a++)FS.streams[a]={fd:a,Wb:a,position:0,path:"",flags:577,tty:!0,seekable:!1}},cwd:function(){return process.cwd()},chdir:function(){process.chdir.apply(void 0,arguments)},
$b:function(a,b){FS.isDir(a)?fs.mkdirSync(a,b):fs.writeFileSync(a,"",{mode:b})},mkdir:function(){fs.mkdirSync.apply(void 0,arguments)},symlink:function(){fs.symlinkSync.apply(void 0,arguments)},rename:function(){fs.renameSync.apply(void 0,arguments)},rmdir:function(){fs.rmdirSync.apply(void 0,arguments)},readdir:function(){return[".",".."].concat(fs.readdirSync.apply(void 0,arguments))},unlink:function(){fs.unlinkSync.apply(void 0,arguments)},readlink:function(){return fs.readlinkSync.apply(void 0,
arguments)},stat:function(){return fs.statSync.apply(void 0,arguments)},lstat:function(){return fs.lstatSync.apply(void 0,arguments)},chmod:function(){fs.chmodSync.apply(void 0,arguments)},fchmod:function(){fs.fchmodSync.apply(void 0,arguments)},chown:function(){fs.chownSync.apply(void 0,arguments)},fchown:function(){fs.fchownSync.apply(void 0,arguments)},truncate:function(){fs.truncateSync.apply(void 0,arguments)},ftruncate:function(a,b){if(0>b)throw new FS.Gb(28);fs.ftruncateSync.apply(void 0,arguments)},
utime:function(){},open:function(a,b,c,d){"string"==typeof b&&(b=dc.Xd(b));var e=a.split("/").map(function(g){return g.substr(0,255)}).join("/");c=fs.openSync(e,NODEFS.Nd(b),c);var f=fs.fstatSync(c);if(b&65536&&!f.isDirectory())throw fs.closeSync(c),new FS.Gb(bc.nf);e=NODEFS.pc(e);d=null!=d?d:FS.Zd(c);a={fd:d,Wb:c,position:0,path:a,flags:b,node:{id:f.ino,mode:e,Jb:cc,path:a},seekable:!0};return FS.streams[d]=a},close:function(a){a.Ib||fs.closeSync(a.Wb);FS.Ed(a.fd)},llseek:function(a,b,c){if(a.Ib)return dc.llseek(a,
b,c);if(1===c)b+=a.position;else if(2===c)b+=fs.fstatSync(a.Wb).size;else if(0!==c)throw new FS.Gb(28);if(0>b)throw new FS.Gb(28);return a.position=b},read:function(a,b,c,d,e){if(a.Ib)return dc.read(a,b,c,d,e);var f="undefined"!=typeof e;!f&&a.seekable&&(e=a.position);b=fs.readSync(a.Wb,Buffer.from(b.buffer),c,d,e);f||(a.position+=b);return b},write:function(a,b,c,d,e){if(a.Ib)return dc.write(a,b,c,d,e);a.flags&1024&&FS.llseek(a,0,2);var f="undefined"!=typeof e;!f&&a.seekable&&(e=a.position);b=fs.writeSync(a.Wb,
Buffer.from(b.buffer),c,d,e);f||(a.position+=b);return b},yc:function(){throw new FS.Gb(138);},mc:function(a,b,c,d,e,f){if(a.Ib)return dc.mc(a,b,c,d,e,f);if(0!==b)throw new FS.Gb(28);b=Zb(c);FS.read(a,E,b,c,d);return{Nb:b,ad:!0}},nc:function(a,b,c,d,e){if(a.Ib)return dc.nc(a,b,c,d,e);if(e&2)return 0;FS.write(a,b,0,d,c);return 0},Me:function(){return 0},Fc:function(){throw new FS.Gb(59);}},FS={root:null,Ic:[],Jd:{},streams:[],Ne:1,hc:null,Hd:"/",jd:!1,Vd:!0,Gb:null,ed:{},xe:null,Wc:0,lookupPath:(a,
b={})=>{a=Rb(FS.cwd(),a);if(!a)return{path:"",node:null};b=Object.assign({dd:!0,ud:0},b);if(8<b.ud)throw new FS.Gb(32);a=Lb(a.split("/").filter(g=>!!g),!1);for(var c=FS.root,d="/",e=0;e<a.length;e++){var f=e===a.length-1;if(f&&b.parent)break;c=FS.lc(c,a[e]);d=O(d,a[e]);FS.uc(c)&&(!f||f&&b.dd)&&(c=c.Hc.root);if(!f||b.follow)for(f=0;FS.isLink(c.mode);)if(c=FS.readlink(d),d=Rb(Nb(d),c),c=FS.lookupPath(d,{ud:b.ud+1}).node,40<f++)throw new FS.Gb(32);}return{path:d,node:c}},getPath:a=>{for(var b;;){if(FS.Sc(a))return a=
a.mount.Yd,b?"/"!==a[a.length-1]?a+"/"+b:a+b:a;b=b?a.name+"/"+b:a.name;a=a.parent}},hd:(a,b)=>{for(var c=0,d=0;d<b.length;d++)c=(c<<5)-c+b.charCodeAt(d)|0;return(a+c>>>0)%FS.hc.length},Td:a=>{var b=FS.hd(a.parent.id,a.name);a.vc=FS.hc[b];FS.hc[b]=a},Ud:a=>{var b=FS.hd(a.parent.id,a.name);if(FS.hc[b]===a)FS.hc[b]=a.vc;else for(b=FS.hc[b];b;){if(b.vc===a){b.vc=a.vc;break}b=b.vc}},lc:(a,b)=>{var c=FS.Ke(a);if(c)throw new FS.Gb(c,a);for(c=FS.hc[FS.hd(a.id,b)];c;c=c.vc){var d=c.name;if(c.parent.id===a.id&&
d===b)return c}return FS.lookup(a,b)},createNode:(a,b,c,d)=>{a=new FS.fe(a,b,c,d);FS.Td(a);return a},cd:a=>{FS.Ud(a)},Sc:a=>a===a.parent,uc:a=>!!a.Hc,isFile:a=>32768===(a&61440),isDir:a=>16384===(a&61440),isLink:a=>40960===(a&61440),isChrdev:a=>8192===(a&61440),isBlkdev:a=>24576===(a&61440),isFIFO:a=>4096===(a&61440),isSocket:a=>49152===(a&49152),ye:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},Xd:a=>{var b=FS.ye[a];if("undefined"==typeof b)throw Error("Unknown file open mode: "+a);return b},Pd:a=>
{var b=["r","w","rw"][a&3];a&512&&(b+="w");return b},rc:(a,b)=>{if(FS.Vd)return 0;if(!b.includes("r")||a.mode&292){if(b.includes("w")&&!(a.mode&146)||b.includes("x")&&!(a.mode&73))return 2}else return 2;return 0},Ke:a=>{var b=FS.rc(a,"x");return b?b:a.Jb.lookup?0:2},od:(a,b)=>{try{return FS.lc(a,b),20}catch(c){}return FS.rc(a,"wx")},Vc:(a,b,c)=>{try{var d=FS.lc(a,b)}catch(e){return e.Mb}if(a=FS.rc(a,"wx"))return a;if(c){if(!FS.isDir(d.mode))return 54;if(FS.Sc(d)||FS.getPath(d)===FS.cwd())return 10}else if(FS.isDir(d.mode))return 31;
return 0},Le:(a,b)=>a?FS.isLink(a.mode)?32:FS.isDir(a.mode)&&("r"!==FS.Pd(b)||b&512)?31:FS.rc(a,FS.Pd(b)):44,he:4096,Zd:(a=0,b=FS.he)=>{for(;a<=b;a++)if(!FS.streams[a])return a;throw new FS.Gb(33);},fc:a=>FS.streams[a],bd:(a,b,c)=>{FS.$c||(FS.$c=function(){},FS.$c.prototype={object:{get:function(){return this.node},set:function(d){this.node=d}}});a=Object.assign(new FS.$c,a);b=FS.Zd(b,c);a.fd=b;return FS.streams[b]=a},Ed:a=>{FS.streams[a]=null},me:{open:a=>{a.Ib=FS.Ae(a.node.rdev).Ib;a.Ib.open&&a.Ib.open(a)},
llseek:()=>{throw new FS.Gb(70);}},nd:a=>a>>8,vf:a=>a&255,makedev:(a,b)=>a<<8|b,registerDevice:(a,b)=>{FS.Jd[a]={Ib:b}},Ae:a=>FS.Jd[a],Rd:a=>{var b=[];for(a=[a];a.length;){var c=a.pop();b.push(c);a.push.apply(a,c.Ic)}return b},syncfs:(a,b)=>{function c(g){FS.Wc--;return b(g)}function d(g){if(g){if(!d.ve)return d.ve=!0,c(g)}else++f>=e.length&&c(null)}"function"==typeof a&&(b=a,a=!1);FS.Wc++;1<FS.Wc&&y("warning: "+FS.Wc+" FS.syncfs operations in flight at once, probably just doing extra work");var e=
FS.Rd(FS.root.mount),f=0;e.forEach(g=>{if(!g.type.syncfs)return d(null);g.type.syncfs(g,a,d)})},mount:(a,b,c)=>{var d="/"===c,e=!c;if(d&&FS.root)throw new FS.Gb(10);if(!d&&!e){var f=FS.lookupPath(c,{dd:!1});c=f.path;f=f.node;if(FS.uc(f))throw new FS.Gb(10);if(!FS.isDir(f.mode))throw new FS.Gb(54);}b={type:a,pd:b,Yd:c,Ic:[]};a=a.mount(b);a.mount=b;b.root=a;d?FS.root=a:f&&(f.Hc=b,f.mount&&f.mount.Ic.push(b));return a},unmount:a=>{a=FS.lookupPath(a,{dd:!1});if(!FS.uc(a.node))throw new FS.Gb(28);a=a.node;
var b=a.Hc,c=FS.Rd(b);Object.keys(FS.hc).forEach(d=>{for(d=FS.hc[d];d;){var e=d.vc;c.includes(d.mount)&&FS.cd(d);d=e}});a.Hc=null;a.mount.Ic.splice(a.mount.Ic.indexOf(b),1)},lookup:(a,b)=>a.Jb.lookup(a,b),$b:(a,b,c)=>{var d=FS.lookupPath(a,{parent:!0}).node;a=Ob(a);if(!a||"."===a||".."===a)throw new FS.Gb(28);var e=FS.od(d,a);if(e)throw new FS.Gb(e);if(!d.Jb.$b)throw new FS.Gb(63);return d.Jb.$b(d,a,b,c)},create:(a,b)=>FS.$b(a,(void 0!==b?b:438)&4095|32768,0),mkdir:(a,b)=>FS.$b(a,(void 0!==b?b:511)&
1023|16384,0),wf:(a,b)=>{a=a.split("/");for(var c="",d=0;d<a.length;++d)if(a[d]){c+="/"+a[d];try{FS.mkdir(c,b)}catch(e){if(20!=e.Mb)throw e;}}},mkdev:(a,b,c)=>{"undefined"==typeof c&&(c=b,b=438);return FS.$b(a,b|8192,c)},symlink:(a,b)=>{if(!Rb(a))throw new FS.Gb(44);var c=FS.lookupPath(b,{parent:!0}).node;if(!c)throw new FS.Gb(44);b=Ob(b);var d=FS.od(c,b);if(d)throw new FS.Gb(d);if(!c.Jb.symlink)throw new FS.Gb(63);return c.Jb.symlink(c,b,a)},rename:(a,b)=>{var c=Nb(a),d=Nb(b),e=Ob(a),f=Ob(b);var g=
FS.lookupPath(a,{parent:!0});var h=g.node;g=FS.lookupPath(b,{parent:!0});g=g.node;if(!h||!g)throw new FS.Gb(44);if(h.mount!==g.mount)throw new FS.Gb(75);var l=FS.lc(h,e);a=Sb(a,d);if("."!==a.charAt(0))throw new FS.Gb(28);a=Sb(b,c);if("."!==a.charAt(0))throw new FS.Gb(55);try{var n=FS.lc(g,f)}catch(p){}if(l!==n){b=FS.isDir(l.mode);if(e=FS.Vc(h,e,b))throw new FS.Gb(e);if(e=n?FS.Vc(g,f,b):FS.od(g,f))throw new FS.Gb(e);if(!h.Jb.rename)throw new FS.Gb(63);if(FS.uc(l)||n&&FS.uc(n))throw new FS.Gb(10);if(g!==
h&&(e=FS.rc(h,"w")))throw new FS.Gb(e);FS.Ud(l);try{h.Jb.rename(l,g,f)}catch(p){throw p;}finally{FS.Td(l)}}},rmdir:a=>{var b=FS.lookupPath(a,{parent:!0}).node;a=Ob(a);var c=FS.lc(b,a),d=FS.Vc(b,a,!0);if(d)throw new FS.Gb(d);if(!b.Jb.rmdir)throw new FS.Gb(63);if(FS.uc(c))throw new FS.Gb(10);b.Jb.rmdir(b,a);FS.cd(c)},readdir:a=>{a=FS.lookupPath(a,{follow:!0}).node;if(!a.Jb.readdir)throw new FS.Gb(54);return a.Jb.readdir(a)},unlink:a=>{var b=FS.lookupPath(a,{parent:!0}).node;if(!b)throw new FS.Gb(44);
a=Ob(a);var c=FS.lc(b,a),d=FS.Vc(b,a,!1);if(d)throw new FS.Gb(d);if(!b.Jb.unlink)throw new FS.Gb(63);if(FS.uc(c))throw new FS.Gb(10);b.Jb.unlink(b,a);FS.cd(c)},readlink:a=>{a=FS.lookupPath(a).node;if(!a)throw new FS.Gb(44);if(!a.Jb.readlink)throw new FS.Gb(28);return Rb(FS.getPath(a.parent),a.Jb.readlink(a))},stat:(a,b)=>{a=FS.lookupPath(a,{follow:!b}).node;if(!a)throw new FS.Gb(44);if(!a.Jb.Zb)throw new FS.Gb(63);return a.Jb.Zb(a)},lstat:a=>FS.stat(a,!0),chmod:(a,b,c)=>{a="string"==typeof a?FS.lookupPath(a,
{follow:!c}).node:a;if(!a.Jb.Sb)throw new FS.Gb(63);a.Jb.Sb(a,{mode:b&4095|a.mode&-4096,timestamp:Date.now()})},lchmod:(a,b)=>{FS.chmod(a,b,!0)},fchmod:(a,b)=>{a=FS.fc(a);if(!a)throw new FS.Gb(8);FS.chmod(a.node,b)},chown:(a,b,c,d)=>{a="string"==typeof a?FS.lookupPath(a,{follow:!d}).node:a;if(!a.Jb.Sb)throw new FS.Gb(63);a.Jb.Sb(a,{timestamp:Date.now()})},lchown:(a,b,c)=>{FS.chown(a,b,c,!0)},fchown:(a,b,c)=>{a=FS.fc(a);if(!a)throw new FS.Gb(8);FS.chown(a.node,b,c)},truncate:(a,b)=>{if(0>b)throw new FS.Gb(28);
a="string"==typeof a?FS.lookupPath(a,{follow:!0}).node:a;if(!a.Jb.Sb)throw new FS.Gb(63);if(FS.isDir(a.mode))throw new FS.Gb(31);if(!FS.isFile(a.mode))throw new FS.Gb(28);var c=FS.rc(a,"w");if(c)throw new FS.Gb(c);a.Jb.Sb(a,{size:b,timestamp:Date.now()})},ftruncate:(a,b)=>{a=FS.fc(a);if(!a)throw new FS.Gb(8);if(0===(a.flags&2097155))throw new FS.Gb(28);FS.truncate(a.node,b)},utime:(a,b,c)=>{a=FS.lookupPath(a,{follow:!0}).node;a.Jb.Sb(a,{timestamp:Math.max(b,c)})},open:(a,b,c,d,e)=>{if(""===a)throw new FS.Gb(44);
b="string"==typeof b?FS.Xd(b):b;c=b&64?("undefined"==typeof c?438:c)&4095|32768:0;if("object"==typeof a)var f=a;else{a=Mb(a);try{f=FS.lookupPath(a,{follow:!(b&131072)}).node}catch(h){}}var g=!1;if(b&64)if(f){if(b&128)throw new FS.Gb(20);}else f=FS.$b(a,c,0),g=!0;if(!f)throw new FS.Gb(44);FS.isChrdev(f.mode)&&(b&=-513);if(b&65536&&!FS.isDir(f.mode))throw new FS.Gb(54);if(!g&&(c=FS.Le(f,b)))throw new FS.Gb(c);b&512&&FS.truncate(f,0);b&=-131713;d=FS.bd({node:f,path:FS.getPath(f),flags:b,seekable:!0,
position:0,Ib:f.Ib,lf:[],error:!1},d,e);d.Ib.open&&d.Ib.open(d);!k.logReadFiles||b&1||(FS.td||(FS.td={}),a in FS.td||(FS.td[a]=1));return d},close:a=>{if(FS.Gc(a))throw new FS.Gb(8);a.gd&&(a.gd=null);try{a.Ib.close&&a.Ib.close(a)}catch(b){throw b;}finally{FS.Ed(a.fd)}a.fd=null},Gc:a=>null===a.fd,llseek:(a,b,c)=>{if(FS.Gc(a))throw new FS.Gb(8);if(!a.seekable||!a.Ib.llseek)throw new FS.Gb(70);if(0!=c&&1!=c&&2!=c)throw new FS.Gb(28);a.position=a.Ib.llseek(a,b,c);a.lf=[];return a.position},read:(a,b,
c,d,e)=>{if(0>d||0>e)throw new FS.Gb(28);if(FS.Gc(a))throw new FS.Gb(8);if(1===(a.flags&2097155))throw new FS.Gb(8);if(FS.isDir(a.node.mode))throw new FS.Gb(31);if(!a.Ib.read)throw new FS.Gb(28);var f="undefined"!=typeof e;if(!f)e=a.position;else if(!a.seekable)throw new FS.Gb(70);b=a.Ib.read(a,b,c,d,e);f||(a.position+=b);return b},write:(a,b,c,d,e,f)=>{if(0>d||0>e)throw new FS.Gb(28);if(FS.Gc(a))throw new FS.Gb(8);if(0===(a.flags&2097155))throw new FS.Gb(8);if(FS.isDir(a.node.mode))throw new FS.Gb(31);
if(!a.Ib.write)throw new FS.Gb(28);a.seekable&&a.flags&1024&&FS.llseek(a,0,2);var g="undefined"!=typeof e;if(!g)e=a.position;else if(!a.seekable)throw new FS.Gb(70);b=a.Ib.write(a,b,c,d,e,f);g||(a.position+=b);return b},yc:(a,b,c)=>{if(FS.Gc(a))throw new FS.Gb(8);if(0>b||0>=c)throw new FS.Gb(28);if(0===(a.flags&2097155))throw new FS.Gb(8);if(!FS.isFile(a.node.mode)&&!FS.isDir(a.node.mode))throw new FS.Gb(43);if(!a.Ib.yc)throw new FS.Gb(138);a.Ib.yc(a,b,c)},mc:(a,b,c,d,e,f)=>{if(0!==(e&2)&&0===(f&
2)&&2!==(a.flags&2097155))throw new FS.Gb(2);if(1===(a.flags&2097155))throw new FS.Gb(2);if(!a.Ib.mc)throw new FS.Gb(43);return a.Ib.mc(a,b,c,d,e,f)},nc:(a,b,c,d,e)=>a&&a.Ib.nc?a.Ib.nc(a,b,c,d,e):0,Me:()=>0,Fc:(a,b,c)=>{if(!a.Ib.Fc)throw new FS.Gb(59);return a.Ib.Fc(a,b,c)},readFile:(a,b={})=>{b.flags=b.flags||0;b.encoding=b.encoding||"binary";if("utf8"!==b.encoding&&"binary"!==b.encoding)throw Error('Invalid encoding type "'+b.encoding+'"');var c,d=FS.open(a,b.flags);a=FS.stat(a).size;var e=new Uint8Array(a);
FS.read(d,e,0,a,0);"utf8"===b.encoding?c=Da(e):"binary"===b.encoding&&(c=e);FS.close(d);return c},writeFile:(a,b,c={})=>{c.flags=c.flags||577;a=FS.open(a,c.flags,c.mode);if("string"==typeof b){var d=new Uint8Array(Fa(b)+1);b=Ea(b,d,0,d.length);FS.write(a,d,0,b,void 0,c.le)}else if(ArrayBuffer.isView(b))FS.write(a,b,0,b.byteLength,void 0,c.le);else throw Error("Unsupported data type");FS.close(a)},cwd:()=>FS.Hd,chdir:a=>{a=FS.lookupPath(a,{follow:!0});if(null===a.node)throw new FS.Gb(44);if(!FS.isDir(a.node.mode))throw new FS.Gb(54);
var b=FS.rc(a.node,"x");if(b)throw new FS.Gb(b);FS.Hd=a.path},pe:()=>{FS.mkdir("/tmp");FS.mkdir("/home");FS.mkdir("/home/web_user")},oe:()=>{FS.mkdir("/dev");FS.registerDevice(FS.makedev(1,3),{read:()=>0,write:(b,c,d,e)=>e});FS.mkdev("/dev/null",FS.makedev(1,3));Ub(FS.makedev(5,0),Xb);Ub(FS.makedev(6,0),Yb);FS.mkdev("/dev/tty",FS.makedev(5,0));FS.mkdev("/dev/tty1",FS.makedev(6,0));var a=Qb();FS.ec("/dev","random",a);FS.ec("/dev","urandom",a);FS.mkdir("/dev/shm");FS.mkdir("/dev/shm/tmp")},se:()=>{FS.mkdir("/proc");
var a=FS.mkdir("/proc/self");FS.mkdir("/proc/self/fd");FS.mount({mount:()=>{var b=FS.createNode(a,"fd",16895,73);b.Jb={lookup:(c,d)=>{var e=FS.fc(+d);if(!e)throw new FS.Gb(8);c={parent:null,mount:{Yd:"fake"},Jb:{readlink:()=>e.path}};return c.parent=c}};return b}},{},"/proc/self/fd")},Gd:()=>{k.stdin?FS.ec("/dev","stdin",k.stdin):FS.symlink("/dev/tty","/dev/stdin");k.stdout?FS.ec("/dev","stdout",null,k.stdout):FS.symlink("/dev/tty","/dev/stdout");k.stderr?FS.ec("/dev","stderr",null,k.stderr):FS.symlink("/dev/tty1",
"/dev/stderr");FS.open("/dev/stdin",0);FS.open("/dev/stdout",1);FS.open("/dev/stderr",1)},Kd:()=>{FS.Gb||(FS.Gb=function(a,b){this.node=b;this.Ze=function(c){this.Mb=c};this.Ze(a);this.message="FS error"},FS.Gb.prototype=Error(),FS.Gb.prototype.constructor=FS.Gb,[44].forEach(a=>{FS.ed[a]=new FS.Gb(a);FS.ed[a].stack="<generic error, no stack>"}))},wd:()=>{FS.Kd();FS.hc=Array(4096);FS.mount(P,{},"/");FS.pe();FS.oe();FS.se();FS.xe={MEMFS:P,NODEFS}},init:(a,b,c)=>{FS.init.jd=!0;FS.Kd();k.stdin=a||k.stdin;
k.stdout=b||k.stdout;k.stderr=c||k.stderr;FS.Gd()},Te:()=>{FS.init.jd=!1;ec();for(var a=0;a<FS.streams.length;a++){var b=FS.streams[a];b&&FS.close(b)}},pc:(a,b)=>{var c=0;a&&(c|=365);b&&(c|=146);return c},qf:(a,b)=>{a=FS.analyzePath(a,b);return a.exists?a.object:null},analyzePath:(a,b)=>{try{var c=FS.lookupPath(a,{follow:!b});a=c.path}catch(e){}var d={Sc:!1,exists:!1,error:0,name:null,path:null,object:null,Oe:!1,Qe:null,Pe:null};try{c=FS.lookupPath(a,{parent:!0}),d.Oe=!0,d.Qe=c.path,d.Pe=c.node,d.name=
Ob(a),c=FS.lookupPath(a,{follow:!b}),d.exists=!0,d.path=c.path,d.object=c.node,d.name=c.node.name,d.Sc="/"===c.path}catch(e){d.error=e.Mb}return d},Fd:(a,b)=>{a="string"==typeof a?a:FS.getPath(a);for(b=b.split("/").reverse();b.length;){var c=b.pop();if(c){var d=O(a,c);try{FS.mkdir(d)}catch(e){}a=d}}return d},qe:(a,b,c,d,e)=>{a=O("string"==typeof a?a:FS.getPath(a),b);d=FS.pc(d,e);return FS.create(a,d)},Pc:(a,b,c,d,e,f)=>{var g=b;a&&(a="string"==typeof a?a:FS.getPath(a),g=b?O(a,b):a);a=FS.pc(d,e);g=
FS.create(g,a);if(c){if("string"==typeof c){b=Array(c.length);d=0;for(e=c.length;d<e;++d)b[d]=c.charCodeAt(d);c=b}FS.chmod(g,a|146);b=FS.open(g,577);FS.write(b,c,0,c.length,0,f);FS.close(b);FS.chmod(g,a)}return g},ec:(a,b,c,d)=>{a=O("string"==typeof a?a:FS.getPath(a),b);b=FS.pc(!!c,!!d);FS.ec.nd||(FS.ec.nd=64);var e=FS.makedev(FS.ec.nd++,0);FS.registerDevice(e,{open:f=>{f.seekable=!1},close:()=>{d&&d.buffer&&d.buffer.length&&d(10)},read:(f,g,h,l)=>{for(var n=0,p=0;p<l;p++){try{var q=c()}catch(t){throw new FS.Gb(29);
}if(void 0===q&&0===n)throw new FS.Gb(6);if(null===q||void 0===q)break;n++;g[h+p]=q}n&&(f.node.timestamp=Date.now());return n},write:(f,g,h,l)=>{for(var n=0;n<l;n++)try{d(g[h+n])}catch(p){throw new FS.Gb(29);}l&&(f.node.timestamp=Date.now());return n}});return FS.mkdev(a,b,e)},Qd:a=>{if(a.kd||a.Ie||a.link||a.Kb)return!0;if("undefined"!=typeof XMLHttpRequest)throw 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(ka)try{a.Kb=Wb(ka(a.url),!0),a.Ob=a.Kb.length}catch(b){throw new FS.Gb(29);}else throw Error("Cannot load without read() or XMLHttpRequest.");},createLazyFile:(a,b,c,d,e)=>{function f(){this.md=!1;this.Oc=[]}f.prototype.get=function(n){if(!(n>this.length-1||0>n)){var p=n%this.chunkSize;return this.Qc(n/this.chunkSize|0)[p]}};f.prototype.ge=function(n){this.Qc=n};f.prototype.Cd=function(){var n=new XMLHttpRequest;n.open("HEAD",c,!1);n.send(null);if(!(200<=n.status&&300>n.status||304===n.status))throw Error("Couldn't load "+
c+". Status: "+n.status);var p=Number(n.getResponseHeader("Content-length")),q,t=(q=n.getResponseHeader("Accept-Ranges"))&&"bytes"===q;n=(q=n.getResponseHeader("Content-Encoding"))&&"gzip"===q;var m=1048576;t||(m=p);var u=this;u.ge(x=>{var C=x*m,K=(x+1)*m-1;K=Math.min(K,p-1);if("undefined"==typeof u.Oc[x]){var T=u.Oc;if(C>K)throw Error("invalid range ("+C+", "+K+") or no bytes requested!");if(K>p-1)throw Error("only "+p+" bytes available! programmer error!");var L=new XMLHttpRequest;L.open("GET",
c,!1);p!==m&&L.setRequestHeader("Range","bytes="+C+"-"+K);L.responseType="arraybuffer";L.overrideMimeType&&L.overrideMimeType("text/plain; charset=x-user-defined");L.send(null);if(!(200<=L.status&&300>L.status||304===L.status))throw Error("Couldn't load "+c+". Status: "+L.status);C=void 0!==L.response?new Uint8Array(L.response||[]):Wb(L.responseText||"",!0);T[x]=C}if("undefined"==typeof u.Oc[x])throw Error("doXHR failed!");return u.Oc[x]});if(n||!p)m=p=1,m=p=this.Qc(0).length,ta("LazyFiles on gzip forces download of the whole file when length is accessed");
this.je=p;this.ie=m;this.md=!0};if("undefined"!=typeof XMLHttpRequest){if(!ia)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var g=new f;Object.defineProperties(g,{length:{get:function(){this.md||this.Cd();return this.je}},chunkSize:{get:function(){this.md||this.Cd();return this.ie}}});g={kd:!1,Kb:g}}else g={kd:!1,url:c};var h=FS.qe(a,b,g,d,e);g.Kb?h.Kb=g.Kb:g.url&&(h.Kb=null,h.url=g.url);Object.defineProperties(h,{Ob:{get:function(){return this.Kb.length}}});
var l={};Object.keys(h.Ib).forEach(n=>{var p=h.Ib[n];l[n]=function(){FS.Qd(h);return p.apply(null,arguments)}});l.read=(n,p,q,t,m)=>{FS.Qd(h);n=n.node.Kb;if(m>=n.length)return 0;t=Math.min(n.length-m,t);if(n.slice)for(var u=0;u<t;u++)p[q+u]=n[m+u];else for(u=0;u<t;u++)p[q+u]=n.get(m+u);return t};h.Ib=l;return h},createPreloadedFile:(a,b,c,d,e,f,g,h,l,n)=>{function p(m){function u(x){n&&n();h||FS.Pc(a,b,x,d,e,l);f&&f();pb(t)}fc.tf(m,q,u,()=>{g&&g();pb(t)})||u(m)}var q=b?Rb(O(a,b)):a,t="cp "+q;ob(t);
"string"==typeof c?ac(c,m=>p(m),g):p(c)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,zd:()=>"EM_FS_"+window.location.pathname,Ad:20,Dc:"FILE_DATA",yf:(a,b,c)=>{b=b||(()=>{});c=c||(()=>{});var d=FS.indexedDB();try{var e=d.open(FS.zd(),FS.Ad)}catch(f){return c(f)}e.onupgradeneeded=()=>{ta("creating db");e.result.createObjectStore(FS.Dc)};e.onsuccess=()=>{var f=e.result.transaction([FS.Dc],"readwrite"),g=f.objectStore(FS.Dc),h=0,l=0,n=a.length;a.forEach(p=>
{p=g.put(FS.analyzePath(p).object.Kb,p);p.onsuccess=()=>{h++;h+l==n&&(0==l?b():c())};p.onerror=()=>{l++;h+l==n&&(0==l?b():c())}});f.onerror=c};e.onerror=c},uf:(a,b,c)=>{b=b||(()=>{});c=c||(()=>{});var d=FS.indexedDB();try{var e=d.open(FS.zd(),FS.Ad)}catch(f){return c(f)}e.onupgradeneeded=c;e.onsuccess=()=>{var f=e.result;try{var g=f.transaction([FS.Dc],"readonly")}catch(q){c(q);return}var h=g.objectStore(FS.Dc),l=0,n=0,p=a.length;a.forEach(q=>{var t=h.get(q);t.onsuccess=()=>{FS.analyzePath(q).exists&&
FS.unlink(q);FS.Pc(Nb(q),Ob(q),t.result,!0,!0,!0);l++;l+n==p&&(0==n?b():c())};t.onerror=()=>{n++;l+n==p&&(0==n?b():c())}});g.onerror=c};e.onerror=c}};function gc(a,b,c){if(r){if(na.isAbsolute(b))return b}else if("/"===b[0])return b;if(-100===a)a=FS.cwd();else{a=FS.fc(a);if(!a)throw new FS.Gb(8);a=a.path}if(0==b.length){if(!c)throw new FS.Gb(44);return a}return O(a,b)}
function hc(a,b,c){try{var d=a(b)}catch(e){if(e&&e.node&&Mb(b)!==Mb(FS.getPath(e.node)))return-54;throw e;}D[c>>2]=d.dev;D[c+4>>2]=0;D[c+8>>2]=d.ino;D[c+12>>2]=d.mode;D[c+16>>2]=d.nlink;D[c+20>>2]=d.uid;D[c+24>>2]=d.gid;D[c+28>>2]=d.rdev;D[c+32>>2]=0;Va[c+40>>3]=BigInt(d.size);D[c+48>>2]=4096;D[c+52>>2]=d.blocks;D[c+56>>2]=d.atime.getTime()/1E3|0;D[c+60>>2]=0;D[c+64>>2]=d.mtime.getTime()/1E3|0;D[c+68>>2]=0;D[c+72>>2]=d.ctime.getTime()/1E3|0;D[c+76>>2]=0;Va[c+80>>3]=BigInt(d.ino);return 0}var ic=void 0;
function jc(){ic+=4;return D[ic-4>>2]}function kc(a){a=FS.fc(a);if(!a)throw new FS.Gb(8);return a}function lc(a){if(v)return N(4,1,a);try{var b=kc(a);return FS.open(b.path,b.flags,0).fd}catch(c){if("undefined"==typeof FS||!(c instanceof FS.Gb))throw c;return-c.Mb}}
function mc(a,b,c,d){if(v)return N(6,1,a,b,c,d);try{b=A(b);b=gc(a,b);if(c&-8)var e=-28;else{var f=FS.lookupPath(b,{follow:!0}).node;f?(a="",c&4&&(a+="r"),c&2&&(a+="w"),c&1&&(a+="x"),e=a&&FS.rc(f,a)?-2:0):e=-44}return e}catch(g){if("undefined"==typeof FS||!(g instanceof FS.Gb))throw g;return-g.Mb}}
function nc(a,b,c){if(v)return N(7,1,a,b,c);ic=c;try{var d=kc(a);switch(b){case 0:var e=jc();return 0>e?-28:FS.open(d.path,d.flags,0,e).fd;case 1:case 2:return 0;case 3:return d.flags;case 4:return e=jc(),d.flags|=e,0;case 5:return e=jc(),Ka[e+0>>1]=2,0;case 6:case 7:return 0;case 16:case 8:return-28;case 9:return D[oc()>>2]=28,-1;default:return-28}}catch(f){if("undefined"==typeof FS||!(f instanceof FS.Gb))throw f;return-f.Mb}}
function pc(a,b){if(v)return N(8,1,a,b);try{var c=kc(a);return hc(FS.stat,c.path,b)}catch(d){if("undefined"==typeof FS||!(d instanceof FS.Gb))throw d;return-d.Mb}}function qc(a,b,c){if(v)return N(9,1,a,b,c);try{return FS.ftruncate(a,b),0}catch(d){if("undefined"==typeof FS||!(d instanceof FS.Gb))throw d;return-d.Mb}}
function rc(a,b){if(v)return N(10,1,a,b);try{if(0===b)return-28;var c=FS.cwd();if(b<Fa(c)+1)return-68;Ea(c,B,a,b);return a}catch(d){if("undefined"==typeof FS||!(d instanceof FS.Gb))throw d;return-d.Mb}}
function sc(a,b,c){if(v)return N(11,1,a,b,c);ic=c;try{var d=kc(a);switch(b){case 21509:case 21505:return d.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return d.tty?0:-59;case 21519:if(!d.tty)return-59;var e=jc();return D[e>>2]=0;case 21520:return d.tty?-28:-59;case 21531:return e=jc(),FS.Fc(d,b,e);case 21523:return d.tty?0:-59;case 21524:return d.tty?0:-59;default:z("bad ioctl syscall "+b)}}catch(f){if("undefined"==typeof FS||!(f instanceof FS.Gb))throw f;return-f.Mb}}
function tc(a,b){if(v)return N(12,1,a,b);try{return a=A(a),hc(FS.lstat,a,b)}catch(c){if("undefined"==typeof FS||!(c instanceof FS.Gb))throw c;return-c.Mb}}function uc(a,b,c,d){if(v)return N(13,1,a,b,c,d);try{b=A(b);var e=d&256;b=gc(a,b,d&4096);return hc(e?FS.lstat:FS.stat,b,c)}catch(f){if("undefined"==typeof FS||!(f instanceof FS.Gb))throw f;return-f.Mb}}
function vc(a,b,c,d){if(v)return N(14,1,a,b,c,d);ic=d;try{b=A(b);b=gc(a,b);var e=d?jc():0;return FS.open(b,c,e).fd}catch(f){if("undefined"==typeof FS||!(f instanceof FS.Gb))throw f;return-f.Mb}}
var G={Yb:8192,mount:function(){return FS.createNode(null,"/",16895,0)},re:function(){var a={Pb:[],be:2};a.Pb.push({buffer:new Uint8Array(G.Yb),offset:0,ac:0});var b=G.Jc(),c=G.Jc(),d=FS.createNode(G.root,b,4096,0),e=FS.createNode(G.root,c,4096,0);d.pipe=a;e.pipe=a;a=FS.bd({path:b,node:d,flags:0,seekable:!1,Ib:G.Ib});d.stream=a;c=FS.bd({path:c,node:e,flags:1,seekable:!1,Ib:G.Ib});e.stream=c;return{Ve:a.fd,mf:c.fd}},Ib:{$d:function(a){var b=a.node.pipe;if(1===(a.flags&2097155))return 260;if(0<b.Pb.length)for(a=
0;a<b.Pb.length;a++){var c=b.Pb[a];if(0<c.offset-c.ac)return 65}return 0},Fc:function(){return 28},fsync:function(){return 28},read:function(a,b,c,d){a=a.node.pipe;for(var e=0,f=0;f<a.Pb.length;f++){var g=a.Pb[f];e+=g.offset-g.ac}b instanceof ArrayBuffer||b instanceof SharedArrayBuffer||ArrayBuffer.isView(b)||z(void 0);b=b.subarray(c,c+d);if(0>=d)return 0;if(0==e)throw new FS.Gb(6);c=d=Math.min(e,d);for(f=e=0;f<a.Pb.length;f++){g=a.Pb[f];var h=g.offset-g.ac;if(d<=h){var l=g.buffer.subarray(g.ac,g.offset);
d<h?(l=l.subarray(0,d),g.ac+=d):e++;b.set(l);break}else l=g.buffer.subarray(g.ac,g.offset),b.set(l),b=b.subarray(l.byteLength),d-=l.byteLength,e++}e&&e==a.Pb.length&&(e--,a.Pb[e].offset=0,a.Pb[e].ac=0);a.Pb.splice(0,e);return c},write:function(a,b,c,d){a=a.node.pipe;b instanceof ArrayBuffer||b instanceof SharedArrayBuffer||ArrayBuffer.isView(b)||z(void 0);b=b.subarray(c,c+d);c=b.byteLength;if(0>=c)return 0;0==a.Pb.length?(d={buffer:new Uint8Array(G.Yb),offset:0,ac:0},a.Pb.push(d)):d=a.Pb[a.Pb.length-
1];d.offset<=G.Yb||z(void 0);var e=G.Yb-d.offset;if(e>=c)return d.buffer.set(b,d.offset),d.offset+=c,c;0<e&&(d.buffer.set(b.subarray(0,e),d.offset),d.offset+=e,b=b.subarray(e,b.byteLength));d=b.byteLength/G.Yb|0;e=b.byteLength%G.Yb;for(var f=0;f<d;f++){var g={buffer:new Uint8Array(G.Yb),offset:G.Yb,ac:0};a.Pb.push(g);g.buffer.set(b.subarray(0,G.Yb));b=b.subarray(G.Yb,b.byteLength)}0<e&&(g={buffer:new Uint8Array(G.Yb),offset:b.byteLength,ac:0},a.Pb.push(g),g.buffer.set(b));return c},close:function(a){a=
a.node.pipe;a.be--;0===a.be&&(a.Pb=null)}},Jc:function(){G.Jc.current||(G.Jc.current=0);return"pipe["+G.Jc.current++ +"]"}};function wc(a){if(v)return N(15,1,a);try{if(0==a)throw new FS.Gb(21);var b=G.re();D[a>>2]=b.Ve;D[a+4>>2]=b.mf;return 0}catch(c){if("undefined"==typeof FS||!(c instanceof FS.Gb))throw c;return-c.Mb}}
function xc(a,b,c){if(v)return N(16,1,a,b,c);try{for(var d=c=0;d<b;d++){var e=a+8*d,f=Ka[e+4>>1],g=32,h=FS.fc(D[e>>2]);h&&(g=5,h.Ib.$d&&(g=h.Ib.$d(h)));(g&=f|24)&&c++;Ka[e+6>>1]=g}return c}catch(l){if("undefined"==typeof FS||!(l instanceof FS.Gb))throw l;return-l.Mb}}
function yc(a,b,c,d){if(v)return N(17,1,a,b,c,d);try{b=A(b);b=gc(a,b);if(0>=d)var e=-28;else{var f=FS.readlink(b),g=Math.min(d,Fa(f)),h=E[c+g];Ea(f,B,c,d+1);E[c+g]=h;e=g}return e}catch(l){if("undefined"==typeof FS||!(l instanceof FS.Gb))throw l;return-l.Mb}}function zc(a){if(v)return N(18,1,a);try{return a=A(a),FS.rmdir(a),0}catch(b){if("undefined"==typeof FS||!(b instanceof FS.Gb))throw b;return-b.Mb}}
function Ac(a,b){if(v)return N(19,1,a,b);try{return a=A(a),hc(FS.stat,a,b)}catch(c){if("undefined"==typeof FS||!(c instanceof FS.Gb))throw c;return-c.Mb}}function Bc(a,b,c){if(v)return N(20,1,a,b,c);try{return b=A(b),b=gc(a,b),0===c?FS.unlink(b):512===c?FS.rmdir(b):z("Invalid flags passed to unlinkat"),0}catch(d){if("undefined"==typeof FS||!(d instanceof FS.Gb))throw d;return-d.Mb}}var Cc={};function Dc(a){for(;a.length;){var b=a.pop();a.pop()(b)}}
function Ec(a){return this.fromWireType(F[a>>2])}var Fc={},Gc={},Hc={};function Ic(a){if(void 0===a)return"_unknown";a=a.replace(/[^a-zA-Z0-9_]/g,"$");var b=a.charCodeAt(0);return 48<=b&&57>=b?"_"+a:a}function Jc(a,b){a=Ic(a);return(new Function("body","return function "+a+'() {\n    "use strict";    return body.apply(this, arguments);\n};\n'))(b)}
function Kc(a){var b=Error,c=Jc(a,function(d){this.name=a;this.message=d;d=Error(d).stack;void 0!==d&&(this.stack=this.toString()+"\n"+d.replace(/^Error(:[^\n]*)?\n/,""))});c.prototype=Object.create(b.prototype);c.prototype.constructor=c;c.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message};return c}var Lc=void 0;function Mc(a){throw new Lc(a);}
function Nc(a,b,c){function d(h){h=c(h);h.length!==a.length&&Mc("Mismatched type converter count");for(var l=0;l<a.length;++l)Q(a[l],h[l])}a.forEach(function(h){Hc[h]=b});var e=Array(b.length),f=[],g=0;b.forEach((h,l)=>{Gc.hasOwnProperty(h)?e[l]=Gc[h]:(f.push(h),Fc.hasOwnProperty(h)||(Fc[h]=[]),Fc[h].push(()=>{e[l]=Gc[h];++g;g===f.length&&d(e)}))});0===f.length&&d(e)}var Oc=void 0;function R(a){for(var b="";B[a];)b+=Oc[B[a++]];return b}var Pc=void 0;function S(a){throw new Pc(a);}
function Q(a,b,c={}){if(!("argPackAdvance"in b))throw new TypeError("registerType registeredInstance requires argPackAdvance");var d=b.name;a||S('type "'+d+'" must have a positive integer typeid pointer');if(Gc.hasOwnProperty(a)){if(c.Fe)return;S("Cannot register type '"+d+"' twice")}Gc[a]=b;delete Hc[a];Fc.hasOwnProperty(a)&&(b=Fc[a],delete Fc[a],b.forEach(e=>e()))}
function Qc(a){switch(a){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+a);}}function Rc(a,b){switch(b){case 2:return Ua;case 3:return Xa;default:throw new TypeError("Unknown float type: "+a);}}function Sc(a,b,c){switch(b){case 0:return c?E:B;case 1:return c?Ka:Ia;case 2:return c?D:F;case 3:return c?Va:Wa;default:throw new TypeError("Unknown integer type: "+a);}}
function Tc(a){if(null===a)return"null";var b=typeof a;return"object"===b||"array"===b||"function"===b?a.toString():""+a}function Uc(a,b,c){var d=Sc(a,b,c);switch(b){case 0:return function(e){return d[e]};case 1:return function(e){return d[e>>1]};case 2:return function(e){return d[e>>2]};case 3:return function(e){return d[e>>3]}}}function Vc(a){S(a.Hb.Qb.Lb.name+" instance already deleted")}var Wc=!1,Xc=!1;function Yc(){}
function Zc(a){--a.count.value;0===a.count.value&&(a.Vb?a.bc.oc(a.Vb):a.Qb.Lb.oc(a.Nb))}function $c(a,b,c){if(b===c)return a;if(void 0===c.dc)return null;a=$c(a,b,c.dc);return null===a?null:c.ue(a)}var ad={},bd=[];function cd(){for(;bd.length;){var a=bd.pop();a.Hb.Ac=!1;a["delete"]()}}var dd=void 0,ed={};function fd(a,b){for(void 0===b&&S("ptr should not be undefined");a.dc;)b=a.Nc(b),a=a.dc;return ed[b]}
function gd(a,b){b.Qb&&b.Nb||Mc("makeClassHandle requires ptr and ptrType");!!b.bc!==!!b.Vb&&Mc("Both smartPtrType and smartPtr must be specified");b.count={value:1};return hd(Object.create(a,{Hb:{value:b}}))}function hd(a){if(Wc)return hd=b=>b.deleteLater(),hd(a);if("undefined"===typeof FinalizationRegistry)return hd=b=>b,a;Xc=new FinalizationRegistry(b=>{Zc(b.Hb)});hd=b=>{var c=b.Hb;c.Vb&&Xc.register(b,{Hb:c},b);return b};Yc=b=>{Xc.unregister(b)};return hd(a)}function jd(){}
function kd(a,b,c){if(void 0===a[b].Rb){var d=a[b];a[b]=function(){a[b].Rb.hasOwnProperty(arguments.length)||S("Function '"+c+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+a[b].Rb+")!");return a[b].Rb[arguments.length].apply(this,arguments)};a[b].Rb=[];a[b].Rb[d.zc]=d}}
function ld(a,b,c){k.hasOwnProperty(a)?((void 0===c||void 0!==k[a].Rb&&void 0!==k[a].Rb[c])&&S("Cannot register public name '"+a+"' twice"),kd(k,a,a),k.hasOwnProperty(c)&&S("Cannot register multiple overloads of a function with the same number of arguments ("+c+")!"),k[a].Rb[c]=b):(k[a]=b,void 0!==c&&(k[a].xf=c))}function md(a,b,c,d,e,f,g,h){this.name=a;this.constructor=b;this.qc=c;this.oc=d;this.dc=e;this.ze=f;this.Nc=g;this.ue=h;this.Se=[]}
function nd(a,b,c){for(;b!==c;)b.Nc||S("Expected null or instance of "+c.name+", got an instance of "+b.name),a=b.Nc(a),b=b.dc;return a}function od(a,b){if(null===b)return this.ld&&S("null is not a valid "+this.name),0;b.Hb||S('Cannot pass "'+Tc(b)+'" as a '+this.name);b.Hb.Nb||S("Cannot pass deleted object as a pointer of type "+this.name);return nd(b.Hb.Nb,b.Hb.Qb.Lb,this.Lb)}
function pd(a,b){if(null===b){this.ld&&S("null is not a valid "+this.name);if(this.Tc){var c=this.sd();null!==a&&a.push(this.oc,c);return c}return 0}b.Hb||S('Cannot pass "'+Tc(b)+'" as a '+this.name);b.Hb.Nb||S("Cannot pass deleted object as a pointer of type "+this.name);!this.Rc&&b.Hb.Qb.Rc&&S("Cannot convert argument of type "+(b.Hb.bc?b.Hb.bc.name:b.Hb.Qb.name)+" to parameter type "+this.name);c=nd(b.Hb.Nb,b.Hb.Qb.Lb,this.Lb);if(this.Tc)switch(void 0===b.Hb.Vb&&S("Passing raw pointer to smart pointer is illegal"),
this.df){case 0:b.Hb.bc===this?c=b.Hb.Vb:S("Cannot convert argument of type "+(b.Hb.bc?b.Hb.bc.name:b.Hb.Qb.name)+" to parameter type "+this.name);break;case 1:c=b.Hb.Vb;break;case 2:if(b.Hb.bc===this)c=b.Hb.Vb;else{var d=b.clone();c=this.Ue(c,U(function(){d["delete"]()}));null!==a&&a.push(this.oc,c)}break;default:S("Unsupporting sharing policy")}return c}
function qd(a,b){if(null===b)return this.ld&&S("null is not a valid "+this.name),0;b.Hb||S('Cannot pass "'+Tc(b)+'" as a '+this.name);b.Hb.Nb||S("Cannot pass deleted object as a pointer of type "+this.name);b.Hb.Qb.Rc&&S("Cannot convert argument of type "+b.Hb.Qb.name+" to parameter type "+this.name);return nd(b.Hb.Nb,b.Hb.Qb.Lb,this.Lb)}
function rd(a,b,c,d){this.name=a;this.Lb=b;this.ld=c;this.Rc=d;this.Tc=!1;this.oc=this.Ue=this.sd=this.ae=this.df=this.Re=void 0;void 0!==b.dc?this.toWireType=pd:(this.toWireType=d?od:qd,this.Ub=null)}function sd(a,b,c){k.hasOwnProperty(a)||Mc("Replacing nonexistant public symbol");void 0!==k[a].Rb&&void 0!==c?k[a].Rb[c]=b:(k[a]=b,k[a].zc=c)}function V(a,b){a=R(a);var c=I(b);"function"!=typeof c&&S("unknown function pointer with signature "+a+": "+b);return c}var td=void 0;
function ud(a){a=vd(a);var b=R(a);W(a);return b}function wd(a,b){function c(f){e[f]||Gc[f]||(Hc[f]?Hc[f].forEach(c):(d.push(f),e[f]=!0))}var d=[],e={};b.forEach(c);throw new td(a+": "+d.map(ud).join([", "]));}function xd(a){var b=Function;if(!(b instanceof Function))throw new TypeError("new_ called with constructor type "+typeof b+" which is not a function");var c=Jc(b.name||"unknownFunctionName",function(){});c.prototype=b.prototype;c=new c;a=b.apply(c,a);return a instanceof Object?a:c}
function yd(a,b,c,d,e){var f=b.length;2>f&&S("argTypes array size mismatch! Must at least get return value and 'this' types!");var g=null!==b[1]&&null!==c,h=!1;for(c=1;c<b.length;++c)if(null!==b[c]&&void 0===b[c].Ub){h=!0;break}var l="void"!==b[0].name,n="",p="";for(c=0;c<f-2;++c)n+=(0!==c?", ":"")+"arg"+c,p+=(0!==c?", ":"")+"arg"+c+"Wired";a="return function "+Ic(a)+"("+n+") {\nif (arguments.length !== "+(f-2)+") {\nthrowBindingError('function "+a+" called with ' + arguments.length + ' arguments, expected "+
(f-2)+" args!');\n}\n";h&&(a+="var destructors = [];\n");var q=h?"destructors":"null";n="throwBindingError invoker fn runDestructors retType classParam".split(" ");d=[S,d,e,Dc,b[0],b[1]];g&&(a+="var thisWired = classParam.toWireType("+q+", this);\n");for(c=0;c<f-2;++c)a+="var arg"+c+"Wired = argType"+c+".toWireType("+q+", arg"+c+"); // "+b[c+2].name+"\n",n.push("argType"+c),d.push(b[c+2]);g&&(p="thisWired"+(0<p.length?", ":"")+p);a+=(l?"var rv = ":"")+"invoker(fn"+(0<p.length?", ":"")+p+");\n";if(h)a+=
"runDestructors(destructors);\n";else for(c=g?1:2;c<b.length;++c)f=1===c?"thisWired":"arg"+(c-2)+"Wired",null!==b[c].Ub&&(a+=f+"_dtor("+f+"); // "+b[c].name+"\n",n.push(f+"_dtor"),d.push(b[c].Ub));l&&(a+="var ret = retType.fromWireType(rv);\nreturn ret;\n");n.push(a+"}\n");return xd(n).apply(null,d)}function zd(a,b){for(var c=[],d=0;d<a;d++)c.push(D[(b>>2)+d]);return c}
function Ad(a,b,c){a instanceof Object||S(c+' with invalid "this": '+a);a instanceof b.Lb.constructor||S(c+' incompatible with "this" of type '+a.constructor.name);a.Hb.Nb||S("cannot call emscripten binding method "+c+" on deleted object");return nd(a.Hb.Nb,a.Hb.Qb.Lb,b.Lb)}var Bd=[],X=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function Cd(a){4<a&&0===--X[a].vd&&(X[a]=void 0,Bd.push(a))}
var Y=a=>{a||S("Cannot use deleted val. handle = "+a);return X[a].value},U=a=>{switch(a){case void 0:return 1;case null:return 2;case !0:return 3;case !1:return 4;default:var b=Bd.length?Bd.pop():X.length;X[b]={vd:1,value:a};return b}};function Dd(a,b,c){var d=Sc(a,b,c);switch(b){case 0:return function(e){return this.fromWireType(d[e])};case 1:return function(e){return this.fromWireType(d[e>>1])};case 2:return function(e){return this.fromWireType(d[e>>2])}}}
function Ed(a,b){var c=Gc[a];void 0===c&&S(b+" has unknown type "+ud(a));return c}function Fd(a,b){var c=Rc(a,b);switch(b){case 2:return function(d){return this.fromWireType(c[d>>2])};case 3:return function(d){return this.fromWireType(c[d>>3])}}}function Gd(a,b){for(var c=Array(a),d=0;d<a;++d)c[d]=Ed(D[(b>>2)+d],"parameter "+d);return c}var Hd={};function Id(a){var b=Hd[a];return void 0===b?R(a):b}var Jd=[];function Kd(){return"object"==typeof globalThis?globalThis:Function("return this")()}
function Ld(a){var b=Jd.length;Jd.push(a);return b}var Md=[],Nd={};function Pd(a,b,c,d,e,f,g,h){if(v)return N(21,1,a,b,c,d,e,f,g,h);try{var l=FS.fc(e);if(!l)return-8;var n=FS.mc(l,a,b,f,c,d),p=n.Nb;D[g>>2]=n.ad;return p}catch(q){if("undefined"==typeof FS||!(q instanceof FS.Gb))throw q;return-q.Mb}}
function Qd(a,b,c,d,e,f){if(v)return N(22,1,a,b,c,d,e,f);try{var g=FS.fc(e);if(g&&c&2){var h=B.slice(a,a+b);FS.nc(g,h,f,b,d)}}catch(l){if("undefined"==typeof FS||!(l instanceof FS.Gb))throw l;return-l.Mb}}
function Rd(a,b,c){function d(l){return(l=l.toTimeString().match(/\(([A-Za-z ]+)\)$/))?l[1]:"GMT"}if(v)return N(23,1,a,b,c);var e=(new Date).getFullYear(),f=new Date(e,0,1),g=new Date(e,6,1);e=f.getTimezoneOffset();var h=g.getTimezoneOffset();D[a>>2]=60*Math.max(e,h);D[b>>2]=Number(e!=h);a=d(f);b=d(g);a=Pa(a);b=Pa(b);h<e?(D[c>>2]=a,D[c+4>>2]=b):(D[c>>2]=b,D[c+4>>2]=a)}function Sd(a,b,c){Sd.ke||(Sd.ke=!0,Rd(a,b,c))}var Td;
Td=r?()=>{var a=process.hrtime();return 1E3*a[0]+a[1]/1E6}:v?()=>performance.now()-k.__performance_now_clock_drift:()=>performance.now();function Ab(){return r?require("os").cpus().length:navigator.hardwareConcurrency}function N(a,b){var c=arguments.length-2,d=arguments;return wb(function(){for(var e=2*c,f=Sa(8*e),g=f>>3,h=0;h<c;h++){var l=d[2+h];"bigint"==typeof l?(Va[g+2*h]=BigInt(1),Va[g+2*h+1]=l):(Va[g+2*h]=BigInt(0),Xa[g+2*h+1]=l)}return Ud(a,e,f,b)})}var Vd=[],Wd={};
function Xd(){if(!Yd){var a={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",_:ea||"./this.program"},b;for(b in Wd)void 0===Wd[b]?delete a[b]:a[b]=Wd[b];var c=[];for(b in a)c.push(b+"="+a[b]);Yd=c}return Yd}var Yd;
function Zd(a,b){if(v)return N(24,1,a,b);var c=0;Xd().forEach(function(d,e){var f=b+c;e=D[a+4*e>>2]=f;for(f=0;f<d.length;++f)E[e++>>0]=d.charCodeAt(f);E[e>>0]=0;c+=d.length+1});return 0}function $d(a,b){if(v)return N(25,1,a,b);var c=Xd();D[a>>2]=c.length;var d=0;c.forEach(function(e){d+=e.length+1});D[b>>2]=d;return 0}function ae(a){if(v)return N(26,1,a);try{var b=kc(a);FS.close(b);return 0}catch(c){if("undefined"==typeof FS||!(c instanceof FS.Gb))throw c;return c.Mb}}
function be(a,b){if(v)return N(27,1,a,b);try{var c=kc(a),d=c.tty?2:FS.isDir(c.mode)?3:FS.isLink(c.mode)?7:4;E[b>>0]=d;return 0}catch(e){if("undefined"==typeof FS||!(e instanceof FS.Gb))throw e;return e.Mb}}function ce(a,b,c,d){if(v)return N(28,1,a,b,c,d);try{a:{for(var e=kc(a),f=a=0;f<c;f++){var g=D[b+(8*f+4)>>2],h=FS.read(e,E,D[b+8*f>>2],g,void 0);if(0>h){var l=-1;break a}a+=h;if(h<g)break}l=a}D[d>>2]=l;return 0}catch(n){if("undefined"==typeof FS||!(n instanceof FS.Gb))throw n;return n.Mb}}
function de(a,b,c,d){if(v)return N(29,1,a,b,c,d);try{var e=Number(b&BigInt(4294967295))|0,f=Number(b>>BigInt(32))|0,g=kc(a);a=4294967296*f+(e>>>0);if(-9007199254740992>=a||9007199254740992<=a)return-61;FS.llseek(g,a,c);Va[d>>3]=BigInt(g.position);g.gd&&0===a&&0===c&&(g.gd=null);return 0}catch(h){if("undefined"==typeof FS||!(h instanceof FS.Gb))throw h;return h.Mb}}
function ee(a,b,c,d){if(v)return N(30,1,a,b,c,d);try{a:{for(var e=kc(a),f=a=0;f<c;f++){var g=FS.write(e,E,D[b+8*f>>2],D[b+(8*f+4)>>2],void 0);if(0>g){var h=-1;break a}a+=g}h=a}D[d>>2]=h;return 0}catch(l){if("undefined"==typeof FS||!(l instanceof FS.Gb))throw l;return l.Mb}}function fe(a){if(v)return N(31,1,a);ge(a)}function he(a){return 0===a%4&&(0!==a%100||0===a%400)}var ie=[31,29,31,30,31,30,31,31,30,31,30,31],je=[31,28,31,30,31,30,31,31,30,31,30,31];H.init();
function ke(a,b,c,d){a||(a=this);this.parent=a;this.mount=a.mount;this.Hc=null;this.id=FS.Ne++;this.name=b;this.mode=c;this.Jb={};this.Ib={};this.rdev=d}Object.defineProperties(ke.prototype,{read:{get:function(){return 365===(this.mode&365)},set:function(a){a?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146===(this.mode&146)},set:function(a){a?this.mode|=146:this.mode&=-147}},Ie:{get:function(){return FS.isDir(this.mode)}},kd:{get:function(){return FS.isChrdev(this.mode)}}});
FS.fe=ke;FS.wd();var fc;k.FS_createPath=FS.Fd;k.FS_createDataFile=FS.Pc;k.FS_createPreloadedFile=FS.createPreloadedFile;k.FS_createLazyFile=FS.createLazyFile;k.FS_createDevice=FS.ec;k.FS_unlink=FS.unlink;r&&(oa(),NODEFS.wd());
bc={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,
ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,
EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};
if(r){var me=function(){var a=cc[le];return function(){try{return a.apply(this,arguments)}catch(b){if(b.code)throw new FS.Gb(bc[b.code]);throw b;}}},dc=Object.assign({},FS),le;for(le in cc)FS[le]=me()}else throw Error("NODERAWFS is currently only supported on Node.js environment.");Lc=k.InternalError=Kc("InternalError");for(var ne=Array(256),oe=0;256>oe;++oe)ne[oe]=String.fromCharCode(oe);Oc=ne;Pc=k.BindingError=Kc("BindingError");
jd.prototype.isAliasOf=function(a){if(!(this instanceof jd&&a instanceof jd))return!1;var b=this.Hb.Qb.Lb,c=this.Hb.Nb,d=a.Hb.Qb.Lb;for(a=a.Hb.Nb;b.dc;)c=b.Nc(c),b=b.dc;for(;d.dc;)a=d.Nc(a),d=d.dc;return b===d&&c===a};
jd.prototype.clone=function(){this.Hb.Nb||Vc(this);if(this.Hb.Kc)return this.Hb.count.value+=1,this;var a=hd,b=Object,c=b.create,d=Object.getPrototypeOf(this),e=this.Hb;a=a(c.call(b,d,{Hb:{value:{count:e.count,Ac:e.Ac,Kc:e.Kc,Nb:e.Nb,Qb:e.Qb,Vb:e.Vb,bc:e.bc}}}));a.Hb.count.value+=1;a.Hb.Ac=!1;return a};jd.prototype["delete"]=function(){this.Hb.Nb||Vc(this);this.Hb.Ac&&!this.Hb.Kc&&S("Object already scheduled for deletion");Yc(this);Zc(this.Hb);this.Hb.Kc||(this.Hb.Vb=void 0,this.Hb.Nb=void 0)};
jd.prototype.isDeleted=function(){return!this.Hb.Nb};jd.prototype.deleteLater=function(){this.Hb.Nb||Vc(this);this.Hb.Ac&&!this.Hb.Kc&&S("Object already scheduled for deletion");bd.push(this);1===bd.length&&dd&&dd(cd);this.Hb.Ac=!0;return this};k.getInheritedInstanceCount=function(){return Object.keys(ed).length};k.getLiveInheritedInstances=function(){var a=[],b;for(b in ed)ed.hasOwnProperty(b)&&a.push(ed[b]);return a};k.setAutoDeleteLater=function(a){Wc=a};k.flushPendingDeletes=cd;
k.setDelayFunction=function(a){dd=a;bd.length&&dd&&dd(cd)};rd.prototype.Ce=function(a){this.ae&&(a=this.ae(a));return a};rd.prototype.Id=function(a){this.oc&&this.oc(a)};rd.prototype.argPackAdvance=8;rd.prototype.readValueFromPointer=Ec;rd.prototype.deleteObject=function(a){if(null!==a)a["delete"]()};
rd.prototype.fromWireType=function(a){function b(){return this.Tc?gd(this.Lb.qc,{Qb:this.Re,Nb:c,bc:this,Vb:a}):gd(this.Lb.qc,{Qb:this,Nb:a})}var c=this.Ce(a);if(!c)return this.Id(a),null;var d=fd(this.Lb,c);if(void 0!==d){if(0===d.Hb.count.value)return d.Hb.Nb=c,d.Hb.Vb=a,d.clone();d=d.clone();this.Id(a);return d}d=this.Lb.ze(c);d=ad[d];if(!d)return b.call(this);d=this.Rc?d.ne:d.pointerType;var e=$c(c,this.Lb,d.Lb);return null===e?b.call(this):this.Tc?gd(d.Lb.qc,{Qb:d,Nb:e,bc:this,Vb:a}):gd(d.Lb.qc,
{Qb:d,Nb:e})};td=k.UnboundTypeError=Kc("UnboundTypeError");k.count_emval_handles=function(){for(var a=0,b=5;b<X.length;++b)void 0!==X[b]&&++a;return a};k.get_first_emval=function(){for(var a=5;a<X.length;++a)if(void 0!==X[a])return X[a];return null};
var pe=[null,Gb,Jb,function(a){if(v)return N(3,1,a);try{return a=A(a),FS.chdir(a),0}catch(b){if("undefined"==typeof FS||!(b instanceof FS.Gb))throw b;return-b.Mb}},lc,function(a,b,c){if(v)return N(5,1,a,b,c);try{var d=kc(a);if(d.fd===b)return-28;var e=FS.fc(b);e&&FS.close(e);return FS.open(d.path,d.flags,0,b,b).fd}catch(f){if("undefined"==typeof FS||!(f instanceof FS.Gb))throw f;return-f.Mb}},mc,nc,pc,qc,rc,sc,tc,uc,vc,wc,xc,yc,zc,Ac,Bc,Pd,Qd,Rd,Zd,$d,ae,be,ce,de,ee,fe];
function Wb(a,b){var c=Array(Fa(a)+1);a=Ea(a,c,0,c.length);b&&(c.length=a);return c}
var Ie={e:function(a,b,c,d){z("Assertion failed: "+A(a)+", at: "+[b?A(b):"unknown filename",c,d?A(d):"unknown function"])},$a:function(a,b){I(a)(b)},la:function(a){qe(a,!ia,1,!ha);H.ee()},ia:function(a){v?postMessage({cmd:"cleanupThread",thread:a}):xb(a)},Y:function(){D[oc()>>2]=63;return-1},bb:Kb,Ca:lc,Da:mc,B:nc,ua:pc,qa:qc,pa:rc,Fa:sc,ra:tc,sa:uc,X:vc,fb:wc,eb:xc,_a:yc,Ya:zc,ta:Ac,ha:Bc,ea:function(a){var b=Cc[a];delete Cc[a];var c=b.sd,d=b.oc,e=b.Md,f=e.map(g=>g.Ee).concat(e.map(g=>g.bf));Nc([a],
f,g=>{var h={};e.forEach((l,n)=>{var p=g[n],q=l.Qc,t=l.De,m=g[n+e.length],u=l.af,x=l.cf;h[l.we]={read:C=>p.fromWireType(q(t,C)),write:(C,K)=>{var T=[];u(x,C,m.toWireType(T,K));Dc(T)}}});return[{name:b.name,fromWireType:function(l){var n={},p;for(p in h)n[p]=h[p].read(l);d(l);return n},toWireType:function(l,n){for(var p in h)if(!(p in n))throw new TypeError('Missing field:  "'+p+'"');var q=c();for(p in h)h[p].write(q,n[p]);null!==l&&l.push(d,q);return q},argPackAdvance:8,readValueFromPointer:Ec,Ub:d}]})},
da:function(a,b,c,d,e){b=R(b);var f=Qc(c);Q(a,{name:b,fromWireType:function(g){for(var h=F[g>>2],l=d?Rc(b,f):Sc(b,f,e),n=Array(h),p=g+c,q=0;q<h;++q)n[q]=l[(p>>f)+q];W(g);return n},toWireType:function(g,h){"number"==typeof h&&(h=[h]);Array.isArray(h)||S("Cannot pass non-array to C++ vector type "+b);h=Array.prototype.concat.apply([],h);var l=h.length,n=d?Rc(b,f):Sc(b,f,e),p=Qa(c+l*c);F[p>>2]=l;for(var q=p+c,t=0;t<l;++t)n[(q>>f)+t]=h[t];null!==g&&g.push(W,p);return p},argPackAdvance:8,readValueFromPointer:Ec,
Ub:function(g){W(g)}})},aa:function(a,b,c,d,e){b=R(b);c=Qc(c);var f=b.includes("u");f&&(e=(BigInt(1)<<BigInt(64))-BigInt(1));Q(a,{name:b,fromWireType:function(g){return g},toWireType:function(g,h){if("bigint"!=typeof h)throw new TypeError('Cannot convert "'+Tc(h)+'" to '+this.name);if(h<d||h>e)throw new TypeError('Passing a number "'+Tc(h)+'" from JS side to C/C++ side to an argument of type "'+b+'", which is outside the valid range ['+d+", "+e+"]!");return h},argPackAdvance:8,readValueFromPointer:Uc(b,
c,!f),Ub:null})},Ka:function(a,b,c,d,e){var f=Qc(c);b=R(b);Q(a,{name:b,fromWireType:function(g){return!!g},toWireType:function(g,h){return h?d:e},argPackAdvance:8,readValueFromPointer:function(g){var h=Sc(b,f,!0);return this.fromWireType(h[g>>f])},Ub:null})},z:function(a,b,c,d,e,f,g,h,l,n,p,q,t){p=R(p);f=V(e,f);h&&(h=V(g,h));n&&(n=V(l,n));t=V(q,t);var m=Ic(p);ld(m,function(){wd("Cannot construct "+p+" due to unbound types",[d])});Nc([a,b,c],d?[d]:[],function(u){u=u[0];if(d){var x=u.Lb;var C=x.qc}else C=
jd.prototype;u=Jc(m,function(){if(Object.getPrototypeOf(this)!==K)throw new Pc("Use 'new' to construct "+p);if(void 0===T.tc)throw new Pc(p+" has no accessible constructor");var Od=T.tc[arguments.length];if(void 0===Od)throw new Pc("Tried to invoke ctor of "+p+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(T.tc).toString()+") parameters instead!");return Od.apply(this,arguments)});var K=Object.create(C,{constructor:{value:u}});u.prototype=K;var T=new md(p,u,K,
t,x,f,h,n);x=new rd(p,T,!0,!1);C=new rd(p+"*",T,!1,!1);var L=new rd(p+" const*",T,!1,!0);ad[a]={pointerType:C,ne:L};sd(m,u);return[x,C,L]})},h:function(a,b,c,d,e,f,g){var h=zd(c,d);b=R(b);f=V(e,f);Nc([],[a],function(l){function n(){wd("Cannot call "+p+" due to unbound types",h)}l=l[0];var p=l.name+"."+b;b.startsWith("@@")&&(b=Symbol[b.substring(2)]);var q=l.Lb.constructor;void 0===q[b]?(n.zc=c-1,q[b]=n):(kd(q,b,p),q[b].Rb[c-1]=n);Nc([],h,function(t){t=[t[0],null].concat(t.slice(1));t=yd(p,t,null,
f,g);void 0===q[b].Rb?(t.zc=c-1,q[b]=t):q[b].Rb[c-1]=t;return[]});return[]})},A:function(a,b,c,d,e,f){0<b||z(void 0);var g=zd(b,c);e=V(d,e);Nc([],[a],function(h){h=h[0];var l="constructor "+h.name;void 0===h.Lb.tc&&(h.Lb.tc=[]);if(void 0!==h.Lb.tc[b-1])throw new Pc("Cannot register multiple constructors with identical number of parameters ("+(b-1)+") for class '"+h.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");h.Lb.tc[b-1]=()=>{wd("Cannot construct "+
h.name+" due to unbound types",g)};Nc([],g,function(n){n.splice(1,0,null);h.Lb.tc[b-1]=yd(l,n,null,e,f);return[]});return[]})},d:function(a,b,c,d,e,f,g,h){var l=zd(c,d);b=R(b);f=V(e,f);Nc([],[a],function(n){function p(){wd("Cannot call "+q+" due to unbound types",l)}n=n[0];var q=n.name+"."+b;b.startsWith("@@")&&(b=Symbol[b.substring(2)]);h&&n.Lb.Se.push(b);var t=n.Lb.qc,m=t[b];void 0===m||void 0===m.Rb&&m.className!==n.name&&m.zc===c-2?(p.zc=c-2,p.className=n.name,t[b]=p):(kd(t,b,q),t[b].Rb[c-2]=
p);Nc([],l,function(u){u=yd(q,u,n,f,g);void 0===t[b].Rb?(u.zc=c-2,t[b]=u):t[b].Rb[c-2]=u;return[]});return[]})},w:function(a,b,c,d,e,f,g,h,l,n){b=R(b);e=V(d,e);Nc([],[a],function(p){p=p[0];var q=p.name+"."+b,t={get:function(){wd("Cannot access "+q+" due to unbound types",[c,g])},enumerable:!0,configurable:!0};t.set=l?()=>{wd("Cannot access "+q+" due to unbound types",[c,g])}:()=>{S(q+" is a read-only property")};Object.defineProperty(p.Lb.qc,b,t);Nc([],l?[c,g]:[c],function(m){var u=m[0],x={get:function(){var K=
Ad(this,p,q+" getter");return u.fromWireType(e(f,K))},enumerable:!0};if(l){l=V(h,l);var C=m[1];x.set=function(K){var T=Ad(this,p,q+" setter"),L=[];l(n,T,C.toWireType(L,K));Dc(L)}}Object.defineProperty(p.Lb.qc,b,x);return[]});return[]})},Ja:function(a,b){b=R(b);Q(a,{name:b,fromWireType:function(c){var d=Y(c);Cd(c);return d},toWireType:function(c,d){return U(d)},argPackAdvance:8,readValueFromPointer:Ec,Ub:null})},p:function(a,b,c,d){function e(){}c=Qc(c);b=R(b);e.values={};Q(a,{name:b,constructor:e,
fromWireType:function(f){return this.constructor.values[f]},toWireType:function(f,g){return g.value},argPackAdvance:8,readValueFromPointer:Dd(b,c,d),Ub:null});ld(b,e)},f:function(a,b,c){var d=Ed(a,"enum");b=R(b);a=d.constructor;d=Object.create(d.constructor.prototype,{value:{value:c},constructor:{value:Jc(d.name+"_"+b,function(){})}});a.values[c]=d;a[b]=d},$:function(a,b,c){c=Qc(c);b=R(b);Q(a,{name:b,fromWireType:function(d){return d},toWireType:function(d,e){return e},argPackAdvance:8,readValueFromPointer:Fd(b,
c),Ub:null})},H:function(a,b,c,d,e,f){var g=zd(b,c);a=R(a);e=V(d,e);ld(a,function(){wd("Cannot call "+a+" due to unbound types",g)},b-1);Nc([],g,function(h){h=[h[0],null].concat(h.slice(1));sd(a,yd(a,h,null,e,f),b-1);return[]})},E:function(a,b,c,d,e){b=R(b);-1===e&&(e=4294967295);e=Qc(c);var f=h=>h;if(0===d){var g=32-8*c;f=h=>h<<g>>>g}c=b.includes("unsigned")?function(h,l){return l>>>0}:function(h,l){return l};Q(a,{name:b,fromWireType:f,toWireType:c,argPackAdvance:8,readValueFromPointer:Uc(b,e,0!==
d),Ub:null})},v:function(a,b,c){function d(f){f>>=2;return new e(Ta,F[f+1],F[f])}var e=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][b];c=R(c);Q(a,{name:c,fromWireType:d,argPackAdvance:8,readValueFromPointer:d},{Fe:!0})},_:function(a,b){b=R(b);var c="std::string"===b;Q(a,{name:b,fromWireType:function(d){var e=F[d>>2];if(c)for(var f=d+4,g=0;g<=e;++g){var h=d+4+g;if(g==e||0==B[h]){f=A(f,h-f);if(void 0===l)var l=f;else l+=
String.fromCharCode(0),l+=f;f=h+1}}else{l=Array(e);for(g=0;g<e;++g)l[g]=String.fromCharCode(B[d+4+g]);l=l.join("")}W(d);return l},toWireType:function(d,e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));var f="string"==typeof e;f||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int8Array||S("Cannot pass non-string to std::string");var g=(c&&f?()=>Fa(e):()=>e.length)(),h=Qa(4+g+1);F[h>>2]=g;if(c&&f)Ea(e,B,h+4,g+1);else if(f)for(f=0;f<g;++f){var l=e.charCodeAt(f);255<l&&(W(h),
S("String has UTF-16 code units that do not fit in 8 bits"));B[h+4+f]=l}else for(f=0;f<g;++f)B[h+4+f]=e[f];null!==d&&d.push(W,h);return h},argPackAdvance:8,readValueFromPointer:Ec,Ub:function(d){W(d)}})},R:function(a,b,c){c=R(c);if(2===b){var d=Ha;var e=Ja;var f=La;var g=1}else 4===b&&(d=Ma,e=Na,f=Oa,g=2);Q(a,{name:c,fromWireType:function(h){for(var l=F[h>>2],n=Sc(c,g,!1),p,q=h+4,t=0;t<=l;++t){var m=h+4+t*b;if(t==l||0==n[m>>g])q=d(q,m-q),void 0===p?p=q:(p+=String.fromCharCode(0),p+=q),q=m+b}W(h);
return p},toWireType:function(h,l){"string"!=typeof l&&S("Cannot pass non-string to C++ string type "+c);var n=f(l),p=Qa(4+n+b);F[p>>2]=n>>g;e(l,p+4,n+b);null!==h&&h.push(W,p);return p},argPackAdvance:8,readValueFromPointer:Ec,Ub:function(h){W(h)}})},fa:function(a,b,c,d,e,f){Cc[a]={name:R(b),sd:V(c,d),oc:V(e,f),Md:[]}},J:function(a,b,c,d,e,f,g,h,l,n){Cc[a].Md.push({we:R(b),Ee:c,Qc:V(d,e),De:f,bf:g,af:V(h,l),cf:n})},La:function(a,b){b=R(b);Q(a,{Je:!0,name:b,argPackAdvance:0,fromWireType:function(){},
toWireType:function(){}})},P:function(){return Date.now()},cb:function(){return 2097152},wa:function(){return!0},db:function(a,b,c,d){if(a==b)setTimeout(()=>{Db()&&Eb(d);Atomics.sub(D,d>>2,1)});else if(v)postMessage({targetThread:a,cmd:"processProxyingQueue",queue:d});else{a=(a=H.jc[a])&&a.worker;if(!a)return;a.postMessage({cmd:"processProxyingQueue",queue:d})}return 1},na:function(){return-1},Va:function(){throw Infinity;},l:function(a,b,c){a=Y(a);b=Ed(b,"emval::as");var d=[],e=U(d);D[c>>2]=e;return b.toWireType(d,
a)},V:function(a,b,c,d){a=Y(a);c=Gd(b,c);for(var e=Array(b),f=0;f<b;++f){var g=c[f];e[f]=g.readValueFromPointer(d);d+=g.argPackAdvance}a=a.apply(void 0,e);return U(a)},Za:function(a,b,c,d,e){a=Jd[a];b=Y(b);c=Id(c);var f=[];D[d>>2]=U(f);return a(b,c,f,e)},b:Cd,o:function(a){if(0===a)return U(Kd());a=Id(a);return U(Kd()[a])},hb:function(a,b){var c=Gd(a,b),d=c[0];b=d.name+"_$"+c.slice(1).map(function(p){return p.name}).join("_")+"$";var e=Md[b];if(void 0!==e)return e;e=["retType"];for(var f=[d],g="",
h=0;h<a-1;++h)g+=(0!==h?", ":"")+"arg"+h,e.push("argType"+h),f.push(c[1+h]);var l="return function "+Ic("methodCaller_"+b)+"(handle, name, destructors, args) {\n",n=0;for(h=0;h<a-1;++h)l+="    var arg"+h+" = argType"+h+".readValueFromPointer(args"+(n?"+"+n:"")+");\n",n+=c[h+1].argPackAdvance;l+="    var rv = handle[name]("+g+");\n";for(h=0;h<a-1;++h)c[h+1].deleteObject&&(l+="    argType"+h+".deleteObject(arg"+h+");\n");d.Je||(l+="    return retType.toWireType(destructors, rv);\n");e.push(l+"};\n");
a=xd(e).apply(null,f);e=Ld(a);return Md[b]=e},W:function(a){a=Id(a);return U(k[a])},m:function(a,b){a=Y(a);b=Y(b);return U(a[b])},c:function(a){4<a&&(X[a].vd+=1)},G:function(a,b){a=Y(a);b=Y(b);return a instanceof b},N:function(a){a=Y(a);return"number"==typeof a},ga:function(a){a=Y(a);return"string"==typeof a},x:function(a,b,c,d){a=Y(a);var e=Nd[b];if(!e){e="";for(var f=0;f<b;++f)e+=(0!==f?", ":"")+"arg"+f;var g="return function emval_allocator_"+b+"(constructor, argTypes, args) {\n";for(f=0;f<b;++f)g+=
"var argType"+f+" = requireRegisteredType(Module['HEAP32'][(argTypes >>> 2) + "+f+'], "parameter '+f+'");\nvar arg'+f+" = argType"+f+".readValueFromPointer(args);\nargs += argType"+f+"['argPackAdvance'];\n";e=(new Function("requireRegisteredType","Module","valueToHandle",g+("var obj = new constructor("+e+");\nreturn valueToHandle(obj);\n}\n")))(Ed,k,U);Nd[b]=e}return e(a,c,d)},n:function(a){return U(Id(a))},k:function(a){var b=Y(a);Dc(b);Cd(a)},K:function(a,b,c){a=Y(a);b=Y(b);c=Y(c);a[b]=c},r:function(a,
b){a=Ed(a,"_emval_take_value");a=a.readValueFromPointer(b);return U(a)},O:function(a){a=Y(a);return U(typeof a)},xa:function(a,b){a=new Date(1E3*D[a>>2]);D[b>>2]=a.getUTCSeconds();D[b+4>>2]=a.getUTCMinutes();D[b+8>>2]=a.getUTCHours();D[b+12>>2]=a.getUTCDate();D[b+16>>2]=a.getUTCMonth();D[b+20>>2]=a.getUTCFullYear()-1900;D[b+24>>2]=a.getUTCDay();D[b+28>>2]=(a.getTime()-Date.UTC(a.getUTCFullYear(),0,1,0,0,0,0))/864E5|0},ya:function(a,b){a=new Date(1E3*D[a>>2]);D[b>>2]=a.getSeconds();D[b+4>>2]=a.getMinutes();
D[b+8>>2]=a.getHours();D[b+12>>2]=a.getDate();D[b+16>>2]=a.getMonth();D[b+20>>2]=a.getFullYear()-1900;D[b+24>>2]=a.getDay();var c=new Date(a.getFullYear(),0,1);D[b+28>>2]=(a.getTime()-c.getTime())/864E5|0;D[b+36>>2]=-(60*a.getTimezoneOffset());var d=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();c=c.getTimezoneOffset();D[b+32>>2]=(d!=c&&a.getTimezoneOffset()==Math.min(c,d))|0},gb:Pd,ja:Qd,za:Sd,j:function(){z("")},ab:function(){r||ia||(ua||(ua={}),ua["Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread"]||
(ua["Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread"]=1,y("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")))},Ua:function(){fb+=1;throw"unwind";},Xa:function(){return B.length},C:Td,Aa:function(a,b,c){B.copyWithin(a,b,b+c)},S:Ab,ma:function(a,b,c){b/=2;Vd.length=b;c>>=3;for(var d=0;d<b;d++)Vd[d]=Va[c+2*d]?Va[c+2*d+1]:Xa[c+
2*d+1];return(0>a?ub[-a-1]:pe[a]).apply(null,Vd)},Wa:function(){z("OOM")},va:function(){throw"unwind";},Ha:Zd,Ia:$d,T:function(a){Hb(a)},L:ae,oa:be,Z:ce,ka:de,Q:ee,ba:function(a,b,c,d){var e=F[(a>>2)+1],f=F[(a>>2)+6],g=F[(a>>2)+2];a=vb(F[(a>>2)+3])[1];var h=J(),l=h,n=[],p=!1;if(15===a)throw Error("complex ret marshalling nyi");if(0>a||15<a)throw Error("Unexpected rtype "+a);if(4===a||13===a)n.push(c),p=!0;for(var q=0;q<f;q++){var t=F[(d>>2)+q],m=vb(F[(g>>2)+q]),u=m[0];m=m[1];switch(m){case 1:case 10:case 9:case 14:n.push(F[t>>
2]);break;case 2:n.push(Ua[t>>2]);break;case 3:n.push(Xa[t>>3]);break;case 5:n.push(B[t]);break;case 6:n.push(E[t]);break;case 7:n.push(Ia[t>>1]);break;case 8:n.push(Ka[t>>1]);break;case 11:case 12:n.push(Wa[t>>3]);break;case 4:n.push(Wa[t>>3]);n.push(Wa[(t>>3)+1]);break;case 13:m=F[u>>2];u=Ia[u+4>>1];l-=m;l&=~(u-1);E.subarray(l,l+m).set(E.subarray(t,t+m));n.push(l);break;case 15:throw Error("complex marshalling nyi");default:throw Error("Unexpected type "+m);}}if(f!=e){var x=[];for(q=e-1;q>=f;q--)switch(t=
F[(d>>2)+q],m=vb(F[(g>>2)+q]),u=m[0],m=m[1],m){case 5:case 6:--l;l&=-1;B[l]=B[t];break;case 7:case 8:l-=2;l&=-2;Ia[l>>1]=Ia[t>>1];break;case 1:case 9:case 10:case 14:case 2:l-=4;l&=-4;F[l>>2]=F[t>>2];break;case 3:case 11:case 12:l-=8;l&=-8;F[l>>2]=F[t>>2];F[(l>>2)+1]=F[(t>>2)+1];break;case 4:l-=16;l&=-8;F[l>>2]=F[t>>2];F[(l>>2)+1]=F[(t>>2)+1];F[(l>>2)+2]=F[(t>>2)+1];F[(l>>2)+3]=F[(t>>2)+1];break;case 13:l-=4;l&=-4;x.push([l,t,F[u>>2],Ia[u+4>>1]]);break;case 15:throw Error("complex arg marshalling nyi");
default:throw Error("Unexpected argtype "+m);}n.push(l);for(q=0;q<x.length;q++)e=x[q],d=e[0],t=e[1],m=e[2],u=e[3],l-=m,l&=~(u-1),E.subarray(l,l+m).set(E.subarray(t,t+m)),F[d>>2]=l}M(l-0&-8);b=$a.get(b).apply(null,n);M(h);if(!p)switch(a){case 0:break;case 1:case 9:case 10:case 14:F[c>>2]=b;break;case 2:Ua[c>>2]=b;break;case 3:Xa[c>>3]=b;break;case 5:case 6:B[c+0]=b;break;case 7:case 8:Ia[c>>1]=b;break;case 11:case 12:Wa[c>>3]=b;break;case 15:throw Error("complex ret marshalling nyi");default:throw Error("Unexpected rtype "+
a);}},g:function(){return xa},I:re,u:se,s:te,t:ue,M:ve,Sa:we,Na:xe,U:ye,Ra:ze,Qa:Ae,q:Be,D:Ce,y:De,F:Ee,Oa:Fe,ca:Ge,Pa:He,a:za||k.wasmMemory,Ea:fe,i:function(a){xa=a},Ta:function(){ib()},Ma:function(a,b,c,d){function e(m,u,x){for(m="number"==typeof m?m.toString():m||"";m.length<u;)m=x[0]+m;return m}function f(m,u){return e(m,u,"0")}function g(m,u){function x(K){return 0>K?-1:0<K?1:0}var C;0===(C=x(m.getFullYear()-u.getFullYear()))&&0===(C=x(m.getMonth()-u.getMonth()))&&(C=x(m.getDate()-u.getDate()));
return C}function h(m){switch(m.getDay()){case 0:return new Date(m.getFullYear()-1,11,29);case 1:return m;case 2:return new Date(m.getFullYear(),0,3);case 3:return new Date(m.getFullYear(),0,2);case 4:return new Date(m.getFullYear(),0,1);case 5:return new Date(m.getFullYear()-1,11,31);case 6:return new Date(m.getFullYear()-1,11,30)}}function l(m){var u=m.wc;for(m=new Date((new Date(m.xc+1900,0,1)).getTime());0<u;){var x=m.getMonth(),C=(he(m.getFullYear())?ie:je)[x];if(u>C-m.getDate())u-=C-m.getDate()+
1,m.setDate(1),11>x?m.setMonth(x+1):(m.setMonth(0),m.setFullYear(m.getFullYear()+1));else{m.setDate(m.getDate()+u);break}}x=new Date(m.getFullYear()+1,0,4);u=h(new Date(m.getFullYear(),0,4));x=h(x);return 0>=g(u,m)?0>=g(x,m)?m.getFullYear()+1:m.getFullYear():m.getFullYear()-1}var n=D[d+40>>2];d={hf:D[d>>2],gf:D[d+4>>2],Yc:D[d+8>>2],yd:D[d+12>>2],Zc:D[d+16>>2],xc:D[d+20>>2],kc:D[d+24>>2],wc:D[d+28>>2],Af:D[d+32>>2],ff:D[d+36>>2],jf:n?A(n):""};c=A(c);n={"%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 p in n)c=c.replace(new RegExp(p,"g"),n[p]);var q="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),t="January February March April May June July August September October November December".split(" ");
n={"%a":function(m){return q[m.kc].substring(0,3)},"%A":function(m){return q[m.kc]},"%b":function(m){return t[m.Zc].substring(0,3)},"%B":function(m){return t[m.Zc]},"%C":function(m){return f((m.xc+1900)/100|0,2)},"%d":function(m){return f(m.yd,2)},"%e":function(m){return e(m.yd,2," ")},"%g":function(m){return l(m).toString().substring(2)},"%G":function(m){return l(m)},"%H":function(m){return f(m.Yc,2)},"%I":function(m){m=m.Yc;0==m?m=12:12<m&&(m-=12);return f(m,2)},"%j":function(m){for(var u=0,x=0;x<=
m.Zc-1;u+=(he(m.xc+1900)?ie:je)[x++]);return f(m.yd+u,3)},"%m":function(m){return f(m.Zc+1,2)},"%M":function(m){return f(m.gf,2)},"%n":function(){return"\n"},"%p":function(m){return 0<=m.Yc&&12>m.Yc?"AM":"PM"},"%S":function(m){return f(m.hf,2)},"%t":function(){return"\t"},"%u":function(m){return m.kc||7},"%U":function(m){return f(Math.floor((m.wc+7-m.kc)/7),2)},"%V":function(m){var u=Math.floor((m.wc+7-(m.kc+6)%7)/7);2>=(m.kc+371-m.wc-2)%7&&u++;if(u)53==u&&(x=(m.kc+371-m.wc)%7,4==x||3==x&&he(m.xc)||
(u=1));else{u=52;var x=(m.kc+7-m.wc-1)%7;(4==x||5==x&&he(m.xc%400-1))&&u++}return f(u,2)},"%w":function(m){return m.kc},"%W":function(m){return f(Math.floor((m.wc+7-(m.kc+6)%7)/7),2)},"%y":function(m){return(m.xc+1900).toString().substring(2)},"%Y":function(m){return m.xc+1900},"%z":function(m){m=m.ff;var u=0<=m;m=Math.abs(m)/60;return(u?"+":"-")+String("0000"+(m/60*100+m%60)).slice(-4)},"%Z":function(m){return m.jf},"%%":function(){return"%"}};c=c.replace(/%%/g,"\x00\x00");for(p in n)c.includes(p)&&
(c=c.replace(new RegExp(p,"g"),n[p](d)));c=c.replace(/\0\0/g,"%");p=Wb(c,!1);if(p.length>b)return 0;E.set(p,a);return p.length-1},Ga:function(a){throw new TypeError(A(a));},Ba:function(a){var b=k.Error.buffer();k.Error.clear();throw Error(A(a)+"\n"+b);}};
(function(){function a(e,f){k.asm=e.exports;H.Xc.push(k.asm.ob);$a=k.asm.kb;bb.unshift(k.asm.ib);Aa=f;if(!v){var g=H.cc.length;H.cc.forEach(function(h){H.Wd(h,function(){--g||pb("wasm-instantiate")})})}}function b(e){a(e.instance,e.module)}function c(e){return tb().then(function(f){return WebAssembly.instantiate(f,d)}).then(function(f){return f}).then(e,function(f){y("failed to asynchronously prepare wasm: "+f);z(f)})}var d={a:Ie};v||ob("wasm-instantiate");if(k.instantiateWasm)try{return k.instantiateWasm(d,
a)}catch(e){return y("Module.instantiateWasm callback failed with error: "+e),!1}(function(){return ya||"function"!=typeof WebAssembly.instantiateStreaming||qb()||"function"!=typeof fetch?c(b):fetch(rb,{credentials:"same-origin"}).then(function(e){return WebAssembly.instantiateStreaming(e,d).then(b,function(f){y("wasm streaming compile failed: "+f);y("falling back to ArrayBuffer instantiation");return c(b)})})})().catch(ba);return{}})();
k.___wasm_call_ctors=function(){return(k.___wasm_call_ctors=k.asm.ib).apply(null,arguments)};var Qa=k._malloc=function(){return(Qa=k._malloc=k.asm.jb).apply(null,arguments)};k._main=function(){return(k._main=k.asm.lb).apply(null,arguments)};var W=k._free=function(){return(W=k._free=k.asm.mb).apply(null,arguments)},oc=k.___errno_location=function(){return(oc=k.___errno_location=k.asm.nb).apply(null,arguments)};k._emscripten_tls_init=function(){return(k._emscripten_tls_init=k.asm.ob).apply(null,arguments)};
var $b=k._emscripten_builtin_memalign=function(){return($b=k._emscripten_builtin_memalign=k.asm.pb).apply(null,arguments)},vd=k.___getTypeName=function(){return(vd=k.___getTypeName=k.asm.qb).apply(null,arguments)};k.___embind_register_native_and_builtin_types=function(){return(k.___embind_register_native_and_builtin_types=k.asm.rb).apply(null,arguments)};
var ec=k.___stdio_exit=function(){return(ec=k.___stdio_exit=k.asm.sb).apply(null,arguments)},jb=k.___funcs_on_exit=function(){return(jb=k.___funcs_on_exit=k.asm.tb).apply(null,arguments)},Db=k._pthread_self=function(){return(Db=k._pthread_self=k.asm.ub).apply(null,arguments)},qe=k.__emscripten_thread_init=function(){return(qe=k.__emscripten_thread_init=k.asm.vb).apply(null,arguments)};k.__emscripten_thread_crashed=function(){return(k.__emscripten_thread_crashed=k.asm.wb).apply(null,arguments)};
var Eb=k._emscripten_proxy_execute_queue=function(){return(Eb=k._emscripten_proxy_execute_queue=k.asm.xb).apply(null,arguments)},Ud=k._emscripten_run_in_main_runtime_thread_js=function(){return(Ud=k._emscripten_run_in_main_runtime_thread_js=k.asm.yb).apply(null,arguments)},Bb=k.__emscripten_thread_free_data=function(){return(Bb=k.__emscripten_thread_free_data=k.asm.zb).apply(null,arguments)};k.__emscripten_thread_exit=function(){return(k.__emscripten_thread_exit=k.asm.Ab).apply(null,arguments)};
var Z=k._setThrew=function(){return(Z=k._setThrew=k.asm.Bb).apply(null,arguments)},Fb=k._emscripten_stack_set_limits=function(){return(Fb=k._emscripten_stack_set_limits=k.asm.Cb).apply(null,arguments)},J=k.stackSave=function(){return(J=k.stackSave=k.asm.Db).apply(null,arguments)},M=k.stackRestore=function(){return(M=k.stackRestore=k.asm.Eb).apply(null,arguments)},Sa=k.stackAlloc=function(){return(Sa=k.stackAlloc=k.asm.Fb).apply(null,arguments)},Cb=k.__emscripten_allow_main_runtime_queued_calls=1314072;
function we(a,b,c,d,e,f){var g=J();try{return I(a)(b,c,d,e,f)}catch(h){M(g);if(h!==h+0)throw h;Z(1,0)}}function se(a,b){var c=J();try{return I(a)(b)}catch(d){M(c);if(d!==d+0)throw d;Z(1,0)}}function ue(a,b,c,d){var e=J();try{return I(a)(b,c,d)}catch(f){M(e);if(f!==f+0)throw f;Z(1,0)}}function De(a,b,c,d){var e=J();try{I(a)(b,c,d)}catch(f){M(e);if(f!==f+0)throw f;Z(1,0)}}function te(a,b,c){var d=J();try{return I(a)(b,c)}catch(e){M(d);if(e!==e+0)throw e;Z(1,0)}}
function Be(a,b){var c=J();try{I(a)(b)}catch(d){M(c);if(d!==d+0)throw d;Z(1,0)}}function re(a){var b=J();try{return I(a)()}catch(c){M(b);if(c!==c+0)throw c;Z(1,0)}}function ye(a,b,c,d,e,f,g){var h=J();try{return I(a)(b,c,d,e,f,g)}catch(l){M(h);if(l!==l+0)throw l;Z(1,0)}}function ze(a,b,c,d,e,f,g,h){var l=J();try{return I(a)(b,c,d,e,f,g,h)}catch(n){M(l);if(n!==n+0)throw n;Z(1,0)}}
function Ae(a,b,c,d,e,f,g,h,l,n,p,q,t){var m=J();try{return I(a)(b,c,d,e,f,g,h,l,n,p,q,t)}catch(u){M(m);if(u!==u+0)throw u;Z(1,0)}}function Ee(a,b,c,d,e){var f=J();try{I(a)(b,c,d,e)}catch(g){M(f);if(g!==g+0)throw g;Z(1,0)}}function Ce(a,b,c){var d=J();try{I(a)(b,c)}catch(e){M(d);if(e!==e+0)throw e;Z(1,0)}}function ve(a,b,c,d,e){var f=J();try{return I(a)(b,c,d,e)}catch(g){M(f);if(g!==g+0)throw g;Z(1,0)}}
function He(a,b,c,d,e,f,g,h,l,n){var p=J();try{I(a)(b,c,d,e,f,g,h,l,n)}catch(q){M(p);if(q!==q+0)throw q;Z(1,0)}}function Fe(a,b,c,d,e,f){var g=J();try{I(a)(b,c,d,e,f)}catch(h){M(g);if(h!==h+0)throw h;Z(1,0)}}function Ge(a,b,c,d,e,f,g){var h=J();try{I(a)(b,c,d,e,f,g)}catch(l){M(h);if(l!==l+0)throw l;Z(1,0)}}function xe(a,b,c,d,e,f,g,h,l){var n=J();try{return I(a)(b,c,d,e,f,g,h,l)}catch(p){M(n);if(p!==p+0)throw p;Z(1,0)}}k.addRunDependency=ob;k.removeRunDependency=pb;k.FS_createPath=FS.Fd;
k.FS_createDataFile=FS.Pc;k.FS_createPreloadedFile=FS.createPreloadedFile;k.FS_createLazyFile=FS.createLazyFile;k.FS_createDevice=FS.ec;k.FS_unlink=FS.unlink;
k.addFunction=function(a,b){if(!wa){wa=new WeakMap;for(var c=$a.length,d=0;d<0+c;d++){var e=I(d);e&&wa.set(e,d)}}if(wa.has(a))return wa.get(a);if(va.length)c=va.pop();else{try{$a.grow(1)}catch(h){if(!(h instanceof RangeError))throw h;throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.";}c=$a.length-1}try{d=c,$a.set(d,a),Ib[d]=a}catch(h){if(!(h instanceof TypeError))throw h;if("function"==typeof WebAssembly.Function){e={i:"i32",j:"i64",f:"f32",d:"f64"};var f={parameters:[],results:"v"==b[0]?[]:
[e[b[0]]]};for(d=1;d<b.length;++d)f.parameters.push(e[b[d]]);d=new WebAssembly.Function(f,a)}else{e=[1,0,1,96];f=b.slice(0,1);b=b.slice(1);var g={i:127,j:126,f:125,d:124};e.push(b.length);for(d=0;d<b.length;++d)e.push(g[b[d]]);"v"==f?e.push(0):e=e.concat([1,g[f]]);e[1]=e.length-2;b=new Uint8Array([0,97,115,109,1,0,0,0].concat(e,[2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0]));b=new WebAssembly.Module(b);d=(new WebAssembly.Instance(b,{e:{f:a}})).exports.f}b=c;$a.set(b,d);Ib[b]=d}wa.set(a,c);return c};
k.keepRuntimeAlive=pa;k.ENV=Wd;k.FS=FS;k.PThread=H;k.deletionQueue=bd;k.PThread=H;k.wasmMemory=za;k.ExitStatus=qa;var Je;function qa(a){this.name="ExitStatus";this.message="Program terminated with exit("+a+")";this.status=a}nb=function Ke(){Je||Le();Je||(nb=Ke)};
function Le(a){function b(){if(!Je&&(Je=!0,k.calledRun=!0,!Ba)){gb();v||hb(cb);aa(k);if(k.onRuntimeInitialized)k.onRuntimeInitialized();if(Me){var c=a,d=k._main;c=c||[];var e=c.length+1,f=Sa(4*(e+1));D[f>>2]=Ra(ea);for(var g=1;g<e;g++)D[(f>>2)+g]=Ra(c[g-1]);D[(f>>2)+e]=0;try{var h=d(e,f);Hb(h,!0)}catch(l){zb(l)}finally{}}if(!v){if(k.postRun)for("function"==typeof k.postRun&&(k.postRun=[k.postRun]);k.postRun.length;)c=k.postRun.shift(),eb.unshift(c);hb(eb)}}}a=a||da;if(!(0<lb))if(v)aa(k),gb(),postMessage({cmd:"loaded"});
else{if(k.preRun)for("function"==typeof k.preRun&&(k.preRun=[k.preRun]);k.preRun.length;)kb();hb(ab);0<lb||(k.setStatus?(k.setStatus("Running..."),setTimeout(function(){setTimeout(function(){k.setStatus("")},1);b()},1)):b())}}k.run=Le;function Hb(a,b){if(!b&&v)throw Gb(a),"unwind";pa()||ib();ge(a)}function ge(a){if(!pa()){H.de();if(k.onExit)k.onExit(a);Ba=!0}fa(a,new qa(a))}if(k.preInit)for("function"==typeof k.preInit&&(k.preInit=[k.preInit]);0<k.preInit.length;)k.preInit.pop()();var Me=!0;
k.noInitialRun&&(Me=!1);Le();


  return Vips.ready
}
);
})();
export default Vips;