b.getNode(a,g)}functionca(a,b,c,d,e){I(c,e)&&C(b,c,d,e)}functionda(a,b,c,d,e){varf=a.openFiles[c];f?D(b,f,d,e):e(newXa.EBADF)}functionea(a,b,c,d,e,f,g){"function"==typeoff&&(g=f,f=null),I(c,g)&&A(b,c,d,e,f,g)}functionfa(a,b,c,d,e,f,g){"function"==typeoff&&(g=f,f=null);varh=a.openFiles[c];h?wa(h.flags).contains(Na)?B(b,h,d,e,f,g):g(newXa.EBADF("descriptor does not permit writing")):g(newXa.EBADF)}functionga(a,b,c,d,e){I(c,e)&&E(b,c,d,e)}functionha(a,b,c,d,e){varf=a.openFiles[c];f?wa(f.flags).contains(Na)?F(b,f,d,e):e(newXa.EBADF("descriptor does not permit writing")):e(newXa.EBADF)}functionia(a,b,c,d,e,f){functiong(a,b){a?f(a):b.size+d<0?f(newXa.EINVAL("resulting file offset would be negative")):(h.position=b.size+d,f(null,h.position))}varh=a.openFiles[c];h||f(newXa.EBADF),"SET"===e?d<0?f(newXa.EINVAL("resulting file offset would be negative")):(h.position=d,f(null,h.position)):"CUR"===e?h.position+d<0?f(newXa.EINVAL("resulting file offset would be negative")):(h.position+=d,f(null,h.position)):"END"===e?p(b,h,g):f(newXa.EINVAL("whence argument is not a proper value"))}functionja(a,b,c,d){I(c,d)&&t(b,c,d)}functionka(a,b,c,d,e,f){if(I(c,f)){varg=Date.now();d=d||g,e=e||g,y(b,c,d,e,f)}}functionla(a,b,c,d,e,f){varg=Date.now();d=d||g,e=e||g;varh=a.openFiles[c];h?wa(h.flags).contains(Na)?z(b,h,d,e,f):f(newXa.EBADF("descriptor does not permit writing")):f(newXa.EBADF)}functionma(a,b,c,d,e){I(c,e)&&(d=Z(d,"mode"))&&$(b,c,d,e)}functionna(a,b,c,d,e){if(d=Z(d,"mode")){varf=a.openFiles[c];f?wa(f.flags).contains(Na)?_(b,f,d,e):e(newXa.EBADF("descriptor does not permit writing")):e(newXa.EBADF)}}functionoa(a,b,c,d,e,f){if(I(c,f))returnY(d)?Y(e)?voidaa(b,c,d,e,f):f(newXa.EINVAL("gid must be a valid integer",e)):f(newXa.EINVAL("uid must be a valid integer",d))}functionpa(a,b,c,d,e,f){if(!Y(d))returnf(newXa.EINVAL("uid must be a valid integer",d));if(!Y(e))returnf(newXa.EINVAL("gid must be a valid integer",e));varg=a.openFiles[c];g?wa(g.flags).contains(Na)?ba(b,g,d,e,f):f(newXa.EBADF("descriptor does not permit writing")):f(newXa.EBADF)}functionqa(a,b,c,e,g){functionh(a,c){a?g(a):(y=c,d(b,e,y,{ctime:D},g))}functioni(a){a?g(a):b.getObject(x[C].id,h)}functionk(a){a?g(a):(u.id===w.id&&(v=x),deletev[B],b.putObject(u.data,v,i))}functionl(a){a?g(a):(x[C]=v[B],b.putObject(w.data,x,k))}functionm(a,c){a?g(a):(x=c,wa(x).has(C)?j(b,e,l):l())}functionn(a,c){a?g(a):(w=c,b.getObject(w.data,m))}functiono(a,c){a?g(a):(v=c,f(b,A,n))}functionp(a,c){a?g(a):(u=c,b.getObject(c.data,o))}functionq(a){a?g(a):s(b,c,g)}functiont(a,d){a?g(a):d.type===Fa?f(b,z,p):r(b,c,e,q)}if(I(c,g)&&I(e,g)){c=ya(c),e=ya(e);varu,v,w,x,y,z=xa.dirname(c),A=xa.dirname(c),B=xa.basename(c),C=xa.basename(e),D=Date.now();f(b,c,t)}}functionra(a,b,c,d,e,f){f=arguments[arguments.length-1],I(c,!0,f)&&I(d,f)&&u(b,c,d,f)}functionsa(a,b,c,d){I(c,d)&&v(b,c,d)}functionta(a,b,c,d){functione(b,e){if(b)d(b);else{varf=newab(c,e,a.name);d(null,f)}}I(c,d)&&q(b,c,e)}functionua(a,b,c,d,e){e=arguments[arguments.length-1],d=d||0,I(c,e)&&w(b,c,d,e)}functionva(a,b,c,d,e){e=arguments[arguments.length-1],d=d||0;varf=a.openFiles[c];f?wa(f.flags).contains(Na)?x(b,f,d,e):e(newXa.EBADF("descriptor does not permit writing")):e(newXa.EBADF)}varwa=a("../../lib/nodash.js"),xa=a("../path.js"),ya=xa.normalize,za=xa.dirname,Aa=xa.basename,Ba=xa.isAbsolute,Ca=xa.isNull,Da=a("../constants.js"),Ea=Da.NODE_TYPE_FILE,Fa=Da.NODE_TYPE_DIRECTORY,Ga=Da.NODE_TYPE_SYMBOLIC_LINK,Ha=Da.NODE_TYPE_META,Ia=(Da.DEFAULT_FILE_PERMISSIONS,Da.DEFAULT_DIR_PERMISSIONS,Da.FULL_READ_WRITE_EXEC_PERMISSIONS),Ja=Da.ROOT_DIRECTORY_NAME,Ka=Da.SUPER_NODE_ID,La=Da.SYMLOOP_MAX,Ma=Da.O_READ,Na=Da.O_WRITE,Oa=Da.O_CREATE,Pa=Da.O_EXCLUSIVE,Qa=(Da.O_TRUNCATE,Da.O_APPEND),Ra=Da.O_FLAGS,Sa=Da.XATTR_CREATE,Ta=Da.XATTR_REPLACE,Ua=Da.FS_NOMTIME,Va=Da.FS_NOCTIME,Wa=a("../encoding.js"),Xa=a("../errors.js"),Ya=a("../directory-entry.js"),Za=a("../open-file-description.js"),$a=a("../super-node.js"),_a=a("../node.js"),ab=a("../stats.js"),bb=a("../buffer.js"),cb=/^[0-7]+$/;b.exports={ensureRootDi
ta.O_APPEND),Ga=ta.O_FLAGS,Ha=ta.XATTR_CREATE,Ia=ta.XATTR_REPLACE,Ja=ta.FS_NOMTIME,Ka=ta.FS_NOCTIME,La=a("../encoding.js"),Ma=a("../errors.js"),Na=a("../directory-entry.js"),Oa=a("../open-file-description.js"),Pa=a("../super-node.js"),Qa=a("../node.js"),Ra=a("../stats.js"),Sa=a("../buffer.js");b.exports={ensureRootDirectory:h,open:J,close:K,mknod:L,mkdir:M,rmdir:N,unlink:R,stat:O,fstat:P,link:Q,read:S,readFile:T,write:U,writeFile:V,appendFile:W,exists:X,getxattr:Y,fgetxattr:Z,setxattr:$,fsetxattr:_,removexattr:aa,fremovexattr:ba,lseek:ca,readdir:da,utimes:ea,futimes:fa,rename:ga,symlink:ha,readlink:ia,lstat:ja,truncate:ka,ftruncate:la}},{"../../lib/nodash.js":4,"../buffer.js":14,"../constants.js":15,"../directory-entry.js":16,"../encoding.js":17,"../errors.js":18,"../node.js":23,"../open-file-description.js":24,"../path.js":25,"../stats.js":33,"../super-node.js":34}],20:[function(a,b,c){functiond(a){return"function"==typeofa?a:function(a){if(a)throwa}}functione(a){a&&console.error("Filer error: ",a)}functionf(a,b){functionc(){I.forEach(function(a){a.call(this)}.bind(F)),I=null}functiond(a){returnfunction(b){functionc(b){vard=B();a.getObject(d,function(a,e){returna?voidb(a):void(e?c(b):b(null,d))})}returng(j).contains(p)?voidb(null,B()):voidc(b)}}functionf(a){if(a.length){varb=s.getInstance();a.forEach(function(a){b.emit(a.event,a.path)})}}a=a||{},b=b||e;varj=a.flags,B=a.guid?a.guid:v,C=a.provider||newq.Default(a.name||k),D=a.name||C.name,E=g(j).contains(l),F=this;F.readyState=n,F.name=D,F.error=null,F.stdin=w,F.stdout=x,F.stderr=y,this.Shell=r.bind(void0,this);varG={},H=z;Object.defineProperty(this,"openFiles",{get:function(){returnG}}),this.allocDescriptor=function(a){varb=H++;returnG[b]=a,b},this.releaseDescriptor=function(a){deleteG[a]};varI=[];this.queueOrRun=function(a){varb;returnm==F.readyState?a.call(F):o==F.readyState?b=newu.EFILESYSTEMERROR("unknown error"):I.push(a),b},this.watch=function(a,b,c){if(h(a))thrownewError("Path must be a string without null bytes.");"function"==typeofb&&(c=b,b={}),b=b||{},c=c||i;vard=newt;returnd.start(a,!1,b.recursive),d.on("change",c),d},C.open(function(a){functione(a){functione(a){varb=C[a]();returnb.flags=j,b.changes=[],b.guid=d(b),b.close=function(){vara=b.changes;f(a),a.length=0},b}F.provider={openReadWriteContext:function(){returne("getReadWriteContext")},openReadOnlyContext:function(){returne("getReadOnlyContext")}},a?F.readyState=o:F.readyState=m,c(),b(a,F)}if(a)returne(a);varg=C.getReadWriteContext();g.guid=d(g),E?g.clear(function(a){returna?e(a):voidA.ensureRootDirectory(g,e)}):A.ensureRootDirectory(g,e)})}varg=a("../../lib/nodash.js"),h=a("../path.js").isNull,i=a("../shared.js").nop,j=a("../constants.js"),k=j.FILE_SYSTEM_NAME,l=j.FS_FORMAT,m=j.FS_READY,n=j.FS_PENDING,o=j.FS_ERROR,p=j.FS_NODUPEIDCHECK,q=a("../providers/index.js"),r=a("../shell/shell.js"),s=a("../../lib/intercom.js"),t=a("../fs-watcher.js"),u=a("../errors.js"),v=a("../shared.js").guid,w=j.STDIN,x=j.STDOUT,y=j.STDERR,z=j.FIRST_DESCRIPTOR,A=a("./implementation.js");f.providers=q,["open","close","mknod","mkdir","rmdir","stat","fstat","link","unlink","read","readFile","write","writeFile","appendFile","exists","lseek","readdir","rename","readlink","symlink","lstat","truncate","ftruncate","utimes","futimes","setxattr","getxattr","fsetxattr","fgetxattr","removexattr","fremovexattr"].forEach(function(a){f.prototype[a]=function(){varb=this,c=Array.prototype.slice.call(arguments,0),e=c.length-1,f="function"!=typeofc[e],g=d(c[e]),h=b.queueOrRun(function(){functiond(){h.close(),g.apply(b,arguments)}varh=b.provider.openReadWriteContext();if(o===b.readyState){vari=newu.EFILESYSTEMERROR("filesystem unavailable, operation canceled");returng.call(b,i)}f?c.push(d):c[e]=d;varj=[b,h].concat(c);A[a].apply(null,j)});h&&g(h)}}),b.exports=f},{"../../lib/intercom.js":3,"../../lib/nodash.js":4,"../constants.js":15,"../errors.js":18,"../fs-watcher.js":21,"../path.js":25,"../providers/index.js":26,"../shared.js":30,"../shell/shell.js":32,"./implementation.js":19}],21:[function(
vart={};["9:EBADF:bad file descriptor","10:EBUSY:resource busy or locked","18:EINVAL:invalid argument","27:ENOTDIR:not a directory","28:EISDIR:illegal operation on a directory","34:ENOENT:no such file or directory","47:EEXIST:file already exists","50:EPERM:operation not permitted","51:ELOOP:too many symbolic links encountered","53:ENOTEMPTY:directory not empty","55:EIO:i/o error","1000:ENOTMOUNTED:not mounted","1001:EFILESYSTEMERROR:missing super node, use 'FORMAT' flag to format filesystem.","1002:ENOATTR:attribute does not exist"].forEach(function(e){varo=+(e=e.split(":"))[0],r=e[1],i=e[2];functions(t,e){Error.call(this),this.name=r,this.code=r,this.errno=o,this.message=t||i,e&&(this.path=e),this.stack=newError(this.message).stack}s.prototype=Object.create(Error.prototype),s.prototype.constructor=s,s.prototype.toString=function(){vart=this.path?", '"+this.path+"'":"";returnthis.name+": "+this.message+t},t[r]=t[o]=s}),module.exports=t;
"use strict";exports.byteLength=u,exports.toByteArray=i,exports.fromByteArray=d;for(varr=[],t=[],e="undefined"!=typeofUint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=n.length;o<a;++o)r[o]=n[o],t[n.charCodeAt(o)]=o;functionh(r){vart=r.length;if(t%4>0)thrownewError("Invalid string. Length must be a multiple of 4");vare=r.indexOf("=");return-1===e&&(e=t),[e,e===t?0:4-e%4]}functionu(r){vart=h(r),e=t[0],n=t[1];return3*(e+n)/4-n}functionc(r,t,e){return3*(t+e)/4-e}functioni(r){for(varn,o=h(r),a=o[0],u=o[1],i=newe(c(r,a,u)),f=0,A=u>0?a-4:a,d=0;d<A;d+=4)n=t[r.charCodeAt(d)]<<18|t[r.charCodeAt(d+1)]<<12|t[r.charCodeAt(d+2)]<<6|t[r.charCodeAt(d+3)],i[f++]=n>>16&255,i[f++]=n>>8&255,i[f++]=255&n;return2===u&&(n=t[r.charCodeAt(d)]<<2|t[r.charCodeAt(d+1)]>>4,i[f++]=255&n),1===u&&(n=t[r.charCodeAt(d)]<<10|t[r.charCodeAt(d+1)]<<4|t[r.charCodeAt(d+2)]>>2,i[f++]=n>>8&255,i[f++]=255&n),i}functionf(t){returnr[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}functionA(r,t,e){for(varn,o=[],a=t;a<e;a+=3)n=(r[a]<<16&16711680)+(r[a+1]<<8&65280)+(255&r[a+2]),o.push(f(n));returno.join("")}functiond(t){for(vare,n=t.length,o=n%3,a=[],h=0,u=n-o;h<u;h+=16383)a.push(A(t,h,h+16383>u?u:h+16383));return1===o?(e=t[n-1],a.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],a.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),a.join("")}t["-".charCodeAt(0)]=62,t["_".charCodeAt(0)]=63;
vart=arguments[3],r=require("base64-js"),e=require("ieee754"),n=require("isarray");functioni(){try{vart=newUint8Array(1);returnt.__proto__={__proto__:Uint8Array.prototype,foo:function(){return42}},42===t.foo()&&"function"==typeoft.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}functiono(){returnf.TYPED_ARRAY_SUPPORT?2147483647:1073741823}functionu(t,r){if(o()<r)thrownewRangeError("Invalid typed array length");returnf.TYPED_ARRAY_SUPPORT?(t=newUint8Array(r)).__proto__=f.prototype:(null===t&&(t=newf(r)),t.length=r),t}functionf(t,r,e){if(!(f.TYPED_ARRAY_SUPPORT||thisinstanceoff))returnnewf(t,r,e);if("number"==typeoft){if("string"==typeofr)thrownewError("If encoding is specified then the first argument must be a string");returnc(this,t)}returns(this,t,r,e)}functions(t,r,e,n){if("number"==typeofr)thrownewTypeError('"value" argument must not be a number');return"undefined"!=typeofArrayBuffer&&rinstanceofArrayBuffer?g(t,r,e,n):"string"==typeofr?l(t,r,e):y(t,r)}functionh(t){if("number"!=typeoft)thrownewTypeError('"size" argument must be a number');if(t<0)thrownewRangeError('"size" argument must not be negative')}functiona(t,r,e,n){returnh(r),r<=0?u(t,r):void0!==e?"string"==typeofn?u(t,r).fill(e,n):u(t,r).fill(e):u(t,r)}functionc(t,r){if(h(r),t=u(t,r<0?0:0|w(r)),!f.TYPED_ARRAY_SUPPORT)for(vare=0;e<r;++e)t[e]=0;returnt}functionl(t,r,e){if("string"==typeofe&&""!==e||(e="utf8"),!f.isEncoding(e))thrownewTypeError('"encoding" must be a valid string encoding');varn=0|v(r,e),i=(t=u(t,n)).write(r,e);returni!==n&&(t=t.slice(0,i)),t}functionp(t,r){vare=r.length<0?0:0|w(r.length);t=u(t,e);for(varn=0;n<e;n+=1)t[n]=255&r[n];returnt}functiong(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)thrownewRangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))thrownewRangeError("'length' is out of bounds");returnr=void0===e&&void0===n?newUint8Array(r):void0===n?newUint8Array(r,e):newUint8Array(r,e,n),f.TYPED_ARRAY_SUPPORT?(t=r).__proto__=f.prototype:t=p(t,r),t}functiony(t,r){if(f.isBuffer(r)){vare=0|w(r.length);return0===(t=u(t,e)).length?t:(r.copy(t,0,0,e),t)}if(r){if("undefined"!=typeofArrayBuffer&&r.bufferinstanceofArrayBuffer||"length"inr)return"number"!=typeofr.length||W(r.length)?u(t,0):p(t,r);if("Buffer"===r.type&&n(r.data))returnp(t,r.data)}thrownewTypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}functionw(t){if(t>=o())thrownewRangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return0|t}functiond(t){return+t!=t&&(t=0),f.alloc(+t)}functionv(t,r){if(f.isBuffer(t))returnt.length;if("undefined"!=typeofArrayBuffer&&"function"==typeofArrayBuffer.isView&&(ArrayBuffer.isView(t)||tinstanceofArrayBuffer))returnt.byteLength;"string"!=typeoft&&(t=""+t);vare=t.length;if(0===e)return0;for(varn=!1;;)switch(r){case"ascii":case"latin1":case"binary":returne;case"utf8":case"utf-8":casevoid0:return$(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return2*e;case"hex":returne>>>1;case"base64":returnK(t).length;default:if(n)return$(t).length;r=(""+r).toLowerCase(),n=!0}}functionE(t,r,e){varn=!1;if((void0===r||r<0)&&(r=0),r>this.length)return"";if((void0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":returnx(this,r,e);case"utf8":case"utf-8":returnY(this,r,e);case"ascii":returnL(this,r,e);case"latin1":case"binary":returnD(this,r,e);case"base64":returnS(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":returnC(this,r,e);default:if(n)thrownewTypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}functionb(t,r,e){varn=t[r];t[r]=t[e],t[e]=n}functionR(t,r,e,n,i){if(0===t.length)return-1;if("string"==typeofe?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}elseif(e<0){if(!i)return-1;e=0}if("string"==typeofr&&(r=f.from(r,n)),f.
vart=arguments[3],n=require("../constants.js").FILE_SYSTEM_NAME,e=require("../constants.js").FILE_STORE_NAME,i=require("../constants.js").WSQL_VERSION,o=require("../constants.js").WSQL_SIZE,r=require("../constants.js").WSQL_DESC,u=require("../errors.js"),a=require("../buffer.js"),c=require("base64-arraybuffer");functions(t,n){vare=this;this.getTransaction=function(i){e.transaction?i(e.transaction):t[n?"readTransaction":"transaction"](function(t){e.transaction=t,i(t)})}}functionf(t,n,i){functiono(t,n){vare=0===n.rows.length?null:n.rows.item(0).data;i(null,e)}functionr(t,n){i(n)}t(function(t){t.executeSql("SELECT data FROM "+e+" WHERE id = ? LIMIT 1;",[n],o,r)})}functionE(t,n,i,o){functionr(t,n){o(null)}functionu(t,n){o(n)}t(function(t){t.executeSql("INSERT OR REPLACE INTO "+e+" (id, data) VALUES (?, ?);",[n,i],r,u)})}functiond(t){this.name=t||n,this.db=null}s.prototype.clear=function(t){functionn(n,e){t(e)}functioni(n,e){t(null)}this.getTransaction(function(t){t.executeSql("DELETE FROM "+e+";",[],i,n)})},s.prototype.getObject=function(t,n){f(this.getTransaction,t,function(t,e){if(t)returnn(t);try{e&&(e=JSON.parse(e))}catch(t){returnn(t)}n(null,e)})},s.prototype.getBuffer=function(t,n){f(this.getTransaction,t,function(t,e){if(t)returnn(t);if(e||""===e){vari=c.decode(e);e=newa(i)}n(null,e)})},s.prototype.putObject=function(t,n,e){vari=JSON.stringify(n);E(this.getTransaction,t,i,e)},s.prototype.putBuffer=function(t,n,e){vari=c.encode(n.buffer);E(this.getTransaction,t,i,e)},s.prototype.delete=function(t,n){functioni(t,e){n(null)}functiono(t,e){n(e)}this.getTransaction(function(n){n.executeSql("DELETE FROM "+e+" WHERE id = ?;",[t],i,o)})},d.isSupported=function(){return!!t.openDatabase},d.prototype.open=function(n){vara=this;if(a.db)returnn();varc=t.openDatabase(a.name,i,r,o);functions(t,e){5===e.code&&n(newu.EINVAL("WebSQL cannot be accessed. If private browsing is enabled, disable it.")),n(e)}functionf(t,e){a.db=c,n()}c?c.transaction(function(t){t.executeSql("CREATE TABLE IF NOT EXISTS "+e+" (id unique, data TEXT);",[],function(t){t.executeSql("CREATE INDEX IF NOT EXISTS idx_"+e+"_id on "+e+" (id);",[],f,s)},s)}):n("[WebSQL] Unable to open database.")},d.prototype.getReadOnlyContext=function(){returnnews(this.db,!0)},d.prototype.getReadWriteContext=function(){returnnews(this.db,!1)},module.exports=d;
vart,e,n=module.exports={};functionr(){thrownewError("setTimeout has not been defined")}functiono(){thrownewError("clearTimeout has not been defined")}functioni(e){if(t===setTimeout)returnsetTimeout(e,0);if((t===r||!t)&&setTimeout)returnt=setTimeout,setTimeout(e,0);try{returnt(e,0)}catch(n){try{returnt.call(null,e,0)}catch(n){returnt.call(this,e,0)}}}functionu(t){if(e===clearTimeout)returnclearTimeout(t);if((e===o||!e)&&clearTimeout)returne=clearTimeout,clearTimeout(t);try{returne(t)}catch(n){try{returne.call(null,t)}catch(n){returne.call(this,t)}}}!function(){try{t="function"==typeofsetTimeout?setTimeout:r}catch(e){t=r}try{e="function"==typeofclearTimeout?clearTimeout:o}catch(t){e=o}}();varc,s=[],l=!1,a=-1;functionf(){l&&c&&(l=!1,c.length?s=c.concat(s):a=-1,s.length&&h())}functionh(){if(!l){vart=i(f);l=!0;for(vare=s.length;e;){for(c=s,s=[];++a<e;)c&&c[a].run();a=-1,e=s.length}c=null,l=!1,u(t)}}functionm(t,e){this.fun=t,this.array=e}functionp(){}n.nextTick=function(t){vare=newArray(arguments.length-1);if(arguments.length>1)for(varn=1;n<arguments.length;n++)e[n-1]=arguments[n];s.push(newm(t,e)),1!==s.length||l||i(h)},m.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(t){return[]},n.binding=function(t){thrownewError("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){thrownewError("process.chdir is not supported")},n.umask=function(){return0};
vart=require("../constants.js").FILE_SYSTEM_NAME,e=require("../../lib/async.js").setImmediate,o=function(){vart={};returnfunction(e){returnt.hasOwnProperty(e)||(t[e]={}),t[e]}}();functionn(t,e){this.readOnly=e,this.objectStore=t}functionr(e){this.name=e||t}n.prototype.clear=function(t){if(this.readOnly)e(function(){t("[MemoryContext] Error: write operation on read only context")});else{varo=this.objectStore;Object.keys(o).forEach(function(t){deleteo[t]}),e(t)}},n.prototype.getObject=n.prototype.getBuffer=function(t,o){varn=this;e(function(){o(null,n.objectStore[t])})},n.prototype.putObject=n.prototype.putBuffer=function(t,o,n){this.readOnly?e(function(){n("[MemoryContext] Error: write operation on read only context")}):(this.objectStore[t]=o,e(n))},n.prototype.delete=function(t,o){this.readOnly?e(function(){o("[MemoryContext] Error: write operation on read only context")}):(deletethis.objectStore[t],e(o))},r.isSupported=function(){return!0},r.prototype.open=function(t){this.db=o(this.name),e(t)},r.prototype.getReadOnlyContext=function(){returnnewn(this.db,!0)},r.prototype.getReadWriteContext=function(){returnnewn(this.db,!1)},module.exports=r;
varr=require("./indexeddb.js"),e=require("./websql.js"),o=require("./memory.js");module.exports={IndexedDB:r,WebSQL:e,Memory:o,Default:r,Fallback:function(){if(r.isSupported())returnr;if(e.isSupported())returne;functiono(){throw"[Filer Error] Your browser doesn't support IndexedDB or WebSQL."}returno.isSupported=function(){return!1},o}()};
varr=require("process");functiont(r,t){for(vare=0,n=r.length-1;n>=0;n--){vars=r[n];"."===s?r.splice(n,1):".."===s?(r.splice(n,1),e++):e&&(r.splice(n,1),e--)}if(t)for(;e--;e)r.unshift("..");returnr}vare=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,n=function(r){returne.exec(r).slice(1)};functions(r,t){if(r.filter)returnr.filter(t);for(vare=[],n=0;n<r.length;n++)t(r[n],n,r)&&e.push(r[n]);returne}exports.resolve=function(){for(vare="",n=!1,o=arguments.length-1;o>=-1&&!n;o--){vari=o>=0?arguments[o]:r.cwd();if("string"!=typeofi)thrownewTypeError("Arguments to path.resolve must be strings");i&&(e=i+"/"+e,n="/"===i.charAt(0))}return(n?"/":"")+(e=t(s(e.split("/"),function(r){return!!r}),!n).join("/"))||"."},exports.normalize=function(r){vare=exports.isAbsolute(r),n="/"===o(r,-1);return(r=t(s(r.split("/"),function(r){return!!r}),!e).join("/"))||e||(r="."),r&&n&&(r+="/"),(e?"/":"")+r},exports.isAbsolute=function(r){return"/"===r.charAt(0)},exports.join=function(){varr=Array.prototype.slice.call(arguments,0);returnexports.normalize(s(r,function(r,t){if("string"!=typeofr)thrownewTypeError("Arguments to path.join must be strings");returnr}).join("/"))},exports.relative=function(r,t){functione(r){for(vart=0;t<r.length&&""===r[t];t++);for(vare=r.length-1;e>=0&&""===r[e];e--);returnt>e?[]:r.slice(t,e-t+1)}r=exports.resolve(r).substr(1),t=exports.resolve(t).substr(1);for(varn=e(r.split("/")),s=e(t.split("/")),o=Math.min(n.length,s.length),i=o,u=0;u<o;u++)if(n[u]!==s[u]){i=u;break}varl=[];for(u=i;u<n.length;u++)l.push("..");return(l=l.concat(s.slice(i))).join("/")},exports.sep="/",exports.delimiter=":",exports.dirname=function(r){vart=n(r),e=t[0],s=t[1];returne||s?(s&&(s=s.substr(0,s.length-1)),e+s):"."},exports.basename=function(r,t){vare=n(r)[2];returnt&&e.substr(-1*t.length)===t&&(e=e.substr(0,e.length-t.length)),e},exports.extname=function(r){returnn(r)[3]};varo="b"==="ab".substr(-1)?function(r,t,e){returnr.substr(t,e)}:function(r,t,e){returnt<0&&(t=r.length+t),r.substr(t,e)};
vare=require("../lib/eventemitter.js"),t=require("./path.js"),n=require("../lib/intercom.js");functionr(){e.call(this);varr,i,o=this,s=!1;functionc(e){(i===e||s&&0===e.indexOf(r))&&o.trigger("change","change",e)}o.start=function(e,o,a){if(!i){if(t.isNull(e))thrownewError("Path must be a string without null bytes.");i=t.normalize(e),(s=!0===a)&&(r="/"===i?"/":i+"/"),n.getInstance().on("change",c)}},o.close=function(){n.getInstance().off("change",c),o.removeAllListeners("change")}}r.prototype=newe,r.prototype.constructor=r,module.exports=r;
varn="function"==typeofSymbol&&"symbol"==typeofSymbol.iterator?function(n){returntypeofn}:function(n){returnn&&"function"==typeofSymbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeofn},t=require("../../lib/nodash.js"),e=require("../path.js"),i=e.normalize,o=e.dirname,a=e.basename,u=e.isAbsolute,c=e.isNull,r=require("../constants.js"),f=r.MODE_FILE,s=r.MODE_DIRECTORY,l=r.MODE_SYMBOLIC_LINK,d=r.MODE_META,m=r.ROOT_DIRECTORY_NAME,p=r.SUPER_NODE_ID,E=r.SYMLOOP_MAX,w=r.O_READ,g=r.O_WRITE,O=r.O_CREATE,b=r.O_EXCLUSIVE,v=r.O_TRUNCATE,N=r.O_APPEND,A=r.O_FLAGS,h=r.XATTR_CREATE,I=r.XATTR_REPLACE,j=r.FS_NOMTIME,y=r.FS_NOCTIME,T=require("../encoding.js"),D=require("../errors.js"),L=require("../directory-entry.js"),R=require("../open-file-description.js"),x=require("../super-node.js"),V=require("../node.js"),F=require("../stats.js"),B=require("../buffer.js");function_(n){returnfunction(t,e){t?n(t):n(null,e)}}functionS(n,e,i,o,a){varu=n.flags;t(u).contains(y)&&deleteo.ctime,t(u).contains(j)&&deleteo.mtime;varc=!1;functionr(t){n.changes.push({event:"change",path:e}),a(t)}o.ctime&&(i.ctime=o.ctime,i.atime=o.ctime,c=!0),o.atime&&(i.atime=o.atime,c=!0),o.mtime&&(i.mtime=o.mtime,c=!0),c?n.putObject(i.id,i,r):r()}functionP(n,t,e,u){if(e!==s&&e!==f)returnu(newD.EINVAL("mode must be a directory or file",t));t=i(t);varc,r,l,d=a(t),m=o(t);functionp(e,i){!e&&i?u(newD.EEXIST("path name already exists",t)):!e||einstanceofD.ENOENT?n.getObject(c.data,E):u(e)}functionE(t,i){t?u(t):(r=i,V.create({guid:n.guid,mode:e},function(t,e){t?u(t):((l=e).nlinks+=1,n.putObject(l.id,l,g))}))}functionw(t){if(t)u(t);else{vare=Date.now();S(n,m,l,{mtime:e,ctime:e},u)}}functiong(t){t?u(t):(r[d]=newL(l.id,e),n.putObject(c.data,r,w))}k(n,m,function(e,i){e?u(e):i.mode!==s?u(newD.ENOTDIR("a component of the path prefix is not a directory",t)):(c=i,k(n,t,p))})}functionk(n,e,u){if(!(e=i(e)))returnu(newD.ENOENT("path is an empty string"));varc=a(e),r=o(e),f=0;functionw(t,e){t?u(t):e&&e.mode===d&&e.rnode?n.getObject(e.rnode,g):u(newD.EFILESYSTEMERROR)}functiong(n,t){n?u(n):t?u(null,t):u(newD.ENOENT)}functionO(t,i){t?u(t):i.mode===s&&i.data?n.getObject(i.data,b):u(newD.ENOTDIR("a component of the path prefix is not a directory",e))}functionb(i,o){if(i)u(i);elseif(t(o).has(c)){vara=o[c].id;n.getObject(a,v)}elseu(newD.ENOENT(null,e))}functionv(t,s){vard;t?u(t):s.mode==l?++f>E?u(newD.ELOOP(null,e)):(d=s.data,d=i(d),r=o(d),c=a(d),m==c?n.getObject(p,w):k(n,r,O)):u(null,s)}m==c?n.getObject(p,w):k(n,r,O)}functionC(t,e,i,o,a,u){varc;functionr(n,r){r&&r.xattrs[i];n?u(n):a===h&&r.xattrs.hasOwnProperty(i)?u(newD.EEXIST("attribute already exists",e)):a!==I||r.xattrs.hasOwnProperty(i)?(r.xattrs[i]=o,t.putObject(r.id,r,function(n){n?u(n):S(t,c,r,{ctime:Date.now()},u)})):u(newD.ENOATTR(null,e))}"string"==typeofe?(c=e,k(t,e,r)):"object"==(void0===e?"undefined":n(e))&&"string"==typeofe.id?(c=e.path,t.getObject(e.id,r)):u(newD.EINVAL("path or file descriptor of wrong type",e))}functionM(n,t){vare,i,o;functiona(o){o?t(o):V.create({guid:n.guid,id:e.rnode,mode:s},function(e,o){e?t(e):((i=o).nlinks+=1,n.putObject(i.id,i,u))})}functionu(e){e?t(e):(o={},n.putObject(i.data,o,t))}n.getObject(p,function(i,o){!i&&o?t():!i||iinstanceofD.ENOENT?x.create({guid:n.guid},function(i,o){i?t(i):(e=o,n.putObject(e.id,e,a))}):t(i)})}functionX(n,t,e){t=i(t);varu,c,r,f,l=a(t),d=o(t);functionm(t,i){t?e(t):(r=i,n.getObject(r.data,p))}functionp(t,i){t?e(t):(f=i,V.create({guid:n.guid,mode:s},function(t,i){t?e(t):((u=i).nlinks+=1,n.putObject(u.id,u,E))}))}functionE(t){t?e(t):(c={},n.putObject(u.data,c,g))}functionw(t){if(t)e(t);else{vari=Date.now();S(n,d,r,{mtime:i,ctime:i},e)}}functiong(t){t?e(t):(f[l]=newL(u.id,s),n.putObject(r.data,f,w))}k(n,t,function(i,o){!i&&o?e(newD.EEXIST(null,t)):!i||iinstanceofD.ENOENT?k(n,d,m):e(i)})}functionz(n,e,u){e=i(e);varc,r,f,l=a(e),d=o(e);functionp(i,o){i?u(i):m==l?u(newD.EBUSY(null,e)):t(o).has(l)?(c=(f=o)[l].id,n.getObject(c,E)):u(newD.ENOENT(null,e))}functionE(t,i){t?u(t):i.mode!=s?u(newD.E
vare=require("../../lib/nodash.js"),t=require("../path.js").isNull,r=require("../shared.js").nop,n=require("../constants.js"),i=n.FILE_SYSTEM_NAME,o=n.FS_FORMAT,a=n.FS_READY,u=n.FS_PENDING,s=n.FS_ERROR,c=n.FS_NODUPEIDCHECK,l=require("../providers/index.js"),f=require("../shell/shell.js"),d=require("../../lib/intercom.js"),p=require("../fs-watcher.js"),h=require("../errors.js"),v=require("../shared.js").guid,R=n.STDIN,g=n.STDOUT,y=n.STDERR,E=n.FIRST_DESCRIPTOR,S=require("./implementation.js");functionm(e){return"function"==typeofe?e:function(e){if(e)throwe}}functionx(n,f){f=f||r;varm=(n=n||{}).flags,x=n.guid?n.guid:v,w=n.provider||newl.Default(n.name||i),F=n.name||w.name,j=e(m).contains(o),q=this;q.readyState=u,q.name=F,q.error=null,q.stdin=R,q.stdout=g,q.stderr=y;varD={},O=E;Object.defineProperty(this,"openFiles",{get:function(){returnD}}),this.allocDescriptor=function(e){vart=O++;returnD[t]=e,t},this.releaseDescriptor=function(e){deleteD[e]};varT=[];functionC(t){returnfunction(r){e(m).contains(c)?r(null,x()):functione(r){varn=x();t.getObject(n,function(t,i){t?r(t):i?e(r):r(null,n)})}(r)}}this.queueOrRun=function(e){vart;returna==q.readyState?e.call(q):s==q.readyState?t=newh.EFILESYSTEMERROR("unknown error"):T.push(e),t},this.watch=function(e,n,i){if(t(e))thrownewError("Path must be a string without null bytes.");"function"==typeofn&&(i=n,n={}),n=n||{},i=i||r;varo=newp;returno.start(e,!1,n.recursive),o.on("change",i),o},w.open(function(e){functiont(e){functiont(e){vart=w[e]();returnt.flags=m,t.changes=[],t.guid=C(t),t.close=function(){vare=t.changes;!function(e){if(e.length){vart=d.getInstance();e.forEach(function(e){t.emit(e.event,e.path)})}}(e),e.length=0},t}q.provider={openReadWriteContext:function(){returnt("getReadWriteContext")},openReadOnlyContext:function(){returnt("getReadOnlyContext")}},q.readyState=e?s:a,T.forEach(function(e){e.call(this)}.bind(q)),T=null,f(e,q)}if(e)returnt(e);varr=w.getReadWriteContext();r.guid=C(r),j?r.clear(function(e){if(e)returnt(e);S.ensureRootDirectory(r,t)}):S.ensureRootDirectory(r,t)})}x.providers=l,["open","close","mknod","mkdir","rmdir","stat","fstat","link","unlink","read","readFile","write","writeFile","appendFile","exists","lseek","readdir","rename","readlink","symlink","lstat","truncate","ftruncate","utimes","futimes","setxattr","getxattr","fsetxattr","fgetxattr","removexattr","fremovexattr"].forEach(function(e){x.prototype[e]=function(){vart=this,r=Array.prototype.slice.call(arguments,0),n=r.length-1,i="function"!=typeofr[n],o=m(r[n]),a=t.queueOrRun(function(){vara=t.provider.openReadWriteContext();if(s===t.readyState){varu=newh.EFILESYSTEMERROR("filesystem unavailable, operation canceled");returno.call(t,u)}functionc(){a.close(),o.apply(t,arguments)}i?r.push(c):r[n]=c;varl=[t,a].concat(r);S[e].apply(null,l)});a&&o(a)}}),x.prototype.Shell=function(e){returnnewf(this,e)},module.exports=x;
varn=require("../../lib/nodash.js"),e=require("../path.js"),t=e.normalize,i=e.dirname,o=e.basename,a=e.isAbsolute,u=e.isNull,c=require("../constants.js"),r=c.MODE_FILE,f=c.MODE_DIRECTORY,s=c.MODE_SYMBOLIC_LINK,l=c.MODE_META,d=c.ROOT_DIRECTORY_NAME,m=c.SUPER_NODE_ID,E=c.SYMLOOP_MAX,p=c.O_READ,w=c.O_WRITE,g=c.O_CREATE,O=c.O_EXCLUSIVE,b=c.O_TRUNCATE,v=c.O_APPEND,N=c.O_FLAGS,I=c.XATTR_CREATE,h=c.XATTR_REPLACE,A=c.FS_NOMTIME,T=c.FS_NOCTIME,D=require("../encoding.js"),j=require("../errors.js"),R=require("../directory-entry.js"),y=require("../open-file-description.js"),L=require("../super-node.js"),V=require("../node.js"),F=require("../stats.js"),B=require("../buffer.js");function_(e,t,i,o,a){varu=e.flags;n(u).contains(T)&&deleteo.ctime,n(u).contains(A)&&deleteo.mtime;varc=!1;functionr(n){e.changes.push({event:"change",path:t}),a(n)}o.ctime&&(i.ctime=o.ctime,i.atime=o.ctime,c=!0),o.atime&&(i.atime=o.atime,c=!0),o.mtime&&(i.mtime=o.mtime,c=!0),c?e.putObject(i.id,i,r):r()}functionx(n,e,a,u){if(a!==f&&a!==r)returnu(newj.EINVAL("mode must be a directory or file",e));e=t(e);varc,s,l,d=o(e),m=i(e);functionE(t,i){!t&&i?u(newj.EEXIST("path name already exists",e)):!t||tinstanceofj.ENOENT?n.getObject(c.data,p):u(t)}functionp(e,t){e?u(e):(s=t,V.create({guid:n.guid,mode:a},function(e,t){e?u(e):((l=t).nlinks+=1,n.putObject(l.id,l,g))}))}functionw(e){if(e)u(e);else{vart=Date.now();_(n,m,l,{mtime:t,ctime:t},u)}}functiong(e){e?u(e):(s[d]=newR(l.id,a),n.putObject(c.data,s,w))}S(n,m,function(t,i){t?u(t):i.mode!==f?u(newj.ENOTDIR("a component of the path prefix is not a directory",e)):(c=i,S(n,e,E))})}functionS(e,a,u){if(!(a=t(a)))returnu(newj.ENOENT("path is an empty string"));varc=o(a),r=i(a),p=0;functionw(n,t){n?u(n):t&&t.mode===l&&t.rnode?e.getObject(t.rnode,g):u(newj.EFILESYSTEMERROR)}functiong(n,e){n?u(n):e?u(null,e):u(newj.ENOENT)}functionO(n,t){n?u(n):t.mode===f&&t.data?e.getObject(t.data,b):u(newj.ENOTDIR("a component of the path prefix is not a directory",a))}functionb(t,i){if(t)u(t);elseif(n(i).has(c)){varo=i[c].id;e.getObject(o,v)}elseu(newj.ENOENT(null,a))}functionv(n,f){varl;n?u(n):f.mode==s?++p>E?u(newj.ELOOP(null,a)):(l=f.data,l=t(l),r=i(l),c=o(l),d==c?e.getObject(m,w):S(e,r,O)):u(null,f)}d==c?e.getObject(m,w):S(e,r,O)}functionC(n,e,t,i,o,a,u){varc=t.xattrs;a===I&&c.hasOwnProperty(i)?u(newj.EEXIST("attribute already exists",e)):a!==h||c.hasOwnProperty(i)?(c[i]=o,n.putObject(t.id,t,function(i){i?u(i):_(n,e,t,{ctime:Date.now()},u)})):u(newj.ENOATTR(null,e))}functionP(n,e){vart,i,o;functiona(o){o?e(o):V.create({guid:n.guid,id:t.rnode,mode:f},function(t,o){t?e(t):((i=o).nlinks+=1,n.putObject(i.id,i,u))})}functionu(t){t?e(t):(o={},n.putObject(i.data,o,e))}n.getObject(m,function(i,o){!i&&o?e():!i||iinstanceofj.ENOENT?L.create({guid:n.guid},function(i,o){i?e(i):(t=o,n.putObject(t.id,t,a))}):e(i)})}functionk(n,e,a){e=t(e);varu,c,r,s,l=o(e),d=i(e);functionm(e,t){e?a(e):(r=t,n.getObject(r.data,E))}functionE(e,t){e?a(e):(s=t,V.create({guid:n.guid,mode:f},function(e,t){e?a(e):((u=t).nlinks+=1,n.putObject(u.id,u,p))}))}functionp(e){e?a(e):(c={},n.putObject(u.data,c,g))}functionw(e){if(e)a(e);else{vart=Date.now();_(n,d,r,{mtime:t,ctime:t},a)}}functiong(e){e?a(e):(s[l]=newR(u.id,f),n.putObject(r.data,s,w))}S(n,e,function(t,i){!t&&i?a(newj.EEXIST(null,e)):!t||tinstanceofj.ENOENT?S(n,d,m):a(t)})}functionM(e,a,u){a=t(a);varc,r,s,l=o(a),m=i(a);functionE(t,i){t?u(t):d==l?u(newj.EBUSY(null,a)):n(i).has(l)?(c=(s=i)[l].id,e.getObject(c,p)):u(newj.ENOENT(null,a))}functionp(n,t){n?u(n):t.mode!=f?u(newj.ENOTDIR(null,a)):(c=t,e.getObject(c.data,w))}functionw(t,i){t?u(t):n(i).size()>0?u(newj.ENOTEMPTY(null,a)):(deletes[l],e.putObject(r.data,s,g))}functiong(n){if(n)u(n);else{vart=Date.now();_(e,m,r,{mtime:t,ctime:t},O)}}functionO(n){n?u(n):e.delete(c.id,b)}functionb(n){n?u(n):e.delete(c.data,u)}S(e,m,function(n,t){n?u(n):(r=t,e.getObject(r.data,E))})}functionX(e,a,u,c){a=t(a);varl,m,p,b,v,N=o(a),I=i(a),h=0;functionA(n,t){n?c(n):t.mode!==f?c(newj.ENOENT(null,a)):(l=t,e.getObject(l
vare=require("../../lib/nodash.js"),t=require("../path.js").isNull,r=require("../shared.js").nop,n=require("../constants.js"),i=n.FILE_SYSTEM_NAME,o=n.FS_FORMAT,a=n.FS_READY,u=n.FS_PENDING,s=n.FS_ERROR,c=n.FS_NODUPEIDCHECK,l=require("../providers/index.js"),f=require("../shell/shell.js"),d=require("../../lib/intercom.js"),h=require("../fs-watcher.js"),p=require("../errors.js"),v=require("../shared.js").guid,R=n.STDIN,g=n.STDOUT,E=n.STDERR,S=n.FIRST_DESCRIPTOR,y=require("./implementation.js");functionm(e){return"function"==typeofe?e:function(e){if(e)throwe}}functionx(e){e&&console.error("Filer error: ",e)}functionF(n,m){m=m||x;varF=(n=n||{}).flags,j=n.guid?n.guid:v,q=n.provider||newl.Default(n.name||i),w=n.name||q.name,D=e(F).contains(o),O=this;O.readyState=u,O.name=w,O.error=null,O.stdin=R,O.stdout=g,O.stderr=E,this.Shell=f.bind(void0,this);varT={},b=S;Object.defineProperty(this,"openFiles",{get:function(){returnT}}),this.allocDescriptor=function(e){vart=b++;returnT[t]=e,t},this.releaseDescriptor=function(e){deleteT[e]};varC=[];functionI(t){returnfunction(r){e(F).contains(c)?r(null,j()):functione(r){varn=j();t.getObject(n,function(t,i){t?r(t):i?e(r):r(null,n)})}(r)}}this.queueOrRun=function(e){vart;returna==O.readyState?e.call(O):s==O.readyState?t=newp.EFILESYSTEMERROR("unknown error"):C.push(e),t},this.watch=function(e,n,i){if(t(e))thrownewError("Path must be a string without null bytes.");"function"==typeofn&&(i=n,n={}),n=n||{},i=i||r;varo=newh;returno.start(e,!1,n.recursive),o.on("change",i),o},q.open(function(e){functiont(e){functiont(e){vart=q[e]();returnt.flags=F,t.changes=[],t.guid=I(t),t.close=function(){vare=t.changes;!function(e){if(e.length){vart=d.getInstance();e.forEach(function(e){t.emit(e.event,e.path)})}}(e),e.length=0},t}O.provider={openReadWriteContext:function(){returnt("getReadWriteContext")},openReadOnlyContext:function(){returnt("getReadOnlyContext")}},O.readyState=e?s:a,C.forEach(function(e){e.call(this)}.bind(O)),C=null,m(e,O)}if(e)returnt(e);varr=q.getReadWriteContext();r.guid=I(r),D?r.clear(function(e){if(e)returnt(e);y.ensureRootDirectory(r,t)}):y.ensureRootDirectory(r,t)})}F.providers=l,["open","close","mknod","mkdir","rmdir","stat","fstat","link","unlink","read","readFile","write","writeFile","appendFile","exists","lseek","readdir","rename","readlink","symlink","lstat","truncate","ftruncate","utimes","futimes","setxattr","getxattr","fsetxattr","fgetxattr","removexattr","fremovexattr"].forEach(function(e){F.prototype[e]=function(){vart=this,r=Array.prototype.slice.call(arguments,0),n=r.length-1,i="function"!=typeofr[n],o=m(r[n]),a=t.queueOrRun(function(){vara=t.provider.openReadWriteContext();if(s===t.readyState){varu=newp.EFILESYSTEMERROR("filesystem unavailable, operation canceled");returno.call(t,u)}functionc(){a.close(),o.apply(t,arguments)}i?r.push(c):r[n]=c;varl=[t,a].concat(r);y[e].apply(null,l)});a&&o(a)}}),module.exports=F;