@modern-js/utils 2.0.0-beta.1 → 2.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,23 +8,25 @@ export interface MatchPath {
8
8
  }
9
9
  /**
10
10
  * Creates a function that can resolve paths according to tsconfig paths property.
11
+ *
11
12
  * @param absoluteBaseUrl Absolute version of baseUrl as specified in tsconfig.
12
13
  * @param paths The paths as specified in tsconfig.
13
- * @param mainFields A list of package.json field names to try when resolving module files.
14
+ * @param mainFields A list of package.json field names to try when resolving module files. Select a nested field using an array of field names.
14
15
  * @param addMatchAll Add a match-all "*" rule if none is present
15
16
  * @returns a function that can resolve paths.
16
17
  */
17
18
  export declare function createMatchPath(absoluteBaseUrl: string, paths: {
18
19
  [key: string]: Array<string>;
19
- }, mainFields?: string[], addMatchAll?: boolean): MatchPath;
20
+ }, mainFields?: (string | string[])[], addMatchAll?: boolean): MatchPath;
20
21
  /**
21
22
  * Finds a path from tsconfig that matches a module load request.
23
+ *
22
24
  * @param absolutePathMappings The paths to try as specified in tsconfig but resolved to absolute form.
23
25
  * @param requestedModule The required module name.
24
26
  * @param readJson Function that can read json from a path (useful for testing).
25
27
  * @param fileExists Function that checks for existence of a file at a path (useful for testing).
26
28
  * @param extensions File extensions to probe for (useful for testing).
27
- * @param mainFields A list of package.json field names to try when resolving module files.
29
+ * @param mainFields A list of package.json field names to try when resolving module files. Select a nested field using an array of field names.
28
30
  * @returns the found path, or undefined if no path was found.
29
31
  */
30
- export declare function matchFromAbsolutePaths(absolutePathMappings: ReadonlyArray<MappingEntry.MappingEntry>, requestedModule: string, readJson?: Filesystem.ReadJsonSync, fileExists?: Filesystem.FileExistsSync, extensions?: Array<string>, mainFields?: string[]): string | undefined;
32
+ export declare function matchFromAbsolutePaths(absolutePathMappings: ReadonlyArray<MappingEntry.MappingEntry>, requestedModule: string, readJson?: Filesystem.ReadJsonSync, fileExists?: Filesystem.FileExistsSync, extensions?: Array<string>, mainFields?: (string | string[])[]): string | undefined;
@@ -1,6 +1,12 @@
1
1
  import { ExplicitParams } from "./config-loader";
2
+ export interface RegisterParams extends ExplicitParams {
3
+ /**
4
+ * Defaults to `--project` CLI flag or `process.cwd()`
5
+ */
6
+ cwd?: string;
7
+ }
2
8
  /**
3
9
  * Installs a custom module load function that can adhere to paths in tsconfig.
4
10
  * Returns a function to undo paths registration.
5
11
  */
6
- export declare function register(explicitParams: ExplicitParams): () => void;
12
+ export declare function register(params?: RegisterParams): () => void;
@@ -24,5 +24,5 @@ export interface TsConfigLoaderParams {
24
24
  loadSync?(cwd: string, filename?: string, baseUrl?: string): TsConfigLoaderResult;
25
25
  }
26
26
  export declare function tsConfigLoader({ getEnv, cwd, loadSync, }: TsConfigLoaderParams): TsConfigLoaderResult;
27
- export declare function walkForTsConfig(directory: string, existsSync?: (path: string) => boolean): string | undefined;
27
+ export declare function walkForTsConfig(directory: string, readdirSync?: (path: string) => string[]): string | undefined;
28
28
  export declare function loadTsconfig(configFilePath: string, existsSync?: (path: string) => boolean, readFileSync?: (filename: string) => string): Tsconfig | undefined;
@@ -1 +1 @@
1
- {"name":"tsconfig-paths","author":"Jonas Kello","version":"3.14.1","license":"MIT","types":"lib/index.d.ts"}
1
+ {"name":"tsconfig-paths","author":"Jonas Kello","version":"4.1.1","license":"MIT","types":"lib/index.d.ts"}
@@ -1,7 +1,7 @@
1
- (()=>{var e={689:(e,t)=>{"use strict";var r;r={value:true};t.Z4=unixify;r=correctPath;var n=process.platform==="win32";function removeTrailingSeparator(e){var t=e.length-1;if(t<2){return e}while(isSeparator(e,t)){t--}return e.substr(0,t+1)}function isSeparator(e,t){var r=e[t];return t>0&&(r==="/"||n&&r==="\\")}function normalizePath(e,t){if(typeof e!=="string"){throw new TypeError("expected a string")}e=e.replace(/[\\\/]+/g,"/");if(t!==false){e=removeTrailingSeparator(e)}return e}function unixify(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;if(n){e=normalizePath(e,t);return e.replace(/^([a-zA-Z]+:|\.\/)/,"")}return e}function correctPath(e){return unixify(e.replace(/^\\\\\?\\.:\\/,"\\"))}},766:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.fsAsyncMethods=t.fsSyncMethods=t.fsProps=void 0;var r=["constants","F_OK","R_OK","W_OK","X_OK","Stats"];t.fsProps=r;var n=["renameSync","ftruncateSync","truncateSync","chownSync","fchownSync","lchownSync","chmodSync","fchmodSync","lchmodSync","statSync","lstatSync","fstatSync","linkSync","symlinkSync","readlinkSync","realpathSync","unlinkSync","rmdirSync","mkdirSync","mkdirpSync","readdirSync","closeSync","openSync","utimesSync","futimesSync","fsyncSync","writeSync","readSync","readFileSync","writeFileSync","appendFileSync","existsSync","accessSync","fdatasyncSync","mkdtempSync","copyFileSync","createReadStream","createWriteStream"];t.fsSyncMethods=n;var i=["rename","ftruncate","truncate","chown","fchown","lchown","chmod","fchmod","lchmod","stat","lstat","fstat","link","symlink","readlink","realpath","unlink","rmdir","mkdir","mkdirp","readdir","close","open","utimes","futimes","fsync","write","read","readFile","writeFile","appendFile","exists","access","fdatasync","mkdtemp","copyFile","watchFile","unwatchFile","watch"];t.fsAsyncMethods=i},367:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Dirent=void 0;var n=r(935);var i=r(51);var o=n.constants.S_IFMT,s=n.constants.S_IFDIR,a=n.constants.S_IFREG,c=n.constants.S_IFBLK,u=n.constants.S_IFCHR,f=n.constants.S_IFLNK,l=n.constants.S_IFIFO,p=n.constants.S_IFSOCK;var d=function(){function Dirent(){this.name="";this.mode=0}Dirent.build=function(e,t){var r=new Dirent;var n=e.getNode().mode;r.name=(0,i.strToEncoding)(e.getName(),t);r.mode=n;return r};Dirent.prototype._checkModeProperty=function(e){return(this.mode&o)===e};Dirent.prototype.isDirectory=function(){return this._checkModeProperty(s)};Dirent.prototype.isFile=function(){return this._checkModeProperty(a)};Dirent.prototype.isBlockDevice=function(){return this._checkModeProperty(c)};Dirent.prototype.isCharacterDevice=function(){return this._checkModeProperty(u)};Dirent.prototype.isSymbolicLink=function(){return this._checkModeProperty(f)};Dirent.prototype.isFIFO=function(){return this._checkModeProperty(l)};Dirent.prototype.isSocket=function(){return this._checkModeProperty(p)};return Dirent}();t.Dirent=d;t["default"]=d},803:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Stats=void 0;var n=r(935);var i=r(221);var o=n.constants.S_IFMT,s=n.constants.S_IFDIR,a=n.constants.S_IFREG,c=n.constants.S_IFBLK,u=n.constants.S_IFCHR,f=n.constants.S_IFLNK,l=n.constants.S_IFIFO,p=n.constants.S_IFSOCK;var d=function(){function Stats(){}Stats.build=function(e,t){if(t===void 0){t=false}var r=new Stats;var n=e.uid,o=e.gid,s=e.atime,a=e.mtime,c=e.ctime;var u=!t?function(e){return e}:i.default;r.uid=u(n);r.gid=u(o);r.rdev=u(0);r.blksize=u(4096);r.ino=u(e.ino);r.size=u(e.getSize());r.blocks=u(1);r.atime=s;r.mtime=a;r.ctime=c;r.birthtime=c;r.atimeMs=u(s.getTime());r.mtimeMs=u(a.getTime());var f=u(c.getTime());r.ctimeMs=f;r.birthtimeMs=f;r.dev=u(0);r.mode=u(e.mode);r.nlink=u(e.nlink);return r};Stats.prototype._checkModeProperty=function(e){return(Number(this.mode)&o)===e};Stats.prototype.isDirectory=function(){return this._checkModeProperty(s)};Stats.prototype.isFile=function(){return this._checkModeProperty(a)};Stats.prototype.isBlockDevice=function(){return this._checkModeProperty(c)};Stats.prototype.isCharacterDevice=function(){return this._checkModeProperty(u)};Stats.prototype.isSymbolicLink=function(){return this._checkModeProperty(f)};Stats.prototype.isFIFO=function(){return this._checkModeProperty(l)};Stats.prototype.isSocket=function(){return this._checkModeProperty(p)};return Stats}();t.Stats=d;t["default"]=d},935:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.constants=void 0;t.constants={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:64,O_EXCL:128,O_NOCTTY:256,O_TRUNC:512,O_APPEND:1024,O_DIRECTORY:65536,O_NOATIME:262144,O_NOFOLLOW:131072,O_SYNC:1052672,O_DIRECT:16384,O_NONBLOCK:2048,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_SYMLINK_DIR:1,UV_FS_SYMLINK_JUNCTION:2,UV_FS_COPYFILE_EXCL:1,UV_FS_COPYFILE_FICLONE:2,UV_FS_COPYFILE_FICLONE_FORCE:4,COPYFILE_EXCL:1,COPYFILE_FICLONE:2,COPYFILE_FICLONE_FORCE:4}},51:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.strToEncoding=t.assertEncoding=t.ENCODING_UTF8=void 0;var n=r(162);var i=r(204);t.ENCODING_UTF8="utf8";function assertEncoding(e){if(e&&!n.Buffer.isEncoding(e))throw new i.TypeError("ERR_INVALID_OPT_VALUE_ENCODING",e)}t.assertEncoding=assertEncoding;function strToEncoding(e,r){if(!r||r===t.ENCODING_UTF8)return e;if(r==="buffer")return new n.Buffer(e);return new n.Buffer(e).toString(r)}t.strToEncoding=strToEncoding},221:(e,t)=>{if(typeof BigInt==="function")t["default"]=BigInt;else t["default"]=function BigIntNotSupported(){throw new Error("BigInt is not supported in this environment.")}},265:function(e,t,r){"use strict";var n=this&&this.__assign||function(){n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i))e[i]=t[i]}return e};return n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:true});t.fs=t.createFsFromVolume=t.vol=t.Volume=void 0;var i=r(803);var o=r(367);var s=r(545);var a=r(766),c=a.fsSyncMethods,u=a.fsAsyncMethods;var f=r(935);var l=f.constants.F_OK,p=f.constants.R_OK,d=f.constants.W_OK,h=f.constants.X_OK;t.Volume=s.Volume;t.vol=new s.Volume;function createFsFromVolume(e){var t={F_OK:l,R_OK:p,W_OK:d,X_OK:h,constants:f.constants,Stats:i.default,Dirent:o.default};for(var r=0,n=c;r<n.length;r++){var a=n[r];if(typeof e[a]==="function")t[a]=e[a].bind(e)}for(var m=0,y=u;m<y.length;m++){var a=y[m];if(typeof e[a]==="function")t[a]=e[a].bind(e)}t.StatWatcher=e.StatWatcher;t.FSWatcher=e.FSWatcher;t.WriteStream=e.WriteStream;t.ReadStream=e.ReadStream;t.promises=e.promises;t._toUnixTimestamp=s.toUnixTimestamp;return t}t.createFsFromVolume=createFsFromVolume;t.fs=createFsFromVolume(t.vol);e.exports=n(n({},e.exports),t.fs);e.exports.semantic=true},162:function(e,t,r){"use strict";var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++){if(o||!(n in t)){if(!o)o=Array.prototype.slice.call(t,0,n);o[n]=t[n]}}return e.concat(o||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.bufferFrom=t.bufferAllocUnsafe=t.Buffer=void 0;var i=r(300);Object.defineProperty(t,"Buffer",{enumerable:true,get:function(){return i.Buffer}});function bufferV0P12Ponyfill(e){var t=[];for(var r=1;r<arguments.length;r++){t[r-1]=arguments[r]}return new(i.Buffer.bind.apply(i.Buffer,n([void 0,e],t,false)))}var o=i.Buffer.allocUnsafe||bufferV0P12Ponyfill;t.bufferAllocUnsafe=o;var s=i.Buffer.from||bufferV0P12Ponyfill;t.bufferFrom=s},204:function(e,t,r){"use strict";var n=this&&this.__extends||function(){var extendStatics=function(e,t){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))e[r]=t[r]};return extendStatics(e,t)};return function(e,t){if(typeof t!=="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");extendStatics(e,t);function __(){this.constructor=e}e.prototype=t===null?Object.create(t):(__.prototype=t.prototype,new __)}}();Object.defineProperty(t,"__esModule",{value:true});t.E=t.AssertionError=t.message=t.RangeError=t.TypeError=t.Error=void 0;var i=r(491);var o=r(837);var s=typeof Symbol==="undefined"?"_kCode":Symbol("code");var a={};function makeNodeError(e){return function(e){n(NodeError,e);function NodeError(t){var r=[];for(var n=1;n<arguments.length;n++){r[n-1]=arguments[n]}var i=e.call(this,message(t,r))||this;i.code=t;i[s]=t;i.name="".concat(e.prototype.name," [").concat(i[s],"]");return i}return NodeError}(e)}var c=typeof globalThis!=="undefined"?globalThis:global;var u=function(e){n(AssertionError,e);function AssertionError(r){var n=this;if(typeof r!=="object"||r===null){throw new t.TypeError("ERR_INVALID_ARG_TYPE","options","object")}if(r.message){n=e.call(this,r.message)||this}else{n=e.call(this,"".concat(o.inspect(r.actual).slice(0,128)," ")+"".concat(r.operator," ").concat(o.inspect(r.expected).slice(0,128)))||this}n.generatedMessage=!r.message;n.name="AssertionError [ERR_ASSERTION]";n.code="ERR_ASSERTION";n.actual=r.actual;n.expected=r.expected;n.operator=r.operator;t.Error.captureStackTrace(n,r.stackStartFunction);return n}return AssertionError}(c.Error);t.AssertionError=u;function message(e,t){i.strictEqual(typeof e,"string");var r=a[e];i(r,"An invalid error message key was used: ".concat(e,"."));var n;if(typeof r==="function"){n=r}else{n=o.format;if(t===undefined||t.length===0)return r;t.unshift(r)}return String(n.apply(null,t))}t.message=message;function E(e,t){a[e]=typeof t==="function"?t:String(t)}t.E=E;t.Error=makeNodeError(c.Error);t.TypeError=makeNodeError(c.TypeError);t.RangeError=makeNodeError(c.RangeError);E("ERR_ARG_NOT_ITERABLE","%s must be iterable");E("ERR_ASSERTION","%s");E("ERR_BUFFER_OUT_OF_BOUNDS",bufferOutOfBounds);E("ERR_CHILD_CLOSED_BEFORE_REPLY","Child closed before reply received");E("ERR_CONSOLE_WRITABLE_STREAM","Console expects a writable stream instance for %s");E("ERR_CPU_USAGE","Unable to obtain cpu usage %s");E("ERR_DNS_SET_SERVERS_FAILED",(function(e,t){return'c-ares failed to set servers: "'.concat(e,'" [').concat(t,"]")}));E("ERR_FALSY_VALUE_REJECTION","Promise was rejected with falsy value");E("ERR_ENCODING_NOT_SUPPORTED",(function(e){return'The "'.concat(e,'" encoding is not supported')}));E("ERR_ENCODING_INVALID_ENCODED_DATA",(function(e){return"The encoded data was not valid for encoding ".concat(e)}));E("ERR_HTTP_HEADERS_SENT","Cannot render headers after they are sent to the client");E("ERR_HTTP_INVALID_STATUS_CODE","Invalid status code: %s");E("ERR_HTTP_TRAILER_INVALID","Trailers are invalid with this transfer encoding");E("ERR_INDEX_OUT_OF_RANGE","Index out of range");E("ERR_INVALID_ARG_TYPE",invalidArgType);E("ERR_INVALID_ARRAY_LENGTH",(function(e,t,r){i.strictEqual(typeof r,"number");return'The array "'.concat(e,'" (length ').concat(r,") must be of length ").concat(t,".")}));E("ERR_INVALID_BUFFER_SIZE","Buffer size must be a multiple of %s");E("ERR_INVALID_CALLBACK","Callback must be a function");E("ERR_INVALID_CHAR","Invalid character in %s");E("ERR_INVALID_CURSOR_POS","Cannot set cursor row without setting its column");E("ERR_INVALID_FD",'"fd" must be a positive integer: %s');E("ERR_INVALID_FILE_URL_HOST",'File URL host must be "localhost" or empty on %s');E("ERR_INVALID_FILE_URL_PATH","File URL path %s");E("ERR_INVALID_HANDLE_TYPE","This handle type cannot be sent");E("ERR_INVALID_IP_ADDRESS","Invalid IP address: %s");E("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'.concat(String(t),'" is invalid for option "').concat(e,'"')}));E("ERR_INVALID_OPT_VALUE_ENCODING",(function(e){return'The value "'.concat(String(e),'" is invalid for option "encoding"')}));E("ERR_INVALID_REPL_EVAL_CONFIG",'Cannot specify both "breakEvalOnSigint" and "eval" for REPL');E("ERR_INVALID_SYNC_FORK_INPUT","Asynchronous forks do not support Buffer, Uint8Array or string input: %s");E("ERR_INVALID_THIS",'Value of "this" must be of type %s');E("ERR_INVALID_TUPLE","%s must be an iterable %s tuple");E("ERR_INVALID_URL","Invalid URL: %s");E("ERR_INVALID_URL_SCHEME",(function(e){return"The URL must be ".concat(oneOf(e,"scheme"))}));E("ERR_IPC_CHANNEL_CLOSED","Channel closed");E("ERR_IPC_DISCONNECTED","IPC channel is already disconnected");E("ERR_IPC_ONE_PIPE","Child process can have only one IPC pipe");E("ERR_IPC_SYNC_FORK","IPC cannot be used with synchronous forks");E("ERR_MISSING_ARGS",missingArgs);E("ERR_MULTIPLE_CALLBACK","Callback called multiple times");E("ERR_NAPI_CONS_FUNCTION","Constructor must be a function");E("ERR_NAPI_CONS_PROTOTYPE_OBJECT","Constructor.prototype must be an object");E("ERR_NO_CRYPTO","Node.js is not compiled with OpenSSL crypto support");E("ERR_NO_LONGER_SUPPORTED","%s is no longer supported");E("ERR_PARSE_HISTORY_DATA","Could not parse history data in %s");E("ERR_SOCKET_ALREADY_BOUND","Socket is already bound");E("ERR_SOCKET_BAD_PORT","Port should be > 0 and < 65536");E("ERR_SOCKET_BAD_TYPE","Bad socket type specified. Valid types are: udp4, udp6");E("ERR_SOCKET_CANNOT_SEND","Unable to send data");E("ERR_SOCKET_CLOSED","Socket is closed");E("ERR_SOCKET_DGRAM_NOT_RUNNING","Not running");E("ERR_STDERR_CLOSE","process.stderr cannot be closed");E("ERR_STDOUT_CLOSE","process.stdout cannot be closed");E("ERR_STREAM_WRAP","Stream has StringDecoder set or is in objectMode");E("ERR_TLS_CERT_ALTNAME_INVALID","Hostname/IP does not match certificate's altnames: %s");E("ERR_TLS_DH_PARAM_SIZE",(function(e){return"DH parameter size ".concat(e," is less than 2048")}));E("ERR_TLS_HANDSHAKE_TIMEOUT","TLS handshake timeout");E("ERR_TLS_RENEGOTIATION_FAILED","Failed to renegotiate");E("ERR_TLS_REQUIRED_SERVER_NAME",'"servername" is required parameter for Server.addContext');E("ERR_TLS_SESSION_ATTACK","TSL session renegotiation attack detected");E("ERR_TRANSFORM_ALREADY_TRANSFORMING","Calling transform done when still transforming");E("ERR_TRANSFORM_WITH_LENGTH_0","Calling transform done when writableState.length != 0");E("ERR_UNKNOWN_ENCODING","Unknown encoding: %s");E("ERR_UNKNOWN_SIGNAL","Unknown signal: %s");E("ERR_UNKNOWN_STDIN_TYPE","Unknown stdin file type");E("ERR_UNKNOWN_STREAM_TYPE","Unknown stream file type");E("ERR_V8BREAKITERATOR","Full ICU data not installed. "+"See https://github.com/nodejs/node/wiki/Intl");function invalidArgType(e,t,r){i(e,"name is required");var n;if(t.includes("not ")){n="must not be";t=t.split("not ")[1]}else{n="must be"}var o;if(Array.isArray(e)){var s=e.map((function(e){return'"'.concat(e,'"')})).join(", ");o="The ".concat(s," arguments ").concat(n," ").concat(oneOf(t,"type"))}else if(e.includes(" argument")){o="The ".concat(e," ").concat(n," ").concat(oneOf(t,"type"))}else{var a=e.includes(".")?"property":"argument";o='The "'.concat(e,'" ').concat(a," ").concat(n," ").concat(oneOf(t,"type"))}if(arguments.length>=3){o+=". Received type ".concat(r!==null?typeof r:"null")}return o}function missingArgs(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}i(e.length>0,"At least one arg needs to be specified");var r="The ";var n=e.length;e=e.map((function(e){return'"'.concat(e,'"')}));switch(n){case 1:r+="".concat(e[0]," argument");break;case 2:r+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:r+=e.slice(0,n-1).join(", ");r+=", and ".concat(e[n-1]," arguments");break}return"".concat(r," must be specified")}function oneOf(e,t){i(e,"expected is required");i(typeof t==="string","thing is required");if(Array.isArray(e)){var r=e.length;i(r>0,"At least one expected value needs to be specified");e=e.map((function(e){return String(e)}));if(r>2){return"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]}else if(r===2){return"one of ".concat(t," ").concat(e[0]," or ").concat(e[1])}else{return"of ".concat(t," ").concat(e[0])}}else{return"of ".concat(t," ").concat(String(e))}}function bufferOutOfBounds(e,t){if(t){return"Attempt to write outside buffer bounds"}else{return'"'.concat(e,'" is outside of buffer bounds')}}},536:function(e,t,r){"use strict";var n=this&&this.__extends||function(){var extendStatics=function(e,t){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))e[r]=t[r]};return extendStatics(e,t)};return function(e,t){if(typeof t!=="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");extendStatics(e,t);function __(){this.constructor=e}e.prototype=t===null?Object.create(t):(__.prototype=t.prototype,new __)}}();Object.defineProperty(t,"__esModule",{value:true});t.File=t.Link=t.Node=t.SEP=void 0;var i=r(73);var o=r(162);var s=r(935);var a=r(361);var c=r(803);var u=s.constants.S_IFMT,f=s.constants.S_IFDIR,l=s.constants.S_IFREG,p=s.constants.S_IFLNK,d=s.constants.O_APPEND;var getuid=function(){var e,t;return(t=(e=i.default.getuid)===null||e===void 0?void 0:e.call(i.default))!==null&&t!==void 0?t:0};var getgid=function(){var e,t;return(t=(e=i.default.getgid)===null||e===void 0?void 0:e.call(i.default))!==null&&t!==void 0?t:0};t.SEP="/";var h=function(e){n(Node,e);function Node(t,r){if(r===void 0){r=438}var n=e.call(this)||this;n.uid=getuid();n.gid=getgid();n.atime=new Date;n.mtime=new Date;n.ctime=new Date;n.perm=438;n.mode=l;n.nlink=1;n.perm=r;n.mode|=r;n.ino=t;return n}Node.prototype.getString=function(e){if(e===void 0){e="utf8"}return this.getBuffer().toString(e)};Node.prototype.setString=function(e){this.buf=(0,o.bufferFrom)(e,"utf8");this.touch()};Node.prototype.getBuffer=function(){if(!this.buf)this.setBuffer((0,o.bufferAllocUnsafe)(0));return(0,o.bufferFrom)(this.buf)};Node.prototype.setBuffer=function(e){this.buf=(0,o.bufferFrom)(e);this.touch()};Node.prototype.getSize=function(){return this.buf?this.buf.length:0};Node.prototype.setModeProperty=function(e){this.mode=this.mode&~u|e};Node.prototype.setIsFile=function(){this.setModeProperty(l)};Node.prototype.setIsDirectory=function(){this.setModeProperty(f)};Node.prototype.setIsSymlink=function(){this.setModeProperty(p)};Node.prototype.isFile=function(){return(this.mode&u)===l};Node.prototype.isDirectory=function(){return(this.mode&u)===f};Node.prototype.isSymlink=function(){return(this.mode&u)===p};Node.prototype.makeSymlink=function(e){this.symlink=e;this.setIsSymlink()};Node.prototype.write=function(e,t,r,n){if(t===void 0){t=0}if(r===void 0){r=e.length}if(n===void 0){n=0}if(!this.buf)this.buf=(0,o.bufferAllocUnsafe)(0);if(n+r>this.buf.length){var i=(0,o.bufferAllocUnsafe)(n+r);this.buf.copy(i,0,0,this.buf.length);this.buf=i}e.copy(this.buf,n,t,t+r);this.touch();return r};Node.prototype.read=function(e,t,r,n){if(t===void 0){t=0}if(r===void 0){r=e.byteLength}if(n===void 0){n=0}if(!this.buf)this.buf=(0,o.bufferAllocUnsafe)(0);var i=r;if(i>e.byteLength){i=e.byteLength}if(i+n>this.buf.length){i=this.buf.length-n}this.buf.copy(e,t,n,n+i);return i};Node.prototype.truncate=function(e){if(e===void 0){e=0}if(!e)this.buf=(0,o.bufferAllocUnsafe)(0);else{if(!this.buf)this.buf=(0,o.bufferAllocUnsafe)(0);if(e<=this.buf.length){this.buf=this.buf.slice(0,e)}else{var t=(0,o.bufferAllocUnsafe)(0);this.buf.copy(t);t.fill(0,e)}}this.touch()};Node.prototype.chmod=function(e){this.perm=e;this.mode=this.mode&~511|e;this.touch()};Node.prototype.chown=function(e,t){this.uid=e;this.gid=t;this.touch()};Node.prototype.touch=function(){this.mtime=new Date;this.emit("change",this)};Node.prototype.canRead=function(e,t){if(e===void 0){e=getuid()}if(t===void 0){t=getgid()}if(this.perm&4){return true}if(t===this.gid){if(this.perm&32){return true}}if(e===this.uid){if(this.perm&256){return true}}return false};Node.prototype.canWrite=function(e,t){if(e===void 0){e=getuid()}if(t===void 0){t=getgid()}if(this.perm&2){return true}if(t===this.gid){if(this.perm&16){return true}}if(e===this.uid){if(this.perm&128){return true}}return false};Node.prototype.del=function(){this.emit("delete",this)};Node.prototype.toJSON=function(){return{ino:this.ino,uid:this.uid,gid:this.gid,atime:this.atime.getTime(),mtime:this.mtime.getTime(),ctime:this.ctime.getTime(),perm:this.perm,mode:this.mode,nlink:this.nlink,symlink:this.symlink,data:this.getString()}};return Node}(a.EventEmitter);t.Node=h;var m=function(e){n(Link,e);function Link(t,r,n){var i=e.call(this)||this;i.children={};i._steps=[];i.ino=0;i.length=0;i.vol=t;i.parent=r;i.name=n;i.syncSteps();return i}Object.defineProperty(Link.prototype,"steps",{get:function(){return this._steps},set:function(e){this._steps=e;for(var t=0,r=Object.values(this.children);t<r.length;t++){var n=r[t];n===null||n===void 0?void 0:n.syncSteps()}},enumerable:false,configurable:true});Link.prototype.setNode=function(e){this.node=e;this.ino=e.ino};Link.prototype.getNode=function(){return this.node};Link.prototype.createChild=function(e,t){if(t===void 0){t=this.vol.createNode()}var r=new Link(this.vol,this,e);r.setNode(t);if(t.isDirectory()){}this.setChild(e,r);return r};Link.prototype.setChild=function(e,t){if(t===void 0){t=new Link(this.vol,this,e)}this.children[e]=t;t.parent=this;this.length++;this.emit("child:add",t,this);return t};Link.prototype.deleteChild=function(e){delete this.children[e.getName()];this.length--;this.emit("child:delete",e,this)};Link.prototype.getChild=function(e){if(Object.hasOwnProperty.call(this.children,e)){return this.children[e]}};Link.prototype.getPath=function(){return this.steps.join(t.SEP)};Link.prototype.getName=function(){return this.steps[this.steps.length-1]};Link.prototype.walk=function(e,t,r){if(t===void 0){t=e.length}if(r===void 0){r=0}if(r>=e.length)return this;if(r>=t)return this;var n=e[r];var i=this.getChild(n);if(!i)return null;return i.walk(e,t,r+1)};Link.prototype.toJSON=function(){return{steps:this.steps,ino:this.ino,children:Object.keys(this.children)}};Link.prototype.syncSteps=function(){this.steps=this.parent?this.parent.steps.concat([this.name]):[this.name]};return Link}(a.EventEmitter);t.Link=m;var y=function(){function File(e,t,r,n){this.position=0;this.link=e;this.node=t;this.flags=r;this.fd=n}File.prototype.getString=function(e){if(e===void 0){e="utf8"}return this.node.getString()};File.prototype.setString=function(e){this.node.setString(e)};File.prototype.getBuffer=function(){return this.node.getBuffer()};File.prototype.setBuffer=function(e){this.node.setBuffer(e)};File.prototype.getSize=function(){return this.node.getSize()};File.prototype.truncate=function(e){this.node.truncate(e)};File.prototype.seekTo=function(e){this.position=e};File.prototype.stats=function(){return c.default.build(this.node)};File.prototype.write=function(e,t,r,n){if(t===void 0){t=0}if(r===void 0){r=e.length}if(typeof n!=="number")n=this.position;if(this.flags&d)n=this.getSize();var i=this.node.write(e,t,r,n);this.position=n+i;return i};File.prototype.read=function(e,t,r,n){if(t===void 0){t=0}if(r===void 0){r=e.byteLength}if(typeof n!=="number")n=this.position;var i=this.node.read(e,t,r,n);this.position=n+i;return i};File.prototype.chmod=function(e){this.node.chmod(e)};File.prototype.chown=function(e,t){this.node.chown(e,t)};return File}();t.File=y},73:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createProcess=void 0;var maybeReturnProcess=function(){if(typeof process!=="undefined"){return process}try{return r(282)}catch(e){return undefined}};function createProcess(){var e=maybeReturnProcess()||{};if(!e.cwd)e.cwd=function(){return"/"};if(!e.nextTick)e.nextTick=r(515)["default"];if(!e.emitWarning)e.emitWarning=function(e,t){console.warn("".concat(t).concat(t?": ":"").concat(e))};if(!e.env)e.env={};return e}t.createProcess=createProcess;t["default"]=createProcess()},858:function(e,t){"use strict";var r=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++){if(o||!(n in t)){if(!o)o=Array.prototype.slice.call(t,0,n);o[n]=t[n]}}return e.concat(o||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.FileHandle=void 0;function promisify(e,t,n){if(n===void 0){n=function(e){return e}}return function(){var i=[];for(var o=0;o<arguments.length;o++){i[o]=arguments[o]}return new Promise((function(o,s){e[t].bind(e).apply(void 0,r(r([],i,false),[function(e,t){if(e)return s(e);return o(n(t))}],false))}))}}var n=function(){function FileHandle(e,t){this.vol=e;this.fd=t}FileHandle.prototype.appendFile=function(e,t){return promisify(this.vol,"appendFile")(this.fd,e,t)};FileHandle.prototype.chmod=function(e){return promisify(this.vol,"fchmod")(this.fd,e)};FileHandle.prototype.chown=function(e,t){return promisify(this.vol,"fchown")(this.fd,e,t)};FileHandle.prototype.close=function(){return promisify(this.vol,"close")(this.fd)};FileHandle.prototype.datasync=function(){return promisify(this.vol,"fdatasync")(this.fd)};FileHandle.prototype.read=function(e,t,r,n){return promisify(this.vol,"read",(function(t){return{bytesRead:t,buffer:e}}))(this.fd,e,t,r,n)};FileHandle.prototype.readFile=function(e){return promisify(this.vol,"readFile")(this.fd,e)};FileHandle.prototype.stat=function(e){return promisify(this.vol,"fstat")(this.fd,e)};FileHandle.prototype.sync=function(){return promisify(this.vol,"fsync")(this.fd)};FileHandle.prototype.truncate=function(e){return promisify(this.vol,"ftruncate")(this.fd,e)};FileHandle.prototype.utimes=function(e,t){return promisify(this.vol,"futimes")(this.fd,e,t)};FileHandle.prototype.write=function(e,t,r,n){return promisify(this.vol,"write",(function(t){return{bytesWritten:t,buffer:e}}))(this.fd,e,t,r,n)};FileHandle.prototype.writeFile=function(e,t){return promisify(this.vol,"writeFile")(this.fd,e,t)};return FileHandle}();t.FileHandle=n;function createPromisesApi(e){if(typeof Promise==="undefined")return null;return{FileHandle:n,access:function(t,r){return promisify(e,"access")(t,r)},appendFile:function(t,r,i){return promisify(e,"appendFile")(t instanceof n?t.fd:t,r,i)},chmod:function(t,r){return promisify(e,"chmod")(t,r)},chown:function(t,r,n){return promisify(e,"chown")(t,r,n)},copyFile:function(t,r,n){return promisify(e,"copyFile")(t,r,n)},lchmod:function(t,r){return promisify(e,"lchmod")(t,r)},lchown:function(t,r,n){return promisify(e,"lchown")(t,r,n)},link:function(t,r){return promisify(e,"link")(t,r)},lstat:function(t,r){return promisify(e,"lstat")(t,r)},mkdir:function(t,r){return promisify(e,"mkdir")(t,r)},mkdtemp:function(t,r){return promisify(e,"mkdtemp")(t,r)},open:function(t,r,i){return promisify(e,"open",(function(t){return new n(e,t)}))(t,r,i)},readdir:function(t,r){return promisify(e,"readdir")(t,r)},readFile:function(t,r){return promisify(e,"readFile")(t instanceof n?t.fd:t,r)},readlink:function(t,r){return promisify(e,"readlink")(t,r)},realpath:function(t,r){return promisify(e,"realpath")(t,r)},rename:function(t,r){return promisify(e,"rename")(t,r)},rmdir:function(t){return promisify(e,"rmdir")(t)},rm:function(t,r){return promisify(e,"rm")(t,r)},stat:function(t,r){return promisify(e,"stat")(t,r)},symlink:function(t,r,n){return promisify(e,"symlink")(t,r,n)},truncate:function(t,r){return promisify(e,"truncate")(t,r)},unlink:function(t){return promisify(e,"unlink")(t)},utimes:function(t,r,n){return promisify(e,"utimes")(t,r,n)},writeFile:function(t,r,i){return promisify(e,"writeFile")(t instanceof n?t.fd:t,r,i)}}}t["default"]=createPromisesApi},515:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});var r;if(typeof setImmediate==="function")r=setImmediate.bind(typeof globalThis!=="undefined"?globalThis:global);else r=setTimeout.bind(typeof globalThis!=="undefined"?globalThis:global);t["default"]=r},728:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});function setTimeoutUnref(e,t,r){var n=setTimeout.apply(typeof globalThis!=="undefined"?globalThis:global,arguments);if(n&&typeof n==="object"&&typeof n.unref==="function")n.unref();return n}t["default"]=setTimeoutUnref},545:function(e,t,r){"use strict";var n=this&&this.__extends||function(){var extendStatics=function(e,t){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))e[r]=t[r]};return extendStatics(e,t)};return function(e,t){if(typeof t!=="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");extendStatics(e,t);function __(){this.constructor=e}e.prototype=t===null?Object.create(t):(__.prototype=t.prototype,new __)}}();var i=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++){if(o||!(n in t)){if(!o)o=Array.prototype.slice.call(t,0,n);o[n]=t[n]}}return e.concat(o||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.FSWatcher=t.StatWatcher=t.Volume=t.toUnixTimestamp=t.bufferToEncoding=t.dataToBuffer=t.dataToStr=t.pathToSteps=t.filenameToSteps=t.pathToFilename=t.flagsToNumber=t.FLAGS=void 0;var o=r(17);var s=r(536);var a=r(803);var c=r(367);var u=r(162);var f=r(515);var l=r(73);var p=r(728);var d=r(781);var h=r(935);var m=r(361);var y=r(51);var v=r(204);var g=r(837);var _=r(858);var b=o.resolve;var S=h.constants.O_RDONLY,w=h.constants.O_WRONLY,F=h.constants.O_RDWR,T=h.constants.O_CREAT,R=h.constants.O_EXCL,k=h.constants.O_TRUNC,N=h.constants.O_APPEND,O=h.constants.O_SYNC,B=h.constants.O_DIRECTORY,I=h.constants.F_OK,A=h.constants.COPYFILE_EXCL,C=h.constants.COPYFILE_FICLONE_FORCE;var L=o.posix?o.posix:o,V=L.sep,P=L.relative,D=L.join,x=L.dirname;var U=l.default.platform==="win32";var M=128;var W={PATH_STR:"path must be a string or Buffer",FD:"fd must be a file descriptor",MODE_INT:"mode must be an int",CB:"callback must be a function",UID:"uid must be an unsigned int",GID:"gid must be an unsigned int",LEN:"len must be an integer",ATIME:"atime must be an integer",MTIME:"mtime must be an integer",PREFIX:"filename prefix is required",BUFFER:"buffer must be an instance of Buffer or StaticBuffer",OFFSET:"offset must be an integer",LENGTH:"length must be an integer",POSITION:"position must be an integer"};var ERRSTR_OPTS=function(e){return"Expected options to be either an object or a string, but got ".concat(e," instead")};var H="ENOENT";var j="EBADF";var G="EINVAL";var K="EPERM";var Y="EPROTO";var q="EEXIST";var $="ENOTDIR";var J="EMFILE";var X="EACCES";var z="EISDIR";var Z="ENOTEMPTY";var Q="ENOSYS";var ee="ERR_FS_EISDIR";function formatError(e,t,r,n){if(t===void 0){t=""}if(r===void 0){r=""}if(n===void 0){n=""}var i="";if(r)i=" '".concat(r,"'");if(n)i+=" -> '".concat(n,"'");switch(e){case H:return"ENOENT: no such file or directory, ".concat(t).concat(i);case j:return"EBADF: bad file descriptor, ".concat(t).concat(i);case G:return"EINVAL: invalid argument, ".concat(t).concat(i);case K:return"EPERM: operation not permitted, ".concat(t).concat(i);case Y:return"EPROTO: protocol error, ".concat(t).concat(i);case q:return"EEXIST: file already exists, ".concat(t).concat(i);case $:return"ENOTDIR: not a directory, ".concat(t).concat(i);case z:return"EISDIR: illegal operation on a directory, ".concat(t).concat(i);case X:return"EACCES: permission denied, ".concat(t).concat(i);case Z:return"ENOTEMPTY: directory not empty, ".concat(t).concat(i);case J:return"EMFILE: too many open files, ".concat(t).concat(i);case Q:return"ENOSYS: function not implemented, ".concat(t).concat(i);case ee:return"[ERR_FS_EISDIR]: Path is a directory: ".concat(t," returned EISDIR (is a directory) ").concat(r);default:return"".concat(e,": error occurred, ").concat(t).concat(i)}}function createError(e,t,r,n,i){if(t===void 0){t=""}if(r===void 0){r=""}if(n===void 0){n=""}if(i===void 0){i=Error}var o=new i(formatError(e,t,r,n));o.code=e;return o}var te;(function(e){e[e["r"]=S]="r";e[e["r+"]=F]="r+";e[e["rs"]=S|O]="rs";e[e["sr"]=e.rs]="sr";e[e["rs+"]=F|O]="rs+";e[e["sr+"]=e["rs+"]]="sr+";e[e["w"]=w|T|k]="w";e[e["wx"]=w|T|k|R]="wx";e[e["xw"]=e.wx]="xw";e[e["w+"]=F|T|k]="w+";e[e["wx+"]=F|T|k|R]="wx+";e[e["xw+"]=e["wx+"]]="xw+";e[e["a"]=w|N|T]="a";e[e["ax"]=w|N|T|R]="ax";e[e["xa"]=e.ax]="xa";e[e["a+"]=F|N|T]="a+";e[e["ax+"]=F|N|T|R]="ax+";e[e["xa+"]=e["ax+"]]="xa+"})(te=t.FLAGS||(t.FLAGS={}));function flagsToNumber(e){if(typeof e==="number")return e;if(typeof e==="string"){var t=te[e];if(typeof t!=="undefined")return t}throw new v.TypeError("ERR_INVALID_OPT_VALUE","flags",e)}t.flagsToNumber=flagsToNumber;function getOptions(e,t){var r;if(!t)return e;else{var n=typeof t;switch(n){case"string":r=Object.assign({},e,{encoding:t});break;case"object":r=Object.assign({},e,t);break;default:throw TypeError(ERRSTR_OPTS(n))}}if(r.encoding!=="buffer")(0,y.assertEncoding)(r.encoding);return r}function optsGenerator(e){return function(t){return getOptions(e,t)}}function validateCallback(e){if(typeof e!=="function")throw TypeError(W.CB);return e}function optsAndCbGenerator(e){return function(t,r){return typeof t==="function"?[e(),t]:[e(t),validateCallback(r)]}}var re={encoding:"utf8"};var ne=optsGenerator(re);var ie=optsAndCbGenerator(ne);var oe={flag:"r"};var se=optsGenerator(oe);var ae={encoding:"utf8",mode:438,flag:te[te.w]};var ce=optsGenerator(ae);var ue={encoding:"utf8",mode:438,flag:te[te.a]};var fe=optsGenerator(ue);var le=optsAndCbGenerator(fe);var pe=re;var de=optsGenerator(pe);var he=optsAndCbGenerator(de);var me={mode:511,recursive:false};var getMkdirOptions=function(e){if(typeof e==="number")return Object.assign({},me,{mode:e});return Object.assign({},me,e)};var ye={recursive:false};var getRmdirOptions=function(e){return Object.assign({},ye,e)};var ve=optsGenerator(re);var ge=optsAndCbGenerator(ve);var _e={encoding:"utf8",withFileTypes:false};var be=optsGenerator(_e);var Se=optsAndCbGenerator(be);var Ee={bigint:false};var getStatOptions=function(e){if(e===void 0){e={}}return Object.assign({},Ee,e)};var getStatOptsAndCb=function(e,t){return typeof e==="function"?[getStatOptions(),e]:[getStatOptions(e),validateCallback(t)]};function getPathFromURLPosix(e){if(e.hostname!==""){throw new v.TypeError("ERR_INVALID_FILE_URL_HOST",l.default.platform)}var t=e.pathname;for(var r=0;r<t.length;r++){if(t[r]==="%"){var n=t.codePointAt(r+2)|32;if(t[r+1]==="2"&&n===102){throw new v.TypeError("ERR_INVALID_FILE_URL_PATH","must not include encoded / characters")}}}return decodeURIComponent(t)}function pathToFilename(e){if(typeof e!=="string"&&!u.Buffer.isBuffer(e)){try{if(!(e instanceof r(310).URL))throw new TypeError(W.PATH_STR)}catch(e){throw new TypeError(W.PATH_STR)}e=getPathFromURLPosix(e)}var t=String(e);nullCheck(t);return t}t.pathToFilename=pathToFilename;var resolve=function(e,t){if(t===void 0){t=l.default.cwd()}return b(t,e)};if(U){var we=resolve;var Fe=r(689).Z4;resolve=function(e,t){return Fe(we(e,t))}}function filenameToSteps(e,t){var r=resolve(e,t);var n=r.substr(1);if(!n)return[];return n.split(V)}t.filenameToSteps=filenameToSteps;function pathToSteps(e){return filenameToSteps(pathToFilename(e))}t.pathToSteps=pathToSteps;function dataToStr(e,t){if(t===void 0){t=y.ENCODING_UTF8}if(u.Buffer.isBuffer(e))return e.toString(t);else if(e instanceof Uint8Array)return(0,u.bufferFrom)(e).toString(t);else return String(e)}t.dataToStr=dataToStr;function dataToBuffer(e,t){if(t===void 0){t=y.ENCODING_UTF8}if(u.Buffer.isBuffer(e))return e;else if(e instanceof Uint8Array)return(0,u.bufferFrom)(e);else return(0,u.bufferFrom)(String(e),t)}t.dataToBuffer=dataToBuffer;function bufferToEncoding(e,t){if(!t||t==="buffer")return e;else return e.toString(t)}t.bufferToEncoding=bufferToEncoding;function nullCheck(e,t){if((""+e).indexOf("\0")!==-1){var r=new Error("Path must be a string without null bytes");r.code=H;if(typeof t!=="function")throw r;l.default.nextTick(t,r);return false}return true}function _modeToNumber(e,t){if(typeof e==="number")return e;if(typeof e==="string")return parseInt(e,8);if(t)return modeToNumber(t);return undefined}function modeToNumber(e,t){var r=_modeToNumber(e,t);if(typeof r!=="number"||isNaN(r))throw new TypeError(W.MODE_INT);return r}function isFd(e){return e>>>0===e}function validateFd(e){if(!isFd(e))throw TypeError(W.FD)}function toUnixTimestamp(e){if(typeof e==="string"&&+e==e){return+e}if(e instanceof Date){return e.getTime()/1e3}if(isFinite(e)){if(e<0){return Date.now()/1e3}return e}throw new Error("Cannot parse time: "+e)}t.toUnixTimestamp=toUnixTimestamp;function validateUid(e){if(typeof e!=="number")throw TypeError(W.UID)}function validateGid(e){if(typeof e!=="number")throw TypeError(W.GID)}function flattenJSON(e){var t={};function flatten(e,r){for(var n in r){var i=r[n];var o=D(e,n);if(typeof i==="string"){t[o]=i}else if(typeof i==="object"&&i!==null&&Object.keys(i).length>0){flatten(o,i)}else{t[o]=null}}}flatten("",e);return t}var Te=function(){function Volume(e){if(e===void 0){e={}}this.ino=0;this.inodes={};this.releasedInos=[];this.fds={};this.releasedFds=[];this.maxFiles=1e4;this.openFiles=0;this.promisesApi=(0,_.default)(this);this.statWatchers={};this.props=Object.assign({Node:s.Node,Link:s.Link,File:s.File},e);var t=this.createLink();t.setNode(this.createNode(true));var r=this;this.StatWatcher=function(e){n(StatWatcher,e);function StatWatcher(){return e.call(this,r)||this}return StatWatcher}(Re);var o=FsReadStream;this.ReadStream=function(e){n(class_1,e);function class_1(){var t=[];for(var n=0;n<arguments.length;n++){t[n]=arguments[n]}return e.apply(this,i([r],t,false))||this}return class_1}(o);var a=FsWriteStream;this.WriteStream=function(e){n(class_2,e);function class_2(){var t=[];for(var n=0;n<arguments.length;n++){t[n]=arguments[n]}return e.apply(this,i([r],t,false))||this}return class_2}(a);this.FSWatcher=function(e){n(FSWatcher,e);function FSWatcher(){return e.call(this,r)||this}return FSWatcher}(Ne);this.root=t}Volume.fromJSON=function(e,t){var r=new Volume;r.fromJSON(e,t);return r};Volume.fromNestedJSON=function(e,t){var r=new Volume;r.fromNestedJSON(e,t);return r};Object.defineProperty(Volume.prototype,"promises",{get:function(){if(this.promisesApi===null)throw new Error("Promise is not supported in this environment.");return this.promisesApi},enumerable:false,configurable:true});Volume.prototype.createLink=function(e,t,r,n){if(r===void 0){r=false}if(!e){return new this.props.Link(this,null,"")}if(!t){throw new Error("createLink: name cannot be empty")}return e.createChild(t,this.createNode(r,n))};Volume.prototype.deleteLink=function(e){var t=e.parent;if(t){t.deleteChild(e);return true}return false};Volume.prototype.newInoNumber=function(){var e=this.releasedInos.pop();if(e)return e;else{this.ino=(this.ino+1)%4294967295;return this.ino}};Volume.prototype.newFdNumber=function(){var e=this.releasedFds.pop();return typeof e==="number"?e:Volume.fd--};Volume.prototype.createNode=function(e,t){if(e===void 0){e=false}var r=new this.props.Node(this.newInoNumber(),t);if(e)r.setIsDirectory();this.inodes[r.ino]=r;return r};Volume.prototype.getNode=function(e){return this.inodes[e]};Volume.prototype.deleteNode=function(e){e.del();delete this.inodes[e.ino];this.releasedInos.push(e.ino)};Volume.prototype.genRndStr=function(){var e=(Math.random()+1).toString(36).substr(2,6);if(e.length===6)return e;else return this.genRndStr()};Volume.prototype.getLink=function(e){return this.root.walk(e)};Volume.prototype.getLinkOrThrow=function(e,t){var r=filenameToSteps(e);var n=this.getLink(r);if(!n)throw createError(H,t,e);return n};Volume.prototype.getResolvedLink=function(e){var t=typeof e==="string"?filenameToSteps(e):e;var r=this.root;var n=0;while(n<t.length){var i=t[n];r=r.getChild(i);if(!r)return null;var o=r.getNode();if(o.isSymlink()){t=o.symlink.concat(t.slice(n+1));r=this.root;n=0;continue}n++}return r};Volume.prototype.getResolvedLinkOrThrow=function(e,t){var r=this.getResolvedLink(e);if(!r)throw createError(H,t,e);return r};Volume.prototype.resolveSymlinks=function(e){return this.getResolvedLink(e.steps.slice(1))};Volume.prototype.getLinkAsDirOrThrow=function(e,t){var r=this.getLinkOrThrow(e,t);if(!r.getNode().isDirectory())throw createError($,t,e);return r};Volume.prototype.getLinkParent=function(e){return this.root.walk(e,e.length-1)};Volume.prototype.getLinkParentAsDirOrThrow=function(e,t){var r=e instanceof Array?e:filenameToSteps(e);var n=this.getLinkParent(r);if(!n)throw createError(H,t,V+r.join(V));if(!n.getNode().isDirectory())throw createError($,t,V+r.join(V));return n};Volume.prototype.getFileByFd=function(e){return this.fds[String(e)]};Volume.prototype.getFileByFdOrThrow=function(e,t){if(!isFd(e))throw TypeError(W.FD);var r=this.getFileByFd(e);if(!r)throw createError(j,t);return r};Volume.prototype.wrapAsync=function(e,t,r){var n=this;validateCallback(r);(0,f.default)((function(){var i;try{i=e.apply(n,t)}catch(e){r(e);return}r(null,i)}))};Volume.prototype._toJSON=function(e,t,r){var n;if(e===void 0){e=this.root}if(t===void 0){t={}}var i=true;var o=e.children;if(e.getNode().isFile()){o=(n={},n[e.getName()]=e.parent.getChild(e.getName()),n);e=e.parent}for(var s in o){i=false;var a=e.getChild(s);if(!a){throw new Error("_toJSON: unexpected undefined")}var c=a.getNode();if(c.isFile()){var u=a.getPath();if(r)u=P(r,u);t[u]=c.getString()}else if(c.isDirectory()){this._toJSON(a,t,r)}}var f=e.getPath();if(r)f=P(r,f);if(f&&i){t[f]=null}return t};Volume.prototype.toJSON=function(e,t,r){if(t===void 0){t={}}if(r===void 0){r=false}var n=[];if(e){if(!(e instanceof Array))e=[e];for(var i=0,o=e;i<o.length;i++){var s=o[i];var a=pathToFilename(s);var c=this.getResolvedLink(a);if(!c)continue;n.push(c)}}else{n.push(this.root)}if(!n.length)return t;for(var u=0,f=n;u<f.length;u++){var c=f[u];this._toJSON(c,t,r?c.getPath():"")}return t};Volume.prototype.fromJSON=function(e,t){if(t===void 0){t=l.default.cwd()}for(var r in e){var n=e[r];r=resolve(r,t);if(typeof n==="string"){var i=x(r);this.mkdirpBase(i,511);this.writeFileSync(r,n)}else{this.mkdirpBase(r,511)}}};Volume.prototype.fromNestedJSON=function(e,t){this.fromJSON(flattenJSON(e),t)};Volume.prototype.reset=function(){this.ino=0;this.inodes={};this.releasedInos=[];this.fds={};this.releasedFds=[];this.openFiles=0;this.root=this.createLink();this.root.setNode(this.createNode(true))};Volume.prototype.mountSync=function(e,t){this.fromJSON(t,e)};Volume.prototype.openLink=function(e,t,r){if(r===void 0){r=true}if(this.openFiles>=this.maxFiles){throw createError(J,"open",e.getPath())}var n=e;if(r)n=this.resolveSymlinks(e);if(!n)throw createError(H,"open",e.getPath());var i=n.getNode();if(i.isDirectory()){if((t&(S|F|w))!==S)throw createError(z,"open",e.getPath())}else{if(t&B)throw createError($,"open",e.getPath())}if(!(t&w)){if(!i.canRead()){throw createError(X,"open",e.getPath())}}if(t&F){}var o=new this.props.File(e,i,t,this.newFdNumber());this.fds[o.fd]=o;this.openFiles++;if(t&k)o.truncate();return o};Volume.prototype.openFile=function(e,t,r,n){if(n===void 0){n=true}var i=filenameToSteps(e);var o=n?this.getResolvedLink(i):this.getLink(i);if(o&&t&R)throw createError(q,"open",e);if(!o&&t&T){var s=this.getResolvedLink(i.slice(0,i.length-1));if(!s)throw createError(H,"open",V+i.join(V));if(t&T&&typeof r==="number"){o=this.createLink(s,i[i.length-1],false,r)}}if(o)return this.openLink(o,t,n);throw createError(H,"open",e)};Volume.prototype.openBase=function(e,t,r,n){if(n===void 0){n=true}var i=this.openFile(e,t,r,n);if(!i)throw createError(H,"open",e);return i.fd};Volume.prototype.openSync=function(e,t,r){if(r===void 0){r=438}var n=modeToNumber(r);var i=pathToFilename(e);var o=flagsToNumber(t);return this.openBase(i,o,n)};Volume.prototype.open=function(e,t,r,n){var i=r;var o=n;if(typeof r==="function"){i=438;o=r}i=i||438;var s=modeToNumber(i);var a=pathToFilename(e);var c=flagsToNumber(t);this.wrapAsync(this.openBase,[a,c,s],o)};Volume.prototype.closeFile=function(e){if(!this.fds[e.fd])return;this.openFiles--;delete this.fds[e.fd];this.releasedFds.push(e.fd)};Volume.prototype.closeSync=function(e){validateFd(e);var t=this.getFileByFdOrThrow(e,"close");this.closeFile(t)};Volume.prototype.close=function(e,t){validateFd(e);this.wrapAsync(this.closeSync,[e],t)};Volume.prototype.openFileOrGetById=function(e,t,r){if(typeof e==="number"){var n=this.fds[e];if(!n)throw createError(H);return n}else{return this.openFile(pathToFilename(e),t,r)}};Volume.prototype.readBase=function(e,t,r,n,i){var o=this.getFileByFdOrThrow(e);return o.read(t,Number(r),Number(n),i)};Volume.prototype.readSync=function(e,t,r,n,i){validateFd(e);return this.readBase(e,t,r,n,i)};Volume.prototype.read=function(e,t,r,n,i,o){var s=this;validateCallback(o);if(n===0){return l.default.nextTick((function(){if(o)o(null,0,t)}))}(0,f.default)((function(){try{var a=s.readBase(e,t,r,n,i);o(null,a,t)}catch(e){o(e)}}))};Volume.prototype.readFileBase=function(e,t,r){var n;var i=typeof e==="number";var o=i&&isFd(e);var s;if(o)s=e;else{var a=pathToFilename(e);var c=filenameToSteps(a);var u=this.getResolvedLink(c);if(u){var f=u.getNode();if(f.isDirectory())throw createError(z,"open",u.getPath())}s=this.openSync(e,t)}try{n=bufferToEncoding(this.getFileByFdOrThrow(s).getBuffer(),r)}finally{if(!o){this.closeSync(s)}}return n};Volume.prototype.readFileSync=function(e,t){var r=se(t);var n=flagsToNumber(r.flag);return this.readFileBase(e,n,r.encoding)};Volume.prototype.readFile=function(e,t,r){var n=optsAndCbGenerator(se)(t,r),i=n[0],o=n[1];var s=flagsToNumber(i.flag);this.wrapAsync(this.readFileBase,[e,s,i.encoding],o)};Volume.prototype.writeBase=function(e,t,r,n,i){var o=this.getFileByFdOrThrow(e,"write");return o.write(t,r,n,i)};Volume.prototype.writeSync=function(e,t,r,n,i){validateFd(e);var o;var s;var a;var c;var u=typeof t!=="string";if(u){s=(r||0)|0;a=n;c=i}else{c=r;o=n}var f=dataToBuffer(t,o);if(u){if(typeof a==="undefined"){a=f.length}}else{s=0;a=f.length}return this.writeBase(e,f,s,a,c)};Volume.prototype.write=function(e,t,r,n,i,o){var s=this;validateFd(e);var a;var c;var u;var l;var p;var d=typeof t;var h=typeof r;var m=typeof n;var y=typeof i;if(d!=="string"){if(h==="function"){p=r}else if(m==="function"){a=r|0;p=n}else if(y==="function"){a=r|0;c=n;p=i}else{a=r|0;c=n;u=i;p=o}}else{if(h==="function"){p=r}else if(m==="function"){u=r;p=n}else if(y==="function"){u=r;l=n;p=i}}var v=dataToBuffer(t,l);if(d!=="string"){if(typeof c==="undefined")c=v.length}else{a=0;c=v.length}var g=validateCallback(p);(0,f.default)((function(){try{var r=s.writeBase(e,v,a,c,u);if(d!=="string"){g(null,r,v)}else{g(null,r,t)}}catch(e){g(e)}}))};Volume.prototype.writeFileBase=function(e,t,r,n){var i=typeof e==="number";var o;if(i)o=e;else{o=this.openBase(pathToFilename(e),r,n)}var s=0;var a=t.length;var c=r&N?undefined:0;try{while(a>0){var u=this.writeSync(o,t,s,a,c);s+=u;a-=u;if(c!==undefined)c+=u}}finally{if(!i)this.closeSync(o)}};Volume.prototype.writeFileSync=function(e,t,r){var n=ce(r);var i=flagsToNumber(n.flag);var o=modeToNumber(n.mode);var s=dataToBuffer(t,n.encoding);this.writeFileBase(e,s,i,o)};Volume.prototype.writeFile=function(e,t,r,n){var i=r;var o=n;if(typeof r==="function"){i=ae;o=r}var s=validateCallback(o);var a=ce(i);var c=flagsToNumber(a.flag);var u=modeToNumber(a.mode);var f=dataToBuffer(t,a.encoding);this.wrapAsync(this.writeFileBase,[e,f,c,u],s)};Volume.prototype.linkBase=function(e,t){var r=filenameToSteps(e);var n=this.getLink(r);if(!n)throw createError(H,"link",e,t);var i=filenameToSteps(t);var o=this.getLinkParent(i);if(!o)throw createError(H,"link",e,t);var s=i[i.length-1];if(o.getChild(s))throw createError(q,"link",e,t);var a=n.getNode();a.nlink++;o.createChild(s,a)};Volume.prototype.copyFileBase=function(e,t,r){var n=this.readFileSync(e);if(r&A){if(this.existsSync(t)){throw createError(q,"copyFile",e,t)}}if(r&C){throw createError(Q,"copyFile",e,t)}this.writeFileBase(t,n,te.w,438)};Volume.prototype.copyFileSync=function(e,t,r){var n=pathToFilename(e);var i=pathToFilename(t);return this.copyFileBase(n,i,(r||0)|0)};Volume.prototype.copyFile=function(e,t,r,n){var i=pathToFilename(e);var o=pathToFilename(t);var s;var a;if(typeof r==="function"){s=0;a=r}else{s=r;a=n}validateCallback(a);this.wrapAsync(this.copyFileBase,[i,o,s],a)};Volume.prototype.linkSync=function(e,t){var r=pathToFilename(e);var n=pathToFilename(t);this.linkBase(r,n)};Volume.prototype.link=function(e,t,r){var n=pathToFilename(e);var i=pathToFilename(t);this.wrapAsync(this.linkBase,[n,i],r)};Volume.prototype.unlinkBase=function(e){var t=filenameToSteps(e);var r=this.getLink(t);if(!r)throw createError(H,"unlink",e);if(r.length)throw Error("Dir not empty...");this.deleteLink(r);var n=r.getNode();n.nlink--;if(n.nlink<=0){this.deleteNode(n)}};Volume.prototype.unlinkSync=function(e){var t=pathToFilename(e);this.unlinkBase(t)};Volume.prototype.unlink=function(e,t){var r=pathToFilename(e);this.wrapAsync(this.unlinkBase,[r],t)};Volume.prototype.symlinkBase=function(e,t){var r=filenameToSteps(t);var n=this.getLinkParent(r);if(!n)throw createError(H,"symlink",e,t);var i=r[r.length-1];if(n.getChild(i))throw createError(q,"symlink",e,t);var o=n.createChild(i);o.getNode().makeSymlink(filenameToSteps(e));return o};Volume.prototype.symlinkSync=function(e,t,r){var n=pathToFilename(e);var i=pathToFilename(t);this.symlinkBase(n,i)};Volume.prototype.symlink=function(e,t,r,n){var i=validateCallback(typeof r==="function"?r:n);var o=pathToFilename(e);var s=pathToFilename(t);this.wrapAsync(this.symlinkBase,[o,s],i)};Volume.prototype.realpathBase=function(e,t){var r=filenameToSteps(e);var n=this.getResolvedLink(r);if(!n)throw createError(H,"realpath",e);return(0,y.strToEncoding)(n.getPath(),t)};Volume.prototype.realpathSync=function(e,t){return this.realpathBase(pathToFilename(e),de(t).encoding)};Volume.prototype.realpath=function(e,t,r){var n=he(t,r),i=n[0],o=n[1];var s=pathToFilename(e);this.wrapAsync(this.realpathBase,[s,i.encoding],o)};Volume.prototype.lstatBase=function(e,t,r){if(t===void 0){t=false}if(r===void 0){r=false}var n=this.getLink(filenameToSteps(e));if(n){return a.default.build(n.getNode(),t)}else if(!r){return undefined}else{throw createError(H,"lstat",e)}};Volume.prototype.lstatSync=function(e,t){var r=getStatOptions(t),n=r.throwIfNoEntry,i=n===void 0?true:n,o=r.bigint,s=o===void 0?false:o;return this.lstatBase(pathToFilename(e),s,i)};Volume.prototype.lstat=function(e,t,r){var n=getStatOptsAndCb(t,r),i=n[0],o=i.throwIfNoEntry,s=o===void 0?true:o,a=i.bigint,c=a===void 0?false:a,u=n[1];this.wrapAsync(this.lstatBase,[pathToFilename(e),c,s],u)};Volume.prototype.statBase=function(e,t,r){if(t===void 0){t=false}if(r===void 0){r=true}var n=this.getResolvedLink(filenameToSteps(e));if(n){return a.default.build(n.getNode(),t)}else if(!r){return undefined}else{throw createError(H,"stat",e)}};Volume.prototype.statSync=function(e,t){var r=getStatOptions(t),n=r.bigint,i=n===void 0?true:n,o=r.throwIfNoEntry,s=o===void 0?true:o;return this.statBase(pathToFilename(e),i,s)};Volume.prototype.stat=function(e,t,r){var n=getStatOptsAndCb(t,r),i=n[0],o=i.bigint,s=o===void 0?false:o,a=i.throwIfNoEntry,c=a===void 0?true:a,u=n[1];this.wrapAsync(this.statBase,[pathToFilename(e),s,c],u)};Volume.prototype.fstatBase=function(e,t){if(t===void 0){t=false}var r=this.getFileByFd(e);if(!r)throw createError(j,"fstat");return a.default.build(r.node,t)};Volume.prototype.fstatSync=function(e,t){return this.fstatBase(e,getStatOptions(t).bigint)};Volume.prototype.fstat=function(e,t,r){var n=getStatOptsAndCb(t,r),i=n[0],o=n[1];this.wrapAsync(this.fstatBase,[e,i.bigint],o)};Volume.prototype.renameBase=function(e,t){var r=this.getLink(filenameToSteps(e));if(!r)throw createError(H,"rename",e,t);var n=filenameToSteps(t);var o=this.getLinkParent(n);if(!o)throw createError(H,"rename",e,t);var s=r.parent;if(s){s.deleteChild(r)}var a=n[n.length-1];r.name=a;r.steps=i(i([],o.steps,true),[a],false);o.setChild(r.getName(),r)};Volume.prototype.renameSync=function(e,t){var r=pathToFilename(e);var n=pathToFilename(t);this.renameBase(r,n)};Volume.prototype.rename=function(e,t,r){var n=pathToFilename(e);var i=pathToFilename(t);this.wrapAsync(this.renameBase,[n,i],r)};Volume.prototype.existsBase=function(e){return!!this.statBase(e)};Volume.prototype.existsSync=function(e){try{return this.existsBase(pathToFilename(e))}catch(e){return false}};Volume.prototype.exists=function(e,t){var r=this;var n=pathToFilename(e);if(typeof t!=="function")throw Error(W.CB);(0,f.default)((function(){try{t(r.existsBase(n))}catch(e){t(false)}}))};Volume.prototype.accessBase=function(e,t){var r=this.getLinkOrThrow(e,"access")};Volume.prototype.accessSync=function(e,t){if(t===void 0){t=I}var r=pathToFilename(e);t=t|0;this.accessBase(r,t)};Volume.prototype.access=function(e,t,r){var n=I;var i;if(typeof t!=="function"){n=t|0;i=validateCallback(r)}else{i=t}var o=pathToFilename(e);this.wrapAsync(this.accessBase,[o,n],i)};Volume.prototype.appendFileSync=function(e,t,r){if(r===void 0){r=ue}var n=fe(r);if(!n.flag||isFd(e))n.flag="a";this.writeFileSync(e,t,n)};Volume.prototype.appendFile=function(e,t,r,n){var i=le(r,n),o=i[0],s=i[1];if(!o.flag||isFd(e))o.flag="a";this.writeFile(e,t,o,s)};Volume.prototype.readdirBase=function(e,t){var r=filenameToSteps(e);var n=this.getResolvedLink(r);if(!n)throw createError(H,"readdir",e);var i=n.getNode();if(!i.isDirectory())throw createError($,"scandir",e);if(t.withFileTypes){var o=[];for(var s in n.children){var a=n.getChild(s);if(!a){continue}o.push(c.default.build(a,t.encoding))}if(!U&&t.encoding!=="buffer")o.sort((function(e,t){if(e.name<t.name)return-1;if(e.name>t.name)return 1;return 0}));return o}var u=[];for(var f in n.children){u.push((0,y.strToEncoding)(f,t.encoding))}if(!U&&t.encoding!=="buffer")u.sort();return u};Volume.prototype.readdirSync=function(e,t){var r=be(t);var n=pathToFilename(e);return this.readdirBase(n,r)};Volume.prototype.readdir=function(e,t,r){var n=Se(t,r),i=n[0],o=n[1];var s=pathToFilename(e);this.wrapAsync(this.readdirBase,[s,i],o)};Volume.prototype.readlinkBase=function(e,t){var r=this.getLinkOrThrow(e,"readlink");var n=r.getNode();if(!n.isSymlink())throw createError(G,"readlink",e);var i=V+n.symlink.join(V);return(0,y.strToEncoding)(i,t)};Volume.prototype.readlinkSync=function(e,t){var r=ne(t);var n=pathToFilename(e);return this.readlinkBase(n,r.encoding)};Volume.prototype.readlink=function(e,t,r){var n=ie(t,r),i=n[0],o=n[1];var s=pathToFilename(e);this.wrapAsync(this.readlinkBase,[s,i.encoding],o)};Volume.prototype.fsyncBase=function(e){this.getFileByFdOrThrow(e,"fsync")};Volume.prototype.fsyncSync=function(e){this.fsyncBase(e)};Volume.prototype.fsync=function(e,t){this.wrapAsync(this.fsyncBase,[e],t)};Volume.prototype.fdatasyncBase=function(e){this.getFileByFdOrThrow(e,"fdatasync")};Volume.prototype.fdatasyncSync=function(e){this.fdatasyncBase(e)};Volume.prototype.fdatasync=function(e,t){this.wrapAsync(this.fdatasyncBase,[e],t)};Volume.prototype.ftruncateBase=function(e,t){var r=this.getFileByFdOrThrow(e,"ftruncate");r.truncate(t)};Volume.prototype.ftruncateSync=function(e,t){this.ftruncateBase(e,t)};Volume.prototype.ftruncate=function(e,t,r){var n=typeof t==="number"?t:0;var i=validateCallback(typeof t==="number"?r:t);this.wrapAsync(this.ftruncateBase,[e,n],i)};Volume.prototype.truncateBase=function(e,t){var r=this.openSync(e,"r+");try{this.ftruncateSync(r,t)}finally{this.closeSync(r)}};Volume.prototype.truncateSync=function(e,t){if(isFd(e))return this.ftruncateSync(e,t);this.truncateBase(e,t)};Volume.prototype.truncate=function(e,t,r){var n=typeof t==="number"?t:0;var i=validateCallback(typeof t==="number"?r:t);if(isFd(e))return this.ftruncate(e,n,i);this.wrapAsync(this.truncateBase,[e,n],i)};Volume.prototype.futimesBase=function(e,t,r){var n=this.getFileByFdOrThrow(e,"futimes");var i=n.node;i.atime=new Date(t*1e3);i.mtime=new Date(r*1e3)};Volume.prototype.futimesSync=function(e,t,r){this.futimesBase(e,toUnixTimestamp(t),toUnixTimestamp(r))};Volume.prototype.futimes=function(e,t,r,n){this.wrapAsync(this.futimesBase,[e,toUnixTimestamp(t),toUnixTimestamp(r)],n)};Volume.prototype.utimesBase=function(e,t,r){var n=this.openSync(e,"r+");try{this.futimesBase(n,t,r)}finally{this.closeSync(n)}};Volume.prototype.utimesSync=function(e,t,r){this.utimesBase(pathToFilename(e),toUnixTimestamp(t),toUnixTimestamp(r))};Volume.prototype.utimes=function(e,t,r,n){this.wrapAsync(this.utimesBase,[pathToFilename(e),toUnixTimestamp(t),toUnixTimestamp(r)],n)};Volume.prototype.mkdirBase=function(e,t){var r=filenameToSteps(e);if(!r.length){throw createError(q,"mkdir",e)}var n=this.getLinkParentAsDirOrThrow(e,"mkdir");var i=r[r.length-1];if(n.getChild(i))throw createError(q,"mkdir",e);n.createChild(i,this.createNode(true,t))};Volume.prototype.mkdirpBase=function(e,t){var r=filenameToSteps(e);var n=this.root;for(var i=0;i<r.length;i++){var o=r[i];if(!n.getNode().isDirectory())throw createError($,"mkdir",n.getPath());var s=n.getChild(o);if(s){if(s.getNode().isDirectory())n=s;else throw createError($,"mkdir",s.getPath())}else{n=n.createChild(o,this.createNode(true,t))}}};Volume.prototype.mkdirSync=function(e,t){var r=getMkdirOptions(t);var n=modeToNumber(r.mode,511);var i=pathToFilename(e);if(r.recursive)this.mkdirpBase(i,n);else this.mkdirBase(i,n)};Volume.prototype.mkdir=function(e,t,r){var n=getMkdirOptions(t);var i=validateCallback(typeof t==="function"?t:r);var o=modeToNumber(n.mode,511);var s=pathToFilename(e);if(n.recursive)this.wrapAsync(this.mkdirpBase,[s,o],i);else this.wrapAsync(this.mkdirBase,[s,o],i)};Volume.prototype.mkdirpSync=function(e,t){this.mkdirSync(e,{mode:t,recursive:true})};Volume.prototype.mkdirp=function(e,t,r){var n=typeof t==="function"?undefined:t;var i=validateCallback(typeof t==="function"?t:r);this.mkdir(e,{mode:n,recursive:true},i)};Volume.prototype.mkdtempBase=function(e,t,r){if(r===void 0){r=5}var n=e+this.genRndStr();try{this.mkdirBase(n,511);return(0,y.strToEncoding)(n,t)}catch(n){if(n.code===q){if(r>1)return this.mkdtempBase(e,t,r-1);else throw Error("Could not create temp dir.")}else throw n}};Volume.prototype.mkdtempSync=function(e,t){var r=ne(t).encoding;if(!e||typeof e!=="string")throw new TypeError("filename prefix is required");nullCheck(e);return this.mkdtempBase(e,r)};Volume.prototype.mkdtemp=function(e,t,r){var n=ie(t,r),i=n[0].encoding,o=n[1];if(!e||typeof e!=="string")throw new TypeError("filename prefix is required");if(!nullCheck(e))return;this.wrapAsync(this.mkdtempBase,[e,i],o)};Volume.prototype.rmdirBase=function(e,t){var r=getRmdirOptions(t);var n=this.getLinkAsDirOrThrow(e,"rmdir");if(n.length&&!r.recursive)throw createError(Z,"rmdir",e);this.deleteLink(n)};Volume.prototype.rmdirSync=function(e,t){this.rmdirBase(pathToFilename(e),t)};Volume.prototype.rmdir=function(e,t,r){var n=getRmdirOptions(t);var i=validateCallback(typeof t==="function"?t:r);this.wrapAsync(this.rmdirBase,[pathToFilename(e),n],i)};Volume.prototype.rmBase=function(e,t){if(t===void 0){t={}}var r=this.getResolvedLink(e);if(!r){if(!t.force)throw createError(H,"stat",e);return}if(r.getNode().isDirectory()){if(!t.recursive){throw createError(ee,"rm",e)}}this.deleteLink(r)};Volume.prototype.rmSync=function(e,t){this.rmBase(pathToFilename(e),t)};Volume.prototype.rm=function(e,t,r){var n=ge(t,r),i=n[0],o=n[1];this.wrapAsync(this.rmBase,[pathToFilename(e),i],o)};Volume.prototype.fchmodBase=function(e,t){var r=this.getFileByFdOrThrow(e,"fchmod");r.chmod(t)};Volume.prototype.fchmodSync=function(e,t){this.fchmodBase(e,modeToNumber(t))};Volume.prototype.fchmod=function(e,t,r){this.wrapAsync(this.fchmodBase,[e,modeToNumber(t)],r)};Volume.prototype.chmodBase=function(e,t){var r=this.openSync(e,"r+");try{this.fchmodBase(r,t)}finally{this.closeSync(r)}};Volume.prototype.chmodSync=function(e,t){var r=modeToNumber(t);var n=pathToFilename(e);this.chmodBase(n,r)};Volume.prototype.chmod=function(e,t,r){var n=modeToNumber(t);var i=pathToFilename(e);this.wrapAsync(this.chmodBase,[i,n],r)};Volume.prototype.lchmodBase=function(e,t){var r=this.openBase(e,F,0,false);try{this.fchmodBase(r,t)}finally{this.closeSync(r)}};Volume.prototype.lchmodSync=function(e,t){var r=modeToNumber(t);var n=pathToFilename(e);this.lchmodBase(n,r)};Volume.prototype.lchmod=function(e,t,r){var n=modeToNumber(t);var i=pathToFilename(e);this.wrapAsync(this.lchmodBase,[i,n],r)};Volume.prototype.fchownBase=function(e,t,r){this.getFileByFdOrThrow(e,"fchown").chown(t,r)};Volume.prototype.fchownSync=function(e,t,r){validateUid(t);validateGid(r);this.fchownBase(e,t,r)};Volume.prototype.fchown=function(e,t,r,n){validateUid(t);validateGid(r);this.wrapAsync(this.fchownBase,[e,t,r],n)};Volume.prototype.chownBase=function(e,t,r){var n=this.getResolvedLinkOrThrow(e,"chown");var i=n.getNode();i.chown(t,r)};Volume.prototype.chownSync=function(e,t,r){validateUid(t);validateGid(r);this.chownBase(pathToFilename(e),t,r)};Volume.prototype.chown=function(e,t,r,n){validateUid(t);validateGid(r);this.wrapAsync(this.chownBase,[pathToFilename(e),t,r],n)};Volume.prototype.lchownBase=function(e,t,r){this.getLinkOrThrow(e,"lchown").getNode().chown(t,r)};Volume.prototype.lchownSync=function(e,t,r){validateUid(t);validateGid(r);this.lchownBase(pathToFilename(e),t,r)};Volume.prototype.lchown=function(e,t,r,n){validateUid(t);validateGid(r);this.wrapAsync(this.lchownBase,[pathToFilename(e),t,r],n)};Volume.prototype.watchFile=function(e,t,r){var n=pathToFilename(e);var i=t;var o=r;if(typeof i==="function"){o=t;i=null}if(typeof o!=="function"){throw Error('"watchFile()" requires a listener function')}var s=5007;var a=true;if(i&&typeof i==="object"){if(typeof i.interval==="number")s=i.interval;if(typeof i.persistent==="boolean")a=i.persistent}var c=this.statWatchers[n];if(!c){c=new this.StatWatcher;c.start(n,a,s);this.statWatchers[n]=c}c.addListener("change",o);return c};Volume.prototype.unwatchFile=function(e,t){var r=pathToFilename(e);var n=this.statWatchers[r];if(!n)return;if(typeof t==="function"){n.removeListener("change",t)}else{n.removeAllListeners("change")}if(n.listenerCount("change")===0){n.stop();delete this.statWatchers[r]}};Volume.prototype.createReadStream=function(e,t){return new this.ReadStream(e,t)};Volume.prototype.createWriteStream=function(e,t){return new this.WriteStream(e,t)};Volume.prototype.watch=function(e,t,r){var n=pathToFilename(e);var i=t;if(typeof t==="function"){r=t;i=null}var o=ne(i),s=o.persistent,a=o.recursive,c=o.encoding;if(s===undefined)s=true;if(a===undefined)a=false;var u=new this.FSWatcher;u.start(n,s,a,c);if(r){u.addListener("change",r)}return u};Volume.fd=2147483647;return Volume}();t.Volume=Te;function emitStop(e){e.emit("stop")}var Re=function(e){n(StatWatcher,e);function StatWatcher(t){var r=e.call(this)||this;r.onInterval=function(){try{var e=r.vol.statSync(r.filename);if(r.hasChanged(e)){r.emit("change",e,r.prev);r.prev=e}}finally{r.loop()}};r.vol=t;return r}StatWatcher.prototype.loop=function(){this.timeoutRef=this.setTimeout(this.onInterval,this.interval)};StatWatcher.prototype.hasChanged=function(e){if(e.mtimeMs>this.prev.mtimeMs)return true;if(e.nlink!==this.prev.nlink)return true;return false};StatWatcher.prototype.start=function(e,t,r){if(t===void 0){t=true}if(r===void 0){r=5007}this.filename=pathToFilename(e);this.setTimeout=t?setTimeout.bind(typeof globalThis!=="undefined"?globalThis:global):p.default;this.interval=r;this.prev=this.vol.statSync(this.filename);this.loop()};StatWatcher.prototype.stop=function(){clearTimeout(this.timeoutRef);l.default.nextTick(emitStop,this)};return StatWatcher}(m.EventEmitter);t.StatWatcher=Re;var ke;function allocNewPool(e){ke=(0,u.bufferAllocUnsafe)(e);ke.used=0}g.inherits(FsReadStream,d.Readable);t.ReadStream=FsReadStream;function FsReadStream(e,t,r){if(!(this instanceof FsReadStream))return new FsReadStream(e,t,r);this._vol=e;r=Object.assign({},getOptions(r,{}));if(r.highWaterMark===undefined)r.highWaterMark=64*1024;d.Readable.call(this,r);this.path=pathToFilename(t);this.fd=r.fd===undefined?null:r.fd;this.flags=r.flags===undefined?"r":r.flags;this.mode=r.mode===undefined?438:r.mode;this.start=r.start;this.end=r.end;this.autoClose=r.autoClose===undefined?true:r.autoClose;this.pos=undefined;this.bytesRead=0;if(this.start!==undefined){if(typeof this.start!=="number"){throw new TypeError('"start" option must be a Number')}if(this.end===undefined){this.end=Infinity}else if(typeof this.end!=="number"){throw new TypeError('"end" option must be a Number')}if(this.start>this.end){throw new Error('"start" option must be <= "end" option')}this.pos=this.start}if(typeof this.fd!=="number")this.open();this.on("end",(function(){if(this.autoClose){if(this.destroy)this.destroy()}}))}FsReadStream.prototype.open=function(){var e=this;this._vol.open(this.path,this.flags,this.mode,(function(t,r){if(t){if(e.autoClose){if(e.destroy)e.destroy()}e.emit("error",t);return}e.fd=r;e.emit("open",r);e.read()}))};FsReadStream.prototype._read=function(e){if(typeof this.fd!=="number"){return this.once("open",(function(){this._read(e)}))}if(this.destroyed)return;if(!ke||ke.length-ke.used<M){allocNewPool(this._readableState.highWaterMark)}var t=ke;var r=Math.min(ke.length-ke.used,e);var n=ke.used;if(this.pos!==undefined)r=Math.min(this.end-this.pos+1,r);if(r<=0)return this.push(null);var i=this;this._vol.read(this.fd,ke,ke.used,r,this.pos,onread);if(this.pos!==undefined)this.pos+=r;ke.used+=r;function onread(e,r){if(e){if(i.autoClose&&i.destroy){i.destroy()}i.emit("error",e)}else{var o=null;if(r>0){i.bytesRead+=r;o=t.slice(n,n+r)}i.push(o)}}};FsReadStream.prototype._destroy=function(e,t){this.close((function(r){t(e||r)}))};FsReadStream.prototype.close=function(e){var t=this;var r;if(e)this.once("close",e);if(this.closed||typeof this.fd!=="number"){if(typeof this.fd!=="number"){this.once("open",closeOnOpen);return}return l.default.nextTick((function(){return t.emit("close")}))}if(typeof((r=this._readableState)===null||r===void 0?void 0:r.closed)==="boolean"){this._readableState.closed=true}else{this.closed=true}this._vol.close(this.fd,(function(e){if(e)t.emit("error",e);else t.emit("close")}));this.fd=null};function closeOnOpen(e){this.close()}g.inherits(FsWriteStream,d.Writable);t.WriteStream=FsWriteStream;function FsWriteStream(e,t,r){if(!(this instanceof FsWriteStream))return new FsWriteStream(e,t,r);this._vol=e;r=Object.assign({},getOptions(r,{}));d.Writable.call(this,r);this.path=pathToFilename(t);this.fd=r.fd===undefined?null:r.fd;this.flags=r.flags===undefined?"w":r.flags;this.mode=r.mode===undefined?438:r.mode;this.start=r.start;this.autoClose=r.autoClose===undefined?true:!!r.autoClose;this.pos=undefined;this.bytesWritten=0;if(this.start!==undefined){if(typeof this.start!=="number"){throw new TypeError('"start" option must be a Number')}if(this.start<0){throw new Error('"start" must be >= zero')}this.pos=this.start}if(r.encoding)this.setDefaultEncoding(r.encoding);if(typeof this.fd!=="number")this.open();this.once("finish",(function(){if(this.autoClose){this.close()}}))}FsWriteStream.prototype.open=function(){this._vol.open(this.path,this.flags,this.mode,function(e,t){if(e){if(this.autoClose&&this.destroy){this.destroy()}this.emit("error",e);return}this.fd=t;this.emit("open",t)}.bind(this))};FsWriteStream.prototype._write=function(e,t,r){if(!(e instanceof u.Buffer||e instanceof Uint8Array))return this.emit("error",new Error("Invalid data"));if(typeof this.fd!=="number"){return this.once("open",(function(){this._write(e,t,r)}))}var n=this;this._vol.write(this.fd,e,0,e.length,this.pos,(function(e,t){if(e){if(n.autoClose&&n.destroy){n.destroy()}return r(e)}n.bytesWritten+=t;r()}));if(this.pos!==undefined)this.pos+=e.length};FsWriteStream.prototype._writev=function(e,t){if(typeof this.fd!=="number"){return this.once("open",(function(){this._writev(e,t)}))}var r=this;var n=e.length;var i=new Array(n);var o=0;for(var s=0;s<n;s++){var a=e[s].chunk;i[s]=a;o+=a.length}var c=u.Buffer.concat(i);this._vol.write(this.fd,c,0,c.length,this.pos,(function(e,n){if(e){if(r.destroy)r.destroy();return t(e)}r.bytesWritten+=n;t()}));if(this.pos!==undefined)this.pos+=o};FsWriteStream.prototype.close=function(e){var t=this;var r;if(e)this.once("close",e);if(this.closed||typeof this.fd!=="number"){if(typeof this.fd!=="number"){this.once("open",closeOnOpen);return}return l.default.nextTick((function(){return t.emit("close")}))}if(typeof((r=this._writableState)===null||r===void 0?void 0:r.closed)==="boolean"){this._writableState.closed=true}else{this.closed=true}this._vol.close(this.fd,(function(e){if(e)t.emit("error",e);else t.emit("close")}));this.fd=null};FsWriteStream.prototype._destroy=FsReadStream.prototype._destroy;FsWriteStream.prototype.destroySoon=FsWriteStream.prototype.end;var Ne=function(e){n(FSWatcher,e);function FSWatcher(t){var r=e.call(this)||this;r._filename="";r._filenameEncoded="";r._recursive=false;r._encoding=y.ENCODING_UTF8;r._onNodeChange=function(){r._emit("change")};r._onParentChild=function(e){if(e.getName()===r._getName()){r._emit("rename")}};r._emit=function(e){r.emit("change",e,r._filenameEncoded)};r._persist=function(){r._timer=setTimeout(r._persist,1e6)};r._vol=t;return r}FSWatcher.prototype._getName=function(){return this._steps[this._steps.length-1]};FSWatcher.prototype.start=function(e,t,r,n){if(t===void 0){t=true}if(r===void 0){r=false}if(n===void 0){n=y.ENCODING_UTF8}this._filename=pathToFilename(e);this._steps=filenameToSteps(this._filename);this._filenameEncoded=(0,y.strToEncoding)(this._filename);this._recursive=r;this._encoding=n;try{this._link=this._vol.getLinkOrThrow(this._filename,"FSWatcher")}catch(e){var i=new Error("watch ".concat(this._filename," ").concat(e.code));i.code=e.code;i.errno=e.code;throw i}this._link.getNode().on("change",this._onNodeChange);this._link.on("child:add",this._onNodeChange);this._link.on("child:delete",this._onNodeChange);var o=this._link.parent;if(o){o.setMaxListeners(o.getMaxListeners()+1);o.on("child:delete",this._onParentChild)}if(t)this._persist()};FSWatcher.prototype.close=function(){clearTimeout(this._timer);this._link.getNode().removeListener("change",this._onNodeChange);var e=this._link.parent;if(e){e.removeListener("child:delete",this._onParentChild)}};return FSWatcher}(m.EventEmitter);t.FSWatcher=Ne},68:e=>{"use strict";
1
+ (()=>{var e={689:(e,t)=>{"use strict";var r;r={value:true};t.Z4=unixify;r=correctPath;var n=process.platform==="win32";function removeTrailingSeparator(e){var t=e.length-1;if(t<2){return e}while(isSeparator(e,t)){t--}return e.substr(0,t+1)}function isSeparator(e,t){var r=e[t];return t>0&&(r==="/"||n&&r==="\\")}function normalizePath(e,t){if(typeof e!=="string"){throw new TypeError("expected a string")}e=e.replace(/[\\\/]+/g,"/");if(t!==false){e=removeTrailingSeparator(e)}return e}function unixify(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;if(n){e=normalizePath(e,t);return e.replace(/^([a-zA-Z]+:|\.\/)/,"")}return e}function correctPath(e){return unixify(e.replace(/^\\\\\?\\.:\\/,"\\"))}},766:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.fsAsyncMethods=t.fsSyncMethods=t.fsProps=void 0;var r=["constants","F_OK","R_OK","W_OK","X_OK","Stats"];t.fsProps=r;var n=["renameSync","ftruncateSync","truncateSync","chownSync","fchownSync","lchownSync","chmodSync","fchmodSync","lchmodSync","statSync","lstatSync","fstatSync","linkSync","symlinkSync","readlinkSync","realpathSync","unlinkSync","rmdirSync","mkdirSync","mkdirpSync","readdirSync","closeSync","openSync","utimesSync","futimesSync","fsyncSync","writeSync","readSync","readFileSync","writeFileSync","appendFileSync","existsSync","accessSync","fdatasyncSync","mkdtempSync","copyFileSync","createReadStream","createWriteStream"];t.fsSyncMethods=n;var i=["rename","ftruncate","truncate","chown","fchown","lchown","chmod","fchmod","lchmod","stat","lstat","fstat","link","symlink","readlink","realpath","unlink","rmdir","mkdir","mkdirp","readdir","close","open","utimes","futimes","fsync","write","read","readFile","writeFile","appendFile","exists","access","fdatasync","mkdtemp","copyFile","watchFile","unwatchFile","watch"];t.fsAsyncMethods=i},569:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Dirent=void 0;var n=r(233);var i=r(166);var o=n.constants.S_IFMT,s=n.constants.S_IFDIR,a=n.constants.S_IFREG,c=n.constants.S_IFBLK,u=n.constants.S_IFCHR,f=n.constants.S_IFLNK,l=n.constants.S_IFIFO,p=n.constants.S_IFSOCK;var d=function(){function Dirent(){this.name="";this.mode=0}Dirent.build=function(e,t){var r=new Dirent;var n=e.getNode().mode;r.name=(0,i.strToEncoding)(e.getName(),t);r.mode=n;return r};Dirent.prototype._checkModeProperty=function(e){return(this.mode&o)===e};Dirent.prototype.isDirectory=function(){return this._checkModeProperty(s)};Dirent.prototype.isFile=function(){return this._checkModeProperty(a)};Dirent.prototype.isBlockDevice=function(){return this._checkModeProperty(c)};Dirent.prototype.isCharacterDevice=function(){return this._checkModeProperty(u)};Dirent.prototype.isSymbolicLink=function(){return this._checkModeProperty(f)};Dirent.prototype.isFIFO=function(){return this._checkModeProperty(l)};Dirent.prototype.isSocket=function(){return this._checkModeProperty(p)};return Dirent}();t.Dirent=d;t["default"]=d},829:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Stats=void 0;var n=r(233);var i=r(561);var o=n.constants.S_IFMT,s=n.constants.S_IFDIR,a=n.constants.S_IFREG,c=n.constants.S_IFBLK,u=n.constants.S_IFCHR,f=n.constants.S_IFLNK,l=n.constants.S_IFIFO,p=n.constants.S_IFSOCK;var d=function(){function Stats(){}Stats.build=function(e,t){if(t===void 0){t=false}var r=new Stats;var n=e.uid,o=e.gid,s=e.atime,a=e.mtime,c=e.ctime;var u=!t?function(e){return e}:i.default;r.uid=u(n);r.gid=u(o);r.rdev=u(0);r.blksize=u(4096);r.ino=u(e.ino);r.size=u(e.getSize());r.blocks=u(1);r.atime=s;r.mtime=a;r.ctime=c;r.birthtime=c;r.atimeMs=u(s.getTime());r.mtimeMs=u(a.getTime());var f=u(c.getTime());r.ctimeMs=f;r.birthtimeMs=f;r.dev=u(0);r.mode=u(e.mode);r.nlink=u(e.nlink);return r};Stats.prototype._checkModeProperty=function(e){return(Number(this.mode)&o)===e};Stats.prototype.isDirectory=function(){return this._checkModeProperty(s)};Stats.prototype.isFile=function(){return this._checkModeProperty(a)};Stats.prototype.isBlockDevice=function(){return this._checkModeProperty(c)};Stats.prototype.isCharacterDevice=function(){return this._checkModeProperty(u)};Stats.prototype.isSymbolicLink=function(){return this._checkModeProperty(f)};Stats.prototype.isFIFO=function(){return this._checkModeProperty(l)};Stats.prototype.isSocket=function(){return this._checkModeProperty(p)};return Stats}();t.Stats=d;t["default"]=d},233:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.constants=void 0;t.constants={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:64,O_EXCL:128,O_NOCTTY:256,O_TRUNC:512,O_APPEND:1024,O_DIRECTORY:65536,O_NOATIME:262144,O_NOFOLLOW:131072,O_SYNC:1052672,O_DIRECT:16384,O_NONBLOCK:2048,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_SYMLINK_DIR:1,UV_FS_SYMLINK_JUNCTION:2,UV_FS_COPYFILE_EXCL:1,UV_FS_COPYFILE_FICLONE:2,UV_FS_COPYFILE_FICLONE_FORCE:4,COPYFILE_EXCL:1,COPYFILE_FICLONE:2,COPYFILE_FICLONE_FORCE:4}},166:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.strToEncoding=t.assertEncoding=t.ENCODING_UTF8=void 0;var n=r(148);var i=r(944);t.ENCODING_UTF8="utf8";function assertEncoding(e){if(e&&!n.Buffer.isEncoding(e))throw new i.TypeError("ERR_INVALID_OPT_VALUE_ENCODING",e)}t.assertEncoding=assertEncoding;function strToEncoding(e,r){if(!r||r===t.ENCODING_UTF8)return e;if(r==="buffer")return new n.Buffer(e);return new n.Buffer(e).toString(r)}t.strToEncoding=strToEncoding},561:(e,t)=>{if(typeof BigInt==="function")t["default"]=BigInt;else t["default"]=function BigIntNotSupported(){throw new Error("BigInt is not supported in this environment.")}},949:function(e,t,r){"use strict";var n=this&&this.__assign||function(){n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i))e[i]=t[i]}return e};return n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:true});t.fs=t.createFsFromVolume=t.vol=t.Volume=void 0;var i=r(829);var o=r(569);var s=r(643);var a=r(766),c=a.fsSyncMethods,u=a.fsAsyncMethods;var f=r(233);var l=f.constants.F_OK,p=f.constants.R_OK,d=f.constants.W_OK,h=f.constants.X_OK;t.Volume=s.Volume;t.vol=new s.Volume;function createFsFromVolume(e){var t={F_OK:l,R_OK:p,W_OK:d,X_OK:h,constants:f.constants,Stats:i.default,Dirent:o.default};for(var r=0,n=c;r<n.length;r++){var a=n[r];if(typeof e[a]==="function")t[a]=e[a].bind(e)}for(var m=0,y=u;m<y.length;m++){var a=y[m];if(typeof e[a]==="function")t[a]=e[a].bind(e)}t.StatWatcher=e.StatWatcher;t.FSWatcher=e.FSWatcher;t.WriteStream=e.WriteStream;t.ReadStream=e.ReadStream;t.promises=e.promises;t._toUnixTimestamp=s.toUnixTimestamp;return t}t.createFsFromVolume=createFsFromVolume;t.fs=createFsFromVolume(t.vol);e.exports=n(n({},e.exports),t.fs);e.exports.semantic=true},148:function(e,t,r){"use strict";var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++){if(o||!(n in t)){if(!o)o=Array.prototype.slice.call(t,0,n);o[n]=t[n]}}return e.concat(o||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.bufferFrom=t.bufferAllocUnsafe=t.Buffer=void 0;var i=r(300);Object.defineProperty(t,"Buffer",{enumerable:true,get:function(){return i.Buffer}});function bufferV0P12Ponyfill(e){var t=[];for(var r=1;r<arguments.length;r++){t[r-1]=arguments[r]}return new(i.Buffer.bind.apply(i.Buffer,n([void 0,e],t,false)))}var o=i.Buffer.allocUnsafe||bufferV0P12Ponyfill;t.bufferAllocUnsafe=o;var s=i.Buffer.from||bufferV0P12Ponyfill;t.bufferFrom=s},944:function(e,t,r){"use strict";var n=this&&this.__extends||function(){var extendStatics=function(e,t){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))e[r]=t[r]};return extendStatics(e,t)};return function(e,t){if(typeof t!=="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");extendStatics(e,t);function __(){this.constructor=e}e.prototype=t===null?Object.create(t):(__.prototype=t.prototype,new __)}}();Object.defineProperty(t,"__esModule",{value:true});t.E=t.AssertionError=t.message=t.RangeError=t.TypeError=t.Error=void 0;var i=r(491);var o=r(837);var s=typeof Symbol==="undefined"?"_kCode":Symbol("code");var a={};function makeNodeError(e){return function(e){n(NodeError,e);function NodeError(t){var r=[];for(var n=1;n<arguments.length;n++){r[n-1]=arguments[n]}var i=e.call(this,message(t,r))||this;i.code=t;i[s]=t;i.name="".concat(e.prototype.name," [").concat(i[s],"]");return i}return NodeError}(e)}var c=typeof globalThis!=="undefined"?globalThis:global;var u=function(e){n(AssertionError,e);function AssertionError(r){var n=this;if(typeof r!=="object"||r===null){throw new t.TypeError("ERR_INVALID_ARG_TYPE","options","object")}if(r.message){n=e.call(this,r.message)||this}else{n=e.call(this,"".concat(o.inspect(r.actual).slice(0,128)," ")+"".concat(r.operator," ").concat(o.inspect(r.expected).slice(0,128)))||this}n.generatedMessage=!r.message;n.name="AssertionError [ERR_ASSERTION]";n.code="ERR_ASSERTION";n.actual=r.actual;n.expected=r.expected;n.operator=r.operator;t.Error.captureStackTrace(n,r.stackStartFunction);return n}return AssertionError}(c.Error);t.AssertionError=u;function message(e,t){i.strictEqual(typeof e,"string");var r=a[e];i(r,"An invalid error message key was used: ".concat(e,"."));var n;if(typeof r==="function"){n=r}else{n=o.format;if(t===undefined||t.length===0)return r;t.unshift(r)}return String(n.apply(null,t))}t.message=message;function E(e,t){a[e]=typeof t==="function"?t:String(t)}t.E=E;t.Error=makeNodeError(c.Error);t.TypeError=makeNodeError(c.TypeError);t.RangeError=makeNodeError(c.RangeError);E("ERR_ARG_NOT_ITERABLE","%s must be iterable");E("ERR_ASSERTION","%s");E("ERR_BUFFER_OUT_OF_BOUNDS",bufferOutOfBounds);E("ERR_CHILD_CLOSED_BEFORE_REPLY","Child closed before reply received");E("ERR_CONSOLE_WRITABLE_STREAM","Console expects a writable stream instance for %s");E("ERR_CPU_USAGE","Unable to obtain cpu usage %s");E("ERR_DNS_SET_SERVERS_FAILED",(function(e,t){return'c-ares failed to set servers: "'.concat(e,'" [').concat(t,"]")}));E("ERR_FALSY_VALUE_REJECTION","Promise was rejected with falsy value");E("ERR_ENCODING_NOT_SUPPORTED",(function(e){return'The "'.concat(e,'" encoding is not supported')}));E("ERR_ENCODING_INVALID_ENCODED_DATA",(function(e){return"The encoded data was not valid for encoding ".concat(e)}));E("ERR_HTTP_HEADERS_SENT","Cannot render headers after they are sent to the client");E("ERR_HTTP_INVALID_STATUS_CODE","Invalid status code: %s");E("ERR_HTTP_TRAILER_INVALID","Trailers are invalid with this transfer encoding");E("ERR_INDEX_OUT_OF_RANGE","Index out of range");E("ERR_INVALID_ARG_TYPE",invalidArgType);E("ERR_INVALID_ARRAY_LENGTH",(function(e,t,r){i.strictEqual(typeof r,"number");return'The array "'.concat(e,'" (length ').concat(r,") must be of length ").concat(t,".")}));E("ERR_INVALID_BUFFER_SIZE","Buffer size must be a multiple of %s");E("ERR_INVALID_CALLBACK","Callback must be a function");E("ERR_INVALID_CHAR","Invalid character in %s");E("ERR_INVALID_CURSOR_POS","Cannot set cursor row without setting its column");E("ERR_INVALID_FD",'"fd" must be a positive integer: %s');E("ERR_INVALID_FILE_URL_HOST",'File URL host must be "localhost" or empty on %s');E("ERR_INVALID_FILE_URL_PATH","File URL path %s");E("ERR_INVALID_HANDLE_TYPE","This handle type cannot be sent");E("ERR_INVALID_IP_ADDRESS","Invalid IP address: %s");E("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'.concat(String(t),'" is invalid for option "').concat(e,'"')}));E("ERR_INVALID_OPT_VALUE_ENCODING",(function(e){return'The value "'.concat(String(e),'" is invalid for option "encoding"')}));E("ERR_INVALID_REPL_EVAL_CONFIG",'Cannot specify both "breakEvalOnSigint" and "eval" for REPL');E("ERR_INVALID_SYNC_FORK_INPUT","Asynchronous forks do not support Buffer, Uint8Array or string input: %s");E("ERR_INVALID_THIS",'Value of "this" must be of type %s');E("ERR_INVALID_TUPLE","%s must be an iterable %s tuple");E("ERR_INVALID_URL","Invalid URL: %s");E("ERR_INVALID_URL_SCHEME",(function(e){return"The URL must be ".concat(oneOf(e,"scheme"))}));E("ERR_IPC_CHANNEL_CLOSED","Channel closed");E("ERR_IPC_DISCONNECTED","IPC channel is already disconnected");E("ERR_IPC_ONE_PIPE","Child process can have only one IPC pipe");E("ERR_IPC_SYNC_FORK","IPC cannot be used with synchronous forks");E("ERR_MISSING_ARGS",missingArgs);E("ERR_MULTIPLE_CALLBACK","Callback called multiple times");E("ERR_NAPI_CONS_FUNCTION","Constructor must be a function");E("ERR_NAPI_CONS_PROTOTYPE_OBJECT","Constructor.prototype must be an object");E("ERR_NO_CRYPTO","Node.js is not compiled with OpenSSL crypto support");E("ERR_NO_LONGER_SUPPORTED","%s is no longer supported");E("ERR_PARSE_HISTORY_DATA","Could not parse history data in %s");E("ERR_SOCKET_ALREADY_BOUND","Socket is already bound");E("ERR_SOCKET_BAD_PORT","Port should be > 0 and < 65536");E("ERR_SOCKET_BAD_TYPE","Bad socket type specified. Valid types are: udp4, udp6");E("ERR_SOCKET_CANNOT_SEND","Unable to send data");E("ERR_SOCKET_CLOSED","Socket is closed");E("ERR_SOCKET_DGRAM_NOT_RUNNING","Not running");E("ERR_STDERR_CLOSE","process.stderr cannot be closed");E("ERR_STDOUT_CLOSE","process.stdout cannot be closed");E("ERR_STREAM_WRAP","Stream has StringDecoder set or is in objectMode");E("ERR_TLS_CERT_ALTNAME_INVALID","Hostname/IP does not match certificate's altnames: %s");E("ERR_TLS_DH_PARAM_SIZE",(function(e){return"DH parameter size ".concat(e," is less than 2048")}));E("ERR_TLS_HANDSHAKE_TIMEOUT","TLS handshake timeout");E("ERR_TLS_RENEGOTIATION_FAILED","Failed to renegotiate");E("ERR_TLS_REQUIRED_SERVER_NAME",'"servername" is required parameter for Server.addContext');E("ERR_TLS_SESSION_ATTACK","TSL session renegotiation attack detected");E("ERR_TRANSFORM_ALREADY_TRANSFORMING","Calling transform done when still transforming");E("ERR_TRANSFORM_WITH_LENGTH_0","Calling transform done when writableState.length != 0");E("ERR_UNKNOWN_ENCODING","Unknown encoding: %s");E("ERR_UNKNOWN_SIGNAL","Unknown signal: %s");E("ERR_UNKNOWN_STDIN_TYPE","Unknown stdin file type");E("ERR_UNKNOWN_STREAM_TYPE","Unknown stream file type");E("ERR_V8BREAKITERATOR","Full ICU data not installed. "+"See https://github.com/nodejs/node/wiki/Intl");function invalidArgType(e,t,r){i(e,"name is required");var n;if(t.includes("not ")){n="must not be";t=t.split("not ")[1]}else{n="must be"}var o;if(Array.isArray(e)){var s=e.map((function(e){return'"'.concat(e,'"')})).join(", ");o="The ".concat(s," arguments ").concat(n," ").concat(oneOf(t,"type"))}else if(e.includes(" argument")){o="The ".concat(e," ").concat(n," ").concat(oneOf(t,"type"))}else{var a=e.includes(".")?"property":"argument";o='The "'.concat(e,'" ').concat(a," ").concat(n," ").concat(oneOf(t,"type"))}if(arguments.length>=3){o+=". Received type ".concat(r!==null?typeof r:"null")}return o}function missingArgs(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}i(e.length>0,"At least one arg needs to be specified");var r="The ";var n=e.length;e=e.map((function(e){return'"'.concat(e,'"')}));switch(n){case 1:r+="".concat(e[0]," argument");break;case 2:r+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:r+=e.slice(0,n-1).join(", ");r+=", and ".concat(e[n-1]," arguments");break}return"".concat(r," must be specified")}function oneOf(e,t){i(e,"expected is required");i(typeof t==="string","thing is required");if(Array.isArray(e)){var r=e.length;i(r>0,"At least one expected value needs to be specified");e=e.map((function(e){return String(e)}));if(r>2){return"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]}else if(r===2){return"one of ".concat(t," ").concat(e[0]," or ").concat(e[1])}else{return"of ".concat(t," ").concat(e[0])}}else{return"of ".concat(t," ").concat(String(e))}}function bufferOutOfBounds(e,t){if(t){return"Attempt to write outside buffer bounds"}else{return'"'.concat(e,'" is outside of buffer bounds')}}},705:function(e,t,r){"use strict";var n=this&&this.__extends||function(){var extendStatics=function(e,t){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))e[r]=t[r]};return extendStatics(e,t)};return function(e,t){if(typeof t!=="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");extendStatics(e,t);function __(){this.constructor=e}e.prototype=t===null?Object.create(t):(__.prototype=t.prototype,new __)}}();Object.defineProperty(t,"__esModule",{value:true});t.File=t.Link=t.Node=t.SEP=void 0;var i=r(206);var o=r(148);var s=r(233);var a=r(361);var c=r(829);var u=s.constants.S_IFMT,f=s.constants.S_IFDIR,l=s.constants.S_IFREG,p=s.constants.S_IFLNK,d=s.constants.O_APPEND;var getuid=function(){var e,t;return(t=(e=i.default.getuid)===null||e===void 0?void 0:e.call(i.default))!==null&&t!==void 0?t:0};var getgid=function(){var e,t;return(t=(e=i.default.getgid)===null||e===void 0?void 0:e.call(i.default))!==null&&t!==void 0?t:0};t.SEP="/";var h=function(e){n(Node,e);function Node(t,r){if(r===void 0){r=438}var n=e.call(this)||this;n.uid=getuid();n.gid=getgid();n.atime=new Date;n.mtime=new Date;n.ctime=new Date;n.perm=438;n.mode=l;n.nlink=1;n.perm=r;n.mode|=r;n.ino=t;return n}Node.prototype.getString=function(e){if(e===void 0){e="utf8"}return this.getBuffer().toString(e)};Node.prototype.setString=function(e){this.buf=(0,o.bufferFrom)(e,"utf8");this.touch()};Node.prototype.getBuffer=function(){if(!this.buf)this.setBuffer((0,o.bufferAllocUnsafe)(0));return(0,o.bufferFrom)(this.buf)};Node.prototype.setBuffer=function(e){this.buf=(0,o.bufferFrom)(e);this.touch()};Node.prototype.getSize=function(){return this.buf?this.buf.length:0};Node.prototype.setModeProperty=function(e){this.mode=this.mode&~u|e};Node.prototype.setIsFile=function(){this.setModeProperty(l)};Node.prototype.setIsDirectory=function(){this.setModeProperty(f)};Node.prototype.setIsSymlink=function(){this.setModeProperty(p)};Node.prototype.isFile=function(){return(this.mode&u)===l};Node.prototype.isDirectory=function(){return(this.mode&u)===f};Node.prototype.isSymlink=function(){return(this.mode&u)===p};Node.prototype.makeSymlink=function(e){this.symlink=e;this.setIsSymlink()};Node.prototype.write=function(e,t,r,n){if(t===void 0){t=0}if(r===void 0){r=e.length}if(n===void 0){n=0}if(!this.buf)this.buf=(0,o.bufferAllocUnsafe)(0);if(n+r>this.buf.length){var i=(0,o.bufferAllocUnsafe)(n+r);this.buf.copy(i,0,0,this.buf.length);this.buf=i}e.copy(this.buf,n,t,t+r);this.touch();return r};Node.prototype.read=function(e,t,r,n){if(t===void 0){t=0}if(r===void 0){r=e.byteLength}if(n===void 0){n=0}if(!this.buf)this.buf=(0,o.bufferAllocUnsafe)(0);var i=r;if(i>e.byteLength){i=e.byteLength}if(i+n>this.buf.length){i=this.buf.length-n}this.buf.copy(e,t,n,n+i);return i};Node.prototype.truncate=function(e){if(e===void 0){e=0}if(!e)this.buf=(0,o.bufferAllocUnsafe)(0);else{if(!this.buf)this.buf=(0,o.bufferAllocUnsafe)(0);if(e<=this.buf.length){this.buf=this.buf.slice(0,e)}else{var t=(0,o.bufferAllocUnsafe)(e);this.buf.copy(t);t.fill(0,this.buf.length);this.buf=t}}this.touch()};Node.prototype.chmod=function(e){this.perm=e;this.mode=this.mode&~511|e;this.touch()};Node.prototype.chown=function(e,t){this.uid=e;this.gid=t;this.touch()};Node.prototype.touch=function(){this.mtime=new Date;this.emit("change",this)};Node.prototype.canRead=function(e,t){if(e===void 0){e=getuid()}if(t===void 0){t=getgid()}if(this.perm&4){return true}if(t===this.gid){if(this.perm&32){return true}}if(e===this.uid){if(this.perm&256){return true}}return false};Node.prototype.canWrite=function(e,t){if(e===void 0){e=getuid()}if(t===void 0){t=getgid()}if(this.perm&2){return true}if(t===this.gid){if(this.perm&16){return true}}if(e===this.uid){if(this.perm&128){return true}}return false};Node.prototype.del=function(){this.emit("delete",this)};Node.prototype.toJSON=function(){return{ino:this.ino,uid:this.uid,gid:this.gid,atime:this.atime.getTime(),mtime:this.mtime.getTime(),ctime:this.ctime.getTime(),perm:this.perm,mode:this.mode,nlink:this.nlink,symlink:this.symlink,data:this.getString()}};return Node}(a.EventEmitter);t.Node=h;var m=function(e){n(Link,e);function Link(t,r,n){var i=e.call(this)||this;i.children={};i._steps=[];i.ino=0;i.length=0;i.vol=t;i.parent=r;i.name=n;i.syncSteps();return i}Object.defineProperty(Link.prototype,"steps",{get:function(){return this._steps},set:function(e){this._steps=e;for(var t=0,r=Object.values(this.children);t<r.length;t++){var n=r[t];n===null||n===void 0?void 0:n.syncSteps()}},enumerable:false,configurable:true});Link.prototype.setNode=function(e){this.node=e;this.ino=e.ino};Link.prototype.getNode=function(){return this.node};Link.prototype.createChild=function(e,t){if(t===void 0){t=this.vol.createNode()}var r=new Link(this.vol,this,e);r.setNode(t);if(t.isDirectory()){}this.setChild(e,r);return r};Link.prototype.setChild=function(e,t){if(t===void 0){t=new Link(this.vol,this,e)}this.children[e]=t;t.parent=this;this.length++;this.emit("child:add",t,this);return t};Link.prototype.deleteChild=function(e){delete this.children[e.getName()];this.length--;this.emit("child:delete",e,this)};Link.prototype.getChild=function(e){if(Object.hasOwnProperty.call(this.children,e)){return this.children[e]}};Link.prototype.getPath=function(){return this.steps.join(t.SEP)};Link.prototype.getName=function(){return this.steps[this.steps.length-1]};Link.prototype.walk=function(e,t,r){if(t===void 0){t=e.length}if(r===void 0){r=0}if(r>=e.length)return this;if(r>=t)return this;var n=e[r];var i=this.getChild(n);if(!i)return null;return i.walk(e,t,r+1)};Link.prototype.toJSON=function(){return{steps:this.steps,ino:this.ino,children:Object.keys(this.children)}};Link.prototype.syncSteps=function(){this.steps=this.parent?this.parent.steps.concat([this.name]):[this.name]};return Link}(a.EventEmitter);t.Link=m;var y=function(){function File(e,t,r,n){this.position=0;this.link=e;this.node=t;this.flags=r;this.fd=n}File.prototype.getString=function(e){if(e===void 0){e="utf8"}return this.node.getString()};File.prototype.setString=function(e){this.node.setString(e)};File.prototype.getBuffer=function(){return this.node.getBuffer()};File.prototype.setBuffer=function(e){this.node.setBuffer(e)};File.prototype.getSize=function(){return this.node.getSize()};File.prototype.truncate=function(e){this.node.truncate(e)};File.prototype.seekTo=function(e){this.position=e};File.prototype.stats=function(){return c.default.build(this.node)};File.prototype.write=function(e,t,r,n){if(t===void 0){t=0}if(r===void 0){r=e.length}if(typeof n!=="number")n=this.position;if(this.flags&d)n=this.getSize();var i=this.node.write(e,t,r,n);this.position=n+i;return i};File.prototype.read=function(e,t,r,n){if(t===void 0){t=0}if(r===void 0){r=e.byteLength}if(typeof n!=="number")n=this.position;var i=this.node.read(e,t,r,n);this.position=n+i;return i};File.prototype.chmod=function(e){this.node.chmod(e)};File.prototype.chown=function(e,t){this.node.chown(e,t)};return File}();t.File=y},206:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createProcess=void 0;var maybeReturnProcess=function(){if(typeof process!=="undefined"){return process}try{return r(282)}catch(e){return undefined}};function createProcess(){var e=maybeReturnProcess()||{};if(!e.cwd)e.cwd=function(){return"/"};if(!e.nextTick)e.nextTick=r(366)["default"];if(!e.emitWarning)e.emitWarning=function(e,t){console.warn("".concat(t).concat(t?": ":"").concat(e))};if(!e.env)e.env={};return e}t.createProcess=createProcess;t["default"]=createProcess()},557:function(e,t){"use strict";var r=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++){if(o||!(n in t)){if(!o)o=Array.prototype.slice.call(t,0,n);o[n]=t[n]}}return e.concat(o||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.FileHandle=void 0;function promisify(e,t,n){if(n===void 0){n=function(e){return e}}return function(){var i=[];for(var o=0;o<arguments.length;o++){i[o]=arguments[o]}return new Promise((function(o,s){e[t].bind(e).apply(void 0,r(r([],i,false),[function(e,t){if(e)return s(e);return o(n(t))}],false))}))}}var n=function(){function FileHandle(e,t){this.vol=e;this.fd=t}FileHandle.prototype.appendFile=function(e,t){return promisify(this.vol,"appendFile")(this.fd,e,t)};FileHandle.prototype.chmod=function(e){return promisify(this.vol,"fchmod")(this.fd,e)};FileHandle.prototype.chown=function(e,t){return promisify(this.vol,"fchown")(this.fd,e,t)};FileHandle.prototype.close=function(){return promisify(this.vol,"close")(this.fd)};FileHandle.prototype.datasync=function(){return promisify(this.vol,"fdatasync")(this.fd)};FileHandle.prototype.read=function(e,t,r,n){return promisify(this.vol,"read",(function(t){return{bytesRead:t,buffer:e}}))(this.fd,e,t,r,n)};FileHandle.prototype.readFile=function(e){return promisify(this.vol,"readFile")(this.fd,e)};FileHandle.prototype.stat=function(e){return promisify(this.vol,"fstat")(this.fd,e)};FileHandle.prototype.sync=function(){return promisify(this.vol,"fsync")(this.fd)};FileHandle.prototype.truncate=function(e){return promisify(this.vol,"ftruncate")(this.fd,e)};FileHandle.prototype.utimes=function(e,t){return promisify(this.vol,"futimes")(this.fd,e,t)};FileHandle.prototype.write=function(e,t,r,n){return promisify(this.vol,"write",(function(t){return{bytesWritten:t,buffer:e}}))(this.fd,e,t,r,n)};FileHandle.prototype.writeFile=function(e,t){return promisify(this.vol,"writeFile")(this.fd,e,t)};return FileHandle}();t.FileHandle=n;function createPromisesApi(e){if(typeof Promise==="undefined")return null;return{FileHandle:n,access:function(t,r){return promisify(e,"access")(t,r)},appendFile:function(t,r,i){return promisify(e,"appendFile")(t instanceof n?t.fd:t,r,i)},chmod:function(t,r){return promisify(e,"chmod")(t,r)},chown:function(t,r,n){return promisify(e,"chown")(t,r,n)},copyFile:function(t,r,n){return promisify(e,"copyFile")(t,r,n)},lchmod:function(t,r){return promisify(e,"lchmod")(t,r)},lchown:function(t,r,n){return promisify(e,"lchown")(t,r,n)},link:function(t,r){return promisify(e,"link")(t,r)},lstat:function(t,r){return promisify(e,"lstat")(t,r)},mkdir:function(t,r){return promisify(e,"mkdir")(t,r)},mkdtemp:function(t,r){return promisify(e,"mkdtemp")(t,r)},open:function(t,r,i){return promisify(e,"open",(function(t){return new n(e,t)}))(t,r,i)},readdir:function(t,r){return promisify(e,"readdir")(t,r)},readFile:function(t,r){return promisify(e,"readFile")(t instanceof n?t.fd:t,r)},readlink:function(t,r){return promisify(e,"readlink")(t,r)},realpath:function(t,r){return promisify(e,"realpath")(t,r)},rename:function(t,r){return promisify(e,"rename")(t,r)},rmdir:function(t){return promisify(e,"rmdir")(t)},rm:function(t,r){return promisify(e,"rm")(t,r)},stat:function(t,r){return promisify(e,"stat")(t,r)},symlink:function(t,r,n){return promisify(e,"symlink")(t,r,n)},truncate:function(t,r){return promisify(e,"truncate")(t,r)},unlink:function(t){return promisify(e,"unlink")(t)},utimes:function(t,r,n){return promisify(e,"utimes")(t,r,n)},writeFile:function(t,r,i){return promisify(e,"writeFile")(t instanceof n?t.fd:t,r,i)}}}t["default"]=createPromisesApi},366:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});var r;if(typeof setImmediate==="function")r=setImmediate.bind(typeof globalThis!=="undefined"?globalThis:global);else r=setTimeout.bind(typeof globalThis!=="undefined"?globalThis:global);t["default"]=r},542:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});function setTimeoutUnref(e,t,r){var n=setTimeout.apply(typeof globalThis!=="undefined"?globalThis:global,arguments);if(n&&typeof n==="object"&&typeof n.unref==="function")n.unref();return n}t["default"]=setTimeoutUnref},643:function(e,t,r){"use strict";var n=this&&this.__extends||function(){var extendStatics=function(e,t){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))e[r]=t[r]};return extendStatics(e,t)};return function(e,t){if(typeof t!=="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");extendStatics(e,t);function __(){this.constructor=e}e.prototype=t===null?Object.create(t):(__.prototype=t.prototype,new __)}}();var i=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++){if(o||!(n in t)){if(!o)o=Array.prototype.slice.call(t,0,n);o[n]=t[n]}}return e.concat(o||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.FSWatcher=t.StatWatcher=t.Volume=t.toUnixTimestamp=t.bufferToEncoding=t.dataToBuffer=t.dataToStr=t.pathToSteps=t.filenameToSteps=t.pathToFilename=t.flagsToNumber=t.FLAGS=void 0;var o=r(17);var s=r(705);var a=r(829);var c=r(569);var u=r(148);var f=r(366);var l=r(206);var p=r(542);var d=r(781);var h=r(233);var m=r(361);var y=r(166);var v=r(944);var g=r(837);var _=r(557);var b=o.resolve;var S=h.constants.O_RDONLY,w=h.constants.O_WRONLY,F=h.constants.O_RDWR,T=h.constants.O_CREAT,R=h.constants.O_EXCL,k=h.constants.O_TRUNC,N=h.constants.O_APPEND,O=h.constants.O_SYNC,B=h.constants.O_DIRECTORY,I=h.constants.F_OK,A=h.constants.COPYFILE_EXCL,C=h.constants.COPYFILE_FICLONE_FORCE;var L=o.posix?o.posix:o,V=L.sep,P=L.relative,D=L.join,x=L.dirname;var U=l.default.platform==="win32";var M=128;var W={PATH_STR:"path must be a string or Buffer",FD:"fd must be a file descriptor",MODE_INT:"mode must be an int",CB:"callback must be a function",UID:"uid must be an unsigned int",GID:"gid must be an unsigned int",LEN:"len must be an integer",ATIME:"atime must be an integer",MTIME:"mtime must be an integer",PREFIX:"filename prefix is required",BUFFER:"buffer must be an instance of Buffer or StaticBuffer",OFFSET:"offset must be an integer",LENGTH:"length must be an integer",POSITION:"position must be an integer"};var ERRSTR_OPTS=function(e){return"Expected options to be either an object or a string, but got ".concat(e," instead")};var H="ENOENT";var j="EBADF";var G="EINVAL";var K="EPERM";var Y="EPROTO";var q="EEXIST";var $="ENOTDIR";var J="EMFILE";var X="EACCES";var z="EISDIR";var Z="ENOTEMPTY";var Q="ENOSYS";var ee="ERR_FS_EISDIR";function formatError(e,t,r,n){if(t===void 0){t=""}if(r===void 0){r=""}if(n===void 0){n=""}var i="";if(r)i=" '".concat(r,"'");if(n)i+=" -> '".concat(n,"'");switch(e){case H:return"ENOENT: no such file or directory, ".concat(t).concat(i);case j:return"EBADF: bad file descriptor, ".concat(t).concat(i);case G:return"EINVAL: invalid argument, ".concat(t).concat(i);case K:return"EPERM: operation not permitted, ".concat(t).concat(i);case Y:return"EPROTO: protocol error, ".concat(t).concat(i);case q:return"EEXIST: file already exists, ".concat(t).concat(i);case $:return"ENOTDIR: not a directory, ".concat(t).concat(i);case z:return"EISDIR: illegal operation on a directory, ".concat(t).concat(i);case X:return"EACCES: permission denied, ".concat(t).concat(i);case Z:return"ENOTEMPTY: directory not empty, ".concat(t).concat(i);case J:return"EMFILE: too many open files, ".concat(t).concat(i);case Q:return"ENOSYS: function not implemented, ".concat(t).concat(i);case ee:return"[ERR_FS_EISDIR]: Path is a directory: ".concat(t," returned EISDIR (is a directory) ").concat(r);default:return"".concat(e,": error occurred, ").concat(t).concat(i)}}function createError(e,t,r,n,i){if(t===void 0){t=""}if(r===void 0){r=""}if(n===void 0){n=""}if(i===void 0){i=Error}var o=new i(formatError(e,t,r,n));o.code=e;return o}var te;(function(e){e[e["r"]=S]="r";e[e["r+"]=F]="r+";e[e["rs"]=S|O]="rs";e[e["sr"]=e.rs]="sr";e[e["rs+"]=F|O]="rs+";e[e["sr+"]=e["rs+"]]="sr+";e[e["w"]=w|T|k]="w";e[e["wx"]=w|T|k|R]="wx";e[e["xw"]=e.wx]="xw";e[e["w+"]=F|T|k]="w+";e[e["wx+"]=F|T|k|R]="wx+";e[e["xw+"]=e["wx+"]]="xw+";e[e["a"]=w|N|T]="a";e[e["ax"]=w|N|T|R]="ax";e[e["xa"]=e.ax]="xa";e[e["a+"]=F|N|T]="a+";e[e["ax+"]=F|N|T|R]="ax+";e[e["xa+"]=e["ax+"]]="xa+"})(te=t.FLAGS||(t.FLAGS={}));function flagsToNumber(e){if(typeof e==="number")return e;if(typeof e==="string"){var t=te[e];if(typeof t!=="undefined")return t}throw new v.TypeError("ERR_INVALID_OPT_VALUE","flags",e)}t.flagsToNumber=flagsToNumber;function getOptions(e,t){var r;if(!t)return e;else{var n=typeof t;switch(n){case"string":r=Object.assign({},e,{encoding:t});break;case"object":r=Object.assign({},e,t);break;default:throw TypeError(ERRSTR_OPTS(n))}}if(r.encoding!=="buffer")(0,y.assertEncoding)(r.encoding);return r}function optsGenerator(e){return function(t){return getOptions(e,t)}}function validateCallback(e){if(typeof e!=="function")throw TypeError(W.CB);return e}function optsAndCbGenerator(e){return function(t,r){return typeof t==="function"?[e(),t]:[e(t),validateCallback(r)]}}var re={encoding:"utf8"};var ne=optsGenerator(re);var ie=optsAndCbGenerator(ne);var oe={flag:"r"};var se=optsGenerator(oe);var ae={encoding:"utf8",mode:438,flag:te[te.w]};var ce=optsGenerator(ae);var ue={encoding:"utf8",mode:438,flag:te[te.a]};var fe=optsGenerator(ue);var le=optsAndCbGenerator(fe);var pe=re;var de=optsGenerator(pe);var he=optsAndCbGenerator(de);var me={mode:511,recursive:false};var getMkdirOptions=function(e){if(typeof e==="number")return Object.assign({},me,{mode:e});return Object.assign({},me,e)};var ye={recursive:false};var getRmdirOptions=function(e){return Object.assign({},ye,e)};var ve=optsGenerator(re);var ge=optsAndCbGenerator(ve);var _e={encoding:"utf8",withFileTypes:false};var be=optsGenerator(_e);var Ee=optsAndCbGenerator(be);var Se={bigint:false};var getStatOptions=function(e){if(e===void 0){e={}}return Object.assign({},Se,e)};var getStatOptsAndCb=function(e,t){return typeof e==="function"?[getStatOptions(),e]:[getStatOptions(e),validateCallback(t)]};function getPathFromURLPosix(e){if(e.hostname!==""){throw new v.TypeError("ERR_INVALID_FILE_URL_HOST",l.default.platform)}var t=e.pathname;for(var r=0;r<t.length;r++){if(t[r]==="%"){var n=t.codePointAt(r+2)|32;if(t[r+1]==="2"&&n===102){throw new v.TypeError("ERR_INVALID_FILE_URL_PATH","must not include encoded / characters")}}}return decodeURIComponent(t)}function pathToFilename(e){if(typeof e!=="string"&&!u.Buffer.isBuffer(e)){try{if(!(e instanceof r(310).URL))throw new TypeError(W.PATH_STR)}catch(e){throw new TypeError(W.PATH_STR)}e=getPathFromURLPosix(e)}var t=String(e);nullCheck(t);return t}t.pathToFilename=pathToFilename;var resolve=function(e,t){if(t===void 0){t=l.default.cwd()}return b(t,e)};if(U){var we=resolve;var Fe=r(689).Z4;resolve=function(e,t){return Fe(we(e,t))}}function filenameToSteps(e,t){var r=resolve(e,t);var n=r.substring(1);if(!n)return[];return n.split(V)}t.filenameToSteps=filenameToSteps;function pathToSteps(e){return filenameToSteps(pathToFilename(e))}t.pathToSteps=pathToSteps;function dataToStr(e,t){if(t===void 0){t=y.ENCODING_UTF8}if(u.Buffer.isBuffer(e))return e.toString(t);else if(e instanceof Uint8Array)return(0,u.bufferFrom)(e).toString(t);else return String(e)}t.dataToStr=dataToStr;function dataToBuffer(e,t){if(t===void 0){t=y.ENCODING_UTF8}if(u.Buffer.isBuffer(e))return e;else if(e instanceof Uint8Array)return(0,u.bufferFrom)(e);else return(0,u.bufferFrom)(String(e),t)}t.dataToBuffer=dataToBuffer;function bufferToEncoding(e,t){if(!t||t==="buffer")return e;else return e.toString(t)}t.bufferToEncoding=bufferToEncoding;function nullCheck(e,t){if((""+e).indexOf("\0")!==-1){var r=new Error("Path must be a string without null bytes");r.code=H;if(typeof t!=="function")throw r;l.default.nextTick(t,r);return false}return true}function _modeToNumber(e,t){if(typeof e==="number")return e;if(typeof e==="string")return parseInt(e,8);if(t)return modeToNumber(t);return undefined}function modeToNumber(e,t){var r=_modeToNumber(e,t);if(typeof r!=="number"||isNaN(r))throw new TypeError(W.MODE_INT);return r}function isFd(e){return e>>>0===e}function validateFd(e){if(!isFd(e))throw TypeError(W.FD)}function toUnixTimestamp(e){if(typeof e==="string"&&+e==e){return+e}if(e instanceof Date){return e.getTime()/1e3}if(isFinite(e)){if(e<0){return Date.now()/1e3}return e}throw new Error("Cannot parse time: "+e)}t.toUnixTimestamp=toUnixTimestamp;function validateUid(e){if(typeof e!=="number")throw TypeError(W.UID)}function validateGid(e){if(typeof e!=="number")throw TypeError(W.GID)}function flattenJSON(e){var t={};function flatten(e,r){for(var n in r){var i=r[n];var o=D(e,n);if(typeof i==="string"){t[o]=i}else if(typeof i==="object"&&i!==null&&Object.keys(i).length>0){flatten(o,i)}else{t[o]=null}}}flatten("",e);return t}var Te=function(){function Volume(e){if(e===void 0){e={}}this.ino=0;this.inodes={};this.releasedInos=[];this.fds={};this.releasedFds=[];this.maxFiles=1e4;this.openFiles=0;this.promisesApi=(0,_.default)(this);this.statWatchers={};this.props=Object.assign({Node:s.Node,Link:s.Link,File:s.File},e);var t=this.createLink();t.setNode(this.createNode(true));var r=this;this.StatWatcher=function(e){n(StatWatcher,e);function StatWatcher(){return e.call(this,r)||this}return StatWatcher}(Re);var o=FsReadStream;this.ReadStream=function(e){n(class_1,e);function class_1(){var t=[];for(var n=0;n<arguments.length;n++){t[n]=arguments[n]}return e.apply(this,i([r],t,false))||this}return class_1}(o);var a=FsWriteStream;this.WriteStream=function(e){n(class_2,e);function class_2(){var t=[];for(var n=0;n<arguments.length;n++){t[n]=arguments[n]}return e.apply(this,i([r],t,false))||this}return class_2}(a);this.FSWatcher=function(e){n(FSWatcher,e);function FSWatcher(){return e.call(this,r)||this}return FSWatcher}(Ne);this.root=t}Volume.fromJSON=function(e,t){var r=new Volume;r.fromJSON(e,t);return r};Volume.fromNestedJSON=function(e,t){var r=new Volume;r.fromNestedJSON(e,t);return r};Object.defineProperty(Volume.prototype,"promises",{get:function(){if(this.promisesApi===null)throw new Error("Promise is not supported in this environment.");return this.promisesApi},enumerable:false,configurable:true});Volume.prototype.createLink=function(e,t,r,n){if(r===void 0){r=false}if(!e){return new this.props.Link(this,null,"")}if(!t){throw new Error("createLink: name cannot be empty")}return e.createChild(t,this.createNode(r,n))};Volume.prototype.deleteLink=function(e){var t=e.parent;if(t){t.deleteChild(e);return true}return false};Volume.prototype.newInoNumber=function(){var e=this.releasedInos.pop();if(e)return e;else{this.ino=(this.ino+1)%4294967295;return this.ino}};Volume.prototype.newFdNumber=function(){var e=this.releasedFds.pop();return typeof e==="number"?e:Volume.fd--};Volume.prototype.createNode=function(e,t){if(e===void 0){e=false}var r=new this.props.Node(this.newInoNumber(),t);if(e)r.setIsDirectory();this.inodes[r.ino]=r;return r};Volume.prototype.getNode=function(e){return this.inodes[e]};Volume.prototype.deleteNode=function(e){e.del();delete this.inodes[e.ino];this.releasedInos.push(e.ino)};Volume.prototype.genRndStr=function(){var e=(Math.random()+1).toString(36).substring(2,8);if(e.length===6)return e;else return this.genRndStr()};Volume.prototype.getLink=function(e){return this.root.walk(e)};Volume.prototype.getLinkOrThrow=function(e,t){var r=filenameToSteps(e);var n=this.getLink(r);if(!n)throw createError(H,t,e);return n};Volume.prototype.getResolvedLink=function(e){var t=typeof e==="string"?filenameToSteps(e):e;var r=this.root;var n=0;while(n<t.length){var i=t[n];r=r.getChild(i);if(!r)return null;var o=r.getNode();if(o.isSymlink()){t=o.symlink.concat(t.slice(n+1));r=this.root;n=0;continue}n++}return r};Volume.prototype.getResolvedLinkOrThrow=function(e,t){var r=this.getResolvedLink(e);if(!r)throw createError(H,t,e);return r};Volume.prototype.resolveSymlinks=function(e){return this.getResolvedLink(e.steps.slice(1))};Volume.prototype.getLinkAsDirOrThrow=function(e,t){var r=this.getLinkOrThrow(e,t);if(!r.getNode().isDirectory())throw createError($,t,e);return r};Volume.prototype.getLinkParent=function(e){return this.root.walk(e,e.length-1)};Volume.prototype.getLinkParentAsDirOrThrow=function(e,t){var r=e instanceof Array?e:filenameToSteps(e);var n=this.getLinkParent(r);if(!n)throw createError(H,t,V+r.join(V));if(!n.getNode().isDirectory())throw createError($,t,V+r.join(V));return n};Volume.prototype.getFileByFd=function(e){return this.fds[String(e)]};Volume.prototype.getFileByFdOrThrow=function(e,t){if(!isFd(e))throw TypeError(W.FD);var r=this.getFileByFd(e);if(!r)throw createError(j,t);return r};Volume.prototype.wrapAsync=function(e,t,r){var n=this;validateCallback(r);(0,f.default)((function(){var i;try{i=e.apply(n,t)}catch(e){r(e);return}r(null,i)}))};Volume.prototype._toJSON=function(e,t,r){var n;if(e===void 0){e=this.root}if(t===void 0){t={}}var i=true;var o=e.children;if(e.getNode().isFile()){o=(n={},n[e.getName()]=e.parent.getChild(e.getName()),n);e=e.parent}for(var s in o){i=false;var a=e.getChild(s);if(!a){throw new Error("_toJSON: unexpected undefined")}var c=a.getNode();if(c.isFile()){var u=a.getPath();if(r)u=P(r,u);t[u]=c.getString()}else if(c.isDirectory()){this._toJSON(a,t,r)}}var f=e.getPath();if(r)f=P(r,f);if(f&&i){t[f]=null}return t};Volume.prototype.toJSON=function(e,t,r){if(t===void 0){t={}}if(r===void 0){r=false}var n=[];if(e){if(!(e instanceof Array))e=[e];for(var i=0,o=e;i<o.length;i++){var s=o[i];var a=pathToFilename(s);var c=this.getResolvedLink(a);if(!c)continue;n.push(c)}}else{n.push(this.root)}if(!n.length)return t;for(var u=0,f=n;u<f.length;u++){var c=f[u];this._toJSON(c,t,r?c.getPath():"")}return t};Volume.prototype.fromJSON=function(e,t){if(t===void 0){t=l.default.cwd()}for(var r in e){var n=e[r];r=resolve(r,t);if(typeof n==="string"){var i=x(r);this.mkdirpBase(i,511);this.writeFileSync(r,n)}else{this.mkdirpBase(r,511)}}};Volume.prototype.fromNestedJSON=function(e,t){this.fromJSON(flattenJSON(e),t)};Volume.prototype.reset=function(){this.ino=0;this.inodes={};this.releasedInos=[];this.fds={};this.releasedFds=[];this.openFiles=0;this.root=this.createLink();this.root.setNode(this.createNode(true))};Volume.prototype.mountSync=function(e,t){this.fromJSON(t,e)};Volume.prototype.openLink=function(e,t,r){if(r===void 0){r=true}if(this.openFiles>=this.maxFiles){throw createError(J,"open",e.getPath())}var n=e;if(r)n=this.resolveSymlinks(e);if(!n)throw createError(H,"open",e.getPath());var i=n.getNode();if(i.isDirectory()){if((t&(S|F|w))!==S)throw createError(z,"open",e.getPath())}else{if(t&B)throw createError($,"open",e.getPath())}if(!(t&w)){if(!i.canRead()){throw createError(X,"open",e.getPath())}}if(t&F){}var o=new this.props.File(e,i,t,this.newFdNumber());this.fds[o.fd]=o;this.openFiles++;if(t&k)o.truncate();return o};Volume.prototype.openFile=function(e,t,r,n){if(n===void 0){n=true}var i=filenameToSteps(e);var o=n?this.getResolvedLink(i):this.getLink(i);if(o&&t&R)throw createError(q,"open",e);if(!o&&t&T){var s=this.getResolvedLink(i.slice(0,i.length-1));if(!s)throw createError(H,"open",V+i.join(V));if(t&T&&typeof r==="number"){o=this.createLink(s,i[i.length-1],false,r)}}if(o)return this.openLink(o,t,n);throw createError(H,"open",e)};Volume.prototype.openBase=function(e,t,r,n){if(n===void 0){n=true}var i=this.openFile(e,t,r,n);if(!i)throw createError(H,"open",e);return i.fd};Volume.prototype.openSync=function(e,t,r){if(r===void 0){r=438}var n=modeToNumber(r);var i=pathToFilename(e);var o=flagsToNumber(t);return this.openBase(i,o,n)};Volume.prototype.open=function(e,t,r,n){var i=r;var o=n;if(typeof r==="function"){i=438;o=r}i=i||438;var s=modeToNumber(i);var a=pathToFilename(e);var c=flagsToNumber(t);this.wrapAsync(this.openBase,[a,c,s],o)};Volume.prototype.closeFile=function(e){if(!this.fds[e.fd])return;this.openFiles--;delete this.fds[e.fd];this.releasedFds.push(e.fd)};Volume.prototype.closeSync=function(e){validateFd(e);var t=this.getFileByFdOrThrow(e,"close");this.closeFile(t)};Volume.prototype.close=function(e,t){validateFd(e);this.wrapAsync(this.closeSync,[e],t)};Volume.prototype.openFileOrGetById=function(e,t,r){if(typeof e==="number"){var n=this.fds[e];if(!n)throw createError(H);return n}else{return this.openFile(pathToFilename(e),t,r)}};Volume.prototype.readBase=function(e,t,r,n,i){var o=this.getFileByFdOrThrow(e);return o.read(t,Number(r),Number(n),i)};Volume.prototype.readSync=function(e,t,r,n,i){validateFd(e);return this.readBase(e,t,r,n,i)};Volume.prototype.read=function(e,t,r,n,i,o){var s=this;validateCallback(o);if(n===0){return l.default.nextTick((function(){if(o)o(null,0,t)}))}(0,f.default)((function(){try{var a=s.readBase(e,t,r,n,i);o(null,a,t)}catch(e){o(e)}}))};Volume.prototype.readFileBase=function(e,t,r){var n;var i=typeof e==="number";var o=i&&isFd(e);var s;if(o)s=e;else{var a=pathToFilename(e);var c=filenameToSteps(a);var u=this.getResolvedLink(c);if(u){var f=u.getNode();if(f.isDirectory())throw createError(z,"open",u.getPath())}s=this.openSync(e,t)}try{n=bufferToEncoding(this.getFileByFdOrThrow(s).getBuffer(),r)}finally{if(!o){this.closeSync(s)}}return n};Volume.prototype.readFileSync=function(e,t){var r=se(t);var n=flagsToNumber(r.flag);return this.readFileBase(e,n,r.encoding)};Volume.prototype.readFile=function(e,t,r){var n=optsAndCbGenerator(se)(t,r),i=n[0],o=n[1];var s=flagsToNumber(i.flag);this.wrapAsync(this.readFileBase,[e,s,i.encoding],o)};Volume.prototype.writeBase=function(e,t,r,n,i){var o=this.getFileByFdOrThrow(e,"write");return o.write(t,r,n,i)};Volume.prototype.writeSync=function(e,t,r,n,i){validateFd(e);var o;var s;var a;var c;var u=typeof t!=="string";if(u){s=(r||0)|0;a=n;c=i}else{c=r;o=n}var f=dataToBuffer(t,o);if(u){if(typeof a==="undefined"){a=f.length}}else{s=0;a=f.length}return this.writeBase(e,f,s,a,c)};Volume.prototype.write=function(e,t,r,n,i,o){var s=this;validateFd(e);var a;var c;var u;var l;var p;var d=typeof t;var h=typeof r;var m=typeof n;var y=typeof i;if(d!=="string"){if(h==="function"){p=r}else if(m==="function"){a=r|0;p=n}else if(y==="function"){a=r|0;c=n;p=i}else{a=r|0;c=n;u=i;p=o}}else{if(h==="function"){p=r}else if(m==="function"){u=r;p=n}else if(y==="function"){u=r;l=n;p=i}}var v=dataToBuffer(t,l);if(d!=="string"){if(typeof c==="undefined")c=v.length}else{a=0;c=v.length}var g=validateCallback(p);(0,f.default)((function(){try{var r=s.writeBase(e,v,a,c,u);if(d!=="string"){g(null,r,v)}else{g(null,r,t)}}catch(e){g(e)}}))};Volume.prototype.writeFileBase=function(e,t,r,n){var i=typeof e==="number";var o;if(i)o=e;else{o=this.openBase(pathToFilename(e),r,n)}var s=0;var a=t.length;var c=r&N?undefined:0;try{while(a>0){var u=this.writeSync(o,t,s,a,c);s+=u;a-=u;if(c!==undefined)c+=u}}finally{if(!i)this.closeSync(o)}};Volume.prototype.writeFileSync=function(e,t,r){var n=ce(r);var i=flagsToNumber(n.flag);var o=modeToNumber(n.mode);var s=dataToBuffer(t,n.encoding);this.writeFileBase(e,s,i,o)};Volume.prototype.writeFile=function(e,t,r,n){var i=r;var o=n;if(typeof r==="function"){i=ae;o=r}var s=validateCallback(o);var a=ce(i);var c=flagsToNumber(a.flag);var u=modeToNumber(a.mode);var f=dataToBuffer(t,a.encoding);this.wrapAsync(this.writeFileBase,[e,f,c,u],s)};Volume.prototype.linkBase=function(e,t){var r=filenameToSteps(e);var n=this.getLink(r);if(!n)throw createError(H,"link",e,t);var i=filenameToSteps(t);var o=this.getLinkParent(i);if(!o)throw createError(H,"link",e,t);var s=i[i.length-1];if(o.getChild(s))throw createError(q,"link",e,t);var a=n.getNode();a.nlink++;o.createChild(s,a)};Volume.prototype.copyFileBase=function(e,t,r){var n=this.readFileSync(e);if(r&A){if(this.existsSync(t)){throw createError(q,"copyFile",e,t)}}if(r&C){throw createError(Q,"copyFile",e,t)}this.writeFileBase(t,n,te.w,438)};Volume.prototype.copyFileSync=function(e,t,r){var n=pathToFilename(e);var i=pathToFilename(t);return this.copyFileBase(n,i,(r||0)|0)};Volume.prototype.copyFile=function(e,t,r,n){var i=pathToFilename(e);var o=pathToFilename(t);var s;var a;if(typeof r==="function"){s=0;a=r}else{s=r;a=n}validateCallback(a);this.wrapAsync(this.copyFileBase,[i,o,s],a)};Volume.prototype.linkSync=function(e,t){var r=pathToFilename(e);var n=pathToFilename(t);this.linkBase(r,n)};Volume.prototype.link=function(e,t,r){var n=pathToFilename(e);var i=pathToFilename(t);this.wrapAsync(this.linkBase,[n,i],r)};Volume.prototype.unlinkBase=function(e){var t=filenameToSteps(e);var r=this.getLink(t);if(!r)throw createError(H,"unlink",e);if(r.length)throw Error("Dir not empty...");this.deleteLink(r);var n=r.getNode();n.nlink--;if(n.nlink<=0){this.deleteNode(n)}};Volume.prototype.unlinkSync=function(e){var t=pathToFilename(e);this.unlinkBase(t)};Volume.prototype.unlink=function(e,t){var r=pathToFilename(e);this.wrapAsync(this.unlinkBase,[r],t)};Volume.prototype.symlinkBase=function(e,t){var r=filenameToSteps(t);var n=this.getLinkParent(r);if(!n)throw createError(H,"symlink",e,t);var i=r[r.length-1];if(n.getChild(i))throw createError(q,"symlink",e,t);var o=n.createChild(i);o.getNode().makeSymlink(filenameToSteps(e));return o};Volume.prototype.symlinkSync=function(e,t,r){var n=pathToFilename(e);var i=pathToFilename(t);this.symlinkBase(n,i)};Volume.prototype.symlink=function(e,t,r,n){var i=validateCallback(typeof r==="function"?r:n);var o=pathToFilename(e);var s=pathToFilename(t);this.wrapAsync(this.symlinkBase,[o,s],i)};Volume.prototype.realpathBase=function(e,t){var r=filenameToSteps(e);var n=this.getResolvedLink(r);if(!n)throw createError(H,"realpath",e);return(0,y.strToEncoding)(n.getPath()||"/",t)};Volume.prototype.realpathSync=function(e,t){return this.realpathBase(pathToFilename(e),de(t).encoding)};Volume.prototype.realpath=function(e,t,r){var n=he(t,r),i=n[0],o=n[1];var s=pathToFilename(e);this.wrapAsync(this.realpathBase,[s,i.encoding],o)};Volume.prototype.lstatBase=function(e,t,r){if(t===void 0){t=false}if(r===void 0){r=false}var n=this.getLink(filenameToSteps(e));if(n){return a.default.build(n.getNode(),t)}else if(!r){return undefined}else{throw createError(H,"lstat",e)}};Volume.prototype.lstatSync=function(e,t){var r=getStatOptions(t),n=r.throwIfNoEntry,i=n===void 0?true:n,o=r.bigint,s=o===void 0?false:o;return this.lstatBase(pathToFilename(e),s,i)};Volume.prototype.lstat=function(e,t,r){var n=getStatOptsAndCb(t,r),i=n[0],o=i.throwIfNoEntry,s=o===void 0?true:o,a=i.bigint,c=a===void 0?false:a,u=n[1];this.wrapAsync(this.lstatBase,[pathToFilename(e),c,s],u)};Volume.prototype.statBase=function(e,t,r){if(t===void 0){t=false}if(r===void 0){r=true}var n=this.getResolvedLink(filenameToSteps(e));if(n){return a.default.build(n.getNode(),t)}else if(!r){return undefined}else{throw createError(H,"stat",e)}};Volume.prototype.statSync=function(e,t){var r=getStatOptions(t),n=r.bigint,i=n===void 0?true:n,o=r.throwIfNoEntry,s=o===void 0?true:o;return this.statBase(pathToFilename(e),i,s)};Volume.prototype.stat=function(e,t,r){var n=getStatOptsAndCb(t,r),i=n[0],o=i.bigint,s=o===void 0?false:o,a=i.throwIfNoEntry,c=a===void 0?true:a,u=n[1];this.wrapAsync(this.statBase,[pathToFilename(e),s,c],u)};Volume.prototype.fstatBase=function(e,t){if(t===void 0){t=false}var r=this.getFileByFd(e);if(!r)throw createError(j,"fstat");return a.default.build(r.node,t)};Volume.prototype.fstatSync=function(e,t){return this.fstatBase(e,getStatOptions(t).bigint)};Volume.prototype.fstat=function(e,t,r){var n=getStatOptsAndCb(t,r),i=n[0],o=n[1];this.wrapAsync(this.fstatBase,[e,i.bigint],o)};Volume.prototype.renameBase=function(e,t){var r=this.getLink(filenameToSteps(e));if(!r)throw createError(H,"rename",e,t);var n=filenameToSteps(t);var o=this.getLinkParent(n);if(!o)throw createError(H,"rename",e,t);var s=r.parent;if(s){s.deleteChild(r)}var a=n[n.length-1];r.name=a;r.steps=i(i([],o.steps,true),[a],false);o.setChild(r.getName(),r)};Volume.prototype.renameSync=function(e,t){var r=pathToFilename(e);var n=pathToFilename(t);this.renameBase(r,n)};Volume.prototype.rename=function(e,t,r){var n=pathToFilename(e);var i=pathToFilename(t);this.wrapAsync(this.renameBase,[n,i],r)};Volume.prototype.existsBase=function(e){return!!this.statBase(e)};Volume.prototype.existsSync=function(e){try{return this.existsBase(pathToFilename(e))}catch(e){return false}};Volume.prototype.exists=function(e,t){var r=this;var n=pathToFilename(e);if(typeof t!=="function")throw Error(W.CB);(0,f.default)((function(){try{t(r.existsBase(n))}catch(e){t(false)}}))};Volume.prototype.accessBase=function(e,t){var r=this.getLinkOrThrow(e,"access")};Volume.prototype.accessSync=function(e,t){if(t===void 0){t=I}var r=pathToFilename(e);t=t|0;this.accessBase(r,t)};Volume.prototype.access=function(e,t,r){var n=I;var i;if(typeof t!=="function"){n=t|0;i=validateCallback(r)}else{i=t}var o=pathToFilename(e);this.wrapAsync(this.accessBase,[o,n],i)};Volume.prototype.appendFileSync=function(e,t,r){if(r===void 0){r=ue}var n=fe(r);if(!n.flag||isFd(e))n.flag="a";this.writeFileSync(e,t,n)};Volume.prototype.appendFile=function(e,t,r,n){var i=le(r,n),o=i[0],s=i[1];if(!o.flag||isFd(e))o.flag="a";this.writeFile(e,t,o,s)};Volume.prototype.readdirBase=function(e,t){var r=filenameToSteps(e);var n=this.getResolvedLink(r);if(!n)throw createError(H,"readdir",e);var i=n.getNode();if(!i.isDirectory())throw createError($,"scandir",e);if(t.withFileTypes){var o=[];for(var s in n.children){var a=n.getChild(s);if(!a){continue}o.push(c.default.build(a,t.encoding))}if(!U&&t.encoding!=="buffer")o.sort((function(e,t){if(e.name<t.name)return-1;if(e.name>t.name)return 1;return 0}));return o}var u=[];for(var f in n.children){u.push((0,y.strToEncoding)(f,t.encoding))}if(!U&&t.encoding!=="buffer")u.sort();return u};Volume.prototype.readdirSync=function(e,t){var r=be(t);var n=pathToFilename(e);return this.readdirBase(n,r)};Volume.prototype.readdir=function(e,t,r){var n=Ee(t,r),i=n[0],o=n[1];var s=pathToFilename(e);this.wrapAsync(this.readdirBase,[s,i],o)};Volume.prototype.readlinkBase=function(e,t){var r=this.getLinkOrThrow(e,"readlink");var n=r.getNode();if(!n.isSymlink())throw createError(G,"readlink",e);var i=V+n.symlink.join(V);return(0,y.strToEncoding)(i,t)};Volume.prototype.readlinkSync=function(e,t){var r=ne(t);var n=pathToFilename(e);return this.readlinkBase(n,r.encoding)};Volume.prototype.readlink=function(e,t,r){var n=ie(t,r),i=n[0],o=n[1];var s=pathToFilename(e);this.wrapAsync(this.readlinkBase,[s,i.encoding],o)};Volume.prototype.fsyncBase=function(e){this.getFileByFdOrThrow(e,"fsync")};Volume.prototype.fsyncSync=function(e){this.fsyncBase(e)};Volume.prototype.fsync=function(e,t){this.wrapAsync(this.fsyncBase,[e],t)};Volume.prototype.fdatasyncBase=function(e){this.getFileByFdOrThrow(e,"fdatasync")};Volume.prototype.fdatasyncSync=function(e){this.fdatasyncBase(e)};Volume.prototype.fdatasync=function(e,t){this.wrapAsync(this.fdatasyncBase,[e],t)};Volume.prototype.ftruncateBase=function(e,t){var r=this.getFileByFdOrThrow(e,"ftruncate");r.truncate(t)};Volume.prototype.ftruncateSync=function(e,t){this.ftruncateBase(e,t)};Volume.prototype.ftruncate=function(e,t,r){var n=typeof t==="number"?t:0;var i=validateCallback(typeof t==="number"?r:t);this.wrapAsync(this.ftruncateBase,[e,n],i)};Volume.prototype.truncateBase=function(e,t){var r=this.openSync(e,"r+");try{this.ftruncateSync(r,t)}finally{this.closeSync(r)}};Volume.prototype.truncateSync=function(e,t){if(isFd(e))return this.ftruncateSync(e,t);this.truncateBase(e,t)};Volume.prototype.truncate=function(e,t,r){var n=typeof t==="number"?t:0;var i=validateCallback(typeof t==="number"?r:t);if(isFd(e))return this.ftruncate(e,n,i);this.wrapAsync(this.truncateBase,[e,n],i)};Volume.prototype.futimesBase=function(e,t,r){var n=this.getFileByFdOrThrow(e,"futimes");var i=n.node;i.atime=new Date(t*1e3);i.mtime=new Date(r*1e3)};Volume.prototype.futimesSync=function(e,t,r){this.futimesBase(e,toUnixTimestamp(t),toUnixTimestamp(r))};Volume.prototype.futimes=function(e,t,r,n){this.wrapAsync(this.futimesBase,[e,toUnixTimestamp(t),toUnixTimestamp(r)],n)};Volume.prototype.utimesBase=function(e,t,r){var n=this.openSync(e,"r");try{this.futimesBase(n,t,r)}finally{this.closeSync(n)}};Volume.prototype.utimesSync=function(e,t,r){this.utimesBase(pathToFilename(e),toUnixTimestamp(t),toUnixTimestamp(r))};Volume.prototype.utimes=function(e,t,r,n){this.wrapAsync(this.utimesBase,[pathToFilename(e),toUnixTimestamp(t),toUnixTimestamp(r)],n)};Volume.prototype.mkdirBase=function(e,t){var r=filenameToSteps(e);if(!r.length){throw createError(q,"mkdir",e)}var n=this.getLinkParentAsDirOrThrow(e,"mkdir");var i=r[r.length-1];if(n.getChild(i))throw createError(q,"mkdir",e);n.createChild(i,this.createNode(true,t))};Volume.prototype.mkdirpBase=function(e,t){var r=resolve(e);var n=r.substring(1);var i=!n?[]:n.split(V);var o=this.root;var s=false;for(var a=0;a<i.length;a++){var c=i[a];if(!o.getNode().isDirectory())throw createError($,"mkdir",o.getPath());var u=o.getChild(c);if(u){if(u.getNode().isDirectory())o=u;else throw createError($,"mkdir",u.getPath())}else{o=o.createChild(c,this.createNode(true,t));s=true}}return s?r:undefined};Volume.prototype.mkdirSync=function(e,t){var r=getMkdirOptions(t);var n=modeToNumber(r.mode,511);var i=pathToFilename(e);if(r.recursive)return this.mkdirpBase(i,n);this.mkdirBase(i,n)};Volume.prototype.mkdir=function(e,t,r){var n=getMkdirOptions(t);var i=validateCallback(typeof t==="function"?t:r);var o=modeToNumber(n.mode,511);var s=pathToFilename(e);if(n.recursive)this.wrapAsync(this.mkdirpBase,[s,o],i);else this.wrapAsync(this.mkdirBase,[s,o],i)};Volume.prototype.mkdirpSync=function(e,t){return this.mkdirSync(e,{mode:t,recursive:true})};Volume.prototype.mkdirp=function(e,t,r){var n=typeof t==="function"?undefined:t;var i=validateCallback(typeof t==="function"?t:r);this.mkdir(e,{mode:n,recursive:true},i)};Volume.prototype.mkdtempBase=function(e,t,r){if(r===void 0){r=5}var n=e+this.genRndStr();try{this.mkdirBase(n,511);return(0,y.strToEncoding)(n,t)}catch(n){if(n.code===q){if(r>1)return this.mkdtempBase(e,t,r-1);else throw Error("Could not create temp dir.")}else throw n}};Volume.prototype.mkdtempSync=function(e,t){var r=ne(t).encoding;if(!e||typeof e!=="string")throw new TypeError("filename prefix is required");nullCheck(e);return this.mkdtempBase(e,r)};Volume.prototype.mkdtemp=function(e,t,r){var n=ie(t,r),i=n[0].encoding,o=n[1];if(!e||typeof e!=="string")throw new TypeError("filename prefix is required");if(!nullCheck(e))return;this.wrapAsync(this.mkdtempBase,[e,i],o)};Volume.prototype.rmdirBase=function(e,t){var r=getRmdirOptions(t);var n=this.getLinkAsDirOrThrow(e,"rmdir");if(n.length&&!r.recursive)throw createError(Z,"rmdir",e);this.deleteLink(n)};Volume.prototype.rmdirSync=function(e,t){this.rmdirBase(pathToFilename(e),t)};Volume.prototype.rmdir=function(e,t,r){var n=getRmdirOptions(t);var i=validateCallback(typeof t==="function"?t:r);this.wrapAsync(this.rmdirBase,[pathToFilename(e),n],i)};Volume.prototype.rmBase=function(e,t){if(t===void 0){t={}}var r=this.getResolvedLink(e);if(!r){if(!t.force)throw createError(H,"stat",e);return}if(r.getNode().isDirectory()){if(!t.recursive){throw createError(ee,"rm",e)}}this.deleteLink(r)};Volume.prototype.rmSync=function(e,t){this.rmBase(pathToFilename(e),t)};Volume.prototype.rm=function(e,t,r){var n=ge(t,r),i=n[0],o=n[1];this.wrapAsync(this.rmBase,[pathToFilename(e),i],o)};Volume.prototype.fchmodBase=function(e,t){var r=this.getFileByFdOrThrow(e,"fchmod");r.chmod(t)};Volume.prototype.fchmodSync=function(e,t){this.fchmodBase(e,modeToNumber(t))};Volume.prototype.fchmod=function(e,t,r){this.wrapAsync(this.fchmodBase,[e,modeToNumber(t)],r)};Volume.prototype.chmodBase=function(e,t){var r=this.openSync(e,"r");try{this.fchmodBase(r,t)}finally{this.closeSync(r)}};Volume.prototype.chmodSync=function(e,t){var r=modeToNumber(t);var n=pathToFilename(e);this.chmodBase(n,r)};Volume.prototype.chmod=function(e,t,r){var n=modeToNumber(t);var i=pathToFilename(e);this.wrapAsync(this.chmodBase,[i,n],r)};Volume.prototype.lchmodBase=function(e,t){var r=this.openBase(e,F,0,false);try{this.fchmodBase(r,t)}finally{this.closeSync(r)}};Volume.prototype.lchmodSync=function(e,t){var r=modeToNumber(t);var n=pathToFilename(e);this.lchmodBase(n,r)};Volume.prototype.lchmod=function(e,t,r){var n=modeToNumber(t);var i=pathToFilename(e);this.wrapAsync(this.lchmodBase,[i,n],r)};Volume.prototype.fchownBase=function(e,t,r){this.getFileByFdOrThrow(e,"fchown").chown(t,r)};Volume.prototype.fchownSync=function(e,t,r){validateUid(t);validateGid(r);this.fchownBase(e,t,r)};Volume.prototype.fchown=function(e,t,r,n){validateUid(t);validateGid(r);this.wrapAsync(this.fchownBase,[e,t,r],n)};Volume.prototype.chownBase=function(e,t,r){var n=this.getResolvedLinkOrThrow(e,"chown");var i=n.getNode();i.chown(t,r)};Volume.prototype.chownSync=function(e,t,r){validateUid(t);validateGid(r);this.chownBase(pathToFilename(e),t,r)};Volume.prototype.chown=function(e,t,r,n){validateUid(t);validateGid(r);this.wrapAsync(this.chownBase,[pathToFilename(e),t,r],n)};Volume.prototype.lchownBase=function(e,t,r){this.getLinkOrThrow(e,"lchown").getNode().chown(t,r)};Volume.prototype.lchownSync=function(e,t,r){validateUid(t);validateGid(r);this.lchownBase(pathToFilename(e),t,r)};Volume.prototype.lchown=function(e,t,r,n){validateUid(t);validateGid(r);this.wrapAsync(this.lchownBase,[pathToFilename(e),t,r],n)};Volume.prototype.watchFile=function(e,t,r){var n=pathToFilename(e);var i=t;var o=r;if(typeof i==="function"){o=t;i=null}if(typeof o!=="function"){throw Error('"watchFile()" requires a listener function')}var s=5007;var a=true;if(i&&typeof i==="object"){if(typeof i.interval==="number")s=i.interval;if(typeof i.persistent==="boolean")a=i.persistent}var c=this.statWatchers[n];if(!c){c=new this.StatWatcher;c.start(n,a,s);this.statWatchers[n]=c}c.addListener("change",o);return c};Volume.prototype.unwatchFile=function(e,t){var r=pathToFilename(e);var n=this.statWatchers[r];if(!n)return;if(typeof t==="function"){n.removeListener("change",t)}else{n.removeAllListeners("change")}if(n.listenerCount("change")===0){n.stop();delete this.statWatchers[r]}};Volume.prototype.createReadStream=function(e,t){return new this.ReadStream(e,t)};Volume.prototype.createWriteStream=function(e,t){return new this.WriteStream(e,t)};Volume.prototype.watch=function(e,t,r){var n=pathToFilename(e);var i=t;if(typeof t==="function"){r=t;i=null}var o=ne(i),s=o.persistent,a=o.recursive,c=o.encoding;if(s===undefined)s=true;if(a===undefined)a=false;var u=new this.FSWatcher;u.start(n,s,a,c);if(r){u.addListener("change",r)}return u};Volume.fd=2147483647;return Volume}();t.Volume=Te;function emitStop(e){e.emit("stop")}var Re=function(e){n(StatWatcher,e);function StatWatcher(t){var r=e.call(this)||this;r.onInterval=function(){try{var e=r.vol.statSync(r.filename);if(r.hasChanged(e)){r.emit("change",e,r.prev);r.prev=e}}finally{r.loop()}};r.vol=t;return r}StatWatcher.prototype.loop=function(){this.timeoutRef=this.setTimeout(this.onInterval,this.interval)};StatWatcher.prototype.hasChanged=function(e){if(e.mtimeMs>this.prev.mtimeMs)return true;if(e.nlink!==this.prev.nlink)return true;return false};StatWatcher.prototype.start=function(e,t,r){if(t===void 0){t=true}if(r===void 0){r=5007}this.filename=pathToFilename(e);this.setTimeout=t?setTimeout.bind(typeof globalThis!=="undefined"?globalThis:global):p.default;this.interval=r;this.prev=this.vol.statSync(this.filename);this.loop()};StatWatcher.prototype.stop=function(){clearTimeout(this.timeoutRef);l.default.nextTick(emitStop,this)};return StatWatcher}(m.EventEmitter);t.StatWatcher=Re;var ke;function allocNewPool(e){ke=(0,u.bufferAllocUnsafe)(e);ke.used=0}g.inherits(FsReadStream,d.Readable);t.ReadStream=FsReadStream;function FsReadStream(e,t,r){if(!(this instanceof FsReadStream))return new FsReadStream(e,t,r);this._vol=e;r=Object.assign({},getOptions(r,{}));if(r.highWaterMark===undefined)r.highWaterMark=64*1024;d.Readable.call(this,r);this.path=pathToFilename(t);this.fd=r.fd===undefined?null:r.fd;this.flags=r.flags===undefined?"r":r.flags;this.mode=r.mode===undefined?438:r.mode;this.start=r.start;this.end=r.end;this.autoClose=r.autoClose===undefined?true:r.autoClose;this.pos=undefined;this.bytesRead=0;if(this.start!==undefined){if(typeof this.start!=="number"){throw new TypeError('"start" option must be a Number')}if(this.end===undefined){this.end=Infinity}else if(typeof this.end!=="number"){throw new TypeError('"end" option must be a Number')}if(this.start>this.end){throw new Error('"start" option must be <= "end" option')}this.pos=this.start}if(typeof this.fd!=="number")this.open();this.on("end",(function(){if(this.autoClose){if(this.destroy)this.destroy()}}))}FsReadStream.prototype.open=function(){var e=this;this._vol.open(this.path,this.flags,this.mode,(function(t,r){if(t){if(e.autoClose){if(e.destroy)e.destroy()}e.emit("error",t);return}e.fd=r;e.emit("open",r);e.read()}))};FsReadStream.prototype._read=function(e){if(typeof this.fd!=="number"){return this.once("open",(function(){this._read(e)}))}if(this.destroyed)return;if(!ke||ke.length-ke.used<M){allocNewPool(this._readableState.highWaterMark)}var t=ke;var r=Math.min(ke.length-ke.used,e);var n=ke.used;if(this.pos!==undefined)r=Math.min(this.end-this.pos+1,r);if(r<=0)return this.push(null);var i=this;this._vol.read(this.fd,ke,ke.used,r,this.pos,onread);if(this.pos!==undefined)this.pos+=r;ke.used+=r;function onread(e,r){if(e){if(i.autoClose&&i.destroy){i.destroy()}i.emit("error",e)}else{var o=null;if(r>0){i.bytesRead+=r;o=t.slice(n,n+r)}i.push(o)}}};FsReadStream.prototype._destroy=function(e,t){this.close((function(r){t(e||r)}))};FsReadStream.prototype.close=function(e){var t=this;var r;if(e)this.once("close",e);if(this.closed||typeof this.fd!=="number"){if(typeof this.fd!=="number"){this.once("open",closeOnOpen);return}return l.default.nextTick((function(){return t.emit("close")}))}if(typeof((r=this._readableState)===null||r===void 0?void 0:r.closed)==="boolean"){this._readableState.closed=true}else{this.closed=true}this._vol.close(this.fd,(function(e){if(e)t.emit("error",e);else t.emit("close")}));this.fd=null};function closeOnOpen(e){this.close()}g.inherits(FsWriteStream,d.Writable);t.WriteStream=FsWriteStream;function FsWriteStream(e,t,r){if(!(this instanceof FsWriteStream))return new FsWriteStream(e,t,r);this._vol=e;r=Object.assign({},getOptions(r,{}));d.Writable.call(this,r);this.path=pathToFilename(t);this.fd=r.fd===undefined?null:r.fd;this.flags=r.flags===undefined?"w":r.flags;this.mode=r.mode===undefined?438:r.mode;this.start=r.start;this.autoClose=r.autoClose===undefined?true:!!r.autoClose;this.pos=undefined;this.bytesWritten=0;if(this.start!==undefined){if(typeof this.start!=="number"){throw new TypeError('"start" option must be a Number')}if(this.start<0){throw new Error('"start" must be >= zero')}this.pos=this.start}if(r.encoding)this.setDefaultEncoding(r.encoding);if(typeof this.fd!=="number")this.open();this.once("finish",(function(){if(this.autoClose){this.close()}}))}FsWriteStream.prototype.open=function(){this._vol.open(this.path,this.flags,this.mode,function(e,t){if(e){if(this.autoClose&&this.destroy){this.destroy()}this.emit("error",e);return}this.fd=t;this.emit("open",t)}.bind(this))};FsWriteStream.prototype._write=function(e,t,r){if(!(e instanceof u.Buffer||e instanceof Uint8Array))return this.emit("error",new Error("Invalid data"));if(typeof this.fd!=="number"){return this.once("open",(function(){this._write(e,t,r)}))}var n=this;this._vol.write(this.fd,e,0,e.length,this.pos,(function(e,t){if(e){if(n.autoClose&&n.destroy){n.destroy()}return r(e)}n.bytesWritten+=t;r()}));if(this.pos!==undefined)this.pos+=e.length};FsWriteStream.prototype._writev=function(e,t){if(typeof this.fd!=="number"){return this.once("open",(function(){this._writev(e,t)}))}var r=this;var n=e.length;var i=new Array(n);var o=0;for(var s=0;s<n;s++){var a=e[s].chunk;i[s]=a;o+=a.length}var c=u.Buffer.concat(i);this._vol.write(this.fd,c,0,c.length,this.pos,(function(e,n){if(e){if(r.destroy)r.destroy();return t(e)}r.bytesWritten+=n;t()}));if(this.pos!==undefined)this.pos+=o};FsWriteStream.prototype.close=function(e){var t=this;var r;if(e)this.once("close",e);if(this.closed||typeof this.fd!=="number"){if(typeof this.fd!=="number"){this.once("open",closeOnOpen);return}return l.default.nextTick((function(){return t.emit("close")}))}if(typeof((r=this._writableState)===null||r===void 0?void 0:r.closed)==="boolean"){this._writableState.closed=true}else{this.closed=true}this._vol.close(this.fd,(function(e){if(e)t.emit("error",e);else t.emit("close")}));this.fd=null};FsWriteStream.prototype._destroy=FsReadStream.prototype._destroy;FsWriteStream.prototype.destroySoon=FsWriteStream.prototype.end;var Ne=function(e){n(FSWatcher,e);function FSWatcher(t){var r=e.call(this)||this;r._filename="";r._filenameEncoded="";r._recursive=false;r._encoding=y.ENCODING_UTF8;r._onNodeChange=function(){r._emit("change")};r._onParentChild=function(e){if(e.getName()===r._getName()){r._emit("rename")}};r._emit=function(e){r.emit("change",e,r._filenameEncoded)};r._persist=function(){r._timer=setTimeout(r._persist,1e6)};r._vol=t;return r}FSWatcher.prototype._getName=function(){return this._steps[this._steps.length-1]};FSWatcher.prototype.start=function(e,t,r,n){if(t===void 0){t=true}if(r===void 0){r=false}if(n===void 0){n=y.ENCODING_UTF8}this._filename=pathToFilename(e);this._steps=filenameToSteps(this._filename);this._filenameEncoded=(0,y.strToEncoding)(this._filename);this._recursive=r;this._encoding=n;try{this._link=this._vol.getLinkOrThrow(this._filename,"FSWatcher")}catch(e){var i=new Error("watch ".concat(this._filename," ").concat(e.code));i.code=e.code;i.errno=e.code;throw i}this._link.getNode().on("change",this._onNodeChange);this._link.on("child:add",this._onNodeChange);this._link.on("child:delete",this._onNodeChange);var o=this._link.parent;if(o){o.setMaxListeners(o.getMaxListeners()+1);o.on("child:delete",this._onParentChild)}if(t)this._persist()};FSWatcher.prototype.close=function(){clearTimeout(this._timer);this._link.getNode().removeListener("change",this._onNodeChange);var e=this._link.parent;if(e){e.removeListener("child:delete",this._onParentChild)}};return FSWatcher}(m.EventEmitter);t.FSWatcher=Ne},68:e=>{"use strict";
2
2
  /*!
3
3
  * range-parser
4
4
  * Copyright(c) 2012-2014 TJ Holowaychuk
5
5
  * Copyright(c) 2015-2016 Douglas Christopher Wilson
6
6
  * MIT Licensed
7
- */e.exports=rangeParser;function rangeParser(e,t,r){if(typeof t!=="string"){throw new TypeError("argument str must be a string")}var n=t.indexOf("=");if(n===-1){return-2}var i=t.slice(n+1).split(",");var o=[];o.type=t.slice(0,n);for(var s=0;s<i.length;s++){var a=i[s].split("-");var c=parseInt(a[0],10);var u=parseInt(a[1],10);if(isNaN(c)){c=e-u;u=e-1}else if(isNaN(u)){u=e-1}if(u>e-1){u=e-1}if(isNaN(c)||isNaN(u)||c>u||c<0){continue}o.push({start:c,end:u})}if(o.length<1){return-1}return r&&r.combine?combineRanges(o):o}function combineRanges(e){var t=e.map(mapWithIndex).sort(sortByRangeStart);for(var r=0,n=1;n<t.length;n++){var i=t[n];var o=t[r];if(i.start>o.end+1){t[++r]=i}else if(i.end>o.end){o.end=i.end;o.index=Math.min(o.index,i.index)}}t.length=r+1;var s=t.sort(sortByRangeIndex).map(mapWithoutIndex);s.type=e.type;return s}function mapWithIndex(e,t){return{start:e.start,end:e.end,index:t}}function mapWithoutIndex(e){return{start:e.start,end:e.end}}function sortByRangeIndex(e,t){return e.index-t.index}function sortByRangeStart(e,t){return e.start-t.start}},523:(e,t,r)=>{"use strict";const{validate:n}=r(739);const i=r(989);const o=r(407);const s=r(647);const a=r(445);const c=r(972);const u=r(907);const f=r(932);const l=r(582);const noop=()=>{};function wdm(e,t={}){n(l,t,{name:"Dev Middleware",baseDataPath:"options"});const{mimeTypes:r}=t;if(r){const{types:e}=i;i.types={...e,...r}}const p={state:false,stats:undefined,callbacks:[],options:t,compiler:e,watching:undefined,logger:e.getInfrastructureLogger("webpack-dev-middleware"),outputFileSystem:undefined};a(p);if(t.writeToDisk){c(p)}u(p);if(p.compiler.watching){p.watching=p.compiler.watching}else{let e;const errorHandler=e=>{if(e){p.logger.error(e)}};if(Array.isArray(p.compiler.compilers)){e=p.compiler.compilers.map((e=>e.options.watchOptions||{}));p.watching=p.compiler.watch(e,errorHandler)}else{e=p.compiler.options.watchOptions||{};p.watching=p.compiler.watch(e,errorHandler)}}const d=o(p);d.getFilenameFromUrl=e=>s(p,e);d.waitUntilValid=(e=noop)=>{f(p,e)};d.invalidate=(e=noop)=>{f(p,e);p.watching.invalidate()};d.close=(e=noop)=>{p.watching.close(e)};d.context=p;return d}e.exports=wdm},407:(e,t,r)=>{"use strict";const n=r(17);const i=r(989);const o=r(68);const s=r(647);const{getHeaderNames:a,getHeaderFromRequest:c,getHeaderFromResponse:u,setHeaderForResponse:f,setStatusCode:l,send:p}=r(856);const d=r(932);function getValueContentRangeHeader(e,t,r){return`${e} ${r?`${r.start}-${r.end}`:"*"}/${t}`}function createHtmlDocument(e,t){return`${"<!DOCTYPE html>\n"+'<html lang="en">\n'+"<head>\n"+'<meta charset="utf-8">\n'+"<title>"}${e}</title>\n`+`</head>\n`+`<body>\n`+`<pre>${t}</pre>\n`+`</body>\n`+`</html>\n`}const h=/^ *bytes/i;function wrapper(e){return async function middleware(t,r,m){const y=e.options.methods||["GET","HEAD"];r.locals=r.locals||{};if(t.method&&!y.includes(t.method)){await goNext();return}d(e,processRequest,t);async function goNext(){if(!e.options.serverSideRender){return m()}return new Promise((n=>{d(e,(()=>{r.locals.webpack={devMiddleware:e};n(m())}),t)}))}async function processRequest(){const d=s(e,t.url);if(!d){await goNext();return}let{headers:m}=e.options;if(typeof m==="function"){m=m(t,r,e)}const y=[];if(typeof m!=="undefined"){if(!Array.isArray(m)){for(const e in m){y.push({key:e,value:m[e]})}m=y}m.forEach((e=>{f(r,e.key,e.value)}))}if(!u(r,"Content-Type")){const e=i.contentType(n.extname(d));if(e){f(r,"Content-Type",e)}}if(!u(r,"Accept-Ranges")){f(r,"Accept-Ranges","bytes")}const v=c(t,"range");let g;let _;if(v&&h.test(v)){const n=await new Promise((t=>{e.outputFileSystem.lstat(d,((r,n)=>{if(r){e.logger.error(r);return}t(n.size)}))}));const i=o(n,v,{combine:true});if(i===-1){const i="Unsatisfiable range for 'Range' header.";e.logger.error(i);const o=a(r);for(let e=0;e<o.length;e++){r.removeHeader(o[e])}l(r,416);f(r,"Content-Range",getValueContentRangeHeader("bytes",n));f(r,"Content-Type","text/html; charset=utf-8");const s=createHtmlDocument(416,`Error: ${i}`);const c=Buffer.byteLength(s);f(r,"Content-Length",Buffer.byteLength(s));p(t,r,s,c);return}else if(i===-2){e.logger.error("A malformed 'Range' header was provided. A regular response will be sent for this request.")}else if(i.length>1){e.logger.error("A 'Range' header with multiple ranges was provided. Multiple ranges are not supported, so a regular response will be sent for this request.")}if(i!==-2&&i.length===1){l(r,206);f(r,"Content-Range",getValueContentRangeHeader("bytes",n,i[0]));[{start:g,end:_}]=i}}const b=typeof e.outputFileSystem.createReadStream==="function";let S;let w;try{if(typeof g!=="undefined"&&typeof _!=="undefined"&&b){S=e.outputFileSystem.createReadStream(d,{start:g,end:_});w=_-g+1}else{S=e.outputFileSystem.readFileSync(d);({byteLength:w}=S)}}catch(e){await goNext();return}p(t,r,S,w)}}}e.exports=wrapper},856:e=>{"use strict";function getHeaderNames(e){if(typeof e.getHeaderNames!=="function"){return Object.keys(e._headers||{})}return e.getHeaderNames()}function getHeaderFromRequest(e,t){if(typeof e.get==="function"){return e.get(t)}return e.headers[t]}function getHeaderFromResponse(e,t){if(typeof e.get==="function"){return e.get(t)}return e.getHeader(t)}function setHeaderForResponse(e,t,r){if(typeof e.set==="function"){e.set(t,typeof r==="number"?String(r):r);return}e.setHeader(t,r)}function setStatusCode(e,t){if(typeof e.status==="function"){e.status(t);return}e.statusCode=t}function send(e,t,r,n){if(typeof r.pipe==="function"){setHeaderForResponse(t,"Content-Length",n);if(e.method==="HEAD"){t.end();return}r.pipe(t);return}if(typeof t.send==="function"){t.send(r);return}t.setHeader("Content-Length",n);if(e.method==="HEAD"){t.end()}else{t.end(r)}}e.exports={getHeaderNames:getHeaderNames,getHeaderFromRequest:getHeaderFromRequest,getHeaderFromResponse:getHeaderFromResponse,setHeaderForResponse:setHeaderForResponse,setStatusCode:setStatusCode,send:send}},647:(e,t,r)=>{"use strict";const n=r(17);const{parse:i}=r(310);const o=r(477);const s=r(779);const a=new WeakMap;const mem=(e,{cache:t=new Map}={})=>{const memoized=(...r)=>{const[n]=r;const i=t.get(n);if(i){return i.data}const o=e.apply(void 0,r);t.set(n,{data:o});return o};a.set(memoized,t);return memoized};const c=mem(i);function getFilenameFromUrl(e,t){const{options:r}=e;const i=s(e);let a;let u;try{u=c(t,false,true)}catch(e){return}for(const{publicPath:t,outputPath:s}of i){let i;let f;try{f=c(t!=="auto"&&t?t:"/",false,true)}catch(e){continue}if(u.pathname&&u.pathname.startsWith(f.pathname)){i=s;const t=u.pathname.slice(f.pathname.length);if(t){i=n.join(s,o.unescape(t))}let c;try{c=e.outputFileSystem.statSync(i)}catch(e){continue}if(c.isFile()){a=i;break}else if(c.isDirectory()&&(typeof r.index==="undefined"||r.index)){const t=typeof r.index==="undefined"||typeof r.index==="boolean"?"index.html":r.index;i=n.join(i,t);try{c=e.outputFileSystem.statSync(i)}catch(e){continue}if(c.isFile()){a=i;break}}}}return a}e.exports=getFilenameFromUrl},779:e=>{"use strict";function getPaths(e){const{stats:t,options:r}=e;const n=t.stats?t.stats:[t];const i=[];for(const{compilation:e}of n){const t=e.getPath(e.outputOptions.path||"");const n=r.publicPath?e.getPath(r.publicPath):e.outputOptions.publicPath?e.getPath(e.outputOptions.publicPath):"";i.push({outputPath:t,publicPath:n})}return i}e.exports=getPaths},932:e=>{"use strict";function ready(e,t,r){if(e.state){t(e.stats);return}const n=r&&r.url||t.name;e.logger.info(`wait until bundle finished${n?`: ${n}`:""}`);e.callbacks.push(t)}e.exports=ready},445:(e,t,r)=>{"use strict";const n=r(846);const{isColorSupported:i}=r(558);function setupHooks(e){function invalid(){if(e.state){e.logger.log("Compilation starting...")}e.state=false;e.stats=undefined}const t=n.Stats&&n.Stats.presetToOptions;function normalizeStatsOptions(e){if(t){if(typeof e==="undefined"){e={}}else if(typeof e==="boolean"||typeof e==="string"){e=n.Stats.presetToOptions(e)}return e}if(typeof e==="undefined"){e={preset:"normal"}}else if(typeof e==="boolean"){e=e?{preset:"normal"}:{preset:"none"}}else if(typeof e==="string"){e={preset:e}}return e}function done(r){e.state=true;e.stats=r;process.nextTick((()=>{const{compiler:n,logger:o,options:s,state:a,callbacks:c}=e;if(!a){return}o.log("Compilation finished");const u=Boolean(n.compilers);let f;if(typeof s.stats!=="undefined"){f=u?{children:n.compilers.map((()=>s.stats))}:s.stats}else{f=u?{children:n.compilers.map((e=>e.options.stats))}:n.options.stats}if(u){f.children=f.children.map((e=>{e=normalizeStatsOptions(e);if(typeof e.colors==="undefined"){e.colors=i}return e}))}else{f=normalizeStatsOptions(f);if(typeof f.colors==="undefined"){f.colors=i}}if(n.compilers&&t){f.colors=f.children.some((e=>e.colors))}const l=r.toString(f);if(l){console.log(l)}e.callbacks=[];c.forEach((e=>{e(r)}))}))}e.compiler.hooks.watchRun.tap("webpack-dev-middleware",invalid);e.compiler.hooks.invalid.tap("webpack-dev-middleware",invalid);e.compiler.hooks.done.tap("webpack-dev-middleware",done)}e.exports=setupHooks},907:(e,t,r)=>{"use strict";const n=r(17);const i=r(265);function setupOutputFileSystem(e){let t;if(e.options.outputFileSystem){const{outputFileSystem:r}=e.options;if(typeof r.join!=="function"){throw new Error("Invalid options: options.outputFileSystem.join() method is expected")}if(typeof r.mkdirp!=="function"){throw new Error("Invalid options: options.outputFileSystem.mkdirp() method is expected")}t=r}else{t=i.createFsFromVolume(new i.Volume);t.join=n.join.bind(n)}const r=e.compiler.compilers||[e.compiler];for(const e of r){e.outputFileSystem=t}e.outputFileSystem=t}e.exports=setupOutputFileSystem},972:(e,t,r)=>{"use strict";const n=r(147);const i=r(17);function setupWriteToDisk(e){const t=e.compiler.compilers||[e.compiler];for(const r of t){r.hooks.emit.tap("DevMiddleware",(t=>{if(r.hasWebpackDevMiddlewareAssetEmittedCallback){return}r.hooks.assetEmitted.tapAsync("DevMiddleware",((o,s,a)=>{let c;let u;if(s.compilation){({targetPath:c,content:u}=s)}else{let e=o;const n=e.indexOf("?");if(n>=0){e=e.slice(0,n)}let{outputPath:a}=r;a=t.getPath(a,{});u=s;c=i.join(a,e)}const{writeToDisk:f}=e.options;const l=f&&typeof f==="function"?f(c):true;if(!l){return a()}const p=i.dirname(c);const d=r.options.name?`Child "${r.options.name}": `:"";return n.mkdir(p,{recursive:true},(t=>{if(t){e.logger.error(`${d}Unable to write "${p}" directory to disk:\n${t}`);return a(t)}return n.writeFile(c,u,(t=>{if(t){e.logger.error(`${d}Unable to write "${c}" asset to disk:\n${t}`);return a(t)}e.logger.log(`${d}Asset written to disk: "${c}"`);return a()}))}))}));r.hasWebpackDevMiddlewareAssetEmittedCallback=true}))}}e.exports=setupWriteToDisk},989:e=>{"use strict";e.exports=require("../mime-types")},739:e=>{"use strict";e.exports=require("../schema-utils3")},491:e=>{"use strict";e.exports=require("assert")},300:e=>{"use strict";e.exports=require("buffer")},361:e=>{"use strict";e.exports=require("events")},147:e=>{"use strict";e.exports=require("fs")},17:e=>{"use strict";e.exports=require("path")},282:e=>{"use strict";e.exports=require("process")},477:e=>{"use strict";e.exports=require("querystring")},781:e=>{"use strict";e.exports=require("stream")},224:e=>{"use strict";e.exports=require("tty")},310:e=>{"use strict";e.exports=require("url")},837:e=>{"use strict";e.exports=require("util")},846:e=>{"use strict";e.exports=require("webpack")},558:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=r(224);function _interopNamespace(e){if(e&&e.__esModule)return e;var t=Object.create(null);if(e){Object.keys(e).forEach((function(r){if(r!=="default"){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:true,get:function(){return e[r]}})}}))}t["default"]=e;return Object.freeze(t)}var i=_interopNamespace(n);const{env:o={},argv:s=[],platform:a=""}=typeof process==="undefined"?{}:process;const c="NO_COLOR"in o||s.includes("--no-color");const u="FORCE_COLOR"in o||s.includes("--color");const f=a==="win32";const l=o.TERM==="dumb";const p=i&&i.isatty&&i.isatty(1)&&o.TERM&&!l;const d="CI"in o&&("GITHUB_ACTIONS"in o||"GITLAB_CI"in o||"CIRCLECI"in o);const h=!c&&(u||f&&!l||p||d);const replaceClose=(e,t,r,n,i=t.substring(0,e)+n,o=t.substring(e+r.length),s=o.indexOf(r))=>i+(s<0?o:replaceClose(s,o,r,n));const clearBleed=(e,t,r,n,i)=>e<0?r+t+n:r+replaceClose(e,t,n,i)+n;const filterEmpty=(e,t,r=e,n=e.length+1)=>i=>i||!(i===""||i===undefined)?clearBleed((""+i).indexOf(t,n),i,e,t,r):"";const init=(e,t,r)=>filterEmpty(`[${e}m`,`[${t}m`,r);const m={reset:init(0,0),bold:init(1,22,""),dim:init(2,22,""),italic:init(3,23),underline:init(4,24),inverse:init(7,27),hidden:init(8,28),strikethrough:init(9,29),black:init(30,39),red:init(31,39),green:init(32,39),yellow:init(33,39),blue:init(34,39),magenta:init(35,39),cyan:init(36,39),white:init(37,39),gray:init(90,39),bgBlack:init(40,49),bgRed:init(41,49),bgGreen:init(42,49),bgYellow:init(43,49),bgBlue:init(44,49),bgMagenta:init(45,49),bgCyan:init(46,49),bgWhite:init(47,49),blackBright:init(90,39),redBright:init(91,39),greenBright:init(92,39),yellowBright:init(93,39),blueBright:init(94,39),magentaBright:init(95,39),cyanBright:init(96,39),whiteBright:init(97,39),bgBlackBright:init(100,49),bgRedBright:init(101,49),bgGreenBright:init(102,49),bgYellowBright:init(103,49),bgBlueBright:init(104,49),bgMagentaBright:init(105,49),bgCyanBright:init(106,49),bgWhiteBright:init(107,49)};const createColors=({useColor:e=h}={})=>e?m:Object.keys(m).reduce(((e,t)=>({...e,[t]:String})),{});const{reset:y,bold:v,dim:g,italic:_,underline:b,inverse:S,hidden:w,strikethrough:F,black:T,red:R,green:k,yellow:N,blue:O,magenta:B,cyan:I,white:A,gray:C,bgBlack:L,bgRed:V,bgGreen:P,bgYellow:D,bgBlue:x,bgMagenta:U,bgCyan:M,bgWhite:W,blackBright:H,redBright:j,greenBright:G,yellowBright:K,blueBright:Y,magentaBright:q,cyanBright:$,whiteBright:J,bgBlackBright:X,bgRedBright:z,bgGreenBright:Z,bgYellowBright:Q,bgBlueBright:ee,bgMagentaBright:te,bgCyanBright:re,bgWhiteBright:ne}=createColors();t.bgBlack=L;t.bgBlackBright=X;t.bgBlue=x;t.bgBlueBright=ee;t.bgCyan=M;t.bgCyanBright=re;t.bgGreen=P;t.bgGreenBright=Z;t.bgMagenta=U;t.bgMagentaBright=te;t.bgRed=V;t.bgRedBright=z;t.bgWhite=W;t.bgWhiteBright=ne;t.bgYellow=D;t.bgYellowBright=Q;t.black=T;t.blackBright=H;t.blue=O;t.blueBright=Y;t.bold=v;t.createColors=createColors;t.cyan=I;t.cyanBright=$;t.dim=g;t.gray=C;t.green=k;t.greenBright=G;t.hidden=w;t.inverse=S;t.isColorSupported=h;t.italic=_;t.magenta=B;t.magentaBright=q;t.red=R;t.redBright=j;t.reset=y;t.strikethrough=F;t.underline=b;t.white=A;t.whiteBright=J;t.yellow=N;t.yellowBright=K},582:e=>{"use strict";e.exports=JSON.parse('{"type":"object","properties":{"mimeTypes":{"description":"Allows a user to register custom mime types or extension mappings.","link":"https://github.com/webpack/webpack-dev-middleware#mimetypes","type":"object"},"writeToDisk":{"description":"Allows to write generated files on disk.","link":"https://github.com/webpack/webpack-dev-middleware#writetodisk","anyOf":[{"type":"boolean"},{"instanceof":"Function"}]},"methods":{"description":"Allows to pass the list of HTTP request methods accepted by the middleware.","link":"https://github.com/webpack/webpack-dev-middleware#methods","type":"array","items":{"type":"string","minlength":"1"}},"headers":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"key":{"description":"key of header.","type":"string"},"value":{"description":"value of header.","type":"string"}}},"minItems":1},{"type":"object"},{"instanceof":"Function"}],"description":"Allows to pass custom HTTP headers on each request","link":"https://github.com/webpack/webpack-dev-middleware#headers"},"publicPath":{"description":"The `publicPath` specifies the public URL address of the output files when referenced in a browser.","link":"https://github.com/webpack/webpack-dev-middleware#publicpath","anyOf":[{"enum":["auto"]},{"type":"string"},{"instanceof":"Function"}]},"stats":{"description":"Stats options object or preset name.","link":"https://github.com/webpack/webpack-dev-middleware#stats","anyOf":[{"enum":["none","summary","errors-only","errors-warnings","minimal","normal","detailed","verbose"]},{"type":"boolean"},{"type":"object","additionalProperties":true}]},"serverSideRender":{"description":"Instructs the module to enable or disable the server-side rendering mode.","link":"https://github.com/webpack/webpack-dev-middleware#serversiderender","type":"boolean"},"outputFileSystem":{"description":"Set the default file system which will be used by webpack as primary destination of generated files.","link":"https://github.com/webpack/webpack-dev-middleware#outputfilesystem","type":"object"},"index":{"description":"Allows to serve an index of the directory.","link":"https://github.com/webpack/webpack-dev-middleware#index","anyOf":[{"type":"boolean"},{"type":"string","minlength":"1"}]}},"additionalProperties":false}')}};var t={};function __nccwpck_require__(r){var n=t[r];if(n!==undefined){return n.exports}var i=t[r]={exports:{}};var o=true;try{e[r].call(i.exports,i,i.exports,__nccwpck_require__);o=false}finally{if(o)delete t[r]}return i.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(523);module.exports=r})();
7
+ */e.exports=rangeParser;function rangeParser(e,t,r){if(typeof t!=="string"){throw new TypeError("argument str must be a string")}var n=t.indexOf("=");if(n===-1){return-2}var i=t.slice(n+1).split(",");var o=[];o.type=t.slice(0,n);for(var s=0;s<i.length;s++){var a=i[s].split("-");var c=parseInt(a[0],10);var u=parseInt(a[1],10);if(isNaN(c)){c=e-u;u=e-1}else if(isNaN(u)){u=e-1}if(u>e-1){u=e-1}if(isNaN(c)||isNaN(u)||c>u||c<0){continue}o.push({start:c,end:u})}if(o.length<1){return-1}return r&&r.combine?combineRanges(o):o}function combineRanges(e){var t=e.map(mapWithIndex).sort(sortByRangeStart);for(var r=0,n=1;n<t.length;n++){var i=t[n];var o=t[r];if(i.start>o.end+1){t[++r]=i}else if(i.end>o.end){o.end=i.end;o.index=Math.min(o.index,i.index)}}t.length=r+1;var s=t.sort(sortByRangeIndex).map(mapWithoutIndex);s.type=e.type;return s}function mapWithIndex(e,t){return{start:e.start,end:e.end,index:t}}function mapWithoutIndex(e){return{start:e.start,end:e.end}}function sortByRangeIndex(e,t){return e.index-t.index}function sortByRangeStart(e,t){return e.start-t.start}},553:(e,t,r)=>{"use strict";const{validate:n}=r(739);const i=r(989);const o=r(581);const s=r(120);const a=r(51);const c=r(54);const u=r(186);const f=r(634);const l=r(30);const noop=()=>{};function wdm(e,t={}){n(l,t,{name:"Dev Middleware",baseDataPath:"options"});const{mimeTypes:r}=t;if(r){const{types:e}=i;i.types={...e,...r}}const p={state:false,stats:undefined,callbacks:[],options:t,compiler:e,watching:undefined,logger:e.getInfrastructureLogger("webpack-dev-middleware"),outputFileSystem:undefined};a(p);if(t.writeToDisk){c(p)}u(p);if(p.compiler.watching){p.watching=p.compiler.watching}else{let e;const errorHandler=e=>{if(e){p.logger.error(e)}};if(Array.isArray(p.compiler.compilers)){e=p.compiler.compilers.map((e=>e.options.watchOptions||{}));p.watching=p.compiler.watch(e,errorHandler)}else{e=p.compiler.options.watchOptions||{};p.watching=p.compiler.watch(e,errorHandler)}}const d=o(p);d.getFilenameFromUrl=e=>s(p,e);d.waitUntilValid=(e=noop)=>{f(p,e)};d.invalidate=(e=noop)=>{f(p,e);p.watching.invalidate()};d.close=(e=noop)=>{p.watching.close(e)};d.context=p;return d}e.exports=wdm},581:(e,t,r)=>{"use strict";const n=r(17);const i=r(989);const o=r(68);const s=r(120);const{getHeaderNames:a,getHeaderFromRequest:c,getHeaderFromResponse:u,setHeaderForResponse:f,setStatusCode:l,send:p}=r(350);const d=r(634);function getValueContentRangeHeader(e,t,r){return`${e} ${r?`${r.start}-${r.end}`:"*"}/${t}`}function createHtmlDocument(e,t){return`${"<!DOCTYPE html>\n"+'<html lang="en">\n'+"<head>\n"+'<meta charset="utf-8">\n'+"<title>"}${e}</title>\n`+`</head>\n`+`<body>\n`+`<pre>${t}</pre>\n`+`</body>\n`+`</html>\n`}const h=/^ *bytes/i;function wrapper(e){return async function middleware(t,r,m){const y=e.options.methods||["GET","HEAD"];r.locals=r.locals||{};if(t.method&&!y.includes(t.method)){await goNext();return}d(e,processRequest,t);async function goNext(){if(!e.options.serverSideRender){return m()}return new Promise((n=>{d(e,(()=>{r.locals.webpack={devMiddleware:e};n(m())}),t)}))}async function processRequest(){const d=s(e,t.url);if(!d){await goNext();return}let{headers:m}=e.options;if(typeof m==="function"){m=m(t,r,e)}const y=[];if(typeof m!=="undefined"){if(!Array.isArray(m)){for(const e in m){y.push({key:e,value:m[e]})}m=y}m.forEach((e=>{f(r,e.key,e.value)}))}if(!u(r,"Content-Type")){const e=i.contentType(n.extname(d));if(e){f(r,"Content-Type",e)}}if(!u(r,"Accept-Ranges")){f(r,"Accept-Ranges","bytes")}const v=c(t,"range");let g;let _;if(v&&h.test(v)){const n=await new Promise((t=>{e.outputFileSystem.lstat(d,((r,n)=>{if(r){e.logger.error(r);return}t(n.size)}))}));const i=o(n,v,{combine:true});if(i===-1){const i="Unsatisfiable range for 'Range' header.";e.logger.error(i);const o=a(r);for(let e=0;e<o.length;e++){r.removeHeader(o[e])}l(r,416);f(r,"Content-Range",getValueContentRangeHeader("bytes",n));f(r,"Content-Type","text/html; charset=utf-8");const s=createHtmlDocument(416,`Error: ${i}`);const c=Buffer.byteLength(s);f(r,"Content-Length",Buffer.byteLength(s));p(t,r,s,c);return}else if(i===-2){e.logger.error("A malformed 'Range' header was provided. A regular response will be sent for this request.")}else if(i.length>1){e.logger.error("A 'Range' header with multiple ranges was provided. Multiple ranges are not supported, so a regular response will be sent for this request.")}if(i!==-2&&i.length===1){l(r,206);f(r,"Content-Range",getValueContentRangeHeader("bytes",n,i[0]));[{start:g,end:_}]=i}}const b=typeof e.outputFileSystem.createReadStream==="function";let S;let w;try{if(typeof g!=="undefined"&&typeof _!=="undefined"&&b){S=e.outputFileSystem.createReadStream(d,{start:g,end:_});w=_-g+1}else{S=e.outputFileSystem.readFileSync(d);({byteLength:w}=S)}}catch(e){await goNext();return}p(t,r,S,w)}}}e.exports=wrapper},350:e=>{"use strict";function getHeaderNames(e){if(typeof e.getHeaderNames!=="function"){return Object.keys(e._headers||{})}return e.getHeaderNames()}function getHeaderFromRequest(e,t){if(typeof e.get==="function"){return e.get(t)}return e.headers[t]}function getHeaderFromResponse(e,t){if(typeof e.get==="function"){return e.get(t)}return e.getHeader(t)}function setHeaderForResponse(e,t,r){if(typeof e.set==="function"){e.set(t,typeof r==="number"?String(r):r);return}e.setHeader(t,r)}function setStatusCode(e,t){if(typeof e.status==="function"){e.status(t);return}e.statusCode=t}function send(e,t,r,n){if(typeof r.pipe==="function"){setHeaderForResponse(t,"Content-Length",n);if(e.method==="HEAD"){t.end();return}r.pipe(t);return}if(typeof t.send==="function"){t.send(r);return}t.setHeader("Content-Length",n);if(e.method==="HEAD"){t.end()}else{t.end(r)}}e.exports={getHeaderNames:getHeaderNames,getHeaderFromRequest:getHeaderFromRequest,getHeaderFromResponse:getHeaderFromResponse,setHeaderForResponse:setHeaderForResponse,setStatusCode:setStatusCode,send:send}},120:(e,t,r)=>{"use strict";const n=r(17);const{parse:i}=r(310);const o=r(477);const s=r(319);const a=new WeakMap;const mem=(e,{cache:t=new Map}={})=>{const memoized=(...r)=>{const[n]=r;const i=t.get(n);if(i){return i.data}const o=e.apply(void 0,r);t.set(n,{data:o});return o};a.set(memoized,t);return memoized};const c=mem(i);function getFilenameFromUrl(e,t){const{options:r}=e;const i=s(e);let a;let u;try{u=c(t,false,true)}catch(e){return}for(const{publicPath:t,outputPath:s}of i){let i;let f;try{f=c(t!=="auto"&&t?t:"/",false,true)}catch(e){continue}if(u.pathname&&u.pathname.startsWith(f.pathname)){i=s;const t=u.pathname.slice(f.pathname.length);if(t){i=n.join(s,o.unescape(t))}let c;try{c=e.outputFileSystem.statSync(i)}catch(e){continue}if(c.isFile()){a=i;break}else if(c.isDirectory()&&(typeof r.index==="undefined"||r.index)){const t=typeof r.index==="undefined"||typeof r.index==="boolean"?"index.html":r.index;i=n.join(i,t);try{c=e.outputFileSystem.statSync(i)}catch(e){continue}if(c.isFile()){a=i;break}}}}return a}e.exports=getFilenameFromUrl},319:e=>{"use strict";function getPaths(e){const{stats:t,options:r}=e;const n=t.stats?t.stats:[t];const i=[];for(const{compilation:e}of n){const t=e.getPath(e.outputOptions.path||"");const n=r.publicPath?e.getPath(r.publicPath):e.outputOptions.publicPath?e.getPath(e.outputOptions.publicPath):"";i.push({outputPath:t,publicPath:n})}return i}e.exports=getPaths},634:e=>{"use strict";function ready(e,t,r){if(e.state){t(e.stats);return}const n=r&&r.url||t.name;e.logger.info(`wait until bundle finished${n?`: ${n}`:""}`);e.callbacks.push(t)}e.exports=ready},51:(e,t,r)=>{"use strict";const{isColorSupported:n}=r(558);function setupHooks(e){function invalid(){if(e.state){e.logger.log("Compilation starting...")}e.state=false;e.stats=undefined}function normalizeStatsOptions(e){if(typeof e==="undefined"){e={preset:"normal"}}else if(typeof e==="boolean"){e=e?{preset:"normal"}:{preset:"none"}}else if(typeof e==="string"){e={preset:e}}return e}function done(t){e.state=true;e.stats=t;process.nextTick((()=>{const{compiler:r,logger:i,options:o,state:s,callbacks:a}=e;if(!s){return}i.log("Compilation finished");const c=Boolean(r.compilers);let u;if(typeof o.stats!=="undefined"){u=c?{children:r.compilers.map((()=>o.stats))}:o.stats}else{u=c?{children:r.compilers.map((e=>e.options.stats))}:r.options.stats}if(c){u.children=u.children.map((e=>{e=normalizeStatsOptions(e);if(typeof e.colors==="undefined"){e.colors=n}return e}))}else{u=normalizeStatsOptions(u);if(typeof u.colors==="undefined"){u.colors=n}}const f=t.toString(u);if(f){console.log(f)}e.callbacks=[];a.forEach((e=>{e(t)}))}))}e.compiler.hooks.watchRun.tap("webpack-dev-middleware",invalid);e.compiler.hooks.invalid.tap("webpack-dev-middleware",invalid);e.compiler.hooks.done.tap("webpack-dev-middleware",done)}e.exports=setupHooks},186:(e,t,r)=>{"use strict";const n=r(949);function setupOutputFileSystem(e){let t;if(e.options.outputFileSystem){const{outputFileSystem:r}=e.options;t=r}else{t=n.createFsFromVolume(new n.Volume)}const r=e.compiler.compilers||[e.compiler];for(const e of r){e.outputFileSystem=t}e.outputFileSystem=t}e.exports=setupOutputFileSystem},54:(e,t,r)=>{"use strict";const n=r(147);const i=r(17);function setupWriteToDisk(e){const t=e.compiler.compilers||[e.compiler];for(const r of t){r.hooks.emit.tap("DevMiddleware",(t=>{if(r.hasWebpackDevMiddlewareAssetEmittedCallback){return}r.hooks.assetEmitted.tapAsync("DevMiddleware",((o,s,a)=>{let c;let u;if(s.compilation){({targetPath:c,content:u}=s)}else{let e=o;const n=e.indexOf("?");if(n>=0){e=e.slice(0,n)}let{outputPath:a}=r;a=t.getPath(a,{});u=s;c=i.join(a,e)}const{writeToDisk:f}=e.options;const l=f&&typeof f==="function"?f(c):true;if(!l){return a()}const p=i.dirname(c);const d=r.options.name?`Child "${r.options.name}": `:"";return n.mkdir(p,{recursive:true},(t=>{if(t){e.logger.error(`${d}Unable to write "${p}" directory to disk:\n${t}`);return a(t)}return n.writeFile(c,u,(t=>{if(t){e.logger.error(`${d}Unable to write "${c}" asset to disk:\n${t}`);return a(t)}e.logger.log(`${d}Asset written to disk: "${c}"`);return a()}))}))}));r.hasWebpackDevMiddlewareAssetEmittedCallback=true}))}}e.exports=setupWriteToDisk},989:e=>{"use strict";e.exports=require("../mime-types")},739:e=>{"use strict";e.exports=require("../schema-utils3")},491:e=>{"use strict";e.exports=require("assert")},300:e=>{"use strict";e.exports=require("buffer")},361:e=>{"use strict";e.exports=require("events")},147:e=>{"use strict";e.exports=require("fs")},17:e=>{"use strict";e.exports=require("path")},282:e=>{"use strict";e.exports=require("process")},477:e=>{"use strict";e.exports=require("querystring")},781:e=>{"use strict";e.exports=require("stream")},224:e=>{"use strict";e.exports=require("tty")},310:e=>{"use strict";e.exports=require("url")},837:e=>{"use strict";e.exports=require("util")},558:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=r(224);function _interopNamespace(e){if(e&&e.__esModule)return e;var t=Object.create(null);if(e){Object.keys(e).forEach((function(r){if(r!=="default"){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:true,get:function(){return e[r]}})}}))}t["default"]=e;return Object.freeze(t)}var i=_interopNamespace(n);const{env:o={},argv:s=[],platform:a=""}=typeof process==="undefined"?{}:process;const c="NO_COLOR"in o||s.includes("--no-color");const u="FORCE_COLOR"in o||s.includes("--color");const f=a==="win32";const l=o.TERM==="dumb";const p=i&&i.isatty&&i.isatty(1)&&o.TERM&&!l;const d="CI"in o&&("GITHUB_ACTIONS"in o||"GITLAB_CI"in o||"CIRCLECI"in o);const h=!c&&(u||f&&!l||p||d);const replaceClose=(e,t,r,n,i=t.substring(0,e)+n,o=t.substring(e+r.length),s=o.indexOf(r))=>i+(s<0?o:replaceClose(s,o,r,n));const clearBleed=(e,t,r,n,i)=>e<0?r+t+n:r+replaceClose(e,t,n,i)+n;const filterEmpty=(e,t,r=e,n=e.length+1)=>i=>i||!(i===""||i===undefined)?clearBleed((""+i).indexOf(t,n),i,e,t,r):"";const init=(e,t,r)=>filterEmpty(`[${e}m`,`[${t}m`,r);const m={reset:init(0,0),bold:init(1,22,""),dim:init(2,22,""),italic:init(3,23),underline:init(4,24),inverse:init(7,27),hidden:init(8,28),strikethrough:init(9,29),black:init(30,39),red:init(31,39),green:init(32,39),yellow:init(33,39),blue:init(34,39),magenta:init(35,39),cyan:init(36,39),white:init(37,39),gray:init(90,39),bgBlack:init(40,49),bgRed:init(41,49),bgGreen:init(42,49),bgYellow:init(43,49),bgBlue:init(44,49),bgMagenta:init(45,49),bgCyan:init(46,49),bgWhite:init(47,49),blackBright:init(90,39),redBright:init(91,39),greenBright:init(92,39),yellowBright:init(93,39),blueBright:init(94,39),magentaBright:init(95,39),cyanBright:init(96,39),whiteBright:init(97,39),bgBlackBright:init(100,49),bgRedBright:init(101,49),bgGreenBright:init(102,49),bgYellowBright:init(103,49),bgBlueBright:init(104,49),bgMagentaBright:init(105,49),bgCyanBright:init(106,49),bgWhiteBright:init(107,49)};const createColors=({useColor:e=h}={})=>e?m:Object.keys(m).reduce(((e,t)=>({...e,[t]:String})),{});const{reset:y,bold:v,dim:g,italic:_,underline:b,inverse:S,hidden:w,strikethrough:F,black:T,red:R,green:k,yellow:N,blue:O,magenta:B,cyan:I,white:A,gray:C,bgBlack:L,bgRed:V,bgGreen:P,bgYellow:D,bgBlue:x,bgMagenta:U,bgCyan:M,bgWhite:W,blackBright:H,redBright:j,greenBright:G,yellowBright:K,blueBright:Y,magentaBright:q,cyanBright:$,whiteBright:J,bgBlackBright:X,bgRedBright:z,bgGreenBright:Z,bgYellowBright:Q,bgBlueBright:ee,bgMagentaBright:te,bgCyanBright:re,bgWhiteBright:ne}=createColors();t.bgBlack=L;t.bgBlackBright=X;t.bgBlue=x;t.bgBlueBright=ee;t.bgCyan=M;t.bgCyanBright=re;t.bgGreen=P;t.bgGreenBright=Z;t.bgMagenta=U;t.bgMagentaBright=te;t.bgRed=V;t.bgRedBright=z;t.bgWhite=W;t.bgWhiteBright=ne;t.bgYellow=D;t.bgYellowBright=Q;t.black=T;t.blackBright=H;t.blue=O;t.blueBright=Y;t.bold=v;t.createColors=createColors;t.cyan=I;t.cyanBright=$;t.dim=g;t.gray=C;t.green=k;t.greenBright=G;t.hidden=w;t.inverse=S;t.isColorSupported=h;t.italic=_;t.magenta=B;t.magentaBright=q;t.red=R;t.redBright=j;t.reset=y;t.strikethrough=F;t.underline=b;t.white=A;t.whiteBright=J;t.yellow=N;t.yellowBright=K},30:e=>{"use strict";e.exports=JSON.parse('{"type":"object","properties":{"mimeTypes":{"description":"Allows a user to register custom mime types or extension mappings.","link":"https://github.com/webpack/webpack-dev-middleware#mimetypes","type":"object"},"writeToDisk":{"description":"Allows to write generated files on disk.","link":"https://github.com/webpack/webpack-dev-middleware#writetodisk","anyOf":[{"type":"boolean"},{"instanceof":"Function"}]},"methods":{"description":"Allows to pass the list of HTTP request methods accepted by the middleware.","link":"https://github.com/webpack/webpack-dev-middleware#methods","type":"array","items":{"type":"string","minLength":1}},"headers":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"key":{"description":"key of header.","type":"string"},"value":{"description":"value of header.","type":"string"}}},"minItems":1},{"type":"object"},{"instanceof":"Function"}],"description":"Allows to pass custom HTTP headers on each request","link":"https://github.com/webpack/webpack-dev-middleware#headers"},"publicPath":{"description":"The `publicPath` specifies the public URL address of the output files when referenced in a browser.","link":"https://github.com/webpack/webpack-dev-middleware#publicpath","anyOf":[{"enum":["auto"]},{"type":"string"},{"instanceof":"Function"}]},"stats":{"description":"Stats options object or preset name.","link":"https://github.com/webpack/webpack-dev-middleware#stats","anyOf":[{"enum":["none","summary","errors-only","errors-warnings","minimal","normal","detailed","verbose"]},{"type":"boolean"},{"type":"object","additionalProperties":true}]},"serverSideRender":{"description":"Instructs the module to enable or disable the server-side rendering mode.","link":"https://github.com/webpack/webpack-dev-middleware#serversiderender","type":"boolean"},"outputFileSystem":{"description":"Set the default file system which will be used by webpack as primary destination of generated files.","link":"https://github.com/webpack/webpack-dev-middleware#outputfilesystem","type":"object"},"index":{"description":"Allows to serve an index of the directory.","link":"https://github.com/webpack/webpack-dev-middleware#index","anyOf":[{"type":"boolean"},{"type":"string","minLength":1}]}},"additionalProperties":false}')}};var t={};function __nccwpck_require__(r){var n=t[r];if(n!==undefined){return n.exports}var i=t[r]={exports:{}};var o=true;try{e[r].call(i.exports,i,i.exports,__nccwpck_require__);o=false}finally{if(o)delete t[r]}return i.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(553);module.exports=r})();
@@ -1 +1 @@
1
- {"name":"webpack-dev-middleware","author":"Tobias Koppers @sokra","version":"5.3.3","funding":{"type":"opencollective","url":"https://opencollective.com/webpack"},"license":"MIT","types":"types/index.d.ts"}
1
+ {"name":"webpack-dev-middleware","author":"Tobias Koppers @sokra","version":"6.0.1","funding":{"type":"opencollective","url":"https://opencollective.com/webpack"},"license":"MIT","types":"types/index.d.ts"}