>3,{b:y,s:T,n:er,t:J}]},wn=function(l,v){var f=0,s=-1,y=new z(292),d=l[v],_=y.subarray(0,256),w=y.subarray(256,268),E=new jr(y.buffer,268);if(d<128){var W=Pr(l,v+1,6),I=W[0],V=W[1];v+=d;var P=I<<3,N=l[v];N||j(0);for(var J=0,C=0,T=V.b,er=T,Y=(++v<<3)-8+Cr(N);Y-=T,!(Y>3;if(J+=(l[U]|l[U+1]<<8)>>(Y&7)&(1<>3,C+=(l[U]|l[U+1]<<8)>>(Y&7)&(1<255&&j(0)}else{for(s=d-127;f>4,_[f+1]=or&15}++v}var S=0;for(f=0;f11&&j(0),S+=m&&1<0;--f){var tr=E[f];Vr(ar,f,tr,E[f-1]=tr+w[f]*(1<w&&V>3,N=(l[P]|l[P+1]<<8|l[P+2]<<16)>>(I&7);E=(E<>2,_=d<<1,w=d+_;Wr(l.subarray(s,s+=l[0]|l[1]<<8),v.subarray(0,d),f),Wr(l.subarray(s,s+=l[2]|l[3]<<8),v.subarray(d,_),f),Wr(l.subarray(s,s+=l[4]|l[5]<<8),v.subarray(_,w),f),Wr(l.subarray(s),v.subarray(w),f)},Cn=function(l,v,f){var s,y=v.b,d=l[y],_=d>>1&3;v.l=d&1;var w=d>>3|l[y+1]<<5|l[y+2]<<13,E=(y+=3)+w;if(_==1)return y>=l.length?void 0:(v.b=y+1,f?(Vr(f,l[y],v.y,v.y+=w),f):Vr(new z(w),l[y]));if(!(E>l.length)){if(_==0)return v.b=E,f?(f.set(l.subarray(y,E),v.y),v.y+=w,f):ue(l,y,E);if(_==2){var W=l[y],I=W&3,V=W>>2&3,P=W>>4,N=0,J=0;I<2?V&1?P|=l[++y]<<4|(V&2&&l[++y]<<12):P=W>>3:(J=V,V<2?(P|=(l[++y]&63)<<4,N=l[y]>>6|l[++y]<<2):V==2?(P|=l[++y]<<4|(l[++y]&3)<<12,N=l[y]>>2|l[++y]<<6):(P|=l[++y]<<4|(l[++y]&63)<<12,N=l[y]>>6|l[++y]<<2|l[++y]<<10)),++y;var C=f?f.subarray(v.y,v.y+v.m):new z(v.m),T=C.length-P;if(I==0)C.set(l.subarray(y,y+=P),T);else if(I==1)Vr(C,l[y++],T);else{var er=v.h;if(I==2){var Y=wn(l,y);N+=y-(y=Y[0]),v.h=er=Y[1]}else er||j(0);(J?Mn:Wr)(l.subarray(y,y+=N),C.subarray(T),er)}var U=l[y++];if(U){U==255?U=(l[y++]|l[y++]<<8)+32512:U>127&&(U=U-128<<8|l[y++]);var or=l[y++];or&3&&j(0);for(var S=[bn,Ln,mn],m=2;m>-1;--m){var Q=or>>(m<<1)+2&3;if(Q==1){var $=new z([0,0,l[y++]]);S[m]={s:$.subarray(2,3),n:$.subarray(0,1),t:new jr($.buffer,0,1),b:0}}else Q==2?(s=Pr(l,y,9-(m&1)),y=s[0],S[m]=s[1]):Q==3&&(v.t||j(0),S[m]=v.t[m])}var ir=v.t=S,L=ir[0],X=ir[1],ar=ir[2],tr=l[E-1];tr||j(0);var R=(E<<3)-8+Cr(tr)-ar.b,g=R>>3,A=0,gr=(l[g]|l[g+1]<<8)>>(R&7)&(1<>3;var Dr=(l[g]|l[g+1]<<8)>>(R&7)&(1<>3;var Fr=(l[g]|l[g+1]<<8)>>(R&7)&(1<>3;var Jr=1<>>(R&7)&Jr-1);g=(R-=ce[Hr])>>3;var pr=En[Hr]+((l[g]|l[g+1]<<8|l[g+2]<<16)>>(R&7)&(1<>3;var dr=Bn[Zr]+((l[g]|l[g+1]<<8|l[g+2]<<16)>>(R&7)&(1<>3,gr=ar.t[gr]+((l[g]|l[g+1]<<8)>>(R&7)&(1<>3,Fr=L.t[Fr]+((l[g]|l[g+1]<<8)>>(R&7)&(1< >3,Dr=X.t[Dr]+((l[g]|l[g+1]<<8)>>(R&7)&(1<3)v.o[2]=v.o[1],v.o[1]=v.o[0],v.o[0]=cr-=3;else{var Or=cr-(dr!=0);Or?(cr=Or==3?v.o[0]-1:v.o[Or],Or>1&&(v.o[2]=v.o[1]),v.o[1]=v.o[0],v.o[0]=cr):cr=v.o[0]}for(var m=0;mpr&&(Mr=pr);for(var m=0;m88?13:14;do f.push(s&255),s>>=8,y-=8;while(y>7);d=-1}}return d>-1&&f.push((s|d<{var l=typeof document<"u"?document.currentScript?.src:void 0;return function(v={}){var f,s=v,y,d,_=new Promise((r,e)=>{y=r,d=e}),w=!1,E=Object.assign({},s),W="./this.program",I=(r,e)=>{throw e},V="";function P(r){return V+r}var N,J,C=console.log.bind(console),T=console.error.bind(console);Object.assign(s,E),E=null;var er;s.wasmBinary&&(er=s.wasmBinary);var Y,U=!1,or;function S(r,e){r||dr(e)}var m,Q,$,ir,L,X,ar,tr;function R(){var r=Y.buffer;s.HEAP8=m=new Int8Array(r),s.HEAP16=$=new Int16Array(r),s.HEAPU8=Q=new Uint8Array(r),s.HEAPU16=ir=new Uint16Array(r),s.HEAP32=L=new Int32Array(r),s.HEAPU32=X=new Uint32Array(r),s.HEAPF32=ar=new Float32Array(r),s.HEAPF64=tr=new Float64Array(r)}var g=[],A=[],gr=[],Dr=!1;function Fr(){$r(g)}function Zr(){Dr=!0,!s.noFSInit&&!n.init.initialized&&n.init(),n.ignorePermissions=!1,Er.init(),$r(A)}function Qr(){$r(gr)}function Hr(r){A.unshift(r)}var br=0,Xr=null,Lr=null;function Jr(r){return r}function cr(r){br++}function pr(r){if(br--,br==0&&(Xr!==null&&(clearInterval(Xr),Xr=null),Lr)){var e=Lr;Lr=null,e()}}function dr(r){r="Aborted("+r+")",T(r),U=!0,or=1,r+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(r);throw d(e),e}var Or="data:application/octet-stream;base64,",Br=r=>r.startsWith(Or),Mr=r=>r.startsWith("file://");function qr(){var r="graphvizlib.wasm";return Br(r)?r:P(r)}var Ur;function fe(r){if(r==Ur&&er)return new Uint8Array(er);if(J)return J(r);throw"both async and sync fetching of the wasm failed"}function Je(r){return er?Promise.resolve().then(()=>fe(r)):N(r).then(e=>new Uint8Array(e),()=>fe(r))}function ye(r,e,t){return Je(r).then(o=>WebAssembly.instantiate(o,e)).then(t,o=>{T(`failed to asynchronously prepare wasm: ${o}`),dr(o)})}function qe(r,e,t,o){return!r&&typeof WebAssembly.instantiateStreaming=="function"&&!Br(e)&&!Mr(e)&&typeof fetch=="function"?fetch(e,{credentials:"same-origin"}).then(i=>{var a=WebAssembly.instantiateStreaming(i,t);return a.then(o,function(u){return T(`wasm streaming compile failed: ${u}`),T("falling back to ArrayBuffer instantiation"),ye(e,t,o)})}):ye(e,t,o)}function $e(){return{a:rn}}function Ae(){var r=$e();function e(o,i){return H=o.exports,Y=H.B,R(),Hr(H.C),pr("wasm-instantiate"),H}cr("wasm-instantiate");function t(o){e(o.instance)}return Ur||(Ur=qr()),qe(er,Ur,r,t).catch(d),{}}var F,q,rt={173224:(r,e)=>{var t=sr(r),o=sr(e);n.createPath("/",G.dirname(t)),n.writeFile(G.join("/",t),o)}};function et(r){this.name="ExitStatus",this.message=`Program terminated with exit(${r})`,this.status=r}var $r=r=>{for(;r.length>0;)r.shift()(s)};class tt{constructor(e){this.excPtr=e,this.ptr=e-24}set_type(e){X[this.ptr+4>>2]=e}get_type(){return X[this.ptr+4>>2]}set_destructor(e){X[this.ptr+8>>2]=e}get_destructor(){return X[this.ptr+8>>2]}set_caught(e){e=e?1:0,m[this.ptr+12]=e}get_caught(){return m[this.ptr+12]!=0}set_rethrown(e){e=e?1:0,m[this.ptr+13]=e}get_rethrown(){return m[this.ptr+13]!=0}init(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)}set_adjusted_ptr(e){X[this.ptr+16>>2]=e}get_adjusted_ptr(){return X[this.ptr+16>>2]}get_exception_ptr(){var e=Ve(this.get_type());if(e)return X[this.excPtr>>2];var t=this.get_adjusted_ptr();return t!==0?t:this.excPtr}}var pe=0,nt=0,ot=(r,e,t)=>{var o=new tt(r);throw o.init(e,t),pe=r,nt++,pe},G={isAbs:r=>r.charAt(0)==="/",splitPath:r=>{var e=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return e.exec(r).slice(1)},normalizeArray:(r,e)=>{for(var t=0,o=r.length-1;o>=0;o--){var i=r[o];i==="."?r.splice(o,1):i===".."?(r.splice(o,1),t++):t&&(r.splice(o,1),t--)}if(e)for(;t;t--)r.unshift("..");return r},normalize:r=>{var e=G.isAbs(r),t=r.substr(-1)==="/";return r=G.normalizeArray(r.split("/").filter(o=>!!o),!e).join("/"),!r&&!e&&(r="."),r&&t&&(r+="/"),(e?"/":"")+r},dirname:r=>{var e=G.splitPath(r),t=e[0],o=e[1];return!t&&!o?".":(o&&(o=o.substr(0,o.length-1)),t+o)},basename:r=>{if(r==="/")return"/";r=G.normalize(r),r=r.replace(/\/$/,"");var e=r.lastIndexOf("/");return e===-1?r:r.substr(e+1)},join:(...r)=>G.normalize(r.join("/")),join2:(r,e)=>G.normalize(r+"/"+e)},it=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return r=>crypto.getRandomValues(r);dr("initRandomDevice")},de=r=>(de=it())(r),hr={resolve:(...r)=>{for(var e="",t=!1,o=r.length-1;o>=-1&&!t;o--){var i=o>=0?r[o]:n.cwd();if(typeof i!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!i)return"";e=i+"/"+e,t=G.isAbs(i)}return e=G.normalizeArray(e.split("/").filter(a=>!!a),!t).join("/"),(t?"/":"")+e||"."},relative:(r,e)=>{r=hr.resolve(r).substr(1),e=hr.resolve(e).substr(1);function t(B){for(var O=0;O=0&&B[k]==="";k--);return O>k?[]:B.slice(O,k-O+1)}for(var o=t(r.split("/")),i=t(e.split("/")),a=Math.min(o.length,i.length),u=a,c=0;c{for(var o=e+t,i=e;r[i]&&!(i>=o);)++i;if(i-e>16&&r.buffer&&_e)return _e.decode(r.subarray(e,i));for(var a="";e>10,56320|B&1023)}}return a},Ar=[],re=r=>{for(var e=0,t=0;t=55296&&o<=57343?(e+=4,++t):e+=3}return e},ee=(r,e,t,o)=>{if(!(o>0))return 0;for(var i=t,a=t+o-1,u=0;u=55296&&c<=57343){var p=r.charCodeAt(++u);c=65536+((c&1023)<<10)|p&1023}if(c<=127){if(t>=a)break;e[t++]=c}else if(c<=2047){if(t+1>=a)break;e[t++]=192|c>>6,e[t++]=128|c&63}else if(c<=65535){if(t+2>=a)break;e[t++]=224|c>>12,e[t++]=128|c>>6&63,e[t++]=128|c&63}else{if(t+3>=a)break;e[t++]=240|c>>18,e[t++]=128|c>>12&63,e[t++]=128|c>>6&63,e[t++]=128|c&63}}return e[t]=0,t-i};function te(r,e,t){var o=t>0?t:re(r)+1,i=new Array(o),a=ee(r,i,0,i.length);return e&&(i.length=a),i}var at=()=>{if(!Ar.length){var r=null;if(!r)return null;Ar=te(r,!0)}return Ar.shift()},Er={ttys:[],init(){},shutdown(){},register(r,e){Er.ttys[r]={input:[],output:[],ops:e},n.registerDevice(r,Er.stream_ops)},stream_ops:{open(r){var e=Er.ttys[r.node.rdev];if(!e)throw new n.ErrnoError(43);r.tty=e,r.seekable=!1},close(r){r.tty.ops.fsync(r.tty)},fsync(r){r.tty.ops.fsync(r.tty)},read(r,e,t,o,i){if(!r.tty||!r.tty.ops.get_char)throw new n.ErrnoError(60);for(var a=0,u=0;u0&&(C(Kr(r.output,0)),r.output=[])},ioctl_tcgets(r){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(r,e,t){return 0},ioctl_tiocgwinsz(r){return[24,80]}},default_tty1_ops:{put_char(r,e){e===null||e===10?(T(Kr(r.output,0)),r.output=[]):e!=0&&r.output.push(e)},fsync(r){r.output&&r.output.length>0&&(T(Kr(r.output,0)),r.output=[])}}},st=(r,e)=>(Q.fill(0,r,r+e),r),he=(r,e)=>Math.ceil(r/e)*e,we=r=>{r=he(r,65536);var e=We(65536,r);return e?st(e,r):0},M={ops_table:null,mount(r){return M.createNode(null,"/",16895,0)},createNode(r,e,t,o){if(n.isBlkdev(t)||n.isFIFO(t))throw new n.ErrnoError(63);M.ops_table||={dir:{node:{getattr:M.node_ops.getattr,setattr:M.node_ops.setattr,lookup:M.node_ops.lookup,mknod:M.node_ops.mknod,rename:M.node_ops.rename,unlink:M.node_ops.unlink,rmdir:M.node_ops.rmdir,readdir:M.node_ops.readdir,symlink:M.node_ops.symlink},stream:{llseek:M.stream_ops.llseek}},file:{node:{getattr:M.node_ops.getattr,setattr:M.node_ops.setattr},stream:{llseek:M.stream_ops.llseek,read:M.stream_ops.read,write:M.stream_ops.write,allocate:M.stream_ops.allocate,mmap:M.stream_ops.mmap,msync:M.stream_ops.msync}},link:{node:{getattr:M.node_ops.getattr,setattr:M.node_ops.setattr,readlink:M.node_ops.readlink},stream:{}},chrdev:{node:{getattr:M.node_ops.getattr,setattr:M.node_ops.setattr},stream:n.chrdev_stream_ops}};var i=n.createNode(r,e,t,o);return n.isDir(i.mode)?(i.node_ops=M.ops_table.dir.node,i.stream_ops=M.ops_table.dir.stream,i.contents={}):n.isFile(i.mode)?(i.node_ops=M.ops_table.file.node,i.stream_ops=M.ops_table.file.stream,i.usedBytes=0,i.contents=null):n.isLink(i.mode)?(i.node_ops=M.ops_table.link.node,i.stream_ops=M.ops_table.link.stream):n.isChrdev(i.mode)&&(i.node_ops=M.ops_table.chrdev.node,i.stream_ops=M.ops_table.chrdev.stream),i.timestamp=Date.now(),r&&(r.contents[e]=i,r.timestamp=i.timestamp),i},getFileDataAsTypedArray(r){return r.contents?r.contents.subarray?r.contents.subarray(0,r.usedBytes):new Uint8Array(r.contents):new Uint8Array(0)},expandFileStorage(r,e){var t=r.contents?r.contents.length:0;if(!(t>=e)){var o=1024*1024;e=Math.max(e,t*(t>>0),t!=0&&(e=Math.max(e,256));var i=r.contents;r.contents=new Uint8Array(e),r.usedBytes>0&&r.contents.set(i.subarray(0,r.usedBytes),0)}},resizeFileStorage(r,e){if(r.usedBytes!=e)if(e==0)r.contents=null,r.usedBytes=0;else{var t=r.contents;r.contents=new Uint8Array(e),t&&r.contents.set(t.subarray(0,Math.min(e,r.usedBytes))),r.usedBytes=e}},node_ops:{getattr(r){var e={};return e.dev=n.isChrdev(r.mode)?r.id:1,e.ino=r.id,e.mode=r.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=r.rdev,n.isDir(r.mode)?e.size=4096:n.isFile(r.mode)?e.size=r.usedBytes:n.isLink(r.mode)?e.size=r.link.length:e.size=0,e.atime=new Date(r.timestamp),e.mtime=new Date(r.timestamp),e.ctime=new Date(r.timestamp),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr(r,e){e.mode!==void 0&&(r.mode=e.mode),e.timestamp!==void 0&&(r.timestamp=e.timestamp),e.size!==void 0&&M.resizeFileStorage(r,e.size)},lookup(r,e){throw n.genericErrors[44]},mknod(r,e,t,o){return M.createNode(r,e,t,o)},rename(r,e,t){if(n.isDir(r.mode)){var o;try{o=n.lookupNode(e,t)}catch{}if(o)for(var i in o.contents)throw new n.ErrnoError(55)}delete r.parent.contents[r.name],r.parent.timestamp=Date.now(),r.name=t,e.contents[t]=r,e.timestamp=r.parent.timestamp},unlink(r,e){delete r.contents[e],r.timestamp=Date.now()},rmdir(r,e){var t=n.lookupNode(r,e);for(var o in t.contents)throw new n.ErrnoError(55);delete r.contents[e],r.timestamp=Date.now()},readdir(r){var e=[".",".."];for(var t of Object.keys(r.contents))e.push(t);return e},symlink(r,e,t){var o=M.createNode(r,e,41471,0);return o.link=t,o},readlink(r){if(!n.isLink(r.mode))throw new n.ErrnoError(28);return r.link}},stream_ops:{read(r,e,t,o,i){var a=r.node.contents;if(i>=r.node.usedBytes)return 0;var u=Math.min(r.node.usedBytes-i,o);if(u>8&&a.subarray)e.set(a.subarray(i,i+u),t);else for(var c=0;c0||t+e{var i=o?"":`al ${r}`;N(r).then(a=>{e(new Uint8Array(a)),i&&pr(i)},a=>{if(t)t();else throw`Loading data file "${r}" failed.`}),i&&cr(i)},lt=(r,e,t,o,i,a)=>{n.createDataFile(r,e,t,o,i,a)},ct=[],vt=(r,e,t,o)=>{typeof Browser<"u"&&Browser.init();var i=!1;return ct.forEach(a=>{i||a.canHandle(e)&&(a.handle(r,e,t,o),i=!0)}),i},ft=(r,e,t,o,i,a,u,c,p,B)=>{var O=e?hr.resolve(G.join2(r,e)):r,k=`cp ${O}`;function D(b){function x(nr){B?.(),c||lt(r,e,nr,o,i,p),a?.(),pr(k)}vt(b,O,x,()=>{u?.(),pr(k)})||x(b)}cr(k),typeof t=="string"?ut(t,D,u):D(t)},yt=r=>{var e={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},t=e[r];if(typeof t>"u")throw new Error(`Unknown file open mode: ${r}`);return t},ne=(r,e)=>{var t=0;return r&&(t|=365),e&&(t|=146),t},n={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class{constructor(r){this.name="ErrnoError",this.errno=r}},genericErrors:{},filesystems:null,syncFSRequests:0,FSStream:class{constructor(){this.shared={}}get object(){return this.node}set object(r){this.node=r}get isRead(){return(this.flags&2097155)!==1}get isWrite(){return(this.flags&2097155)!==0}get isAppend(){return this.flags&1024}get flags(){return this.shared.flags}set flags(r){this.shared.flags=r}get position(){return this.shared.position}set position(r){this.shared.position=r}},FSNode:class{constructor(r,e,t,o){r||(r=this),this.parent=r,this.mount=r.mount,this.mounted=null,this.id=n.nextInode++,this.name=e,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=o,this.readMode=365,this.writeMode=146}get read(){return(this.mode&this.readMode)===this.readMode}set read(r){r?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(r){r?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return n.isDir(this.mode)}get isDevice(){return n.isChrdev(this.mode)}},lookupPath(r,e={}){if(r=hr.resolve(r),!r)return{path:"",node:null};var t={follow_mount:!0,recurse_count:0};if(e=Object.assign(t,e),e.recurse_count>8)throw new n.ErrnoError(32);for(var o=r.split("/").filter(k=>!!k),i=n.root,a="/",u=0;u40)throw new n.ErrnoError(32)}}return{path:a,node:i}},getPath(r){for(var e;;){if(n.isRoot(r)){var t=r.mount.mountpoint;return e?t[t.length-1]!=="/"?`${t}/${e}`:t+e:t}e=e?`${r.name}/${e}`:r.name,r=r.parent}},hashName(r,e){for(var t=0,o=0;o>>0)%n.nameTable.length},hashAddNode(r){var e=n.hashName(r.parent.id,r.name);r.name_next=n.nameTable[e],n.nameTable[e]=r},hashRemoveNode(r){var e=n.hashName(r.parent.id,r.name);if(n.nameTable[e]===r)n.nameTable[e]=r.name_next;else for(var t=n.nameTable[e];t;){if(t.name_next===r){t.name_next=r.name_next;break}t=t.name_next}},lookupNode(r,e){var t=n.mayLookup(r);if(t)throw new n.ErrnoError(t);for(var o=n.hashName(r.id,e),i=n.nameTable[o];i;i=i.name_next){var a=i.name;if(i.parent.id===r.id&&a===e)return i}return n.lookup(r,e)},createNode(r,e,t,o){var i=new n.FSNode(r,e,t,o);return n.hashAddNode(i),i},destroyNode(r){n.hashRemoveNode(r)},isRoot(r){return r===r.parent},isMountpoint(r){return!!r.mounted},isFile(r){return(r&61440)===32768},isDir(r){return(r&61440)===16384},isLink(r){return(r&61440)===40960},isChrdev(r){return(r&61440)===8192},isBlkdev(r){return(r&61440)===24576},isFIFO(r){return(r&61440)===4096},isSocket(r){return(r&49152)===49152},flagsToPermissionString(r){var e=["r","w","rw"][r&3];return r&512&&(e+="w"),e},nodePermissions(r,e){return n.ignorePermissions?0:e.includes("r")&&!(r.mode&292)||e.includes("w")&&!(r.mode&146)||e.includes("x")&&!(r.mode&73)?2:0},mayLookup(r){if(!n.isDir(r.mode))return 54;var e=n.nodePermissions(r,"x");return e||(r.node_ops.lookup?0:2)},mayCreate(r,e){try{var t=n.lookupNode(r,e);return 20}catch{}return n.nodePermissions(r,"wx")},mayDelete(r,e,t){var o;try{o=n.lookupNode(r,e)}catch(a){return a.errno}var i=n.nodePermissions(r,"wx");if(i)return i;if(t){if(!n.isDir(o.mode))return 54;if(n.isRoot(o)||n.getPath(o)===n.cwd())return 10}else if(n.isDir(o.mode))return 31;return 0},mayOpen(r,e){return r?n.isLink(r.mode)?32:n.isDir(r.mode)&&(n.flagsToPermissionString(e)!=="r"||e&512)?31:n.nodePermissions(r,n.flagsToPermissionString(e)):44},MAX_OPEN_FDS:4096,nextfd(){for(var r=0;r<=n.MAX_OPEN_FDS;r++)if(!n.streams[r])return r;throw new n.ErrnoError(33)},getStreamChecked(r){var e=n.getStream(r);if(!e)throw new n.ErrnoError(8);return e},getStream:r=>n.streams[r],createStream(r,e=-1){return r=Object.assign(new n.FSStream,r),e==-1&&(e=n.nextfd()),r.fd=e,n.streams[e]=r,r},closeStream(r){n.streams[r]=null},dupStream(r,e=-1){var t=n.createStream(r,e);return t.stream_ops?.dup?.(t),t},chrdev_stream_ops:{open(r){var e=n.getDevice(r.node.rdev);r.stream_ops=e.stream_ops,r.stream_ops.open?.(r)},llseek(){throw new n.ErrnoError(70)}},major:r=>r>>8,minor:r=>r&255,makedev:(r,e)=>r<<8|e,registerDevice(r,e){n.devices[r]={stream_ops:e}},getDevice:r=>n.devices[r],getMounts(r){for(var e=[],t=[r];t.length;){var o=t.pop();e.push(o),t.push(...o.mounts)}return e},syncfs(r,e){typeof r=="function"&&(e=r,r=!1),n.syncFSRequests++,n.syncFSRequests>1&&T(`warning: ${n.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=n.getMounts(n.root.mount),o=0;function i(u){return n.syncFSRequests--,e(u)}function a(u){if(u)return a.errored?void 0:(a.errored=!0,i(u));++o>=t.length&&i(null)}t.forEach(u=>{if(!u.type.syncfs)return a(null);u.type.syncfs(u,r,a)})},mount(r,e,t){var o=t==="/",i=!t,a;if(o&&n.root)throw new n.ErrnoError(10);if(!o&&!i){var u=n.lookupPath(t,{follow_mount:!1});if(t=u.path,a=u.node,n.isMountpoint(a))throw new n.ErrnoError(10);if(!n.isDir(a.mode))throw new n.ErrnoError(54)}var c={type:r,opts:e,mountpoint:t,mounts:[]},p=r.mount(c);return p.mount=c,c.root=p,o?n.root=p:a&&(a.mounted=c,a.mount&&a.mount.mounts.push(c)),p},unmount(r){var e=n.lookupPath(r,{follow_mount:!1});if(!n.isMountpoint(e.node))throw new n.ErrnoError(28);var t=e.node,o=t.mounted,i=n.getMounts(o);Object.keys(n.nameTable).forEach(u=>{for(var c=n.nameTable[u];c;){var p=c.name_next;i.includes(c.mount)&&n.destroyNode(c),c=p}}),t.mounted=null;var a=t.mount.mounts.indexOf(o);t.mount.mounts.splice(a,1)},lookup(r,e){return r.node_ops.lookup(r,e)},mknod(r,e,t){var o=n.lookupPath(r,{parent:!0}),i=o.node,a=G.basename(r);if(!a||a==="."||a==="..")throw new n.ErrnoError(28);var u=n.mayCreate(i,a);if(u)throw new n.ErrnoError(u);if(!i.node_ops.mknod)throw new n.ErrnoError(63);return i.node_ops.mknod(i,a,e,t)},create(r,e){return e=e!==void 0?e:438,e&=4095,e|=32768,n.mknod(r,e,0)},mkdir(r,e){return e=e!==void 0?e:511,e&=1023,e|=16384,n.mknod(r,e,0)},mkdirTree(r,e){for(var t=r.split("/"),o="",i=0;i"u"&&(t=e,e=438),e|=8192,n.mknod(r,e,t)},symlink(r,e){if(!hr.resolve(r))throw new n.ErrnoError(44);var t=n.lookupPath(e,{parent:!0}),o=t.node;if(!o)throw new n.ErrnoError(44);var i=G.basename(e),a=n.mayCreate(o,i);if(a)throw new n.ErrnoError(a);if(!o.node_ops.symlink)throw new n.ErrnoError(63);return o.node_ops.symlink(o,i,r)},rename(r,e){var t=G.dirname(r),o=G.dirname(e),i=G.basename(r),a=G.basename(e),u,c,p;if(u=n.lookupPath(r,{parent:!0}),c=u.node,u=n.lookupPath(e,{parent:!0}),p=u.node,!c||!p)throw new n.ErrnoError(44);if(c.mount!==p.mount)throw new n.ErrnoError(75);var B=n.lookupNode(c,i),O=hr.relative(r,o);if(O.charAt(0)!==".")throw new n.ErrnoError(28);if(O=hr.relative(e,t),O.charAt(0)!==".")throw new n.ErrnoError(55);var k;try{k=n.lookupNode(p,a)}catch{}if(B!==k){var D=n.isDir(B.mode),b=n.mayDelete(c,i,D);if(b)throw new n.ErrnoError(b);if(b=k?n.mayDelete(p,a,D):n.mayCreate(p,a),b)throw new n.ErrnoError(b);if(!c.node_ops.rename)throw new n.ErrnoError(63);if(n.isMountpoint(B)||k&&n.isMountpoint(k))throw new n.ErrnoError(10);if(p!==c&&(b=n.nodePermissions(c,"w"),b))throw new n.ErrnoError(b);n.hashRemoveNode(B);try{c.node_ops.rename(B,p,a),B.parent=p}catch(x){throw x}finally{n.hashAddNode(B)}}},rmdir(r){var e=n.lookupPath(r,{parent:!0}),t=e.node,o=G.basename(r),i=n.lookupNode(t,o),a=n.mayDelete(t,o,!0);if(a)throw new n.ErrnoError(a);if(!t.node_ops.rmdir)throw new n.ErrnoError(63);if(n.isMountpoint(i))throw new n.ErrnoError(10);t.node_ops.rmdir(t,o),n.destroyNode(i)},readdir(r){var e=n.lookupPath(r,{follow:!0}),t=e.node;if(!t.node_ops.readdir)throw new n.ErrnoError(54);return t.node_ops.readdir(t)},unlink(r){var e=n.lookupPath(r,{parent:!0}),t=e.node;if(!t)throw new n.ErrnoError(44);var o=G.basename(r),i=n.lookupNode(t,o),a=n.mayDelete(t,o,!1);if(a)throw new n.ErrnoError(a);if(!t.node_ops.unlink)throw new n.ErrnoError(63);if(n.isMountpoint(i))throw new n.ErrnoError(10);t.node_ops.unlink(t,o),n.destroyNode(i)},readlink(r){var e=n.lookupPath(r),t=e.node;if(!t)throw new n.ErrnoError(44);if(!t.node_ops.readlink)throw new n.ErrnoError(28);return hr.resolve(n.getPath(t.parent),t.node_ops.readlink(t))},stat(r,e){var t=n.lookupPath(r,{follow:!e}),o=t.node;if(!o)throw new n.ErrnoError(44);if(!o.node_ops.getattr)throw new n.ErrnoError(63);return o.node_ops.getattr(o)},lstat(r){return n.stat(r,!0)},chmod(r,e,t){var o;if(typeof r=="string"){var i=n.lookupPath(r,{follow:!t});o=i.node}else o=r;if(!o.node_ops.setattr)throw new n.ErrnoError(63);o.node_ops.setattr(o,{mode:e&4095|o.mode&-4096,timestamp:Date.now()})},lchmod(r,e){n.chmod(r,e,!0)},fchmod(r,e){var t=n.getStreamChecked(r);n.chmod(t.node,e)},chown(r,e,t,o){var i;if(typeof r=="string"){var a=n.lookupPath(r,{follow:!o});i=a.node}else i=r;if(!i.node_ops.setattr)throw new n.ErrnoError(63);i.node_ops.setattr(i,{timestamp:Date.now()})},lchown(r,e,t){n.chown(r,e,t,!0)},fchown(r,e,t){var o=n.getStreamChecked(r);n.chown(o.node,e,t)},truncate(r,e){if(e<0)throw new n.ErrnoError(28);var t;if(typeof r=="string"){var o=n.lookupPath(r,{follow:!0});t=o.node}else t=r;if(!t.node_ops.setattr)throw new n.ErrnoError(63);if(n.isDir(t.mode))throw new n.ErrnoError(31);if(!n.isFile(t.mode))throw new n.ErrnoError(28);var i=n.nodePermissions(t,"w");if(i)throw new n.ErrnoError(i);t.node_ops.setattr(t,{size:e,timestamp:Date.now()})},ftruncate(r,e){var t=n.getStreamChecked(r);if(!(t.flags&2097155))throw new n.ErrnoError(28);n.truncate(t.node,e)},utime(r,e,t){var o=n.lookupPath(r,{follow:!0}),i=o.node;i.node_ops.setattr(i,{timestamp:Math.max(e,t)})},open(r,e,t){if(r==="")throw new n.ErrnoError(44);e=typeof e=="string"?yt(e):e,e&64?(t=typeof t>"u"?438:t,t=t&4095|32768):t=0;var o;if(typeof r=="object")o=r;else{r=G.normalize(r);try{var i=n.lookupPath(r,{follow:!(e&131072)});o=i.node}catch{}}var a=!1;if(e&64)if(o){if(e&128)throw new n.ErrnoError(20)}else o=n.mknod(r,t,0),a=!0;if(!o)throw new n.ErrnoError(44);if(n.isChrdev(o.mode)&&(e&=-513),e&65536&&!n.isDir(o.mode))throw new n.ErrnoError(54);if(!a){var u=n.mayOpen(o,e);if(u)throw new n.ErrnoError(u)}e&512&&!a&&n.truncate(o,0),e&=-131713;var c=n.createStream({node:o,path:n.getPath(o),flags:e,seekable:!0,position:0,stream_ops:o.stream_ops,ungotten:[],error:!1});return c.stream_ops.open&&c.stream_ops.open(c),s.logReadFiles&&!(e&1)&&(n.readFiles||(n.readFiles={}),r in n.readFiles||(n.readFiles[r]=1)),c},close(r){if(n.isClosed(r))throw new n.ErrnoError(8);r.getdents&&(r.getdents=null);try{r.stream_ops.close&&r.stream_ops.close(r)}catch(e){throw e}finally{n.closeStream(r.fd)}r.fd=null},isClosed(r){return r.fd===null},llseek(r,e,t){if(n.isClosed(r))throw new n.ErrnoError(8);if(!r.seekable||!r.stream_ops.llseek)throw new n.ErrnoError(70);if(t!=0&&t!=1&&t!=2)throw new n.ErrnoError(28);return r.position=r.stream_ops.llseek(r,e,t),r.ungotten=[],r.position},read(r,e,t,o,i){if(o<0||i<0)throw new n.ErrnoError(28);if(n.isClosed(r))throw new n.ErrnoError(8);if((r.flags&2097155)===1)throw new n.ErrnoError(8);if(n.isDir(r.node.mode))throw new n.ErrnoError(31);if(!r.stream_ops.read)throw new n.ErrnoError(28);var a=typeof i<"u";if(!a)i=r.position;else if(!r.seekable)throw new n.ErrnoError(70);var u=r.stream_ops.read(r,e,t,o,i);return a||(r.position+=u),u},write(r,e,t,o,i,a){if(o<0||i<0)throw new n.ErrnoError(28);if(n.isClosed(r))throw new n.ErrnoError(8);if(!(r.flags&2097155))throw new n.ErrnoError(8);if(n.isDir(r.node.mode))throw new n.ErrnoError(31);if(!r.stream_ops.write)throw new n.ErrnoError(28);r.seekable&&r.flags&1024&&n.llseek(r,0,2);var u=typeof i<"u";if(!u)i=r.position;else if(!r.seekable)throw new n.ErrnoError(70);var c=r.stream_ops.write(r,e,t,o,i,a);return u||(r.position+=c),c},allocate(r,e,t){if(n.isClosed(r))throw new n.ErrnoError(8);if(e<0||t<=0)throw new n.ErrnoError(28);if(!(r.flags&2097155))throw new n.ErrnoError(8);if(!n.isFile(r.node.mode)&&!n.isDir(r.node.mode))throw new n.ErrnoError(43);if(!r.stream_ops.allocate)throw new n.ErrnoError(138);r.stream_ops.allocate(r,e,t)},mmap(r,e,t,o,i){if(o&2&&!(i&2)&&(r.flags&2097155)!==2)throw new n.ErrnoError(2);if((r.flags&2097155)===1)throw new n.ErrnoError(2);if(!r.stream_ops.mmap)throw new n.ErrnoError(43);return r.stream_ops.mmap(r,e,t,o,i)},msync(r,e,t,o,i){return r.stream_ops.msync?r.stream_ops.msync(r,e,t,o,i):0},ioctl(r,e,t){if(!r.stream_ops.ioctl)throw new n.ErrnoError(59);return r.stream_ops.ioctl(r,e,t)},readFile(r,e={}){if(e.flags=e.flags||0,e.encoding=e.encoding||"binary",e.encoding!=="utf8"&&e.encoding!=="binary")throw new Error(`Invalid encoding type "${e.encoding}"`);var t,o=n.open(r,e.flags),i=n.stat(r),a=i.size,u=new Uint8Array(a);return n.read(o,u,0,a,0),e.encoding==="utf8"?t=Kr(u,0):e.encoding==="binary"&&(t=u),n.close(o),t},writeFile(r,e,t={}){t.flags=t.flags||577;var o=n.open(r,t.flags,t.mode);if(typeof e=="string"){var i=new Uint8Array(re(e)+1),a=ee(e,i,0,i.length);n.write(o,i,0,a,void 0,t.canOwn)}else if(ArrayBuffer.isView(e))n.write(o,e,0,e.byteLength,void 0,t.canOwn);else throw new Error("Unsupported data type");n.close(o)},cwd:()=>n.currentPath,chdir(r){var e=n.lookupPath(r,{follow:!0});if(e.node===null)throw new n.ErrnoError(44);if(!n.isDir(e.node.mode))throw new n.ErrnoError(54);var t=n.nodePermissions(e.node,"x");if(t)throw new n.ErrnoError(t);n.currentPath=e.path},createDefaultDirectories(){n.mkdir("/tmp"),n.mkdir("/home"),n.mkdir("/home/web_user")},createDefaultDevices(){n.mkdir("/dev"),n.registerDevice(n.makedev(1,3),{read:()=>0,write:(o,i,a,u,c)=>u}),n.mkdev("/dev/null",n.makedev(1,3)),Er.register(n.makedev(5,0),Er.default_tty_ops),Er.register(n.makedev(6,0),Er.default_tty1_ops),n.mkdev("/dev/tty",n.makedev(5,0)),n.mkdev("/dev/tty1",n.makedev(6,0));var r=new Uint8Array(1024),e=0,t=()=>(e===0&&(e=de(r).byteLength),r[--e]);n.createDevice("/dev","random",t),n.createDevice("/dev","urandom",t),n.mkdir("/dev/shm"),n.mkdir("/dev/shm/tmp")},createSpecialDirectories(){n.mkdir("/proc");var r=n.mkdir("/proc/self");n.mkdir("/proc/self/fd"),n.mount({mount(){var e=n.createNode(r,"fd",16895,73);return e.node_ops={lookup(t,o){var i=+o,a=n.getStreamChecked(i),u={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>a.path}};return u.parent=u,u}},e}},{},"/proc/self/fd")},createStandardStreams(){s.stdin?n.createDevice("/dev","stdin",s.stdin):n.symlink("/dev/tty","/dev/stdin"),s.stdout?n.createDevice("/dev","stdout",null,s.stdout):n.symlink("/dev/tty","/dev/stdout"),s.stderr?n.createDevice("/dev","stderr",null,s.stderr):n.symlink("/dev/tty1","/dev/stderr");var r=n.open("/dev/stdin",0),e=n.open("/dev/stdout",1),t=n.open("/dev/stderr",1)},staticInit(){[44].forEach(r=>{n.genericErrors[r]=new n.ErrnoError(r),n.genericErrors[r].stack=""}),n.nameTable=new Array(4096),n.mount(M,{},"/"),n.createDefaultDirectories(),n.createDefaultDevices(),n.createSpecialDirectories(),n.filesystems={MEMFS:M}},init(r,e,t){n.init.initialized=!0,s.stdin=r||s.stdin,s.stdout=e||s.stdout,s.stderr=t||s.stderr,n.createStandardStreams()},quit(){n.init.initialized=!1;for(var r=0;rthis.length-1||b<0)){var x=b%this.chunkSize,nr=b/this.chunkSize|0;return this.getter(nr)[x]}}setDataGetter(b){this.getter=b}cacheLength(){var b=new XMLHttpRequest;if(b.open("HEAD",t,!1),b.send(null),!(b.status>=200&&b.status<300||b.status===304))throw new Error("Couldn't load "+t+". Status: "+b.status);var x=Number(b.getResponseHeader("Content-length")),nr,mr=(nr=b.getResponseHeader("Accept-Ranges"))&&nr==="bytes",vr=(nr=b.getResponseHeader("Content-Encoding"))&&nr==="gzip",fr=1024*1024;mr||(fr=x);var yr=(_r,kr)=>{if(_r>kr)throw new Error("invalid range ("+_r+", "+kr+") or no bytes requested!");if(kr>x-1)throw new Error("only "+x+" bytes available! programmer error!");var rr=new XMLHttpRequest;if(rr.open("GET",t,!1),x!==fr&&rr.setRequestHeader("Range","bytes="+_r+"-"+kr),rr.responseType="arraybuffer",rr.overrideMimeType&&rr.overrideMimeType("text/plain; charset=x-user-defined"),rr.send(null),!(rr.status>=200&&rr.status<300||rr.status===304))throw new Error("Couldn't load "+t+". Status: "+rr.status);return rr.response!==void 0?new Uint8Array(rr.response||[]):te(rr.responseText||"",!0)},Gr=this;Gr.setDataGetter(_r=>{var kr=_r*fr,rr=(_r+1)*fr-1;if(rr=Math.min(rr,x-1),typeof Gr.chunks[_r]>"u"&&(Gr.chunks[_r]=yr(kr,rr)),typeof Gr.chunks[_r]>"u")throw new Error("doXHR failed!");return Gr.chunks[_r]}),(vr||!x)&&(fr=x=1,x=this.getter(0).length,fr=x,C("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=x,this._chunkSize=fr,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(typeof XMLHttpRequest<"u"){if(!w)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var u=new a,c={isDevice:!1,contents:u}}else var c={isDevice:!1,url:t};var p=n.createFile(r,e,c,o,i);c.contents?p.contents=c.contents:c.url&&(p.contents=null,p.url=c.url),Object.defineProperties(p,{usedBytes:{get:function(){return this.contents.length}}});var B={},O=Object.keys(p.stream_ops);O.forEach(D=>{var b=p.stream_ops[D];B[D]=(...x)=>(n.forceLoadFile(p),b(...x))});function k(D,b,x,nr,mr){var vr=D.node.contents;if(mr>=vr.length)return 0;var fr=Math.min(vr.length-mr,nr);if(vr.slice)for(var yr=0;yr(n.forceLoadFile(p),k(D,b,x,nr,mr)),B.mmap=(D,b,x,nr,mr)=>{n.forceLoadFile(p);var vr=we(b);if(!vr)throw new n.ErrnoError(48);return k(D,m,vr,b,x),{ptr:vr,allocated:!0}},p.stream_ops=B,p}},sr=(r,e)=>r?Kr(Q,r,e):"",Z={DEFAULT_POLLMASK:5,calculateAt(r,e,t){if(G.isAbs(e))return e;var o;if(r===-100)o=n.cwd();else{var i=Z.getStreamFromFD(r);o=i.path}if(e.length==0){if(!t)throw new n.ErrnoError(44);return o}return G.join2(o,e)},doStat(r,e,t){var o=r(e);L[t>>2]=o.dev,L[t+4>>2]=o.mode,X[t+8>>2]=o.nlink,L[t+12>>2]=o.uid,L[t+16>>2]=o.gid,L[t+20>>2]=o.rdev,q=[o.size>>>0,(F=o.size,+Math.abs(F)>=1?F>0?+Math.floor(F/4294967296)>>>0:~~+Math.ceil((F-+(~~F>>>0))/4294967296)>>>0:0)],L[t+24>>2]=q[0],L[t+28>>2]=q[1],L[t+32>>2]=4096,L[t+36>>2]=o.blocks;var i=o.atime.getTime(),a=o.mtime.getTime(),u=o.ctime.getTime();return q=[Math.floor(i/1e3)>>>0,(F=Math.floor(i/1e3),+Math.abs(F)>=1?F>0?+Math.floor(F/4294967296)>>>0:~~+Math.ceil((F-+(~~F>>>0))/4294967296)>>>0:0)],L[t+40>>2]=q[0],L[t+44>>2]=q[1],X[t+48>>2]=i%1e3*1e3,q=[Math.floor(a/1e3)>>>0,(F=Math.floor(a/1e3),+Math.abs(F)>=1?F>0?+Math.floor(F/4294967296)>>>0:~~+Math.ceil((F-+(~~F>>>0))/4294967296)>>>0:0)],L[t+56>>2]=q[0],L[t+60>>2]=q[1],X[t+64>>2]=a%1e3*1e3,q=[Math.floor(u/1e3)>>>0,(F=Math.floor(u/1e3),+Math.abs(F)>=1?F>0?+Math.floor(F/4294967296)>>>0:~~+Math.ceil((F-+(~~F>>>0))/4294967296)>>>0:0)],L[t+72>>2]=q[0],L[t+76>>2]=q[1],X[t+80>>2]=u%1e3*1e3,q=[o.ino>>>0,(F=o.ino,+Math.abs(F)>=1?F>0?+Math.floor(F/4294967296)>>>0:~~+Math.ceil((F-+(~~F>>>0))/4294967296)>>>0:0)],L[t+88>>2]=q[0],L[t+92>>2]=q[1],0},doMsync(r,e,t,o,i){if(!n.isFile(e.node.mode))throw new n.ErrnoError(43);if(o&2)return 0;var a=Q.slice(r,r+t);n.msync(e,a,i,t,o)},getStreamFromFD(r){var e=n.getStreamChecked(r);return e},varargs:void 0,getStr(r){var e=sr(r);return e}};function pt(r,e,t,o){try{if(e=Z.getStr(e),e=Z.calculateAt(r,e),t&-8)return-28;var i=n.lookupPath(e,{follow:!0}),a=i.node;if(!a)return-44;var u="";return t&4&&(u+="r"),t&2&&(u+="w"),t&1&&(u+="x"),u&&n.nodePermissions(a,u)?-2:0}catch(c){if(typeof n>"u"||c.name!=="ErrnoError")throw c;return-c.errno}}function Sr(){var r=L[+Z.varargs>>2];return Z.varargs+=4,r}var xr=Sr;function dt(r,e,t){Z.varargs=t;try{var o=Z.getStreamFromFD(r);switch(e){case 0:{var i=Sr();if(i<0)return-28;for(;n.streams[i];)i++;var a;return a=n.dupStream(o,i),a.fd}case 1:case 2:return 0;case 3:return o.flags;case 4:{var i=Sr();return o.flags|=i,0}case 12:{var i=xr(),u=0;return $[i+u>>1]=2,0}case 13:case 14:return 0}return-28}catch(c){if(typeof n>"u"||c.name!=="ErrnoError")throw c;return-c.errno}}function _t(r,e){try{var t=Z.getStreamFromFD(r);return Z.doStat(n.stat,t.path,e)}catch(o){if(typeof n>"u"||o.name!=="ErrnoError")throw o;return-o.errno}}function ht(r,e,t){Z.varargs=t;try{var o=Z.getStreamFromFD(r);switch(e){case 21509:return o.tty?0:-59;case 21505:{if(!o.tty)return-59;if(o.tty.ops.ioctl_tcgets){var i=o.tty.ops.ioctl_tcgets(o),a=xr();L[a>>2]=i.c_iflag||0,L[a+4>>2]=i.c_oflag||0,L[a+8>>2]=i.c_cflag||0,L[a+12>>2]=i.c_lflag||0;for(var u=0;u<32;u++)m[a+u+17]=i.c_cc[u]||0;return 0}return 0}case 21510:case 21511:case 21512:return o.tty?0:-59;case 21506:case 21507:case 21508:{if(!o.tty)return-59;if(o.tty.ops.ioctl_tcsets){for(var a=xr(),c=L[a>>2],p=L[a+4>>2],B=L[a+8>>2],O=L[a+12>>2],k=[],u=0;u<32;u++)k.push(m[a+u+17]);return o.tty.ops.ioctl_tcsets(o.tty,e,{c_iflag:c,c_oflag:p,c_cflag:B,c_lflag:O,c_cc:k})}return 0}case 21519:{if(!o.tty)return-59;var a=xr();return L[a>>2]=0,0}case 21520:return o.tty?-28:-59;case 21531:{var a=xr();return n.ioctl(o,e,a)}case 21523:{if(!o.tty)return-59;if(o.tty.ops.ioctl_tiocgwinsz){var D=o.tty.ops.ioctl_tiocgwinsz(o.tty),a=xr();$[a>>1]=D[0],$[a+2>>1]=D[1]}return 0}case 21524:return o.tty?0:-59;case 21515:return o.tty?0:-59;default:return-28}}catch(b){if(typeof n>"u"||b.name!=="ErrnoError")throw b;return-b.errno}}function wt(r,e,t,o){try{e=Z.getStr(e);var i=o&256,a=o&4096;return o=o&-6401,e=Z.calculateAt(r,e,a),Z.doStat(i?n.lstat:n.stat,e,t)}catch(u){if(typeof n>"u"||u.name!=="ErrnoError")throw u;return-u.errno}}function mt(r,e,t,o){Z.varargs=o;try{e=Z.getStr(e),e=Z.calculateAt(r,e);var i=o?Sr():0;return n.open(e,t,i).fd}catch(a){if(typeof n>"u"||a.name!=="ErrnoError")throw a;return-a.errno}}var Tr=(r,e,t)=>ee(r,Q,e,t);function bt(r,e,t,o){try{if(e=Z.getStr(e),e=Z.calculateAt(r,e),o<=0)return-28;var i=n.readlink(e),a=Math.min(o,re(i)),u=m[t+a];return Tr(i,t,o+1),m[t+a]=u,a}catch(c){if(typeof n>"u"||c.name!=="ErrnoError")throw c;return-c.errno}}function Lt(r){try{return r=Z.getStr(r),n.rmdir(r),0}catch(e){if(typeof n>"u"||e.name!=="ErrnoError")throw e;return-e.errno}}function Bt(r,e){try{return r=Z.getStr(r),Z.doStat(n.stat,r,e)}catch(t){if(typeof n>"u"||t.name!=="ErrnoError")throw t;return-t.errno}}function Et(r,e,t){try{return e=Z.getStr(e),e=Z.calculateAt(r,e),t===0?n.unlink(e):t===512?n.rmdir(e):dr("Invalid flags passed to unlinkat"),0}catch(o){if(typeof n>"u"||o.name!=="ErrnoError")throw o;return-o.errno}}var Mt=()=>{dr("")},Ct=1,gt=()=>Ct,Dt=(r,e,t)=>Q.copyWithin(r,e,e+t),oe=(r,e)=>e+2097152>>>0<4194305-!!r?(r>>>0)+e*4294967296:NaN;function Ft(r,e,t,o,i,a,u,c){var p=oe(i,a);try{if(isNaN(p))return 61;var B=Z.getStreamFromFD(o),O=n.mmap(B,r,p,e,t),k=O.ptr;return L[u>>2]=O.allocated,X[c>>2]=k,0}catch(D){if(typeof n>"u"||D.name!=="ErrnoError")throw D;return-D.errno}}function Xt(r,e,t,o,i,a,u){var c=oe(a,u);try{var p=Z.getStreamFromFD(i);t&2&&Z.doMsync(r,p,e,o,c)}catch(B){if(typeof n>"u"||B.name!=="ErrnoError")throw B;return-B.errno}}var Ot=(r,e,t,o)=>{var i=new Date().getFullYear(),a=new Date(i,0,1),u=new Date(i,6,1),c=a.getTimezoneOffset(),p=u.getTimezoneOffset(),B=Math.max(c,p);X[r>>2]=B*60,L[e>>2]=+(c!=p);var O=b=>b.toLocaleTimeString(void 0,{hour12:!1,timeZoneName:"short"}).split(" ")[1],k=O(a),D=O(u);p{ie.length=0;for(var t;t=Q[r++];){var o=t!=105;o&=t!=112,e+=o&&e%8?4:0,ie.push(t==112?X[e>>2]:t==105?L[e>>2]:tr[e>>3]),e+=o?8:4}return ie},xt=(r,e,t)=>{var o=Kt(e,t);return rt[r](...o)},kt=(r,e,t)=>xt(r,e,t),Zt=()=>Date.now(),Ht;Ht=()=>performance.now();var Tt=()=>2147483648,Rt=r=>{var e=Y.buffer,t=(r-e.byteLength+65535)/65536;try{return Y.grow(t),R(),1}catch{}},Gt=r=>{var e=Q.length;r>>>=0;var t=Tt();if(r>t)return!1;for(var o=(p,B)=>p+(B-p%B)%B,i=1;i<=4;i*=2){var a=e*(1+.2/i);a=Math.min(a,r+100663296);var u=Math.min(t,o(Math.max(r,a),65536)),c=Rt(u);if(c)return!0}return!1},ae={},Wt=()=>W||"./this.program",Rr=()=>{if(!Rr.strings){var r=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:r,_:Wt()};for(var t in ae)ae[t]===void 0?delete e[t]:e[t]=ae[t];var o=[];for(var t in e)o.push(`${t}=${e[t]}`);Rr.strings=o}return Rr.strings},Vt=(r,e)=>{for(var t=0;t{var t=0;return Rr().forEach((o,i)=>{var a=e+t;X[r+i*4>>2]=a,Vt(o,a),t+=o.length+1}),0},Nt=(r,e)=>{var t=Rr();X[r>>2]=t.length;var o=0;return t.forEach(i=>o+=i.length+1),X[e>>2]=o,0},Qt=0,Ut=()=>Qt>0,St=r=>{or=r,Ut()||(U=!0),I(r,new et(r))},Yt=(r,e)=>{or=r,St(r)},zt=Yt;function jt(r){try{var e=Z.getStreamFromFD(r);return n.close(e),0}catch(t){if(typeof n>"u"||t.name!=="ErrnoError")throw t;return t.errno}}var It=(r,e,t,o)=>{for(var i=0,a=0;a>2],c=X[e+4>>2];e+=8;var p=n.read(r,m,u,c,o);if(p<0)return-1;if(i+=p,p>2]=a,0}catch(u){if(typeof n>"u"||u.name!=="ErrnoError")throw u;return u.errno}}function qt(r,e,t,o,i){var a=oe(e,t);try{if(isNaN(a))return 61;var u=Z.getStreamFromFD(r);return n.llseek(u,a,o),q=[u.position>>>0,(F=u.position,+Math.abs(F)>=1?F>0?+Math.floor(F/4294967296)>>>0:~~+Math.ceil((F-+(~~F>>>0))/4294967296)>>>0:0)],L[i>>2]=q[0],L[i+4>>2]=q[1],u.getdents&&a===0&&o===0&&(u.getdents=null),0}catch(c){if(typeof n>"u"||c.name!=="ErrnoError")throw c;return c.errno}}var $t=(r,e,t,o)=>{for(var i=0,a=0;a>2],c=X[e+4>>2];e+=8;var p=n.write(r,m,u,c,o);if(p<0)return-1;i+=p,typeof o<"u"&&(o+=p)}return i};function At(r,e,t,o){try{var i=Z.getStreamFromFD(r),a=$t(i,e,t);return X[o>>2]=a,0}catch(u){if(typeof n>"u"||u.name!=="ErrnoError")throw u;return u.errno}}n.createPreloadedFile=ft,n.staticInit();var rn={a:ot,k:pt,h:dt,y:_t,z:ht,w:wt,d:mt,r:bt,s:Lt,x:Bt,t:Et,l:Mt,i:gt,j:Dt,m:Ft,n:Xt,p:Ot,A:kt,b:Zt,q:Gt,u:Pt,v:Nt,e:zt,c:jt,f:Jt,o:qt,g:At},H=Ae(),en=()=>(en=H.C)(),tn=s._webidl_free=r=>(tn=s._webidl_free=H.D)(r),nn=s._free=r=>(nn=s._free=H.E)(r),on=s._webidl_malloc=r=>(on=s._webidl_malloc=H.F)(r),an=s._malloc=r=>(an=s._malloc=H.G)(r),me=s._emscripten_bind_VoidPtr___destroy___0=r=>(me=s._emscripten_bind_VoidPtr___destroy___0=H.H)(r),be=s._emscripten_bind_Graphviz_Graphviz_2=(r,e)=>(be=s._emscripten_bind_Graphviz_Graphviz_2=H.I)(r,e),Le=s._emscripten_bind_Graphviz_version_0=()=>(Le=s._emscripten_bind_Graphviz_version_0=H.J)(),Be=s._emscripten_bind_Graphviz_lastError_0=()=>(Be=s._emscripten_bind_Graphviz_lastError_0=H.K)(),Ee=s._emscripten_bind_Graphviz_createFile_2=(r,e,t)=>(Ee=s._emscripten_bind_Graphviz_createFile_2=H.L)(r,e,t),Me=s._emscripten_bind_Graphviz_layout_3=(r,e,t,o)=>(Me=s._emscripten_bind_Graphviz_layout_3=H.M)(r,e,t,o),Ce=s._emscripten_bind_Graphviz_acyclic_3=(r,e,t,o)=>(Ce=s._emscripten_bind_Graphviz_acyclic_3=H.N)(r,e,t,o),ge=s._emscripten_bind_Graphviz_tred_3=(r,e,t,o)=>(ge=s._emscripten_bind_Graphviz_tred_3=H.O)(r,e,t,o),De=s._emscripten_bind_Graphviz_unflatten_4=(r,e,t,o,i)=>(De=s._emscripten_bind_Graphviz_unflatten_4=H.P)(r,e,t,o,i),Fe=s._emscripten_bind_Graphviz_get_layout_result_0=r=>(Fe=s._emscripten_bind_Graphviz_get_layout_result_0=H.Q)(r),Xe=s._emscripten_bind_Graphviz_set_layout_result_1=(r,e)=>(Xe=s._emscripten_bind_Graphviz_set_layout_result_1=H.R)(r,e),Oe=s._emscripten_bind_Graphviz_get_acyclic_outFile_0=r=>(Oe=s._emscripten_bind_Graphviz_get_acyclic_outFile_0=H.S)(r),Ke=s._emscripten_bind_Graphviz_set_acyclic_outFile_1=(r,e)=>(Ke=s._emscripten_bind_Graphviz_set_acyclic_outFile_1=H.T)(r,e),xe=s._emscripten_bind_Graphviz_get_acyclic_num_rev_0=r=>(xe=s._emscripten_bind_Graphviz_get_acyclic_num_rev_0=H.U)(r),ke=s._emscripten_bind_Graphviz_set_acyclic_num_rev_1=(r,e)=>(ke=s._emscripten_bind_Graphviz_set_acyclic_num_rev_1=H.V)(r,e),Ze=s._emscripten_bind_Graphviz_get_tred_out_0=r=>(Ze=s._emscripten_bind_Graphviz_get_tred_out_0=H.W)(r),He=s._emscripten_bind_Graphviz_set_tred_out_1=(r,e)=>(He=s._emscripten_bind_Graphviz_set_tred_out_1=H.X)(r,e),Te=s._emscripten_bind_Graphviz_get_tred_err_0=r=>(Te=s._emscripten_bind_Graphviz_get_tred_err_0=H.Y)(r),Re=s._emscripten_bind_Graphviz_set_tred_err_1=(r,e)=>(Re=s._emscripten_bind_Graphviz_set_tred_err_1=H.Z)(r,e),Ge=s._emscripten_bind_Graphviz___destroy___0=r=>(Ge=s._emscripten_bind_Graphviz___destroy___0=H._)(r),We=(r,e)=>(We=H.aa)(r,e),Ve=r=>(Ve=H.ba)(r);s.UTF8ToString=sr;var Yr;Lr=function r(){Yr||Pe(),Yr||(Lr=r)};function Pe(){if(br>0||(Fr(),br>0))return;function r(){Yr||(Yr=!0,s.calledRun=!0,!U&&(Zr(),y(s),Qr()))}r()}Pe();function ur(){}ur.prototype=Object.create(ur.prototype),ur.prototype.constructor=ur,ur.prototype.__class__=ur,ur.__cache__={},s.WrapperObject=ur;function zr(r){return(r||ur).__cache__}s.getCache=zr;function se(r,e){var t=zr(e),o=t[r];return o||(o=Object.create((e||ur).prototype),o.ptr=r,t[r]=o)}s.wrapPointer=se;function sn(r,e){return se(r.ptr,e)}s.castObject=sn,s.NULL=se(0);function un(r){if(!r.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";r.__destroy__(),delete zr(r.__class__)[r.ptr]}s.destroy=un;function ln(r,e){return r.ptr===e.ptr}s.compare=ln;function cn(r){return r.ptr}s.getPointer=cn;function vn(r){return r.__class__}s.getClass=vn;var K={buffer:0,size:0,pos:0,temps:[],needed:0,prepare(){if(K.needed){for(var r=0;r=K.size?(S(o>0),K.needed+=o,i=s._webidl_malloc(o),K.temps.push(i)):(i=K.buffer+K.pos,K.pos+=o),i},copy(r,e,t){t/=e.BYTES_PER_ELEMENT;for(var o=0;o
+
+ `}}function xn(l){return l.map(Kn)}function kn(l,v){let f={images:[],files:[],...v};[...f.files,...xn(f.images)].forEach(s=>l.createFile(s.path,s.data))}var Ie=class l{constructor(v){this._module=v}static load(){return ze().then(v=>new l(v))}static unload(){je()}version(){return this._module.Graphviz.prototype.version()}layout(v,f="svg",s="dot",y){if(!v)return"";let d=new this._module.Graphviz(y?.yInvert?1:0,y?.nop?y?.nop:0),_="",w="";try{kn(d,y);try{_=d.layout(v,f,s)}catch(E){w=E.message}w=d.lastError()||w}finally{this._module.destroy(d)}if(!_&&w)throw l.unload(),new Error(w);return _}acyclic(v,f=!1,s=!1){if(!v)return{acyclic:!1,num_rev:0,outFile:""};let y=new this._module.Graphviz,d=!1,_=0,w="",E="";try{try{d=y.acyclic(v,f,s),_=y.acyclic_num_rev,w=y.acyclic_outFile}catch(W){E=W.message}E=y.lastError()||E}finally{this._module.destroy(y)}if(E)throw l.unload(),new Error(E);return{acyclic:d,num_rev:_,outFile:w}}tred(v,f=!1,s=!1){if(!v)return{out:"",err:""};let y=new this._module.Graphviz,d="",_="",w="";try{try{y.tred(v,f,s),d=y.tred_out,_=y.tred_err}catch(E){w=E.message}w=y.lastError()||w}finally{this._module.destroy(y)}if(!d&&w)throw l.unload(),new Error(w);return{out:d,err:_}}unflatten(v,f=0,s=!1,y=0){if(!v)return"";let d=new this._module.Graphviz,_="",w="";try{try{_=d.unflatten(v,f,s,y)}catch(E){w=E.message}w=d.lastError()||w}finally{this._module.destroy(d)}if(!_&&w)throw l.unload(),new Error(w);return _}circo(v,f="svg",s){return this.layout(v,f,"circo",s)}dot(v,f="svg",s){return this.layout(v,f,"dot",s)}fdp(v,f="svg",s){return this.layout(v,f,"fdp",s)}sfdp(v,f="svg",s){return this.layout(v,f,"sfdp",s)}neato(v,f="svg",s){return this.layout(v,f,"neato",s)}osage(v,f="svg",s){return this.layout(v,f,"osage",s)}patchwork(v,f="svg",s){return this.layout(v,f,"patchwork",s)}twopi(v,f="svg",s){return this.layout(v,f,"twopi",s)}nop(v){return this.layout(v,"dot","nop")}nop2(v){return this.layout(v,"dot","nop2")}};export{Ie as Graphviz};
+//# sourceMappingURL=graphviz.js.map