!function(t){if("object"==typeofexports&&"undefined"!=typeofmodule)module.exports=t();elseif("function"==typeofdefine&&define.amd)define([],t);else{vare;"undefined"!=typeofwindow?e=window:"undefined"!=typeofglobal?e=global:"undefined"!=typeofself&&(e=self),e.Filer=t()}}(function(){vart;returnfunctione(t,n,r){functioni(a,s){if(!n[a]){if(!t[a]){varu="function"==typeofrequire&&require;if(!s&&u)returnu(a,!0);if(o)returno(a,!0);throwError("Cannot find module '"+a+"'")}varf=n[a]={exports:{}};t[a][0].call(f.exports,function(e){varn=t[a][1][e];returni(n?n:e)},f,f.exports,e,t,n,r)}returnn[a].exports}for(varo="function"==typeofrequire&&require,a=0;r.length>a;a++)i(r[a]);returni}({1:[function(e,n){(function(e){(function(){functionr(t){vare=!1;returnfunction(){if(e)throwError("Callback was already called.");e=!0,t.apply(i,arguments)}}vari,o,a={};i=this,null!=i&&(o=i.async),a.noConflict=function(){returni.async=o,a};vars=function(t,e){if(t.forEach)returnt.forEach(e);for(varn=0;t.length>n;n+=1)e(t[n],n,t)},u=function(t,e){if(t.map)returnt.map(e);varn=[];returns(t,function(t,r,i){n.push(e(t,r,i))}),n},f=function(t,e,n){returnt.reduce?t.reduce(e,n):(s(t,function(t,r,i){n=e(n,t,r,i)}),n)},c=function(t){if(Object.keys)returnObject.keys(t);vare=[];for(varnint)t.hasOwnProperty(n)&&e.push(n);returne};void0!==e&&e.nextTick?(a.nextTick=e.nextTick,a.setImmediate="undefined"!=typeofsetImmediate?function(t){setImmediate(t)}:a.nextTick):"function"==typeofsetImmediate?(a.nextTick=function(t){setImmediate(t)},a.setImmediate=a.nextTick):(a.nextTick=function(t){setTimeout(t,0)},a.setImmediate=a.nextTick),a.each=function(t,e,n){if(n=n||function(){},!t.length)returnn();vari=0;s(t,function(o){e(o,r(function(e){e?(n(e),n=function(){}):(i+=1,i>=t.length&&n(null))}))})},a.forEach=a.each,a.eachSeries=function(t,e,n){if(n=n||function(){},!t.length)returnn();varr=0,i=function(){e(t[r],function(e){e?(n(e),n=function(){}):(r+=1,r>=t.length?n(null):i())})};i()},a.forEachSeries=a.eachSeries,a.eachLimit=function(t,e,n,r){vari=l(e);i.apply(null,[t,n,r])},a.forEachLimit=a.eachLimit;varl=function(t){returnfunction(e,n,r){if(r=r||function(){},!e.length||0>=t)returnr();vari=0,o=0,a=0;(functions(){if(i>=e.length)returnr();for(;t>a&&e.length>o;)o+=1,a+=1,n(e[o-1],function(t){t?(r(t),r=function(){}):(i+=1,a-=1,i>=e.length?r():s())})})()}},d=function(t){returnfunction(){vare=Array.prototype.slice.call(arguments);returnt.apply(null,[a.each].concat(e))}},h=function(t,e){returnfunction(){varn=Array.prototype.slice.call(arguments);returne.apply(null,[l(t)].concat(n))}},p=function(t){returnfunction(){vare=Array.prototype.slice.call(arguments);returnt.apply(null,[a.eachSeries].concat(e))}},g=function(t,e,n,r){vari=[];e=u(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){n(t.value,function(n,r){i[t.index]=r,e(n)})},function(t){r(t,i)})};a.map=d(g),a.mapSeries=p(g),a.mapLimit=function(t,e,n,r){returnm(e)(t,n,r)};varm=function(t){returnh(t,g)};a.reduce=function(t,e,n,r){a.eachSeries(t,function(t,r){n(e,t,function(t,n){e=n,r(t)})},function(t){r(t,e)})},a.inject=a.reduce,a.foldl=a.reduce,a.reduceRight=function(t,e,n,r){vari=u(t,function(t){returnt}).reverse();a.reduce(i,e,n,r)},a.foldr=a.reduceRight;varv=function(t,e,n,r){vari=[];e=u(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){n(t.value,function(n){n&&i.push(t),e()})},function(){r(u(i.sort(function(t,e){returnt.index-e.index}),function(t){returnt.value}))})};a.filter=d(v),a.filterSeries=p(v),a.select=a.filter,a.selectSeries=a.filterSeries;varb=function(t,e,n,r){vari=[];e=u(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){n(t.value,function(n){n||i.push(t),e()})},function(){r(u(i.sort(function(t,e){returnt.index-e.index}),function(t){returnt.value}))})};a.reject=d(b),a.rejectSeries=p(b);vary=function(t,e,n,r){t(e,function(t,e){n(t,function(n){n?(r(t),r=function(){}):e()})},function(){r()})};a.detect=d(y),a.detectSeries=p(y),a.some=function(t,e,n){a.each(t,function(t,r){e(t,function(t){t&&(n(!0),n=function(){}),r()})},f
n?(n=Number(n),n>l&&(n=l)):n=l,r=((r||"utf8")+"").toLowerCase();vard;switch(r){case"hex":d=i(this,t,e,n);break;case"utf8":case"utf-8":d=o(this,t,e,n);break;case"ascii":d=a(this,t,e,n);break;case"binary":d=s(this,t,e,n);break;case"base64":d=u(this,t,e,n);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":d=f(this,t,e,n);break;default:throwError("Unknown encoding")}returnd},r.prototype.toString=function(t,e,n){varr=this;if(t=((t||"utf8")+"").toLowerCase(),e=Number(e)||0,n=void0===n?r.length:Number(n),n===e)return"";vari;switch(t){case"hex":i=p(r,e,n);break;case"utf8":case"utf-8":i=l(r,e,n);break;case"ascii":i=d(r,e,n);break;case"binary":i=h(r,e,n);break;case"base64":i=c(r,e,n);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":i=g(r,e,n);break;default:throwError("Unknown encoding")}returni},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},r.prototype.equals=function(t){returnY(r.isBuffer(t),"Argument must be a Buffer"),0===r.compare(this,t)},r.prototype.compare=function(t){returnY(r.isBuffer(t),"Argument must be a Buffer"),r.compare(this,t)},r.prototype.copy=function(t,e,n,i){varo=this;if(n||(n=0),i||0===i||(i=this.length),e||(e=0),i!==n&&0!==t.length&&0!==o.length){Y(i>=n,"sourceEnd < sourceStart"),Y(e>=0&&t.length>e,"targetStart out of bounds"),Y(n>=0&&o.length>n,"sourceStart out of bounds"),Y(i>=0&&o.length>=i,"sourceEnd out of bounds"),i>this.length&&(i=this.length),i-n>t.length-e&&(i=t.length-e+n);vara=i-n;if(100>a||!r._useTypedArrays)for(vars=0;a>s;s++)t[s+e]=this[s+n];elset._set(this.subarray(n,n+a),e)}},r.prototype.slice=function(t,e){varn=this.length;if(t=C(t,n,0),e=C(e,n,n),r._useTypedArrays)returnr._augment(this.subarray(t,e));for(vari=e-t,o=newr(i,void0,!0),a=0;i>a;a++)o[a]=this[a+t];returno},r.prototype.get=function(t){returnconsole.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(t)},r.prototype.set=function(t,e){returnconsole.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(t,e)},r.prototype.readUInt8=function(t,e){returne||(Y(void0!==t&&null!==t,"missing offset"),Y(this.length>t,"Trying to read beyond buffer length")),t>=this.length?void0:this[t]},r.prototype.readUInt16LE=function(t,e){returnm(this,t,!0,e)},r.prototype.readUInt16BE=function(t,e){returnm(this,t,!1,e)},r.prototype.readUInt32LE=function(t,e){returnv(this,t,!0,e)},r.prototype.readUInt32BE=function(t,e){returnv(this,t,!1,e)},r.prototype.readInt8=function(t,e){if(e||(Y(void0!==t&&null!==t,"missing offset"),Y(this.length>t,"Trying to read beyond buffer length")),!(t>=this.length)){varn=128&this[t];returnn?-1*(255-this[t]+1):this[t]}},r.prototype.readInt16LE=function(t,e){returnb(this,t,!0,e)},r.prototype.readInt16BE=function(t,e){returnb(this,t,!1,e)},r.prototype.readInt32LE=function(t,e){returny(this,t,!0,e)},r.prototype.readInt32BE=function(t,e){returny(this,t,!1,e)},r.prototype.readFloatLE=function(t,e){return_(this,t,!0,e)},r.prototype.readFloatBE=function(t,e){return_(this,t,!1,e)},r.prototype.readDoubleLE=function(t,e){returnw(this,t,!0,e)},r.prototype.readDoubleBE=function(t,e){returnw(this,t,!1,e)},r.prototype.writeUInt8=function(t,e,n){returnn||(Y(void0!==t&&null!==t,"missing value"),Y(void0!==e&&null!==e,"missing offset"),Y(this.length>e,"trying to write beyond buffer length"),P(t,255)),e>=this.length?void0:(this[e]=t,e+1)},r.prototype.writeUInt16LE=function(t,e,n){returnE(this,t,e,!0,n)},r.prototype.writeUInt16BE=function(t,e,n){returnE(this,t,e,!1,n)},r.prototype.writeUInt32LE=function(t,e,n){returnx(this,t,e,!0,n)},r.prototype.writeUInt32BE=function(t,e,n){returnx(this,t,e,!1,n)},r.prototype.writeInt8=function(t,e,n){returnn||(Y(void0!==t&&null!==t,"missing value"),Y(void0!==e&&null!==e,"missing offset"),Y(this.length>e,"Trying to write beyond buffer length"),V(t,127,-128)),e>=this.length?void0:(t>=0?this.writeUInt8(t,e,n):this.writeUInt8(255+t+1,e,n),e+1)},r.prototype.writeInt16LE=function(t,e,n){returnI(this,t,e,!0,n)},r.prototype.writeInt16BE=functi
this.reader.setIndex(t),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}},prepareReader:function(t){vare=a.getTypeOf(t);this.reader="string"!==e||f.uint8array?"nodebuffer"===e?newi(t):newo(a.transformTo("uint8array",t)):newr(t,this.loadOptions.optimizedBinaryString)},load:function(t){this.prepareReader(t),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},e.exports=n},{"./nodeBufferReader":20,"./signature":22,"./stringReader":23,"./support":24,"./uint8ArrayReader":25,"./utils":26,"./zipEntry":28}],28:[function(t,e){"use strict";functionn(t,e){this.options=t,this.loadOptions=e}varr=t("./stringReader"),i=t("./utils"),o=t("./compressedObject"),a=t("./object");n.prototype={isEncrypted:function(){return1===(1&this.bitFlag)},useUTF8:function(){return2048===(2048&this.bitFlag)},prepareCompressedContent:function(t,e,n){returnfunction(){varr=t.index;t.setIndex(e);vari=t.readData(n);returnt.setIndex(r),i}},prepareContent:function(t,e,n,r,o){returnfunction(){vart=i.transformTo(r.uncompressInputType,this.getCompressedContent()),e=r.uncompress(t);if(e.length!==o)throwError("Bug : uncompressed data size mismatch");returne}},readLocalPart:function(t){vare,n;if(t.skip(22),this.fileNameLength=t.readInt(2),n=t.readInt(2),this.fileName=t.readString(this.fileNameLength),t.skip(n),-1==this.compressedSize||-1==this.uncompressedSize)throwError("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize == -1 || uncompressedSize == -1)");if(e=i.findCompression(this.compressionMethod),null===e)throwError("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+this.fileName+")");if(this.decompressed=newo,this.decompressed.compressedSize=this.compressedSize,this.decompressed.uncompressedSize=this.uncompressedSize,this.decompressed.crc32=this.crc32,this.decompressed.compressionMethod=this.compressionMethod,this.decompressed.getCompressedContent=this.prepareCompressedContent(t,t.index,this.compressedSize,e),this.decompressed.getContent=this.prepareContent(t,t.index,this.compressedSize,e,this.uncompressedSize),this.loadOptions.checkCRC32&&(this.decompressed=i.transformTo("string",this.decompressed.getContent()),a.crc32(this.decompressed)!==this.crc32))throwError("Corrupted zip : CRC32 mismatch")},readCentralPart:function(t){if(this.versionMadeBy=t.readString(2),this.versionNeeded=t.readInt(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4),this.fileNameLength=t.readInt(2),this.extraFieldsLength=t.readInt(2),this.fileCommentLength=t.readInt(2),this.diskNumberStart=t.readInt(2),this.internalFileAttributes=t.readInt(2),this.externalFileAttributes=t.readInt(4),this.localHeaderOffset=t.readInt(4),this.isEncrypted())throwError("Encrypted zip are not supported");this.fileName=t.readString(this.fileNameLength),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readString(this.fileCommentLength),this.dir=16&this.externalFileAttributes?!0:!1},parseZIP64ExtraField:function(){if(this.extraFields[1]){vart=newr(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(t){vare,n,r,i=t.index;for(this.extraFields=this.extraFields||{};t.index<i+this.extraFieldsLength;)e=t.readInt(2),n=t.readInt(2),r=t.readString(n),this.extraFields[e]={id:e,length:n,value:r}},handleUTF8:function(){if(this.useUTF8())this.fileName=a.utf8decode(this.fileName),this.fileComment=a.utf8decode(this.fileComment);else{vart=this
caseU:if(1024&n.flags){for(;16>h;){if(0===u)breakt;u--,d+=i[a++]<<h,h+=8}n.length=d,n.head&&(n.head.extra_len=d),512&n.flags&&(Oe[0]=255&d,Oe[1]=255&d>>>8,n.check=y(n.check,Oe,2,0)),d=0,h=0}elsen.head&&(n.head.extra=null);n.mode=P;caseP:if(1024&n.flags&&(m=n.length,m>u&&(m=u),m&&(n.head&&(Ee=n.head.extra_len-n.length,n.head.extra||(n.head.extra=Array(n.head.extra_len)),v.arraySet(n.head.extra,i,a,m,Ee)),512&n.flags&&(n.check=y(n.check,i,m,a)),u-=m,a+=m,n.length-=m),n.length))breakt;n.length=0,n.mode=V;caseV:if(2048&n.flags){if(0===u)breakt;m=0;doEe=i[a+m++],n.head&&Ee&&65536>n.length&&(n.head.name+=String.fromCharCode(Ee));while(Ee&&u>m);if(512&n.flags&&(n.check=y(n.check,i,m,a)),u-=m,a+=m,Ee)breakt}elsen.head&&(n.head.name=null);n.length=0,n.mode=Z;caseZ:if(4096&n.flags){if(0===u)breakt;m=0;doEe=i[a+m++],n.head&&Ee&&65536>n.length&&(n.head.comment+=String.fromCharCode(Ee));while(Ee&&u>m);if(512&n.flags&&(n.check=y(n.check,i,m,a)),u-=m,a+=m,Ee)breakt}elsen.head&&(n.head.comment=null);n.mode=Y;caseY:if(512&n.flags){for(;16>h;){if(0===u)breakt;u--,d+=i[a++]<<h,h+=8}if(d!==(65535&n.check)){t.msg="header crc mismatch",n.mode=le;break}d=0,h=0}n.head&&(n.head.hcrc=1&n.flags>>9,n.head.done=!0),t.adler=n.check=0,n.mode=W;break;caseX:for(;32>h;){if(0===u)breakt;u--,d+=i[a++]<<h,h+=8}t.adler=n.check=r(d),d=0,h=0,n.mode=H;caseH:if(0===n.havedict)returnt.next_out=s,t.avail_out=f,t.next_in=a,t.avail_in=u,n.hold=d,n.bits=h,C;t.adler=n.check=1,n.mode=W;caseW:if(e===A||e===O)breakt;caseq:if(n.last){d>>>=7&h,h-=7&h,n.mode=ue;break}for(;3>h;){if(0===u)breakt;u--,d+=i[a++]<<h,h+=8}switch(n.last=1&d,d>>>=1,h-=1,3&d){case0:n.mode=J;break;case1:if(c(n),n.mode=ee,e===O){d>>>=2,h-=2;breakt}break;case2:n.mode=Q;break;case3:t.msg="invalid block type",n.mode=le}d>>>=2,h-=2;break;caseJ:for(d>>>=7&h,h-=7&h;32>h;){if(0===u)breakt;u--,d+=i[a++]<<h,h+=8}if((65535&d)!==(65535^d>>>16)){t.msg="invalid stored block lengths",n.mode=le;break}if(n.length=65535&d,d=0,h=0,n.mode=K,e===O)breakt;caseK:n.mode=G;caseG:if(m=n.length){if(m>u&&(m=u),m>f&&(m=f),0===m)breakt;v.arraySet(o,i,a,m,s),u-=m,a+=m,f-=m,s+=m,n.length-=m;break}n.mode=W;break;caseQ:for(;14>h;){if(0===u)breakt;u--,d+=i[a++]<<h,h+=8}if(n.nlen=(31&d)+257,d>>>=5,h-=5,n.ndist=(31&d)+1,d>>>=5,h-=5,n.ncode=(15&d)+4,d>>>=4,h-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=le;break}n.have=0,n.mode=$;case$:for(;n.have<n.ncode;){for(;3>h;){if(0===u)breakt;u--,d+=i[a++]<<h,h+=8}n.lens[Se[n.have++]]=7&d,d>>>=3,h-=3}for(;19>n.have;)n.lens[Se[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,Ie={bits:n.lenbits},xe=w(E,n.lens,0,19,n.lencode,0,n.work,Ie),n.lenbits=Ie.bits,xe){t.msg="invalid code lengths set",n.mode=le;break}n.have=0,n.mode=te;casete:for(;n.have<n.nlen+n.ndist;){for(;Ae=n.lencode[d&(1<<n.lenbits)-1],me=Ae>>>24,ve=255&Ae>>>16,be=65535&Ae,!(h>=me);){if(0===u)breakt;u--,d+=i[a++]<<h,h+=8}if(16>be)d>>>=me,h-=me,n.lens[n.have++]=be;else{if(16===be){for(ke=me+2;ke>h;){if(0===u)breakt;u--,d+=i[a++]<<h,h+=8}if(d>>>=me,h-=me,0===n.have){t.msg="invalid bit length repeat",n.mode=le;break}Ee=n.lens[n.have-1],m=3+(3&d),d>>>=2,h-=2}elseif(17===be){for(ke=me+3;ke>h;){if(0===u)breakt;u--,d+=i[a++]<<h,h+=8}d>>>=me,h-=me,Ee=0,m=3+(7&d),d>>>=3,h-=3}else{for(ke=me+7;ke>h;){if(0===u)breakt;u--,d+=i[a++]<<h,h+=8}d>>>=me,h-=me,Ee=0,m=11+(127&d),d>>>=7,h-=7}if(n.have+m>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=le;break}for(;m--;)n.lens[n.have++]=Ee}}if(n.mode===le)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=le;break}if(n.lenbits=9,Ie={bits:n.lenbits},xe=w(x,n.lens,0,n.nlen,n.lencode,0,n.work,Ie),n.lenbits=Ie.bits,xe){t.msg="invalid literal/lengths set",n.mode=le;break}if(n.distbits=6,n.distcode=n.distdyn,Ie={bits:n.distbits},xe=w(I,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,Ie),n.distbits=Ie.bits,xe){t.msg="invalid distances set",n.mode=le;break}if(n.mode=ee,e===O)breakt;caseee:n.mode=ne;casene:if(u>=6&&f>=258){t.next_out=s,t.avail_out=f,t.next_in=a,t.avail_in=u,n.hold=d,n.bits=h,_(t,g),s=t.next_out
}functionz(t,e,n,r,o){B(n,o)&&i(e,n,r,o)}functionF(t,e,r,i,o){o=arguments[arguments.length-1],B(r,o)&&u(e,r,n(o))}functionM(t,e,r,i){B(r,i)&&f(e,r,n(i))}functionU(t,e,n,r){functioni(e,n){if(e)r(e);else{vari=newZe(n,t.name);r(null,i)}}B(n,r)&&p(e,n,i)}functionP(t,e,n,r){functioni(e,n){if(e)r(e);else{vari=newZe(n,t.name);r(null,i)}}varo=t.openFiles[n];o?g(e,o,i):r(newFe.EBADF)}functionV(t,e,r,i,o){B(r,o)&&B(i,o)&&v(e,r,i,n(o))}functionZ(t,e,r,i){B(r,i)&&b(e,r,n(i))}functionY(t,e,r,i,o,a,s,u){functionf(t,e){u(t,e||0,i)}o=void0===o?0:o,a=void0===a?i.length-o:a,u=arguments[arguments.length-1];varc=t.openFiles[r];c?de(c.flags).contains(Oe)?h(e,c,i,o,a,s,n(f)):u(newFe.EBADF("descriptor does not permit reading")):u(newFe.EBADF)}functionX(t,e,n,r,i){if(i=arguments[arguments.length-1],r=N(r,null,"r"),B(n,i)){varo=j(r.flag||"r");returno?(c(e,n,o,function(a,s){functionu(){t.releaseDescriptor(c)}if(a)returni(a);varf=newUe(n,s.id,o,0),c=t.allocDescriptor(f);g(e,f,function(o,a){if(o)returnu(),i(o);vars=newZe(a,t.name);if(s.isDirectory())returnu(),i(newFe.EISDIR("illegal operation on directory",n));varc=s.size,l=newYe(c);l.fill(0),h(e,f,l,0,c,0,function(t){if(u(),t)returni(t);vare;e="utf8"===r.encoding?ze.decode(l):l,i(null,e)})})}),void0):i(newFe.EINVAL("flags is not valid",n))}}functionH(t,e,r,i,o,a,s,u){u=arguments[arguments.length-1],o=void0===o?0:o,a=void0===a?i.length-o:a;varf=t.openFiles[r];f?de(f.flags).contains(Se)?a>i.length-o?u(newFe.EIO("intput buffer is too small")):d(e,f,i,o,a,s,n(u)):u(newFe.EBADF("descriptor does not permit writing")):u(newFe.EBADF)}functionW(t,e,n,r,i,o){if(o=arguments[arguments.length-1],i=N(i,"utf8","w"),B(n,o)){vara=j(i.flag||"w");if(!a)returno(newFe.EINVAL("flags is not valid",n));r=r||"","number"==typeofr&&(r=""+r),"string"==typeofr&&"utf8"===i.encoding&&(r=ze.encode(r)),c(e,n,a,function(i,s){if(i)returno(i);varu=newUe(n,s.id,a,0),f=t.allocDescriptor(u);l(e,u,r,0,r.length,function(e){returnt.releaseDescriptor(f),e?o(e):(o(null),void0)})})}}functionq(t,e,n,r,i,o){if(o=arguments[arguments.length-1],i=N(i,"utf8","a"),B(n,o)){vara=j(i.flag||"a");if(!a)returno(newFe.EINVAL("flags is not valid",n));r=r||"","number"==typeofr&&(r=""+r),"string"==typeofr&&"utf8"===i.encoding&&(r=ze.encode(r)),c(e,n,a,function(i,s){if(i)returno(i);varu=newUe(n,s.id,a,s.size),f=t.allocDescriptor(u);d(e,u,r,0,r.length,u.position,function(e){returnt.releaseDescriptor(f),e?o(e):(o(null),void0)})})}}functionJ(t,e,n,r){functioni(t){r(t?!1:!0)}U(t,e,n,i)}functionK(t,e,r,i,o){B(r,o)&&S(e,r,i,n(o))}functionG(t,e,r,i,o){vara=t.openFiles[r];a?T(e,a,i,n(o)):o(newFe.EBADF)}functionQ(t,e,r,i,o,a,s){"function"==typeofa&&(s=a,a=null),B(r,s)&&A(e,r,i,o,a,n(s))}function$(t,e,r,i,o,a,s){"function"==typeofa&&(s=a,a=null);varu=t.openFiles[r];u?de(u.flags).contains(Se)?O(e,u,i,o,a,n(s)):s(newFe.EBADF("descriptor does not permit writing")):s(newFe.EBADF)}functionte(t,e,r,i,o){B(r,o)&&C(e,r,i,n(o))}functionee(t,e,r,i,o){vara=t.openFiles[r];a?de(a.flags).contains(Se)?R(e,a,i,n(o)):o(newFe.EBADF("descriptor does not permit writing")):o(newFe.EBADF)}functionne(t,e,n,r,i,o){functiona(t,e){t?o(t):0>e.size+r?o(newFe.EINVAL("resulting file offset would be negative")):(s.position=e.size+r,o(null,s.position))}vars=t.openFiles[n];s||o(newFe.EBADF),"SET"===i?0>r?o(newFe.EINVAL("resulting file offset would be negative")):(s.position=r,o(null,s.position)):"CUR"===i?0>s.position+r?o(newFe.EINVAL("resulting file offset would be negative")):(s.position+=r,o(null,s.position)):"END"===i?g(e,s,a):o(newFe.EINVAL("whence argument is not a proper value"))}functionre(t,e,r,i){B(r,i)&&y(e,r,n(i))}functionie(t,e,r,i,o,a){if(B(r,a)){vars=Date.now();i=i?i:s,o=o?o:s,I(e,r,i,o,n(a))}}functionoe(t,e,r,i,o,a){vars=Date.now();i=i?i:s,o=o?o:s;varu=t.openFiles[r];u?de(u.flags).contains(Se)?k(e,u,i,o,n(a)):a(newFe.EBADF("descriptor does not permit writing")):a(newFe.EBADF)}functionae(t,e,r,i,o){functiona(t){t?o(t):b(e,r,n(o))}B(r,o)&&B(i,o)&&v(e,r,i,a)}functionse(t,e,r,i,o,a){a