88 lines
89 KiB
JavaScript
88 lines
89 KiB
JavaScript
parcelRequire=function(e,r,n,t){var i="function"==typeof parcelRequire&&parcelRequire,o="function"==typeof require&&require;function u(n,t){if(!r[n]){if(!e[n]){var f="function"==typeof parcelRequire&&parcelRequire;if(!t&&f)return f(n,!0);if(i)return i(n,!0);if(o&&"string"==typeof n)return o(n);var c=new Error("Cannot find module '"+n+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[n][1][r]||r};var l=r[n]=new u.Module(n);e[n][0].call(l.exports,p,l,l.exports,this)}return r[n].exports;function p(e){return u(p.resolve(e))}}u.isParcelRequire=!0,u.Module=function(e){this.id=e,this.bundle=u,this.exports={}},u.modules=e,u.cache=r,u.parent=i,u.register=function(r,n){e[r]=[function(e,r){r.exports=n},{}]};for(var f=0;f<n.length;f++)u(n[f]);if(n.length){var c=u(n[n.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=c:"function"==typeof define&&define.amd?define(function(){return c}):t&&(this[t]=c)}return u}({"96cB":[function(require,module,exports) {
|
|
var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},t=Array.prototype,r=t.forEach,e=t.indexOf,o=t.some,u=Object.prototype,l=u.hasOwnProperty,f=Object.keys,i={};function c(n,t){return l.call(n,t)}var a=f||function(n){if(n!==Object(n))throw new TypeError("Invalid object");var t=[];for(var r in n)c(n,r)&&t.push(r);return t};function y(n){return null==n?0:n.length===+n.length?n.length:a(n).length}function p(n){return n}function s(n,t,e){var o,u;if(null!=n)if(r&&n.forEach===r)n.forEach(t,e);else if(n.length===+n.length){for(o=0,u=n.length;o<u;o++)if(t.call(e,n[o],o,n)===i)return}else{var l=l(n);for(o=0,u=l.length;o<u;o++)if(t.call(e,n[l[o]],l[o],n)===i)return}}function h(n,t,r){t||(t=p);var e=!1;return null==n?e:o&&n.some===o?n.some(t,r):(s(n,function(n,o,u){if(e||(e=t.call(r,n,o,u)))return i}),!!e)}function v(n,t){return null!=n&&(e&&n.indexOf===e?-1!=n.indexOf(t):h(n,function(n){return n===t}))}function b(n){this.value=n}function m(t){return t&&"object"==(void 0===t?"undefined":n(t))&&!Array.isArray(t)&&l.call(t,"__wrapped__")?t:new b(t)}b.prototype.has=function(n){return c(this.value,n)},b.prototype.contains=function(n){return v(this.value,n)},b.prototype.size=function(){return y(this.value)},module.exports=m;
|
|
},{}],"0c0E":[function(require,module,exports) {
|
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=Symbol?Symbol("__ES6-PROMISIFY--CUSTOM-ARGUMENTS__"):"__ES6-PROMISIFY--CUSTOM-ARGUMENTS__";function o(e){if("function"!=typeof e)throw new TypeError("Argument to promisify must be a function");var n=e[r],t=o.Promise||Promise;if("function"!=typeof t)throw new Error("No Promise implementation found; do you need a polyfill?");return function(){for(var r=this,o=arguments.length,i=Array(o),f=0;f<o;f++)i[f]=arguments[f];return new t(function(o,t){i.push(function(r){if(r)return t(r);for(var e=arguments.length,i=Array(e>1?e-1:0),f=1;f<e;f++)i[f-1]=arguments[f];if(1===i.length||!n)return o(i[0]);var u={};i.forEach(function(r,o){var e=n[o];e&&(u[e]=r)}),o(u)}),e.call.apply(e,[r].concat(i))})}}o.argumentNames=r,o.Promise=void 0,exports.promisify=o;
|
|
},{}],"UzoP":[function(require,module,exports) {
|
|
function r(r,n){for(var t=0,e=r.length-1;e>=0;e--){var i=r[e];"."===i?r.splice(e,1):".."===i?(r.splice(e,1),t++):t&&(r.splice(e,1),t--)}if(n)for(;t--;t)r.unshift("..");return r}var n=/^(\/?)([\s\S]+\/(?!$)|\/)?((?:\.{1,2}$|[\s\S]+?)?(\.[^.\/]*)?)$/,t=function(r){var t=n.exec(r);return[t[1]||"",t[2]||"",t[3]||"",t[4]||""]};function e(){for(var n="",t=!1,e=arguments.length-1;e>=-1&&!t;e--){var i=e>=0?arguments[e]:"/";"string"==typeof i&&i&&(n=i+"/"+n,t="/"===i.charAt(0))}return(t?"/":"")+(n=r(n.split("/").filter(function(r){return!!r}),!t).join("/"))||"."}function i(n){var t="/"===n.charAt(0);return(n=r(n.split("/").filter(function(r){return!!r}),!t).join("/"))||t||(n="."),(t?"/":"")+n}function u(){return i(Array.prototype.slice.call(arguments,0).filter(function(r){return r&&"string"==typeof r}).join("/"))}function o(r,n){function t(r){for(var n=0;n<r.length&&""===r[n];n++);for(var t=r.length-1;t>=0&&""===r[t];t--);return n>t?[]:r.slice(n,t-n+1)}r=e(r).substr(1),n=e(n).substr(1);for(var i=t(r.split("/")),u=t(n.split("/")),o=Math.min(i.length,u.length),l=o,f=0;f<o;f++)if(i[f]!==u[f]){l=f;break}var s=[];for(f=l;f<i.length;f++)s.push("..");return(s=s.concat(u.slice(l))).join("/")}function l(r){var n=t(r),e=n[0],i=n[1];return e||i?(i&&(i=i.substr(0,i.length-1)),e+i):"."}function f(r,n){var e=t(r)[2];return n&&e.substr(-1*n.length)===n&&(e=e.substr(0,e.length-n.length)),""===e?"/":e}function s(r){return t(r)[3]}function a(r){return"/"===r.charAt(0)}function c(r){return-1!==(""+r).indexOf("\0")}function h(r){return r.replace(/\/*$/,"/")}function p(r){return""===(r=r.replace(/\/*$/,""))?"/":r}module.exports={normalize:i,resolve:e,join:u,relative:o,sep:"/",delimiter:":",dirname:l,basename:f,extname:s,isAbsolute:a,isNull:c,addTrailing:h,removeTrailing:p};
|
|
},{}],"p8GN":[function(require,module,exports) {
|
|
var t={};["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){var o=+(e=e.split(":"))[0],r=e[1],i=e[2];function s(t,e){Error.call(this),this.name=r,this.code=r,this.errno=o,this.message=t||i,e&&(this.path=e),this.stack=new Error(this.message).stack}s.prototype=Object.create(Error.prototype),s.prototype.constructor=s,s.prototype.toString=function(){var t=this.path?", '"+this.path+"'":"";return this.name+": "+this.message+t},t[r]=t[o]=s}),module.exports=t;
|
|
},{}],"3zBM":[function(require,module,exports) {
|
|
var r=require("./errors.js");function x(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){var x=16*Math.random()|0;return("x"==r?x:3&x|8).toString(16)}).toUpperCase()}function e(){}function n(r){for(var x=[],e=r.length,n=0;n<e;n++)x[n]=r[n];return x}function t(x,e){var n=void 0;if("number"!=typeof x&&(n=new r.EINVAL(e,"number",x)),n)throw Error.captureStackTrace(n,t),n;return x}module.exports={guid:x,u8toArray:n,nop:e,validateInteger:t};
|
|
},{"./errors.js":"p8GN"}],"iJA9":[function(require,module,exports) {
|
|
var _="READ",E="WRITE",R="CREATE",I="EXCLUSIVE",O="TRUNCATE",S="APPEND",T="CREATE",N="REPLACE";module.exports={FILE_SYSTEM_NAME:"local",FILE_STORE_NAME:"files",IDB_RO:"readonly",IDB_RW:"readwrite",WSQL_VERSION:"1",WSQL_SIZE:5242880,WSQL_DESC:"FileSystem Storage",NODE_TYPE_FILE:"FILE",NODE_TYPE_DIRECTORY:"DIRECTORY",NODE_TYPE_SYMBOLIC_LINK:"SYMLINK",NODE_TYPE_META:"META",S_IFREG:32768,S_IFDIR:16384,S_IFLNK:40960,DEFAULT_DIR_PERMISSIONS:493,DEFAULT_FILE_PERMISSIONS:420,FULL_READ_WRITE_EXEC_PERMISSIONS:511,READ_WRITE_PERMISSIONS:438,SYMLOOP_MAX:10,BINARY_MIME_TYPE:"application/octet-stream",JSON_MIME_TYPE:"application/json",ROOT_DIRECTORY_NAME:"/",FS_FORMAT:"FORMAT",FS_NOCTIME:"NOCTIME",FS_NOMTIME:"NOMTIME",FS_NODUPEIDCHECK:"FS_NODUPEIDCHECK",O_READ:_,O_WRITE:E,O_CREATE:R,O_EXCLUSIVE:I,O_TRUNCATE:O,O_APPEND:S,O_FLAGS:{r:[_],"r+":[_,E],w:[E,R,O],"w+":[E,_,R,O],wx:[E,R,I,O],"wx+":[E,_,R,I,O],a:[E,R,S],"a+":[E,_,R,S],ax:[E,R,I,S],"ax+":[E,_,R,I,S]},XATTR_CREATE:T,XATTR_REPLACE:N,FS_READY:"READY",FS_PENDING:"PENDING",FS_ERROR:"ERROR",SUPER_NODE_ID:"00000000-0000-0000-0000-000000000000",STDIN:0,STDOUT:1,STDERR:2,FIRST_DESCRIPTOR:3,ENVIRONMENT:{TMP:"/tmp",PATH:""},fsConstants:{O_RDONLY:0,O_WRONLY:1,O_RDWR:2,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:512,O_EXCL:2048,O_NOCTTY:131072,O_TRUNC:1024,O_APPEND:8,O_DIRECTORY:1048576,O_NOFOLLOW:256,O_SYNC:128,O_DSYNC:4194304,O_SYMLINK:2097152,O_NONBLOCK:4,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,F_OK:0,R_OK:4,W_OK:2,X_OK:1,UV_FS_COPYFILE_EXCL:1,COPYFILE_EXCL:1}};
|
|
},{}],"yh9p":[function(require,module,exports) {
|
|
"use strict";exports.byteLength=u,exports.toByteArray=i,exports.fromByteArray=d;for(var r=[],t=[],e="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=n.length;o<a;++o)r[o]=n[o],t[n.charCodeAt(o)]=o;function h(r){var t=r.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");return-1===e&&(e=t),[e,e===t?0:4-e%4]}function u(r){var t=h(r),e=t[0],n=t[1];return 3*(e+n)/4-n}function c(r,t,e){return 3*(t+e)/4-e}function i(r){for(var n,o=h(r),a=o[0],u=o[1],i=new e(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;return 2===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}function f(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function A(r,t,e){for(var n,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));return o.join("")}function d(t){for(var e,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));return 1===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;
|
|
},{}],"JgNJ":[function(require,module,exports) {
|
|
exports.read=function(a,o,t,r,h){var M,p,w=8*h-r-1,f=(1<<w)-1,e=f>>1,i=-7,N=t?h-1:0,n=t?-1:1,s=a[o+N];for(N+=n,M=s&(1<<-i)-1,s>>=-i,i+=w;i>0;M=256*M+a[o+N],N+=n,i-=8);for(p=M&(1<<-i)-1,M>>=-i,i+=r;i>0;p=256*p+a[o+N],N+=n,i-=8);if(0===M)M=1-e;else{if(M===f)return p?NaN:1/0*(s?-1:1);p+=Math.pow(2,r),M-=e}return(s?-1:1)*p*Math.pow(2,M-r)},exports.write=function(a,o,t,r,h,M){var p,w,f,e=8*M-h-1,i=(1<<e)-1,N=i>>1,n=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,s=r?0:M-1,u=r?1:-1,l=o<0||0===o&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(w=isNaN(o)?1:0,p=i):(p=Math.floor(Math.log(o)/Math.LN2),o*(f=Math.pow(2,-p))<1&&(p--,f*=2),(o+=p+N>=1?n/f:n*Math.pow(2,1-N))*f>=2&&(p++,f/=2),p+N>=i?(w=0,p=i):p+N>=1?(w=(o*f-1)*Math.pow(2,h),p+=N):(w=o*Math.pow(2,N-1)*Math.pow(2,h),p=0));h>=8;a[t+s]=255&w,s+=u,w/=256,h-=8);for(p=p<<h|w,e+=h;e>0;a[t+s]=255&p,s+=u,p/=256,e-=8);a[t+s-u]|=128*l};
|
|
},{}],"REa7":[function(require,module,exports) {
|
|
var r={}.toString;module.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)};
|
|
},{}],"dskh":[function(require,module,exports) {
|
|
|
|
var global = arguments[3];
|
|
var t=arguments[3],r=require("base64-js"),e=require("ieee754"),n=require("isarray");function i(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,r){if(o()<r)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=f.prototype:(null===t&&(t=new f(r)),t.length=r),t}function f(t,r,e){if(!(f.TYPED_ARRAY_SUPPORT||this instanceof f))return new f(t,r,e);if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return s(this,t,r,e)}function s(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?g(t,r,e,n):"string"==typeof r?l(t,r,e):y(t,r)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function a(t,r,e,n){return h(r),r<=0?u(t,r):void 0!==e?"string"==typeof n?u(t,r).fill(e,n):u(t,r).fill(e):u(t,r)}function c(t,r){if(h(r),t=u(t,r<0?0:0|w(r)),!f.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function l(t,r,e){if("string"==typeof e&&""!==e||(e="utf8"),!f.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|v(r,e),i=(t=u(t,n)).write(r,e);return i!==n&&(t=t.slice(0,i)),t}function p(t,r){var e=r.length<0?0:0|w(r.length);t=u(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function g(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return r=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n),f.TYPED_ARRAY_SUPPORT?(t=r).__proto__=f.prototype:t=p(t,r),t}function y(t,r){if(f.isBuffer(r)){var e=0|w(r.length);return 0===(t=u(t,e)).length?t:(r.copy(t,0,0,e),t)}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||W(r.length)?u(t,0):p(t,r);if("Buffer"===r.type&&n(r.data))return p(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function w(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function d(t){return+t!=t&&(t=0),f.alloc(+t)}function v(t,r){if(f.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return $(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return K(t).length;default:if(n)return $(t).length;r=(""+r).toLowerCase(),n=!0}}function E(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return x(this,r,e);case"utf8":case"utf-8":return Y(this,r,e);case"ascii":return L(this,r,e);case"latin1":case"binary":return D(this,r,e);case"base64":return S(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function R(t,r,e,n,i){if(0===t.length)return-1;if("string"==typeof e?(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}else if(e<0){if(!i)return-1;e=0}if("string"==typeof r&&(r=f.from(r,n)),f.isBuffer(r))return 0===r.length?-1:_(t,r,e,n,i);if("number"==typeof r)return r&=255,f.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):_(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function _(t,r,e,n,i){var o,u=1,f=t.length,s=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;u=2,f/=2,s/=2,e/=2}function h(t,r){return 1===u?t[r]:t.readUInt16BE(r*u)}if(i){var a=-1;for(o=e;o<f;o++)if(h(t,o)===h(r,-1===a?0:o-a)){if(-1===a&&(a=o),o-a+1===s)return a*u}else-1!==a&&(o-=o-a),a=-1}else for(e+s>f&&(e=f-s),o=e;o>=0;o--){for(var c=!0,l=0;l<s;l++)if(h(t,o+l)!==h(r,l)){c=!1;break}if(c)return o}return-1}function A(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n))>i&&(n=i):n=i;var o=r.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var u=0;u<n;++u){var f=parseInt(r.substr(2*u,2),16);if(isNaN(f))return u;t[e+u]=f}return u}function m(t,r,e,n){return Q($(r,t.length-e),t,e,n)}function P(t,r,e,n){return Q(G(r),t,e,n)}function T(t,r,e,n){return P(t,r,e,n)}function B(t,r,e,n){return Q(K(r),t,e,n)}function U(t,r,e,n){return Q(H(r,t.length-e),t,e,n)}function S(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function Y(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o,u,f,s,h=t[i],a=null,c=h>239?4:h>223?3:h>191?2:1;if(i+c<=e)switch(c){case 1:h<128&&(a=h);break;case 2:128==(192&(o=t[i+1]))&&(s=(31&h)<<6|63&o)>127&&(a=s);break;case 3:o=t[i+1],u=t[i+2],128==(192&o)&&128==(192&u)&&(s=(15&h)<<12|(63&o)<<6|63&u)>2047&&(s<55296||s>57343)&&(a=s);break;case 4:o=t[i+1],u=t[i+2],f=t[i+3],128==(192&o)&&128==(192&u)&&128==(192&f)&&(s=(15&h)<<18|(63&o)<<12|(63&u)<<6|63&f)>65535&&s<1114112&&(a=s)}null===a?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=c}return O(n)}exports.Buffer=f,exports.SlowBuffer=d,exports.INSPECT_MAX_BYTES=50,f.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:i(),exports.kMaxLength=o(),f.poolSize=8192,f._augment=function(t){return t.__proto__=f.prototype,t},f.from=function(t,r,e){return s(null,t,r,e)},f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&f[Symbol.species]===f&&Object.defineProperty(f,Symbol.species,{value:null,configurable:!0})),f.alloc=function(t,r,e){return a(null,t,r,e)},f.allocUnsafe=function(t){return c(null,t)},f.allocUnsafeSlow=function(t){return c(null,t)},f.isBuffer=function(t){return!(null==t||!t._isBuffer)},f.compare=function(t,r){if(!f.isBuffer(t)||!f.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,i=0,o=Math.min(e,n);i<o;++i)if(t[i]!==r[i]){e=t[i],n=r[i];break}return e<n?-1:n<e?1:0},f.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(t,r){if(!n(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return f.alloc(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;++e)r+=t[e].length;var i=f.allocUnsafe(r),o=0;for(e=0;e<t.length;++e){var u=t[e];if(!f.isBuffer(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(i,o),o+=u.length}return i},f.byteLength=v,f.prototype._isBuffer=!0,f.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)b(this,r,r+1);return this},f.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)b(this,r,r+3),b(this,r+1,r+2);return this},f.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)b(this,r,r+7),b(this,r+1,r+6),b(this,r+2,r+5),b(this,r+3,r+4);return this},f.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?Y(this,0,t):E.apply(this,arguments)},f.prototype.equals=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===f.compare(this,t)},f.prototype.inspect=function(){var t="",r=exports.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},f.prototype.compare=function(t,r,e,n,i){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),r<0||e>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&r>=e)return 0;if(n>=i)return-1;if(r>=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),u=(e>>>=0)-(r>>>=0),s=Math.min(o,u),h=this.slice(n,i),a=t.slice(r,e),c=0;c<s;++c)if(h[c]!==a[c]){o=h[c],u=a[c];break}return o<u?-1:u<o?1:0},f.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},f.prototype.indexOf=function(t,r,e){return R(this,t,r,e,!0)},f.prototype.lastIndexOf=function(t,r,e){return R(this,t,r,e,!1)},f.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(e)?(e|=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var i=this.length-r;if((void 0===e||e>i)&&(e=i),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return A(this,t,r,e);case"utf8":case"utf-8":return m(this,t,r,e);case"ascii":return P(this,t,r,e);case"latin1":case"binary":return T(this,t,r,e);case"base64":return B(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,t,r,e);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function O(t){var r=t.length;if(r<=I)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=I));return e}function L(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(127&t[i]);return n}function D(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function x(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=Z(t[o]);return i}function C(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function M(t,r,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function k(t,r,e,n,i,o){if(!f.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function N(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function z(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>8*(n?i:3-i)&255}function F(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function j(t,r,n,i,o){return o||F(t,r,n,4,3.4028234663852886e38,-3.4028234663852886e38),e.write(t,r,n,i,23,4),n+4}function q(t,r,n,i,o){return o||F(t,r,n,8,1.7976931348623157e308,-1.7976931348623157e308),e.write(t,r,n,i,52,8),n+8}f.prototype.slice=function(t,r){var e,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<t&&(r=t),f.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,r)).__proto__=f.prototype;else{var i=r-t;e=new f(i,void 0);for(var o=0;o<i;++o)e[o]=this[o+t]}return e},f.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n},f.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t+--r],i=1;r>0&&(i*=256);)n+=this[t+--r]*i;return n},f.prototype.readUInt8=function(t,r){return r||M(t,1,this.length),this[t]},f.prototype.readUInt16LE=function(t,r){return r||M(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUInt16BE=function(t,r){return r||M(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUInt32LE=function(t,r){return r||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},f.prototype.readUInt32BE=function(t,r){return r||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*r)),n},f.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=r,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*r)),o},f.prototype.readInt8=function(t,r){return r||M(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},f.prototype.readInt16LE=function(t,r){r||M(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},f.prototype.readInt16BE=function(t,r){r||M(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},f.prototype.readInt32LE=function(t,r){return r||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,r){return r||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readFloatLE=function(t,r){return r||M(t,4,this.length),e.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,r){return r||M(t,4,this.length),e.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,r){return r||M(t,8,this.length),e.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,r){return r||M(t,8,this.length),e.read(this,t,!1,52,8)},f.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||k(this,t,r,e,Math.pow(2,8*e)-1,0);var i=1,o=0;for(this[r]=255&t;++o<e&&(i*=256);)this[r+o]=t/i&255;return r+e},f.prototype.writeUIntBE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||k(this,t,r,e,Math.pow(2,8*e)-1,0);var i=e-1,o=1;for(this[r+i]=255&t;--i>=0&&(o*=256);)this[r+i]=t/o&255;return r+e},f.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,1,255,0),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},f.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):N(this,t,r,!0),r+2},f.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):N(this,t,r,!1),r+2},f.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):z(this,t,r,!0),r+4},f.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):z(this,t,r,!1),r+4},f.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);k(this,t,r,e,i-1,-i)}var o=0,u=1,f=0;for(this[r]=255&t;++o<e&&(u*=256);)t<0&&0===f&&0!==this[r+o-1]&&(f=1),this[r+o]=(t/u>>0)-f&255;return r+e},f.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);k(this,t,r,e,i-1,-i)}var o=e-1,u=1,f=0;for(this[r+o]=255&t;--o>=0&&(u*=256);)t<0&&0===f&&0!==this[r+o+1]&&(f=1),this[r+o]=(t/u>>0)-f&255;return r+e},f.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,1,127,-128),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},f.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):N(this,t,r,!0),r+2},f.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):N(this,t,r,!1),r+2},f.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):z(this,t,r,!0),r+4},f.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):z(this,t,r,!1),r+4},f.prototype.writeFloatLE=function(t,r,e){return j(this,t,r,!0,e)},f.prototype.writeFloatBE=function(t,r,e){return j(this,t,r,!1,e)},f.prototype.writeDoubleLE=function(t,r,e){return q(this,t,r,!0,e)},f.prototype.writeDoubleBE=function(t,r,e){return q(this,t,r,!1,e)},f.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n<e&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var i,o=n-e;if(this===t&&e<r&&r<n)for(i=o-1;i>=0;--i)t[i+r]=this[i+e];else if(o<1e3||!f.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+r]=this[i+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+o),r);return o},f.prototype.fill=function(t,r,e,n){if("string"==typeof t){if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!f.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(e<=r)return this;var o;if(r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(o=r;o<e;++o)this[o]=t;else{var u=f.isBuffer(t)?t:$(new f(t,n).toString()),s=u.length;for(o=0;o<e-r;++o)this[o+r]=u[o%s]}return this};var V=/[^+\/0-9A-Za-z-_]/g;function X(t){if((t=J(t).replace(V,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}function J(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Z(t){return t<16?"0"+t.toString(16):t.toString(16)}function $(t,r){var e;r=r||1/0;for(var n=t.length,i=null,o=[],u=0;u<n;++u){if((e=t.charCodeAt(u))>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}if(u+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=65536+(i-55296<<10|e-56320)}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return o}function G(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}function H(t,r){for(var e,n,i,o=[],u=0;u<t.length&&!((r-=2)<0);++u)n=(e=t.charCodeAt(u))>>8,i=e%256,o.push(i),o.push(n);return o}function K(t){return r.toByteArray(X(t))}function Q(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function W(t){return t!=t}
|
|
},{"base64-js":"yh9p","ieee754":"JgNJ","isarray":"REa7","buffer":"dskh"}],"xfwq":[function(require,module,exports) {
|
|
var Buffer = require("buffer").Buffer;
|
|
var r=require("buffer").Buffer;function e(e,t,o){return e instanceof ArrayBuffer&&(e=new Uint8Array(e)),new r(e,t,o)}e.prototype=Object.create(r.prototype),e.prototype.constructor=e,Object.keys(r).forEach(function(t){r.hasOwnProperty(t)&&(e[t]=r[t])}),module.exports=e;
|
|
},{"buffer":"dskh"}],"QO4x":[function(require,module,exports) {
|
|
var global = arguments[3];
|
|
var t=arguments[3],e=require("../constants.js").FILE_SYSTEM_NAME,r=require("../constants.js").FILE_STORE_NAME,n=require("../constants.js").IDB_RW,o=require("../constants.js").IDB_RO,u=require("../buffer.js"),c=t.indexedDB||t.mozIndexedDB||t.webkitIndexedDB||t.msIndexedDB;function i(t,e){this.db=t,this.mode=e}function s(t){this.name=t||e,this.db=null}i.prototype._getObjectStore=function(){if(this.objectStore)return this.objectStore;var t=this.db.transaction(r,this.mode);return this.objectStore=t.objectStore(r),this.objectStore},i.prototype.clear=function(t){try{var e=this._getObjectStore().clear();e.onsuccess=function(){t()},e.onerror=function(e){e.preventDefault(),t(e.error)}}catch(e){t(e)}},i.prototype._get=function(t,e){try{var r=this._getObjectStore().get(t);r.onsuccess=function(t){var r=t.target.result;e(null,r)},r.onerror=function(t){t.preventDefault(),e(t.error)}}catch(t){e(t)}},i.prototype.getObject=function(t,e){this._get(t,e)},i.prototype.getBuffer=function(t,e){this._get(t,function(t,r){if(t)return e(t);e(null,new u(r))})},i.prototype._put=function(t,e,r){try{var n=this._getObjectStore().put(e,t);n.onsuccess=function(t){var e=t.target.result;r(null,e)},n.onerror=function(t){t.preventDefault(),r(t.error)}}catch(t){r(t)}},i.prototype.putObject=function(t,e,r){this._put(t,e,r)},i.prototype.putBuffer=function(t,e,r){var n=e.buffer;this._put(t,n,r)},i.prototype.delete=function(t,e){try{var r=this._getObjectStore().delete(t);r.onsuccess=function(t){var r=t.target.result;e(null,r)},r.onerror=function(t){t.preventDefault(),e(t.error)}}catch(t){e(t)}},s.isSupported=function(){return!!c},s.prototype.open=function(t){var e=this;if(e.db)return t();try{var n=c.open(e.name);n.onupgradeneeded=function(t){var e=t.target.result;e.objectStoreNames.contains(r)&&e.deleteObjectStore(r),e.createObjectStore(r)},n.onsuccess=function(r){e.db=r.target.result,t()},n.onerror=function(e){e.preventDefault(),t(e.error)}}catch(e){t(e)}},s.prototype.getReadOnlyContext=function(){return new i(this.db,o)},s.prototype.getReadWriteContext=function(){return new i(this.db,n)},module.exports=s;
|
|
},{"../constants.js":"iJA9","../buffer.js":"xfwq"}],"vLJO":[function(require,module,exports) {
|
|
!function(){"use strict";for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=new Uint8Array(256),t=0;t<r.length;t++)e[r.charCodeAt(t)]=t;exports.encode=function(e){var t,n=new Uint8Array(e),o=n.length,a="";for(t=0;t<o;t+=3)a+=r[n[t]>>2],a+=r[(3&n[t])<<4|n[t+1]>>4],a+=r[(15&n[t+1])<<2|n[t+2]>>6],a+=r[63&n[t+2]];return o%3==2?a=a.substring(0,a.length-1)+"=":o%3==1&&(a=a.substring(0,a.length-2)+"=="),a},exports.decode=function(r){var t,n,o,a,h,c=.75*r.length,g=r.length,i=0;"="===r[r.length-1]&&(c--,"="===r[r.length-2]&&c--);var u=new ArrayBuffer(c),A=new Uint8Array(u);for(t=0;t<g;t+=4)n=e[r.charCodeAt(t)],o=e[r.charCodeAt(t+1)],a=e[r.charCodeAt(t+2)],h=e[r.charCodeAt(t+3)],A[i++]=n<<2|o>>4,A[i++]=(15&o)<<4|a>>2,A[i++]=(3&a)<<6|63&h;return u}}();
|
|
},{}],"hW+K":[function(require,module,exports) {
|
|
var global = arguments[3];
|
|
var t=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");function s(t,n){var e=this;this.getTransaction=function(i){e.transaction?i(e.transaction):t[n?"readTransaction":"transaction"](function(t){e.transaction=t,i(t)})}}function f(t,n,i){function o(t,n){var e=0===n.rows.length?null:n.rows.item(0).data;i(null,e)}function r(t,n){i(n)}t(function(t){t.executeSql("SELECT data FROM "+e+" WHERE id = ? LIMIT 1;",[n],o,r)})}function E(t,n,i,o){function r(){o(null)}function u(t,n){o(n)}t(function(t){t.executeSql("INSERT OR REPLACE INTO "+e+" (id, data) VALUES (?, ?);",[n,i],r,u)})}function d(t){this.name=t||n,this.db=null}s.prototype.clear=function(t){function n(n,e){t(e)}function i(){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)return n(t);try{e&&(e=JSON.parse(e))}catch(t){return n(t)}n(null,e)})},s.prototype.getBuffer=function(t,n){f(this.getTransaction,t,function(t,e){if(t)return n(t);if(e||""===e){var i=c.decode(e);e=new a(i)}n(null,e)})},s.prototype.putObject=function(t,n,e){var i=JSON.stringify(n);E(this.getTransaction,t,i,e)},s.prototype.putBuffer=function(t,n,e){var i=c.encode(n.buffer);E(this.getTransaction,t,i,e)},s.prototype.delete=function(t,n){function i(){n(null)}function o(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){var a=this;if(a.db)return n();var c=t.openDatabase(a.name,i,r,o);function s(t,e){5===e.code&&n(new u.EINVAL("WebSQL cannot be accessed. If private browsing is enabled, disable it.")),n(e)}function f(){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(){return new s(this.db,!0)},d.prototype.getReadWriteContext=function(){return new s(this.db,!1)},module.exports=d;
|
|
},{"../constants.js":"iJA9","../errors.js":"p8GN","../buffer.js":"xfwq","base64-arraybuffer":"vLJO"}],"pBGv":[function(require,module,exports) {
|
|
|
|
var t,e,n=module.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}function u(t){if(e===clearTimeout)return clearTimeout(t);if((e===o||!e)&&clearTimeout)return e=clearTimeout,clearTimeout(t);try{return e(t)}catch(n){try{return e.call(null,t)}catch(n){return e.call(this,t)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:r}catch(e){t=r}try{e="function"==typeof clearTimeout?clearTimeout:o}catch(t){e=o}}();var c,s=[],l=!1,a=-1;function f(){l&&c&&(l=!1,c.length?s=c.concat(s):a=-1,s.length&&h())}function h(){if(!l){var t=i(f);l=!0;for(var e=s.length;e;){for(c=s,s=[];++a<e;)c&&c[a].run();a=-1,e=s.length}c=null,l=!1,u(t)}}function m(t,e){this.fun=t,this.array=e}function p(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];s.push(new m(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){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0};
|
|
},{}],"u4Zs":[function(require,module,exports) {
|
|
var process = require("process");
|
|
var define;
|
|
var e,t=require("process");!function(){var n={};void 0!==t&&t.nextTick?(n.nextTick=t.nextTick,"undefined"!=typeof setImmediate?n.setImmediate=function(e){setImmediate(e)}:n.setImmediate=n.nextTick):"function"==typeof setImmediate?(n.nextTick=function(e){setImmediate(e)},n.setImmediate=n.nextTick):(n.nextTick=function(e){setTimeout(e,0)},n.setImmediate=n.nextTick),n.eachSeries=function(e,t,n){if(n=n||function(){},!e.length)return n();var i=0;!function o(){t(e[i],function(t){t?(n(t),n=function(){}):(i+=1)>=e.length?n():o()})}()},n.forEachSeries=n.eachSeries,void 0!==e&&e.amd?e([],function(){return n}):"undefined"!=typeof module&&module.exports?module.exports=n:root.async=n}();
|
|
},{"process":"pBGv"}],"3OWy":[function(require,module,exports) {
|
|
var t=require("../constants.js").FILE_SYSTEM_NAME,e=require("../../lib/async.js").setImmediate,o=function(){var t={};return function(e){return t.hasOwnProperty(e)||(t[e]={}),t[e]}}();function n(t,e){this.readOnly=e,this.objectStore=t}function r(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{var o=this.objectStore;Object.keys(o).forEach(function(t){delete o[t]}),e(t)}},n.prototype.getObject=n.prototype.getBuffer=function(t,o){var n=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")}):(delete this.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(){return new n(this.db,!0)},r.prototype.getReadWriteContext=function(){return new n(this.db,!1)},module.exports=r;
|
|
},{"../constants.js":"iJA9","../../lib/async.js":"u4Zs"}],"AiW7":[function(require,module,exports) {
|
|
var r=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())return r;if(e.isSupported())return e;function o(){throw"[Filer Error] Your browser doesn't support IndexedDB or WebSQL."}return o.isSupported=function(){return!1},o}()};
|
|
},{"./indexeddb.js":"QO4x","./websql.js":"hW+K","./memory.js":"3OWy"}],"QMiB":[function(require,module,exports) {
|
|
var t=require("../constants.js").ENVIRONMENT;module.exports=function(n){(n=n||{}).TMP=n.TMP||t.TMP,n.PATH=n.PATH||t.PATH,this.get=function(t){return n[t]},this.set=function(t,e){n[t]=e}};
|
|
},{"../constants.js":"iJA9"}],"UUq2":[function(require,module,exports) {
|
|
var process = require("process");
|
|
var r=require("process");function t(r,t){for(var e=0,n=r.length-1;n>=0;n--){var s=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("..");return r}var e=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,n=function(r){return e.exec(r).slice(1)};function s(r,t){if(r.filter)return r.filter(t);for(var e=[],n=0;n<r.length;n++)t(r[n],n,r)&&e.push(r[n]);return e}exports.resolve=function(){for(var e="",n=!1,o=arguments.length-1;o>=-1&&!n;o--){var i=o>=0?arguments[o]:r.cwd();if("string"!=typeof i)throw new TypeError("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){var e=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(){var r=Array.prototype.slice.call(arguments,0);return exports.normalize(s(r,function(r,t){if("string"!=typeof r)throw new TypeError("Arguments to path.join must be strings");return r}).join("/"))},exports.relative=function(r,t){function e(r){for(var t=0;t<r.length&&""===r[t];t++);for(var e=r.length-1;e>=0&&""===r[e];e--);return t>e?[]:r.slice(t,e-t+1)}r=exports.resolve(r).substr(1),t=exports.resolve(t).substr(1);for(var n=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}var l=[];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){var t=n(r),e=t[0],s=t[1];return e||s?(s&&(s=s.substr(0,s.length-1)),e+s):"."},exports.basename=function(r,t){var e=n(r)[2];return t&&e.substr(-1*t.length)===t&&(e=e.substr(0,e.length-t.length)),e},exports.extname=function(r){return n(r)[3]};var o="b"==="ab".substr(-1)?function(r,t,e){return r.substr(t,e)}:function(r,t,e){return t<0&&(t=r.length+t),r.substr(t,e)};
|
|
},{"process":"pBGv"}],"bQx9":[function(require,module,exports) {
|
|
module.exports=function(t,o){for(var a=[],e=0;e<t.length;e++){var n=o(t[e],e);r(n)?a.push.apply(a,n):a.push(n)}return a};var r=Array.isArray||function(r){return"[object Array]"===Object.prototype.toString.call(r)};
|
|
},{}],"6D9y":[function(require,module,exports) {
|
|
"use strict";function e(e,r,i){e instanceof RegExp&&(e=n(e,i)),r instanceof RegExp&&(r=n(r,i));var o=t(e,r,i);return o&&{start:o[0],end:o[1],pre:i.slice(0,o[0]),body:i.slice(o[0]+e.length,o[1]),post:i.slice(o[1]+r.length)}}function n(e,n){var t=n.match(e);return t?t[0]:null}function t(e,n,t){var r,i,o,f,l,s=t.indexOf(e),c=t.indexOf(n,s+1),p=s;if(s>=0&&c>0){for(r=[],o=t.length;p>=0&&!l;)p==s?(r.push(p),s=t.indexOf(e,p+1)):1==r.length?l=[r.pop(),c]:((i=r.pop())<o&&(o=i,f=c),c=t.indexOf(n,p+1)),p=s<c&&s>=0?s:c;r.length&&(l=[o,f])}return l}module.exports=e,e.range=t;
|
|
},{}],"dwX/":[function(require,module,exports) {
|
|
var t=require("concat-map"),r=require("balanced-match");module.exports=f;var n="\0SLASH"+Math.random()+"\0",e="\0OPEN"+Math.random()+"\0",i="\0CLOSE"+Math.random()+"\0",o="\0COMMA"+Math.random()+"\0",a="\0PERIOD"+Math.random()+"\0";function s(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function p(t){return t.split("\\\\").join(n).split("\\{").join(e).split("\\}").join(i).split("\\,").join(o).split("\\.").join(a)}function u(t){return t.split(n).join("\\").split(e).join("{").split(i).join("}").split(o).join(",").split(a).join(".")}function l(t){if(!t)return[""];var n=[],e=r("{","}",t);if(!e)return t.split(",");var i=e.pre,o=e.body,a=e.post,s=i.split(",");s[s.length-1]+="{"+o+"}";var p=l(a);return a.length&&(s[s.length-1]+=p.shift(),s.push.apply(s,p)),n.push.apply(n,s),n}function f(t){return t?("{}"===t.substr(0,2)&&(t="\\{\\}"+t.substr(2)),m(p(t),!0).map(u)):[]}function h(t){return t}function d(t){return"{"+t+"}"}function c(t){return/^-?0\d/.test(t)}function v(t,r){return t<=r}function g(t,r){return t>=r}function m(n,e){var o=[],a=r("{","}",n);if(!a||/\$$/.test(a.pre))return[n];var p,u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(a.body),f=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(a.body),h=u||f,b=a.body.indexOf(",")>=0;if(!h&&!b)return a.post.match(/,.*\}/)?m(n=a.pre+"{"+a.body+i+a.post):[n];if(h)p=a.body.split(/\.\./);else if(1===(p=l(a.body)).length&&1===(p=m(p[0],!1).map(d)).length)return(M=a.post.length?m(a.post,!1):[""]).map(function(t){return a.pre+p[0]+t});var j,y=a.pre,M=a.post.length?m(a.post,!1):[""];if(h){var A=s(p[0]),C=s(p[1]),O=Math.max(p[0].length,p[1].length),S=3==p.length?Math.abs(s(p[2])):1,$=v;C<A&&(S*=-1,$=g);var x=p.some(c);j=[];for(var E=A;$(E,C);E+=S){var I;if(f)"\\"===(I=String.fromCharCode(E))&&(I="");else if(I=String(E),x){var q=O-I.length;if(q>0){var z=new Array(q+1).join("0");I=E<0?"-"+z+I.slice(1):z+I}}j.push(I)}}else j=t(p,function(t){return m(t,!1)});for(var L=0;L<j.length;L++)for(var P=0;P<M.length;P++){var Z=y+j[L]+M[P];(!e||h||Z)&&o.push(Z)}return o}
|
|
},{"concat-map":"bQx9","balanced-match":"6D9y"}],"Nt/K":[function(require,module,exports) {
|
|
module.exports=g,g.Minimatch=l;var t={sep:"/"};try{t=require("path")}catch(t){}var e=g.GLOBSTAR=l.GLOBSTAR={},n=require("brace-expansion"),r={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},i="[^/]",s=i+"*?",a="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",o="(?:(?!(?:\\/|^)\\.).)*?",h=c("().*{}+?[]^$\\!");function c(t){return t.split("").reduce(function(t,e){return t[e]=!0,t},{})}var u=/\/+/;function p(t,e){return e=e||{},function(n,r,i){return g(n,t,e)}}function f(t,e){t=t||{},e=e||{};var n={};return Object.keys(e).forEach(function(t){n[t]=e[t]}),Object.keys(t).forEach(function(e){n[e]=t[e]}),n}function g(t,e,n){if("string"!=typeof e)throw new TypeError("glob pattern string required");return n||(n={}),!(!n.nocomment&&"#"===e.charAt(0))&&(""===e.trim()?""===t:new l(e,n).match(t))}function l(e,n){if(!(this instanceof l))return new l(e,n);if("string"!=typeof e)throw new TypeError("glob pattern string required");n||(n={}),e=e.trim(),"/"!==t.sep&&(e=e.split(t.sep).join("/")),this.options=n,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}function d(){if(!this._made){var t=this.pattern,e=this.options;if(e.nocomment||"#"!==t.charAt(0))if(t){this.parseNegate();var n=this.globSet=this.braceExpand();e.debug&&(this.debug=console.error),this.debug(this.pattern,n),n=this.globParts=n.map(function(t){return t.split(u)}),this.debug(this.pattern,n),n=n.map(function(t,e,n){return t.map(this.parse,this)},this),this.debug(this.pattern,n),n=n.filter(function(t){return-1===t.indexOf(!1)}),this.debug(this.pattern,n),this.set=n}else this.empty=!0;else this.comment=!0}}function b(){var t=this.pattern,e=!1,n=0;if(!this.options.nonegate){for(var r=0,i=t.length;r<i&&"!"===t.charAt(r);r++)e=!e,n++;n&&(this.pattern=t.substr(n)),this.negate=e}}function m(t,e){if(e||(e=this instanceof l?this.options:{}),void 0===(t=void 0===t?this.pattern:t))throw new TypeError("undefined pattern");return e.nobrace||!t.match(/\{.*\}/)?[t]:n(t)}g.filter=p,g.defaults=function(t){if(!t||!Object.keys(t).length)return g;var e=g,n=function(n,r,i){return e.minimatch(n,r,f(t,i))};return n.Minimatch=function(n,r){return new e.Minimatch(n,f(t,r))},n},l.defaults=function(t){return t&&Object.keys(t).length?g.defaults(t).Minimatch:l},l.prototype.debug=function(){},l.prototype.make=d,l.prototype.parseNegate=b,g.braceExpand=function(t,e){return m(t,e)},l.prototype.braceExpand=m,l.prototype.parse=y;var v={};function y(t,n){if(t.length>65536)throw new TypeError("pattern is too long");var a=this.options;if(!a.noglobstar&&"**"===t)return e;if(""===t)return"";var o,c="",u=!!a.nocase,p=!1,f=[],g=[],l=!1,d=-1,b=-1,m="."===t.charAt(0)?"":a.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",y=this;function w(){if(o){switch(o){case"*":c+=s,u=!0;break;case"?":c+=i,u=!0;break;default:c+="\\"+o}y.debug("clearStateChar %j %j",o,c),o=!1}}for(var x,j=0,O=t.length;j<O&&(x=t.charAt(j));j++)if(this.debug("%s\t%s %s %j",t,j,c,x),p&&h[x])c+="\\"+x,p=!1;else switch(x){case"/":return!1;case"\\":w(),p=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s\t%s %s %j <-- stateChar",t,j,c,x),l){this.debug(" in class"),"!"===x&&j===b+1&&(x="^"),c+=x;continue}y.debug("call clearStateChar %j",o),w(),o=x,a.noext&&w();continue;case"(":if(l){c+="(";continue}if(!o){c+="\\(";continue}f.push({type:o,start:j-1,reStart:c.length,open:r[o].open,close:r[o].close}),c+="!"===o?"(?:(?!(?:":"(?:",this.debug("plType %j %j",o,c),o=!1;continue;case")":if(l||!f.length){c+="\\)";continue}w(),u=!0;var k=f.pop();c+=k.close,"!"===k.type&&g.push(k),k.reEnd=c.length;continue;case"|":if(l||!f.length||p){c+="\\|",p=!1;continue}w(),c+="|";continue;case"[":if(w(),l){c+="\\"+x;continue}l=!0,b=j,d=c.length,c+=x;continue;case"]":if(j===b+1||!l){c+="\\"+x,p=!1;continue}if(l){var A=t.substring(b+1,j);try{RegExp("["+A+"]")}catch(t){var S=this.parse(A,v);c=c.substr(0,d)+"\\["+S[0]+"\\]",u=u||S[1],l=!1;continue}}u=!0,l=!1,c+=x;continue;default:w(),p?p=!1:!h[x]||"^"===x&&l||(c+="\\"),c+=x}for(l&&(A=t.substr(b+1),S=this.parse(A,v),c=c.substr(0,d)+"\\["+S[0],u=u||S[1]),k=f.pop();k;k=f.pop()){var $=c.slice(k.reStart+k.open.length);this.debug("setting tail",c,k),$=$.replace(/((?:\\{2}){0,64})(\\?)\|/g,function(t,e,n){return n||(n="\\"),e+e+n+"|"}),this.debug("tail=%j\n %s",$,$,k,c);var R="*"===k.type?s:"?"===k.type?i:"\\"+k.type;u=!0,c=c.slice(0,k.reStart)+R+"\\("+$}w(),p&&(c+="\\\\");var T=!1;switch(c.charAt(0)){case".":case"[":case"(":T=!0}for(var C=g.length-1;C>-1;C--){var L=g[C],q=c.slice(0,L.reStart),B=c.slice(L.reStart,L.reEnd-8),M=c.slice(L.reEnd-8,L.reEnd),N=c.slice(L.reEnd);M+=N;var _=q.split("(").length-1,G=N;for(j=0;j<_;j++)G=G.replace(/\)[+*?]?/,"");var P="";""===(N=G)&&n!==v&&(P="$"),c=q+B+N+P+M}if(""!==c&&u&&(c="(?=.)"+c),T&&(c=m+c),n===v)return[c,u];if(!u)return E(t);var z=a.nocase?"i":"";try{var D=new RegExp("^"+c+"$",z)}catch(t){return new RegExp("$.")}return D._glob=t,D._src=c,D}function w(){if(this.regexp||!1===this.regexp)return this.regexp;var t=this.set;if(!t.length)return this.regexp=!1,this.regexp;var n=this.options,r=n.noglobstar?s:n.dot?a:o,i=n.nocase?"i":"",h=t.map(function(t){return t.map(function(t){return t===e?r:"string"==typeof t?j(t):t._src}).join("\\/")}).join("|");h="^(?:"+h+")$",this.negate&&(h="^(?!"+h+").*$");try{this.regexp=new RegExp(h,i)}catch(t){this.regexp=!1}return this.regexp}function x(e,n){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return""===e;if("/"===e&&n)return!0;var r=this.options;"/"!==t.sep&&(e=e.split(t.sep).join("/")),e=e.split(u),this.debug(this.pattern,"split",e);var i,s,a=this.set;for(this.debug(this.pattern,"set",a),s=e.length-1;s>=0&&!(i=e[s]);s--);for(s=0;s<a.length;s++){var o=a[s],h=e;if(r.matchBase&&1===o.length&&(h=[i]),this.matchOne(h,o,n))return!!r.flipNegate||!this.negate}return!r.flipNegate&&this.negate}function E(t){return t.replace(/\\(.)/g,"$1")}function j(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}g.makeRe=function(t,e){return new l(t,e||{}).makeRe()},l.prototype.makeRe=w,g.match=function(t,e,n){var r=new l(e,n=n||{});return t=t.filter(function(t){return r.match(t)}),r.options.nonull&&!t.length&&t.push(e),t},l.prototype.match=x,l.prototype.matchOne=function(t,n,r){var i=this.options;this.debug("matchOne",{this:this,file:t,pattern:n}),this.debug("matchOne",t.length,n.length);for(var s=0,a=0,o=t.length,h=n.length;s<o&&a<h;s++,a++){this.debug("matchOne loop");var c,u=n[a],p=t[s];if(this.debug(n,u,p),!1===u)return!1;if(u===e){this.debug("GLOBSTAR",[n,u,p]);var f=s,g=a+1;if(g===h){for(this.debug("** at the end");s<o;s++)if("."===t[s]||".."===t[s]||!i.dot&&"."===t[s].charAt(0))return!1;return!0}for(;f<o;){var l=t[f];if(this.debug("\nglobstar while",t,f,n,g,l),this.matchOne(t.slice(f),n.slice(g),r))return this.debug("globstar found match!",f,o,l),!0;if("."===l||".."===l||!i.dot&&"."===l.charAt(0)){this.debug("dot detected!",t,f,n,g);break}this.debug("globstar swallow a segment, and continue"),f++}return!(!r||(this.debug("\n>>> no match, partial?",t,f,n,g),f!==o))}if("string"==typeof u?(c=i.nocase?p.toLowerCase()===u.toLowerCase():p===u,this.debug("string match",u,p,c)):(c=p.match(u),this.debug("pattern match",u,p,c)),!c)return!1}if(s===o&&a===h)return!0;if(s===o)return r;if(a===h)return s===o-1&&""===t[s];throw new Error("wtf?")};
|
|
},{"path":"UUq2","brace-expansion":"dwX/"}],"D1Ra":[function(require,module,exports) {
|
|
var n=require("es6-promisify"),t=n.promisify,e=require("../path.js"),i=require("../errors.js"),r=require("./environment.js"),o=require("../../lib/async.js"),u=require("minimatch");function c(n,o){var u=this,c=new r((o=o||{}).env),f="/";Object.defineProperty(this,"fs",{get:function(){return n},enumerable:!0}),Object.defineProperty(this,"env",{get:function(){return c},enumerable:!0}),this.cd=function(t,r){t=e.resolve(f,t),n.stat(t,function(n,e){n?r(new i.ENOTDIR(null,t)):"DIRECTORY"===e.type?(f=t,r()):r(new i.ENOTDIR(null,t))})},this.pwd=function(){return f},this.promises={},["cd","exec","touch","cat","ls","rm","tempDir","mkdirp","find"].forEach(function(n){u.promises[n]=t(u[n].bind(u))})}c.prototype.exec=function(n,t,i){var r=this.fs;"function"==typeof t&&(i=t,t=[]),t=t||[],i=i||function(){},n=e.resolve(this.pwd(),n),r.readFile(n,"utf8",function(n,e){if(n)i(n);else try{new Function("fs","args","callback",e)(r,t,i)}catch(n){i(n)}})},c.prototype.touch=function(n,t,i){var r=this.fs;"function"==typeof t&&(i=t,t={}),t=t||{},i=i||function(){},n=e.resolve(this.pwd(),n),r.stat(n,function(e){e?!0===t.updateOnly?i():function(n){r.writeFile(n,"",i)}(n):function(n){var e=Date.now(),o=t.date||e,u=t.date||e;r.utimes(n,o,u,i)}(n)})},c.prototype.cat=function(n,t){var r=this,u=r.fs,c="";t=t||function(){},n?(n="string"==typeof n?[n]:n,o.eachSeries(n,function(n,t){var i=e.resolve(r.pwd(),n);u.readFile(i,"utf8",function(n,e){n?t(n):(c+=e+"\n",t())})},function(n){n?t(n):t(null,c.replace(/\n$/,""))})):t(new i.EINVAL("Missing files argument"))},c.prototype.ls=function(n,t,r){var u=this,c=u.fs;"function"==typeof t&&(r=t,t={}),t=t||{},r=r||function(){},n?function n(i,r){var f=e.resolve(u.pwd(),i),s=[];c.readdir(f,function(i,u){i?r(i):o.eachSeries(u,function(i,r){i=e.join(f,i),c.stat(i,function(i,o){if(i)r(i);else{var u=o;t.recursive&&"DIRECTORY"===o.type?n(e.join(f,u.name),function(n,t){n?r(n):(u.contents=t,s.push(u),r())}):(s.push(u),r())}})},function(n){r(n,s)})})}(n,r):r(new i.EINVAL("Missing dir argument"))},c.prototype.rm=function(n,t,r){var u=this,c=u.fs;"function"==typeof t&&(r=t,t={}),t=t||{},r=r||function(){},n?function n(r,f){r=e.resolve(u.pwd(),r),c.stat(r,function(u,s){u?f(u):"FILE"!==s.type?c.readdir(r,function(u,s){u?f(u):0!==s.length?t.recursive?(s=s.map(function(n){return e.join(r,n)}),o.eachSeries(s,n,function(n){n?f(n):c.rmdir(r,f)})):f(new i.ENOTEMPTY(null,r)):c.rmdir(r,f)}):c.unlink(r,f)})}(n,r):r(new i.EINVAL("Missing path argument"))},c.prototype.tempDir=function(n){var t=this.fs,e=this.env.get("TMP");n=n||function(){},t.mkdir(e,function(){n(null,e)})},c.prototype.mkdirp=function(n,t){var r=this.fs;t=t||function(){},n?"/"!==n?function n(t,o){r.stat(t,function(u,c){if(c){if(c.isDirectory())return void o();if(c.isFile())return void o(new i.ENOTDIR(null,t))}else{if(u&&"ENOENT"!==u.code)return void o(u);var f=e.dirname(t);"/"===f?r.mkdir(t,function(n){n&&"EEXIST"!=n.code?o(n):o()}):n(f,function(n){if(n)return o(n);r.mkdir(t,function(n){n&&"EEXIST"!=n.code?o(n):o()})})}})}(n,t):t():t(new i.EINVAL("Missing path argument"))},c.prototype.find=function(n,t,r){var c=this,f=c.fs;"function"==typeof t&&(r=t,t={}),r=r||function(){};var s=(t=t||{}).exec||function(n,t){t()},a=[];function p(n,i){var r=e.removeTrailing(n);!t.regex||t.regex.test(r)?t.name&&!u(e.basename(r),t.name)||t.path&&!u(e.dirname(r),t.path)?i():function(n,t){s(n,function(e){e?t(e):(a.push(n),t())})}(n,i):i()}function d(n,t){n=e.resolve(c.pwd(),n),f.readdir(n,function(i,r){i?"ENOTDIR"===i.code?p(n,t):t(i):p(e.addTrailing(n),function(i){i?t(i):(r=r.map(function(t){return e.join(n,t)}),o.eachSeries(r,d,function(n){t(n,a)}))})})}n?f.stat(n,function(t,e){t?r(t):e.isDirectory()?d(n,r):r(new i.ENOTDIR(null,n))}):r(new i.EINVAL("Missing path argument"))},module.exports=c;
|
|
},{"es6-promisify":"0c0E","../path.js":"UzoP","../errors.js":"p8GN","./environment.js":"QMiB","../../lib/async.js":"u4Zs","minimatch":"Nt/K"}],"J4Qg":[function(require,module,exports) {
|
|
function t(t,r){for(var o=r.length-1;o>=0;o--)r[o]===t&&r.splice(o,1);return r}var r=function(){};r.createInterface=function(r){var o={on:function(t,o){void 0===this[r]&&(this[r]={}),this[r].hasOwnProperty(t)||(this[r][t]=[]),this[r][t].push(o)},off:function(o,e){void 0!==this[r]&&this[r].hasOwnProperty(o)&&t(e,this[r][o])},trigger:function(t){if(void 0!==this[r]&&this[r].hasOwnProperty(t))for(var o=Array.prototype.slice.call(arguments,1),e=0;e<this[r][t].length;e++)this[r][t][e].apply(this[r][t][e],o)},removeAllListeners:function(t){if(void 0!==this[r]){var o=this;o[r][t].forEach(function(r){o.off(t,r)})}}};return o};var o=r.createInterface("_handlers");r.prototype._on=o.on,r.prototype._off=o.off,r.prototype._trigger=o.trigger;var e=r.createInterface("handlers");r.prototype.on=function(){e.on.apply(this,arguments),Array.prototype.unshift.call(arguments,"on"),this._trigger.apply(this,arguments)},r.prototype.off=e.off,r.prototype.trigger=e.trigger,r.prototype.removeAllListeners=e.removeAllListeners,module.exports=r;
|
|
},{}],"u7Jv":[function(require,module,exports) {
|
|
var global = arguments[3];
|
|
var t=arguments[3],e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n=require("./eventemitter.js"),o=require("../src/shared.js").guid;function r(t,e){var n=0;return function(){var o=Date.now();o-n>t&&(n=o,e.apply(this,arguments))}}function i(t,n){if(void 0!==t&&t||(t={}),"object"===(void 0===n?"undefined":e(n)))for(var o in n)n.hasOwnProperty(o)&&(t[o]=n[o]);return t}var a=function(t){return void 0===t||void 0===t.localStorage?{getItem:function(){},setItem:function(){},removeItem:function(){}}:t.localStorage}(t);function s(){var e=this,n=Date.now();this.origin=o(),this.lastMessage=n,this.receivedIDs={},this.previousValues={};var r=function(){e._onStorageEvent.apply(e,arguments)};"undefined"!=typeof document&&(document.attachEvent?document.attachEvent("onstorage",r):t.addEventListener("storage",r,!1))}s.prototype._transaction=function(t){var e=1e3,n=20,o=this,r=!1,i=!1,s=null;function c(){if(!r){var u=Date.now(),f=0|a.getItem(p);if(f&&u-f<e)return i||(o._on("storage",c),i=!0),void(s=setTimeout(c,n));r=!0,a.setItem(p,u),t(),function(){i&&o._off("storage",c);s&&clearTimeout(s);a.removeItem(p)}()}}c()},s.prototype._cleanup_emit=r(100,function(){this._transaction(function(){var t,e=Date.now()-f,n=0;try{t=JSON.parse(a.getItem(c)||"[]")}catch(e){t=[]}for(var o=t.length-1;o>=0;o--)t[o].timestamp<e&&(t.splice(o,1),n++);n>0&&a.setItem(c,JSON.stringify(t))})}),s.prototype._cleanup_once=r(100,function(){var t=this;t._transaction(function(){Date.now();var e,n,o=0;try{n=JSON.parse(a.getItem(u)||"{}")}catch(t){n={}}for(e in n)t._once_expired(e,n)&&(delete n[e],o++);o>0&&a.setItem(u,JSON.stringify(n))})}),s.prototype._once_expired=function(t,n){if(!n)return!0;if(!n.hasOwnProperty(t))return!0;if("object"!==e(n[t]))return!0;var o=n[t].ttl||m,r=Date.now();return n[t].timestamp<r-o},s.prototype._localStorageChanged=function(t,e){if(t&&t.key)return t.key===e;var n=a.getItem(e);return n!==this.previousValues[e]&&(this.previousValues[e]=n,!0)},s.prototype._onStorageEvent=function(e){e=e||t.event;var n=this;this._localStorageChanged(e,c)&&this._transaction(function(){var t,e=Date.now(),o=a.getItem(c);try{t=JSON.parse(o||"[]")}catch(e){t=[]}for(var r=0;r<t.length;r++)if(t[r].origin!==n.origin&&!(t[r].timestamp<n.lastMessage)){if(t[r].id){if(n.receivedIDs.hasOwnProperty(t[r].id))continue;n.receivedIDs[t[r].id]=!0}n.trigger(t[r].name,t[r].payload)}n.lastMessage=e}),this._trigger("storage",e)},s.prototype._emit=function(t,e,n){if((n="string"==typeof n||"number"==typeof n?String(n):null)&&n.length){if(this.receivedIDs.hasOwnProperty(n))return;this.receivedIDs[n]=!0}var o={id:n,name:t,origin:this.origin,timestamp:Date.now(),payload:e},r=this;this._transaction(function(){var n=a.getItem(c)||"[]",i="[]"===n?"":",";n=[n.substring(0,n.length-1),i,JSON.stringify(o),"]"].join(""),a.setItem(c,n),r.trigger(t,e),setTimeout(function(){r._cleanup_emit()},50)})},s.prototype.emit=function(t,e){this._emit.apply(this,arguments),this._trigger("emit",t,e)},s.prototype.once=function(t,e,n){if(s.supported){var o=this;this._transaction(function(){var r;try{r=JSON.parse(a.getItem(u)||"{}")}catch(t){r={}}o._once_expired(t,r)&&(r[t]={},r[t].timestamp=Date.now(),"number"==typeof n&&(r[t].ttl=1e3*n),a.setItem(u,JSON.stringify(r)),e(),setTimeout(function(){o._cleanup_once()},50))})}},i(s.prototype,n.prototype),s.supported=void 0!==a;var c="intercom",u="intercom_once",p="intercom_lock",f=5e4,m=36e5;s.destroy=function(){a.removeItem(p),a.removeItem(c),a.removeItem(u)},s.getInstance=function(){var t;return function(){return t||(t=new s),t}}(),module.exports=s;
|
|
},{"./eventemitter.js":"J4Qg","../src/shared.js":"3zBM"}],"VLEe":[function(require,module,exports) {
|
|
var e=require("../lib/eventemitter.js"),t=require("./path.js"),n=require("../lib/intercom.js");function r(){e.call(this);var r,i,o=this,s=!1;function c(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))throw new Error("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=new e,r.prototype.constructor=r,module.exports=r;
|
|
},{"../lib/eventemitter.js":"J4Qg","./path.js":"UzoP","../lib/intercom.js":"u7Jv"}],"03yF":[function(require,module,exports) {
|
|
var Buffer = require("buffer").Buffer;
|
|
var e=require("buffer").Buffer;function r(e){return e.toString("utf8")}function u(r){return new e(r,"utf8")}module.exports={encode:u,decode:r};
|
|
},{"buffer":"dskh"}],"ZECt":[function(require,module,exports) {
|
|
var t=require("./constants.js").NODE_TYPE_FILE;module.exports=function(s,e){this.id=s,this.type=e||t};
|
|
},{"./constants.js":"iJA9"}],"XWaV":[function(require,module,exports) {
|
|
var t=require("./errors.js");function e(t,e,i,o){this.path=t,this.id=e,this.flags=i,this.position=o}e.prototype.getNode=function(e,i){var o=this.id,r=this.path;e.getObject(o,function(e,o){return e?i(e):o?void i(null,o):i(new t.EBADF("file descriptor refers to unknown node",r))})},module.exports=e;
|
|
},{"./errors.js":"p8GN"}],"33JE":[function(require,module,exports) {
|
|
var t=require("./constants.js");function e(e){var i=Date.now();this.id=t.SUPER_NODE_ID,this.type=t.NODE_TYPE_META,this.atime=e.atime||i,this.ctime=e.ctime||i,this.mtime=e.mtime||i,this.rnode=e.rnode}e.create=function(t,i){t.guid(function(n,o){n?i(n):(t.rnode=t.rnode||o,i(null,new e(t)))})},module.exports=e;
|
|
},{"./constants.js":"iJA9"}],"KKNo":[function(require,module,exports) {
|
|
var t=require("./constants.js").NODE_TYPE_FILE,s=require("./constants.js").NODE_TYPE_DIRECTORY,i=require("./constants.js").NODE_TYPE_SYMBOLIC_LINK,e=require("./constants.js").S_IFREG,n=require("./constants.js").S_IFDIR,r=require("./constants.js").S_IFLNK,a=require("./constants.js").DEFAULT_FILE_PERMISSIONS,u=require("./constants.js").DEFAULT_DIR_PERMISSIONS;function o(o,c){switch(o){case s:return(c||u)|n;case i:return(c||a)|r;case t:default:return(c||a)|e}}function c(s){var i=Date.now();this.id=s.id,this.type=s.type||t,this.size=s.size||0,this.atime=s.atime||i,this.ctime=s.ctime||i,this.mtime=s.mtime||i,this.flags=s.flags||[],this.xattrs=s.xattrs||{},this.nlinks=s.nlinks||0,this.data=s.data,this.version=s.version||1,this.mode=s.mode||o(this.type),this.uid=s.uid||0,this.gid=s.gid||0}function d(t,s,i){t[s]?i(null):t.guid(function(e,n){t[s]=n,i(e)})}c.create=function(t,s){d(t,"id",function(i){i?s(i):d(t,"data",function(i){i?s(i):s(null,new c(t))})})},c.setMode=function(t,s){s.mode=o(s.type,t)},module.exports=c;
|
|
},{"./constants.js":"iJA9"}],"6dsC":[function(require,module,exports) {
|
|
var t=require("./constants.js"),i=require("./path.js");function e(t,e,s){this.dev=s,this.node=e.id,this.type=e.type,this.size=e.size,this.nlinks=e.nlinks,this.atime=e.atime,this.mtime=e.mtime,this.ctime=e.ctime,this.version=e.version,this.mode=e.mode,this.uid=e.uid,this.gid=e.gid,this.name=i.basename(t)}e.prototype.isFile=function(){return this.type===t.NODE_TYPE_FILE},e.prototype.isDirectory=function(){return this.type===t.NODE_TYPE_DIRECTORY},e.prototype.isSymbolicLink=function(){return this.type===t.NODE_TYPE_SYMBOLIC_LINK},e.prototype.isSocket=e.prototype.isFIFO=e.prototype.isCharacterDevice=e.prototype.isBlockDevice=function(){return!1},module.exports=e;
|
|
},{"./constants.js":"iJA9","./path.js":"UzoP"}],"bsBG":[function(require,module,exports) {
|
|
|
|
var n=require("../../lib/nodash.js"),e=require("../path.js"),t=e.normalize,i=e.dirname,o=e.basename,a=e.isAbsolute,u=e.isNull,r=require("../constants.js"),c=r.NODE_TYPE_FILE,f=r.NODE_TYPE_DIRECTORY,s=r.NODE_TYPE_SYMBOLIC_LINK,l=r.NODE_TYPE_META,d=r.FULL_READ_WRITE_EXEC_PERMISSIONS,p=r.ROOT_DIRECTORY_NAME,m=r.SUPER_NODE_ID,E=r.SYMLOOP_MAX,w=r.O_READ,g=r.O_WRITE,b=r.O_CREATE,O=r.O_EXCLUSIVE,v=r.O_APPEND,N=r.O_FLAGS,h=r.XATTR_CREATE,I=r.XATTR_REPLACE,A=r.FS_NOMTIME,y=r.FS_NOCTIME,D=require("../encoding.js"),T=require("../errors.js"),j=require("../directory-entry.js"),L=require("../open-file-description.js"),R=require("../super-node.js"),_=require("../node.js"),V=require("../stats.js"),F=require("../buffer.js"),B=require("../shared.js"),x=B.validateInteger;function S(e,t,i,o,a){var u=e.flags;n(u).contains(y)&&delete o.ctime,n(u).contains(A)&&delete o.mtime;var r=!1;function c(n){e.changes.push({event:"change",path:t}),a(n)}o.ctime&&(i.ctime=o.ctime,i.atime=o.ctime,r=!0),o.atime&&(i.atime=o.atime,r=!0),o.mtime&&(i.mtime=o.mtime,r=!0),r?e.putObject(i.id,i,c):c()}function P(n,e,a,u){if(a!==f&&a!==c)return u(new T.EINVAL("type must be a directory or file",e));e=t(e);var r,s,l,d=o(e),p=i(e);function m(t,i){!t&&i?u(new T.EEXIST("path name already exists",e)):!t||t instanceof T.ENOENT?n.getObject(r.data,E):u(t)}function E(e,t){e?u(e):(s=t,_.create({guid:n.guid,type:a},function(e,t){e?u(e):((l=t).nlinks+=1,n.putObject(l.id,l,g))}))}function w(e){if(e)u(e);else{var t=Date.now();S(n,p,l,{mtime:t,ctime:t},u)}}function g(e){e?u(e):(s[d]=new j(l.id,a),n.putObject(r.data,s,w))}k(n,p,function(t,i){t?u(t):i.type!==f?u(new T.ENOTDIR("a component of the path prefix is not a directory",e)):(r=i,k(n,e,m))})}function k(e,a,u){if(!(a=t(a)))return u(new T.ENOENT("path is an empty string"));var r=o(a),c=i(a),d=0;function w(n,t){n?u(n):t&&t.type===l&&t.rnode?e.getObject(t.rnode,g):u(new T.EFILESYSTEMERROR)}function g(n,e){n?u(n):e?u(null,e):u(new T.ENOENT)}function b(n,t){n?u(n):t.type===f&&t.data?e.getObject(t.data,O):u(new T.ENOTDIR("a component of the path prefix is not a directory",a))}function O(t,i){if(t)u(t);else if(n(i).has(r)){var o=i[r].id;e.getObject(o,v)}else u(new T.ENOENT(null,a))}function v(n,f){var l;n?u(n):f.type===s?++d>E?u(new T.ELOOP(null,a)):(l=f.data,l=t(l),c=i(l),r=o(l),p===r?e.getObject(m,w):k(e,c,b)):u(null,f)}p===r?e.getObject(m,w):k(e,c,b)}function C(n,e,t,i,o,a,u){var r=t.xattrs;a===h&&r.hasOwnProperty(i)?u(new T.EEXIST("attribute already exists",e)):a!==I||r.hasOwnProperty(i)?(r[i]=o,n.putObject(t.id,t,function(i){i?u(i):S(n,e,t,{ctime:Date.now()},u)})):u(new T.ENOATTR(null,e))}function X(n,e){var t,i,o;function a(o){o?e(o):_.create({guid:n.guid,id:t.rnode,type:f},function(t,o){t?e(t):((i=o).nlinks+=1,n.putObject(i.id,i,u))})}function u(t){t?e(t):(o={},n.putObject(i.data,o,e))}n.getObject(m,function(i,o){!i&&o?e():!i||i instanceof T.ENOENT?R.create({guid:n.guid},function(i,o){i?e(i):(t=o,n.putObject(t.id,t,a))}):e(i)})}function M(n,e,a){e=t(e);var u,r,c,s,l=o(e),d=i(e);function p(e,t){e?a(e):(c=t,n.getObject(c.data,m))}function m(e,t){e?a(e):(s=t,_.create({guid:n.guid,type:f},function(e,t){e?a(e):((u=t).nlinks+=1,n.putObject(u.id,u,E))}))}function E(e){e?a(e):(r={},n.putObject(u.data,r,g))}function w(e){if(e)a(e);else{var t=Date.now();S(n,d,c,{mtime:t,ctime:t},a)}}function g(e){e?a(e):(s[l]=new j(u.id,f),n.putObject(c.data,s,w))}k(n,e,function(t,i){!t&&i?a(new T.EEXIST(null,e)):!t||t instanceof T.ENOENT?k(n,d,p):a(t)})}function q(e,a,u){a=t(a);var r,c,s,l=o(a),d=i(a);function m(t,i){t?u(t):p===l?u(new T.EBUSY(null,a)):n(i).has(l)?(r=(s=i)[l].id,e.getObject(r,E)):u(new T.ENOENT(null,a))}function E(n,t){n?u(n):t.type!==f?u(new T.ENOTDIR(null,a)):(r=t,e.getObject(r.data,w))}function w(t,i){t?u(t):n(i).size()>0?u(new T.ENOTEMPTY(null,a)):(delete s[l],e.putObject(c.data,s,g))}function g(n){if(n)u(n);else{var t=Date.now();S(e,d,c,{mtime:t,ctime:t},b)}}function b(n){n?u(n):e.delete(r.id,O)}function O(n){n?u(n):e.delete(r.data,u)}k(e,d,function(n,t){n?u(n):(c=t,e.getObject(c.data,m))})}function z(e,a,u,r){a=t(a);var l,d,m,w,v,N=o(a),h=i(a),I=0;function A(n,t){n?r(n):t.type!==f?r(new T.ENOENT(null,a)):(l=t,e.getObject(l.data,y))}function y(t,i){t?r(t):n(d=i).has(N)?n(u).contains(O)?r(new T.ENOENT("O_CREATE and O_EXCLUSIVE are set, and the named file exists",a)):(m=d[N]).type===f&&n(u).contains(g)?r(new T.EISDIR("the named file is a directory and O_WRITE is set",a)):e.getObject(m.id,D):n(u).contains(b)?_.create({guid:e.guid,type:c},function(n,t){n?r(n):((w=t).nlinks+=1,e.putObject(w.id,w,R))}):r(new T.ENOENT("O_CREATE is not set and the named file does not exist",a))}function D(c,f){if(c)r(c);else{var l=f;l.type===s?++I>E?r(new T.ELOOP(null,a)):function(c){c=t(c),h=i(c),N=o(c),p===N&&(n(u).contains(g)?r(new T.EISDIR("the named file is a directory and O_WRITE is set",a)):k(e,a,L));k(e,h,A)}(l.data):L(void 0,l)}}function L(n,e){n?r(n):r(null,w=e)}function R(n){n?r(n):((v=new F(0)).fill(0),e.putBuffer(w.data,v,B))}function V(n){if(n)r(n);else{var t=Date.now();S(e,h,l,{mtime:t,ctime:t},x)}}function B(n){n?r(n):(d[N]=new j(w.id,c),e.putObject(l.data,d,V))}function x(n){n?r(n):r(null,w)}p===N?n(u).contains(g)?r(new T.EISDIR("the named file is a directory and O_WRITE is set",a)):k(e,a,L):k(e,h,A)}function Y(n,e,t,i,o,a){var u;function r(n){n?a(n):a(null,o)}function c(t){if(t)a(t);else{var i=Date.now();S(n,e.path,u,{mtime:i,ctime:i},r)}}function f(e){e?a(e):n.putObject(u.id,u,c)}n.getObject(e.id,function(r,c){if(r)a(r);else{u=c;var s=new F(o);s.fill(0),t.copy(s,0,i,i+o),e.position=o,u.size=o,u.version+=1,n.putBuffer(u.data,s,f)}})}function U(n,e,t,i,o,a,u){var r,c;function f(n){n?u(n):u(null,o)}function s(t){if(t)u(t);else{var i=Date.now();S(n,e.path,r,{mtime:i,ctime:i},f)}}function l(e){e?u(e):n.putObject(r.id,r,s)}function d(f,s){if(f)u(f);else{if(!(c=s))return u(new T.EIO("Expected Buffer"));var d=null!=a?a:e.position,p=Math.max(c.length,d+o),m=new F(p);m.fill(0),c&&c.copy(m),t.copy(m,d,i,i+o),void 0===a&&(e.position+=o),r.size=p,r.version+=1,n.putBuffer(r.data,m,l)}}n.getObject(e.id,function(e,t){e?u(e):(r=t,n.getBuffer(r.data,d))})}function W(n,e,t,i,o,a,u){var r,c;function s(n,r){if(n)u(n);else{if(!(c=r))return u(new T.EIO("Expected Buffer"));var f=null!=a?a:e.position;o=f+o>t.length?o-f:o,c.copy(t,i,f,f+o),void 0===a&&(e.position+=o),u(null,o)}}n.getObject(e.id,function(t,i){t?u(t):i.type===f?u(new T.EISDIR("the named file is a directory",e.path)):(r=i,n.getBuffer(r.data,s))})}function G(n,e,i){k(n,e=t(e),i)}function K(n,e,t){e.getNode(n,t)}function $(e,a,u){a=t(a);var r,c,f=o(a),s=i(a);function l(t,i){t?u(t):n(c=i).has(f)?e.getObject(c[f].id,u):u(new T.ENOENT("a component of the path does not name an existing file",a))}p===f?k(e,a,u):k(e,s,function(n,t){n?u(n):(r=t,e.getObject(r.data,l))})}function H(e,a,u,r){a=t(a);var c=o(a),s=i(a);u=t(u);var l,d,p,m,E,w,g=o(u),b=i(u),O=Date.now();function v(n){n?r(n):S(e,u,w,{ctime:O},r)}function N(n,t){n?r(n):((w=t).nlinks+=1,e.putObject(w.id,w,v))}function h(n){n?r(n):e.getObject(E,N)}function I(t,i){t?r(t):n(m=i).has(g)?r(new T.EEXIST("newpath resolves to an existing file",g)):(m[g]=d[c],E=m[g].id,e.putObject(p.data,m,h))}function A(n,t){n?r(n):(p=t,e.getObject(p.data,I))}function y(t,i){t?r(t):n(d=i).has(c)?d[c].type===f?r(new T.EPERM("oldpath refers to a directory")):k(e,b,A):r(new T.ENOENT("a component of either path prefix does not exist",c))}k(e,s,function(n,t){n?r(n):(l=t,e.getObject(l.data,y))})}function J(e,a,u){a=t(a);var r,c,s,l=o(a),d=i(a);function p(n){n?u(n):(delete c[l],e.putObject(r.data,c,function(n){if(n)u(n);else{var t=Date.now();S(e,d,r,{mtime:t,ctime:t},u)}}))}function m(n){n?u(n):e.delete(s.data,p)}function E(n,t){n?u(n):t.type===f?u(new T.EPERM("unlink not permitted on directories",l)):function(n,t){n?u(n):((s=t).nlinks-=1,s.nlinks<1?e.delete(s.id,m):e.putObject(s.id,s,function(n){n?u(n):S(e,a,s,{ctime:Date.now()},p)}))}(null,t)}function w(t,i){t?u(t):n(c=i).has(l)?e.getObject(c[l].id,E):u(new T.ENOENT("a component of the path does not name an existing file",l))}k(e,d,function(n,t){n?u(n):(r=t,e.getObject(r.data,w))})}function Q(n,e,i){var o,a;function u(n,e){if(n)i(n);else{a=e;var t=Object.keys(a);i(null,t)}}e=t(e),k(n,e,function(t,a){t?i(t):a.type!==f?i(new T.ENOTDIR(null,e)):(o=a,n.getObject(o.data,u))})}function Z(u,r,c,f){c=t(c);var l,d,m,E=o(c),w=i(c);function g(t,i){t?f(t):n(d=i).has(E)?f(new T.EEXIST(null,E)):_.create({guid:u.guid,type:s},function(n,t){n?f(n):((m=t).nlinks+=1,a(r)||(m.symlink_relpath=r,r=e.resolve(w,r)),m.size=r.length,m.data=r,u.putObject(m.id,m,O))})}function b(n){if(n)f(n);else{var e=Date.now();S(u,w,l,{mtime:e,ctime:e},f)}}function O(n){n?f(n):(d[E]=new j(m.id,s),u.putObject(l.data,d,b))}p===E?f(new T.EEXIST(null,E)):k(u,w,function(n,e){n?f(n):(l=e,u.getObject(l.data,g))})}function nn(e,a,u){a=t(a);var r,c,f=o(a),l=i(a);function d(t,i){t?u(t):n(c=i).has(f)?e.getObject(c[f].id,p):u(new T.ENOENT("a component of the path does not name an existing file",f))}function p(n,e){if(n)u(n);else if(e.type!==s)u(new T.EINVAL("path not a symbolic link",a));else{var t=e.symlink_relpath?e.symlink_relpath:e.data;u(null,t)}}k(e,l,function(n,t){n?u(n):(r=t,e.getObject(r.data,d))})}function en(n,e,i,o){var a;function u(e,t){if(e)o(e);else{if(!t)return o(new T.EIO("Expected Buffer"));try{x(i,"len")}catch(e){return o(e)}var u=new F(i);u.fill(0),t&&t.copy(u),n.putBuffer(a.data,u,c)}}function r(t){if(t)o(t);else{var i=Date.now();S(n,e,a,{mtime:i,ctime:i},o)}}function c(e){e?o(e):(a.size=i,a.version+=1,n.putObject(a.id,a,r))}e=t(e),i<0?o(new T.EINVAL("length cannot be negative")):k(n,e,function(t,i){t?o(t):i.type===f?o(new T.EISDIR(null,e)):(a=i,n.getBuffer(a.data,u))})}function tn(n,e,t,i){var o;function a(e,a){if(e)i(e);else{var u;if(!a)return i(new T.EIO("Expected Buffer"));a?u=a.slice(0,t):(u=new F(t)).fill(0),n.putBuffer(o.data,u,r)}}function u(t){if(t)i(t);else{var a=Date.now();S(n,e.path,o,{mtime:a,ctime:a},i)}}function r(e){e?i(e):(o.size=t,o.version+=1,n.putObject(o.id,o,u))}t<0?i(new T.EINVAL("length cannot be negative")):e.getNode(n,function(e,t){e?i(e):t.type===f?i(new T.EISDIR):(o=t,n.getBuffer(o.data,a))})}function on(n,e,i,o,a){e=t(e),"number"!=typeof i||"number"!=typeof o?a(new T.EINVAL("atime and mtime must be number",e)):i<0||o<0?a(new T.EINVAL("atime and mtime must be positive integers",e)):k(n,e,function(t,u){t?a(t):S(n,e,u,{atime:i,ctime:o,mtime:o},a)})}function an(n,e,t,i,o){"number"!=typeof t||"number"!=typeof i?o(new T.EINVAL("atime and mtime must be a number")):t<0||i<0?o(new T.EINVAL("atime and mtime must be positive integers")):e.getNode(n,function(a,u){a?o(a):S(n,e.path,u,{atime:t,ctime:i,mtime:i},o)})}function un(n,e,i,o,a,u){e=t(e),"string"!=typeof i?u(new T.EINVAL("attribute name must be a string",e)):i?null!==a&&a!==h&&a!==I?u(new T.EINVAL("invalid flag, must be null, XATTR_CREATE or XATTR_REPLACE",e)):k(n,e,function(t,r){if(t)return u(t);C(n,e,r,i,o,a,u)}):u(new T.EINVAL("attribute name cannot be an empty string",e))}function rn(n,e,t,i,o,a){"string"!=typeof t?a(new T.EINVAL("attribute name must be a string")):t?null!==o&&o!==h&&o!==I?a(new T.EINVAL("invalid flag, must be null, XATTR_CREATE or XATTR_REPLACE")):e.getNode(n,function(u,r){if(u)return a(u);C(n,e.path,r,t,i,o,a)}):a(new T.EINVAL("attribute name cannot be an empty string"))}function cn(n,e,i,o){e=t(e),"string"!=typeof i?o(new T.EINVAL("attribute name must be a string",e)):i?k(n,e,function(n,t){if(n)return o(n);var a=t.xattrs;a.hasOwnProperty(i)?o(null,a[i]):o(new T.ENOATTR(null,e))}):o(new T.EINVAL("attribute name cannot be an empty string",e))}function fn(n,e,t,i){"string"!=typeof t?i(new T.EINVAL):t?e.getNode(n,function(n,e){if(n)return i(n);var o=e.xattrs;o.hasOwnProperty(t)?i(null,o[t]):i(new T.ENOATTR)}):i(new T.EINVAL("attribute name cannot be an empty string"))}function sn(n,e,i,o){e=t(e),"string"!=typeof i?o(new T.EINVAL("attribute name must be a string",e)):i?k(n,e,function(t,a){if(t)return o(t);var u=a.xattrs;u.hasOwnProperty(i)?(delete u[i],n.putObject(a.id,a,function(t){t?o(t):S(n,e,a,{ctime:Date.now()},o)})):o(new T.ENOATTR(null,e))}):o(new T.EINVAL("attribute name cannot be an empty string",e))}function ln(n,e,t,i){"string"!=typeof t?i(new T.EINVAL("attribute name must be a string")):t?e.getNode(n,function(o,a){if(o)return i(o);var u=a.xattrs;u.hasOwnProperty(t)?(delete u[t],n.putObject(a.id,a,function(t){t?i(t):S(n,e.path,a,{ctime:Date.now()},i)})):i(new T.ENOATTR)}):i(new T.EINVAL("attribute name cannot be an empty string"))}function dn(e){return n(N).has(e)?N[e]:null}function pn(n,e,t){return n?"function"==typeof n?n={encoding:e,flag:t}:"string"==typeof n&&(n={encoding:n,flag:t}):n={encoding:e,flag:t},n}function mn(n,e,t){var i;return"function"==typeof e&&(t=e,e=!1),n?u(n)?i=new T.EINVAL("Path must be a string without null bytes.",n):e||a(n)||(i=new T.EINVAL("Path must be absolute.",n)):i=new T.EINVAL("Path must be a string",n),!i||(t(i),!1)}function En(e,t,i,o,a,u){u=arguments[arguments.length-1],mn(i,u)&&((o=dn(o))||u(new T.EINVAL("flags is not valid"),i),z(t,i,o,function(t,a){if(t)u(t);else{var r;r=n(o).contains(v)?a.size:0;var c=new L(i,a.id,o,r),f=e.allocDescriptor(c);u(null,f)}}))}function wn(e,t,i,o){n(e.openFiles).has(i)?(e.releaseDescriptor(i),o(null)):o(new T.EBADF)}function gn(n,e,t,i,o){mn(t,o)&&P(e,t,i,o)}function bn(n,e,t,i,o){if(arguments.length<5)o=i,i=d;else if(!(i=Vn(i,d,o)))return;mn(t,o)&&M(e,t,o)}function On(n,e,t,i){mn(t,i)&&q(e,t,i)}function vn(n,e,t,i){mn(t,i)&&G(e,t,function(e,o){if(e)i(e);else{var a=new V(t,o,n.name);i(null,a)}})}function Nn(n,e,t,i){var o=n.openFiles[t];o?K(e,o,function(e,t){if(e)i(e);else{var a=new V(o.path,t,n.name);i(null,a)}}):i(new T.EBADF)}function hn(n,e,t,i,o){mn(t,o)&&mn(i,o)&&H(e,t,i,o)}function In(n,e,t,i){mn(t,i)&&J(e,t,i)}function An(e,t,i,o,a,u,r,c){a=void 0===a?0:a,u=void 0===u?o.length-a:u,c=arguments[arguments.length-1];var f=e.openFiles[i];f?n(f.flags).contains(w)?W(t,f,o,a,u,r,function(n,e){c(n,e||0,o)}):c(new T.EBADF("descriptor does not permit reading")):c(new T.EBADF)}function yn(n,e,t,i,o){if(o=arguments[arguments.length-1],i=pn(i,null,"r"),mn(t,o)){var a=dn(i.flag||"r");if(!a)return o(new T.EINVAL("flags is not valid",t));z(e,t,a,function(u,r){if(u)return o(u);var c=new L(t,r.id,a,0),f=n.allocDescriptor(c);function s(){n.releaseDescriptor(f)}K(e,c,function(a,u){if(a)return s(),o(a);var r=new V(c.path,u,n.name);if(r.isDirectory())return s(),o(new T.EISDIR("illegal operation on directory",t));var f=r.size,l=new F(f);l.fill(0),W(e,c,l,0,f,0,function(n){if(s(),n)return o(n);var e;e="utf8"===i.encoding?D.decode(l):l,o(null,e)})})})}}function Dn(e,t,i,o,a,u,r,c){c=arguments[arguments.length-1],a=void 0===a?0:a,u=void 0===u?o.length-a:u;var f=e.openFiles[i];f?n(f.flags).contains(g)?o.length-a<u?c(new T.EIO("intput buffer is too small")):U(t,f,o,a,u,r,c):c(new T.EBADF("descriptor does not permit writing")):c(new T.EBADF)}function Tn(n,e,t,i,o,a){if(a=arguments[arguments.length-1],o=pn(o,"utf8","w"),mn(t,a)){var u=dn(o.flag||"w");if(!u)return a(new T.EINVAL("flags is not valid",t));"number"==typeof(i=i||"")&&(i=""+i),"string"==typeof i&&"utf8"===o.encoding&&(i=D.encode(i)),z(e,t,u,function(o,r){if(o)return a(o);var c=new L(t,r.id,u,0),f=n.allocDescriptor(c);Y(e,c,i,0,i.length,function(e){if(n.releaseDescriptor(f),e)return a(e);a(null)})})}}function jn(n,e,t,i,o,a){if(a=arguments[arguments.length-1],o=pn(o,"utf8","a"),mn(t,a)){var u=dn(o.flag||"a");if(!u)return a(new T.EINVAL("flags is not valid",t));"number"==typeof(i=i||"")&&(i=""+i),"string"==typeof i&&"utf8"===o.encoding&&(i=D.encode(i)),z(e,t,u,function(o,r){if(o)return a(o);var c=new L(t,r.id,u,r.size),f=n.allocDescriptor(c);U(e,c,i,0,i.length,c.position,function(e){if(n.releaseDescriptor(f),e)return a(e);a(null)})})}}function Ln(n,e,t,i){console.warn("This method is deprecated. For more details see https://nodejs.org/api/fs.html#fs_fs_exists_path_callback"),vn(n,e,t,function(n){i(!n)})}var Rn=/^[0-7]+$/;function _n(n){return n===n>>>0}function Vn(n,e,t){return"function"==typeof e&&(t=e,e=void 0),_n(n)?n&d:"number"==typeof n?(Number.isInteger(n),t(new T.EINVAL("mode not a valid an integer value",n)),!1):"string"==typeof n?Rn.test(n)?parseInt(n,8)&d:(t(new T.EINVAL("mode not a valid octal string",n)),!1):void 0!==e?e:(t(new T.EINVAL("mode not valid",n)),!1)}function Fn(n,e,i,o){e=t(e),"number"!=typeof i?o(new T.EINVAL("mode must be number",e)):k(n,e,function(t,a){t?o(t):(_.setMode(i,a),S(n,e,a,{mtime:Date.now()},o))})}function Bn(n,e,t,i){"number"!=typeof t?i(new T.EINVAL("mode must be a number")):e.getNode(n,function(o,a){o?i(o):(a.mode=t,S(n,e.path,a,{mtime:Date.now()},i))})}function xn(n,e,i,o,a){e=t(e),k(n,e,function(t,u){t?a(t):(u.uid=i,u.gid=o,S(n,e,u,{mtime:Date.now()},a))})}function Sn(n,e,t,i,o){e.getNode(n,function(a,u){a?o(a):(u.uid=t,u.gid=i,S(n,e.path,u,{mtime:Date.now()},o))})}function Pn(n,e,t,i,o){mn(t,o)&&cn(e,t,i,o)}function kn(n,e,t,i,o){var a=n.openFiles[t];a?fn(e,a,i,o):o(new T.EBADF)}function Cn(n,e,t,i,o,a,u){"function"==typeof a&&(u=a,a=null),mn(t,u)&&un(e,t,i,o,a,u)}function Xn(e,t,i,o,a,u,r){"function"==typeof u&&(r=u,u=null);var c=e.openFiles[i];c?n(c.flags).contains(g)?rn(t,c,o,a,u,r):r(new T.EBADF("descriptor does not permit writing")):r(new T.EBADF)}function Mn(n,e,t,i,o){mn(t,o)&&sn(e,t,i,o)}function qn(e,t,i,o,a){var u=e.openFiles[i];u?n(u.flags).contains(g)?ln(t,u,o,a):a(new T.EBADF("descriptor does not permit writing")):a(new T.EBADF)}function zn(n,e,t,i,o,a){var u=n.openFiles[t];u||a(new T.EBADF),"SET"===o?i<0?a(new T.EINVAL("resulting file offset would be negative")):(u.position=i,a(null,u.position)):"CUR"===o?u.position+i<0?a(new T.EINVAL("resulting file offset would be negative")):(u.position+=i,a(null,u.position)):"END"===o?K(e,u,function(n,e){n?a(n):e.size+i<0?a(new T.EINVAL("resulting file offset would be negative")):(u.position=e.size+i,a(null,u.position))}):a(new T.EINVAL("whence argument is not a proper value"))}function Yn(n,e,t,i){mn(t,i)&&Q(e,t,i)}function Un(n,e,t,i,o,a){if(mn(t,a)){var u=Date.now();on(e,t,i=i||u,o=o||u,a)}}function Wn(e,t,i,o,a,u){var r=Date.now();o=o||r,a=a||r;var c=e.openFiles[i];c?n(c.flags).contains(g)?an(t,c,o,a,u):u(new T.EBADF("descriptor does not permit writing")):u(new T.EBADF)}function Gn(n,e,t,i,o){mn(t,o)&&(i=Vn(i,"mode"))&&Fn(e,t,i,o)}function Kn(e,t,i,o,a){if(o=Vn(o,"mode")){var u=e.openFiles[i];u?n(u.flags).contains(g)?Bn(t,u,o,a):a(new T.EBADF("descriptor does not permit writing")):a(new T.EBADF)}}function $n(n,e,t,i,o,a){if(mn(t,a))return _n(i)?_n(o)?void xn(e,t,i,o,a):a(new T.EINVAL("gid must be a valid integer",o)):a(new T.EINVAL("uid must be a valid integer",i))}function Hn(e,t,i,o,a,u){if(!_n(o))return u(new T.EINVAL("uid must be a valid integer",o));if(!_n(a))return u(new T.EINVAL("gid must be a valid integer",a));var r=e.openFiles[i];r?n(r.flags).contains(g)?Sn(t,r,o,a,u):u(new T.EBADF("descriptor does not permit writing")):u(new T.EBADF)}function Jn(i,o,a,u,r){if(mn(a,r)&&mn(u,r)){a=t(a),u=t(u);var c,s,l,d,p=e.dirname(a),m=e.dirname(a),E=e.basename(a),w=e.basename(u),g=Date.now();k(o,a,function(n,e){n?r(n):e.type===f?k(o,p,y):H(o,a,u,D)})}function b(n,e){n?r(n):S(o,u,e,{ctime:g},r)}function O(n){n?r(n):o.getObject(d[w].id,b)}function v(n){n?r(n):(c.id===l.id&&(s=d),delete s[E],o.putObject(c.data,s,O))}function N(n){n?r(n):(d[w]=s[E],o.putObject(l.data,d,v))}function h(e,t){e?r(e):n(d=t).has(w)?q(o,u,N):N()}function I(n,e){n?r(n):(l=e,o.getObject(l.data,h))}function A(n,e){n?r(n):(s=e,k(o,m,I))}function y(n,e){n?r(n):(c=e,o.getObject(e.data,A))}function D(n){n?r(n):J(o,a,r)}}function Qn(n,e,t,i,o,a){mn(t,!0,a=arguments[arguments.length-1])&&mn(i,a)&&Z(e,t,i,a)}function Zn(n,e,t,i){mn(t,i)&&nn(e,t,i)}function ne(n,e,t,i){mn(t,i)&&$(e,t,function(e,o){if(e)i(e);else{var a=new V(t,o,n.name);i(null,a)}})}function ee(n,e,t,i,o){i=i||0,mn(t,o=arguments[arguments.length-1])&&en(e,t,i,o)}function te(e,t,i,o,a){a=arguments[arguments.length-1],o=o||0;var u=e.openFiles[i];u?n(u.flags).contains(g)?tn(t,u,o,a):a(new T.EBADF("descriptor does not permit writing")):a(new T.EBADF)}module.exports={ensureRootDirectory:X,open:En,chmod:Gn,fchmod:Kn,chown:$n,fchown:Hn,close:wn,mknod:gn,mkdir:bn,rmdir:On,unlink:In,stat:vn,fstat:Nn,link:hn,read:An,readFile:yn,write:Dn,writeFile:Tn,appendFile:jn,exists:Ln,getxattr:Pn,fgetxattr:kn,setxattr:Cn,fsetxattr:Xn,removexattr:Mn,fremovexattr:qn,lseek:zn,readdir:Yn,utimes:Un,futimes:Wn,rename:Jn,symlink:Qn,readlink:Zn,lstat:ne,truncate:ee,ftruncate:te};
|
|
},{"../../lib/nodash.js":"96cB","../path.js":"UzoP","../constants.js":"iJA9","../encoding.js":"03yF","../errors.js":"p8GN","../directory-entry.js":"ZECt","../open-file-description.js":"XWaV","../super-node.js":"33JE","../node.js":"KKNo","../stats.js":"6dsC","../buffer.js":"xfwq","../shared.js":"3zBM"}],"GMi4":[function(require,module,exports) {
|
|
var e=require("../../lib/nodash.js"),t=require("es6-promisify"),r=t.promisify,n=require("../path.js").isNull,i=require("../shared.js").nop,o=require("../constants.js"),a=o.FILE_SYSTEM_NAME,u=o.FS_FORMAT,s=o.FS_READY,c=o.FS_PENDING,l=o.FS_ERROR,f=o.FS_NODUPEIDCHECK,d=require("../providers/index.js"),p=require("../shell/shell.js"),h=require("../../lib/intercom.js"),v=require("../fs-watcher.js"),m=require("../errors.js"),y=require("../shared.js").guid,R=o.STDIN,g=o.STDOUT,E=o.STDERR,S=o.FIRST_DESCRIPTOR,w=require("./implementation.js");function x(e){return"function"==typeof e?e:function(e){if(e)throw e}}function F(e){e&&console.error("Filer error: ",e)}function q(t,j){j=j||F;var D=(t=t||{}).flags,O=t.guid?t.guid:y,b=t.provider||new d.Default(t.name||a),C=t.name||b.name,T=e(D).contains(u),I=this;I.readyState=c,I.name=C,I.error=null,I.stdin=R,I.stdout=g,I.stderr=E,I.constants=o.fsConstants,this.Shell=p.bind(void 0,this);var k={},_=S;Object.defineProperty(this,"openFiles",{get:function(){return k}}),this.allocDescriptor=function(e){var t=_++;return k[t]=e,t},this.releaseDescriptor=function(e){delete k[e]};var N=[];function M(t){return function(r){e(D).contains(f)?r(null,O()):function e(r){var n=O();t.getObject(n,function(t,i){t?r(t):i?e(r):r(null,n)})}(r)}}this.queueOrRun=function(e){var t;return s==I.readyState?e.call(I):l==I.readyState?t=new m.EFILESYSTEMERROR("unknown error"):N.push(e),t},this.watch=function(e,t,r){if(n(e))throw new Error("Path must be a string without null bytes.");"function"==typeof t&&(r=t,t={}),t=t||{},r=r||i;var o=new v;return o.start(e,!1,t.recursive),o.on("change",r),o},b.open(function(e){function t(e){function t(e){var t=b[e]();return t.flags=D,t.changes=[],t.guid=M(t),t.close=function(){var e=t.changes;!function(e){if(e.length){var t=h.getInstance();e.forEach(function(e){t.emit(e.event,e.path)})}}(e),e.length=0},t}I.provider={openReadWriteContext:function(){return t("getReadWriteContext")},openReadOnlyContext:function(){return t("getReadOnlyContext")}},I.readyState=e?l:s,N.forEach(function(e){e.call(this)}.bind(I)),N=null,j(e,I)}if(e)return t(e);var r=b.getReadWriteContext();r.guid=M(r),T?r.clear(function(e){if(e)return t(e);w.ensureRootDirectory(r,t)}):w.ensureRootDirectory(r,t)}),q.prototype.promises={},["open","chmod","fchmod","chown","fchown","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){q.prototype[e]=function(){var t=this,r=Array.prototype.slice.call(arguments,0),n=r.length-1,i="function"!=typeof r[n],o=x(r[n]),a=t.queueOrRun(function(){var a=t.provider.openReadWriteContext();if(l===t.readyState){var u=new m.EFILESYSTEMERROR("filesystem unavailable, operation canceled");return o.call(t,u)}function s(){a.close(),o.apply(t,arguments)}i?r.push(s):r[n]=s;var c=[t,a].concat(r);w[e].apply(null,c)});a&&o(a)},q.prototype.promises[e]=r(q.prototype[e].bind(I))})}q.providers=d,module.exports=q;
|
|
},{"../../lib/nodash.js":"96cB","es6-promisify":"0c0E","../path.js":"UzoP","../shared.js":"3zBM","../constants.js":"iJA9","../providers/index.js":"AiW7","../shell/shell.js":"D1Ra","../../lib/intercom.js":"u7Jv","../fs-watcher.js":"VLEe","../errors.js":"p8GN","./implementation.js":"bsBG"}],"Focm":[function(require,module,exports) {
|
|
module.exports={FileSystem:require("./filesystem/interface.js"),Buffer:require("./buffer.js"),Path:require("./path.js"),Errors:require("./errors.js"),Shell:require("./shell/shell.js")};
|
|
},{"./filesystem/interface.js":"GMi4","./buffer.js":"xfwq","./path.js":"UzoP","./errors.js":"p8GN","./shell/shell.js":"D1Ra"}]},{},["Focm"], "Filer")
|
|
//# sourceMappingURL=/filer.min.map
|