var __create = Object.create; var __defProp = Object.defineProperty; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __getOwnPropNames = Object.getOwnPropertyNames; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __markAsModule = (target) => __defProp(target, "__esModule", {value: true}); var __commonJS = (callback, module2) => () => { if (!module2) { module2 = {exports: {}}; callback(module2.exports, module2); } return module2.exports; }; var __export = (target, all) => { for (var name in all) __defProp(target, name, {get: all[name], enumerable: true}); }; var __exportStar = (target, module2, desc) => { if (module2 && typeof module2 === "object" || typeof module2 === "function") { for (let key of __getOwnPropNames(module2)) if (!__hasOwnProp.call(target, key) && key !== "default") __defProp(target, key, {get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable}); } return target; }; var __toModule = (module2) => { if (module2 && module2.__esModule) return module2; return __exportStar(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", {value: module2, enumerable: true})), module2); }; // node_modules/vscode-jsonrpc/lib/common/ral.js var require_ral = __commonJS((exports2) => { "use strict"; Object.defineProperty(exports2, "__esModule", {value: true}); var _ral; function RAL() { if (_ral === void 0) { throw new Error(`No runtime abstraction layer installed`); } return _ral; } (function(RAL2) { function install2(ral) { if (ral === void 0) { throw new Error(`No runtime abstraction layer provided`); } _ral = ral; } RAL2.install = install2; })(RAL || (RAL = {})); exports2.default = RAL; }); // node_modules/vscode-jsonrpc/lib/common/disposable.js var require_disposable = __commonJS((exports2) => { "use strict"; Object.defineProperty(exports2, "__esModule", {value: true}); exports2.Disposable = void 0; var Disposable3; (function(Disposable4) { function create(func) { return { dispose: func }; } Disposable4.create = create; })(Disposable3 = exports2.Disposable || (exports2.Disposable = {})); }); // node_modules/vscode-jsonrpc/lib/common/messageBuffer.js var require_messageBuffer = __commonJS((exports2) => { "use strict"; Object.defineProperty(exports2, "__esModule", {value: true}); exports2.AbstractMessageBuffer = void 0; var CR = 13; var LF = 10; var CRLF = "\r\n"; var AbstractMessageBuffer = class { constructor(encoding = "utf-8") { this._encoding = encoding; this._chunks = []; this._totalLength = 0; } get encoding() { return this._encoding; } append(chunk) { const toAppend = typeof chunk === "string" ? this.fromString(chunk, this._encoding) : chunk; this._chunks.push(toAppend); this._totalLength += toAppend.byteLength; } tryReadHeaders() { if (this._chunks.length === 0) { return void 0; } let state = 0; let chunkIndex = 0; let offset = 0; let chunkBytesRead = 0; row: while (chunkIndex < this._chunks.length) { const chunk = this._chunks[chunkIndex]; offset = 0; column: while (offset < chunk.length) { const value = chunk[offset]; switch (value) { case CR: switch (state) { case 0: state = 1; break; case 2: state = 3; break; default: state = 0; } break; case LF: switch (state) { case 1: state = 2; break; case 3: state = 4; offset++; break row; default: state = 0; } break; default: state = 0; } offset++; } chunkBytesRead += chunk.byteLength; chunkIndex++; } if (state !== 4) { return void 0; } const buffer = this._read(chunkBytesRead + offset); const result = new Map(); const headers = this.toString(buffer, "ascii").split(CRLF); if (headers.length < 2) { return result; } for (let i = 0; i < headers.length - 2; i++) { const header = headers[i]; const index = header.indexOf(":"); if (index === -1) { throw new Error("Message header must separate key and value using :"); } const key = header.substr(0, index); const value = header.substr(index + 1).trim(); result.set(key, value); } return result; } tryReadBody(length) { if (this._totalLength < length) { return void 0; } return this._read(length); } get numberOfBytes() { return this._totalLength; } _read(byteCount) { if (byteCount === 0) { return this.emptyBuffer(); } if (byteCount > this._totalLength) { throw new Error(`Cannot read so many bytes!`); } if (this._chunks[0].byteLength === byteCount) { const chunk = this._chunks[0]; this._chunks.shift(); this._totalLength -= byteCount; return this.asNative(chunk); } if (this._chunks[0].byteLength > byteCount) { const chunk = this._chunks[0]; const result2 = this.asNative(chunk, byteCount); this._chunks[0] = chunk.slice(byteCount); this._totalLength -= byteCount; return result2; } const result = this.allocNative(byteCount); let resultOffset = 0; let chunkIndex = 0; while (byteCount > 0) { const chunk = this._chunks[chunkIndex]; if (chunk.byteLength > byteCount) { const chunkPart = chunk.slice(0, byteCount); result.set(chunkPart, resultOffset); resultOffset += byteCount; this._chunks[chunkIndex] = chunk.slice(byteCount); this._totalLength -= byteCount; byteCount -= byteCount; } else { result.set(chunk, resultOffset); resultOffset += chunk.byteLength; this._chunks.shift(); this._totalLength -= chunk.byteLength; byteCount -= chunk.byteLength; } } return result; } }; exports2.AbstractMessageBuffer = AbstractMessageBuffer; }); // node_modules/vscode-jsonrpc/lib/node/ril.js var require_ril = __commonJS((exports2) => { "use strict"; Object.defineProperty(exports2, "__esModule", {value: true}); var ral_1 = require_ral(); var util_1 = require("util"); var disposable_1 = require_disposable(); var messageBuffer_1 = require_messageBuffer(); var MessageBuffer = class extends messageBuffer_1.AbstractMessageBuffer { constructor(encoding = "utf-8") { super(encoding); } emptyBuffer() { return MessageBuffer.emptyBuffer; } fromString(value, encoding) { return Buffer.from(value, encoding); } toString(value, encoding) { if (value instanceof Buffer) { return value.toString(encoding); } else { return new util_1.TextDecoder(encoding).decode(value); } } asNative(buffer, length) { if (length === void 0) { return buffer instanceof Buffer ? buffer : Buffer.from(buffer); } else { return buffer instanceof Buffer ? buffer.slice(0, length) : Buffer.from(buffer, 0, length); } } allocNative(length) { return Buffer.allocUnsafe(length); } }; MessageBuffer.emptyBuffer = Buffer.allocUnsafe(0); var ReadableStreamWrapper = class { constructor(stream) { this.stream = stream; } onClose(listener) { this.stream.on("close", listener); return disposable_1.Disposable.create(() => this.stream.off("close", listener)); } onError(listener) { this.stream.on("error", listener); return disposable_1.Disposable.create(() => this.stream.off("error", listener)); } onEnd(listener) { this.stream.on("end", listener); return disposable_1.Disposable.create(() => this.stream.off("end", listener)); } onData(listener) { this.stream.on("data", listener); return disposable_1.Disposable.create(() => this.stream.off("data", listener)); } }; var WritableStreamWrapper = class { constructor(stream) { this.stream = stream; } onClose(listener) { this.stream.on("close", listener); return disposable_1.Disposable.create(() => this.stream.off("close", listener)); } onError(listener) { this.stream.on("error", listener); return disposable_1.Disposable.create(() => this.stream.off("error", listener)); } onEnd(listener) { this.stream.on("end", listener); return disposable_1.Disposable.create(() => this.stream.off("end", listener)); } write(data, encoding) { return new Promise((resolve, reject) => { const callback = (error) => { if (error === void 0 || error === null) { resolve(); } else { reject(error); } }; if (typeof data === "string") { this.stream.write(data, encoding, callback); } else { this.stream.write(data, callback); } }); } end() { this.stream.end(); } }; var _ril = Object.freeze({ messageBuffer: Object.freeze({ create: (encoding) => new MessageBuffer(encoding) }), applicationJson: Object.freeze({ encoder: Object.freeze({ name: "application/json", encode: (msg, options) => { try { return Promise.resolve(Buffer.from(JSON.stringify(msg, void 0, 0), options.charset)); } catch (err) { return Promise.reject(err); } } }), decoder: Object.freeze({ name: "application/json", decode: (buffer, options) => { try { if (buffer instanceof Buffer) { return Promise.resolve(JSON.parse(buffer.toString(options.charset))); } else { return Promise.resolve(JSON.parse(new util_1.TextDecoder(options.charset).decode(buffer))); } } catch (err) { return Promise.reject(err); } } }) }), stream: Object.freeze({ asReadableStream: (stream) => new ReadableStreamWrapper(stream), asWritableStream: (stream) => new WritableStreamWrapper(stream) }), console, timer: Object.freeze({ setTimeout(callback, ms, ...args) { return setTimeout(callback, ms, ...args); }, clearTimeout(handle) { clearTimeout(handle); }, setImmediate(callback, ...args) { return setImmediate(callback, ...args); }, clearImmediate(handle) { clearImmediate(handle); } }) }); function RIL() { return _ril; } (function(RIL2) { function install2() { ral_1.default.install(_ril); } RIL2.install = install2; })(RIL || (RIL = {})); exports2.default = RIL; }); // node_modules/vscode-jsonrpc/lib/common/is.js var require_is = __commonJS((exports2) => { "use strict"; Object.defineProperty(exports2, "__esModule", {value: true}); exports2.stringArray = exports2.array = exports2.func = exports2.error = exports2.number = exports2.string = exports2.boolean = void 0; function boolean(value) { return value === true || value === false; } exports2.boolean = boolean; function string(value) { return typeof value === "string" || value instanceof String; } exports2.string = string; function number(value) { return typeof value === "number" || value instanceof Number; } exports2.number = number; function error(value) { return value instanceof Error; } exports2.error = error; function func(value) { return typeof value === "function"; } exports2.func = func; function array(value) { return Array.isArray(value); } exports2.array = array; function stringArray(value) { return array(value) && value.every((elem) => string(elem)); } exports2.stringArray = stringArray; }); // node_modules/vscode-jsonrpc/lib/common/messages.js var require_messages = __commonJS((exports2) => { "use strict"; Object.defineProperty(exports2, "__esModule", {value: true}); exports2.isResponseMessage = exports2.isNotificationMessage = exports2.isRequestMessage = exports2.NotificationType9 = exports2.NotificationType8 = exports2.NotificationType7 = exports2.NotificationType6 = exports2.NotificationType5 = exports2.NotificationType4 = exports2.NotificationType3 = exports2.NotificationType2 = exports2.NotificationType1 = exports2.NotificationType0 = exports2.NotificationType = exports2.RequestType9 = exports2.RequestType8 = exports2.RequestType7 = exports2.RequestType6 = exports2.RequestType5 = exports2.RequestType4 = exports2.RequestType3 = exports2.RequestType2 = exports2.RequestType1 = exports2.RequestType = exports2.RequestType0 = exports2.AbstractMessageSignature = exports2.ParameterStructures = exports2.ResponseError = exports2.ErrorCodes = void 0; var is = require_is(); var ErrorCodes; (function(ErrorCodes2) { ErrorCodes2.ParseError = -32700; ErrorCodes2.InvalidRequest = -32600; ErrorCodes2.MethodNotFound = -32601; ErrorCodes2.InvalidParams = -32602; ErrorCodes2.InternalError = -32603; ErrorCodes2.jsonrpcReservedErrorRangeStart = -32099; ErrorCodes2.serverErrorStart = ErrorCodes2.jsonrpcReservedErrorRangeStart; ErrorCodes2.MessageWriteError = -32099; ErrorCodes2.MessageReadError = -32098; ErrorCodes2.ServerNotInitialized = -32002; ErrorCodes2.UnknownErrorCode = -32001; ErrorCodes2.jsonrpcReservedErrorRangeEnd = -32e3; ErrorCodes2.serverErrorEnd = ErrorCodes2.jsonrpcReservedErrorRangeEnd; })(ErrorCodes = exports2.ErrorCodes || (exports2.ErrorCodes = {})); var ResponseError = class extends Error { constructor(code, message, data) { super(message); this.code = is.number(code) ? code : ErrorCodes.UnknownErrorCode; this.data = data; Object.setPrototypeOf(this, ResponseError.prototype); } toJson() { return { code: this.code, message: this.message, data: this.data }; } }; exports2.ResponseError = ResponseError; var ParameterStructures = class { constructor(kind) { this.kind = kind; } static is(value) { return value === ParameterStructures.auto || value === ParameterStructures.byName || value === ParameterStructures.byPosition; } toString() { return this.kind; } }; exports2.ParameterStructures = ParameterStructures; ParameterStructures.auto = new ParameterStructures("auto"); ParameterStructures.byPosition = new ParameterStructures("byPosition"); ParameterStructures.byName = new ParameterStructures("byName"); var AbstractMessageSignature = class { constructor(method, numberOfParams) { this.method = method; this.numberOfParams = numberOfParams; } get parameterStructures() { return ParameterStructures.auto; } }; exports2.AbstractMessageSignature = AbstractMessageSignature; var RequestType0 = class extends AbstractMessageSignature { constructor(method) { super(method, 0); } }; exports2.RequestType0 = RequestType0; var RequestType2 = class extends AbstractMessageSignature { constructor(method, _parameterStructures = ParameterStructures.auto) { super(method, 1); this._parameterStructures = _parameterStructures; } get parameterStructures() { return this._parameterStructures; } }; exports2.RequestType = RequestType2; var RequestType1 = class extends AbstractMessageSignature { constructor(method, _parameterStructures = ParameterStructures.auto) { super(method, 1); this._parameterStructures = _parameterStructures; } get parameterStructures() { return this._parameterStructures; } }; exports2.RequestType1 = RequestType1; var RequestType22 = class extends AbstractMessageSignature { constructor(method) { super(method, 2); } }; exports2.RequestType2 = RequestType22; var RequestType3 = class extends AbstractMessageSignature { constructor(method) { super(method, 3); } }; exports2.RequestType3 = RequestType3; var RequestType4 = class extends AbstractMessageSignature { constructor(method) { super(method, 4); } }; exports2.RequestType4 = RequestType4; var RequestType5 = class extends AbstractMessageSignature { constructor(method) { super(method, 5); } }; exports2.RequestType5 = RequestType5; var RequestType6 = class extends AbstractMessageSignature { constructor(method) { super(method, 6); } }; exports2.RequestType6 = RequestType6; var RequestType7 = class extends AbstractMessageSignature { constructor(method) { super(method, 7); } }; exports2.RequestType7 = RequestType7; var RequestType8 = class extends AbstractMessageSignature { constructor(method) { super(method, 8); } }; exports2.RequestType8 = RequestType8; var RequestType9 = class extends AbstractMessageSignature { constructor(method) { super(method, 9); } }; exports2.RequestType9 = RequestType9; var NotificationType2 = class extends AbstractMessageSignature { constructor(method, _parameterStructures = ParameterStructures.auto) { super(method, 1); this._parameterStructures = _parameterStructures; } get parameterStructures() { return this._parameterStructures; } }; exports2.NotificationType = NotificationType2; var NotificationType0 = class extends AbstractMessageSignature { constructor(method) { super(method, 0); } }; exports2.NotificationType0 = NotificationType0; var NotificationType1 = class extends AbstractMessageSignature { constructor(method, _parameterStructures = ParameterStructures.auto) { super(method, 1); this._parameterStructures = _parameterStructures; } get parameterStructures() { return this._parameterStructures; } }; exports2.NotificationType1 = NotificationType1; var NotificationType22 = class extends AbstractMessageSignature { constructor(method) { super(method, 2); } }; exports2.NotificationType2 = NotificationType22; var NotificationType3 = class extends AbstractMessageSignature { constructor(method) { super(method, 3); } }; exports2.NotificationType3 = NotificationType3; var NotificationType4 = class extends AbstractMessageSignature { constructor(method) { super(method, 4); } }; exports2.NotificationType4 = NotificationType4; var NotificationType5 = class extends AbstractMessageSignature { constructor(method) { super(method, 5); } }; exports2.NotificationType5 = NotificationType5; var NotificationType6 = class extends AbstractMessageSignature { constructor(method) { super(method, 6); } }; exports2.NotificationType6 = NotificationType6; var NotificationType7 = class extends AbstractMessageSignature { constructor(method) { super(method, 7); } }; exports2.NotificationType7 = NotificationType7; var NotificationType8 = class extends AbstractMessageSignature { constructor(method) { super(method, 8); } }; exports2.NotificationType8 = NotificationType8; var NotificationType9 = class extends AbstractMessageSignature { constructor(method) { super(method, 9); } }; exports2.NotificationType9 = NotificationType9; function isRequestMessage(message) { const candidate = message; return candidate && is.string(candidate.method) && (is.string(candidate.id) || is.number(candidate.id)); } exports2.isRequestMessage = isRequestMessage; function isNotificationMessage(message) { const candidate = message; return candidate && is.string(candidate.method) && message.id === void 0; } exports2.isNotificationMessage = isNotificationMessage; function isResponseMessage(message) { const candidate = message; return candidate && (candidate.result !== void 0 || !!candidate.error) && (is.string(candidate.id) || is.number(candidate.id) || candidate.id === null); } exports2.isResponseMessage = isResponseMessage; }); // node_modules/vscode-jsonrpc/lib/common/events.js var require_events = __commonJS((exports2) => { "use strict"; Object.defineProperty(exports2, "__esModule", {value: true}); exports2.Emitter = exports2.Event = void 0; var ral_1 = require_ral(); var Event3; (function(Event4) { const _disposable = {dispose() { }}; Event4.None = function() { return _disposable; }; })(Event3 = exports2.Event || (exports2.Event = {})); var CallbackList = class { add(callback, context = null, bucket) { if (!this._callbacks) { this._callbacks = []; this._contexts = []; } this._callbacks.push(callback); this._contexts.push(context); if (Array.isArray(bucket)) { bucket.push({dispose: () => this.remove(callback, context)}); } } remove(callback, context = null) { if (!this._callbacks) { return; } let foundCallbackWithDifferentContext = false; for (let i = 0, len = this._callbacks.length; i < len; i++) { if (this._callbacks[i] === callback) { if (this._contexts[i] === context) { this._callbacks.splice(i, 1); this._contexts.splice(i, 1); return; } else { foundCallbackWithDifferentContext = true; } } } if (foundCallbackWithDifferentContext) { throw new Error("When adding a listener with a context, you should remove it with the same context"); } } invoke(...args) { if (!this._callbacks) { return []; } const ret2 = [], callbacks = this._callbacks.slice(0), contexts = this._contexts.slice(0); for (let i = 0, len = callbacks.length; i < len; i++) { try { ret2.push(callbacks[i].apply(contexts[i], args)); } catch (e) { ral_1.default().console.error(e); } } return ret2; } isEmpty() { return !this._callbacks || this._callbacks.length === 0; } dispose() { this._callbacks = void 0; this._contexts = void 0; } }; var Emitter = class { constructor(_options) { this._options = _options; } get event() { if (!this._event) { this._event = (listener, thisArgs, disposables) => { if (!this._callbacks) { this._callbacks = new CallbackList(); } if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) { this._options.onFirstListenerAdd(this); } this._callbacks.add(listener, thisArgs); const result = { dispose: () => { if (!this._callbacks) { return; } this._callbacks.remove(listener, thisArgs); result.dispose = Emitter._noop; if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) { this._options.onLastListenerRemove(this); } } }; if (Array.isArray(disposables)) { disposables.push(result); } return result; }; } return this._event; } fire(event) { if (this._callbacks) { this._callbacks.invoke.call(this._callbacks, event); } } dispose() { if (this._callbacks) { this._callbacks.dispose(); this._callbacks = void 0; } } }; exports2.Emitter = Emitter; Emitter._noop = function() { }; }); // node_modules/vscode-jsonrpc/lib/common/cancellation.js var require_cancellation = __commonJS((exports2) => { "use strict"; Object.defineProperty(exports2, "__esModule", {value: true}); exports2.CancellationTokenSource = exports2.CancellationToken = void 0; var ral_1 = require_ral(); var Is = require_is(); var events_1 = require_events(); var CancellationToken; (function(CancellationToken2) { CancellationToken2.None = Object.freeze({ isCancellationRequested: false, onCancellationRequested: events_1.Event.None }); CancellationToken2.Cancelled = Object.freeze({ isCancellationRequested: true, onCancellationRequested: events_1.Event.None }); function is(value) { const candidate = value; return candidate && (candidate === CancellationToken2.None || candidate === CancellationToken2.Cancelled || Is.boolean(candidate.isCancellationRequested) && !!candidate.onCancellationRequested); } CancellationToken2.is = is; })(CancellationToken = exports2.CancellationToken || (exports2.CancellationToken = {})); var shortcutEvent = Object.freeze(function(callback, context) { const handle = ral_1.default().timer.setTimeout(callback.bind(context), 0); return {dispose() { ral_1.default().timer.clearTimeout(handle); }}; }); var MutableToken = class { constructor() { this._isCancelled = false; } cancel() { if (!this._isCancelled) { this._isCancelled = true; if (this._emitter) { this._emitter.fire(void 0); this.dispose(); } } } get isCancellationRequested() { return this._isCancelled; } get onCancellationRequested() { if (this._isCancelled) { return shortcutEvent; } if (!this._emitter) { this._emitter = new events_1.Emitter(); } return this._emitter.event; } dispose() { if (this._emitter) { this._emitter.dispose(); this._emitter = void 0; } } }; var CancellationTokenSource = class { get token() { if (!this._token) { this._token = new MutableToken(); } return this._token; } cancel() { if (!this._token) { this._token = CancellationToken.Cancelled; } else { this._token.cancel(); } } dispose() { if (!this._token) { this._token = CancellationToken.None; } else if (this._token instanceof MutableToken) { this._token.dispose(); } } }; exports2.CancellationTokenSource = CancellationTokenSource; }); // node_modules/vscode-jsonrpc/lib/common/messageReader.js var require_messageReader = __commonJS((exports2) => { "use strict"; Object.defineProperty(exports2, "__esModule", {value: true}); exports2.ReadableStreamMessageReader = exports2.AbstractMessageReader = exports2.MessageReader = void 0; var ral_1 = require_ral(); var Is = require_is(); var events_1 = require_events(); var MessageReader; (function(MessageReader2) { function is(value) { let candidate = value; return candidate && Is.func(candidate.listen) && Is.func(candidate.dispose) && Is.func(candidate.onError) && Is.func(candidate.onClose) && Is.func(candidate.onPartialMessage); } MessageReader2.is = is; })(MessageReader = exports2.MessageReader || (exports2.MessageReader = {})); var AbstractMessageReader = class { constructor() { this.errorEmitter = new events_1.Emitter(); this.closeEmitter = new events_1.Emitter(); this.partialMessageEmitter = new events_1.Emitter(); } dispose() { this.errorEmitter.dispose(); this.closeEmitter.dispose(); } get onError() { return this.errorEmitter.event; } fireError(error) { this.errorEmitter.fire(this.asError(error)); } get onClose() { return this.closeEmitter.event; } fireClose() { this.closeEmitter.fire(void 0); } get onPartialMessage() { return this.partialMessageEmitter.event; } firePartialMessage(info) { this.partialMessageEmitter.fire(info); } asError(error) { if (error instanceof Error) { return error; } else { return new Error(`Reader received error. Reason: ${Is.string(error.message) ? error.message : "unknown"}`); } } }; exports2.AbstractMessageReader = AbstractMessageReader; var ResolvedMessageReaderOptions; (function(ResolvedMessageReaderOptions2) { function fromOptions(options) { var _a; let charset; let result; let contentDecoder; const contentDecoders = new Map(); let contentTypeDecoder; const contentTypeDecoders = new Map(); if (options === void 0 || typeof options === "string") { charset = options !== null && options !== void 0 ? options : "utf-8"; } else { charset = (_a = options.charset) !== null && _a !== void 0 ? _a : "utf-8"; if (options.contentDecoder !== void 0) { contentDecoder = options.contentDecoder; contentDecoders.set(contentDecoder.name, contentDecoder); } if (options.contentDecoders !== void 0) { for (const decoder of options.contentDecoders) { contentDecoders.set(decoder.name, decoder); } } if (options.contentTypeDecoder !== void 0) { contentTypeDecoder = options.contentTypeDecoder; contentTypeDecoders.set(contentTypeDecoder.name, contentTypeDecoder); } if (options.contentTypeDecoders !== void 0) { for (const decoder of options.contentTypeDecoders) { contentTypeDecoders.set(decoder.name, decoder); } } } if (contentTypeDecoder === void 0) { contentTypeDecoder = ral_1.default().applicationJson.decoder; contentTypeDecoders.set(contentTypeDecoder.name, contentTypeDecoder); } return {charset, contentDecoder, contentDecoders, contentTypeDecoder, contentTypeDecoders}; } ResolvedMessageReaderOptions2.fromOptions = fromOptions; })(ResolvedMessageReaderOptions || (ResolvedMessageReaderOptions = {})); var ReadableStreamMessageReader = class extends AbstractMessageReader { constructor(readable, options) { super(); this.readable = readable; this.options = ResolvedMessageReaderOptions.fromOptions(options); this.buffer = ral_1.default().messageBuffer.create(this.options.charset); this._partialMessageTimeout = 1e4; this.nextMessageLength = -1; this.messageToken = 0; } set partialMessageTimeout(timeout) { this._partialMessageTimeout = timeout; } get partialMessageTimeout() { return this._partialMessageTimeout; } listen(callback) { this.nextMessageLength = -1; this.messageToken = 0; this.partialMessageTimer = void 0; this.callback = callback; const result = this.readable.onData((data) => { this.onData(data); }); this.readable.onError((error) => this.fireError(error)); this.readable.onClose(() => this.fireClose()); return result; } onData(data) { this.buffer.append(data); while (true) { if (this.nextMessageLength === -1) { const headers = this.buffer.tryReadHeaders(); if (!headers) { return; } const contentLength = headers.get("Content-Length"); if (!contentLength) { throw new Error("Header must provide a Content-Length property."); } const length = parseInt(contentLength); if (isNaN(length)) { throw new Error("Content-Length value must be a number."); } this.nextMessageLength = length; } const body = this.buffer.tryReadBody(this.nextMessageLength); if (body === void 0) { this.setPartialMessageTimer(); return; } this.clearPartialMessageTimer(); this.nextMessageLength = -1; let p; if (this.options.contentDecoder !== void 0) { p = this.options.contentDecoder.decode(body); } else { p = Promise.resolve(body); } p.then((value) => { this.options.contentTypeDecoder.decode(value, this.options).then((msg) => { this.callback(msg); }, (error) => { this.fireError(error); }); }, (error) => { this.fireError(error); }); } } clearPartialMessageTimer() { if (this.partialMessageTimer) { ral_1.default().timer.clearTimeout(this.partialMessageTimer); this.partialMessageTimer = void 0; } } setPartialMessageTimer() { this.clearPartialMessageTimer(); if (this._partialMessageTimeout <= 0) { return; } this.partialMessageTimer = ral_1.default().timer.setTimeout((token, timeout) => { this.partialMessageTimer = void 0; if (token === this.messageToken) { this.firePartialMessage({messageToken: token, waitingTime: timeout}); this.setPartialMessageTimer(); } }, this._partialMessageTimeout, this.messageToken, this._partialMessageTimeout); } }; exports2.ReadableStreamMessageReader = ReadableStreamMessageReader; }); // node_modules/vscode-jsonrpc/lib/common/semaphore.js var require_semaphore = __commonJS((exports2) => { "use strict"; Object.defineProperty(exports2, "__esModule", {value: true}); exports2.Semaphore = void 0; var ral_1 = require_ral(); var Semaphore = class { constructor(capacity = 1) { if (capacity <= 0) { throw new Error("Capacity must be greater than 0"); } this._capacity = capacity; this._active = 0; this._waiting = []; } lock(thunk) { return new Promise((resolve, reject) => { this._waiting.push({thunk, resolve, reject}); this.runNext(); }); } get active() { return this._active; } runNext() { if (this._waiting.length === 0 || this._active === this._capacity) { return; } ral_1.default().timer.setImmediate(() => this.doRunNext()); } doRunNext() { if (this._waiting.length === 0 || this._active === this._capacity) { return; } const next = this._waiting.shift(); this._active++; if (this._active > this._capacity) { throw new Error(`To many thunks active`); } try { const result = next.thunk(); if (result instanceof Promise) { result.then((value) => { this._active--; next.resolve(value); this.runNext(); }, (err) => { this._active--; next.reject(err); this.runNext(); }); } else { this._active--; next.resolve(result); this.runNext(); } } catch (err) { this._active--; next.reject(err); this.runNext(); } } }; exports2.Semaphore = Semaphore; }); // node_modules/vscode-jsonrpc/lib/common/messageWriter.js var require_messageWriter = __commonJS((exports2) => { "use strict"; Object.defineProperty(exports2, "__esModule", {value: true}); exports2.WriteableStreamMessageWriter = exports2.AbstractMessageWriter = exports2.MessageWriter = void 0; var ral_1 = require_ral(); var Is = require_is(); var semaphore_1 = require_semaphore(); var events_1 = require_events(); var ContentLength = "Content-Length: "; var CRLF = "\r\n"; var MessageWriter; (function(MessageWriter2) { function is(value) { let candidate = value; return candidate && Is.func(candidate.dispose) && Is.func(candidate.onClose) && Is.func(candidate.onError) && Is.func(candidate.write); } MessageWriter2.is = is; })(MessageWriter = exports2.MessageWriter || (exports2.MessageWriter = {})); var AbstractMessageWriter = class { constructor() { this.errorEmitter = new events_1.Emitter(); this.closeEmitter = new events_1.Emitter(); } dispose() { this.errorEmitter.dispose(); this.closeEmitter.dispose(); } get onError() { return this.errorEmitter.event; } fireError(error, message, count) { this.errorEmitter.fire([this.asError(error), message, count]); } get onClose() { return this.closeEmitter.event; } fireClose() { this.closeEmitter.fire(void 0); } asError(error) { if (error instanceof Error) { return error; } else { return new Error(`Writer received error. Reason: ${Is.string(error.message) ? error.message : "unknown"}`); } } }; exports2.AbstractMessageWriter = AbstractMessageWriter; var ResolvedMessageWriterOptions; (function(ResolvedMessageWriterOptions2) { function fromOptions(options) { var _a, _b; if (options === void 0 || typeof options === "string") { return {charset: options !== null && options !== void 0 ? options : "utf-8", contentTypeEncoder: ral_1.default().applicationJson.encoder}; } else { return {charset: (_a = options.charset) !== null && _a !== void 0 ? _a : "utf-8", contentEncoder: options.contentEncoder, contentTypeEncoder: (_b = options.contentTypeEncoder) !== null && _b !== void 0 ? _b : ral_1.default().applicationJson.encoder}; } } ResolvedMessageWriterOptions2.fromOptions = fromOptions; })(ResolvedMessageWriterOptions || (ResolvedMessageWriterOptions = {})); var WriteableStreamMessageWriter = class extends AbstractMessageWriter { constructor(writable, options) { super(); this.writable = writable; this.options = ResolvedMessageWriterOptions.fromOptions(options); this.errorCount = 0; this.writeSemaphore = new semaphore_1.Semaphore(1); this.writable.onError((error) => this.fireError(error)); this.writable.onClose(() => this.fireClose()); } async write(msg) { return this.writeSemaphore.lock(async () => { const payload = this.options.contentTypeEncoder.encode(msg, this.options).then((buffer) => { if (this.options.contentEncoder !== void 0) { return this.options.contentEncoder.encode(buffer); } else { return buffer; } }); return payload.then((buffer) => { const headers = []; headers.push(ContentLength, buffer.byteLength.toString(), CRLF); headers.push(CRLF); return this.doWrite(msg, headers, buffer); }, (error) => { this.fireError(error); throw error; }); }); } async doWrite(msg, headers, data) { try { await this.writable.write(headers.join(""), "ascii"); return this.writable.write(data); } catch (error) { this.handleError(error, msg); return Promise.reject(error); } } handleError(error, msg) { this.errorCount++; this.fireError(error, msg, this.errorCount); } end() { this.writable.end(); } }; exports2.WriteableStreamMessageWriter = WriteableStreamMessageWriter; }); // node_modules/vscode-jsonrpc/lib/common/linkedMap.js var require_linkedMap = __commonJS((exports2) => { "use strict"; Object.defineProperty(exports2, "__esModule", {value: true}); exports2.LRUCache = exports2.LinkedMap = exports2.Touch = void 0; var Touch; (function(Touch2) { Touch2.None = 0; Touch2.First = 1; Touch2.AsOld = Touch2.First; Touch2.Last = 2; Touch2.AsNew = Touch2.Last; })(Touch = exports2.Touch || (exports2.Touch = {})); var LinkedMap = class { constructor() { this[Symbol.toStringTag] = "LinkedMap"; this._map = new Map(); this._head = void 0; this._tail = void 0; this._size = 0; this._state = 0; } clear() { this._map.clear(); this._head = void 0; this._tail = void 0; this._size = 0; this._state++; } isEmpty() { return !this._head && !this._tail; } get size() { return this._size; } get first() { var _a; return (_a = this._head) === null || _a === void 0 ? void 0 : _a.value; } get last() { var _a; return (_a = this._tail) === null || _a === void 0 ? void 0 : _a.value; } has(key) { return this._map.has(key); } get(key, touch = Touch.None) { const item = this._map.get(key); if (!item) { return void 0; } if (touch !== Touch.None) { this.touch(item, touch); } return item.value; } set(key, value, touch = Touch.None) { let item = this._map.get(key); if (item) { item.value = value; if (touch !== Touch.None) { this.touch(item, touch); } } else { item = {key, value, next: void 0, previous: void 0}; switch (touch) { case Touch.None: this.addItemLast(item); break; case Touch.First: this.addItemFirst(item); break; case Touch.Last: this.addItemLast(item); break; default: this.addItemLast(item); break; } this._map.set(key, item); this._size++; } return this; } delete(key) { return !!this.remove(key); } remove(key) { const item = this._map.get(key); if (!item) { return void 0; } this._map.delete(key); this.removeItem(item); this._size--; return item.value; } shift() { if (!this._head && !this._tail) { return void 0; } if (!this._head || !this._tail) { throw new Error("Invalid list"); } const item = this._head; this._map.delete(item.key); this.removeItem(item); this._size--; return item.value; } forEach(callbackfn, thisArg) { const state = this._state; let current = this._head; while (current) { if (thisArg) { callbackfn.bind(thisArg)(current.value, current.key, this); } else { callbackfn(current.value, current.key, this); } if (this._state !== state) { throw new Error(`LinkedMap got modified during iteration.`); } current = current.next; } } keys() { const map = this; const state = this._state; let current = this._head; const iterator = { [Symbol.iterator]() { return iterator; }, next() { if (map._state !== state) { throw new Error(`LinkedMap got modified during iteration.`); } if (current) { const result = {value: current.key, done: false}; current = current.next; return result; } else { return {value: void 0, done: true}; } } }; return iterator; } values() { const map = this; const state = this._state; let current = this._head; const iterator = { [Symbol.iterator]() { return iterator; }, next() { if (map._state !== state) { throw new Error(`LinkedMap got modified during iteration.`); } if (current) { const result = {value: current.value, done: false}; current = current.next; return result; } else { return {value: void 0, done: true}; } } }; return iterator; } entries() { const map = this; const state = this._state; let current = this._head; const iterator = { [Symbol.iterator]() { return iterator; }, next() { if (map._state !== state) { throw new Error(`LinkedMap got modified during iteration.`); } if (current) { const result = {value: [current.key, current.value], done: false}; current = current.next; return result; } else { return {value: void 0, done: true}; } } }; return iterator; } [Symbol.iterator]() { return this.entries(); } trimOld(newSize) { if (newSize >= this.size) { return; } if (newSize === 0) { this.clear(); return; } let current = this._head; let currentSize = this.size; while (current && currentSize > newSize) { this._map.delete(current.key); current = current.next; currentSize--; } this._head = current; this._size = currentSize; if (current) { current.previous = void 0; } this._state++; } addItemFirst(item) { if (!this._head && !this._tail) { this._tail = item; } else if (!this._head) { throw new Error("Invalid list"); } else { item.next = this._head; this._head.previous = item; } this._head = item; this._state++; } addItemLast(item) { if (!this._head && !this._tail) { this._head = item; } else if (!this._tail) { throw new Error("Invalid list"); } else { item.previous = this._tail; this._tail.next = item; } this._tail = item; this._state++; } removeItem(item) { if (item === this._head && item === this._tail) { this._head = void 0; this._tail = void 0; } else if (item === this._head) { if (!item.next) { throw new Error("Invalid list"); } item.next.previous = void 0; this._head = item.next; } else if (item === this._tail) { if (!item.previous) { throw new Error("Invalid list"); } item.previous.next = void 0; this._tail = item.previous; } else { const next = item.next; const previous = item.previous; if (!next || !previous) { throw new Error("Invalid list"); } next.previous = previous; previous.next = next; } item.next = void 0; item.previous = void 0; this._state++; } touch(item, touch) { if (!this._head || !this._tail) { throw new Error("Invalid list"); } if (touch !== Touch.First && touch !== Touch.Last) { return; } if (touch === Touch.First) { if (item === this._head) { return; } const next = item.next; const previous = item.previous; if (item === this._tail) { previous.next = void 0; this._tail = previous; } else { next.previous = previous; previous.next = next; } item.previous = void 0; item.next = this._head; this._head.previous = item; this._head = item; this._state++; } else if (touch === Touch.Last) { if (item === this._tail) { return; } const next = item.next; const previous = item.previous; if (item === this._head) { next.previous = void 0; this._head = next; } else { next.previous = previous; previous.next = next; } item.next = void 0; item.previous = this._tail; this._tail.next = item; this._tail = item; this._state++; } } toJSON() { const data = []; this.forEach((value, key) => { data.push([key, value]); }); return data; } fromJSON(data) { this.clear(); for (const [key, value] of data) { this.set(key, value); } } }; exports2.LinkedMap = LinkedMap; var LRUCache = class extends LinkedMap { constructor(limit, ratio = 1) { super(); this._limit = limit; this._ratio = Math.min(Math.max(0, ratio), 1); } get limit() { return this._limit; } set limit(limit) { this._limit = limit; this.checkTrim(); } get ratio() { return this._ratio; } set ratio(ratio) { this._ratio = Math.min(Math.max(0, ratio), 1); this.checkTrim(); } get(key, touch = Touch.AsNew) { return super.get(key, touch); } peek(key) { return super.get(key, Touch.None); } set(key, value) { super.set(key, value, Touch.Last); this.checkTrim(); return this; } checkTrim() { if (this.size > this._limit) { this.trimOld(Math.round(this._limit * this._ratio)); } } }; exports2.LRUCache = LRUCache; }); // node_modules/vscode-jsonrpc/lib/common/connection.js var require_connection = __commonJS((exports2) => { "use strict"; Object.defineProperty(exports2, "__esModule", {value: true}); exports2.createMessageConnection = exports2.ConnectionOptions = exports2.CancellationStrategy = exports2.CancellationSenderStrategy = exports2.CancellationReceiverStrategy = exports2.ConnectionStrategy = exports2.ConnectionError = exports2.ConnectionErrors = exports2.LogTraceNotification = exports2.SetTraceNotification = exports2.TraceFormat = exports2.Trace = exports2.NullLogger = exports2.ProgressType = void 0; var ral_1 = require_ral(); var Is = require_is(); var messages_1 = require_messages(); var linkedMap_1 = require_linkedMap(); var events_1 = require_events(); var cancellation_1 = require_cancellation(); var CancelNotification; (function(CancelNotification2) { CancelNotification2.type = new messages_1.NotificationType("$/cancelRequest"); })(CancelNotification || (CancelNotification = {})); var ProgressNotification; (function(ProgressNotification2) { ProgressNotification2.type = new messages_1.NotificationType("$/progress"); })(ProgressNotification || (ProgressNotification = {})); var ProgressType = class { constructor() { } }; exports2.ProgressType = ProgressType; var StarRequestHandler; (function(StarRequestHandler2) { function is(value) { return Is.func(value); } StarRequestHandler2.is = is; })(StarRequestHandler || (StarRequestHandler = {})); exports2.NullLogger = Object.freeze({ error: () => { }, warn: () => { }, info: () => { }, log: () => { } }); var Trace; (function(Trace2) { Trace2[Trace2["Off"] = 0] = "Off"; Trace2[Trace2["Messages"] = 1] = "Messages"; Trace2[Trace2["Verbose"] = 2] = "Verbose"; })(Trace = exports2.Trace || (exports2.Trace = {})); (function(Trace2) { function fromString(value) { if (!Is.string(value)) { return Trace2.Off; } value = value.toLowerCase(); switch (value) { case "off": return Trace2.Off; case "messages": return Trace2.Messages; case "verbose": return Trace2.Verbose; default: return Trace2.Off; } } Trace2.fromString = fromString; function toString(value) { switch (value) { case Trace2.Off: return "off"; case Trace2.Messages: return "messages"; case Trace2.Verbose: return "verbose"; default: return "off"; } } Trace2.toString = toString; })(Trace = exports2.Trace || (exports2.Trace = {})); var TraceFormat; (function(TraceFormat2) { TraceFormat2["Text"] = "text"; TraceFormat2["JSON"] = "json"; })(TraceFormat = exports2.TraceFormat || (exports2.TraceFormat = {})); (function(TraceFormat2) { function fromString(value) { value = value.toLowerCase(); if (value === "json") { return TraceFormat2.JSON; } else { return TraceFormat2.Text; } } TraceFormat2.fromString = fromString; })(TraceFormat = exports2.TraceFormat || (exports2.TraceFormat = {})); var SetTraceNotification; (function(SetTraceNotification2) { SetTraceNotification2.type = new messages_1.NotificationType("$/setTrace"); })(SetTraceNotification = exports2.SetTraceNotification || (exports2.SetTraceNotification = {})); var LogTraceNotification; (function(LogTraceNotification2) { LogTraceNotification2.type = new messages_1.NotificationType("$/logTrace"); })(LogTraceNotification = exports2.LogTraceNotification || (exports2.LogTraceNotification = {})); var ConnectionErrors; (function(ConnectionErrors2) { ConnectionErrors2[ConnectionErrors2["Closed"] = 1] = "Closed"; ConnectionErrors2[ConnectionErrors2["Disposed"] = 2] = "Disposed"; ConnectionErrors2[ConnectionErrors2["AlreadyListening"] = 3] = "AlreadyListening"; })(ConnectionErrors = exports2.ConnectionErrors || (exports2.ConnectionErrors = {})); var ConnectionError = class extends Error { constructor(code, message) { super(message); this.code = code; Object.setPrototypeOf(this, ConnectionError.prototype); } }; exports2.ConnectionError = ConnectionError; var ConnectionStrategy; (function(ConnectionStrategy2) { function is(value) { const candidate = value; return candidate && Is.func(candidate.cancelUndispatched); } ConnectionStrategy2.is = is; })(ConnectionStrategy = exports2.ConnectionStrategy || (exports2.ConnectionStrategy = {})); var CancellationReceiverStrategy; (function(CancellationReceiverStrategy2) { CancellationReceiverStrategy2.Message = Object.freeze({ createCancellationTokenSource(_) { return new cancellation_1.CancellationTokenSource(); } }); function is(value) { const candidate = value; return candidate && Is.func(candidate.createCancellationTokenSource); } CancellationReceiverStrategy2.is = is; })(CancellationReceiverStrategy = exports2.CancellationReceiverStrategy || (exports2.CancellationReceiverStrategy = {})); var CancellationSenderStrategy; (function(CancellationSenderStrategy2) { CancellationSenderStrategy2.Message = Object.freeze({ sendCancellation(conn, id) { conn.sendNotification(CancelNotification.type, {id}); }, cleanup(_) { } }); function is(value) { const candidate = value; return candidate && Is.func(candidate.sendCancellation) && Is.func(candidate.cleanup); } CancellationSenderStrategy2.is = is; })(CancellationSenderStrategy = exports2.CancellationSenderStrategy || (exports2.CancellationSenderStrategy = {})); var CancellationStrategy; (function(CancellationStrategy2) { CancellationStrategy2.Message = Object.freeze({ receiver: CancellationReceiverStrategy.Message, sender: CancellationSenderStrategy.Message }); function is(value) { const candidate = value; return candidate && CancellationReceiverStrategy.is(candidate.receiver) && CancellationSenderStrategy.is(candidate.sender); } CancellationStrategy2.is = is; })(CancellationStrategy = exports2.CancellationStrategy || (exports2.CancellationStrategy = {})); var ConnectionOptions; (function(ConnectionOptions2) { function is(value) { const candidate = value; return candidate && (CancellationStrategy.is(candidate.cancellationStrategy) || ConnectionStrategy.is(candidate.connectionStrategy)); } ConnectionOptions2.is = is; })(ConnectionOptions = exports2.ConnectionOptions || (exports2.ConnectionOptions = {})); var ConnectionState; (function(ConnectionState2) { ConnectionState2[ConnectionState2["New"] = 1] = "New"; ConnectionState2[ConnectionState2["Listening"] = 2] = "Listening"; ConnectionState2[ConnectionState2["Closed"] = 3] = "Closed"; ConnectionState2[ConnectionState2["Disposed"] = 4] = "Disposed"; })(ConnectionState || (ConnectionState = {})); function createMessageConnection(messageReader, messageWriter, _logger, options) { const logger = _logger !== void 0 ? _logger : exports2.NullLogger; let sequenceNumber = 0; let notificationSquenceNumber = 0; let unknownResponseSquenceNumber = 0; const version = "2.0"; let starRequestHandler = void 0; const requestHandlers = Object.create(null); let starNotificationHandler = void 0; const notificationHandlers = Object.create(null); const progressHandlers = new Map(); let timer; let messageQueue = new linkedMap_1.LinkedMap(); let responsePromises = Object.create(null); let requestTokens = Object.create(null); let trace = Trace.Off; let traceFormat = TraceFormat.Text; let tracer; let state = ConnectionState.New; const errorEmitter = new events_1.Emitter(); const closeEmitter = new events_1.Emitter(); const unhandledNotificationEmitter = new events_1.Emitter(); const unhandledProgressEmitter = new events_1.Emitter(); const disposeEmitter = new events_1.Emitter(); const cancellationStrategy = options && options.cancellationStrategy ? options.cancellationStrategy : CancellationStrategy.Message; function createRequestQueueKey(id) { if (id === null) { throw new Error(`Can't send requests with id null since the response can't be correlated.`); } return "req-" + id.toString(); } function createResponseQueueKey(id) { if (id === null) { return "res-unknown-" + (++unknownResponseSquenceNumber).toString(); } else { return "res-" + id.toString(); } } function createNotificationQueueKey() { return "not-" + (++notificationSquenceNumber).toString(); } function addMessageToQueue(queue, message) { if (messages_1.isRequestMessage(message)) { queue.set(createRequestQueueKey(message.id), message); } else if (messages_1.isResponseMessage(message)) { queue.set(createResponseQueueKey(message.id), message); } else { queue.set(createNotificationQueueKey(), message); } } function cancelUndispatched(_message) { return void 0; } function isListening() { return state === ConnectionState.Listening; } function isClosed() { return state === ConnectionState.Closed; } function isDisposed() { return state === ConnectionState.Disposed; } function closeHandler() { if (state === ConnectionState.New || state === ConnectionState.Listening) { state = ConnectionState.Closed; closeEmitter.fire(void 0); } } function readErrorHandler(error) { errorEmitter.fire([error, void 0, void 0]); } function writeErrorHandler(data) { errorEmitter.fire(data); } messageReader.onClose(closeHandler); messageReader.onError(readErrorHandler); messageWriter.onClose(closeHandler); messageWriter.onError(writeErrorHandler); function triggerMessageQueue() { if (timer || messageQueue.size === 0) { return; } timer = ral_1.default().timer.setImmediate(() => { timer = void 0; processMessageQueue(); }); } function processMessageQueue() { if (messageQueue.size === 0) { return; } const message = messageQueue.shift(); try { if (messages_1.isRequestMessage(message)) { handleRequest(message); } else if (messages_1.isNotificationMessage(message)) { handleNotification(message); } else if (messages_1.isResponseMessage(message)) { handleResponse(message); } else { handleInvalidMessage(message); } } finally { triggerMessageQueue(); } } const callback = (message) => { try { if (messages_1.isNotificationMessage(message) && message.method === CancelNotification.type.method) { const key = createRequestQueueKey(message.params.id); const toCancel = messageQueue.get(key); if (messages_1.isRequestMessage(toCancel)) { const strategy = options === null || options === void 0 ? void 0 : options.connectionStrategy; const response = strategy && strategy.cancelUndispatched ? strategy.cancelUndispatched(toCancel, cancelUndispatched) : cancelUndispatched(toCancel); if (response && (response.error !== void 0 || response.result !== void 0)) { messageQueue.delete(key); response.id = toCancel.id; traceSendingResponse(response, message.method, Date.now()); messageWriter.write(response); return; } } } addMessageToQueue(messageQueue, message); } finally { triggerMessageQueue(); } }; function handleRequest(requestMessage) { if (isDisposed()) { return; } function reply(resultOrError, method, startTime2) { const message = { jsonrpc: version, id: requestMessage.id }; if (resultOrError instanceof messages_1.ResponseError) { message.error = resultOrError.toJson(); } else { message.result = resultOrError === void 0 ? null : resultOrError; } traceSendingResponse(message, method, startTime2); messageWriter.write(message); } function replyError(error, method, startTime2) { const message = { jsonrpc: version, id: requestMessage.id, error: error.toJson() }; traceSendingResponse(message, method, startTime2); messageWriter.write(message); } function replySuccess(result, method, startTime2) { if (result === void 0) { result = null; } const message = { jsonrpc: version, id: requestMessage.id, result }; traceSendingResponse(message, method, startTime2); messageWriter.write(message); } traceReceivedRequest(requestMessage); const element = requestHandlers[requestMessage.method]; let type; let requestHandler; if (element) { type = element.type; requestHandler = element.handler; } const startTime = Date.now(); if (requestHandler || starRequestHandler) { const tokenKey = String(requestMessage.id); const cancellationSource = cancellationStrategy.receiver.createCancellationTokenSource(tokenKey); requestTokens[tokenKey] = cancellationSource; try { let handlerResult; if (requestHandler) { if (requestMessage.params === void 0) { if (type !== void 0 && type.numberOfParams !== 0) { replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InvalidParams, `Request ${requestMessage.method} defines ${type.numberOfParams} params but recevied none.`), requestMessage.method, startTime); return; } handlerResult = requestHandler(cancellationSource.token); } else if (Array.isArray(requestMessage.params)) { if (type !== void 0 && type.parameterStructures === messages_1.ParameterStructures.byName) { replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InvalidParams, `Request ${requestMessage.method} defines parameters by name but received parameters by position`), requestMessage.method, startTime); return; } handlerResult = requestHandler(...requestMessage.params, cancellationSource.token); } else { if (type !== void 0 && type.parameterStructures === messages_1.ParameterStructures.byPosition) { replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InvalidParams, `Request ${requestMessage.method} defines parameters by position but received parameters by name`), requestMessage.method, startTime); return; } handlerResult = requestHandler(requestMessage.params, cancellationSource.token); } } else if (starRequestHandler) { handlerResult = starRequestHandler(requestMessage.method, requestMessage.params, cancellationSource.token); } const promise = handlerResult; if (!handlerResult) { delete requestTokens[tokenKey]; replySuccess(handlerResult, requestMessage.method, startTime); } else if (promise.then) { promise.then((resultOrError) => { delete requestTokens[tokenKey]; reply(resultOrError, requestMessage.method, startTime); }, (error) => { delete requestTokens[tokenKey]; if (error instanceof messages_1.ResponseError) { replyError(error, requestMessage.method, startTime); } else if (error && Is.string(error.message)) { replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error.message}`), requestMessage.method, startTime); } else { replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime); } }); } else { delete requestTokens[tokenKey]; reply(handlerResult, requestMessage.method, startTime); } } catch (error) { delete requestTokens[tokenKey]; if (error instanceof messages_1.ResponseError) { reply(error, requestMessage.method, startTime); } else if (error && Is.string(error.message)) { replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error.message}`), requestMessage.method, startTime); } else { replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime); } } } else { replyError(new messages_1.ResponseError(messages_1.ErrorCodes.MethodNotFound, `Unhandled method ${requestMessage.method}`), requestMessage.method, startTime); } } function handleResponse(responseMessage) { if (isDisposed()) { return; } if (responseMessage.id === null) { if (responseMessage.error) { logger.error(`Received response message without id: Error is: ${JSON.stringify(responseMessage.error, void 0, 4)}`); } else { logger.error(`Received response message without id. No further error information provided.`); } } else { const key = String(responseMessage.id); const responsePromise = responsePromises[key]; traceReceivedResponse(responseMessage, responsePromise); if (responsePromise) { delete responsePromises[key]; try { if (responseMessage.error) { const error = responseMessage.error; responsePromise.reject(new messages_1.ResponseError(error.code, error.message, error.data)); } else if (responseMessage.result !== void 0) { responsePromise.resolve(responseMessage.result); } else { throw new Error("Should never happen."); } } catch (error) { if (error.message) { logger.error(`Response handler '${responsePromise.method}' failed with message: ${error.message}`); } else { logger.error(`Response handler '${responsePromise.method}' failed unexpectedly.`); } } } } } function handleNotification(message) { if (isDisposed()) { return; } let type = void 0; let notificationHandler; if (message.method === CancelNotification.type.method) { notificationHandler = (params) => { const id = params.id; const source = requestTokens[String(id)]; if (source) { source.cancel(); } }; } else { const element = notificationHandlers[message.method]; if (element) { notificationHandler = element.handler; type = element.type; } } if (notificationHandler || starNotificationHandler) { try { traceReceivedNotification(message); if (notificationHandler) { if (message.params === void 0) { if (type !== void 0) { if (type.numberOfParams !== 0 && type.parameterStructures !== messages_1.ParameterStructures.byName) { logger.error(`Notification ${message.method} defines ${type.numberOfParams} params but recevied none.`); } } notificationHandler(); } else if (Array.isArray(message.params)) { if (type !== void 0) { if (type.parameterStructures === messages_1.ParameterStructures.byName) { logger.error(`Notification ${message.method} defines parameters by name but received parameters by position`); } if (type.numberOfParams !== message.params.length) { logger.error(`Notification ${message.method} defines ${type.numberOfParams} params but received ${message.params.length} argumennts`); } } notificationHandler(...message.params); } else { if (type !== void 0 && type.parameterStructures === messages_1.ParameterStructures.byPosition) { logger.error(`Notification ${message.method} defines parameters by position but received parameters by name`); } notificationHandler(message.params); } } else if (starNotificationHandler) { starNotificationHandler(message.method, message.params); } } catch (error) { if (error.message) { logger.error(`Notification handler '${message.method}' failed with message: ${error.message}`); } else { logger.error(`Notification handler '${message.method}' failed unexpectedly.`); } } } else { unhandledNotificationEmitter.fire(message); } } function handleInvalidMessage(message) { if (!message) { logger.error("Received empty message."); return; } logger.error(`Received message which is neither a response nor a notification message: ${JSON.stringify(message, null, 4)}`); const responseMessage = message; if (Is.string(responseMessage.id) || Is.number(responseMessage.id)) { const key = String(responseMessage.id); const responseHandler = responsePromises[key]; if (responseHandler) { responseHandler.reject(new Error("The received response has neither a result nor an error property.")); } } } function traceSendingRequest(message) { if (trace === Trace.Off || !tracer) { return; } if (traceFormat === TraceFormat.Text) { let data = void 0; if (trace === Trace.Verbose && message.params) { data = `Params: ${JSON.stringify(message.params, null, 4)} `; } tracer.log(`Sending request '${message.method} - (${message.id})'.`, data); } else { logLSPMessage("send-request", message); } } function traceSendingNotification(message) { if (trace === Trace.Off || !tracer) { return; } if (traceFormat === TraceFormat.Text) { let data = void 0; if (trace === Trace.Verbose) { if (message.params) { data = `Params: ${JSON.stringify(message.params, null, 4)} `; } else { data = "No parameters provided.\n\n"; } } tracer.log(`Sending notification '${message.method}'.`, data); } else { logLSPMessage("send-notification", message); } } function traceSendingResponse(message, method, startTime) { if (trace === Trace.Off || !tracer) { return; } if (traceFormat === TraceFormat.Text) { let data = void 0; if (trace === Trace.Verbose) { if (message.error && message.error.data) { data = `Error data: ${JSON.stringify(message.error.data, null, 4)} `; } else { if (message.result) { data = `Result: ${JSON.stringify(message.result, null, 4)} `; } else if (message.error === void 0) { data = "No result returned.\n\n"; } } } tracer.log(`Sending response '${method} - (${message.id})'. Processing request took ${Date.now() - startTime}ms`, data); } else { logLSPMessage("send-response", message); } } function traceReceivedRequest(message) { if (trace === Trace.Off || !tracer) { return; } if (traceFormat === TraceFormat.Text) { let data = void 0; if (trace === Trace.Verbose && message.params) { data = `Params: ${JSON.stringify(message.params, null, 4)} `; } tracer.log(`Received request '${message.method} - (${message.id})'.`, data); } else { logLSPMessage("receive-request", message); } } function traceReceivedNotification(message) { if (trace === Trace.Off || !tracer || message.method === LogTraceNotification.type.method) { return; } if (traceFormat === TraceFormat.Text) { let data = void 0; if (trace === Trace.Verbose) { if (message.params) { data = `Params: ${JSON.stringify(message.params, null, 4)} `; } else { data = "No parameters provided.\n\n"; } } tracer.log(`Received notification '${message.method}'.`, data); } else { logLSPMessage("receive-notification", message); } } function traceReceivedResponse(message, responsePromise) { if (trace === Trace.Off || !tracer) { return; } if (traceFormat === TraceFormat.Text) { let data = void 0; if (trace === Trace.Verbose) { if (message.error && message.error.data) { data = `Error data: ${JSON.stringify(message.error.data, null, 4)} `; } else { if (message.result) { data = `Result: ${JSON.stringify(message.result, null, 4)} `; } else if (message.error === void 0) { data = "No result returned.\n\n"; } } } if (responsePromise) { const error = message.error ? ` Request failed: ${message.error.message} (${message.error.code}).` : ""; tracer.log(`Received response '${responsePromise.method} - (${message.id})' in ${Date.now() - responsePromise.timerStart}ms.${error}`, data); } else { tracer.log(`Received response ${message.id} without active response promise.`, data); } } else { logLSPMessage("receive-response", message); } } function logLSPMessage(type, message) { if (!tracer || trace === Trace.Off) { return; } const lspMessage = { isLSPMessage: true, type, message, timestamp: Date.now() }; tracer.log(lspMessage); } function throwIfClosedOrDisposed() { if (isClosed()) { throw new ConnectionError(ConnectionErrors.Closed, "Connection is closed."); } if (isDisposed()) { throw new ConnectionError(ConnectionErrors.Disposed, "Connection is disposed."); } } function throwIfListening() { if (isListening()) { throw new ConnectionError(ConnectionErrors.AlreadyListening, "Connection is already listening"); } } function throwIfNotListening() { if (!isListening()) { throw new Error("Call listen() first."); } } function undefinedToNull(param) { if (param === void 0) { return null; } else { return param; } } function nullToUndefined(param) { if (param === null) { return void 0; } else { return param; } } function isNamedParam(param) { return param !== void 0 && param !== null && !Array.isArray(param) && typeof param === "object"; } function computeSingleParam(parameterStructures, param) { switch (parameterStructures) { case messages_1.ParameterStructures.auto: if (isNamedParam(param)) { return nullToUndefined(param); } else { return [undefinedToNull(param)]; } break; case messages_1.ParameterStructures.byName: if (!isNamedParam(param)) { throw new Error(`Recevied parameters by name but param is not an object literal.`); } return nullToUndefined(param); case messages_1.ParameterStructures.byPosition: return [undefinedToNull(param)]; default: throw new Error(`Unknown parameter structure ${parameterStructures.toString()}`); } } function computeMessageParams(type, params) { let result; const numberOfParams = type.numberOfParams; switch (numberOfParams) { case 0: result = void 0; break; case 1: result = computeSingleParam(type.parameterStructures, params[0]); break; default: result = []; for (let i = 0; i < params.length && i < numberOfParams; i++) { result.push(undefinedToNull(params[i])); } if (params.length < numberOfParams) { for (let i = params.length; i < numberOfParams; i++) { result.push(null); } } break; } return result; } const connection = { sendNotification: (type, ...args) => { throwIfClosedOrDisposed(); let method; let messageParams; if (Is.string(type)) { method = type; const first = args[0]; let paramStart = 0; let parameterStructures = messages_1.ParameterStructures.auto; if (messages_1.ParameterStructures.is(first)) { paramStart = 1; parameterStructures = first; } let paramEnd = args.length; const numberOfParams = paramEnd - paramStart; switch (numberOfParams) { case 0: messageParams = void 0; break; case 1: messageParams = computeSingleParam(parameterStructures, args[paramStart]); break; default: if (parameterStructures === messages_1.ParameterStructures.byName) { throw new Error(`Recevied ${numberOfParams} parameters for 'by Name' notification parameter structure.`); } messageParams = args.slice(paramStart, paramEnd).map((value) => undefinedToNull(value)); break; } } else { const params = args; method = type.method; messageParams = computeMessageParams(type, params); } const notificationMessage = { jsonrpc: version, method, params: messageParams }; traceSendingNotification(notificationMessage); messageWriter.write(notificationMessage); }, onNotification: (type, handler) => { throwIfClosedOrDisposed(); let method; if (Is.func(type)) { starNotificationHandler = type; } else if (handler) { if (Is.string(type)) { method = type; notificationHandlers[type] = {type: void 0, handler}; } else { method = type.method; notificationHandlers[type.method] = {type, handler}; } } return { dispose: () => { if (method !== void 0) { delete notificationHandlers[method]; } else { starNotificationHandler = void 0; } } }; }, onProgress: (_type, token, handler) => { if (progressHandlers.has(token)) { throw new Error(`Progress handler for token ${token} already registered`); } progressHandlers.set(token, handler); return { dispose: () => { progressHandlers.delete(token); } }; }, sendProgress: (_type, token, value) => { connection.sendNotification(ProgressNotification.type, {token, value}); }, onUnhandledProgress: unhandledProgressEmitter.event, sendRequest: (type, ...args) => { throwIfClosedOrDisposed(); throwIfNotListening(); let method; let messageParams; let token = void 0; if (Is.string(type)) { method = type; const first = args[0]; const last = args[args.length - 1]; let paramStart = 0; let parameterStructures = messages_1.ParameterStructures.auto; if (messages_1.ParameterStructures.is(first)) { paramStart = 1; parameterStructures = first; } let paramEnd = args.length; if (cancellation_1.CancellationToken.is(last)) { paramEnd = paramEnd - 1; token = last; } const numberOfParams = paramEnd - paramStart; switch (numberOfParams) { case 0: messageParams = void 0; break; case 1: messageParams = computeSingleParam(parameterStructures, args[paramStart]); break; default: if (parameterStructures === messages_1.ParameterStructures.byName) { throw new Error(`Recevied ${numberOfParams} parameters for 'by Name' request parameter structure.`); } messageParams = args.slice(paramStart, paramEnd).map((value) => undefinedToNull(value)); break; } } else { const params = args; method = type.method; messageParams = computeMessageParams(type, params); const numberOfParams = type.numberOfParams; token = cancellation_1.CancellationToken.is(params[numberOfParams]) ? params[numberOfParams] : void 0; } const id = sequenceNumber++; let disposable; if (token) { disposable = token.onCancellationRequested(() => { cancellationStrategy.sender.sendCancellation(connection, id); }); } const result = new Promise((resolve, reject) => { const requestMessage = { jsonrpc: version, id, method, params: messageParams }; const resolveWithCleanup = (r) => { resolve(r); cancellationStrategy.sender.cleanup(id); disposable === null || disposable === void 0 ? void 0 : disposable.dispose(); }; const rejectWithCleanup = (r) => { reject(r); cancellationStrategy.sender.cleanup(id); disposable === null || disposable === void 0 ? void 0 : disposable.dispose(); }; let responsePromise = {method, timerStart: Date.now(), resolve: resolveWithCleanup, reject: rejectWithCleanup}; traceSendingRequest(requestMessage); try { messageWriter.write(requestMessage); } catch (e) { responsePromise.reject(new messages_1.ResponseError(messages_1.ErrorCodes.MessageWriteError, e.message ? e.message : "Unknown reason")); responsePromise = null; } if (responsePromise) { responsePromises[String(id)] = responsePromise; } }); return result; }, onRequest: (type, handler) => { throwIfClosedOrDisposed(); let method = null; if (StarRequestHandler.is(type)) { method = void 0; starRequestHandler = type; } else if (Is.string(type)) { method = null; if (handler !== void 0) { method = type; requestHandlers[type] = {handler, type: void 0}; } } else { if (handler !== void 0) { method = type.method; requestHandlers[type.method] = {type, handler}; } } return { dispose: () => { if (method === null) { return; } if (method !== void 0) { delete requestHandlers[method]; } else { starRequestHandler = void 0; } } }; }, trace: (_value, _tracer, sendNotificationOrTraceOptions) => { let _sendNotification = false; let _traceFormat = TraceFormat.Text; if (sendNotificationOrTraceOptions !== void 0) { if (Is.boolean(sendNotificationOrTraceOptions)) { _sendNotification = sendNotificationOrTraceOptions; } else { _sendNotification = sendNotificationOrTraceOptions.sendNotification || false; _traceFormat = sendNotificationOrTraceOptions.traceFormat || TraceFormat.Text; } } trace = _value; traceFormat = _traceFormat; if (trace === Trace.Off) { tracer = void 0; } else { tracer = _tracer; } if (_sendNotification && !isClosed() && !isDisposed()) { connection.sendNotification(SetTraceNotification.type, {value: Trace.toString(_value)}); } }, onError: errorEmitter.event, onClose: closeEmitter.event, onUnhandledNotification: unhandledNotificationEmitter.event, onDispose: disposeEmitter.event, end: () => { messageWriter.end(); }, dispose: () => { if (isDisposed()) { return; } state = ConnectionState.Disposed; disposeEmitter.fire(void 0); const error = new Error("Connection got disposed."); Object.keys(responsePromises).forEach((key) => { responsePromises[key].reject(error); }); responsePromises = Object.create(null); requestTokens = Object.create(null); messageQueue = new linkedMap_1.LinkedMap(); if (Is.func(messageWriter.dispose)) { messageWriter.dispose(); } if (Is.func(messageReader.dispose)) { messageReader.dispose(); } }, listen: () => { throwIfClosedOrDisposed(); throwIfListening(); state = ConnectionState.Listening; messageReader.listen(callback); }, inspect: () => { ral_1.default().console.log("inspect"); } }; connection.onNotification(LogTraceNotification.type, (params) => { if (trace === Trace.Off || !tracer) { return; } tracer.log(params.message, trace === Trace.Verbose ? params.verbose : void 0); }); connection.onNotification(ProgressNotification.type, (params) => { const handler = progressHandlers.get(params.token); if (handler) { handler(params.value); } else { unhandledProgressEmitter.fire(params); } }); return connection; } exports2.createMessageConnection = createMessageConnection; }); // node_modules/vscode-jsonrpc/lib/common/api.js var require_api = __commonJS((exports2) => { "use strict"; Object.defineProperty(exports2, "__esModule", {value: true}); exports2.CancellationSenderStrategy = exports2.CancellationReceiverStrategy = exports2.ConnectionError = exports2.ConnectionErrors = exports2.LogTraceNotification = exports2.SetTraceNotification = exports2.TraceFormat = exports2.Trace = exports2.ProgressType = exports2.createMessageConnection = exports2.NullLogger = exports2.ConnectionOptions = exports2.ConnectionStrategy = exports2.WriteableStreamMessageWriter = exports2.AbstractMessageWriter = exports2.MessageWriter = exports2.ReadableStreamMessageReader = exports2.AbstractMessageReader = exports2.MessageReader = exports2.CancellationToken = exports2.CancellationTokenSource = exports2.Emitter = exports2.Event = exports2.Disposable = exports2.ParameterStructures = exports2.NotificationType9 = exports2.NotificationType8 = exports2.NotificationType7 = exports2.NotificationType6 = exports2.NotificationType5 = exports2.NotificationType4 = exports2.NotificationType3 = exports2.NotificationType2 = exports2.NotificationType1 = exports2.NotificationType0 = exports2.NotificationType = exports2.ErrorCodes = exports2.ResponseError = exports2.RequestType9 = exports2.RequestType8 = exports2.RequestType7 = exports2.RequestType6 = exports2.RequestType5 = exports2.RequestType4 = exports2.RequestType3 = exports2.RequestType2 = exports2.RequestType1 = exports2.RequestType0 = exports2.RequestType = exports2.RAL = void 0; exports2.CancellationStrategy = void 0; var messages_1 = require_messages(); Object.defineProperty(exports2, "RequestType", {enumerable: true, get: function() { return messages_1.RequestType; }}); Object.defineProperty(exports2, "RequestType0", {enumerable: true, get: function() { return messages_1.RequestType0; }}); Object.defineProperty(exports2, "RequestType1", {enumerable: true, get: function() { return messages_1.RequestType1; }}); Object.defineProperty(exports2, "RequestType2", {enumerable: true, get: function() { return messages_1.RequestType2; }}); Object.defineProperty(exports2, "RequestType3", {enumerable: true, get: function() { return messages_1.RequestType3; }}); Object.defineProperty(exports2, "RequestType4", {enumerable: true, get: function() { return messages_1.RequestType4; }}); Object.defineProperty(exports2, "RequestType5", {enumerable: true, get: function() { return messages_1.RequestType5; }}); Object.defineProperty(exports2, "RequestType6", {enumerable: true, get: function() { return messages_1.RequestType6; }}); Object.defineProperty(exports2, "RequestType7", {enumerable: true, get: function() { return messages_1.RequestType7; }}); Object.defineProperty(exports2, "RequestType8", {enumerable: true, get: function() { return messages_1.RequestType8; }}); Object.defineProperty(exports2, "RequestType9", {enumerable: true, get: function() { return messages_1.RequestType9; }}); Object.defineProperty(exports2, "ResponseError", {enumerable: true, get: function() { return messages_1.ResponseError; }}); Object.defineProperty(exports2, "ErrorCodes", {enumerable: true, get: function() { return messages_1.ErrorCodes; }}); Object.defineProperty(exports2, "NotificationType", {enumerable: true, get: function() { return messages_1.NotificationType; }}); Object.defineProperty(exports2, "NotificationType0", {enumerable: true, get: function() { return messages_1.NotificationType0; }}); Object.defineProperty(exports2, "NotificationType1", {enumerable: true, get: function() { return messages_1.NotificationType1; }}); Object.defineProperty(exports2, "NotificationType2", {enumerable: true, get: function() { return messages_1.NotificationType2; }}); Object.defineProperty(exports2, "NotificationType3", {enumerable: true, get: function() { return messages_1.NotificationType3; }}); Object.defineProperty(exports2, "NotificationType4", {enumerable: true, get: function() { return messages_1.NotificationType4; }}); Object.defineProperty(exports2, "NotificationType5", {enumerable: true, get: function() { return messages_1.NotificationType5; }}); Object.defineProperty(exports2, "NotificationType6", {enumerable: true, get: function() { return messages_1.NotificationType6; }}); Object.defineProperty(exports2, "NotificationType7", {enumerable: true, get: function() { return messages_1.NotificationType7; }}); Object.defineProperty(exports2, "NotificationType8", {enumerable: true, get: function() { return messages_1.NotificationType8; }}); Object.defineProperty(exports2, "NotificationType9", {enumerable: true, get: function() { return messages_1.NotificationType9; }}); Object.defineProperty(exports2, "ParameterStructures", {enumerable: true, get: function() { return messages_1.ParameterStructures; }}); var disposable_1 = require_disposable(); Object.defineProperty(exports2, "Disposable", {enumerable: true, get: function() { return disposable_1.Disposable; }}); var events_1 = require_events(); Object.defineProperty(exports2, "Event", {enumerable: true, get: function() { return events_1.Event; }}); Object.defineProperty(exports2, "Emitter", {enumerable: true, get: function() { return events_1.Emitter; }}); var cancellation_1 = require_cancellation(); Object.defineProperty(exports2, "CancellationTokenSource", {enumerable: true, get: function() { return cancellation_1.CancellationTokenSource; }}); Object.defineProperty(exports2, "CancellationToken", {enumerable: true, get: function() { return cancellation_1.CancellationToken; }}); var messageReader_1 = require_messageReader(); Object.defineProperty(exports2, "MessageReader", {enumerable: true, get: function() { return messageReader_1.MessageReader; }}); Object.defineProperty(exports2, "AbstractMessageReader", {enumerable: true, get: function() { return messageReader_1.AbstractMessageReader; }}); Object.defineProperty(exports2, "ReadableStreamMessageReader", {enumerable: true, get: function() { return messageReader_1.ReadableStreamMessageReader; }}); var messageWriter_1 = require_messageWriter(); Object.defineProperty(exports2, "MessageWriter", {enumerable: true, get: function() { return messageWriter_1.MessageWriter; }}); Object.defineProperty(exports2, "AbstractMessageWriter", {enumerable: true, get: function() { return messageWriter_1.AbstractMessageWriter; }}); Object.defineProperty(exports2, "WriteableStreamMessageWriter", {enumerable: true, get: function() { return messageWriter_1.WriteableStreamMessageWriter; }}); var connection_1 = require_connection(); Object.defineProperty(exports2, "ConnectionStrategy", {enumerable: true, get: function() { return connection_1.ConnectionStrategy; }}); Object.defineProperty(exports2, "ConnectionOptions", {enumerable: true, get: function() { return connection_1.ConnectionOptions; }}); Object.defineProperty(exports2, "NullLogger", {enumerable: true, get: function() { return connection_1.NullLogger; }}); Object.defineProperty(exports2, "createMessageConnection", {enumerable: true, get: function() { return connection_1.createMessageConnection; }}); Object.defineProperty(exports2, "ProgressType", {enumerable: true, get: function() { return connection_1.ProgressType; }}); Object.defineProperty(exports2, "Trace", {enumerable: true, get: function() { return connection_1.Trace; }}); Object.defineProperty(exports2, "TraceFormat", {enumerable: true, get: function() { return connection_1.TraceFormat; }}); Object.defineProperty(exports2, "SetTraceNotification", {enumerable: true, get: function() { return connection_1.SetTraceNotification; }}); Object.defineProperty(exports2, "LogTraceNotification", {enumerable: true, get: function() { return connection_1.LogTraceNotification; }}); Object.defineProperty(exports2, "ConnectionErrors", {enumerable: true, get: function() { return connection_1.ConnectionErrors; }}); Object.defineProperty(exports2, "ConnectionError", {enumerable: true, get: function() { return connection_1.ConnectionError; }}); Object.defineProperty(exports2, "CancellationReceiverStrategy", {enumerable: true, get: function() { return connection_1.CancellationReceiverStrategy; }}); Object.defineProperty(exports2, "CancellationSenderStrategy", {enumerable: true, get: function() { return connection_1.CancellationSenderStrategy; }}); Object.defineProperty(exports2, "CancellationStrategy", {enumerable: true, get: function() { return connection_1.CancellationStrategy; }}); var ral_1 = require_ral(); exports2.RAL = ral_1.default; }); // node_modules/vscode-jsonrpc/lib/node/main.js var require_main = __commonJS((exports2) => { "use strict"; var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { if (k2 === void 0) k2 = k; Object.defineProperty(o, k2, {enumerable: true, get: function() { return m[k]; }}); } : function(o, m, k, k2) { if (k2 === void 0) k2 = k; o[k2] = m[k]; }); var __exportStar2 = exports2 && exports2.__exportStar || function(m, exports3) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p); }; Object.defineProperty(exports2, "__esModule", {value: true}); exports2.createMessageConnection = exports2.createServerSocketTransport = exports2.createClientSocketTransport = exports2.createServerPipeTransport = exports2.createClientPipeTransport = exports2.generateRandomPipeName = exports2.StreamMessageWriter = exports2.StreamMessageReader = exports2.SocketMessageWriter = exports2.SocketMessageReader = exports2.IPCMessageWriter = exports2.IPCMessageReader = void 0; var ril_1 = require_ril(); ril_1.default.install(); var api_1 = require_api(); var path = require("path"); var os = require("os"); var crypto_1 = require("crypto"); var net_1 = require("net"); __exportStar2(require_api(), exports2); var IPCMessageReader = class extends api_1.AbstractMessageReader { constructor(process2) { super(); this.process = process2; let eventEmitter = this.process; eventEmitter.on("error", (error) => this.fireError(error)); eventEmitter.on("close", () => this.fireClose()); } listen(callback) { this.process.on("message", callback); return api_1.Disposable.create(() => this.process.off("message", callback)); } }; exports2.IPCMessageReader = IPCMessageReader; var IPCMessageWriter = class extends api_1.AbstractMessageWriter { constructor(process2) { super(); this.process = process2; this.errorCount = 0; let eventEmitter = this.process; eventEmitter.on("error", (error) => this.fireError(error)); eventEmitter.on("close", () => this.fireClose); } write(msg) { try { if (typeof this.process.send === "function") { this.process.send(msg, void 0, void 0, (error) => { if (error) { this.errorCount++; this.handleError(error, msg); } else { this.errorCount = 0; } }); } return Promise.resolve(); } catch (error) { this.handleError(error, msg); return Promise.reject(error); } } handleError(error, msg) { this.errorCount++; this.fireError(error, msg, this.errorCount); } end() { } }; exports2.IPCMessageWriter = IPCMessageWriter; var SocketMessageReader = class extends api_1.ReadableStreamMessageReader { constructor(socket, encoding = "utf-8") { super(ril_1.default().stream.asReadableStream(socket), encoding); } }; exports2.SocketMessageReader = SocketMessageReader; var SocketMessageWriter = class extends api_1.WriteableStreamMessageWriter { constructor(socket, options) { super(ril_1.default().stream.asWritableStream(socket), options); this.socket = socket; } dispose() { super.dispose(); this.socket.destroy(); } }; exports2.SocketMessageWriter = SocketMessageWriter; var StreamMessageReader = class extends api_1.ReadableStreamMessageReader { constructor(readble, encoding) { super(ril_1.default().stream.asReadableStream(readble), encoding); } }; exports2.StreamMessageReader = StreamMessageReader; var StreamMessageWriter = class extends api_1.WriteableStreamMessageWriter { constructor(writable, options) { super(ril_1.default().stream.asWritableStream(writable), options); } }; exports2.StreamMessageWriter = StreamMessageWriter; var XDG_RUNTIME_DIR = process.env["XDG_RUNTIME_DIR"]; var safeIpcPathLengths = new Map([ ["linux", 107], ["darwin", 103] ]); function generateRandomPipeName() { const randomSuffix = crypto_1.randomBytes(21).toString("hex"); if (process.platform === "win32") { return `\\\\.\\pipe\\vscode-jsonrpc-${randomSuffix}-sock`; } let result; if (XDG_RUNTIME_DIR) { result = path.join(XDG_RUNTIME_DIR, `vscode-ipc-${randomSuffix}.sock`); } else { result = path.join(os.tmpdir(), `vscode-${randomSuffix}.sock`); } const limit = safeIpcPathLengths.get(process.platform); if (limit !== void 0 && result.length >= limit) { ril_1.default().console.warn(`WARNING: IPC handle "${result}" is longer than ${limit} characters.`); } return result; } exports2.generateRandomPipeName = generateRandomPipeName; function createClientPipeTransport(pipeName, encoding = "utf-8") { let connectResolve; const connected = new Promise((resolve, _reject) => { connectResolve = resolve; }); return new Promise((resolve, reject) => { let server = net_1.createServer((socket) => { server.close(); connectResolve([ new SocketMessageReader(socket, encoding), new SocketMessageWriter(socket, encoding) ]); }); server.on("error", reject); server.listen(pipeName, () => { server.removeListener("error", reject); resolve({ onConnected: () => { return connected; } }); }); }); } exports2.createClientPipeTransport = createClientPipeTransport; function createServerPipeTransport(pipeName, encoding = "utf-8") { const socket = net_1.createConnection(pipeName); return [ new SocketMessageReader(socket, encoding), new SocketMessageWriter(socket, encoding) ]; } exports2.createServerPipeTransport = createServerPipeTransport; function createClientSocketTransport(port, encoding = "utf-8") { let connectResolve; const connected = new Promise((resolve, _reject) => { connectResolve = resolve; }); return new Promise((resolve, reject) => { const server = net_1.createServer((socket) => { server.close(); connectResolve([ new SocketMessageReader(socket, encoding), new SocketMessageWriter(socket, encoding) ]); }); server.on("error", reject); server.listen(port, "127.0.0.1", () => { server.removeListener("error", reject); resolve({ onConnected: () => { return connected; } }); }); }); } exports2.createClientSocketTransport = createClientSocketTransport; function createServerSocketTransport(port, encoding = "utf-8") { const socket = net_1.createConnection(port, "127.0.0.1"); return [ new SocketMessageReader(socket, encoding), new SocketMessageWriter(socket, encoding) ]; } exports2.createServerSocketTransport = createServerSocketTransport; function isReadableStream(value) { const candidate = value; return candidate.read !== void 0 && candidate.addListener !== void 0; } function isWritableStream(value) { const candidate = value; return candidate.write !== void 0 && candidate.addListener !== void 0; } function createMessageConnection(input, output, logger, options) { if (!logger) { logger = api_1.NullLogger; } const reader = isReadableStream(input) ? new StreamMessageReader(input) : input; const writer = isWritableStream(output) ? new StreamMessageWriter(output) : output; if (api_1.ConnectionStrategy.is(options)) { options = {connectionStrategy: options}; } return api_1.createMessageConnection(reader, writer, logger, options); } exports2.createMessageConnection = createMessageConnection; }); // node_modules/vscode-jsonrpc/node.js var require_node = __commonJS((exports2, module2) => { "use strict"; module2.exports = require_main(); }); // node_modules/vscode-languageserver-types/lib/esm/main.js var require_main2 = __commonJS((exports2) => { __markAsModule(exports2); __export(exports2, { AnnotatedTextEdit: () => AnnotatedTextEdit, ChangeAnnotation: () => ChangeAnnotation, ChangeAnnotationIdentifier: () => ChangeAnnotationIdentifier, CodeAction: () => CodeAction, CodeActionContext: () => CodeActionContext, CodeActionKind: () => CodeActionKind, CodeDescription: () => CodeDescription, CodeLens: () => CodeLens, Color: () => Color, ColorInformation: () => ColorInformation, ColorPresentation: () => ColorPresentation, Command: () => Command, CompletionItem: () => CompletionItem, CompletionItemKind: () => CompletionItemKind, CompletionItemTag: () => CompletionItemTag, CompletionList: () => CompletionList, CreateFile: () => CreateFile, DeleteFile: () => DeleteFile, Diagnostic: () => Diagnostic, DiagnosticRelatedInformation: () => DiagnosticRelatedInformation, DiagnosticSeverity: () => DiagnosticSeverity, DiagnosticTag: () => DiagnosticTag, DocumentHighlight: () => DocumentHighlight, DocumentHighlightKind: () => DocumentHighlightKind, DocumentLink: () => DocumentLink, DocumentSymbol: () => DocumentSymbol, EOL: () => EOL, FoldingRange: () => FoldingRange, FoldingRangeKind: () => FoldingRangeKind, FormattingOptions: () => FormattingOptions, Hover: () => Hover, InsertReplaceEdit: () => InsertReplaceEdit, InsertTextFormat: () => InsertTextFormat, InsertTextMode: () => InsertTextMode, Location: () => Location, LocationLink: () => LocationLink, MarkedString: () => MarkedString, MarkupContent: () => MarkupContent, MarkupKind: () => MarkupKind, OptionalVersionedTextDocumentIdentifier: () => OptionalVersionedTextDocumentIdentifier, ParameterInformation: () => ParameterInformation, Position: () => Position, Range: () => Range3, RenameFile: () => RenameFile, SelectionRange: () => SelectionRange, SignatureInformation: () => SignatureInformation, SymbolInformation: () => SymbolInformation, SymbolKind: () => SymbolKind, SymbolTag: () => SymbolTag, TextDocument: () => TextDocument, TextDocumentEdit: () => TextDocumentEdit, TextDocumentIdentifier: () => TextDocumentIdentifier2, TextDocumentItem: () => TextDocumentItem, TextEdit: () => TextEdit, VersionedTextDocumentIdentifier: () => VersionedTextDocumentIdentifier2, WorkspaceChange: () => WorkspaceChange, WorkspaceEdit: () => WorkspaceEdit, integer: () => integer, uinteger: () => uinteger }); "use strict"; var integer; (function(integer2) { integer2.MIN_VALUE = -2147483648; integer2.MAX_VALUE = 2147483647; })(integer || (integer = {})); var uinteger; (function(uinteger2) { uinteger2.MIN_VALUE = 0; uinteger2.MAX_VALUE = 2147483647; })(uinteger || (uinteger = {})); var Position; (function(Position2) { function create(line, character) { if (line === Number.MAX_VALUE) { line = uinteger.MAX_VALUE; } if (character === Number.MAX_VALUE) { character = uinteger.MAX_VALUE; } return {line, character}; } Position2.create = create; function is(value) { var candidate = value; return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character); } Position2.is = is; })(Position || (Position = {})); var Range3; (function(Range4) { function create(one, two, three, four) { if (Is.uinteger(one) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four)) { return {start: Position.create(one, two), end: Position.create(three, four)}; } else if (Position.is(one) && Position.is(two)) { return {start: one, end: two}; } else { throw new Error("Range#create called with invalid arguments[" + one + ", " + two + ", " + three + ", " + four + "]"); } } Range4.create = create; function is(value) { var candidate = value; return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end); } Range4.is = is; })(Range3 || (Range3 = {})); var Location; (function(Location2) { function create(uri, range) { return {uri, range}; } Location2.create = create; function is(value) { var candidate = value; return Is.defined(candidate) && Range3.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri)); } Location2.is = is; })(Location || (Location = {})); var LocationLink; (function(LocationLink2) { function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) { return {targetUri, targetRange, targetSelectionRange, originSelectionRange}; } LocationLink2.create = create; function is(value) { var candidate = value; return Is.defined(candidate) && Range3.is(candidate.targetRange) && Is.string(candidate.targetUri) && (Range3.is(candidate.targetSelectionRange) || Is.undefined(candidate.targetSelectionRange)) && (Range3.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange)); } LocationLink2.is = is; })(LocationLink || (LocationLink = {})); var Color; (function(Color2) { function create(red, green, blue, alpha) { return { red, green, blue, alpha }; } Color2.create = create; function is(value) { var candidate = value; return Is.numberRange(candidate.red, 0, 1) && Is.numberRange(candidate.green, 0, 1) && Is.numberRange(candidate.blue, 0, 1) && Is.numberRange(candidate.alpha, 0, 1); } Color2.is = is; })(Color || (Color = {})); var ColorInformation; (function(ColorInformation2) { function create(range, color) { return { range, color }; } ColorInformation2.create = create; function is(value) { var candidate = value; return Range3.is(candidate.range) && Color.is(candidate.color); } ColorInformation2.is = is; })(ColorInformation || (ColorInformation = {})); var ColorPresentation; (function(ColorPresentation2) { function create(label, textEdit, additionalTextEdits) { return { label, textEdit, additionalTextEdits }; } ColorPresentation2.create = create; function is(value) { var candidate = value; return Is.string(candidate.label) && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate)) && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is)); } ColorPresentation2.is = is; })(ColorPresentation || (ColorPresentation = {})); var FoldingRangeKind; (function(FoldingRangeKind2) { FoldingRangeKind2["Comment"] = "comment"; FoldingRangeKind2["Imports"] = "imports"; FoldingRangeKind2["Region"] = "region"; })(FoldingRangeKind || (FoldingRangeKind = {})); var FoldingRange; (function(FoldingRange2) { function create(startLine, endLine, startCharacter, endCharacter, kind) { var result = { startLine, endLine }; if (Is.defined(startCharacter)) { result.startCharacter = startCharacter; } if (Is.defined(endCharacter)) { result.endCharacter = endCharacter; } if (Is.defined(kind)) { result.kind = kind; } return result; } FoldingRange2.create = create; function is(value) { var candidate = value; return Is.uinteger(candidate.startLine) && Is.uinteger(candidate.startLine) && (Is.undefined(candidate.startCharacter) || Is.uinteger(candidate.startCharacter)) && (Is.undefined(candidate.endCharacter) || Is.uinteger(candidate.endCharacter)) && (Is.undefined(candidate.kind) || Is.string(candidate.kind)); } FoldingRange2.is = is; })(FoldingRange || (FoldingRange = {})); var DiagnosticRelatedInformation; (function(DiagnosticRelatedInformation2) { function create(location, message) { return { location, message }; } DiagnosticRelatedInformation2.create = create; function is(value) { var candidate = value; return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message); } DiagnosticRelatedInformation2.is = is; })(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {})); var DiagnosticSeverity; (function(DiagnosticSeverity2) { DiagnosticSeverity2.Error = 1; DiagnosticSeverity2.Warning = 2; DiagnosticSeverity2.Information = 3; DiagnosticSeverity2.Hint = 4; })(DiagnosticSeverity || (DiagnosticSeverity = {})); var DiagnosticTag; (function(DiagnosticTag2) { DiagnosticTag2.Unnecessary = 1; DiagnosticTag2.Deprecated = 2; })(DiagnosticTag || (DiagnosticTag = {})); var CodeDescription; (function(CodeDescription2) { function is(value) { var candidate = value; return candidate !== void 0 && candidate !== null && Is.string(candidate.href); } CodeDescription2.is = is; })(CodeDescription || (CodeDescription = {})); var Diagnostic; (function(Diagnostic2) { function create(range, message, severity, code, source, relatedInformation) { var result = {range, message}; if (Is.defined(severity)) { result.severity = severity; } if (Is.defined(code)) { result.code = code; } if (Is.defined(source)) { result.source = source; } if (Is.defined(relatedInformation)) { result.relatedInformation = relatedInformation; } return result; } Diagnostic2.create = create; function is(value) { var _a; var candidate = value; return Is.defined(candidate) && Range3.is(candidate.range) && Is.string(candidate.message) && (Is.number(candidate.severity) || Is.undefined(candidate.severity)) && (Is.integer(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code)) && (Is.undefined(candidate.codeDescription) || Is.string((_a = candidate.codeDescription) === null || _a === void 0 ? void 0 : _a.href)) && (Is.string(candidate.source) || Is.undefined(candidate.source)) && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is)); } Diagnostic2.is = is; })(Diagnostic || (Diagnostic = {})); var Command; (function(Command2) { function create(title, command) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } var result = {title, command}; if (Is.defined(args) && args.length > 0) { result.arguments = args; } return result; } Command2.create = create; function is(value) { var candidate = value; return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command); } Command2.is = is; })(Command || (Command = {})); var TextEdit; (function(TextEdit2) { function replace(range, newText) { return {range, newText}; } TextEdit2.replace = replace; function insert(position, newText) { return {range: {start: position, end: position}, newText}; } TextEdit2.insert = insert; function del(range) { return {range, newText: ""}; } TextEdit2.del = del; function is(value) { var candidate = value; return Is.objectLiteral(candidate) && Is.string(candidate.newText) && Range3.is(candidate.range); } TextEdit2.is = is; })(TextEdit || (TextEdit = {})); var ChangeAnnotation; (function(ChangeAnnotation2) { function create(label, needsConfirmation, description) { var result = {label}; if (needsConfirmation !== void 0) { result.needsConfirmation = needsConfirmation; } if (description !== void 0) { result.description = description; } return result; } ChangeAnnotation2.create = create; function is(value) { var candidate = value; return candidate !== void 0 && Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === void 0) && (Is.string(candidate.description) || candidate.description === void 0); } ChangeAnnotation2.is = is; })(ChangeAnnotation || (ChangeAnnotation = {})); var ChangeAnnotationIdentifier; (function(ChangeAnnotationIdentifier2) { function is(value) { var candidate = value; return typeof candidate === "string"; } ChangeAnnotationIdentifier2.is = is; })(ChangeAnnotationIdentifier || (ChangeAnnotationIdentifier = {})); var AnnotatedTextEdit; (function(AnnotatedTextEdit2) { function replace(range, newText, annotation) { return {range, newText, annotationId: annotation}; } AnnotatedTextEdit2.replace = replace; function insert(position, newText, annotation) { return {range: {start: position, end: position}, newText, annotationId: annotation}; } AnnotatedTextEdit2.insert = insert; function del(range, annotation) { return {range, newText: "", annotationId: annotation}; } AnnotatedTextEdit2.del = del; function is(value) { var candidate = value; return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId)); } AnnotatedTextEdit2.is = is; })(AnnotatedTextEdit || (AnnotatedTextEdit = {})); var TextDocumentEdit; (function(TextDocumentEdit2) { function create(textDocument, edits) { return {textDocument, edits}; } TextDocumentEdit2.create = create; function is(value) { var candidate = value; return Is.defined(candidate) && OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument) && Array.isArray(candidate.edits); } TextDocumentEdit2.is = is; })(TextDocumentEdit || (TextDocumentEdit = {})); var CreateFile; (function(CreateFile2) { function create(uri, options, annotation) { var result = { kind: "create", uri }; if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) { result.options = options; } if (annotation !== void 0) { result.annotationId = annotation; } return result; } CreateFile2.create = create; function is(value) { var candidate = value; return candidate && candidate.kind === "create" && Is.string(candidate.uri) && (candidate.options === void 0 || (candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId)); } CreateFile2.is = is; })(CreateFile || (CreateFile = {})); var RenameFile; (function(RenameFile2) { function create(oldUri, newUri, options, annotation) { var result = { kind: "rename", oldUri, newUri }; if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) { result.options = options; } if (annotation !== void 0) { result.annotationId = annotation; } return result; } RenameFile2.create = create; function is(value) { var candidate = value; return candidate && candidate.kind === "rename" && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && (candidate.options === void 0 || (candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId)); } RenameFile2.is = is; })(RenameFile || (RenameFile = {})); var DeleteFile; (function(DeleteFile2) { function create(uri, options, annotation) { var result = { kind: "delete", uri }; if (options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0)) { result.options = options; } if (annotation !== void 0) { result.annotationId = annotation; } return result; } DeleteFile2.create = create; function is(value) { var candidate = value; return candidate && candidate.kind === "delete" && Is.string(candidate.uri) && (candidate.options === void 0 || (candidate.options.recursive === void 0 || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === void 0 || Is.boolean(candidate.options.ignoreIfNotExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId)); } DeleteFile2.is = is; })(DeleteFile || (DeleteFile = {})); var WorkspaceEdit; (function(WorkspaceEdit2) { function is(value) { var candidate = value; return candidate && (candidate.changes !== void 0 || candidate.documentChanges !== void 0) && (candidate.documentChanges === void 0 || candidate.documentChanges.every(function(change) { if (Is.string(change.kind)) { return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change); } else { return TextDocumentEdit.is(change); } })); } WorkspaceEdit2.is = is; })(WorkspaceEdit || (WorkspaceEdit = {})); var TextEditChangeImpl = function() { function TextEditChangeImpl2(edits, changeAnnotations) { this.edits = edits; this.changeAnnotations = changeAnnotations; } TextEditChangeImpl2.prototype.insert = function(position, newText, annotation) { var edit; var id; if (annotation === void 0) { edit = TextEdit.insert(position, newText); } else if (ChangeAnnotationIdentifier.is(annotation)) { id = annotation; edit = AnnotatedTextEdit.insert(position, newText, annotation); } else { this.assertChangeAnnotations(this.changeAnnotations); id = this.changeAnnotations.manage(annotation); edit = AnnotatedTextEdit.insert(position, newText, id); } this.edits.push(edit); if (id !== void 0) { return id; } }; TextEditChangeImpl2.prototype.replace = function(range, newText, annotation) { var edit; var id; if (annotation === void 0) { edit = TextEdit.replace(range, newText); } else if (ChangeAnnotationIdentifier.is(annotation)) { id = annotation; edit = AnnotatedTextEdit.replace(range, newText, annotation); } else { this.assertChangeAnnotations(this.changeAnnotations); id = this.changeAnnotations.manage(annotation); edit = AnnotatedTextEdit.replace(range, newText, id); } this.edits.push(edit); if (id !== void 0) { return id; } }; TextEditChangeImpl2.prototype.delete = function(range, annotation) { var edit; var id; if (annotation === void 0) { edit = TextEdit.del(range); } else if (ChangeAnnotationIdentifier.is(annotation)) { id = annotation; edit = AnnotatedTextEdit.del(range, annotation); } else { this.assertChangeAnnotations(this.changeAnnotations); id = this.changeAnnotations.manage(annotation); edit = AnnotatedTextEdit.del(range, id); } this.edits.push(edit); if (id !== void 0) { return id; } }; TextEditChangeImpl2.prototype.add = function(edit) { this.edits.push(edit); }; TextEditChangeImpl2.prototype.all = function() { return this.edits; }; TextEditChangeImpl2.prototype.clear = function() { this.edits.splice(0, this.edits.length); }; TextEditChangeImpl2.prototype.assertChangeAnnotations = function(value) { if (value === void 0) { throw new Error("Text edit change is not configured to manage change annotations."); } }; return TextEditChangeImpl2; }(); var ChangeAnnotations = function() { function ChangeAnnotations2(annotations) { this._annotations = annotations === void 0 ? Object.create(null) : annotations; this._counter = 0; this._size = 0; } ChangeAnnotations2.prototype.all = function() { return this._annotations; }; Object.defineProperty(ChangeAnnotations2.prototype, "size", { get: function() { return this._size; }, enumerable: false, configurable: true }); ChangeAnnotations2.prototype.manage = function(idOrAnnotation, annotation) { var id; if (ChangeAnnotationIdentifier.is(idOrAnnotation)) { id = idOrAnnotation; } else { id = this.nextId(); annotation = idOrAnnotation; } if (this._annotations[id] !== void 0) { throw new Error("Id " + id + " is already in use."); } if (annotation === void 0) { throw new Error("No annotation provided for id " + id); } this._annotations[id] = annotation; this._size++; return id; }; ChangeAnnotations2.prototype.nextId = function() { this._counter++; return this._counter.toString(); }; return ChangeAnnotations2; }(); var WorkspaceChange = function() { function WorkspaceChange2(workspaceEdit) { var _this = this; this._textEditChanges = Object.create(null); if (workspaceEdit !== void 0) { this._workspaceEdit = workspaceEdit; if (workspaceEdit.documentChanges) { this._changeAnnotations = new ChangeAnnotations(workspaceEdit.changeAnnotations); workspaceEdit.changeAnnotations = this._changeAnnotations.all(); workspaceEdit.documentChanges.forEach(function(change) { if (TextDocumentEdit.is(change)) { var textEditChange = new TextEditChangeImpl(change.edits, _this._changeAnnotations); _this._textEditChanges[change.textDocument.uri] = textEditChange; } }); } else if (workspaceEdit.changes) { Object.keys(workspaceEdit.changes).forEach(function(key) { var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]); _this._textEditChanges[key] = textEditChange; }); } } else { this._workspaceEdit = {}; } } Object.defineProperty(WorkspaceChange2.prototype, "edit", { get: function() { this.initDocumentChanges(); if (this._changeAnnotations !== void 0) { if (this._changeAnnotations.size === 0) { this._workspaceEdit.changeAnnotations = void 0; } else { this._workspaceEdit.changeAnnotations = this._changeAnnotations.all(); } } return this._workspaceEdit; }, enumerable: false, configurable: true }); WorkspaceChange2.prototype.getTextEditChange = function(key) { if (OptionalVersionedTextDocumentIdentifier.is(key)) { this.initDocumentChanges(); if (this._workspaceEdit.documentChanges === void 0) { throw new Error("Workspace edit is not configured for document changes."); } var textDocument = {uri: key.uri, version: key.version}; var result = this._textEditChanges[textDocument.uri]; if (!result) { var edits = []; var textDocumentEdit = { textDocument, edits }; this._workspaceEdit.documentChanges.push(textDocumentEdit); result = new TextEditChangeImpl(edits, this._changeAnnotations); this._textEditChanges[textDocument.uri] = result; } return result; } else { this.initChanges(); if (this._workspaceEdit.changes === void 0) { throw new Error("Workspace edit is not configured for normal text edit changes."); } var result = this._textEditChanges[key]; if (!result) { var edits = []; this._workspaceEdit.changes[key] = edits; result = new TextEditChangeImpl(edits); this._textEditChanges[key] = result; } return result; } }; WorkspaceChange2.prototype.initDocumentChanges = function() { if (this._workspaceEdit.documentChanges === void 0 && this._workspaceEdit.changes === void 0) { this._changeAnnotations = new ChangeAnnotations(); this._workspaceEdit.documentChanges = []; this._workspaceEdit.changeAnnotations = this._changeAnnotations.all(); } }; WorkspaceChange2.prototype.initChanges = function() { if (this._workspaceEdit.documentChanges === void 0 && this._workspaceEdit.changes === void 0) { this._workspaceEdit.changes = Object.create(null); } }; WorkspaceChange2.prototype.createFile = function(uri, optionsOrAnnotation, options) { this.initDocumentChanges(); if (this._workspaceEdit.documentChanges === void 0) { throw new Error("Workspace edit is not configured for document changes."); } var annotation; if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) { annotation = optionsOrAnnotation; } else { options = optionsOrAnnotation; } var operation; var id; if (annotation === void 0) { operation = CreateFile.create(uri, options); } else { id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation); operation = CreateFile.create(uri, options, id); } this._workspaceEdit.documentChanges.push(operation); if (id !== void 0) { return id; } }; WorkspaceChange2.prototype.renameFile = function(oldUri, newUri, optionsOrAnnotation, options) { this.initDocumentChanges(); if (this._workspaceEdit.documentChanges === void 0) { throw new Error("Workspace edit is not configured for document changes."); } var annotation; if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) { annotation = optionsOrAnnotation; } else { options = optionsOrAnnotation; } var operation; var id; if (annotation === void 0) { operation = RenameFile.create(oldUri, newUri, options); } else { id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation); operation = RenameFile.create(oldUri, newUri, options, id); } this._workspaceEdit.documentChanges.push(operation); if (id !== void 0) { return id; } }; WorkspaceChange2.prototype.deleteFile = function(uri, optionsOrAnnotation, options) { this.initDocumentChanges(); if (this._workspaceEdit.documentChanges === void 0) { throw new Error("Workspace edit is not configured for document changes."); } var annotation; if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) { annotation = optionsOrAnnotation; } else { options = optionsOrAnnotation; } var operation; var id; if (annotation === void 0) { operation = DeleteFile.create(uri, options); } else { id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation); operation = DeleteFile.create(uri, options, id); } this._workspaceEdit.documentChanges.push(operation); if (id !== void 0) { return id; } }; return WorkspaceChange2; }(); var TextDocumentIdentifier2; (function(TextDocumentIdentifier3) { function create(uri) { return {uri}; } TextDocumentIdentifier3.create = create; function is(value) { var candidate = value; return Is.defined(candidate) && Is.string(candidate.uri); } TextDocumentIdentifier3.is = is; })(TextDocumentIdentifier2 || (TextDocumentIdentifier2 = {})); var VersionedTextDocumentIdentifier2; (function(VersionedTextDocumentIdentifier3) { function create(uri, version) { return {uri, version}; } VersionedTextDocumentIdentifier3.create = create; function is(value) { var candidate = value; return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version); } VersionedTextDocumentIdentifier3.is = is; })(VersionedTextDocumentIdentifier2 || (VersionedTextDocumentIdentifier2 = {})); var OptionalVersionedTextDocumentIdentifier; (function(OptionalVersionedTextDocumentIdentifier2) { function create(uri, version) { return {uri, version}; } OptionalVersionedTextDocumentIdentifier2.create = create; function is(value) { var candidate = value; return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version)); } OptionalVersionedTextDocumentIdentifier2.is = is; })(OptionalVersionedTextDocumentIdentifier || (OptionalVersionedTextDocumentIdentifier = {})); var TextDocumentItem; (function(TextDocumentItem2) { function create(uri, languageId, version, text) { return {uri, languageId, version, text}; } TextDocumentItem2.create = create; function is(value) { var candidate = value; return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text); } TextDocumentItem2.is = is; })(TextDocumentItem || (TextDocumentItem = {})); var MarkupKind; (function(MarkupKind2) { MarkupKind2.PlainText = "plaintext"; MarkupKind2.Markdown = "markdown"; })(MarkupKind || (MarkupKind = {})); (function(MarkupKind2) { function is(value) { var candidate = value; return candidate === MarkupKind2.PlainText || candidate === MarkupKind2.Markdown; } MarkupKind2.is = is; })(MarkupKind || (MarkupKind = {})); var MarkupContent; (function(MarkupContent2) { function is(value) { var candidate = value; return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value); } MarkupContent2.is = is; })(MarkupContent || (MarkupContent = {})); var CompletionItemKind; (function(CompletionItemKind2) { CompletionItemKind2.Text = 1; CompletionItemKind2.Method = 2; CompletionItemKind2.Function = 3; CompletionItemKind2.Constructor = 4; CompletionItemKind2.Field = 5; CompletionItemKind2.Variable = 6; CompletionItemKind2.Class = 7; CompletionItemKind2.Interface = 8; CompletionItemKind2.Module = 9; CompletionItemKind2.Property = 10; CompletionItemKind2.Unit = 11; CompletionItemKind2.Value = 12; CompletionItemKind2.Enum = 13; CompletionItemKind2.Keyword = 14; CompletionItemKind2.Snippet = 15; CompletionItemKind2.Color = 16; CompletionItemKind2.File = 17; CompletionItemKind2.Reference = 18; CompletionItemKind2.Folder = 19; CompletionItemKind2.EnumMember = 20; CompletionItemKind2.Constant = 21; CompletionItemKind2.Struct = 22; CompletionItemKind2.Event = 23; CompletionItemKind2.Operator = 24; CompletionItemKind2.TypeParameter = 25; })(CompletionItemKind || (CompletionItemKind = {})); var InsertTextFormat; (function(InsertTextFormat2) { InsertTextFormat2.PlainText = 1; InsertTextFormat2.Snippet = 2; })(InsertTextFormat || (InsertTextFormat = {})); var CompletionItemTag; (function(CompletionItemTag2) { CompletionItemTag2.Deprecated = 1; })(CompletionItemTag || (CompletionItemTag = {})); var InsertReplaceEdit; (function(InsertReplaceEdit2) { function create(newText, insert, replace) { return {newText, insert, replace}; } InsertReplaceEdit2.create = create; function is(value) { var candidate = value; return candidate && Is.string(candidate.newText) && Range3.is(candidate.insert) && Range3.is(candidate.replace); } InsertReplaceEdit2.is = is; })(InsertReplaceEdit || (InsertReplaceEdit = {})); var InsertTextMode; (function(InsertTextMode2) { InsertTextMode2.asIs = 1; InsertTextMode2.adjustIndentation = 2; })(InsertTextMode || (InsertTextMode = {})); var CompletionItem; (function(CompletionItem2) { function create(label) { return {label}; } CompletionItem2.create = create; })(CompletionItem || (CompletionItem = {})); var CompletionList; (function(CompletionList2) { function create(items, isIncomplete) { return {items: items ? items : [], isIncomplete: !!isIncomplete}; } CompletionList2.create = create; })(CompletionList || (CompletionList = {})); var MarkedString; (function(MarkedString2) { function fromPlainText(plainText) { return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&"); } MarkedString2.fromPlainText = fromPlainText; function is(value) { var candidate = value; return Is.string(candidate) || Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value); } MarkedString2.is = is; })(MarkedString || (MarkedString = {})); var Hover; (function(Hover2) { function is(value) { var candidate = value; return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) || MarkedString.is(candidate.contents) || Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || Range3.is(value.range)); } Hover2.is = is; })(Hover || (Hover = {})); var ParameterInformation; (function(ParameterInformation2) { function create(label, documentation) { return documentation ? {label, documentation} : {label}; } ParameterInformation2.create = create; })(ParameterInformation || (ParameterInformation = {})); var SignatureInformation; (function(SignatureInformation2) { function create(label, documentation) { var parameters = []; for (var _i = 2; _i < arguments.length; _i++) { parameters[_i - 2] = arguments[_i]; } var result = {label}; if (Is.defined(documentation)) { result.documentation = documentation; } if (Is.defined(parameters)) { result.parameters = parameters; } else { result.parameters = []; } return result; } SignatureInformation2.create = create; })(SignatureInformation || (SignatureInformation = {})); var DocumentHighlightKind; (function(DocumentHighlightKind2) { DocumentHighlightKind2.Text = 1; DocumentHighlightKind2.Read = 2; DocumentHighlightKind2.Write = 3; })(DocumentHighlightKind || (DocumentHighlightKind = {})); var DocumentHighlight; (function(DocumentHighlight2) { function create(range, kind) { var result = {range}; if (Is.number(kind)) { result.kind = kind; } return result; } DocumentHighlight2.create = create; })(DocumentHighlight || (DocumentHighlight = {})); var SymbolKind; (function(SymbolKind2) { SymbolKind2.File = 1; SymbolKind2.Module = 2; SymbolKind2.Namespace = 3; SymbolKind2.Package = 4; SymbolKind2.Class = 5; SymbolKind2.Method = 6; SymbolKind2.Property = 7; SymbolKind2.Field = 8; SymbolKind2.Constructor = 9; SymbolKind2.Enum = 10; SymbolKind2.Interface = 11; SymbolKind2.Function = 12; SymbolKind2.Variable = 13; SymbolKind2.Constant = 14; SymbolKind2.String = 15; SymbolKind2.Number = 16; SymbolKind2.Boolean = 17; SymbolKind2.Array = 18; SymbolKind2.Object = 19; SymbolKind2.Key = 20; SymbolKind2.Null = 21; SymbolKind2.EnumMember = 22; SymbolKind2.Struct = 23; SymbolKind2.Event = 24; SymbolKind2.Operator = 25; SymbolKind2.TypeParameter = 26; })(SymbolKind || (SymbolKind = {})); var SymbolTag; (function(SymbolTag2) { SymbolTag2.Deprecated = 1; })(SymbolTag || (SymbolTag = {})); var SymbolInformation; (function(SymbolInformation2) { function create(name, kind, range, uri, containerName) { var result = { name, kind, location: {uri, range} }; if (containerName) { result.containerName = containerName; } return result; } SymbolInformation2.create = create; })(SymbolInformation || (SymbolInformation = {})); var DocumentSymbol; (function(DocumentSymbol2) { function create(name, detail, kind, range, selectionRange, children) { var result = { name, detail, kind, range, selectionRange }; if (children !== void 0) { result.children = children; } return result; } DocumentSymbol2.create = create; function is(value) { var candidate = value; return candidate && Is.string(candidate.name) && Is.number(candidate.kind) && Range3.is(candidate.range) && Range3.is(candidate.selectionRange) && (candidate.detail === void 0 || Is.string(candidate.detail)) && (candidate.deprecated === void 0 || Is.boolean(candidate.deprecated)) && (candidate.children === void 0 || Array.isArray(candidate.children)) && (candidate.tags === void 0 || Array.isArray(candidate.tags)); } DocumentSymbol2.is = is; })(DocumentSymbol || (DocumentSymbol = {})); var CodeActionKind; (function(CodeActionKind2) { CodeActionKind2.Empty = ""; CodeActionKind2.QuickFix = "quickfix"; CodeActionKind2.Refactor = "refactor"; CodeActionKind2.RefactorExtract = "refactor.extract"; CodeActionKind2.RefactorInline = "refactor.inline"; CodeActionKind2.RefactorRewrite = "refactor.rewrite"; CodeActionKind2.Source = "source"; CodeActionKind2.SourceOrganizeImports = "source.organizeImports"; CodeActionKind2.SourceFixAll = "source.fixAll"; })(CodeActionKind || (CodeActionKind = {})); var CodeActionContext; (function(CodeActionContext2) { function create(diagnostics, only) { var result = {diagnostics}; if (only !== void 0 && only !== null) { result.only = only; } return result; } CodeActionContext2.create = create; function is(value) { var candidate = value; return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string)); } CodeActionContext2.is = is; })(CodeActionContext || (CodeActionContext = {})); var CodeAction; (function(CodeAction2) { function create(title, kindOrCommandOrEdit, kind) { var result = {title}; var checkKind = true; if (typeof kindOrCommandOrEdit === "string") { checkKind = false; result.kind = kindOrCommandOrEdit; } else if (Command.is(kindOrCommandOrEdit)) { result.command = kindOrCommandOrEdit; } else { result.edit = kindOrCommandOrEdit; } if (checkKind && kind !== void 0) { result.kind = kind; } return result; } CodeAction2.create = create; function is(value) { var candidate = value; return candidate && Is.string(candidate.title) && (candidate.diagnostics === void 0 || Is.typedArray(candidate.diagnostics, Diagnostic.is)) && (candidate.kind === void 0 || Is.string(candidate.kind)) && (candidate.edit !== void 0 || candidate.command !== void 0) && (candidate.command === void 0 || Command.is(candidate.command)) && (candidate.isPreferred === void 0 || Is.boolean(candidate.isPreferred)) && (candidate.edit === void 0 || WorkspaceEdit.is(candidate.edit)); } CodeAction2.is = is; })(CodeAction || (CodeAction = {})); var CodeLens; (function(CodeLens2) { function create(range, data) { var result = {range}; if (Is.defined(data)) { result.data = data; } return result; } CodeLens2.create = create; function is(value) { var candidate = value; return Is.defined(candidate) && Range3.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command)); } CodeLens2.is = is; })(CodeLens || (CodeLens = {})); var FormattingOptions; (function(FormattingOptions2) { function create(tabSize, insertSpaces) { return {tabSize, insertSpaces}; } FormattingOptions2.create = create; function is(value) { var candidate = value; return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces); } FormattingOptions2.is = is; })(FormattingOptions || (FormattingOptions = {})); var DocumentLink; (function(DocumentLink2) { function create(range, target, data) { return {range, target, data}; } DocumentLink2.create = create; function is(value) { var candidate = value; return Is.defined(candidate) && Range3.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target)); } DocumentLink2.is = is; })(DocumentLink || (DocumentLink = {})); var SelectionRange; (function(SelectionRange2) { function create(range, parent) { return {range, parent}; } SelectionRange2.create = create; function is(value) { var candidate = value; return candidate !== void 0 && Range3.is(candidate.range) && (candidate.parent === void 0 || SelectionRange2.is(candidate.parent)); } SelectionRange2.is = is; })(SelectionRange || (SelectionRange = {})); var EOL = ["\n", "\r\n", "\r"]; var TextDocument; (function(TextDocument2) { function create(uri, languageId, version, content) { return new FullTextDocument(uri, languageId, version, content); } TextDocument2.create = create; function is(value) { var candidate = value; return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.uinteger(candidate.lineCount) && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false; } TextDocument2.is = is; function applyEdits(document2, edits) { var text = document2.getText(); var sortedEdits = mergeSort(edits, function(a, b) { var diff = a.range.start.line - b.range.start.line; if (diff === 0) { return a.range.start.character - b.range.start.character; } return diff; }); var lastModifiedOffset = text.length; for (var i = sortedEdits.length - 1; i >= 0; i--) { var e = sortedEdits[i]; var startOffset = document2.offsetAt(e.range.start); var endOffset = document2.offsetAt(e.range.end); if (endOffset <= lastModifiedOffset) { text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length); } else { throw new Error("Overlapping edit"); } lastModifiedOffset = startOffset; } return text; } TextDocument2.applyEdits = applyEdits; function mergeSort(data, compare) { if (data.length <= 1) { return data; } var p = data.length / 2 | 0; var left = data.slice(0, p); var right = data.slice(p); mergeSort(left, compare); mergeSort(right, compare); var leftIdx = 0; var rightIdx = 0; var i = 0; while (leftIdx < left.length && rightIdx < right.length) { var ret2 = compare(left[leftIdx], right[rightIdx]); if (ret2 <= 0) { data[i++] = left[leftIdx++]; } else { data[i++] = right[rightIdx++]; } } while (leftIdx < left.length) { data[i++] = left[leftIdx++]; } while (rightIdx < right.length) { data[i++] = right[rightIdx++]; } return data; } })(TextDocument || (TextDocument = {})); var FullTextDocument = function() { function FullTextDocument2(uri, languageId, version, content) { this._uri = uri; this._languageId = languageId; this._version = version; this._content = content; this._lineOffsets = void 0; } Object.defineProperty(FullTextDocument2.prototype, "uri", { get: function() { return this._uri; }, enumerable: false, configurable: true }); Object.defineProperty(FullTextDocument2.prototype, "languageId", { get: function() { return this._languageId; }, enumerable: false, configurable: true }); Object.defineProperty(FullTextDocument2.prototype, "version", { get: function() { return this._version; }, enumerable: false, configurable: true }); FullTextDocument2.prototype.getText = function(range) { if (range) { var start = this.offsetAt(range.start); var end = this.offsetAt(range.end); return this._content.substring(start, end); } return this._content; }; FullTextDocument2.prototype.update = function(event, version) { this._content = event.text; this._version = version; this._lineOffsets = void 0; }; FullTextDocument2.prototype.getLineOffsets = function() { if (this._lineOffsets === void 0) { var lineOffsets = []; var text = this._content; var isLineStart = true; for (var i = 0; i < text.length; i++) { if (isLineStart) { lineOffsets.push(i); isLineStart = false; } var ch = text.charAt(i); isLineStart = ch === "\r" || ch === "\n"; if (ch === "\r" && i + 1 < text.length && text.charAt(i + 1) === "\n") { i++; } } if (isLineStart && text.length > 0) { lineOffsets.push(text.length); } this._lineOffsets = lineOffsets; } return this._lineOffsets; }; FullTextDocument2.prototype.positionAt = function(offset) { offset = Math.max(Math.min(offset, this._content.length), 0); var lineOffsets = this.getLineOffsets(); var low = 0, high = lineOffsets.length; if (high === 0) { return Position.create(0, offset); } while (low < high) { var mid = Math.floor((low + high) / 2); if (lineOffsets[mid] > offset) { high = mid; } else { low = mid + 1; } } var line = low - 1; return Position.create(line, offset - lineOffsets[line]); }; FullTextDocument2.prototype.offsetAt = function(position) { var lineOffsets = this.getLineOffsets(); if (position.line >= lineOffsets.length) { return this._content.length; } else if (position.line < 0) { return 0; } var lineOffset = lineOffsets[position.line]; var nextLineOffset = position.line + 1 < lineOffsets.length ? lineOffsets[position.line + 1] : this._content.length; return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset); }; Object.defineProperty(FullTextDocument2.prototype, "lineCount", { get: function() { return this.getLineOffsets().length; }, enumerable: false, configurable: true }); return FullTextDocument2; }(); var Is; (function(Is2) { var toString = Object.prototype.toString; function defined(value) { return typeof value !== "undefined"; } Is2.defined = defined; function undefined2(value) { return typeof value === "undefined"; } Is2.undefined = undefined2; function boolean(value) { return value === true || value === false; } Is2.boolean = boolean; function string(value) { return toString.call(value) === "[object String]"; } Is2.string = string; function number(value) { return toString.call(value) === "[object Number]"; } Is2.number = number; function numberRange(value, min, max) { return toString.call(value) === "[object Number]" && min <= value && value <= max; } Is2.numberRange = numberRange; function integer2(value) { return toString.call(value) === "[object Number]" && -2147483648 <= value && value <= 2147483647; } Is2.integer = integer2; function uinteger2(value) { return toString.call(value) === "[object Number]" && 0 <= value && value <= 2147483647; } Is2.uinteger = uinteger2; function func(value) { return toString.call(value) === "[object Function]"; } Is2.func = func; function objectLiteral(value) { return value !== null && typeof value === "object"; } Is2.objectLiteral = objectLiteral; function typedArray(value, check) { return Array.isArray(value) && value.every(check); } Is2.typedArray = typedArray; })(Is || (Is = {})); }); // node_modules/vscode-languageserver-protocol/lib/common/messages.js var require_messages2 = __commonJS((exports2) => { "use strict"; Object.defineProperty(exports2, "__esModule", {value: true}); exports2.ProtocolNotificationType = exports2.ProtocolNotificationType0 = exports2.ProtocolRequestType = exports2.ProtocolRequestType0 = exports2.RegistrationType = void 0; var vscode_jsonrpc_1 = require_main(); var RegistrationType = class { constructor(method) { this.method = method; } }; exports2.RegistrationType = RegistrationType; var ProtocolRequestType0 = class extends vscode_jsonrpc_1.RequestType0 { constructor(method) { super(method); } }; exports2.ProtocolRequestType0 = ProtocolRequestType0; var ProtocolRequestType = class extends vscode_jsonrpc_1.RequestType { constructor(method) { super(method, vscode_jsonrpc_1.ParameterStructures.byName); } }; exports2.ProtocolRequestType = ProtocolRequestType; var ProtocolNotificationType0 = class extends vscode_jsonrpc_1.NotificationType0 { constructor(method) { super(method); } }; exports2.ProtocolNotificationType0 = ProtocolNotificationType0; var ProtocolNotificationType = class extends vscode_jsonrpc_1.NotificationType { constructor(method) { super(method, vscode_jsonrpc_1.ParameterStructures.byName); } }; exports2.ProtocolNotificationType = ProtocolNotificationType; }); // node_modules/vscode-languageserver-protocol/lib/common/utils/is.js var require_is2 = __commonJS((exports2) => { "use strict"; Object.defineProperty(exports2, "__esModule", {value: true}); exports2.objectLiteral = exports2.typedArray = exports2.stringArray = exports2.array = exports2.func = exports2.error = exports2.number = exports2.string = exports2.boolean = void 0; function boolean(value) { return value === true || value === false; } exports2.boolean = boolean; function string(value) { return typeof value === "string" || value instanceof String; } exports2.string = string; function number(value) { return typeof value === "number" || value instanceof Number; } exports2.number = number; function error(value) { return value instanceof Error; } exports2.error = error; function func(value) { return typeof value === "function"; } exports2.func = func; function array(value) { return Array.isArray(value); } exports2.array = array; function stringArray(value) { return array(value) && value.every((elem) => string(elem)); } exports2.stringArray = stringArray; function typedArray(value, check) { return Array.isArray(value) && value.every(check); } exports2.typedArray = typedArray; function objectLiteral(value) { return value !== null && typeof value === "object"; } exports2.objectLiteral = objectLiteral; }); // node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js var require_protocol_implementation = __commonJS((exports2) => { "use strict"; Object.defineProperty(exports2, "__esModule", {value: true}); exports2.ImplementationRequest = void 0; var messages_1 = require_messages2(); var ImplementationRequest; (function(ImplementationRequest2) { ImplementationRequest2.method = "textDocument/implementation"; ImplementationRequest2.type = new messages_1.ProtocolRequestType(ImplementationRequest2.method); })(ImplementationRequest = exports2.ImplementationRequest || (exports2.ImplementationRequest = {})); }); // node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js var require_protocol_typeDefinition = __commonJS((exports2) => { "use strict"; Object.defineProperty(exports2, "__esModule", {value: true}); exports2.TypeDefinitionRequest = void 0; var messages_1 = require_messages2(); var TypeDefinitionRequest; (function(TypeDefinitionRequest2) { TypeDefinitionRequest2.method = "textDocument/typeDefinition"; TypeDefinitionRequest2.type = new messages_1.ProtocolRequestType(TypeDefinitionRequest2.method); })(TypeDefinitionRequest = exports2.TypeDefinitionRequest || (exports2.TypeDefinitionRequest = {})); }); // node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolders.js var require_protocol_workspaceFolders = __commonJS((exports2) => { "use strict"; Object.defineProperty(exports2, "__esModule", {value: true}); exports2.DidChangeWorkspaceFoldersNotification = exports2.WorkspaceFoldersRequest = void 0; var messages_1 = require_messages2(); var WorkspaceFoldersRequest; (function(WorkspaceFoldersRequest2) { WorkspaceFoldersRequest2.type = new messages_1.ProtocolRequestType0("workspace/workspaceFolders"); })(WorkspaceFoldersRequest = exports2.WorkspaceFoldersRequest || (exports2.WorkspaceFoldersRequest = {})); var DidChangeWorkspaceFoldersNotification; (function(DidChangeWorkspaceFoldersNotification2) { DidChangeWorkspaceFoldersNotification2.type = new messages_1.ProtocolNotificationType("workspace/didChangeWorkspaceFolders"); })(DidChangeWorkspaceFoldersNotification = exports2.DidChangeWorkspaceFoldersNotification || (exports2.DidChangeWorkspaceFoldersNotification = {})); }); // node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js var require_protocol_configuration = __commonJS((exports2) => { "use strict"; Object.defineProperty(exports2, "__esModule", {value: true}); exports2.ConfigurationRequest = void 0; var messages_1 = require_messages2(); var ConfigurationRequest; (function(ConfigurationRequest2) { ConfigurationRequest2.type = new messages_1.ProtocolRequestType("workspace/configuration"); })(ConfigurationRequest = exports2.ConfigurationRequest || (exports2.ConfigurationRequest = {})); }); // node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js var require_protocol_colorProvider = __commonJS((exports2) => { "use strict"; Object.defineProperty(exports2, "__esModule", {value: true}); exports2.ColorPresentationRequest = exports2.DocumentColorRequest = void 0; var messages_1 = require_messages2(); var DocumentColorRequest; (function(DocumentColorRequest2) { DocumentColorRequest2.method = "textDocument/documentColor"; DocumentColorRequest2.type = new messages_1.ProtocolRequestType(DocumentColorRequest2.method); })(DocumentColorRequest = exports2.DocumentColorRequest || (exports2.DocumentColorRequest = {})); var ColorPresentationRequest; (function(ColorPresentationRequest2) { ColorPresentationRequest2.type = new messages_1.ProtocolRequestType("textDocument/colorPresentation"); })(ColorPresentationRequest = exports2.ColorPresentationRequest || (exports2.ColorPresentationRequest = {})); }); // node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js var require_protocol_foldingRange = __commonJS((exports2) => { "use strict"; Object.defineProperty(exports2, "__esModule", {value: true}); exports2.FoldingRangeRequest = exports2.FoldingRangeKind = void 0; var messages_1 = require_messages2(); var FoldingRangeKind; (function(FoldingRangeKind2) { FoldingRangeKind2["Comment"] = "comment"; FoldingRangeKind2["Imports"] = "imports"; FoldingRangeKind2["Region"] = "region"; })(FoldingRangeKind = exports2.FoldingRangeKind || (exports2.FoldingRangeKind = {})); var FoldingRangeRequest; (function(FoldingRangeRequest2) { FoldingRangeRequest2.method = "textDocument/foldingRange"; FoldingRangeRequest2.type = new messages_1.ProtocolRequestType(FoldingRangeRequest2.method); })(FoldingRangeRequest = exports2.FoldingRangeRequest || (exports2.FoldingRangeRequest = {})); }); // node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js var require_protocol_declaration = __commonJS((exports2) => { "use strict"; Object.defineProperty(exports2, "__esModule", {value: true}); exports2.DeclarationRequest = void 0; var messages_1 = require_messages2(); var DeclarationRequest; (function(DeclarationRequest2) { DeclarationRequest2.method = "textDocument/declaration"; DeclarationRequest2.type = new messages_1.ProtocolRequestType(DeclarationRequest2.method); })(DeclarationRequest = exports2.DeclarationRequest || (exports2.DeclarationRequest = {})); }); // node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js var require_protocol_selectionRange = __commonJS((exports2) => { "use strict"; Object.defineProperty(exports2, "__esModule", {value: true}); exports2.SelectionRangeRequest = void 0; var messages_1 = require_messages2(); var SelectionRangeRequest; (function(SelectionRangeRequest2) { SelectionRangeRequest2.method = "textDocument/selectionRange"; SelectionRangeRequest2.type = new messages_1.ProtocolRequestType(SelectionRangeRequest2.method); })(SelectionRangeRequest = exports2.SelectionRangeRequest || (exports2.SelectionRangeRequest = {})); }); // node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js var require_protocol_progress = __commonJS((exports2) => { "use strict"; Object.defineProperty(exports2, "__esModule", {value: true}); exports2.WorkDoneProgressCancelNotification = exports2.WorkDoneProgressCreateRequest = exports2.WorkDoneProgress = void 0; var vscode_jsonrpc_1 = require_main(); var messages_1 = require_messages2(); var WorkDoneProgress; (function(WorkDoneProgress2) { WorkDoneProgress2.type = new vscode_jsonrpc_1.ProgressType(); function is(value) { return value === WorkDoneProgress2.type; } WorkDoneProgress2.is = is; })(WorkDoneProgress = exports2.WorkDoneProgress || (exports2.WorkDoneProgress = {})); var WorkDoneProgressCreateRequest; (function(WorkDoneProgressCreateRequest2) { WorkDoneProgressCreateRequest2.type = new messages_1.ProtocolRequestType("window/workDoneProgress/create"); })(WorkDoneProgressCreateRequest = exports2.WorkDoneProgressCreateRequest || (exports2.WorkDoneProgressCreateRequest = {})); var WorkDoneProgressCancelNotification; (function(WorkDoneProgressCancelNotification2) { WorkDoneProgressCancelNotification2.type = new messages_1.ProtocolNotificationType("window/workDoneProgress/cancel"); })(WorkDoneProgressCancelNotification = exports2.WorkDoneProgressCancelNotification || (exports2.WorkDoneProgressCancelNotification = {})); }); // node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js var require_protocol_callHierarchy = __commonJS((exports2) => { "use strict"; Object.defineProperty(exports2, "__esModule", {value: true}); exports2.CallHierarchyOutgoingCallsRequest = exports2.CallHierarchyIncomingCallsRequest = exports2.CallHierarchyPrepareRequest = void 0; var messages_1 = require_messages2(); var CallHierarchyPrepareRequest; (function(CallHierarchyPrepareRequest2) { CallHierarchyPrepareRequest2.method = "textDocument/prepareCallHierarchy"; CallHierarchyPrepareRequest2.type = new messages_1.ProtocolRequestType(CallHierarchyPrepareRequest2.method); })(CallHierarchyPrepareRequest = exports2.CallHierarchyPrepareRequest || (exports2.CallHierarchyPrepareRequest = {})); var CallHierarchyIncomingCallsRequest; (function(CallHierarchyIncomingCallsRequest2) { CallHierarchyIncomingCallsRequest2.method = "callHierarchy/incomingCalls"; CallHierarchyIncomingCallsRequest2.type = new messages_1.ProtocolRequestType(CallHierarchyIncomingCallsRequest2.method); })(CallHierarchyIncomingCallsRequest = exports2.CallHierarchyIncomingCallsRequest || (exports2.CallHierarchyIncomingCallsRequest = {})); var CallHierarchyOutgoingCallsRequest; (function(CallHierarchyOutgoingCallsRequest2) { CallHierarchyOutgoingCallsRequest2.method = "callHierarchy/outgoingCalls"; CallHierarchyOutgoingCallsRequest2.type = new messages_1.ProtocolRequestType(CallHierarchyOutgoingCallsRequest2.method); })(CallHierarchyOutgoingCallsRequest = exports2.CallHierarchyOutgoingCallsRequest || (exports2.CallHierarchyOutgoingCallsRequest = {})); }); // node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js var require_protocol_semanticTokens = __commonJS((exports2) => { "use strict"; Object.defineProperty(exports2, "__esModule", {value: true}); exports2.SemanticTokensRefreshRequest = exports2.SemanticTokensRangeRequest = exports2.SemanticTokensDeltaRequest = exports2.SemanticTokensRequest = exports2.SemanticTokensRegistrationType = exports2.TokenFormat = exports2.SemanticTokens = exports2.SemanticTokenModifiers = exports2.SemanticTokenTypes = void 0; var messages_1 = require_messages2(); var SemanticTokenTypes; (function(SemanticTokenTypes2) { SemanticTokenTypes2["namespace"] = "namespace"; SemanticTokenTypes2["type"] = "type"; SemanticTokenTypes2["class"] = "class"; SemanticTokenTypes2["enum"] = "enum"; SemanticTokenTypes2["interface"] = "interface"; SemanticTokenTypes2["struct"] = "struct"; SemanticTokenTypes2["typeParameter"] = "typeParameter"; SemanticTokenTypes2["parameter"] = "parameter"; SemanticTokenTypes2["variable"] = "variable"; SemanticTokenTypes2["property"] = "property"; SemanticTokenTypes2["enumMember"] = "enumMember"; SemanticTokenTypes2["event"] = "event"; SemanticTokenTypes2["function"] = "function"; SemanticTokenTypes2["method"] = "method"; SemanticTokenTypes2["macro"] = "macro"; SemanticTokenTypes2["keyword"] = "keyword"; SemanticTokenTypes2["modifier"] = "modifier"; SemanticTokenTypes2["comment"] = "comment"; SemanticTokenTypes2["string"] = "string"; SemanticTokenTypes2["number"] = "number"; SemanticTokenTypes2["regexp"] = "regexp"; SemanticTokenTypes2["operator"] = "operator"; })(SemanticTokenTypes = exports2.SemanticTokenTypes || (exports2.SemanticTokenTypes = {})); var SemanticTokenModifiers; (function(SemanticTokenModifiers2) { SemanticTokenModifiers2["declaration"] = "declaration"; SemanticTokenModifiers2["definition"] = "definition"; SemanticTokenModifiers2["readonly"] = "readonly"; SemanticTokenModifiers2["static"] = "static"; SemanticTokenModifiers2["deprecated"] = "deprecated"; SemanticTokenModifiers2["abstract"] = "abstract"; SemanticTokenModifiers2["async"] = "async"; SemanticTokenModifiers2["modification"] = "modification"; SemanticTokenModifiers2["documentation"] = "documentation"; SemanticTokenModifiers2["defaultLibrary"] = "defaultLibrary"; })(SemanticTokenModifiers = exports2.SemanticTokenModifiers || (exports2.SemanticTokenModifiers = {})); var SemanticTokens; (function(SemanticTokens2) { function is(value) { const candidate = value; return candidate !== void 0 && (candidate.resultId === void 0 || typeof candidate.resultId === "string") && Array.isArray(candidate.data) && (candidate.data.length === 0 || typeof candidate.data[0] === "number"); } SemanticTokens2.is = is; })(SemanticTokens = exports2.SemanticTokens || (exports2.SemanticTokens = {})); var TokenFormat; (function(TokenFormat2) { TokenFormat2.Relative = "relative"; })(TokenFormat = exports2.TokenFormat || (exports2.TokenFormat = {})); var SemanticTokensRegistrationType; (function(SemanticTokensRegistrationType2) { SemanticTokensRegistrationType2.method = "textDocument/semanticTokens"; SemanticTokensRegistrationType2.type = new messages_1.RegistrationType(SemanticTokensRegistrationType2.method); })(SemanticTokensRegistrationType = exports2.SemanticTokensRegistrationType || (exports2.SemanticTokensRegistrationType = {})); var SemanticTokensRequest; (function(SemanticTokensRequest2) { SemanticTokensRequest2.method = "textDocument/semanticTokens/full"; SemanticTokensRequest2.type = new messages_1.ProtocolRequestType(SemanticTokensRequest2.method); })(SemanticTokensRequest = exports2.SemanticTokensRequest || (exports2.SemanticTokensRequest = {})); var SemanticTokensDeltaRequest; (function(SemanticTokensDeltaRequest2) { SemanticTokensDeltaRequest2.method = "textDocument/semanticTokens/full/delta"; SemanticTokensDeltaRequest2.type = new messages_1.ProtocolRequestType(SemanticTokensDeltaRequest2.method); })(SemanticTokensDeltaRequest = exports2.SemanticTokensDeltaRequest || (exports2.SemanticTokensDeltaRequest = {})); var SemanticTokensRangeRequest; (function(SemanticTokensRangeRequest2) { SemanticTokensRangeRequest2.method = "textDocument/semanticTokens/range"; SemanticTokensRangeRequest2.type = new messages_1.ProtocolRequestType(SemanticTokensRangeRequest2.method); })(SemanticTokensRangeRequest = exports2.SemanticTokensRangeRequest || (exports2.SemanticTokensRangeRequest = {})); var SemanticTokensRefreshRequest; (function(SemanticTokensRefreshRequest2) { SemanticTokensRefreshRequest2.method = `workspace/semanticTokens/refresh`; SemanticTokensRefreshRequest2.type = new messages_1.ProtocolRequestType0(SemanticTokensRefreshRequest2.method); })(SemanticTokensRefreshRequest = exports2.SemanticTokensRefreshRequest || (exports2.SemanticTokensRefreshRequest = {})); }); // node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js var require_protocol_showDocument = __commonJS((exports2) => { "use strict"; Object.defineProperty(exports2, "__esModule", {value: true}); exports2.ShowDocumentRequest = void 0; var messages_1 = require_messages2(); var ShowDocumentRequest; (function(ShowDocumentRequest2) { ShowDocumentRequest2.method = "window/showDocument"; ShowDocumentRequest2.type = new messages_1.ProtocolRequestType(ShowDocumentRequest2.method); })(ShowDocumentRequest = exports2.ShowDocumentRequest || (exports2.ShowDocumentRequest = {})); }); // node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js var require_protocol_linkedEditingRange = __commonJS((exports2) => { "use strict"; Object.defineProperty(exports2, "__esModule", {value: true}); exports2.LinkedEditingRangeRequest = void 0; var messages_1 = require_messages2(); var LinkedEditingRangeRequest; (function(LinkedEditingRangeRequest2) { LinkedEditingRangeRequest2.method = "textDocument/linkedEditingRange"; LinkedEditingRangeRequest2.type = new messages_1.ProtocolRequestType(LinkedEditingRangeRequest2.method); })(LinkedEditingRangeRequest = exports2.LinkedEditingRangeRequest || (exports2.LinkedEditingRangeRequest = {})); }); // node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js var require_protocol_fileOperations = __commonJS((exports2) => { "use strict"; Object.defineProperty(exports2, "__esModule", {value: true}); exports2.WillDeleteFilesRequest = exports2.DidDeleteFilesNotification = exports2.DidRenameFilesNotification = exports2.WillRenameFilesRequest = exports2.DidCreateFilesNotification = exports2.WillCreateFilesRequest = exports2.FileOperationPatternKind = void 0; var messages_1 = require_messages2(); var FileOperationPatternKind; (function(FileOperationPatternKind2) { FileOperationPatternKind2.file = "file"; FileOperationPatternKind2.folder = "folder"; })(FileOperationPatternKind = exports2.FileOperationPatternKind || (exports2.FileOperationPatternKind = {})); var WillCreateFilesRequest; (function(WillCreateFilesRequest2) { WillCreateFilesRequest2.method = "workspace/willCreateFiles"; WillCreateFilesRequest2.type = new messages_1.ProtocolRequestType(WillCreateFilesRequest2.method); })(WillCreateFilesRequest = exports2.WillCreateFilesRequest || (exports2.WillCreateFilesRequest = {})); var DidCreateFilesNotification; (function(DidCreateFilesNotification2) { DidCreateFilesNotification2.method = "workspace/didCreateFiles"; DidCreateFilesNotification2.type = new messages_1.ProtocolNotificationType(DidCreateFilesNotification2.method); })(DidCreateFilesNotification = exports2.DidCreateFilesNotification || (exports2.DidCreateFilesNotification = {})); var WillRenameFilesRequest; (function(WillRenameFilesRequest2) { WillRenameFilesRequest2.method = "workspace/willRenameFiles"; WillRenameFilesRequest2.type = new messages_1.ProtocolRequestType(WillRenameFilesRequest2.method); })(WillRenameFilesRequest = exports2.WillRenameFilesRequest || (exports2.WillRenameFilesRequest = {})); var DidRenameFilesNotification; (function(DidRenameFilesNotification2) { DidRenameFilesNotification2.method = "workspace/didRenameFiles"; DidRenameFilesNotification2.type = new messages_1.ProtocolNotificationType(DidRenameFilesNotification2.method); })(DidRenameFilesNotification = exports2.DidRenameFilesNotification || (exports2.DidRenameFilesNotification = {})); var DidDeleteFilesNotification; (function(DidDeleteFilesNotification2) { DidDeleteFilesNotification2.method = "workspace/didDeleteFiles"; DidDeleteFilesNotification2.type = new messages_1.ProtocolNotificationType(DidDeleteFilesNotification2.method); })(DidDeleteFilesNotification = exports2.DidDeleteFilesNotification || (exports2.DidDeleteFilesNotification = {})); var WillDeleteFilesRequest; (function(WillDeleteFilesRequest2) { WillDeleteFilesRequest2.method = "workspace/willDeleteFiles"; WillDeleteFilesRequest2.type = new messages_1.ProtocolRequestType(WillDeleteFilesRequest2.method); })(WillDeleteFilesRequest = exports2.WillDeleteFilesRequest || (exports2.WillDeleteFilesRequest = {})); }); // node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js var require_protocol_moniker = __commonJS((exports2) => { "use strict"; Object.defineProperty(exports2, "__esModule", {value: true}); exports2.MonikerRequest = exports2.MonikerKind = exports2.UniquenessLevel = void 0; var messages_1 = require_messages2(); var UniquenessLevel; (function(UniquenessLevel2) { UniquenessLevel2["document"] = "document"; UniquenessLevel2["project"] = "project"; UniquenessLevel2["group"] = "group"; UniquenessLevel2["scheme"] = "scheme"; UniquenessLevel2["global"] = "global"; })(UniquenessLevel = exports2.UniquenessLevel || (exports2.UniquenessLevel = {})); var MonikerKind; (function(MonikerKind2) { MonikerKind2["import"] = "import"; MonikerKind2["export"] = "export"; MonikerKind2["local"] = "local"; })(MonikerKind = exports2.MonikerKind || (exports2.MonikerKind = {})); var MonikerRequest; (function(MonikerRequest2) { MonikerRequest2.method = "textDocument/moniker"; MonikerRequest2.type = new messages_1.ProtocolRequestType(MonikerRequest2.method); })(MonikerRequest = exports2.MonikerRequest || (exports2.MonikerRequest = {})); }); // node_modules/vscode-languageserver-protocol/lib/common/protocol.js var require_protocol = __commonJS((exports2) => { "use strict"; Object.defineProperty(exports2, "__esModule", {value: true}); exports2.DocumentLinkRequest = exports2.CodeLensRefreshRequest = exports2.CodeLensResolveRequest = exports2.CodeLensRequest = exports2.WorkspaceSymbolRequest = exports2.CodeActionResolveRequest = exports2.CodeActionRequest = exports2.DocumentSymbolRequest = exports2.DocumentHighlightRequest = exports2.ReferencesRequest = exports2.DefinitionRequest = exports2.SignatureHelpRequest = exports2.SignatureHelpTriggerKind = exports2.HoverRequest = exports2.CompletionResolveRequest = exports2.CompletionRequest = exports2.CompletionTriggerKind = exports2.PublishDiagnosticsNotification = exports2.WatchKind = exports2.FileChangeType = exports2.DidChangeWatchedFilesNotification = exports2.WillSaveTextDocumentWaitUntilRequest = exports2.WillSaveTextDocumentNotification = exports2.TextDocumentSaveReason = exports2.DidSaveTextDocumentNotification = exports2.DidCloseTextDocumentNotification = exports2.DidChangeTextDocumentNotification = exports2.TextDocumentContentChangeEvent = exports2.DidOpenTextDocumentNotification = exports2.TextDocumentSyncKind = exports2.TelemetryEventNotification = exports2.LogMessageNotification = exports2.ShowMessageRequest = exports2.ShowMessageNotification = exports2.MessageType = exports2.DidChangeConfigurationNotification = exports2.ExitNotification = exports2.ShutdownRequest = exports2.InitializedNotification = exports2.InitializeError = exports2.InitializeRequest = exports2.WorkDoneProgressOptions = exports2.TextDocumentRegistrationOptions = exports2.StaticRegistrationOptions = exports2.FailureHandlingKind = exports2.ResourceOperationKind = exports2.UnregistrationRequest = exports2.RegistrationRequest = exports2.DocumentSelector = exports2.DocumentFilter = void 0; exports2.MonikerRequest = exports2.MonikerKind = exports2.UniquenessLevel = exports2.WillDeleteFilesRequest = exports2.DidDeleteFilesNotification = exports2.WillRenameFilesRequest = exports2.DidRenameFilesNotification = exports2.WillCreateFilesRequest = exports2.DidCreateFilesNotification = exports2.FileOperationPatternKind = exports2.LinkedEditingRangeRequest = exports2.ShowDocumentRequest = exports2.SemanticTokensRegistrationType = exports2.SemanticTokensRefreshRequest = exports2.SemanticTokensRangeRequest = exports2.SemanticTokensDeltaRequest = exports2.SemanticTokensRequest = exports2.TokenFormat = exports2.SemanticTokens = exports2.SemanticTokenModifiers = exports2.SemanticTokenTypes = exports2.CallHierarchyPrepareRequest = exports2.CallHierarchyOutgoingCallsRequest = exports2.CallHierarchyIncomingCallsRequest = exports2.WorkDoneProgressCancelNotification = exports2.WorkDoneProgressCreateRequest = exports2.WorkDoneProgress = exports2.SelectionRangeRequest = exports2.DeclarationRequest = exports2.FoldingRangeRequest = exports2.ColorPresentationRequest = exports2.DocumentColorRequest = exports2.ConfigurationRequest = exports2.DidChangeWorkspaceFoldersNotification = exports2.WorkspaceFoldersRequest = exports2.TypeDefinitionRequest = exports2.ImplementationRequest = exports2.ApplyWorkspaceEditRequest = exports2.ExecuteCommandRequest = exports2.PrepareRenameRequest = exports2.RenameRequest = exports2.PrepareSupportDefaultBehavior = exports2.DocumentOnTypeFormattingRequest = exports2.DocumentRangeFormattingRequest = exports2.DocumentFormattingRequest = exports2.DocumentLinkResolveRequest = void 0; var Is = require_is2(); var messages_1 = require_messages2(); var protocol_implementation_1 = require_protocol_implementation(); Object.defineProperty(exports2, "ImplementationRequest", {enumerable: true, get: function() { return protocol_implementation_1.ImplementationRequest; }}); var protocol_typeDefinition_1 = require_protocol_typeDefinition(); Object.defineProperty(exports2, "TypeDefinitionRequest", {enumerable: true, get: function() { return protocol_typeDefinition_1.TypeDefinitionRequest; }}); var protocol_workspaceFolders_1 = require_protocol_workspaceFolders(); Object.defineProperty(exports2, "WorkspaceFoldersRequest", {enumerable: true, get: function() { return protocol_workspaceFolders_1.WorkspaceFoldersRequest; }}); Object.defineProperty(exports2, "DidChangeWorkspaceFoldersNotification", {enumerable: true, get: function() { return protocol_workspaceFolders_1.DidChangeWorkspaceFoldersNotification; }}); var protocol_configuration_1 = require_protocol_configuration(); Object.defineProperty(exports2, "ConfigurationRequest", {enumerable: true, get: function() { return protocol_configuration_1.ConfigurationRequest; }}); var protocol_colorProvider_1 = require_protocol_colorProvider(); Object.defineProperty(exports2, "DocumentColorRequest", {enumerable: true, get: function() { return protocol_colorProvider_1.DocumentColorRequest; }}); Object.defineProperty(exports2, "ColorPresentationRequest", {enumerable: true, get: function() { return protocol_colorProvider_1.ColorPresentationRequest; }}); var protocol_foldingRange_1 = require_protocol_foldingRange(); Object.defineProperty(exports2, "FoldingRangeRequest", {enumerable: true, get: function() { return protocol_foldingRange_1.FoldingRangeRequest; }}); var protocol_declaration_1 = require_protocol_declaration(); Object.defineProperty(exports2, "DeclarationRequest", {enumerable: true, get: function() { return protocol_declaration_1.DeclarationRequest; }}); var protocol_selectionRange_1 = require_protocol_selectionRange(); Object.defineProperty(exports2, "SelectionRangeRequest", {enumerable: true, get: function() { return protocol_selectionRange_1.SelectionRangeRequest; }}); var protocol_progress_1 = require_protocol_progress(); Object.defineProperty(exports2, "WorkDoneProgress", {enumerable: true, get: function() { return protocol_progress_1.WorkDoneProgress; }}); Object.defineProperty(exports2, "WorkDoneProgressCreateRequest", {enumerable: true, get: function() { return protocol_progress_1.WorkDoneProgressCreateRequest; }}); Object.defineProperty(exports2, "WorkDoneProgressCancelNotification", {enumerable: true, get: function() { return protocol_progress_1.WorkDoneProgressCancelNotification; }}); var protocol_callHierarchy_1 = require_protocol_callHierarchy(); Object.defineProperty(exports2, "CallHierarchyIncomingCallsRequest", {enumerable: true, get: function() { return protocol_callHierarchy_1.CallHierarchyIncomingCallsRequest; }}); Object.defineProperty(exports2, "CallHierarchyOutgoingCallsRequest", {enumerable: true, get: function() { return protocol_callHierarchy_1.CallHierarchyOutgoingCallsRequest; }}); Object.defineProperty(exports2, "CallHierarchyPrepareRequest", {enumerable: true, get: function() { return protocol_callHierarchy_1.CallHierarchyPrepareRequest; }}); var protocol_semanticTokens_1 = require_protocol_semanticTokens(); Object.defineProperty(exports2, "SemanticTokenTypes", {enumerable: true, get: function() { return protocol_semanticTokens_1.SemanticTokenTypes; }}); Object.defineProperty(exports2, "SemanticTokenModifiers", {enumerable: true, get: function() { return protocol_semanticTokens_1.SemanticTokenModifiers; }}); Object.defineProperty(exports2, "SemanticTokens", {enumerable: true, get: function() { return protocol_semanticTokens_1.SemanticTokens; }}); Object.defineProperty(exports2, "TokenFormat", {enumerable: true, get: function() { return protocol_semanticTokens_1.TokenFormat; }}); Object.defineProperty(exports2, "SemanticTokensRequest", {enumerable: true, get: function() { return protocol_semanticTokens_1.SemanticTokensRequest; }}); Object.defineProperty(exports2, "SemanticTokensDeltaRequest", {enumerable: true, get: function() { return protocol_semanticTokens_1.SemanticTokensDeltaRequest; }}); Object.defineProperty(exports2, "SemanticTokensRangeRequest", {enumerable: true, get: function() { return protocol_semanticTokens_1.SemanticTokensRangeRequest; }}); Object.defineProperty(exports2, "SemanticTokensRefreshRequest", {enumerable: true, get: function() { return protocol_semanticTokens_1.SemanticTokensRefreshRequest; }}); Object.defineProperty(exports2, "SemanticTokensRegistrationType", {enumerable: true, get: function() { return protocol_semanticTokens_1.SemanticTokensRegistrationType; }}); var protocol_showDocument_1 = require_protocol_showDocument(); Object.defineProperty(exports2, "ShowDocumentRequest", {enumerable: true, get: function() { return protocol_showDocument_1.ShowDocumentRequest; }}); var protocol_linkedEditingRange_1 = require_protocol_linkedEditingRange(); Object.defineProperty(exports2, "LinkedEditingRangeRequest", {enumerable: true, get: function() { return protocol_linkedEditingRange_1.LinkedEditingRangeRequest; }}); var protocol_fileOperations_1 = require_protocol_fileOperations(); Object.defineProperty(exports2, "FileOperationPatternKind", {enumerable: true, get: function() { return protocol_fileOperations_1.FileOperationPatternKind; }}); Object.defineProperty(exports2, "DidCreateFilesNotification", {enumerable: true, get: function() { return protocol_fileOperations_1.DidCreateFilesNotification; }}); Object.defineProperty(exports2, "WillCreateFilesRequest", {enumerable: true, get: function() { return protocol_fileOperations_1.WillCreateFilesRequest; }}); Object.defineProperty(exports2, "DidRenameFilesNotification", {enumerable: true, get: function() { return protocol_fileOperations_1.DidRenameFilesNotification; }}); Object.defineProperty(exports2, "WillRenameFilesRequest", {enumerable: true, get: function() { return protocol_fileOperations_1.WillRenameFilesRequest; }}); Object.defineProperty(exports2, "DidDeleteFilesNotification", {enumerable: true, get: function() { return protocol_fileOperations_1.DidDeleteFilesNotification; }}); Object.defineProperty(exports2, "WillDeleteFilesRequest", {enumerable: true, get: function() { return protocol_fileOperations_1.WillDeleteFilesRequest; }}); var protocol_moniker_1 = require_protocol_moniker(); Object.defineProperty(exports2, "UniquenessLevel", {enumerable: true, get: function() { return protocol_moniker_1.UniquenessLevel; }}); Object.defineProperty(exports2, "MonikerKind", {enumerable: true, get: function() { return protocol_moniker_1.MonikerKind; }}); Object.defineProperty(exports2, "MonikerRequest", {enumerable: true, get: function() { return protocol_moniker_1.MonikerRequest; }}); var DocumentFilter; (function(DocumentFilter2) { function is(value) { const candidate = value; return Is.string(candidate.language) || Is.string(candidate.scheme) || Is.string(candidate.pattern); } DocumentFilter2.is = is; })(DocumentFilter = exports2.DocumentFilter || (exports2.DocumentFilter = {})); var DocumentSelector; (function(DocumentSelector2) { function is(value) { if (!Array.isArray(value)) { return false; } for (let elem of value) { if (!Is.string(elem) && !DocumentFilter.is(elem)) { return false; } } return true; } DocumentSelector2.is = is; })(DocumentSelector = exports2.DocumentSelector || (exports2.DocumentSelector = {})); var RegistrationRequest; (function(RegistrationRequest2) { RegistrationRequest2.type = new messages_1.ProtocolRequestType("client/registerCapability"); })(RegistrationRequest = exports2.RegistrationRequest || (exports2.RegistrationRequest = {})); var UnregistrationRequest; (function(UnregistrationRequest2) { UnregistrationRequest2.type = new messages_1.ProtocolRequestType("client/unregisterCapability"); })(UnregistrationRequest = exports2.UnregistrationRequest || (exports2.UnregistrationRequest = {})); var ResourceOperationKind; (function(ResourceOperationKind2) { ResourceOperationKind2.Create = "create"; ResourceOperationKind2.Rename = "rename"; ResourceOperationKind2.Delete = "delete"; })(ResourceOperationKind = exports2.ResourceOperationKind || (exports2.ResourceOperationKind = {})); var FailureHandlingKind; (function(FailureHandlingKind2) { FailureHandlingKind2.Abort = "abort"; FailureHandlingKind2.Transactional = "transactional"; FailureHandlingKind2.TextOnlyTransactional = "textOnlyTransactional"; FailureHandlingKind2.Undo = "undo"; })(FailureHandlingKind = exports2.FailureHandlingKind || (exports2.FailureHandlingKind = {})); var StaticRegistrationOptions; (function(StaticRegistrationOptions2) { function hasId(value) { const candidate = value; return candidate && Is.string(candidate.id) && candidate.id.length > 0; } StaticRegistrationOptions2.hasId = hasId; })(StaticRegistrationOptions = exports2.StaticRegistrationOptions || (exports2.StaticRegistrationOptions = {})); var TextDocumentRegistrationOptions; (function(TextDocumentRegistrationOptions2) { function is(value) { const candidate = value; return candidate && (candidate.documentSelector === null || DocumentSelector.is(candidate.documentSelector)); } TextDocumentRegistrationOptions2.is = is; })(TextDocumentRegistrationOptions = exports2.TextDocumentRegistrationOptions || (exports2.TextDocumentRegistrationOptions = {})); var WorkDoneProgressOptions; (function(WorkDoneProgressOptions2) { function is(value) { const candidate = value; return Is.objectLiteral(candidate) && (candidate.workDoneProgress === void 0 || Is.boolean(candidate.workDoneProgress)); } WorkDoneProgressOptions2.is = is; function hasWorkDoneProgress(value) { const candidate = value; return candidate && Is.boolean(candidate.workDoneProgress); } WorkDoneProgressOptions2.hasWorkDoneProgress = hasWorkDoneProgress; })(WorkDoneProgressOptions = exports2.WorkDoneProgressOptions || (exports2.WorkDoneProgressOptions = {})); var InitializeRequest; (function(InitializeRequest2) { InitializeRequest2.type = new messages_1.ProtocolRequestType("initialize"); })(InitializeRequest = exports2.InitializeRequest || (exports2.InitializeRequest = {})); var InitializeError; (function(InitializeError2) { InitializeError2.unknownProtocolVersion = 1; })(InitializeError = exports2.InitializeError || (exports2.InitializeError = {})); var InitializedNotification; (function(InitializedNotification2) { InitializedNotification2.type = new messages_1.ProtocolNotificationType("initialized"); })(InitializedNotification = exports2.InitializedNotification || (exports2.InitializedNotification = {})); var ShutdownRequest; (function(ShutdownRequest2) { ShutdownRequest2.type = new messages_1.ProtocolRequestType0("shutdown"); })(ShutdownRequest = exports2.ShutdownRequest || (exports2.ShutdownRequest = {})); var ExitNotification; (function(ExitNotification2) { ExitNotification2.type = new messages_1.ProtocolNotificationType0("exit"); })(ExitNotification = exports2.ExitNotification || (exports2.ExitNotification = {})); var DidChangeConfigurationNotification; (function(DidChangeConfigurationNotification2) { DidChangeConfigurationNotification2.type = new messages_1.ProtocolNotificationType("workspace/didChangeConfiguration"); })(DidChangeConfigurationNotification = exports2.DidChangeConfigurationNotification || (exports2.DidChangeConfigurationNotification = {})); var MessageType; (function(MessageType2) { MessageType2.Error = 1; MessageType2.Warning = 2; MessageType2.Info = 3; MessageType2.Log = 4; })(MessageType = exports2.MessageType || (exports2.MessageType = {})); var ShowMessageNotification; (function(ShowMessageNotification2) { ShowMessageNotification2.type = new messages_1.ProtocolNotificationType("window/showMessage"); })(ShowMessageNotification = exports2.ShowMessageNotification || (exports2.ShowMessageNotification = {})); var ShowMessageRequest; (function(ShowMessageRequest2) { ShowMessageRequest2.type = new messages_1.ProtocolRequestType("window/showMessageRequest"); })(ShowMessageRequest = exports2.ShowMessageRequest || (exports2.ShowMessageRequest = {})); var LogMessageNotification; (function(LogMessageNotification2) { LogMessageNotification2.type = new messages_1.ProtocolNotificationType("window/logMessage"); })(LogMessageNotification = exports2.LogMessageNotification || (exports2.LogMessageNotification = {})); var TelemetryEventNotification; (function(TelemetryEventNotification2) { TelemetryEventNotification2.type = new messages_1.ProtocolNotificationType("telemetry/event"); })(TelemetryEventNotification = exports2.TelemetryEventNotification || (exports2.TelemetryEventNotification = {})); var TextDocumentSyncKind; (function(TextDocumentSyncKind2) { TextDocumentSyncKind2.None = 0; TextDocumentSyncKind2.Full = 1; TextDocumentSyncKind2.Incremental = 2; })(TextDocumentSyncKind = exports2.TextDocumentSyncKind || (exports2.TextDocumentSyncKind = {})); var DidOpenTextDocumentNotification; (function(DidOpenTextDocumentNotification2) { DidOpenTextDocumentNotification2.method = "textDocument/didOpen"; DidOpenTextDocumentNotification2.type = new messages_1.ProtocolNotificationType(DidOpenTextDocumentNotification2.method); })(DidOpenTextDocumentNotification = exports2.DidOpenTextDocumentNotification || (exports2.DidOpenTextDocumentNotification = {})); var TextDocumentContentChangeEvent; (function(TextDocumentContentChangeEvent2) { function isIncremental(event) { let candidate = event; return candidate !== void 0 && candidate !== null && typeof candidate.text === "string" && candidate.range !== void 0 && (candidate.rangeLength === void 0 || typeof candidate.rangeLength === "number"); } TextDocumentContentChangeEvent2.isIncremental = isIncremental; function isFull(event) { let candidate = event; return candidate !== void 0 && candidate !== null && typeof candidate.text === "string" && candidate.range === void 0 && candidate.rangeLength === void 0; } TextDocumentContentChangeEvent2.isFull = isFull; })(TextDocumentContentChangeEvent = exports2.TextDocumentContentChangeEvent || (exports2.TextDocumentContentChangeEvent = {})); var DidChangeTextDocumentNotification; (function(DidChangeTextDocumentNotification2) { DidChangeTextDocumentNotification2.method = "textDocument/didChange"; DidChangeTextDocumentNotification2.type = new messages_1.ProtocolNotificationType(DidChangeTextDocumentNotification2.method); })(DidChangeTextDocumentNotification = exports2.DidChangeTextDocumentNotification || (exports2.DidChangeTextDocumentNotification = {})); var DidCloseTextDocumentNotification; (function(DidCloseTextDocumentNotification2) { DidCloseTextDocumentNotification2.method = "textDocument/didClose"; DidCloseTextDocumentNotification2.type = new messages_1.ProtocolNotificationType(DidCloseTextDocumentNotification2.method); })(DidCloseTextDocumentNotification = exports2.DidCloseTextDocumentNotification || (exports2.DidCloseTextDocumentNotification = {})); var DidSaveTextDocumentNotification; (function(DidSaveTextDocumentNotification2) { DidSaveTextDocumentNotification2.method = "textDocument/didSave"; DidSaveTextDocumentNotification2.type = new messages_1.ProtocolNotificationType(DidSaveTextDocumentNotification2.method); })(DidSaveTextDocumentNotification = exports2.DidSaveTextDocumentNotification || (exports2.DidSaveTextDocumentNotification = {})); var TextDocumentSaveReason; (function(TextDocumentSaveReason2) { TextDocumentSaveReason2.Manual = 1; TextDocumentSaveReason2.AfterDelay = 2; TextDocumentSaveReason2.FocusOut = 3; })(TextDocumentSaveReason = exports2.TextDocumentSaveReason || (exports2.TextDocumentSaveReason = {})); var WillSaveTextDocumentNotification; (function(WillSaveTextDocumentNotification2) { WillSaveTextDocumentNotification2.method = "textDocument/willSave"; WillSaveTextDocumentNotification2.type = new messages_1.ProtocolNotificationType(WillSaveTextDocumentNotification2.method); })(WillSaveTextDocumentNotification = exports2.WillSaveTextDocumentNotification || (exports2.WillSaveTextDocumentNotification = {})); var WillSaveTextDocumentWaitUntilRequest; (function(WillSaveTextDocumentWaitUntilRequest2) { WillSaveTextDocumentWaitUntilRequest2.method = "textDocument/willSaveWaitUntil"; WillSaveTextDocumentWaitUntilRequest2.type = new messages_1.ProtocolRequestType(WillSaveTextDocumentWaitUntilRequest2.method); })(WillSaveTextDocumentWaitUntilRequest = exports2.WillSaveTextDocumentWaitUntilRequest || (exports2.WillSaveTextDocumentWaitUntilRequest = {})); var DidChangeWatchedFilesNotification; (function(DidChangeWatchedFilesNotification2) { DidChangeWatchedFilesNotification2.type = new messages_1.ProtocolNotificationType("workspace/didChangeWatchedFiles"); })(DidChangeWatchedFilesNotification = exports2.DidChangeWatchedFilesNotification || (exports2.DidChangeWatchedFilesNotification = {})); var FileChangeType; (function(FileChangeType2) { FileChangeType2.Created = 1; FileChangeType2.Changed = 2; FileChangeType2.Deleted = 3; })(FileChangeType = exports2.FileChangeType || (exports2.FileChangeType = {})); var WatchKind; (function(WatchKind2) { WatchKind2.Create = 1; WatchKind2.Change = 2; WatchKind2.Delete = 4; })(WatchKind = exports2.WatchKind || (exports2.WatchKind = {})); var PublishDiagnosticsNotification; (function(PublishDiagnosticsNotification2) { PublishDiagnosticsNotification2.type = new messages_1.ProtocolNotificationType("textDocument/publishDiagnostics"); })(PublishDiagnosticsNotification = exports2.PublishDiagnosticsNotification || (exports2.PublishDiagnosticsNotification = {})); var CompletionTriggerKind; (function(CompletionTriggerKind2) { CompletionTriggerKind2.Invoked = 1; CompletionTriggerKind2.TriggerCharacter = 2; CompletionTriggerKind2.TriggerForIncompleteCompletions = 3; })(CompletionTriggerKind = exports2.CompletionTriggerKind || (exports2.CompletionTriggerKind = {})); var CompletionRequest; (function(CompletionRequest2) { CompletionRequest2.method = "textDocument/completion"; CompletionRequest2.type = new messages_1.ProtocolRequestType(CompletionRequest2.method); })(CompletionRequest = exports2.CompletionRequest || (exports2.CompletionRequest = {})); var CompletionResolveRequest; (function(CompletionResolveRequest2) { CompletionResolveRequest2.method = "completionItem/resolve"; CompletionResolveRequest2.type = new messages_1.ProtocolRequestType(CompletionResolveRequest2.method); })(CompletionResolveRequest = exports2.CompletionResolveRequest || (exports2.CompletionResolveRequest = {})); var HoverRequest; (function(HoverRequest2) { HoverRequest2.method = "textDocument/hover"; HoverRequest2.type = new messages_1.ProtocolRequestType(HoverRequest2.method); })(HoverRequest = exports2.HoverRequest || (exports2.HoverRequest = {})); var SignatureHelpTriggerKind; (function(SignatureHelpTriggerKind2) { SignatureHelpTriggerKind2.Invoked = 1; SignatureHelpTriggerKind2.TriggerCharacter = 2; SignatureHelpTriggerKind2.ContentChange = 3; })(SignatureHelpTriggerKind = exports2.SignatureHelpTriggerKind || (exports2.SignatureHelpTriggerKind = {})); var SignatureHelpRequest; (function(SignatureHelpRequest2) { SignatureHelpRequest2.method = "textDocument/signatureHelp"; SignatureHelpRequest2.type = new messages_1.ProtocolRequestType(SignatureHelpRequest2.method); })(SignatureHelpRequest = exports2.SignatureHelpRequest || (exports2.SignatureHelpRequest = {})); var DefinitionRequest; (function(DefinitionRequest2) { DefinitionRequest2.method = "textDocument/definition"; DefinitionRequest2.type = new messages_1.ProtocolRequestType(DefinitionRequest2.method); })(DefinitionRequest = exports2.DefinitionRequest || (exports2.DefinitionRequest = {})); var ReferencesRequest; (function(ReferencesRequest2) { ReferencesRequest2.method = "textDocument/references"; ReferencesRequest2.type = new messages_1.ProtocolRequestType(ReferencesRequest2.method); })(ReferencesRequest = exports2.ReferencesRequest || (exports2.ReferencesRequest = {})); var DocumentHighlightRequest; (function(DocumentHighlightRequest2) { DocumentHighlightRequest2.method = "textDocument/documentHighlight"; DocumentHighlightRequest2.type = new messages_1.ProtocolRequestType(DocumentHighlightRequest2.method); })(DocumentHighlightRequest = exports2.DocumentHighlightRequest || (exports2.DocumentHighlightRequest = {})); var DocumentSymbolRequest; (function(DocumentSymbolRequest2) { DocumentSymbolRequest2.method = "textDocument/documentSymbol"; DocumentSymbolRequest2.type = new messages_1.ProtocolRequestType(DocumentSymbolRequest2.method); })(DocumentSymbolRequest = exports2.DocumentSymbolRequest || (exports2.DocumentSymbolRequest = {})); var CodeActionRequest; (function(CodeActionRequest2) { CodeActionRequest2.method = "textDocument/codeAction"; CodeActionRequest2.type = new messages_1.ProtocolRequestType(CodeActionRequest2.method); })(CodeActionRequest = exports2.CodeActionRequest || (exports2.CodeActionRequest = {})); var CodeActionResolveRequest; (function(CodeActionResolveRequest2) { CodeActionResolveRequest2.method = "codeAction/resolve"; CodeActionResolveRequest2.type = new messages_1.ProtocolRequestType(CodeActionResolveRequest2.method); })(CodeActionResolveRequest = exports2.CodeActionResolveRequest || (exports2.CodeActionResolveRequest = {})); var WorkspaceSymbolRequest; (function(WorkspaceSymbolRequest2) { WorkspaceSymbolRequest2.method = "workspace/symbol"; WorkspaceSymbolRequest2.type = new messages_1.ProtocolRequestType(WorkspaceSymbolRequest2.method); })(WorkspaceSymbolRequest = exports2.WorkspaceSymbolRequest || (exports2.WorkspaceSymbolRequest = {})); var CodeLensRequest; (function(CodeLensRequest2) { CodeLensRequest2.method = "textDocument/codeLens"; CodeLensRequest2.type = new messages_1.ProtocolRequestType(CodeLensRequest2.method); })(CodeLensRequest = exports2.CodeLensRequest || (exports2.CodeLensRequest = {})); var CodeLensResolveRequest; (function(CodeLensResolveRequest2) { CodeLensResolveRequest2.method = "codeLens/resolve"; CodeLensResolveRequest2.type = new messages_1.ProtocolRequestType(CodeLensResolveRequest2.method); })(CodeLensResolveRequest = exports2.CodeLensResolveRequest || (exports2.CodeLensResolveRequest = {})); var CodeLensRefreshRequest; (function(CodeLensRefreshRequest2) { CodeLensRefreshRequest2.method = `workspace/codeLens/refresh`; CodeLensRefreshRequest2.type = new messages_1.ProtocolRequestType0(CodeLensRefreshRequest2.method); })(CodeLensRefreshRequest = exports2.CodeLensRefreshRequest || (exports2.CodeLensRefreshRequest = {})); var DocumentLinkRequest; (function(DocumentLinkRequest2) { DocumentLinkRequest2.method = "textDocument/documentLink"; DocumentLinkRequest2.type = new messages_1.ProtocolRequestType(DocumentLinkRequest2.method); })(DocumentLinkRequest = exports2.DocumentLinkRequest || (exports2.DocumentLinkRequest = {})); var DocumentLinkResolveRequest; (function(DocumentLinkResolveRequest2) { DocumentLinkResolveRequest2.method = "documentLink/resolve"; DocumentLinkResolveRequest2.type = new messages_1.ProtocolRequestType(DocumentLinkResolveRequest2.method); })(DocumentLinkResolveRequest = exports2.DocumentLinkResolveRequest || (exports2.DocumentLinkResolveRequest = {})); var DocumentFormattingRequest; (function(DocumentFormattingRequest2) { DocumentFormattingRequest2.method = "textDocument/formatting"; DocumentFormattingRequest2.type = new messages_1.ProtocolRequestType(DocumentFormattingRequest2.method); })(DocumentFormattingRequest = exports2.DocumentFormattingRequest || (exports2.DocumentFormattingRequest = {})); var DocumentRangeFormattingRequest; (function(DocumentRangeFormattingRequest2) { DocumentRangeFormattingRequest2.method = "textDocument/rangeFormatting"; DocumentRangeFormattingRequest2.type = new messages_1.ProtocolRequestType(DocumentRangeFormattingRequest2.method); })(DocumentRangeFormattingRequest = exports2.DocumentRangeFormattingRequest || (exports2.DocumentRangeFormattingRequest = {})); var DocumentOnTypeFormattingRequest; (function(DocumentOnTypeFormattingRequest2) { DocumentOnTypeFormattingRequest2.method = "textDocument/onTypeFormatting"; DocumentOnTypeFormattingRequest2.type = new messages_1.ProtocolRequestType(DocumentOnTypeFormattingRequest2.method); })(DocumentOnTypeFormattingRequest = exports2.DocumentOnTypeFormattingRequest || (exports2.DocumentOnTypeFormattingRequest = {})); var PrepareSupportDefaultBehavior; (function(PrepareSupportDefaultBehavior2) { PrepareSupportDefaultBehavior2.Identifier = 1; })(PrepareSupportDefaultBehavior = exports2.PrepareSupportDefaultBehavior || (exports2.PrepareSupportDefaultBehavior = {})); var RenameRequest; (function(RenameRequest2) { RenameRequest2.method = "textDocument/rename"; RenameRequest2.type = new messages_1.ProtocolRequestType(RenameRequest2.method); })(RenameRequest = exports2.RenameRequest || (exports2.RenameRequest = {})); var PrepareRenameRequest; (function(PrepareRenameRequest2) { PrepareRenameRequest2.method = "textDocument/prepareRename"; PrepareRenameRequest2.type = new messages_1.ProtocolRequestType(PrepareRenameRequest2.method); })(PrepareRenameRequest = exports2.PrepareRenameRequest || (exports2.PrepareRenameRequest = {})); var ExecuteCommandRequest; (function(ExecuteCommandRequest2) { ExecuteCommandRequest2.type = new messages_1.ProtocolRequestType("workspace/executeCommand"); })(ExecuteCommandRequest = exports2.ExecuteCommandRequest || (exports2.ExecuteCommandRequest = {})); var ApplyWorkspaceEditRequest; (function(ApplyWorkspaceEditRequest2) { ApplyWorkspaceEditRequest2.type = new messages_1.ProtocolRequestType("workspace/applyEdit"); })(ApplyWorkspaceEditRequest = exports2.ApplyWorkspaceEditRequest || (exports2.ApplyWorkspaceEditRequest = {})); }); // node_modules/vscode-languageserver-protocol/lib/common/connection.js var require_connection2 = __commonJS((exports2) => { "use strict"; Object.defineProperty(exports2, "__esModule", {value: true}); exports2.createProtocolConnection = void 0; var vscode_jsonrpc_1 = require_main(); function createProtocolConnection(input, output, logger, options) { if (vscode_jsonrpc_1.ConnectionStrategy.is(options)) { options = {connectionStrategy: options}; } return vscode_jsonrpc_1.createMessageConnection(input, output, logger, options); } exports2.createProtocolConnection = createProtocolConnection; }); // node_modules/vscode-languageserver-protocol/lib/common/api.js var require_api2 = __commonJS((exports2) => { "use strict"; var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { if (k2 === void 0) k2 = k; Object.defineProperty(o, k2, {enumerable: true, get: function() { return m[k]; }}); } : function(o, m, k, k2) { if (k2 === void 0) k2 = k; o[k2] = m[k]; }); var __exportStar2 = exports2 && exports2.__exportStar || function(m, exports3) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p); }; Object.defineProperty(exports2, "__esModule", {value: true}); exports2.LSPErrorCodes = exports2.createProtocolConnection = void 0; __exportStar2(require_main(), exports2); __exportStar2(require_main2(), exports2); __exportStar2(require_messages2(), exports2); __exportStar2(require_protocol(), exports2); var connection_1 = require_connection2(); Object.defineProperty(exports2, "createProtocolConnection", {enumerable: true, get: function() { return connection_1.createProtocolConnection; }}); var LSPErrorCodes; (function(LSPErrorCodes2) { LSPErrorCodes2.lspReservedErrorRangeStart = -32899; LSPErrorCodes2.ContentModified = -32801; LSPErrorCodes2.RequestCancelled = -32800; LSPErrorCodes2.lspReservedErrorRangeEnd = -32800; })(LSPErrorCodes = exports2.LSPErrorCodes || (exports2.LSPErrorCodes = {})); }); // node_modules/vscode-languageserver-protocol/lib/node/main.js var require_main3 = __commonJS((exports2) => { "use strict"; var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { if (k2 === void 0) k2 = k; Object.defineProperty(o, k2, {enumerable: true, get: function() { return m[k]; }}); } : function(o, m, k, k2) { if (k2 === void 0) k2 = k; o[k2] = m[k]; }); var __exportStar2 = exports2 && exports2.__exportStar || function(m, exports3) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p); }; Object.defineProperty(exports2, "__esModule", {value: true}); exports2.createProtocolConnection = void 0; var node_1 = require_node(); __exportStar2(require_node(), exports2); __exportStar2(require_api2(), exports2); function createProtocolConnection(input, output, logger, options) { return node_1.createMessageConnection(input, output, logger, options); } exports2.createProtocolConnection = createProtocolConnection; }); // node_modules/abort-controller/dist/abort-controller.mjs var require_abort_controller = __commonJS((exports2) => { __markAsModule(exports2); __export(exports2, { AbortController: () => AbortController, AbortSignal: () => AbortSignal, default: () => abort_controller_default }); var AbortSignal = class extends EventTarget { constructor() { super(); throw new TypeError("AbortSignal cannot be constructed directly"); } get aborted() { const aborted = abortedFlags.get(this); if (typeof aborted !== "boolean") { throw new TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this === null ? "null" : typeof this}`); } return aborted; } }; defineEventAttribute(AbortSignal.prototype, "abort"); function createAbortSignal() { const signal = Object.create(AbortSignal.prototype); EventTarget.call(signal); abortedFlags.set(signal, false); return signal; } function abortSignal(signal) { if (abortedFlags.get(signal) !== false) { return; } abortedFlags.set(signal, true); signal.dispatchEvent({type: "abort"}); } var abortedFlags = new WeakMap(); Object.defineProperties(AbortSignal.prototype, { aborted: {enumerable: true} }); if (typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol") { Object.defineProperty(AbortSignal.prototype, Symbol.toStringTag, { configurable: true, value: "AbortSignal" }); } var AbortController = class { constructor() { signals.set(this, createAbortSignal()); } get signal() { return getSignal(this); } abort() { abortSignal(getSignal(this)); } }; var signals = new WeakMap(); function getSignal(controller) { const signal = signals.get(controller); if (signal == null) { throw new TypeError(`Expected 'this' to be an 'AbortController' object, but got ${controller === null ? "null" : typeof controller}`); } return signal; } Object.defineProperties(AbortController.prototype, { signal: {enumerable: true}, abort: {enumerable: true} }); if (typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol") { Object.defineProperty(AbortController.prototype, Symbol.toStringTag, { configurable: true, value: "AbortController" }); } var abort_controller_default = AbortController; }); // node_modules/node-fetch/lib/index.mjs var require_lib = __commonJS((exports2) => { __markAsModule(exports2); __export(exports2, { FetchError: () => FetchError, Headers: () => Headers, Request: () => Request, Response: () => Response, default: () => lib_default }); var import_stream = __toModule(require("stream")); var import_http = __toModule(require("http")); var import_url = __toModule(require("url")); var import_https = __toModule(require("https")); var import_zlib = __toModule(require("zlib")); var Readable = import_stream.default.Readable; var BUFFER = Symbol("buffer"); var TYPE = Symbol("type"); var Blob = class { constructor() { this[TYPE] = ""; const blobParts = arguments[0]; const options = arguments[1]; const buffers = []; let size = 0; if (blobParts) { const a = blobParts; const length = Number(a.length); for (let i = 0; i < length; i++) { const element = a[i]; let buffer; if (element instanceof Buffer) { buffer = element; } else if (ArrayBuffer.isView(element)) { buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength); } else if (element instanceof ArrayBuffer) { buffer = Buffer.from(element); } else if (element instanceof Blob) { buffer = element[BUFFER]; } else { buffer = Buffer.from(typeof element === "string" ? element : String(element)); } size += buffer.length; buffers.push(buffer); } } this[BUFFER] = Buffer.concat(buffers); let type = options && options.type !== void 0 && String(options.type).toLowerCase(); if (type && !/[^\u0020-\u007E]/.test(type)) { this[TYPE] = type; } } get size() { return this[BUFFER].length; } get type() { return this[TYPE]; } text() { return Promise.resolve(this[BUFFER].toString()); } arrayBuffer() { const buf = this[BUFFER]; const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); return Promise.resolve(ab); } stream() { const readable = new Readable(); readable._read = function() { }; readable.push(this[BUFFER]); readable.push(null); return readable; } toString() { return "[object Blob]"; } slice() { const size = this.size; const start = arguments[0]; const end = arguments[1]; let relativeStart, relativeEnd; if (start === void 0) { relativeStart = 0; } else if (start < 0) { relativeStart = Math.max(size + start, 0); } else { relativeStart = Math.min(start, size); } if (end === void 0) { relativeEnd = size; } else if (end < 0) { relativeEnd = Math.max(size + end, 0); } else { relativeEnd = Math.min(end, size); } const span = Math.max(relativeEnd - relativeStart, 0); const buffer = this[BUFFER]; const slicedBuffer = buffer.slice(relativeStart, relativeStart + span); const blob = new Blob([], {type: arguments[2]}); blob[BUFFER] = slicedBuffer; return blob; } }; Object.defineProperties(Blob.prototype, { size: {enumerable: true}, type: {enumerable: true}, slice: {enumerable: true} }); Object.defineProperty(Blob.prototype, Symbol.toStringTag, { value: "Blob", writable: false, enumerable: false, configurable: true }); function FetchError(message, type, systemError) { Error.call(this, message); this.message = message; this.type = type; if (systemError) { this.code = this.errno = systemError.code; } Error.captureStackTrace(this, this.constructor); } FetchError.prototype = Object.create(Error.prototype); FetchError.prototype.constructor = FetchError; FetchError.prototype.name = "FetchError"; var convert; try { convert = require("encoding").convert; } catch (e) { } var INTERNALS = Symbol("Body internals"); var PassThrough = import_stream.default.PassThrough; function Body(body) { var _this = this; var _ref = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, _ref$size = _ref.size; let size = _ref$size === void 0 ? 0 : _ref$size; var _ref$timeout = _ref.timeout; let timeout = _ref$timeout === void 0 ? 0 : _ref$timeout; if (body == null) { body = null; } else if (isURLSearchParams(body)) { body = Buffer.from(body.toString()); } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === "[object ArrayBuffer]") { body = Buffer.from(body); } else if (ArrayBuffer.isView(body)) { body = Buffer.from(body.buffer, body.byteOffset, body.byteLength); } else if (body instanceof import_stream.default) ; else { body = Buffer.from(String(body)); } this[INTERNALS] = { body, disturbed: false, error: null }; this.size = size; this.timeout = timeout; if (body instanceof import_stream.default) { body.on("error", function(err) { const error = err.name === "AbortError" ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, "system", err); _this[INTERNALS].error = error; }); } } Body.prototype = { get body() { return this[INTERNALS].body; }, get bodyUsed() { return this[INTERNALS].disturbed; }, arrayBuffer() { return consumeBody.call(this).then(function(buf) { return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); }); }, blob() { let ct = this.headers && this.headers.get("content-type") || ""; return consumeBody.call(this).then(function(buf) { return Object.assign(new Blob([], { type: ct.toLowerCase() }), { [BUFFER]: buf }); }); }, json() { var _this2 = this; return consumeBody.call(this).then(function(buffer) { try { return JSON.parse(buffer.toString()); } catch (err) { return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, "invalid-json")); } }); }, text() { return consumeBody.call(this).then(function(buffer) { return buffer.toString(); }); }, buffer() { return consumeBody.call(this); }, textConverted() { var _this3 = this; return consumeBody.call(this).then(function(buffer) { return convertBody(buffer, _this3.headers); }); } }; Object.defineProperties(Body.prototype, { body: {enumerable: true}, bodyUsed: {enumerable: true}, arrayBuffer: {enumerable: true}, blob: {enumerable: true}, json: {enumerable: true}, text: {enumerable: true} }); Body.mixIn = function(proto) { for (const name of Object.getOwnPropertyNames(Body.prototype)) { if (!(name in proto)) { const desc = Object.getOwnPropertyDescriptor(Body.prototype, name); Object.defineProperty(proto, name, desc); } } }; function consumeBody() { var _this4 = this; if (this[INTERNALS].disturbed) { return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`)); } this[INTERNALS].disturbed = true; if (this[INTERNALS].error) { return Body.Promise.reject(this[INTERNALS].error); } let body = this.body; if (body === null) { return Body.Promise.resolve(Buffer.alloc(0)); } if (isBlob(body)) { body = body.stream(); } if (Buffer.isBuffer(body)) { return Body.Promise.resolve(body); } if (!(body instanceof import_stream.default)) { return Body.Promise.resolve(Buffer.alloc(0)); } let accum = []; let accumBytes = 0; let abort = false; return new Body.Promise(function(resolve, reject) { let resTimeout; if (_this4.timeout) { resTimeout = setTimeout(function() { abort = true; reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, "body-timeout")); }, _this4.timeout); } body.on("error", function(err) { if (err.name === "AbortError") { abort = true; reject(err); } else { reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, "system", err)); } }); body.on("data", function(chunk) { if (abort || chunk === null) { return; } if (_this4.size && accumBytes + chunk.length > _this4.size) { abort = true; reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, "max-size")); return; } accumBytes += chunk.length; accum.push(chunk); }); body.on("end", function() { if (abort) { return; } clearTimeout(resTimeout); try { resolve(Buffer.concat(accum, accumBytes)); } catch (err) { reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, "system", err)); } }); }); } function convertBody(buffer, headers) { if (typeof convert !== "function") { throw new Error("The package `encoding` must be installed to use the textConverted() function"); } const ct = headers.get("content-type"); let charset = "utf-8"; let res, str; if (ct) { res = /charset=([^;]*)/i.exec(ct); } str = buffer.slice(0, 1024).toString(); if (!res && str) { res = / 0 && arguments[0] !== void 0 ? arguments[0] : void 0; this[MAP] = Object.create(null); if (init instanceof Headers) { const rawHeaders = init.raw(); const headerNames = Object.keys(rawHeaders); for (const headerName of headerNames) { for (const value of rawHeaders[headerName]) { this.append(headerName, value); } } return; } if (init == null) ; else if (typeof init === "object") { const method = init[Symbol.iterator]; if (method != null) { if (typeof method !== "function") { throw new TypeError("Header pairs must be iterable"); } const pairs = []; for (const pair of init) { if (typeof pair !== "object" || typeof pair[Symbol.iterator] !== "function") { throw new TypeError("Each header pair must be iterable"); } pairs.push(Array.from(pair)); } for (const pair of pairs) { if (pair.length !== 2) { throw new TypeError("Each header pair must be a name/value tuple"); } this.append(pair[0], pair[1]); } } else { for (const key of Object.keys(init)) { const value = init[key]; this.append(key, value); } } } else { throw new TypeError("Provided initializer must be an object"); } } get(name) { name = `${name}`; validateName(name); const key = find(this[MAP], name); if (key === void 0) { return null; } return this[MAP][key].join(", "); } forEach(callback) { let thisArg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : void 0; let pairs = getHeaders(this); let i = 0; while (i < pairs.length) { var _pairs$i = pairs[i]; const name = _pairs$i[0], value = _pairs$i[1]; callback.call(thisArg, value, name, this); pairs = getHeaders(this); i++; } } set(name, value) { name = `${name}`; value = `${value}`; validateName(name); validateValue(value); const key = find(this[MAP], name); this[MAP][key !== void 0 ? key : name] = [value]; } append(name, value) { name = `${name}`; value = `${value}`; validateName(name); validateValue(value); const key = find(this[MAP], name); if (key !== void 0) { this[MAP][key].push(value); } else { this[MAP][name] = [value]; } } has(name) { name = `${name}`; validateName(name); return find(this[MAP], name) !== void 0; } delete(name) { name = `${name}`; validateName(name); const key = find(this[MAP], name); if (key !== void 0) { delete this[MAP][key]; } } raw() { return this[MAP]; } keys() { return createHeadersIterator(this, "key"); } values() { return createHeadersIterator(this, "value"); } [Symbol.iterator]() { return createHeadersIterator(this, "key+value"); } }; Headers.prototype.entries = Headers.prototype[Symbol.iterator]; Object.defineProperty(Headers.prototype, Symbol.toStringTag, { value: "Headers", writable: false, enumerable: false, configurable: true }); Object.defineProperties(Headers.prototype, { get: {enumerable: true}, forEach: {enumerable: true}, set: {enumerable: true}, append: {enumerable: true}, has: {enumerable: true}, delete: {enumerable: true}, keys: {enumerable: true}, values: {enumerable: true}, entries: {enumerable: true} }); function getHeaders(headers) { let kind = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "key+value"; const keys = Object.keys(headers[MAP]).sort(); return keys.map(kind === "key" ? function(k) { return k.toLowerCase(); } : kind === "value" ? function(k) { return headers[MAP][k].join(", "); } : function(k) { return [k.toLowerCase(), headers[MAP][k].join(", ")]; }); } var INTERNAL = Symbol("internal"); function createHeadersIterator(target, kind) { const iterator = Object.create(HeadersIteratorPrototype); iterator[INTERNAL] = { target, kind, index: 0 }; return iterator; } var HeadersIteratorPrototype = Object.setPrototypeOf({ next() { if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) { throw new TypeError("Value of `this` is not a HeadersIterator"); } var _INTERNAL = this[INTERNAL]; const target = _INTERNAL.target, kind = _INTERNAL.kind, index = _INTERNAL.index; const values = getHeaders(target, kind); const len = values.length; if (index >= len) { return { value: void 0, done: true }; } this[INTERNAL].index = index + 1; return { value: values[index], done: false }; } }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))); Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, { value: "HeadersIterator", writable: false, enumerable: false, configurable: true }); function exportNodeCompatibleHeaders(headers) { const obj = Object.assign({__proto__: null}, headers[MAP]); const hostHeaderKey = find(headers[MAP], "Host"); if (hostHeaderKey !== void 0) { obj[hostHeaderKey] = obj[hostHeaderKey][0]; } return obj; } function createHeadersLenient(obj) { const headers = new Headers(); for (const name of Object.keys(obj)) { if (invalidTokenRegex.test(name)) { continue; } if (Array.isArray(obj[name])) { for (const val of obj[name]) { if (invalidHeaderCharRegex.test(val)) { continue; } if (headers[MAP][name] === void 0) { headers[MAP][name] = [val]; } else { headers[MAP][name].push(val); } } } else if (!invalidHeaderCharRegex.test(obj[name])) { headers[MAP][name] = [obj[name]]; } } return headers; } var INTERNALS$1 = Symbol("Response internals"); var STATUS_CODES = import_http.default.STATUS_CODES; var Response = class { constructor() { let body = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null; let opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; Body.call(this, body, opts); const status = opts.status || 200; const headers = new Headers(opts.headers); if (body != null && !headers.has("Content-Type")) { const contentType = extractContentType(body); if (contentType) { headers.append("Content-Type", contentType); } } this[INTERNALS$1] = { url: opts.url, status, statusText: opts.statusText || STATUS_CODES[status], headers, counter: opts.counter }; } get url() { return this[INTERNALS$1].url || ""; } get status() { return this[INTERNALS$1].status; } get ok() { return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300; } get redirected() { return this[INTERNALS$1].counter > 0; } get statusText() { return this[INTERNALS$1].statusText; } get headers() { return this[INTERNALS$1].headers; } clone() { return new Response(clone(this), { url: this.url, status: this.status, statusText: this.statusText, headers: this.headers, ok: this.ok, redirected: this.redirected }); } }; Body.mixIn(Response.prototype); Object.defineProperties(Response.prototype, { url: {enumerable: true}, status: {enumerable: true}, ok: {enumerable: true}, redirected: {enumerable: true}, statusText: {enumerable: true}, headers: {enumerable: true}, clone: {enumerable: true} }); Object.defineProperty(Response.prototype, Symbol.toStringTag, { value: "Response", writable: false, enumerable: false, configurable: true }); var INTERNALS$2 = Symbol("Request internals"); var parse_url = import_url.default.parse; var format_url = import_url.default.format; var streamDestructionSupported = "destroy" in import_stream.default.Readable.prototype; function isRequest(input) { return typeof input === "object" && typeof input[INTERNALS$2] === "object"; } function isAbortSignal(signal) { const proto = signal && typeof signal === "object" && Object.getPrototypeOf(signal); return !!(proto && proto.constructor.name === "AbortSignal"); } var Request = class { constructor(input) { let init = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; let parsedURL; if (!isRequest(input)) { if (input && input.href) { parsedURL = parse_url(input.href); } else { parsedURL = parse_url(`${input}`); } input = {}; } else { parsedURL = parse_url(input.url); } let method = init.method || input.method || "GET"; method = method.toUpperCase(); if ((init.body != null || isRequest(input) && input.body !== null) && (method === "GET" || method === "HEAD")) { throw new TypeError("Request with GET/HEAD method cannot have body"); } let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null; Body.call(this, inputBody, { timeout: init.timeout || input.timeout || 0, size: init.size || input.size || 0 }); const headers = new Headers(init.headers || input.headers || {}); if (inputBody != null && !headers.has("Content-Type")) { const contentType = extractContentType(inputBody); if (contentType) { headers.append("Content-Type", contentType); } } let signal = isRequest(input) ? input.signal : null; if ("signal" in init) signal = init.signal; if (signal != null && !isAbortSignal(signal)) { throw new TypeError("Expected signal to be an instanceof AbortSignal"); } this[INTERNALS$2] = { method, redirect: init.redirect || input.redirect || "follow", headers, parsedURL, signal }; this.follow = init.follow !== void 0 ? init.follow : input.follow !== void 0 ? input.follow : 20; this.compress = init.compress !== void 0 ? init.compress : input.compress !== void 0 ? input.compress : true; this.counter = init.counter || input.counter || 0; this.agent = init.agent || input.agent; } get method() { return this[INTERNALS$2].method; } get url() { return format_url(this[INTERNALS$2].parsedURL); } get headers() { return this[INTERNALS$2].headers; } get redirect() { return this[INTERNALS$2].redirect; } get signal() { return this[INTERNALS$2].signal; } clone() { return new Request(this); } }; Body.mixIn(Request.prototype); Object.defineProperty(Request.prototype, Symbol.toStringTag, { value: "Request", writable: false, enumerable: false, configurable: true }); Object.defineProperties(Request.prototype, { method: {enumerable: true}, url: {enumerable: true}, headers: {enumerable: true}, redirect: {enumerable: true}, clone: {enumerable: true}, signal: {enumerable: true} }); function getNodeRequestOptions(request) { const parsedURL = request[INTERNALS$2].parsedURL; const headers = new Headers(request[INTERNALS$2].headers); if (!headers.has("Accept")) { headers.set("Accept", "*/*"); } if (!parsedURL.protocol || !parsedURL.hostname) { throw new TypeError("Only absolute URLs are supported"); } if (!/^https?:$/.test(parsedURL.protocol)) { throw new TypeError("Only HTTP(S) protocols are supported"); } if (request.signal && request.body instanceof import_stream.default.Readable && !streamDestructionSupported) { throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8"); } let contentLengthValue = null; if (request.body == null && /^(POST|PUT)$/i.test(request.method)) { contentLengthValue = "0"; } if (request.body != null) { const totalBytes = getTotalBytes(request); if (typeof totalBytes === "number") { contentLengthValue = String(totalBytes); } } if (contentLengthValue) { headers.set("Content-Length", contentLengthValue); } if (!headers.has("User-Agent")) { headers.set("User-Agent", "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"); } if (request.compress && !headers.has("Accept-Encoding")) { headers.set("Accept-Encoding", "gzip,deflate"); } let agent = request.agent; if (typeof agent === "function") { agent = agent(parsedURL); } if (!headers.has("Connection") && !agent) { headers.set("Connection", "close"); } return Object.assign({}, parsedURL, { method: request.method, headers: exportNodeCompatibleHeaders(headers), agent }); } function AbortError(message) { Error.call(this, message); this.type = "aborted"; this.message = message; Error.captureStackTrace(this, this.constructor); } AbortError.prototype = Object.create(Error.prototype); AbortError.prototype.constructor = AbortError; AbortError.prototype.name = "AbortError"; var PassThrough$1 = import_stream.default.PassThrough; var resolve_url = import_url.default.resolve; function fetch(url, opts) { if (!fetch.Promise) { throw new Error("native promise missing, set fetch.Promise to your favorite alternative"); } Body.Promise = fetch.Promise; return new fetch.Promise(function(resolve, reject) { const request = new Request(url, opts); const options = getNodeRequestOptions(request); const send = (options.protocol === "https:" ? import_https.default : import_http.default).request; const signal = request.signal; let response = null; const abort = function abort2() { let error = new AbortError("The user aborted a request."); reject(error); if (request.body && request.body instanceof import_stream.default.Readable) { request.body.destroy(error); } if (!response || !response.body) return; response.body.emit("error", error); }; if (signal && signal.aborted) { abort(); return; } const abortAndFinalize = function abortAndFinalize2() { abort(); finalize(); }; const req = send(options); let reqTimeout; if (signal) { signal.addEventListener("abort", abortAndFinalize); } function finalize() { req.abort(); if (signal) signal.removeEventListener("abort", abortAndFinalize); clearTimeout(reqTimeout); } if (request.timeout) { req.once("socket", function(socket) { reqTimeout = setTimeout(function() { reject(new FetchError(`network timeout at: ${request.url}`, "request-timeout")); finalize(); }, request.timeout); }); } req.on("error", function(err) { reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, "system", err)); finalize(); }); req.on("response", function(res) { clearTimeout(reqTimeout); const headers = createHeadersLenient(res.headers); if (fetch.isRedirect(res.statusCode)) { const location = headers.get("Location"); const locationURL = location === null ? null : resolve_url(request.url, location); switch (request.redirect) { case "error": reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, "no-redirect")); finalize(); return; case "manual": if (locationURL !== null) { try { headers.set("Location", locationURL); } catch (err) { reject(err); } } break; case "follow": if (locationURL === null) { break; } if (request.counter >= request.follow) { reject(new FetchError(`maximum redirect reached at: ${request.url}`, "max-redirect")); finalize(); return; } const requestOpts = { headers: new Headers(request.headers), follow: request.follow, counter: request.counter + 1, agent: request.agent, compress: request.compress, method: request.method, body: request.body, signal: request.signal, timeout: request.timeout, size: request.size }; if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) { reject(new FetchError("Cannot follow redirect with body being a readable stream", "unsupported-redirect")); finalize(); return; } if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === "POST") { requestOpts.method = "GET"; requestOpts.body = void 0; requestOpts.headers.delete("content-length"); } resolve(fetch(new Request(locationURL, requestOpts))); finalize(); return; } } res.once("end", function() { if (signal) signal.removeEventListener("abort", abortAndFinalize); }); let body = res.pipe(new PassThrough$1()); const response_options = { url: request.url, status: res.statusCode, statusText: res.statusMessage, headers, size: request.size, timeout: request.timeout, counter: request.counter }; const codings = headers.get("Content-Encoding"); if (!request.compress || request.method === "HEAD" || codings === null || res.statusCode === 204 || res.statusCode === 304) { response = new Response(body, response_options); resolve(response); return; } const zlibOptions = { flush: import_zlib.default.Z_SYNC_FLUSH, finishFlush: import_zlib.default.Z_SYNC_FLUSH }; if (codings == "gzip" || codings == "x-gzip") { body = body.pipe(import_zlib.default.createGunzip(zlibOptions)); response = new Response(body, response_options); resolve(response); return; } if (codings == "deflate" || codings == "x-deflate") { const raw = res.pipe(new PassThrough$1()); raw.once("data", function(chunk) { if ((chunk[0] & 15) === 8) { body = body.pipe(import_zlib.default.createInflate()); } else { body = body.pipe(import_zlib.default.createInflateRaw()); } response = new Response(body, response_options); resolve(response); }); return; } if (codings == "br" && typeof import_zlib.default.createBrotliDecompress === "function") { body = body.pipe(import_zlib.default.createBrotliDecompress()); response = new Response(body, response_options); resolve(response); return; } response = new Response(body, response_options); resolve(response); }); writeToStream(req, request); }); } fetch.isRedirect = function(code) { return code === 301 || code === 302 || code === 303 || code === 307 || code === 308; }; fetch.Promise = global.Promise; var lib_default = fetch; }); // node_modules/picomatch/lib/constants.js var require_constants = __commonJS((exports2, module2) => { "use strict"; var path = require("path"); var WIN_SLASH = "\\\\/"; var WIN_NO_SLASH = `[^${WIN_SLASH}]`; var DOT_LITERAL = "\\."; var PLUS_LITERAL = "\\+"; var QMARK_LITERAL = "\\?"; var SLASH_LITERAL = "\\/"; var ONE_CHAR = "(?=.)"; var QMARK = "[^/]"; var END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; var START_ANCHOR = `(?:^|${SLASH_LITERAL})`; var DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; var NO_DOT = `(?!${DOT_LITERAL})`; var NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; var NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; var NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; var QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; var STAR = `${QMARK}*?`; var POSIX_CHARS = { DOT_LITERAL, PLUS_LITERAL, QMARK_LITERAL, SLASH_LITERAL, ONE_CHAR, QMARK, END_ANCHOR, DOTS_SLASH, NO_DOT, NO_DOTS, NO_DOT_SLASH, NO_DOTS_SLASH, QMARK_NO_DOT, STAR, START_ANCHOR }; var WINDOWS_CHARS = { ...POSIX_CHARS, SLASH_LITERAL: `[${WIN_SLASH}]`, QMARK: WIN_NO_SLASH, STAR: `${WIN_NO_SLASH}*?`, DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, NO_DOT: `(?!${DOT_LITERAL})`, NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, QMARK_NO_DOT: `[^.${WIN_SLASH}]`, START_ANCHOR: `(?:^|[${WIN_SLASH}])`, END_ANCHOR: `(?:[${WIN_SLASH}]|$)` }; var POSIX_REGEX_SOURCE = { alnum: "a-zA-Z0-9", alpha: "a-zA-Z", ascii: "\\x00-\\x7F", blank: " \\t", cntrl: "\\x00-\\x1F\\x7F", digit: "0-9", graph: "\\x21-\\x7E", lower: "a-z", print: "\\x20-\\x7E ", punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~", space: " \\t\\r\\n\\v\\f", upper: "A-Z", word: "A-Za-z0-9_", xdigit: "A-Fa-f0-9" }; module2.exports = { MAX_LENGTH: 1024 * 64, POSIX_REGEX_SOURCE, REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, REPLACEMENTS: { "***": "*", "**/**": "**", "**/**/**": "**" }, CHAR_0: 48, CHAR_9: 57, CHAR_UPPERCASE_A: 65, CHAR_LOWERCASE_A: 97, CHAR_UPPERCASE_Z: 90, CHAR_LOWERCASE_Z: 122, CHAR_LEFT_PARENTHESES: 40, CHAR_RIGHT_PARENTHESES: 41, CHAR_ASTERISK: 42, CHAR_AMPERSAND: 38, CHAR_AT: 64, CHAR_BACKWARD_SLASH: 92, CHAR_CARRIAGE_RETURN: 13, CHAR_CIRCUMFLEX_ACCENT: 94, CHAR_COLON: 58, CHAR_COMMA: 44, CHAR_DOT: 46, CHAR_DOUBLE_QUOTE: 34, CHAR_EQUAL: 61, CHAR_EXCLAMATION_MARK: 33, CHAR_FORM_FEED: 12, CHAR_FORWARD_SLASH: 47, CHAR_GRAVE_ACCENT: 96, CHAR_HASH: 35, CHAR_HYPHEN_MINUS: 45, CHAR_LEFT_ANGLE_BRACKET: 60, CHAR_LEFT_CURLY_BRACE: 123, CHAR_LEFT_SQUARE_BRACKET: 91, CHAR_LINE_FEED: 10, CHAR_NO_BREAK_SPACE: 160, CHAR_PERCENT: 37, CHAR_PLUS: 43, CHAR_QUESTION_MARK: 63, CHAR_RIGHT_ANGLE_BRACKET: 62, CHAR_RIGHT_CURLY_BRACE: 125, CHAR_RIGHT_SQUARE_BRACKET: 93, CHAR_SEMICOLON: 59, CHAR_SINGLE_QUOTE: 39, CHAR_SPACE: 32, CHAR_TAB: 9, CHAR_UNDERSCORE: 95, CHAR_VERTICAL_LINE: 124, CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, SEP: path.sep, extglobChars(chars) { return { "!": {type: "negate", open: "(?:(?!(?:", close: `))${chars.STAR})`}, "?": {type: "qmark", open: "(?:", close: ")?"}, "+": {type: "plus", open: "(?:", close: ")+"}, "*": {type: "star", open: "(?:", close: ")*"}, "@": {type: "at", open: "(?:", close: ")"} }; }, globChars(win32) { return win32 === true ? WINDOWS_CHARS : POSIX_CHARS; } }; }); // node_modules/picomatch/lib/utils.js var require_utils = __commonJS((exports2) => { "use strict"; var path = require("path"); var win32 = process.platform === "win32"; var { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = require_constants(); exports2.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val); exports2.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str); exports2.isRegexChar = (str) => str.length === 1 && exports2.hasRegexChars(str); exports2.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1"); exports2.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/"); exports2.removeBackslashes = (str) => { return str.replace(REGEX_REMOVE_BACKSLASH, (match) => { return match === "\\" ? "" : match; }); }; exports2.supportsLookbehinds = () => { const segs = process.version.slice(1).split(".").map(Number); if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) { return true; } return false; }; exports2.isWindows = (options) => { if (options && typeof options.windows === "boolean") { return options.windows; } return win32 === true || path.sep === "\\"; }; exports2.escapeLast = (input, char, lastIdx) => { const idx = input.lastIndexOf(char, lastIdx); if (idx === -1) return input; if (input[idx - 1] === "\\") return exports2.escapeLast(input, char, idx - 1); return `${input.slice(0, idx)}\\${input.slice(idx)}`; }; exports2.removePrefix = (input, state = {}) => { let output = input; if (output.startsWith("./")) { output = output.slice(2); state.prefix = "./"; } return output; }; exports2.wrapOutput = (input, state = {}, options = {}) => { const prepend = options.contains ? "" : "^"; const append = options.contains ? "" : "$"; let output = `${prepend}(?:${input})${append}`; if (state.negated === true) { output = `(?:^(?!${output}).*$)`; } return output; }; }); // node_modules/picomatch/lib/scan.js var require_scan = __commonJS((exports2, module2) => { "use strict"; var utils = require_utils(); var { CHAR_ASTERISK, CHAR_AT, CHAR_BACKWARD_SLASH, CHAR_COMMA, CHAR_DOT, CHAR_EXCLAMATION_MARK, CHAR_FORWARD_SLASH, CHAR_LEFT_CURLY_BRACE, CHAR_LEFT_PARENTHESES, CHAR_LEFT_SQUARE_BRACKET, CHAR_PLUS, CHAR_QUESTION_MARK, CHAR_RIGHT_CURLY_BRACE, CHAR_RIGHT_PARENTHESES, CHAR_RIGHT_SQUARE_BRACKET } = require_constants(); var isPathSeparator = (code) => { return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; }; var depth = (token) => { if (token.isPrefix !== true) { token.depth = token.isGlobstar ? Infinity : 1; } }; var scan = (input, options) => { const opts = options || {}; const length = input.length - 1; const scanToEnd = opts.parts === true || opts.scanToEnd === true; const slashes = []; const tokens = []; const parts = []; let str = input; let index = -1; let start = 0; let lastIndex = 0; let isBrace = false; let isBracket = false; let isGlob = false; let isExtglob = false; let isGlobstar = false; let braceEscaped = false; let backslashes = false; let negated = false; let finished = false; let braces = 0; let prev; let code; let token = {value: "", depth: 0, isGlob: false}; const eos = () => index >= length; const peek = () => str.charCodeAt(index + 1); const advance = () => { prev = code; return str.charCodeAt(++index); }; while (index < length) { code = advance(); let next; if (code === CHAR_BACKWARD_SLASH) { backslashes = token.backslashes = true; code = advance(); if (code === CHAR_LEFT_CURLY_BRACE) { braceEscaped = true; } continue; } if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) { braces++; while (eos() !== true && (code = advance())) { if (code === CHAR_BACKWARD_SLASH) { backslashes = token.backslashes = true; advance(); continue; } if (code === CHAR_LEFT_CURLY_BRACE) { braces++; continue; } if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) { isBrace = token.isBrace = true; isGlob = token.isGlob = true; finished = true; if (scanToEnd === true) { continue; } break; } if (braceEscaped !== true && code === CHAR_COMMA) { isBrace = token.isBrace = true; isGlob = token.isGlob = true; finished = true; if (scanToEnd === true) { continue; } break; } if (code === CHAR_RIGHT_CURLY_BRACE) { braces--; if (braces === 0) { braceEscaped = false; isBrace = token.isBrace = true; finished = true; break; } } } if (scanToEnd === true) { continue; } break; } if (code === CHAR_FORWARD_SLASH) { slashes.push(index); tokens.push(token); token = {value: "", depth: 0, isGlob: false}; if (finished === true) continue; if (prev === CHAR_DOT && index === start + 1) { start += 2; continue; } lastIndex = index + 1; continue; } if (opts.noext !== true) { const isExtglobChar = code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK; if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) { isGlob = token.isGlob = true; isExtglob = token.isExtglob = true; finished = true; if (scanToEnd === true) { while (eos() !== true && (code = advance())) { if (code === CHAR_BACKWARD_SLASH) { backslashes = token.backslashes = true; code = advance(); continue; } if (code === CHAR_RIGHT_PARENTHESES) { isGlob = token.isGlob = true; finished = true; break; } } continue; } break; } } if (code === CHAR_ASTERISK) { if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true; isGlob = token.isGlob = true; finished = true; if (scanToEnd === true) { continue; } break; } if (code === CHAR_QUESTION_MARK) { isGlob = token.isGlob = true; finished = true; if (scanToEnd === true) { continue; } break; } if (code === CHAR_LEFT_SQUARE_BRACKET) { while (eos() !== true && (next = advance())) { if (next === CHAR_BACKWARD_SLASH) { backslashes = token.backslashes = true; advance(); continue; } if (next === CHAR_RIGHT_SQUARE_BRACKET) { isBracket = token.isBracket = true; isGlob = token.isGlob = true; finished = true; if (scanToEnd === true) { continue; } break; } } } if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) { negated = token.negated = true; start++; continue; } if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) { isGlob = token.isGlob = true; if (scanToEnd === true) { while (eos() !== true && (code = advance())) { if (code === CHAR_LEFT_PARENTHESES) { backslashes = token.backslashes = true; code = advance(); continue; } if (code === CHAR_RIGHT_PARENTHESES) { finished = true; break; } } continue; } break; } if (isGlob === true) { finished = true; if (scanToEnd === true) { continue; } break; } } if (opts.noext === true) { isExtglob = false; isGlob = false; } let base = str; let prefix = ""; let glob = ""; if (start > 0) { prefix = str.slice(0, start); str = str.slice(start); lastIndex -= start; } if (base && isGlob === true && lastIndex > 0) { base = str.slice(0, lastIndex); glob = str.slice(lastIndex); } else if (isGlob === true) { base = ""; glob = str; } else { base = str; } if (base && base !== "" && base !== "/" && base !== str) { if (isPathSeparator(base.charCodeAt(base.length - 1))) { base = base.slice(0, -1); } } if (opts.unescape === true) { if (glob) glob = utils.removeBackslashes(glob); if (base && backslashes === true) { base = utils.removeBackslashes(base); } } const state = { prefix, input, start, base, glob, isBrace, isBracket, isGlob, isExtglob, isGlobstar, negated }; if (opts.tokens === true) { state.maxDepth = 0; if (!isPathSeparator(code)) { tokens.push(token); } state.tokens = tokens; } if (opts.parts === true || opts.tokens === true) { let prevIndex; for (let idx = 0; idx < slashes.length; idx++) { const n = prevIndex ? prevIndex + 1 : start; const i = slashes[idx]; const value = input.slice(n, i); if (opts.tokens) { if (idx === 0 && start !== 0) { tokens[idx].isPrefix = true; tokens[idx].value = prefix; } else { tokens[idx].value = value; } depth(tokens[idx]); state.maxDepth += tokens[idx].depth; } if (idx !== 0 || value !== "") { parts.push(value); } prevIndex = i; } if (prevIndex && prevIndex + 1 < input.length) { const value = input.slice(prevIndex + 1); parts.push(value); if (opts.tokens) { tokens[tokens.length - 1].value = value; depth(tokens[tokens.length - 1]); state.maxDepth += tokens[tokens.length - 1].depth; } } state.slashes = slashes; state.parts = parts; } return state; }; module2.exports = scan; }); // node_modules/picomatch/lib/parse.js var require_parse = __commonJS((exports2, module2) => { "use strict"; var constants = require_constants(); var utils = require_utils(); var { MAX_LENGTH, POSIX_REGEX_SOURCE, REGEX_NON_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_BACKREF, REPLACEMENTS } = constants; var expandRange = (args, options) => { if (typeof options.expandRange === "function") { return options.expandRange(...args, options); } args.sort(); const value = `[${args.join("-")}]`; try { new RegExp(value); } catch (ex) { return args.map((v) => utils.escapeRegex(v)).join(".."); } return value; }; var syntaxError = (type, char) => { return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; }; var parse = (input, options) => { if (typeof input !== "string") { throw new TypeError("Expected a string"); } input = REPLACEMENTS[input] || input; const opts = {...options}; const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; let len = input.length; if (len > max) { throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); } const bos = {type: "bos", value: "", output: opts.prepend || ""}; const tokens = [bos]; const capture = opts.capture ? "" : "?:"; const win32 = utils.isWindows(options); const PLATFORM_CHARS = constants.globChars(win32); const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS); const { DOT_LITERAL, PLUS_LITERAL, SLASH_LITERAL, ONE_CHAR, DOTS_SLASH, NO_DOT, NO_DOT_SLASH, NO_DOTS_SLASH, QMARK, QMARK_NO_DOT, STAR, START_ANCHOR } = PLATFORM_CHARS; const globstar = (opts2) => { return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; }; const nodot = opts.dot ? "" : NO_DOT; const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; let star = opts.bash === true ? globstar(opts) : STAR; if (opts.capture) { star = `(${star})`; } if (typeof opts.noext === "boolean") { opts.noextglob = opts.noext; } const state = { input, index: -1, start: 0, dot: opts.dot === true, consumed: "", output: "", prefix: "", backtrack: false, negated: false, brackets: 0, braces: 0, parens: 0, quotes: 0, globstar: false, tokens }; input = utils.removePrefix(input, state); len = input.length; const extglobs = []; const braces = []; const stack = []; let prev = bos; let value; const eos = () => state.index === len - 1; const peek = state.peek = (n = 1) => input[state.index + n]; const advance = state.advance = () => input[++state.index]; const remaining = () => input.slice(state.index + 1); const consume = (value2 = "", num = 0) => { state.consumed += value2; state.index += num; }; const append = (token) => { state.output += token.output != null ? token.output : token.value; consume(token.value); }; const negate = () => { let count = 1; while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) { advance(); state.start++; count++; } if (count % 2 === 0) { return false; } state.negated = true; state.start++; return true; }; const increment = (type) => { state[type]++; stack.push(type); }; const decrement = (type) => { state[type]--; stack.pop(); }; const push = (tok) => { if (prev.type === "globstar") { const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace"); const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren"); if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) { state.output = state.output.slice(0, -prev.output.length); prev.type = "star"; prev.value = "*"; prev.output = star; state.output += prev.output; } } if (extglobs.length && tok.type !== "paren" && !EXTGLOB_CHARS[tok.value]) { extglobs[extglobs.length - 1].inner += tok.value; } if (tok.value || tok.output) append(tok); if (prev && prev.type === "text" && tok.type === "text") { prev.value += tok.value; prev.output = (prev.output || "") + tok.value; return; } tok.prev = prev; tokens.push(tok); prev = tok; }; const extglobOpen = (type, value2) => { const token = {...EXTGLOB_CHARS[value2], conditions: 1, inner: ""}; token.prev = prev; token.parens = state.parens; token.output = state.output; const output = (opts.capture ? "(" : "") + token.open; increment("parens"); push({type, value: value2, output: state.output ? "" : ONE_CHAR}); push({type: "paren", extglob: true, value: advance(), output}); extglobs.push(token); }; const extglobClose = (token) => { let output = token.close + (opts.capture ? ")" : ""); if (token.type === "negate") { let extglobStar = star; if (token.inner && token.inner.length > 1 && token.inner.includes("/")) { extglobStar = globstar(opts); } if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { output = token.close = `)$))${extglobStar}`; } if (token.prev.type === "bos" && eos()) { state.negatedExtglob = true; } } push({type: "paren", extglob: true, value, output}); decrement("parens"); }; if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { let backslashes = false; let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => { if (first === "\\") { backslashes = true; return m; } if (first === "?") { if (esc) { return esc + first + (rest ? QMARK.repeat(rest.length) : ""); } if (index === 0) { return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ""); } return QMARK.repeat(chars.length); } if (first === ".") { return DOT_LITERAL.repeat(chars.length); } if (first === "*") { if (esc) { return esc + first + (rest ? star : ""); } return star; } return esc ? m : `\\${m}`; }); if (backslashes === true) { if (opts.unescape === true) { output = output.replace(/\\/g, ""); } else { output = output.replace(/\\+/g, (m) => { return m.length % 2 === 0 ? "\\\\" : m ? "\\" : ""; }); } } if (output === input && opts.contains === true) { state.output = input; return state; } state.output = utils.wrapOutput(output, state, options); return state; } while (!eos()) { value = advance(); if (value === "\0") { continue; } if (value === "\\") { const next = peek(); if (next === "/" && opts.bash !== true) { continue; } if (next === "." || next === ";") { continue; } if (!next) { value += "\\"; push({type: "text", value}); continue; } const match = /^\\+/.exec(remaining()); let slashes = 0; if (match && match[0].length > 2) { slashes = match[0].length; state.index += slashes; if (slashes % 2 !== 0) { value += "\\"; } } if (opts.unescape === true) { value = advance() || ""; } else { value += advance() || ""; } if (state.brackets === 0) { push({type: "text", value}); continue; } } if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) { if (opts.posix !== false && value === ":") { const inner = prev.value.slice(1); if (inner.includes("[")) { prev.posix = true; if (inner.includes(":")) { const idx = prev.value.lastIndexOf("["); const pre = prev.value.slice(0, idx); const rest2 = prev.value.slice(idx + 2); const posix = POSIX_REGEX_SOURCE[rest2]; if (posix) { prev.value = pre + posix; state.backtrack = true; advance(); if (!bos.output && tokens.indexOf(prev) === 1) { bos.output = ONE_CHAR; } continue; } } } } if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") { value = `\\${value}`; } if (value === "]" && (prev.value === "[" || prev.value === "[^")) { value = `\\${value}`; } if (opts.posix === true && value === "!" && prev.value === "[") { value = "^"; } prev.value += value; append({value}); continue; } if (state.quotes === 1 && value !== '"') { value = utils.escapeRegex(value); prev.value += value; append({value}); continue; } if (value === '"') { state.quotes = state.quotes === 1 ? 0 : 1; if (opts.keepQuotes === true) { push({type: "text", value}); } continue; } if (value === "(") { increment("parens"); push({type: "paren", value}); continue; } if (value === ")") { if (state.parens === 0 && opts.strictBrackets === true) { throw new SyntaxError(syntaxError("opening", "(")); } const extglob = extglobs[extglobs.length - 1]; if (extglob && state.parens === extglob.parens + 1) { extglobClose(extglobs.pop()); continue; } push({type: "paren", value, output: state.parens ? ")" : "\\)"}); decrement("parens"); continue; } if (value === "[") { if (opts.nobracket === true || !remaining().includes("]")) { if (opts.nobracket !== true && opts.strictBrackets === true) { throw new SyntaxError(syntaxError("closing", "]")); } value = `\\${value}`; } else { increment("brackets"); } push({type: "bracket", value}); continue; } if (value === "]") { if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) { push({type: "text", value, output: `\\${value}`}); continue; } if (state.brackets === 0) { if (opts.strictBrackets === true) { throw new SyntaxError(syntaxError("opening", "[")); } push({type: "text", value, output: `\\${value}`}); continue; } decrement("brackets"); const prevValue = prev.value.slice(1); if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) { value = `/${value}`; } prev.value += value; append({value}); if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) { continue; } const escaped = utils.escapeRegex(prev.value); state.output = state.output.slice(0, -prev.value.length); if (opts.literalBrackets === true) { state.output += escaped; prev.value = escaped; continue; } prev.value = `(${capture}${escaped}|${prev.value})`; state.output += prev.value; continue; } if (value === "{" && opts.nobrace !== true) { increment("braces"); const open = { type: "brace", value, output: "(", outputIndex: state.output.length, tokensIndex: state.tokens.length }; braces.push(open); push(open); continue; } if (value === "}") { const brace = braces[braces.length - 1]; if (opts.nobrace === true || !brace) { push({type: "text", value, output: value}); continue; } let output = ")"; if (brace.dots === true) { const arr = tokens.slice(); const range = []; for (let i = arr.length - 1; i >= 0; i--) { tokens.pop(); if (arr[i].type === "brace") { break; } if (arr[i].type !== "dots") { range.unshift(arr[i].value); } } output = expandRange(range, opts); state.backtrack = true; } if (brace.comma !== true && brace.dots !== true) { const out = state.output.slice(0, brace.outputIndex); const toks = state.tokens.slice(brace.tokensIndex); brace.value = brace.output = "\\{"; value = output = "\\}"; state.output = out; for (const t of toks) { state.output += t.output || t.value; } } push({type: "brace", value, output}); decrement("braces"); braces.pop(); continue; } if (value === "|") { if (extglobs.length > 0) { extglobs[extglobs.length - 1].conditions++; } push({type: "text", value}); continue; } if (value === ",") { let output = value; const brace = braces[braces.length - 1]; if (brace && stack[stack.length - 1] === "braces") { brace.comma = true; output = "|"; } push({type: "comma", value, output}); continue; } if (value === "/") { if (prev.type === "dot" && state.index === state.start + 1) { state.start = state.index + 1; state.consumed = ""; state.output = ""; tokens.pop(); prev = bos; continue; } push({type: "slash", value, output: SLASH_LITERAL}); continue; } if (value === ".") { if (state.braces > 0 && prev.type === "dot") { if (prev.value === ".") prev.output = DOT_LITERAL; const brace = braces[braces.length - 1]; prev.type = "dots"; prev.output += value; prev.value += value; brace.dots = true; continue; } if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") { push({type: "text", value, output: DOT_LITERAL}); continue; } push({type: "dot", value, output: DOT_LITERAL}); continue; } if (value === "?") { const isGroup = prev && prev.value === "("; if (!isGroup && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") { extglobOpen("qmark", value); continue; } if (prev && prev.type === "paren") { const next = peek(); let output = value; if (next === "<" && !utils.supportsLookbehinds()) { throw new Error("Node.js v10 or higher is required for regex lookbehinds"); } if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) { output = `\\${value}`; } push({type: "text", value, output}); continue; } if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) { push({type: "qmark", value, output: QMARK_NO_DOT}); continue; } push({type: "qmark", value, output: QMARK}); continue; } if (value === "!") { if (opts.noextglob !== true && peek() === "(") { if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) { extglobOpen("negate", value); continue; } } if (opts.nonegate !== true && state.index === 0) { negate(); continue; } } if (value === "+") { if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") { extglobOpen("plus", value); continue; } if (prev && prev.value === "(" || opts.regex === false) { push({type: "plus", value, output: PLUS_LITERAL}); continue; } if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) { push({type: "plus", value}); continue; } push({type: "plus", value: PLUS_LITERAL}); continue; } if (value === "@") { if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") { push({type: "at", extglob: true, value, output: ""}); continue; } push({type: "text", value}); continue; } if (value !== "*") { if (value === "$" || value === "^") { value = `\\${value}`; } const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); if (match) { value += match[0]; state.index += match[0].length; } push({type: "text", value}); continue; } if (prev && (prev.type === "globstar" || prev.star === true)) { prev.type = "star"; prev.star = true; prev.value += value; prev.output = star; state.backtrack = true; state.globstar = true; consume(value); continue; } let rest = remaining(); if (opts.noextglob !== true && /^\([^?]/.test(rest)) { extglobOpen("star", value); continue; } if (prev.type === "star") { if (opts.noglobstar === true) { consume(value); continue; } const prior = prev.prev; const before = prior.prev; const isStart = prior.type === "slash" || prior.type === "bos"; const afterStar = before && (before.type === "star" || before.type === "globstar"); if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) { push({type: "star", value, output: ""}); continue; } const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace"); const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren"); if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) { push({type: "star", value, output: ""}); continue; } while (rest.slice(0, 3) === "/**") { const after = input[state.index + 4]; if (after && after !== "/") { break; } rest = rest.slice(3); consume("/**", 3); } if (prior.type === "bos" && eos()) { prev.type = "globstar"; prev.value += value; prev.output = globstar(opts); state.output = prev.output; state.globstar = true; consume(value); continue; } if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) { state.output = state.output.slice(0, -(prior.output + prev.output).length); prior.output = `(?:${prior.output}`; prev.type = "globstar"; prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)"); prev.value += value; state.globstar = true; state.output += prior.output + prev.output; consume(value); continue; } if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") { const end = rest[1] !== void 0 ? "|$" : ""; state.output = state.output.slice(0, -(prior.output + prev.output).length); prior.output = `(?:${prior.output}`; prev.type = "globstar"; prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`; prev.value += value; state.output += prior.output + prev.output; state.globstar = true; consume(value + advance()); push({type: "slash", value: "/", output: ""}); continue; } if (prior.type === "bos" && rest[0] === "/") { prev.type = "globstar"; prev.value += value; prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`; state.output = prev.output; state.globstar = true; consume(value + advance()); push({type: "slash", value: "/", output: ""}); continue; } state.output = state.output.slice(0, -prev.output.length); prev.type = "globstar"; prev.output = globstar(opts); prev.value += value; state.output += prev.output; state.globstar = true; consume(value); continue; } const token = {type: "star", value, output: star}; if (opts.bash === true) { token.output = ".*?"; if (prev.type === "bos" || prev.type === "slash") { token.output = nodot + token.output; } push(token); continue; } if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) { token.output = value; push(token); continue; } if (state.index === state.start || prev.type === "slash" || prev.type === "dot") { if (prev.type === "dot") { state.output += NO_DOT_SLASH; prev.output += NO_DOT_SLASH; } else if (opts.dot === true) { state.output += NO_DOTS_SLASH; prev.output += NO_DOTS_SLASH; } else { state.output += nodot; prev.output += nodot; } if (peek() !== "*") { state.output += ONE_CHAR; prev.output += ONE_CHAR; } } push(token); } while (state.brackets > 0) { if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "]")); state.output = utils.escapeLast(state.output, "["); decrement("brackets"); } while (state.parens > 0) { if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", ")")); state.output = utils.escapeLast(state.output, "("); decrement("parens"); } while (state.braces > 0) { if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "}")); state.output = utils.escapeLast(state.output, "{"); decrement("braces"); } if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) { push({type: "maybe_slash", value: "", output: `${SLASH_LITERAL}?`}); } if (state.backtrack === true) { state.output = ""; for (const token of state.tokens) { state.output += token.output != null ? token.output : token.value; if (token.suffix) { state.output += token.suffix; } } } return state; }; parse.fastpaths = (input, options) => { const opts = {...options}; const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; const len = input.length; if (len > max) { throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); } input = REPLACEMENTS[input] || input; const win32 = utils.isWindows(options); const { DOT_LITERAL, SLASH_LITERAL, ONE_CHAR, DOTS_SLASH, NO_DOT, NO_DOTS, NO_DOTS_SLASH, STAR, START_ANCHOR } = constants.globChars(win32); const nodot = opts.dot ? NO_DOTS : NO_DOT; const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; const capture = opts.capture ? "" : "?:"; const state = {negated: false, prefix: ""}; let star = opts.bash === true ? ".*?" : STAR; if (opts.capture) { star = `(${star})`; } const globstar = (opts2) => { if (opts2.noglobstar === true) return star; return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; }; const create = (str) => { switch (str) { case "*": return `${nodot}${ONE_CHAR}${star}`; case ".*": return `${DOT_LITERAL}${ONE_CHAR}${star}`; case "*.*": return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; case "*/*": return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; case "**": return nodot + globstar(opts); case "**/*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; case "**/*.*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; case "**/.*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; default: { const match = /^(.*?)\.(\w+)$/.exec(str); if (!match) return; const source2 = create(match[1]); if (!source2) return; return source2 + DOT_LITERAL + match[2]; } } }; const output = utils.removePrefix(input, state); let source = create(output); if (source && opts.strictSlashes !== true) { source += `${SLASH_LITERAL}?`; } return source; }; module2.exports = parse; }); // node_modules/picomatch/lib/picomatch.js var require_picomatch = __commonJS((exports2, module2) => { "use strict"; var path = require("path"); var scan = require_scan(); var parse = require_parse(); var utils = require_utils(); var constants = require_constants(); var isObject3 = (val) => val && typeof val === "object" && !Array.isArray(val); var picomatch = (glob, options, returnState = false) => { if (Array.isArray(glob)) { const fns = glob.map((input) => picomatch(input, options, returnState)); const arrayMatcher = (str) => { for (const isMatch of fns) { const state2 = isMatch(str); if (state2) return state2; } return false; }; return arrayMatcher; } const isState = isObject3(glob) && glob.tokens && glob.input; if (glob === "" || typeof glob !== "string" && !isState) { throw new TypeError("Expected pattern to be a non-empty string"); } const opts = options || {}; const posix = utils.isWindows(options); const regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true); const state = regex.state; delete regex.state; let isIgnored = () => false; if (opts.ignore) { const ignoreOpts = {...options, ignore: null, onMatch: null, onResult: null}; isIgnored = picomatch(opts.ignore, ignoreOpts, returnState); } const matcher = (input, returnObject = false) => { const {isMatch, match, output} = picomatch.test(input, regex, options, {glob, posix}); const result = {glob, state, regex, posix, input, output, match, isMatch}; if (typeof opts.onResult === "function") { opts.onResult(result); } if (isMatch === false) { result.isMatch = false; return returnObject ? result : false; } if (isIgnored(input)) { if (typeof opts.onIgnore === "function") { opts.onIgnore(result); } result.isMatch = false; return returnObject ? result : false; } if (typeof opts.onMatch === "function") { opts.onMatch(result); } return returnObject ? result : true; }; if (returnState) { matcher.state = state; } return matcher; }; picomatch.test = (input, regex, options, {glob, posix} = {}) => { if (typeof input !== "string") { throw new TypeError("Expected input to be a string"); } if (input === "") { return {isMatch: false, output: ""}; } const opts = options || {}; const format = opts.format || (posix ? utils.toPosixSlashes : null); let match = input === glob; let output = match && format ? format(input) : input; if (match === false) { output = format ? format(input) : input; match = output === glob; } if (match === false || opts.capture === true) { if (opts.matchBase === true || opts.basename === true) { match = picomatch.matchBase(input, regex, options, posix); } else { match = regex.exec(output); } } return {isMatch: Boolean(match), match, output}; }; picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => { const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options); return regex.test(path.basename(input)); }; picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); picomatch.parse = (pattern, options) => { if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options)); return parse(pattern, {...options, fastpaths: false}); }; picomatch.scan = (input, options) => scan(input, options); picomatch.compileRe = (parsed, options, returnOutput = false, returnState = false) => { if (returnOutput === true) { return parsed.output; } const opts = options || {}; const prepend = opts.contains ? "" : "^"; const append = opts.contains ? "" : "$"; let source = `${prepend}(?:${parsed.output})${append}`; if (parsed && parsed.negated === true) { source = `^(?!${source}).*$`; } const regex = picomatch.toRegex(source, options); if (returnState === true) { regex.state = parsed; } return regex; }; picomatch.makeRe = (input, options, returnOutput = false, returnState = false) => { if (!input || typeof input !== "string") { throw new TypeError("Expected a non-empty string"); } const opts = options || {}; let parsed = {negated: false, fastpaths: true}; let prefix = ""; let output; if (input.startsWith("./")) { input = input.slice(2); prefix = parsed.prefix = "./"; } if (opts.fastpaths !== false && (input[0] === "." || input[0] === "*")) { output = parse.fastpaths(input, options); } if (output === void 0) { parsed = parse(input, options); parsed.prefix = prefix + (parsed.prefix || ""); } else { parsed.output = output; } return picomatch.compileRe(parsed, options, returnOutput, returnState); }; picomatch.toRegex = (source, options) => { try { const opts = options || {}; return new RegExp(source, opts.flags || (opts.nocase ? "i" : "")); } catch (err) { if (options && options.debug === true) throw err; return /$^/; } }; picomatch.constants = constants; module2.exports = picomatch; }); // node_modules/picomatch/index.js var require_picomatch2 = __commonJS((exports2, module2) => { "use strict"; module2.exports = require_picomatch(); }); // node_modules/readdirp/index.js var require_readdirp = __commonJS((exports2, module2) => { "use strict"; var fs = require("fs"); var {Readable} = require("stream"); var sysPath = require("path"); var {promisify} = require("util"); var picomatch = require_picomatch2(); var readdir = promisify(fs.readdir); var stat = promisify(fs.stat); var lstat = promisify(fs.lstat); var realpath = promisify(fs.realpath); var BANG = "!"; var NORMAL_FLOW_ERRORS = new Set(["ENOENT", "EPERM", "EACCES", "ELOOP"]); var FILE_TYPE = "files"; var DIR_TYPE = "directories"; var FILE_DIR_TYPE = "files_directories"; var EVERYTHING_TYPE = "all"; var ALL_TYPES = [FILE_TYPE, DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE]; var isNormalFlowError = (error) => NORMAL_FLOW_ERRORS.has(error.code); var normalizeFilter = (filter) => { if (filter === void 0) return; if (typeof filter === "function") return filter; if (typeof filter === "string") { const glob = picomatch(filter.trim()); return (entry) => glob(entry.basename); } if (Array.isArray(filter)) { const positive = []; const negative = []; for (const item of filter) { const trimmed = item.trim(); if (trimmed.charAt(0) === BANG) { negative.push(picomatch(trimmed.slice(1))); } else { positive.push(picomatch(trimmed)); } } if (negative.length > 0) { if (positive.length > 0) { return (entry) => positive.some((f) => f(entry.basename)) && !negative.some((f) => f(entry.basename)); } return (entry) => !negative.some((f) => f(entry.basename)); } return (entry) => positive.some((f) => f(entry.basename)); } }; var ReaddirpStream = class extends Readable { static get defaultOptions() { return { root: ".", fileFilter: (path) => true, directoryFilter: (path) => true, type: FILE_TYPE, lstat: false, depth: 2147483648, alwaysStat: false }; } constructor(options = {}) { super({ objectMode: true, autoDestroy: true, highWaterMark: options.highWaterMark || 4096 }); const opts = {...ReaddirpStream.defaultOptions, ...options}; const {root, type} = opts; this._fileFilter = normalizeFilter(opts.fileFilter); this._directoryFilter = normalizeFilter(opts.directoryFilter); const statMethod = opts.lstat ? lstat : stat; if (process.platform === "win32" && stat.length === 3) { this._stat = (path) => statMethod(path, {bigint: true}); } else { this._stat = statMethod; } this._maxDepth = opts.depth; this._wantsDir = [DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type); this._wantsFile = [FILE_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type); this._wantsEverything = type === EVERYTHING_TYPE; this._root = sysPath.resolve(root); this._isDirent = "Dirent" in fs && !opts.alwaysStat; this._statsProp = this._isDirent ? "dirent" : "stats"; this._rdOptions = {encoding: "utf8", withFileTypes: this._isDirent}; this.parents = [this._exploreDir(root, 1)]; this.reading = false; this.parent = void 0; } async _read(batch) { if (this.reading) return; this.reading = true; try { while (!this.destroyed && batch > 0) { const {path, depth, files = []} = this.parent || {}; if (files.length > 0) { const slice = files.splice(0, batch).map((dirent) => this._formatEntry(dirent, path)); for (const entry of await Promise.all(slice)) { if (this.destroyed) return; const entryType = await this._getEntryType(entry); if (entryType === "directory" && this._directoryFilter(entry)) { if (depth <= this._maxDepth) { this.parents.push(this._exploreDir(entry.fullPath, depth + 1)); } if (this._wantsDir) { this.push(entry); batch--; } } else if ((entryType === "file" || this._includeAsFile(entry)) && this._fileFilter(entry)) { if (this._wantsFile) { this.push(entry); batch--; } } } } else { const parent = this.parents.pop(); if (!parent) { this.push(null); break; } this.parent = await parent; if (this.destroyed) return; } } } catch (error) { this.destroy(error); } finally { this.reading = false; } } async _exploreDir(path, depth) { let files; try { files = await readdir(path, this._rdOptions); } catch (error) { this._onError(error); } return {files, depth, path}; } async _formatEntry(dirent, path) { let entry; try { const basename2 = this._isDirent ? dirent.name : dirent; const fullPath = sysPath.resolve(sysPath.join(path, basename2)); entry = {path: sysPath.relative(this._root, fullPath), fullPath, basename: basename2}; entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath); } catch (err) { this._onError(err); } return entry; } _onError(err) { if (isNormalFlowError(err) && !this.destroyed) { this.emit("warn", err); } else { this.destroy(err); } } async _getEntryType(entry) { const stats = entry && entry[this._statsProp]; if (!stats) { return; } if (stats.isFile()) { return "file"; } if (stats.isDirectory()) { return "directory"; } if (stats && stats.isSymbolicLink()) { try { const entryRealPath = await realpath(entry.fullPath); const entryRealPathStats = await lstat(entryRealPath); if (entryRealPathStats.isFile()) { return "file"; } if (entryRealPathStats.isDirectory()) { return "directory"; } } catch (error) { this._onError(error); } } } _includeAsFile(entry) { const stats = entry && entry[this._statsProp]; return stats && this._wantsEverything && !stats.isDirectory(); } }; var readdirp = (root, options = {}) => { let type = options.entryType || options.type; if (type === "both") type = FILE_DIR_TYPE; if (type) options.type = type; if (!root) { throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)"); } else if (typeof root !== "string") { throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)"); } else if (type && !ALL_TYPES.includes(type)) { throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(", ")}`); } options.root = root; return new ReaddirpStream(options); }; var readdirpPromise = (root, options = {}) => { return new Promise((resolve, reject) => { const files = []; readdirp(root, options).on("data", (entry) => files.push(entry)).on("end", () => resolve(files)).on("error", (error) => reject(error)); }); }; readdirp.promise = readdirpPromise; readdirp.ReaddirpStream = ReaddirpStream; readdirp.default = readdirp; module2.exports = readdirp; }); // node_modules/fs.realpath/old.js var require_old = __commonJS((exports2) => { var pathModule = require("path"); var isWindows = process.platform === "win32"; var fs = require("fs"); var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); function rethrow() { var callback; if (DEBUG) { var backtrace = new Error(); callback = debugCallback; } else callback = missingCallback; return callback; function debugCallback(err) { if (err) { backtrace.message = err.message; err = backtrace; missingCallback(err); } } function missingCallback(err) { if (err) { if (process.throwDeprecation) throw err; else if (!process.noDeprecation) { var msg = "fs: missing callback " + (err.stack || err.message); if (process.traceDeprecation) console.trace(msg); else console.error(msg); } } } } function maybeCallback(cb) { return typeof cb === "function" ? cb : rethrow(); } var normalize = pathModule.normalize; if (isWindows) { nextPartRe = /(.*?)(?:[\/\\]+|$)/g; } else { nextPartRe = /(.*?)(?:[\/]+|$)/g; } var nextPartRe; if (isWindows) { splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; } else { splitRootRe = /^[\/]*/; } var splitRootRe; exports2.realpathSync = function realpathSync(p, cache) { p = pathModule.resolve(p); if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { return cache[p]; } var original = p, seenLinks = {}, knownHard = {}; var pos; var current; var base; var previous; start(); function start() { var m = splitRootRe.exec(p); pos = m[0].length; current = m[0]; base = m[0]; previous = ""; if (isWindows && !knownHard[base]) { fs.lstatSync(base); knownHard[base] = true; } } while (pos < p.length) { nextPartRe.lastIndex = pos; var result = nextPartRe.exec(p); previous = current; current += result[0]; base = previous + result[1]; pos = nextPartRe.lastIndex; if (knownHard[base] || cache && cache[base] === base) { continue; } var resolvedLink; if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { resolvedLink = cache[base]; } else { var stat = fs.lstatSync(base); if (!stat.isSymbolicLink()) { knownHard[base] = true; if (cache) cache[base] = base; continue; } var linkTarget = null; if (!isWindows) { var id = stat.dev.toString(32) + ":" + stat.ino.toString(32); if (seenLinks.hasOwnProperty(id)) { linkTarget = seenLinks[id]; } } if (linkTarget === null) { fs.statSync(base); linkTarget = fs.readlinkSync(base); } resolvedLink = pathModule.resolve(previous, linkTarget); if (cache) cache[base] = resolvedLink; if (!isWindows) seenLinks[id] = linkTarget; } p = pathModule.resolve(resolvedLink, p.slice(pos)); start(); } if (cache) cache[original] = p; return p; }; exports2.realpath = function realpath(p, cache, cb) { if (typeof cb !== "function") { cb = maybeCallback(cache); cache = null; } p = pathModule.resolve(p); if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { return process.nextTick(cb.bind(null, null, cache[p])); } var original = p, seenLinks = {}, knownHard = {}; var pos; var current; var base; var previous; start(); function start() { var m = splitRootRe.exec(p); pos = m[0].length; current = m[0]; base = m[0]; previous = ""; if (isWindows && !knownHard[base]) { fs.lstat(base, function(err) { if (err) return cb(err); knownHard[base] = true; LOOP(); }); } else { process.nextTick(LOOP); } } function LOOP() { if (pos >= p.length) { if (cache) cache[original] = p; return cb(null, p); } nextPartRe.lastIndex = pos; var result = nextPartRe.exec(p); previous = current; current += result[0]; base = previous + result[1]; pos = nextPartRe.lastIndex; if (knownHard[base] || cache && cache[base] === base) { return process.nextTick(LOOP); } if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { return gotResolvedLink(cache[base]); } return fs.lstat(base, gotStat); } function gotStat(err, stat) { if (err) return cb(err); if (!stat.isSymbolicLink()) { knownHard[base] = true; if (cache) cache[base] = base; return process.nextTick(LOOP); } if (!isWindows) { var id = stat.dev.toString(32) + ":" + stat.ino.toString(32); if (seenLinks.hasOwnProperty(id)) { return gotTarget(null, seenLinks[id], base); } } fs.stat(base, function(err2) { if (err2) return cb(err2); fs.readlink(base, function(err3, target) { if (!isWindows) seenLinks[id] = target; gotTarget(err3, target); }); }); } function gotTarget(err, target, base2) { if (err) return cb(err); var resolvedLink = pathModule.resolve(previous, target); if (cache) cache[base2] = resolvedLink; gotResolvedLink(resolvedLink); } function gotResolvedLink(resolvedLink) { p = pathModule.resolve(resolvedLink, p.slice(pos)); start(); } }; }); // node_modules/fs.realpath/index.js var require_fs = __commonJS((exports2, module2) => { module2.exports = realpath; realpath.realpath = realpath; realpath.sync = realpathSync; realpath.realpathSync = realpathSync; realpath.monkeypatch = monkeypatch; realpath.unmonkeypatch = unmonkeypatch; var fs = require("fs"); var origRealpath = fs.realpath; var origRealpathSync = fs.realpathSync; var version = process.version; var ok = /^v[0-5]\./.test(version); var old = require_old(); function newError(er) { return er && er.syscall === "realpath" && (er.code === "ELOOP" || er.code === "ENOMEM" || er.code === "ENAMETOOLONG"); } function realpath(p, cache, cb) { if (ok) { return origRealpath(p, cache, cb); } if (typeof cache === "function") { cb = cache; cache = null; } origRealpath(p, cache, function(er, result) { if (newError(er)) { old.realpath(p, cache, cb); } else { cb(er, result); } }); } function realpathSync(p, cache) { if (ok) { return origRealpathSync(p, cache); } try { return origRealpathSync(p, cache); } catch (er) { if (newError(er)) { return old.realpathSync(p, cache); } else { throw er; } } } function monkeypatch() { fs.realpath = realpath; fs.realpathSync = realpathSync; } function unmonkeypatch() { fs.realpath = origRealpath; fs.realpathSync = origRealpathSync; } }); // node_modules/concat-map/index.js var require_concat_map = __commonJS((exports2, module2) => { module2.exports = function(xs, fn) { var res = []; for (var i = 0; i < xs.length; i++) { var x = fn(xs[i], i); if (isArray(x)) res.push.apply(res, x); else res.push(x); } return res; }; var isArray = Array.isArray || function(xs) { return Object.prototype.toString.call(xs) === "[object Array]"; }; }); // node_modules/balanced-match/index.js var require_balanced_match = __commonJS((exports2, module2) => { "use strict"; module2.exports = balanced; function balanced(a, b, str) { if (a instanceof RegExp) a = maybeMatch(a, str); if (b instanceof RegExp) b = maybeMatch(b, str); var r = range(a, b, str); return r && { start: r[0], end: r[1], pre: str.slice(0, r[0]), body: str.slice(r[0] + a.length, r[1]), post: str.slice(r[1] + b.length) }; } function maybeMatch(reg, str) { var m = str.match(reg); return m ? m[0] : null; } balanced.range = range; function range(a, b, str) { var begs, beg, left, right, result; var ai = str.indexOf(a); var bi = str.indexOf(b, ai + 1); var i = ai; if (ai >= 0 && bi > 0) { begs = []; left = str.length; while (i >= 0 && !result) { if (i == ai) { begs.push(i); ai = str.indexOf(a, i + 1); } else if (begs.length == 1) { result = [begs.pop(), bi]; } else { beg = begs.pop(); if (beg < left) { left = beg; right = bi; } bi = str.indexOf(b, i + 1); } i = ai < bi && ai >= 0 ? ai : bi; } if (begs.length) { result = [left, right]; } } return result; } }); // node_modules/brace-expansion/index.js var require_brace_expansion = __commonJS((exports2, module2) => { var concatMap = require_concat_map(); var balanced = require_balanced_match(); module2.exports = expandTop; var escSlash = "\0SLASH" + Math.random() + "\0"; var escOpen = "\0OPEN" + Math.random() + "\0"; var escClose = "\0CLOSE" + Math.random() + "\0"; var escComma = "\0COMMA" + Math.random() + "\0"; var escPeriod = "\0PERIOD" + Math.random() + "\0"; function numeric(str) { return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0); } function escapeBraces(str) { return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); } function unescapeBraces(str) { return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); } function parseCommaParts(str) { if (!str) return [""]; var parts = []; var m = balanced("{", "}", str); if (!m) return str.split(","); var pre = m.pre; var body = m.body; var post = m.post; var p = pre.split(","); p[p.length - 1] += "{" + body + "}"; var postParts = parseCommaParts(post); if (post.length) { p[p.length - 1] += postParts.shift(); p.push.apply(p, postParts); } parts.push.apply(parts, p); return parts; } function expandTop(str) { if (!str) return []; if (str.substr(0, 2) === "{}") { str = "\\{\\}" + str.substr(2); } return expand(escapeBraces(str), true).map(unescapeBraces); } function embrace(str) { return "{" + str + "}"; } function isPadded(el) { return /^-?0\d/.test(el); } function lte(i, y) { return i <= y; } function gte(i, y) { return i >= y; } function expand(str, isTop) { var expansions = []; var m = balanced("{", "}", str); if (!m || /\$$/.test(m.pre)) return [str]; var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); var isSequence = isNumericSequence || isAlphaSequence; var isOptions = m.body.indexOf(",") >= 0; if (!isSequence && !isOptions) { if (m.post.match(/,.*\}/)) { str = m.pre + "{" + m.body + escClose + m.post; return expand(str); } return [str]; } var n; if (isSequence) { n = m.body.split(/\.\./); } else { n = parseCommaParts(m.body); if (n.length === 1) { n = expand(n[0], false).map(embrace); if (n.length === 1) { var post = m.post.length ? expand(m.post, false) : [""]; return post.map(function(p) { return m.pre + n[0] + p; }); } } } var pre = m.pre; var post = m.post.length ? expand(m.post, false) : [""]; var N; if (isSequence) { var x = numeric(n[0]); var y = numeric(n[1]); var width = Math.max(n[0].length, n[1].length); var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; var test = lte; var reverse = y < x; if (reverse) { incr *= -1; test = gte; } var pad = n.some(isPadded); N = []; for (var i = x; test(i, y); i += incr) { var c; if (isAlphaSequence) { c = String.fromCharCode(i); if (c === "\\") c = ""; } else { c = String(i); if (pad) { var need = width - c.length; if (need > 0) { var z = new Array(need + 1).join("0"); if (i < 0) c = "-" + z + c.slice(1); else c = z + c; } } } N.push(c); } } else { N = concatMap(n, function(el) { return expand(el, false); }); } for (var j = 0; j < N.length; j++) { for (var k = 0; k < post.length; k++) { var expansion = pre + N[j] + post[k]; if (!isTop || isSequence || expansion) expansions.push(expansion); } } return expansions; } }); // node_modules/minimatch/minimatch.js var require_minimatch = __commonJS((exports2, module2) => { module2.exports = minimatch; minimatch.Minimatch = Minimatch; var path = {sep: "/"}; try { path = require("path"); } catch (er) { } var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; var expand = require_brace_expansion(); var plTypes = { "!": {open: "(?:(?!(?:", close: "))[^/]*?)"}, "?": {open: "(?:", close: ")?"}, "+": {open: "(?:", close: ")+"}, "*": {open: "(?:", close: ")*"}, "@": {open: "(?:", close: ")"} }; var qmark = "[^/]"; var star = qmark + "*?"; var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; var reSpecials = charSet("().*{}+?[]^$\\!"); function charSet(s) { return s.split("").reduce(function(set, c) { set[c] = true; return set; }, {}); } var slashSplit = /\/+/; minimatch.filter = filter; function filter(pattern, options) { options = options || {}; return function(p, i, list) { return minimatch(p, pattern, options); }; } function ext(a, b) { a = a || {}; b = b || {}; var t = {}; Object.keys(b).forEach(function(k) { t[k] = b[k]; }); Object.keys(a).forEach(function(k) { t[k] = a[k]; }); return t; } minimatch.defaults = function(def) { if (!def || !Object.keys(def).length) return minimatch; var orig = minimatch; var m = function minimatch2(p, pattern, options) { return orig.minimatch(p, pattern, ext(def, options)); }; m.Minimatch = function Minimatch2(pattern, options) { return new orig.Minimatch(pattern, ext(def, options)); }; return m; }; Minimatch.defaults = function(def) { if (!def || !Object.keys(def).length) return Minimatch; return minimatch.defaults(def).Minimatch; }; function minimatch(p, pattern, options) { if (typeof pattern !== "string") { throw new TypeError("glob pattern string required"); } if (!options) options = {}; if (!options.nocomment && pattern.charAt(0) === "#") { return false; } if (pattern.trim() === "") return p === ""; return new Minimatch(pattern, options).match(p); } function Minimatch(pattern, options) { if (!(this instanceof Minimatch)) { return new Minimatch(pattern, options); } if (typeof pattern !== "string") { throw new TypeError("glob pattern string required"); } if (!options) options = {}; pattern = pattern.trim(); if (path.sep !== "/") { pattern = pattern.split(path.sep).join("/"); } this.options = options; this.set = []; this.pattern = pattern; this.regexp = null; this.negate = false; this.comment = false; this.empty = false; this.make(); } Minimatch.prototype.debug = function() { }; Minimatch.prototype.make = make; function make() { if (this._made) return; var pattern = this.pattern; var options = this.options; if (!options.nocomment && pattern.charAt(0) === "#") { this.comment = true; return; } if (!pattern) { this.empty = true; return; } this.parseNegate(); var set = this.globSet = this.braceExpand(); if (options.debug) this.debug = console.error; this.debug(this.pattern, set); set = this.globParts = set.map(function(s) { return s.split(slashSplit); }); this.debug(this.pattern, set); set = set.map(function(s, si, set2) { return s.map(this.parse, this); }, this); this.debug(this.pattern, set); set = set.filter(function(s) { return s.indexOf(false) === -1; }); this.debug(this.pattern, set); this.set = set; } Minimatch.prototype.parseNegate = parseNegate; function parseNegate() { var pattern = this.pattern; var negate = false; var options = this.options; var negateOffset = 0; if (options.nonegate) return; for (var i = 0, l = pattern.length; i < l && pattern.charAt(i) === "!"; i++) { negate = !negate; negateOffset++; } if (negateOffset) this.pattern = pattern.substr(negateOffset); this.negate = negate; } minimatch.braceExpand = function(pattern, options) { return braceExpand(pattern, options); }; Minimatch.prototype.braceExpand = braceExpand; function braceExpand(pattern, options) { if (!options) { if (this instanceof Minimatch) { options = this.options; } else { options = {}; } } pattern = typeof pattern === "undefined" ? this.pattern : pattern; if (typeof pattern === "undefined") { throw new TypeError("undefined pattern"); } if (options.nobrace || !pattern.match(/\{.*\}/)) { return [pattern]; } return expand(pattern); } Minimatch.prototype.parse = parse; var SUBPARSE = {}; function parse(pattern, isSub) { if (pattern.length > 1024 * 64) { throw new TypeError("pattern is too long"); } var options = this.options; if (!options.noglobstar && pattern === "**") return GLOBSTAR; if (pattern === "") return ""; var re = ""; var hasMagic = !!options.nocase; var escaping = false; var patternListStack = []; var negativeLists = []; var stateChar; var inClass = false; var reClassStart = -1; var classStart = -1; var patternStart = pattern.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)"; var self2 = this; function clearStateChar() { if (stateChar) { switch (stateChar) { case "*": re += star; hasMagic = true; break; case "?": re += qmark; hasMagic = true; break; default: re += "\\" + stateChar; break; } self2.debug("clearStateChar %j %j", stateChar, re); stateChar = false; } } for (var i = 0, len = pattern.length, c; i < len && (c = pattern.charAt(i)); i++) { this.debug("%s %s %s %j", pattern, i, re, c); if (escaping && reSpecials[c]) { re += "\\" + c; escaping = false; continue; } switch (c) { case "/": return false; case "\\": clearStateChar(); escaping = true; continue; case "?": case "*": case "+": case "@": case "!": this.debug("%s %s %s %j <-- stateChar", pattern, i, re, c); if (inClass) { this.debug(" in class"); if (c === "!" && i === classStart + 1) c = "^"; re += c; continue; } self2.debug("call clearStateChar %j", stateChar); clearStateChar(); stateChar = c; if (options.noext) clearStateChar(); continue; case "(": if (inClass) { re += "("; continue; } if (!stateChar) { re += "\\("; continue; } patternListStack.push({ type: stateChar, start: i - 1, reStart: re.length, open: plTypes[stateChar].open, close: plTypes[stateChar].close }); re += stateChar === "!" ? "(?:(?!(?:" : "(?:"; this.debug("plType %j %j", stateChar, re); stateChar = false; continue; case ")": if (inClass || !patternListStack.length) { re += "\\)"; continue; } clearStateChar(); hasMagic = true; var pl = patternListStack.pop(); re += pl.close; if (pl.type === "!") { negativeLists.push(pl); } pl.reEnd = re.length; continue; case "|": if (inClass || !patternListStack.length || escaping) { re += "\\|"; escaping = false; continue; } clearStateChar(); re += "|"; continue; case "[": clearStateChar(); if (inClass) { re += "\\" + c; continue; } inClass = true; classStart = i; reClassStart = re.length; re += c; continue; case "]": if (i === classStart + 1 || !inClass) { re += "\\" + c; escaping = false; continue; } if (inClass) { var cs = pattern.substring(classStart + 1, i); try { RegExp("[" + cs + "]"); } catch (er) { var sp = this.parse(cs, SUBPARSE); re = re.substr(0, reClassStart) + "\\[" + sp[0] + "\\]"; hasMagic = hasMagic || sp[1]; inClass = false; continue; } } hasMagic = true; inClass = false; re += c; continue; default: clearStateChar(); if (escaping) { escaping = false; } else if (reSpecials[c] && !(c === "^" && inClass)) { re += "\\"; } re += c; } } if (inClass) { cs = pattern.substr(classStart + 1); sp = this.parse(cs, SUBPARSE); re = re.substr(0, reClassStart) + "\\[" + sp[0]; hasMagic = hasMagic || sp[1]; } for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { var tail = re.slice(pl.reStart + pl.open.length); this.debug("setting tail", re, pl); tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function(_, $1, $2) { if (!$2) { $2 = "\\"; } return $1 + $1 + $2 + "|"; }); this.debug("tail=%j\n %s", tail, tail, pl, re); var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; hasMagic = true; re = re.slice(0, pl.reStart) + t + "\\(" + tail; } clearStateChar(); if (escaping) { re += "\\\\"; } var addPatternStart = false; switch (re.charAt(0)) { case ".": case "[": case "(": addPatternStart = true; } for (var n = negativeLists.length - 1; n > -1; n--) { var nl = negativeLists[n]; var nlBefore = re.slice(0, nl.reStart); var nlFirst = re.slice(nl.reStart, nl.reEnd - 8); var nlLast = re.slice(nl.reEnd - 8, nl.reEnd); var nlAfter = re.slice(nl.reEnd); nlLast += nlAfter; var openParensBefore = nlBefore.split("(").length - 1; var cleanAfter = nlAfter; for (i = 0; i < openParensBefore; i++) { cleanAfter = cleanAfter.replace(/\)[+*?]?/, ""); } nlAfter = cleanAfter; var dollar = ""; if (nlAfter === "" && isSub !== SUBPARSE) { dollar = "$"; } var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast; re = newRe; } if (re !== "" && hasMagic) { re = "(?=.)" + re; } if (addPatternStart) { re = patternStart + re; } if (isSub === SUBPARSE) { return [re, hasMagic]; } if (!hasMagic) { return globUnescape(pattern); } var flags = options.nocase ? "i" : ""; try { var regExp = new RegExp("^" + re + "$", flags); } catch (er) { return new RegExp("$."); } regExp._glob = pattern; regExp._src = re; return regExp; } minimatch.makeRe = function(pattern, options) { return new Minimatch(pattern, options || {}).makeRe(); }; Minimatch.prototype.makeRe = makeRe; function makeRe() { if (this.regexp || this.regexp === false) return this.regexp; var set = this.set; if (!set.length) { this.regexp = false; return this.regexp; } var options = this.options; var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; var flags = options.nocase ? "i" : ""; var re = set.map(function(pattern) { return pattern.map(function(p) { return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(p) : p._src; }).join("\\/"); }).join("|"); re = "^(?:" + re + ")$"; if (this.negate) re = "^(?!" + re + ").*$"; try { this.regexp = new RegExp(re, flags); } catch (ex) { this.regexp = false; } return this.regexp; } minimatch.match = function(list, pattern, options) { options = options || {}; var mm = new Minimatch(pattern, options); list = list.filter(function(f) { return mm.match(f); }); if (mm.options.nonull && !list.length) { list.push(pattern); } return list; }; Minimatch.prototype.match = match; function match(f, partial) { this.debug("match", f, this.pattern); if (this.comment) return false; if (this.empty) return f === ""; if (f === "/" && partial) return true; var options = this.options; if (path.sep !== "/") { f = f.split(path.sep).join("/"); } f = f.split(slashSplit); this.debug(this.pattern, "split", f); var set = this.set; this.debug(this.pattern, "set", set); var filename; var i; for (i = f.length - 1; i >= 0; i--) { filename = f[i]; if (filename) break; } for (i = 0; i < set.length; i++) { var pattern = set[i]; var file = f; if (options.matchBase && pattern.length === 1) { file = [filename]; } var hit = this.matchOne(file, pattern, partial); if (hit) { if (options.flipNegate) return true; return !this.negate; } } if (options.flipNegate) return false; return this.negate; } Minimatch.prototype.matchOne = function(file, pattern, partial) { var options = this.options; this.debug("matchOne", {this: this, file, pattern}); this.debug("matchOne", file.length, pattern.length); for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { this.debug("matchOne loop"); var p = pattern[pi]; var f = file[fi]; this.debug(pattern, p, f); if (p === false) return false; if (p === GLOBSTAR) { this.debug("GLOBSTAR", [pattern, p, f]); var fr = fi; var pr = pi + 1; if (pr === pl) { this.debug("** at the end"); for (; fi < fl; fi++) { if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false; } return true; } while (fr < fl) { var swallowee = file[fr]; this.debug("\nglobstar while", file, fr, pattern, pr, swallowee); if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { this.debug("globstar found match!", fr, fl, swallowee); return true; } else { if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") { this.debug("dot detected!", file, fr, pattern, pr); break; } this.debug("globstar swallow a segment, and continue"); fr++; } } if (partial) { this.debug("\n>>> no match, partial?", file, fr, pattern, pr); if (fr === fl) return true; } return false; } var hit; if (typeof p === "string") { if (options.nocase) { hit = f.toLowerCase() === p.toLowerCase(); } else { hit = f === p; } this.debug("string match", p, f, hit); } else { hit = f.match(p); this.debug("pattern match", p, f, hit); } if (!hit) return false; } if (fi === fl && pi === pl) { return true; } else if (fi === fl) { return partial; } else if (pi === pl) { var emptyFileEnd = fi === fl - 1 && file[fi] === ""; return emptyFileEnd; } throw new Error("wtf?"); }; function globUnescape(s) { return s.replace(/\\(.)/g, "$1"); } function regExpEscape(s) { return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); } }); // node_modules/inherits/inherits_browser.js var require_inherits_browser = __commonJS((exports2, module2) => { if (typeof Object.create === "function") { module2.exports = function inherits2(ctor, superCtor) { if (superCtor) { ctor.super_ = superCtor; ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: false, writable: true, configurable: true } }); } }; } else { module2.exports = function inherits2(ctor, superCtor) { if (superCtor) { ctor.super_ = superCtor; var TempCtor = function() { }; TempCtor.prototype = superCtor.prototype; ctor.prototype = new TempCtor(); ctor.prototype.constructor = ctor; } }; } }); // node_modules/inherits/inherits.js var require_inherits = __commonJS((exports2, module2) => { try { util = require("util"); if (typeof util.inherits !== "function") throw ""; module2.exports = util.inherits; } catch (e) { module2.exports = require_inherits_browser(); } var util; }); // node_modules/path-is-absolute/index.js var require_path_is_absolute = __commonJS((exports2, module2) => { "use strict"; function posix(path) { return path.charAt(0) === "/"; } function win32(path) { var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; var result = splitDeviceRe.exec(path); var device = result[1] || ""; var isUnc = Boolean(device && device.charAt(1) !== ":"); return Boolean(result[2] || isUnc); } module2.exports = process.platform === "win32" ? win32 : posix; module2.exports.posix = posix; module2.exports.win32 = win32; }); // node_modules/glob/common.js var require_common = __commonJS((exports2) => { exports2.alphasort = alphasort; exports2.alphasorti = alphasorti; exports2.setopts = setopts; exports2.ownProp = ownProp; exports2.makeAbs = makeAbs; exports2.finish = finish; exports2.mark = mark; exports2.isIgnored = isIgnored; exports2.childrenIgnored = childrenIgnored; function ownProp(obj, field) { return Object.prototype.hasOwnProperty.call(obj, field); } var path = require("path"); var minimatch = require_minimatch(); var isAbsolute = require_path_is_absolute(); var Minimatch = minimatch.Minimatch; function alphasorti(a, b) { return a.toLowerCase().localeCompare(b.toLowerCase()); } function alphasort(a, b) { return a.localeCompare(b); } function setupIgnores(self2, options) { self2.ignore = options.ignore || []; if (!Array.isArray(self2.ignore)) self2.ignore = [self2.ignore]; if (self2.ignore.length) { self2.ignore = self2.ignore.map(ignoreMap); } } function ignoreMap(pattern) { var gmatcher = null; if (pattern.slice(-3) === "/**") { var gpattern = pattern.replace(/(\/\*\*)+$/, ""); gmatcher = new Minimatch(gpattern, {dot: true}); } return { matcher: new Minimatch(pattern, {dot: true}), gmatcher }; } function setopts(self2, pattern, options) { if (!options) options = {}; if (options.matchBase && pattern.indexOf("/") === -1) { if (options.noglobstar) { throw new Error("base matching requires globstar"); } pattern = "**/" + pattern; } self2.silent = !!options.silent; self2.pattern = pattern; self2.strict = options.strict !== false; self2.realpath = !!options.realpath; self2.realpathCache = options.realpathCache || Object.create(null); self2.follow = !!options.follow; self2.dot = !!options.dot; self2.mark = !!options.mark; self2.nodir = !!options.nodir; if (self2.nodir) self2.mark = true; self2.sync = !!options.sync; self2.nounique = !!options.nounique; self2.nonull = !!options.nonull; self2.nosort = !!options.nosort; self2.nocase = !!options.nocase; self2.stat = !!options.stat; self2.noprocess = !!options.noprocess; self2.absolute = !!options.absolute; self2.maxLength = options.maxLength || Infinity; self2.cache = options.cache || Object.create(null); self2.statCache = options.statCache || Object.create(null); self2.symlinks = options.symlinks || Object.create(null); setupIgnores(self2, options); self2.changedCwd = false; var cwd = process.cwd(); if (!ownProp(options, "cwd")) self2.cwd = cwd; else { self2.cwd = path.resolve(options.cwd); self2.changedCwd = self2.cwd !== cwd; } self2.root = options.root || path.resolve(self2.cwd, "/"); self2.root = path.resolve(self2.root); if (process.platform === "win32") self2.root = self2.root.replace(/\\/g, "/"); self2.cwdAbs = isAbsolute(self2.cwd) ? self2.cwd : makeAbs(self2, self2.cwd); if (process.platform === "win32") self2.cwdAbs = self2.cwdAbs.replace(/\\/g, "/"); self2.nomount = !!options.nomount; options.nonegate = true; options.nocomment = true; self2.minimatch = new Minimatch(pattern, options); self2.options = self2.minimatch.options; } function finish(self2) { var nou = self2.nounique; var all = nou ? [] : Object.create(null); for (var i = 0, l = self2.matches.length; i < l; i++) { var matches = self2.matches[i]; if (!matches || Object.keys(matches).length === 0) { if (self2.nonull) { var literal = self2.minimatch.globSet[i]; if (nou) all.push(literal); else all[literal] = true; } } else { var m = Object.keys(matches); if (nou) all.push.apply(all, m); else m.forEach(function(m2) { all[m2] = true; }); } } if (!nou) all = Object.keys(all); if (!self2.nosort) all = all.sort(self2.nocase ? alphasorti : alphasort); if (self2.mark) { for (var i = 0; i < all.length; i++) { all[i] = self2._mark(all[i]); } if (self2.nodir) { all = all.filter(function(e) { var notDir = !/\/$/.test(e); var c = self2.cache[e] || self2.cache[makeAbs(self2, e)]; if (notDir && c) notDir = c !== "DIR" && !Array.isArray(c); return notDir; }); } } if (self2.ignore.length) all = all.filter(function(m2) { return !isIgnored(self2, m2); }); self2.found = all; } function mark(self2, p) { var abs = makeAbs(self2, p); var c = self2.cache[abs]; var m = p; if (c) { var isDir = c === "DIR" || Array.isArray(c); var slash = p.slice(-1) === "/"; if (isDir && !slash) m += "/"; else if (!isDir && slash) m = m.slice(0, -1); if (m !== p) { var mabs = makeAbs(self2, m); self2.statCache[mabs] = self2.statCache[abs]; self2.cache[mabs] = self2.cache[abs]; } } return m; } function makeAbs(self2, f) { var abs = f; if (f.charAt(0) === "/") { abs = path.join(self2.root, f); } else if (isAbsolute(f) || f === "") { abs = f; } else if (self2.changedCwd) { abs = path.resolve(self2.cwd, f); } else { abs = path.resolve(f); } if (process.platform === "win32") abs = abs.replace(/\\/g, "/"); return abs; } function isIgnored(self2, path2) { if (!self2.ignore.length) return false; return self2.ignore.some(function(item) { return item.matcher.match(path2) || !!(item.gmatcher && item.gmatcher.match(path2)); }); } function childrenIgnored(self2, path2) { if (!self2.ignore.length) return false; return self2.ignore.some(function(item) { return !!(item.gmatcher && item.gmatcher.match(path2)); }); } }); // node_modules/glob/sync.js var require_sync = __commonJS((exports2, module2) => { module2.exports = globSync; globSync.GlobSync = GlobSync; var fs = require("fs"); var rp = require_fs(); var minimatch = require_minimatch(); var Minimatch = minimatch.Minimatch; var Glob = require_glob().Glob; var util = require("util"); var path = require("path"); var assert = require("assert"); var isAbsolute = require_path_is_absolute(); var common2 = require_common(); var alphasort = common2.alphasort; var alphasorti = common2.alphasorti; var setopts = common2.setopts; var ownProp = common2.ownProp; var childrenIgnored = common2.childrenIgnored; var isIgnored = common2.isIgnored; function globSync(pattern, options) { if (typeof options === "function" || arguments.length === 3) throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167"); return new GlobSync(pattern, options).found; } function GlobSync(pattern, options) { if (!pattern) throw new Error("must provide pattern"); if (typeof options === "function" || arguments.length === 3) throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167"); if (!(this instanceof GlobSync)) return new GlobSync(pattern, options); setopts(this, pattern, options); if (this.noprocess) return this; var n = this.minimatch.set.length; this.matches = new Array(n); for (var i = 0; i < n; i++) { this._process(this.minimatch.set[i], i, false); } this._finish(); } GlobSync.prototype._finish = function() { assert(this instanceof GlobSync); if (this.realpath) { var self2 = this; this.matches.forEach(function(matchset, index) { var set = self2.matches[index] = Object.create(null); for (var p in matchset) { try { p = self2._makeAbs(p); var real = rp.realpathSync(p, self2.realpathCache); set[real] = true; } catch (er) { if (er.syscall === "stat") set[self2._makeAbs(p)] = true; else throw er; } } }); } common2.finish(this); }; GlobSync.prototype._process = function(pattern, index, inGlobStar) { assert(this instanceof GlobSync); var n = 0; while (typeof pattern[n] === "string") { n++; } var prefix; switch (n) { case pattern.length: this._processSimple(pattern.join("/"), index); return; case 0: prefix = null; break; default: prefix = pattern.slice(0, n).join("/"); break; } var remain = pattern.slice(n); var read; if (prefix === null) read = "."; else if (isAbsolute(prefix) || isAbsolute(pattern.join("/"))) { if (!prefix || !isAbsolute(prefix)) prefix = "/" + prefix; read = prefix; } else read = prefix; var abs = this._makeAbs(read); if (childrenIgnored(this, read)) return; var isGlobStar = remain[0] === minimatch.GLOBSTAR; if (isGlobStar) this._processGlobStar(prefix, read, abs, remain, index, inGlobStar); else this._processReaddir(prefix, read, abs, remain, index, inGlobStar); }; GlobSync.prototype._processReaddir = function(prefix, read, abs, remain, index, inGlobStar) { var entries = this._readdir(abs, inGlobStar); if (!entries) return; var pn = remain[0]; var negate = !!this.minimatch.negate; var rawGlob = pn._glob; var dotOk = this.dot || rawGlob.charAt(0) === "."; var matchedEntries = []; for (var i = 0; i < entries.length; i++) { var e = entries[i]; if (e.charAt(0) !== "." || dotOk) { var m; if (negate && !prefix) { m = !e.match(pn); } else { m = e.match(pn); } if (m) matchedEntries.push(e); } } var len = matchedEntries.length; if (len === 0) return; if (remain.length === 1 && !this.mark && !this.stat) { if (!this.matches[index]) this.matches[index] = Object.create(null); for (var i = 0; i < len; i++) { var e = matchedEntries[i]; if (prefix) { if (prefix.slice(-1) !== "/") e = prefix + "/" + e; else e = prefix + e; } if (e.charAt(0) === "/" && !this.nomount) { e = path.join(this.root, e); } this._emitMatch(index, e); } return; } remain.shift(); for (var i = 0; i < len; i++) { var e = matchedEntries[i]; var newPattern; if (prefix) newPattern = [prefix, e]; else newPattern = [e]; this._process(newPattern.concat(remain), index, inGlobStar); } }; GlobSync.prototype._emitMatch = function(index, e) { if (isIgnored(this, e)) return; var abs = this._makeAbs(e); if (this.mark) e = this._mark(e); if (this.absolute) { e = abs; } if (this.matches[index][e]) return; if (this.nodir) { var c = this.cache[abs]; if (c === "DIR" || Array.isArray(c)) return; } this.matches[index][e] = true; if (this.stat) this._stat(e); }; GlobSync.prototype._readdirInGlobStar = function(abs) { if (this.follow) return this._readdir(abs, false); var entries; var lstat; var stat; try { lstat = fs.lstatSync(abs); } catch (er) { if (er.code === "ENOENT") { return null; } } var isSym = lstat && lstat.isSymbolicLink(); this.symlinks[abs] = isSym; if (!isSym && lstat && !lstat.isDirectory()) this.cache[abs] = "FILE"; else entries = this._readdir(abs, false); return entries; }; GlobSync.prototype._readdir = function(abs, inGlobStar) { var entries; if (inGlobStar && !ownProp(this.symlinks, abs)) return this._readdirInGlobStar(abs); if (ownProp(this.cache, abs)) { var c = this.cache[abs]; if (!c || c === "FILE") return null; if (Array.isArray(c)) return c; } try { return this._readdirEntries(abs, fs.readdirSync(abs)); } catch (er) { this._readdirError(abs, er); return null; } }; GlobSync.prototype._readdirEntries = function(abs, entries) { if (!this.mark && !this.stat) { for (var i = 0; i < entries.length; i++) { var e = entries[i]; if (abs === "/") e = abs + e; else e = abs + "/" + e; this.cache[e] = true; } } this.cache[abs] = entries; return entries; }; GlobSync.prototype._readdirError = function(f, er) { switch (er.code) { case "ENOTSUP": case "ENOTDIR": var abs = this._makeAbs(f); this.cache[abs] = "FILE"; if (abs === this.cwdAbs) { var error = new Error(er.code + " invalid cwd " + this.cwd); error.path = this.cwd; error.code = er.code; throw error; } break; case "ENOENT": case "ELOOP": case "ENAMETOOLONG": case "UNKNOWN": this.cache[this._makeAbs(f)] = false; break; default: this.cache[this._makeAbs(f)] = false; if (this.strict) throw er; if (!this.silent) console.error("glob error", er); break; } }; GlobSync.prototype._processGlobStar = function(prefix, read, abs, remain, index, inGlobStar) { var entries = this._readdir(abs, inGlobStar); if (!entries) return; var remainWithoutGlobStar = remain.slice(1); var gspref = prefix ? [prefix] : []; var noGlobStar = gspref.concat(remainWithoutGlobStar); this._process(noGlobStar, index, false); var len = entries.length; var isSym = this.symlinks[abs]; if (isSym && inGlobStar) return; for (var i = 0; i < len; i++) { var e = entries[i]; if (e.charAt(0) === "." && !this.dot) continue; var instead = gspref.concat(entries[i], remainWithoutGlobStar); this._process(instead, index, true); var below = gspref.concat(entries[i], remain); this._process(below, index, true); } }; GlobSync.prototype._processSimple = function(prefix, index) { var exists = this._stat(prefix); if (!this.matches[index]) this.matches[index] = Object.create(null); if (!exists) return; if (prefix && isAbsolute(prefix) && !this.nomount) { var trail = /[\/\\]$/.test(prefix); if (prefix.charAt(0) === "/") { prefix = path.join(this.root, prefix); } else { prefix = path.resolve(this.root, prefix); if (trail) prefix += "/"; } } if (process.platform === "win32") prefix = prefix.replace(/\\/g, "/"); this._emitMatch(index, prefix); }; GlobSync.prototype._stat = function(f) { var abs = this._makeAbs(f); var needDir = f.slice(-1) === "/"; if (f.length > this.maxLength) return false; if (!this.stat && ownProp(this.cache, abs)) { var c = this.cache[abs]; if (Array.isArray(c)) c = "DIR"; if (!needDir || c === "DIR") return c; if (needDir && c === "FILE") return false; } var exists; var stat = this.statCache[abs]; if (!stat) { var lstat; try { lstat = fs.lstatSync(abs); } catch (er) { if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) { this.statCache[abs] = false; return false; } } if (lstat && lstat.isSymbolicLink()) { try { stat = fs.statSync(abs); } catch (er) { stat = lstat; } } else { stat = lstat; } } this.statCache[abs] = stat; var c = true; if (stat) c = stat.isDirectory() ? "DIR" : "FILE"; this.cache[abs] = this.cache[abs] || c; if (needDir && c === "FILE") return false; return c; }; GlobSync.prototype._mark = function(p) { return common2.mark(this, p); }; GlobSync.prototype._makeAbs = function(f) { return common2.makeAbs(this, f); }; }); // node_modules/wrappy/wrappy.js var require_wrappy = __commonJS((exports2, module2) => { module2.exports = wrappy; function wrappy(fn, cb) { if (fn && cb) return wrappy(fn)(cb); if (typeof fn !== "function") throw new TypeError("need wrapper function"); Object.keys(fn).forEach(function(k) { wrapper[k] = fn[k]; }); return wrapper; function wrapper() { var args = new Array(arguments.length); for (var i = 0; i < args.length; i++) { args[i] = arguments[i]; } var ret2 = fn.apply(this, args); var cb2 = args[args.length - 1]; if (typeof ret2 === "function" && ret2 !== cb2) { Object.keys(cb2).forEach(function(k) { ret2[k] = cb2[k]; }); } return ret2; } } }); // node_modules/once/once.js var require_once = __commonJS((exports2, module2) => { var wrappy = require_wrappy(); module2.exports = wrappy(once); module2.exports.strict = wrappy(onceStrict); once.proto = once(function() { Object.defineProperty(Function.prototype, "once", { value: function() { return once(this); }, configurable: true }); Object.defineProperty(Function.prototype, "onceStrict", { value: function() { return onceStrict(this); }, configurable: true }); }); function once(fn) { var f = function() { if (f.called) return f.value; f.called = true; return f.value = fn.apply(this, arguments); }; f.called = false; return f; } function onceStrict(fn) { var f = function() { if (f.called) throw new Error(f.onceError); f.called = true; return f.value = fn.apply(this, arguments); }; var name = fn.name || "Function wrapped with `once`"; f.onceError = name + " shouldn't be called more than once"; f.called = false; return f; } }); // node_modules/inflight/inflight.js var require_inflight = __commonJS((exports2, module2) => { var wrappy = require_wrappy(); var reqs = Object.create(null); var once = require_once(); module2.exports = wrappy(inflight); function inflight(key, cb) { if (reqs[key]) { reqs[key].push(cb); return null; } else { reqs[key] = [cb]; return makeres(key); } } function makeres(key) { return once(function RES() { var cbs = reqs[key]; var len = cbs.length; var args = slice(arguments); try { for (var i = 0; i < len; i++) { cbs[i].apply(null, args); } } finally { if (cbs.length > len) { cbs.splice(0, len); process.nextTick(function() { RES.apply(null, args); }); } else { delete reqs[key]; } } }); } function slice(args) { var length = args.length; var array = []; for (var i = 0; i < length; i++) array[i] = args[i]; return array; } }); // node_modules/glob/glob.js var require_glob = __commonJS((exports2, module2) => { module2.exports = glob; var fs = require("fs"); var rp = require_fs(); var minimatch = require_minimatch(); var Minimatch = minimatch.Minimatch; var inherits2 = require_inherits(); var EE = require("events").EventEmitter; var path = require("path"); var assert = require("assert"); var isAbsolute = require_path_is_absolute(); var globSync = require_sync(); var common2 = require_common(); var alphasort = common2.alphasort; var alphasorti = common2.alphasorti; var setopts = common2.setopts; var ownProp = common2.ownProp; var inflight = require_inflight(); var util = require("util"); var childrenIgnored = common2.childrenIgnored; var isIgnored = common2.isIgnored; var once = require_once(); function glob(pattern, options, cb) { if (typeof options === "function") cb = options, options = {}; if (!options) options = {}; if (options.sync) { if (cb) throw new TypeError("callback provided to sync glob"); return globSync(pattern, options); } return new Glob(pattern, options, cb); } glob.sync = globSync; var GlobSync = glob.GlobSync = globSync.GlobSync; glob.glob = glob; function extend(origin, add) { if (add === null || typeof add !== "object") { return origin; } var keys = Object.keys(add); var i = keys.length; while (i--) { origin[keys[i]] = add[keys[i]]; } return origin; } glob.hasMagic = function(pattern, options_) { var options = extend({}, options_); options.noprocess = true; var g = new Glob(pattern, options); var set = g.minimatch.set; if (!pattern) return false; if (set.length > 1) return true; for (var j = 0; j < set[0].length; j++) { if (typeof set[0][j] !== "string") return true; } return false; }; glob.Glob = Glob; inherits2(Glob, EE); function Glob(pattern, options, cb) { if (typeof options === "function") { cb = options; options = null; } if (options && options.sync) { if (cb) throw new TypeError("callback provided to sync glob"); return new GlobSync(pattern, options); } if (!(this instanceof Glob)) return new Glob(pattern, options, cb); setopts(this, pattern, options); this._didRealPath = false; var n = this.minimatch.set.length; this.matches = new Array(n); if (typeof cb === "function") { cb = once(cb); this.on("error", cb); this.on("end", function(matches) { cb(null, matches); }); } var self2 = this; this._processing = 0; this._emitQueue = []; this._processQueue = []; this.paused = false; if (this.noprocess) return this; if (n === 0) return done(); var sync = true; for (var i = 0; i < n; i++) { this._process(this.minimatch.set[i], i, false, done); } sync = false; function done() { --self2._processing; if (self2._processing <= 0) { if (sync) { process.nextTick(function() { self2._finish(); }); } else { self2._finish(); } } } } Glob.prototype._finish = function() { assert(this instanceof Glob); if (this.aborted) return; if (this.realpath && !this._didRealpath) return this._realpath(); common2.finish(this); this.emit("end", this.found); }; Glob.prototype._realpath = function() { if (this._didRealpath) return; this._didRealpath = true; var n = this.matches.length; if (n === 0) return this._finish(); var self2 = this; for (var i = 0; i < this.matches.length; i++) this._realpathSet(i, next); function next() { if (--n === 0) self2._finish(); } }; Glob.prototype._realpathSet = function(index, cb) { var matchset = this.matches[index]; if (!matchset) return cb(); var found = Object.keys(matchset); var self2 = this; var n = found.length; if (n === 0) return cb(); var set = this.matches[index] = Object.create(null); found.forEach(function(p, i) { p = self2._makeAbs(p); rp.realpath(p, self2.realpathCache, function(er, real) { if (!er) set[real] = true; else if (er.syscall === "stat") set[p] = true; else self2.emit("error", er); if (--n === 0) { self2.matches[index] = set; cb(); } }); }); }; Glob.prototype._mark = function(p) { return common2.mark(this, p); }; Glob.prototype._makeAbs = function(f) { return common2.makeAbs(this, f); }; Glob.prototype.abort = function() { this.aborted = true; this.emit("abort"); }; Glob.prototype.pause = function() { if (!this.paused) { this.paused = true; this.emit("pause"); } }; Glob.prototype.resume = function() { if (this.paused) { this.emit("resume"); this.paused = false; if (this._emitQueue.length) { var eq = this._emitQueue.slice(0); this._emitQueue.length = 0; for (var i = 0; i < eq.length; i++) { var e = eq[i]; this._emitMatch(e[0], e[1]); } } if (this._processQueue.length) { var pq = this._processQueue.slice(0); this._processQueue.length = 0; for (var i = 0; i < pq.length; i++) { var p = pq[i]; this._processing--; this._process(p[0], p[1], p[2], p[3]); } } } }; Glob.prototype._process = function(pattern, index, inGlobStar, cb) { assert(this instanceof Glob); assert(typeof cb === "function"); if (this.aborted) return; this._processing++; if (this.paused) { this._processQueue.push([pattern, index, inGlobStar, cb]); return; } var n = 0; while (typeof pattern[n] === "string") { n++; } var prefix; switch (n) { case pattern.length: this._processSimple(pattern.join("/"), index, cb); return; case 0: prefix = null; break; default: prefix = pattern.slice(0, n).join("/"); break; } var remain = pattern.slice(n); var read; if (prefix === null) read = "."; else if (isAbsolute(prefix) || isAbsolute(pattern.join("/"))) { if (!prefix || !isAbsolute(prefix)) prefix = "/" + prefix; read = prefix; } else read = prefix; var abs = this._makeAbs(read); if (childrenIgnored(this, read)) return cb(); var isGlobStar = remain[0] === minimatch.GLOBSTAR; if (isGlobStar) this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb); else this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb); }; Glob.prototype._processReaddir = function(prefix, read, abs, remain, index, inGlobStar, cb) { var self2 = this; this._readdir(abs, inGlobStar, function(er, entries) { return self2._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb); }); }; Glob.prototype._processReaddir2 = function(prefix, read, abs, remain, index, inGlobStar, entries, cb) { if (!entries) return cb(); var pn = remain[0]; var negate = !!this.minimatch.negate; var rawGlob = pn._glob; var dotOk = this.dot || rawGlob.charAt(0) === "."; var matchedEntries = []; for (var i = 0; i < entries.length; i++) { var e = entries[i]; if (e.charAt(0) !== "." || dotOk) { var m; if (negate && !prefix) { m = !e.match(pn); } else { m = e.match(pn); } if (m) matchedEntries.push(e); } } var len = matchedEntries.length; if (len === 0) return cb(); if (remain.length === 1 && !this.mark && !this.stat) { if (!this.matches[index]) this.matches[index] = Object.create(null); for (var i = 0; i < len; i++) { var e = matchedEntries[i]; if (prefix) { if (prefix !== "/") e = prefix + "/" + e; else e = prefix + e; } if (e.charAt(0) === "/" && !this.nomount) { e = path.join(this.root, e); } this._emitMatch(index, e); } return cb(); } remain.shift(); for (var i = 0; i < len; i++) { var e = matchedEntries[i]; var newPattern; if (prefix) { if (prefix !== "/") e = prefix + "/" + e; else e = prefix + e; } this._process([e].concat(remain), index, inGlobStar, cb); } cb(); }; Glob.prototype._emitMatch = function(index, e) { if (this.aborted) return; if (isIgnored(this, e)) return; if (this.paused) { this._emitQueue.push([index, e]); return; } var abs = isAbsolute(e) ? e : this._makeAbs(e); if (this.mark) e = this._mark(e); if (this.absolute) e = abs; if (this.matches[index][e]) return; if (this.nodir) { var c = this.cache[abs]; if (c === "DIR" || Array.isArray(c)) return; } this.matches[index][e] = true; var st = this.statCache[abs]; if (st) this.emit("stat", e, st); this.emit("match", e); }; Glob.prototype._readdirInGlobStar = function(abs, cb) { if (this.aborted) return; if (this.follow) return this._readdir(abs, false, cb); var lstatkey = "lstat\0" + abs; var self2 = this; var lstatcb = inflight(lstatkey, lstatcb_); if (lstatcb) fs.lstat(abs, lstatcb); function lstatcb_(er, lstat) { if (er && er.code === "ENOENT") return cb(); var isSym = lstat && lstat.isSymbolicLink(); self2.symlinks[abs] = isSym; if (!isSym && lstat && !lstat.isDirectory()) { self2.cache[abs] = "FILE"; cb(); } else self2._readdir(abs, false, cb); } }; Glob.prototype._readdir = function(abs, inGlobStar, cb) { if (this.aborted) return; cb = inflight("readdir\0" + abs + "\0" + inGlobStar, cb); if (!cb) return; if (inGlobStar && !ownProp(this.symlinks, abs)) return this._readdirInGlobStar(abs, cb); if (ownProp(this.cache, abs)) { var c = this.cache[abs]; if (!c || c === "FILE") return cb(); if (Array.isArray(c)) return cb(null, c); } var self2 = this; fs.readdir(abs, readdirCb(this, abs, cb)); }; function readdirCb(self2, abs, cb) { return function(er, entries) { if (er) self2._readdirError(abs, er, cb); else self2._readdirEntries(abs, entries, cb); }; } Glob.prototype._readdirEntries = function(abs, entries, cb) { if (this.aborted) return; if (!this.mark && !this.stat) { for (var i = 0; i < entries.length; i++) { var e = entries[i]; if (abs === "/") e = abs + e; else e = abs + "/" + e; this.cache[e] = true; } } this.cache[abs] = entries; return cb(null, entries); }; Glob.prototype._readdirError = function(f, er, cb) { if (this.aborted) return; switch (er.code) { case "ENOTSUP": case "ENOTDIR": var abs = this._makeAbs(f); this.cache[abs] = "FILE"; if (abs === this.cwdAbs) { var error = new Error(er.code + " invalid cwd " + this.cwd); error.path = this.cwd; error.code = er.code; this.emit("error", error); this.abort(); } break; case "ENOENT": case "ELOOP": case "ENAMETOOLONG": case "UNKNOWN": this.cache[this._makeAbs(f)] = false; break; default: this.cache[this._makeAbs(f)] = false; if (this.strict) { this.emit("error", er); this.abort(); } if (!this.silent) console.error("glob error", er); break; } return cb(); }; Glob.prototype._processGlobStar = function(prefix, read, abs, remain, index, inGlobStar, cb) { var self2 = this; this._readdir(abs, inGlobStar, function(er, entries) { self2._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb); }); }; Glob.prototype._processGlobStar2 = function(prefix, read, abs, remain, index, inGlobStar, entries, cb) { if (!entries) return cb(); var remainWithoutGlobStar = remain.slice(1); var gspref = prefix ? [prefix] : []; var noGlobStar = gspref.concat(remainWithoutGlobStar); this._process(noGlobStar, index, false, cb); var isSym = this.symlinks[abs]; var len = entries.length; if (isSym && inGlobStar) return cb(); for (var i = 0; i < len; i++) { var e = entries[i]; if (e.charAt(0) === "." && !this.dot) continue; var instead = gspref.concat(entries[i], remainWithoutGlobStar); this._process(instead, index, true, cb); var below = gspref.concat(entries[i], remain); this._process(below, index, true, cb); } cb(); }; Glob.prototype._processSimple = function(prefix, index, cb) { var self2 = this; this._stat(prefix, function(er, exists) { self2._processSimple2(prefix, index, er, exists, cb); }); }; Glob.prototype._processSimple2 = function(prefix, index, er, exists, cb) { if (!this.matches[index]) this.matches[index] = Object.create(null); if (!exists) return cb(); if (prefix && isAbsolute(prefix) && !this.nomount) { var trail = /[\/\\]$/.test(prefix); if (prefix.charAt(0) === "/") { prefix = path.join(this.root, prefix); } else { prefix = path.resolve(this.root, prefix); if (trail) prefix += "/"; } } if (process.platform === "win32") prefix = prefix.replace(/\\/g, "/"); this._emitMatch(index, prefix); cb(); }; Glob.prototype._stat = function(f, cb) { var abs = this._makeAbs(f); var needDir = f.slice(-1) === "/"; if (f.length > this.maxLength) return cb(); if (!this.stat && ownProp(this.cache, abs)) { var c = this.cache[abs]; if (Array.isArray(c)) c = "DIR"; if (!needDir || c === "DIR") return cb(null, c); if (needDir && c === "FILE") return cb(); } var exists; var stat = this.statCache[abs]; if (stat !== void 0) { if (stat === false) return cb(null, stat); else { var type = stat.isDirectory() ? "DIR" : "FILE"; if (needDir && type === "FILE") return cb(); else return cb(null, type, stat); } } var self2 = this; var statcb = inflight("stat\0" + abs, lstatcb_); if (statcb) fs.lstat(abs, statcb); function lstatcb_(er, lstat) { if (lstat && lstat.isSymbolicLink()) { return fs.stat(abs, function(er2, stat2) { if (er2) self2._stat2(f, abs, null, lstat, cb); else self2._stat2(f, abs, er2, stat2, cb); }); } else { self2._stat2(f, abs, er, lstat, cb); } } }; Glob.prototype._stat2 = function(f, abs, er, stat, cb) { if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) { this.statCache[abs] = false; return cb(); } var needDir = f.slice(-1) === "/"; this.statCache[abs] = stat; if (abs.slice(-1) === "/" && stat && !stat.isDirectory()) return cb(null, false, stat); var c = true; if (stat) c = stat.isDirectory() ? "DIR" : "FILE"; this.cache[abs] = this.cache[abs] || c; if (needDir && c === "FILE") return cb(); return cb(null, c, stat); }; }); // node_modules/rimraf/rimraf.js var require_rimraf = __commonJS((exports2, module2) => { var assert = require("assert"); var path = require("path"); var fs = require("fs"); var glob = void 0; try { glob = require_glob(); } catch (_err) { } var defaultGlobOpts = { nosort: true, silent: true }; var timeout = 0; var isWindows = process.platform === "win32"; var defaults = (options) => { const methods = [ "unlink", "chmod", "stat", "lstat", "rmdir", "readdir" ]; methods.forEach((m) => { options[m] = options[m] || fs[m]; m = m + "Sync"; options[m] = options[m] || fs[m]; }); options.maxBusyTries = options.maxBusyTries || 3; options.emfileWait = options.emfileWait || 1e3; if (options.glob === false) { options.disableGlob = true; } if (options.disableGlob !== true && glob === void 0) { throw Error("glob dependency not found, set `options.disableGlob = true` if intentional"); } options.disableGlob = options.disableGlob || false; options.glob = options.glob || defaultGlobOpts; }; var rimraf = (p, options, cb) => { if (typeof options === "function") { cb = options; options = {}; } assert(p, "rimraf: missing path"); assert.equal(typeof p, "string", "rimraf: path should be a string"); assert.equal(typeof cb, "function", "rimraf: callback function required"); assert(options, "rimraf: invalid options argument provided"); assert.equal(typeof options, "object", "rimraf: options should be object"); defaults(options); let busyTries = 0; let errState = null; let n = 0; const next = (er) => { errState = errState || er; if (--n === 0) cb(errState); }; const afterGlob = (er, results) => { if (er) return cb(er); n = results.length; if (n === 0) return cb(); results.forEach((p2) => { const CB = (er2) => { if (er2) { if ((er2.code === "EBUSY" || er2.code === "ENOTEMPTY" || er2.code === "EPERM") && busyTries < options.maxBusyTries) { busyTries++; return setTimeout(() => rimraf_(p2, options, CB), busyTries * 100); } if (er2.code === "EMFILE" && timeout < options.emfileWait) { return setTimeout(() => rimraf_(p2, options, CB), timeout++); } if (er2.code === "ENOENT") er2 = null; } timeout = 0; next(er2); }; rimraf_(p2, options, CB); }); }; if (options.disableGlob || !glob.hasMagic(p)) return afterGlob(null, [p]); options.lstat(p, (er, stat) => { if (!er) return afterGlob(null, [p]); glob(p, options.glob, afterGlob); }); }; var rimraf_ = (p, options, cb) => { assert(p); assert(options); assert(typeof cb === "function"); options.lstat(p, (er, st) => { if (er && er.code === "ENOENT") return cb(null); if (er && er.code === "EPERM" && isWindows) fixWinEPERM(p, options, er, cb); if (st && st.isDirectory()) return rmdir(p, options, er, cb); options.unlink(p, (er2) => { if (er2) { if (er2.code === "ENOENT") return cb(null); if (er2.code === "EPERM") return isWindows ? fixWinEPERM(p, options, er2, cb) : rmdir(p, options, er2, cb); if (er2.code === "EISDIR") return rmdir(p, options, er2, cb); } return cb(er2); }); }); }; var fixWinEPERM = (p, options, er, cb) => { assert(p); assert(options); assert(typeof cb === "function"); options.chmod(p, 438, (er2) => { if (er2) cb(er2.code === "ENOENT" ? null : er); else options.stat(p, (er3, stats) => { if (er3) cb(er3.code === "ENOENT" ? null : er); else if (stats.isDirectory()) rmdir(p, options, er, cb); else options.unlink(p, cb); }); }); }; var fixWinEPERMSync = (p, options, er) => { assert(p); assert(options); try { options.chmodSync(p, 438); } catch (er2) { if (er2.code === "ENOENT") return; else throw er; } let stats; try { stats = options.statSync(p); } catch (er3) { if (er3.code === "ENOENT") return; else throw er; } if (stats.isDirectory()) rmdirSync(p, options, er); else options.unlinkSync(p); }; var rmdir = (p, options, originalEr, cb) => { assert(p); assert(options); assert(typeof cb === "function"); options.rmdir(p, (er) => { if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) rmkids(p, options, cb); else if (er && er.code === "ENOTDIR") cb(originalEr); else cb(er); }); }; var rmkids = (p, options, cb) => { assert(p); assert(options); assert(typeof cb === "function"); options.readdir(p, (er, files) => { if (er) return cb(er); let n = files.length; if (n === 0) return options.rmdir(p, cb); let errState; files.forEach((f) => { rimraf(path.join(p, f), options, (er2) => { if (errState) return; if (er2) return cb(errState = er2); if (--n === 0) options.rmdir(p, cb); }); }); }); }; var rimrafSync = (p, options) => { options = options || {}; defaults(options); assert(p, "rimraf: missing path"); assert.equal(typeof p, "string", "rimraf: path should be a string"); assert(options, "rimraf: missing options"); assert.equal(typeof options, "object", "rimraf: options should be object"); let results; if (options.disableGlob || !glob.hasMagic(p)) { results = [p]; } else { try { options.lstatSync(p); results = [p]; } catch (er) { results = glob.sync(p, options.glob); } } if (!results.length) return; for (let i = 0; i < results.length; i++) { const p2 = results[i]; let st; try { st = options.lstatSync(p2); } catch (er) { if (er.code === "ENOENT") return; if (er.code === "EPERM" && isWindows) fixWinEPERMSync(p2, options, er); } try { if (st && st.isDirectory()) rmdirSync(p2, options, null); else options.unlinkSync(p2); } catch (er) { if (er.code === "ENOENT") return; if (er.code === "EPERM") return isWindows ? fixWinEPERMSync(p2, options, er) : rmdirSync(p2, options, er); if (er.code !== "EISDIR") throw er; rmdirSync(p2, options, er); } } }; var rmdirSync = (p, options, originalEr) => { assert(p); assert(options); try { options.rmdirSync(p); } catch (er) { if (er.code === "ENOENT") return; if (er.code === "ENOTDIR") throw originalEr; if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") rmkidsSync(p, options); } }; var rmkidsSync = (p, options) => { assert(p); assert(options); options.readdirSync(p).forEach((f) => rimrafSync(path.join(p, f), options)); const retries = isWindows ? 100 : 1; let i = 0; do { let threw = true; try { const ret2 = options.rmdirSync(p, options); threw = false; return ret2; } finally { if (++i < retries && threw) continue; } } while (true); }; module2.exports = rimraf; rimraf.sync = rimrafSync; }); // node_modules/semver/internal/constants.js var require_constants2 = __commonJS((exports2, module2) => { var SEMVER_SPEC_VERSION = "2.0.0"; var MAX_LENGTH = 256; var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991; var MAX_SAFE_COMPONENT_LENGTH = 16; module2.exports = { SEMVER_SPEC_VERSION, MAX_LENGTH, MAX_SAFE_INTEGER, MAX_SAFE_COMPONENT_LENGTH }; }); // node_modules/semver/internal/debug.js var require_debug = __commonJS((exports2, module2) => { var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { }; module2.exports = debug; }); // node_modules/semver/internal/re.js var require_re = __commonJS((exports2, module2) => { var {MAX_SAFE_COMPONENT_LENGTH} = require_constants2(); var debug = require_debug(); exports2 = module2.exports = {}; var re = exports2.re = []; var src = exports2.src = []; var t = exports2.t = {}; var R = 0; var createToken = (name, value, isGlobal) => { const index = R++; debug(index, value); t[name] = index; src[index] = value; re[index] = new RegExp(value, isGlobal ? "g" : void 0); }; createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*"); createToken("NUMERICIDENTIFIERLOOSE", "[0-9]+"); createToken("NONNUMERICIDENTIFIER", "\\d*[a-zA-Z-][a-zA-Z0-9-]*"); createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`); createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`); createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NUMERICIDENTIFIER]}|${src[t.NONNUMERICIDENTIFIER]})`); createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NUMERICIDENTIFIERLOOSE]}|${src[t.NONNUMERICIDENTIFIER]})`); createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`); createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`); createToken("BUILDIDENTIFIER", "[0-9A-Za-z-]+"); createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`); createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`); createToken("FULL", `^${src[t.FULLPLAIN]}$`); createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`); createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`); createToken("GTLT", "((?:<|>)?=?)"); createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`); createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`); createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`); createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`); createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`); createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`); createToken("COERCE", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:$|[^\\d])`); createToken("COERCERTL", src[t.COERCE], true); createToken("LONETILDE", "(?:~>?)"); createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true); exports2.tildeTrimReplace = "$1~"; createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`); createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`); createToken("LONECARET", "(?:\\^)"); createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true); exports2.caretTrimReplace = "$1^"; createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`); createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`); createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`); createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`); createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true); exports2.comparatorTrimReplace = "$1$2$3"; createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`); createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`); createToken("STAR", "(<|>)?=?\\s*\\*"); createToken("GTE0", "^\\s*>=\\s*0.0.0\\s*$"); createToken("GTE0PRE", "^\\s*>=\\s*0.0.0-0\\s*$"); }); // node_modules/semver/internal/parse-options.js var require_parse_options = __commonJS((exports2, module2) => { var opts = ["includePrerelease", "loose", "rtl"]; var parseOptions = (options) => !options ? {} : typeof options !== "object" ? {loose: true} : opts.filter((k) => options[k]).reduce((options2, k) => { options2[k] = true; return options2; }, {}); module2.exports = parseOptions; }); // node_modules/semver/internal/identifiers.js var require_identifiers = __commonJS((exports2, module2) => { var numeric = /^[0-9]+$/; var compareIdentifiers = (a, b) => { const anum = numeric.test(a); const bnum = numeric.test(b); if (anum && bnum) { a = +a; b = +b; } return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1; }; var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a); module2.exports = { compareIdentifiers, rcompareIdentifiers }; }); // node_modules/semver/classes/semver.js var require_semver = __commonJS((exports2, module2) => { var debug = require_debug(); var {MAX_LENGTH, MAX_SAFE_INTEGER} = require_constants2(); var {re, t} = require_re(); var parseOptions = require_parse_options(); var {compareIdentifiers} = require_identifiers(); var SemVer = class { constructor(version, options) { options = parseOptions(options); if (version instanceof SemVer) { if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) { return version; } else { version = version.version; } } else if (typeof version !== "string") { throw new TypeError(`Invalid Version: ${version}`); } if (version.length > MAX_LENGTH) { throw new TypeError(`version is longer than ${MAX_LENGTH} characters`); } debug("SemVer", version, options); this.options = options; this.loose = !!options.loose; this.includePrerelease = !!options.includePrerelease; const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]); if (!m) { throw new TypeError(`Invalid Version: ${version}`); } this.raw = version; this.major = +m[1]; this.minor = +m[2]; this.patch = +m[3]; if (this.major > MAX_SAFE_INTEGER || this.major < 0) { throw new TypeError("Invalid major version"); } if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { throw new TypeError("Invalid minor version"); } if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { throw new TypeError("Invalid patch version"); } if (!m[4]) { this.prerelease = []; } else { this.prerelease = m[4].split(".").map((id) => { if (/^[0-9]+$/.test(id)) { const num = +id; if (num >= 0 && num < MAX_SAFE_INTEGER) { return num; } } return id; }); } this.build = m[5] ? m[5].split(".") : []; this.format(); } format() { this.version = `${this.major}.${this.minor}.${this.patch}`; if (this.prerelease.length) { this.version += `-${this.prerelease.join(".")}`; } return this.version; } toString() { return this.version; } compare(other) { debug("SemVer.compare", this.version, this.options, other); if (!(other instanceof SemVer)) { if (typeof other === "string" && other === this.version) { return 0; } other = new SemVer(other, this.options); } if (other.version === this.version) { return 0; } return this.compareMain(other) || this.comparePre(other); } compareMain(other) { if (!(other instanceof SemVer)) { other = new SemVer(other, this.options); } return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch); } comparePre(other) { if (!(other instanceof SemVer)) { other = new SemVer(other, this.options); } if (this.prerelease.length && !other.prerelease.length) { return -1; } else if (!this.prerelease.length && other.prerelease.length) { return 1; } else if (!this.prerelease.length && !other.prerelease.length) { return 0; } let i = 0; do { const a = this.prerelease[i]; const b = other.prerelease[i]; debug("prerelease compare", i, a, b); if (a === void 0 && b === void 0) { return 0; } else if (b === void 0) { return 1; } else if (a === void 0) { return -1; } else if (a === b) { continue; } else { return compareIdentifiers(a, b); } } while (++i); } compareBuild(other) { if (!(other instanceof SemVer)) { other = new SemVer(other, this.options); } let i = 0; do { const a = this.build[i]; const b = other.build[i]; debug("prerelease compare", i, a, b); if (a === void 0 && b === void 0) { return 0; } else if (b === void 0) { return 1; } else if (a === void 0) { return -1; } else if (a === b) { continue; } else { return compareIdentifiers(a, b); } } while (++i); } inc(release, identifier) { switch (release) { case "premajor": this.prerelease.length = 0; this.patch = 0; this.minor = 0; this.major++; this.inc("pre", identifier); break; case "preminor": this.prerelease.length = 0; this.patch = 0; this.minor++; this.inc("pre", identifier); break; case "prepatch": this.prerelease.length = 0; this.inc("patch", identifier); this.inc("pre", identifier); break; case "prerelease": if (this.prerelease.length === 0) { this.inc("patch", identifier); } this.inc("pre", identifier); break; case "major": if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { this.major++; } this.minor = 0; this.patch = 0; this.prerelease = []; break; case "minor": if (this.patch !== 0 || this.prerelease.length === 0) { this.minor++; } this.patch = 0; this.prerelease = []; break; case "patch": if (this.prerelease.length === 0) { this.patch++; } this.prerelease = []; break; case "pre": if (this.prerelease.length === 0) { this.prerelease = [0]; } else { let i = this.prerelease.length; while (--i >= 0) { if (typeof this.prerelease[i] === "number") { this.prerelease[i]++; i = -2; } } if (i === -1) { this.prerelease.push(0); } } if (identifier) { if (this.prerelease[0] === identifier) { if (isNaN(this.prerelease[1])) { this.prerelease = [identifier, 0]; } } else { this.prerelease = [identifier, 0]; } } break; default: throw new Error(`invalid increment argument: ${release}`); } this.format(); this.raw = this.version; return this; } }; module2.exports = SemVer; }); // node_modules/semver/functions/parse.js var require_parse2 = __commonJS((exports2, module2) => { var {MAX_LENGTH} = require_constants2(); var {re, t} = require_re(); var SemVer = require_semver(); var parseOptions = require_parse_options(); var parse = (version, options) => { options = parseOptions(options); if (version instanceof SemVer) { return version; } if (typeof version !== "string") { return null; } if (version.length > MAX_LENGTH) { return null; } const r = options.loose ? re[t.LOOSE] : re[t.FULL]; if (!r.test(version)) { return null; } try { return new SemVer(version, options); } catch (er) { return null; } }; module2.exports = parse; }); // node_modules/semver/functions/valid.js var require_valid = __commonJS((exports2, module2) => { var parse = require_parse2(); var valid = (version, options) => { const v = parse(version, options); return v ? v.version : null; }; module2.exports = valid; }); // node_modules/semver/functions/clean.js var require_clean = __commonJS((exports2, module2) => { var parse = require_parse2(); var clean = (version, options) => { const s = parse(version.trim().replace(/^[=v]+/, ""), options); return s ? s.version : null; }; module2.exports = clean; }); // node_modules/semver/functions/inc.js var require_inc = __commonJS((exports2, module2) => { var SemVer = require_semver(); var inc = (version, release, options, identifier) => { if (typeof options === "string") { identifier = options; options = void 0; } try { return new SemVer(version, options).inc(release, identifier).version; } catch (er) { return null; } }; module2.exports = inc; }); // node_modules/semver/functions/compare.js var require_compare = __commonJS((exports2, module2) => { var SemVer = require_semver(); var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose)); module2.exports = compare; }); // node_modules/semver/functions/eq.js var require_eq = __commonJS((exports2, module2) => { var compare = require_compare(); var eq = (a, b, loose) => compare(a, b, loose) === 0; module2.exports = eq; }); // node_modules/semver/functions/diff.js var require_diff = __commonJS((exports2, module2) => { var parse = require_parse2(); var eq = require_eq(); var diff = (version1, version2) => { if (eq(version1, version2)) { return null; } else { const v1 = parse(version1); const v2 = parse(version2); const hasPre = v1.prerelease.length || v2.prerelease.length; const prefix = hasPre ? "pre" : ""; const defaultResult = hasPre ? "prerelease" : ""; for (const key in v1) { if (key === "major" || key === "minor" || key === "patch") { if (v1[key] !== v2[key]) { return prefix + key; } } } return defaultResult; } }; module2.exports = diff; }); // node_modules/semver/functions/major.js var require_major = __commonJS((exports2, module2) => { var SemVer = require_semver(); var major = (a, loose) => new SemVer(a, loose).major; module2.exports = major; }); // node_modules/semver/functions/minor.js var require_minor = __commonJS((exports2, module2) => { var SemVer = require_semver(); var minor = (a, loose) => new SemVer(a, loose).minor; module2.exports = minor; }); // node_modules/semver/functions/patch.js var require_patch = __commonJS((exports2, module2) => { var SemVer = require_semver(); var patch = (a, loose) => new SemVer(a, loose).patch; module2.exports = patch; }); // node_modules/semver/functions/prerelease.js var require_prerelease = __commonJS((exports2, module2) => { var parse = require_parse2(); var prerelease = (version, options) => { const parsed = parse(version, options); return parsed && parsed.prerelease.length ? parsed.prerelease : null; }; module2.exports = prerelease; }); // node_modules/semver/functions/rcompare.js var require_rcompare = __commonJS((exports2, module2) => { var compare = require_compare(); var rcompare = (a, b, loose) => compare(b, a, loose); module2.exports = rcompare; }); // node_modules/semver/functions/compare-loose.js var require_compare_loose = __commonJS((exports2, module2) => { var compare = require_compare(); var compareLoose = (a, b) => compare(a, b, true); module2.exports = compareLoose; }); // node_modules/semver/functions/compare-build.js var require_compare_build = __commonJS((exports2, module2) => { var SemVer = require_semver(); var compareBuild = (a, b, loose) => { const versionA = new SemVer(a, loose); const versionB = new SemVer(b, loose); return versionA.compare(versionB) || versionA.compareBuild(versionB); }; module2.exports = compareBuild; }); // node_modules/semver/functions/sort.js var require_sort = __commonJS((exports2, module2) => { var compareBuild = require_compare_build(); var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose)); module2.exports = sort; }); // node_modules/semver/functions/rsort.js var require_rsort = __commonJS((exports2, module2) => { var compareBuild = require_compare_build(); var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)); module2.exports = rsort; }); // node_modules/semver/functions/gt.js var require_gt = __commonJS((exports2, module2) => { var compare = require_compare(); var gt = (a, b, loose) => compare(a, b, loose) > 0; module2.exports = gt; }); // node_modules/semver/functions/lt.js var require_lt = __commonJS((exports2, module2) => { var compare = require_compare(); var lt = (a, b, loose) => compare(a, b, loose) < 0; module2.exports = lt; }); // node_modules/semver/functions/neq.js var require_neq = __commonJS((exports2, module2) => { var compare = require_compare(); var neq = (a, b, loose) => compare(a, b, loose) !== 0; module2.exports = neq; }); // node_modules/semver/functions/gte.js var require_gte = __commonJS((exports2, module2) => { var compare = require_compare(); var gte = (a, b, loose) => compare(a, b, loose) >= 0; module2.exports = gte; }); // node_modules/semver/functions/lte.js var require_lte = __commonJS((exports2, module2) => { var compare = require_compare(); var lte = (a, b, loose) => compare(a, b, loose) <= 0; module2.exports = lte; }); // node_modules/semver/functions/cmp.js var require_cmp = __commonJS((exports2, module2) => { var eq = require_eq(); var neq = require_neq(); var gt = require_gt(); var gte = require_gte(); var lt = require_lt(); var lte = require_lte(); var cmp = (a, op, b, loose) => { switch (op) { case "===": if (typeof a === "object") a = a.version; if (typeof b === "object") b = b.version; return a === b; case "!==": if (typeof a === "object") a = a.version; if (typeof b === "object") b = b.version; return a !== b; case "": case "=": case "==": return eq(a, b, loose); case "!=": return neq(a, b, loose); case ">": return gt(a, b, loose); case ">=": return gte(a, b, loose); case "<": return lt(a, b, loose); case "<=": return lte(a, b, loose); default: throw new TypeError(`Invalid operator: ${op}`); } }; module2.exports = cmp; }); // node_modules/semver/functions/coerce.js var require_coerce = __commonJS((exports2, module2) => { var SemVer = require_semver(); var parse = require_parse2(); var {re, t} = require_re(); var coerce = (version, options) => { if (version instanceof SemVer) { return version; } if (typeof version === "number") { version = String(version); } if (typeof version !== "string") { return null; } options = options || {}; let match = null; if (!options.rtl) { match = version.match(re[t.COERCE]); } else { let next; while ((next = re[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) { if (!match || next.index + next[0].length !== match.index + match[0].length) { match = next; } re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length; } re[t.COERCERTL].lastIndex = -1; } if (match === null) return null; return parse(`${match[2]}.${match[3] || "0"}.${match[4] || "0"}`, options); }; module2.exports = coerce; }); // node_modules/yallist/iterator.js var require_iterator = __commonJS((exports2, module2) => { "use strict"; module2.exports = function(Yallist) { Yallist.prototype[Symbol.iterator] = function* () { for (let walker = this.head; walker; walker = walker.next) { yield walker.value; } }; }; }); // node_modules/yallist/yallist.js var require_yallist = __commonJS((exports2, module2) => { "use strict"; module2.exports = Yallist; Yallist.Node = Node; Yallist.create = Yallist; function Yallist(list) { var self2 = this; if (!(self2 instanceof Yallist)) { self2 = new Yallist(); } self2.tail = null; self2.head = null; self2.length = 0; if (list && typeof list.forEach === "function") { list.forEach(function(item) { self2.push(item); }); } else if (arguments.length > 0) { for (var i = 0, l = arguments.length; i < l; i++) { self2.push(arguments[i]); } } return self2; } Yallist.prototype.removeNode = function(node) { if (node.list !== this) { throw new Error("removing node which does not belong to this list"); } var next = node.next; var prev = node.prev; if (next) { next.prev = prev; } if (prev) { prev.next = next; } if (node === this.head) { this.head = next; } if (node === this.tail) { this.tail = prev; } node.list.length--; node.next = null; node.prev = null; node.list = null; return next; }; Yallist.prototype.unshiftNode = function(node) { if (node === this.head) { return; } if (node.list) { node.list.removeNode(node); } var head = this.head; node.list = this; node.next = head; if (head) { head.prev = node; } this.head = node; if (!this.tail) { this.tail = node; } this.length++; }; Yallist.prototype.pushNode = function(node) { if (node === this.tail) { return; } if (node.list) { node.list.removeNode(node); } var tail = this.tail; node.list = this; node.prev = tail; if (tail) { tail.next = node; } this.tail = node; if (!this.head) { this.head = node; } this.length++; }; Yallist.prototype.push = function() { for (var i = 0, l = arguments.length; i < l; i++) { push(this, arguments[i]); } return this.length; }; Yallist.prototype.unshift = function() { for (var i = 0, l = arguments.length; i < l; i++) { unshift(this, arguments[i]); } return this.length; }; Yallist.prototype.pop = function() { if (!this.tail) { return void 0; } var res = this.tail.value; this.tail = this.tail.prev; if (this.tail) { this.tail.next = null; } else { this.head = null; } this.length--; return res; }; Yallist.prototype.shift = function() { if (!this.head) { return void 0; } var res = this.head.value; this.head = this.head.next; if (this.head) { this.head.prev = null; } else { this.tail = null; } this.length--; return res; }; Yallist.prototype.forEach = function(fn, thisp) { thisp = thisp || this; for (var walker = this.head, i = 0; walker !== null; i++) { fn.call(thisp, walker.value, i, this); walker = walker.next; } }; Yallist.prototype.forEachReverse = function(fn, thisp) { thisp = thisp || this; for (var walker = this.tail, i = this.length - 1; walker !== null; i--) { fn.call(thisp, walker.value, i, this); walker = walker.prev; } }; Yallist.prototype.get = function(n) { for (var i = 0, walker = this.head; walker !== null && i < n; i++) { walker = walker.next; } if (i === n && walker !== null) { return walker.value; } }; Yallist.prototype.getReverse = function(n) { for (var i = 0, walker = this.tail; walker !== null && i < n; i++) { walker = walker.prev; } if (i === n && walker !== null) { return walker.value; } }; Yallist.prototype.map = function(fn, thisp) { thisp = thisp || this; var res = new Yallist(); for (var walker = this.head; walker !== null; ) { res.push(fn.call(thisp, walker.value, this)); walker = walker.next; } return res; }; Yallist.prototype.mapReverse = function(fn, thisp) { thisp = thisp || this; var res = new Yallist(); for (var walker = this.tail; walker !== null; ) { res.push(fn.call(thisp, walker.value, this)); walker = walker.prev; } return res; }; Yallist.prototype.reduce = function(fn, initial) { var acc; var walker = this.head; if (arguments.length > 1) { acc = initial; } else if (this.head) { walker = this.head.next; acc = this.head.value; } else { throw new TypeError("Reduce of empty list with no initial value"); } for (var i = 0; walker !== null; i++) { acc = fn(acc, walker.value, i); walker = walker.next; } return acc; }; Yallist.prototype.reduceReverse = function(fn, initial) { var acc; var walker = this.tail; if (arguments.length > 1) { acc = initial; } else if (this.tail) { walker = this.tail.prev; acc = this.tail.value; } else { throw new TypeError("Reduce of empty list with no initial value"); } for (var i = this.length - 1; walker !== null; i--) { acc = fn(acc, walker.value, i); walker = walker.prev; } return acc; }; Yallist.prototype.toArray = function() { var arr = new Array(this.length); for (var i = 0, walker = this.head; walker !== null; i++) { arr[i] = walker.value; walker = walker.next; } return arr; }; Yallist.prototype.toArrayReverse = function() { var arr = new Array(this.length); for (var i = 0, walker = this.tail; walker !== null; i++) { arr[i] = walker.value; walker = walker.prev; } return arr; }; Yallist.prototype.slice = function(from, to) { to = to || this.length; if (to < 0) { to += this.length; } from = from || 0; if (from < 0) { from += this.length; } var ret2 = new Yallist(); if (to < from || to < 0) { return ret2; } if (from < 0) { from = 0; } if (to > this.length) { to = this.length; } for (var i = 0, walker = this.head; walker !== null && i < from; i++) { walker = walker.next; } for (; walker !== null && i < to; i++, walker = walker.next) { ret2.push(walker.value); } return ret2; }; Yallist.prototype.sliceReverse = function(from, to) { to = to || this.length; if (to < 0) { to += this.length; } from = from || 0; if (from < 0) { from += this.length; } var ret2 = new Yallist(); if (to < from || to < 0) { return ret2; } if (from < 0) { from = 0; } if (to > this.length) { to = this.length; } for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) { walker = walker.prev; } for (; walker !== null && i > from; i--, walker = walker.prev) { ret2.push(walker.value); } return ret2; }; Yallist.prototype.splice = function(start, deleteCount, ...nodes) { if (start > this.length) { start = this.length - 1; } if (start < 0) { start = this.length + start; } for (var i = 0, walker = this.head; walker !== null && i < start; i++) { walker = walker.next; } var ret2 = []; for (var i = 0; walker && i < deleteCount; i++) { ret2.push(walker.value); walker = this.removeNode(walker); } if (walker === null) { walker = this.tail; } if (walker !== this.head && walker !== this.tail) { walker = walker.prev; } for (var i = 0; i < nodes.length; i++) { walker = insert(this, walker, nodes[i]); } return ret2; }; Yallist.prototype.reverse = function() { var head = this.head; var tail = this.tail; for (var walker = head; walker !== null; walker = walker.prev) { var p = walker.prev; walker.prev = walker.next; walker.next = p; } this.head = tail; this.tail = head; return this; }; function insert(self2, node, value) { var inserted = node === self2.head ? new Node(value, null, node, self2) : new Node(value, node, node.next, self2); if (inserted.next === null) { self2.tail = inserted; } if (inserted.prev === null) { self2.head = inserted; } self2.length++; return inserted; } function push(self2, item) { self2.tail = new Node(item, self2.tail, null, self2); if (!self2.head) { self2.head = self2.tail; } self2.length++; } function unshift(self2, item) { self2.head = new Node(item, null, self2.head, self2); if (!self2.tail) { self2.tail = self2.head; } self2.length++; } function Node(value, prev, next, list) { if (!(this instanceof Node)) { return new Node(value, prev, next, list); } this.list = list; this.value = value; if (prev) { prev.next = this; this.prev = prev; } else { this.prev = null; } if (next) { next.prev = this; this.next = next; } else { this.next = null; } } try { require_iterator()(Yallist); } catch (er) { } }); // node_modules/lru-cache/index.js var require_lru_cache = __commonJS((exports2, module2) => { "use strict"; var Yallist = require_yallist(); var MAX = Symbol("max"); var LENGTH = Symbol("length"); var LENGTH_CALCULATOR = Symbol("lengthCalculator"); var ALLOW_STALE = Symbol("allowStale"); var MAX_AGE = Symbol("maxAge"); var DISPOSE = Symbol("dispose"); var NO_DISPOSE_ON_SET = Symbol("noDisposeOnSet"); var LRU_LIST = Symbol("lruList"); var CACHE = Symbol("cache"); var UPDATE_AGE_ON_GET = Symbol("updateAgeOnGet"); var naiveLength = () => 1; var LRUCache = class { constructor(options) { if (typeof options === "number") options = {max: options}; if (!options) options = {}; if (options.max && (typeof options.max !== "number" || options.max < 0)) throw new TypeError("max must be a non-negative number"); const max = this[MAX] = options.max || Infinity; const lc = options.length || naiveLength; this[LENGTH_CALCULATOR] = typeof lc !== "function" ? naiveLength : lc; this[ALLOW_STALE] = options.stale || false; if (options.maxAge && typeof options.maxAge !== "number") throw new TypeError("maxAge must be a number"); this[MAX_AGE] = options.maxAge || 0; this[DISPOSE] = options.dispose; this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false; this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false; this.reset(); } set max(mL) { if (typeof mL !== "number" || mL < 0) throw new TypeError("max must be a non-negative number"); this[MAX] = mL || Infinity; trim(this); } get max() { return this[MAX]; } set allowStale(allowStale) { this[ALLOW_STALE] = !!allowStale; } get allowStale() { return this[ALLOW_STALE]; } set maxAge(mA) { if (typeof mA !== "number") throw new TypeError("maxAge must be a non-negative number"); this[MAX_AGE] = mA; trim(this); } get maxAge() { return this[MAX_AGE]; } set lengthCalculator(lC) { if (typeof lC !== "function") lC = naiveLength; if (lC !== this[LENGTH_CALCULATOR]) { this[LENGTH_CALCULATOR] = lC; this[LENGTH] = 0; this[LRU_LIST].forEach((hit) => { hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key); this[LENGTH] += hit.length; }); } trim(this); } get lengthCalculator() { return this[LENGTH_CALCULATOR]; } get length() { return this[LENGTH]; } get itemCount() { return this[LRU_LIST].length; } rforEach(fn, thisp) { thisp = thisp || this; for (let walker = this[LRU_LIST].tail; walker !== null; ) { const prev = walker.prev; forEachStep(this, fn, walker, thisp); walker = prev; } } forEach(fn, thisp) { thisp = thisp || this; for (let walker = this[LRU_LIST].head; walker !== null; ) { const next = walker.next; forEachStep(this, fn, walker, thisp); walker = next; } } keys() { return this[LRU_LIST].toArray().map((k) => k.key); } values() { return this[LRU_LIST].toArray().map((k) => k.value); } reset() { if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) { this[LRU_LIST].forEach((hit) => this[DISPOSE](hit.key, hit.value)); } this[CACHE] = new Map(); this[LRU_LIST] = new Yallist(); this[LENGTH] = 0; } dump() { return this[LRU_LIST].map((hit) => isStale(this, hit) ? false : { k: hit.key, v: hit.value, e: hit.now + (hit.maxAge || 0) }).toArray().filter((h) => h); } dumpLru() { return this[LRU_LIST]; } set(key, value, maxAge) { maxAge = maxAge || this[MAX_AGE]; if (maxAge && typeof maxAge !== "number") throw new TypeError("maxAge must be a number"); const now = maxAge ? Date.now() : 0; const len = this[LENGTH_CALCULATOR](value, key); if (this[CACHE].has(key)) { if (len > this[MAX]) { del(this, this[CACHE].get(key)); return false; } const node = this[CACHE].get(key); const item = node.value; if (this[DISPOSE]) { if (!this[NO_DISPOSE_ON_SET]) this[DISPOSE](key, item.value); } item.now = now; item.maxAge = maxAge; item.value = value; this[LENGTH] += len - item.length; item.length = len; this.get(key); trim(this); return true; } const hit = new Entry(key, value, len, now, maxAge); if (hit.length > this[MAX]) { if (this[DISPOSE]) this[DISPOSE](key, value); return false; } this[LENGTH] += hit.length; this[LRU_LIST].unshift(hit); this[CACHE].set(key, this[LRU_LIST].head); trim(this); return true; } has(key) { if (!this[CACHE].has(key)) return false; const hit = this[CACHE].get(key).value; return !isStale(this, hit); } get(key) { return get(this, key, true); } peek(key) { return get(this, key, false); } pop() { const node = this[LRU_LIST].tail; if (!node) return null; del(this, node); return node.value; } del(key) { del(this, this[CACHE].get(key)); } load(arr) { this.reset(); const now = Date.now(); for (let l = arr.length - 1; l >= 0; l--) { const hit = arr[l]; const expiresAt = hit.e || 0; if (expiresAt === 0) this.set(hit.k, hit.v); else { const maxAge = expiresAt - now; if (maxAge > 0) { this.set(hit.k, hit.v, maxAge); } } } } prune() { this[CACHE].forEach((value, key) => get(this, key, false)); } }; var get = (self2, key, doUse) => { const node = self2[CACHE].get(key); if (node) { const hit = node.value; if (isStale(self2, hit)) { del(self2, node); if (!self2[ALLOW_STALE]) return void 0; } else { if (doUse) { if (self2[UPDATE_AGE_ON_GET]) node.value.now = Date.now(); self2[LRU_LIST].unshiftNode(node); } } return hit.value; } }; var isStale = (self2, hit) => { if (!hit || !hit.maxAge && !self2[MAX_AGE]) return false; const diff = Date.now() - hit.now; return hit.maxAge ? diff > hit.maxAge : self2[MAX_AGE] && diff > self2[MAX_AGE]; }; var trim = (self2) => { if (self2[LENGTH] > self2[MAX]) { for (let walker = self2[LRU_LIST].tail; self2[LENGTH] > self2[MAX] && walker !== null; ) { const prev = walker.prev; del(self2, walker); walker = prev; } } }; var del = (self2, node) => { if (node) { const hit = node.value; if (self2[DISPOSE]) self2[DISPOSE](hit.key, hit.value); self2[LENGTH] -= hit.length; self2[CACHE].delete(hit.key); self2[LRU_LIST].removeNode(node); } }; var Entry = class { constructor(key, value, length, now, maxAge) { this.key = key; this.value = value; this.length = length; this.now = now; this.maxAge = maxAge || 0; } }; var forEachStep = (self2, fn, node, thisp) => { let hit = node.value; if (isStale(self2, hit)) { del(self2, node); if (!self2[ALLOW_STALE]) hit = void 0; } if (hit) fn.call(thisp, hit.value, hit.key, self2); }; module2.exports = LRUCache; }); // node_modules/semver/classes/range.js var require_range = __commonJS((exports2, module2) => { var Range3 = class { constructor(range, options) { options = parseOptions(options); if (range instanceof Range3) { if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { return range; } else { return new Range3(range.raw, options); } } if (range instanceof Comparator) { this.raw = range.value; this.set = [[range]]; this.format(); return this; } this.options = options; this.loose = !!options.loose; this.includePrerelease = !!options.includePrerelease; this.raw = range; this.set = range.split(/\s*\|\|\s*/).map((range2) => this.parseRange(range2.trim())).filter((c) => c.length); if (!this.set.length) { throw new TypeError(`Invalid SemVer Range: ${range}`); } if (this.set.length > 1) { const first = this.set[0]; this.set = this.set.filter((c) => !isNullSet(c[0])); if (this.set.length === 0) this.set = [first]; else if (this.set.length > 1) { for (const c of this.set) { if (c.length === 1 && isAny(c[0])) { this.set = [c]; break; } } } } this.format(); } format() { this.range = this.set.map((comps) => { return comps.join(" ").trim(); }).join("||").trim(); return this.range; } toString() { return this.range; } parseRange(range) { range = range.trim(); const memoOpts = Object.keys(this.options).join(","); const memoKey = `parseRange:${memoOpts}:${range}`; const cached = cache.get(memoKey); if (cached) return cached; const loose = this.options.loose; const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]; range = range.replace(hr, hyphenReplace(this.options.includePrerelease)); debug("hyphen replace", range); range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace); debug("comparator trim", range, re[t.COMPARATORTRIM]); range = range.replace(re[t.TILDETRIM], tildeTrimReplace); range = range.replace(re[t.CARETTRIM], caretTrimReplace); range = range.split(/\s+/).join(" "); const compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]; const rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options)).filter(this.options.loose ? (comp) => !!comp.match(compRe) : () => true).map((comp) => new Comparator(comp, this.options)); const l = rangeList.length; const rangeMap = new Map(); for (const comp of rangeList) { if (isNullSet(comp)) return [comp]; rangeMap.set(comp.value, comp); } if (rangeMap.size > 1 && rangeMap.has("")) rangeMap.delete(""); const result = [...rangeMap.values()]; cache.set(memoKey, result); return result; } intersects(range, options) { if (!(range instanceof Range3)) { throw new TypeError("a Range is required"); } return this.set.some((thisComparators) => { return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => { return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => { return rangeComparators.every((rangeComparator) => { return thisComparator.intersects(rangeComparator, options); }); }); }); }); } test(version) { if (!version) { return false; } if (typeof version === "string") { try { version = new SemVer(version, this.options); } catch (er) { return false; } } for (let i = 0; i < this.set.length; i++) { if (testSet(this.set[i], version, this.options)) { return true; } } return false; } }; module2.exports = Range3; var LRU = require_lru_cache(); var cache = new LRU({max: 1e3}); var parseOptions = require_parse_options(); var Comparator = require_comparator(); var debug = require_debug(); var SemVer = require_semver(); var { re, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re(); var isNullSet = (c) => c.value === "<0.0.0-0"; var isAny = (c) => c.value === ""; var isSatisfiable = (comparators, options) => { let result = true; const remainingComparators = comparators.slice(); let testComparator = remainingComparators.pop(); while (result && remainingComparators.length) { result = remainingComparators.every((otherComparator) => { return testComparator.intersects(otherComparator, options); }); testComparator = remainingComparators.pop(); } return result; }; var parseComparator = (comp, options) => { debug("comp", comp, options); comp = replaceCarets(comp, options); debug("caret", comp); comp = replaceTildes(comp, options); debug("tildes", comp); comp = replaceXRanges(comp, options); debug("xrange", comp); comp = replaceStars(comp, options); debug("stars", comp); return comp; }; var isX = (id) => !id || id.toLowerCase() === "x" || id === "*"; var replaceTildes = (comp, options) => comp.trim().split(/\s+/).map((comp2) => { return replaceTilde(comp2, options); }).join(" "); var replaceTilde = (comp, options) => { const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]; return comp.replace(r, (_, M, m, p, pr) => { debug("tilde", comp, _, M, m, p, pr); let ret2; if (isX(M)) { ret2 = ""; } else if (isX(m)) { ret2 = `>=${M}.0.0 <${+M + 1}.0.0-0`; } else if (isX(p)) { ret2 = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`; } else if (pr) { debug("replaceTilde pr", pr); ret2 = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`; } else { ret2 = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`; } debug("tilde return", ret2); return ret2; }); }; var replaceCarets = (comp, options) => comp.trim().split(/\s+/).map((comp2) => { return replaceCaret(comp2, options); }).join(" "); var replaceCaret = (comp, options) => { debug("caret", comp, options); const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]; const z = options.includePrerelease ? "-0" : ""; return comp.replace(r, (_, M, m, p, pr) => { debug("caret", comp, _, M, m, p, pr); let ret2; if (isX(M)) { ret2 = ""; } else if (isX(m)) { ret2 = `>=${M}.0.0${z} <${+M + 1}.0.0-0`; } else if (isX(p)) { if (M === "0") { ret2 = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`; } else { ret2 = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`; } } else if (pr) { debug("replaceCaret pr", pr); if (M === "0") { if (m === "0") { ret2 = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`; } else { ret2 = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`; } } else { ret2 = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`; } } else { debug("no pr"); if (M === "0") { if (m === "0") { ret2 = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`; } else { ret2 = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`; } } else { ret2 = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`; } } debug("caret return", ret2); return ret2; }); }; var replaceXRanges = (comp, options) => { debug("replaceXRanges", comp, options); return comp.split(/\s+/).map((comp2) => { return replaceXRange(comp2, options); }).join(" "); }; var replaceXRange = (comp, options) => { comp = comp.trim(); const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]; return comp.replace(r, (ret2, gtlt, M, m, p, pr) => { debug("xRange", comp, ret2, gtlt, M, m, p, pr); const xM = isX(M); const xm = xM || isX(m); const xp = xm || isX(p); const anyX = xp; if (gtlt === "=" && anyX) { gtlt = ""; } pr = options.includePrerelease ? "-0" : ""; if (xM) { if (gtlt === ">" || gtlt === "<") { ret2 = "<0.0.0-0"; } else { ret2 = "*"; } } else if (gtlt && anyX) { if (xm) { m = 0; } p = 0; if (gtlt === ">") { gtlt = ">="; if (xm) { M = +M + 1; m = 0; p = 0; } else { m = +m + 1; p = 0; } } else if (gtlt === "<=") { gtlt = "<"; if (xm) { M = +M + 1; } else { m = +m + 1; } } if (gtlt === "<") pr = "-0"; ret2 = `${gtlt + M}.${m}.${p}${pr}`; } else if (xm) { ret2 = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`; } else if (xp) { ret2 = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`; } debug("xRange return", ret2); return ret2; }); }; var replaceStars = (comp, options) => { debug("replaceStars", comp, options); return comp.trim().replace(re[t.STAR], ""); }; var replaceGTE0 = (comp, options) => { debug("replaceGTE0", comp, options); return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], ""); }; var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) => { if (isX(fM)) { from = ""; } else if (isX(fm)) { from = `>=${fM}.0.0${incPr ? "-0" : ""}`; } else if (isX(fp)) { from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`; } else if (fpr) { from = `>=${from}`; } else { from = `>=${from}${incPr ? "-0" : ""}`; } if (isX(tM)) { to = ""; } else if (isX(tm)) { to = `<${+tM + 1}.0.0-0`; } else if (isX(tp)) { to = `<${tM}.${+tm + 1}.0-0`; } else if (tpr) { to = `<=${tM}.${tm}.${tp}-${tpr}`; } else if (incPr) { to = `<${tM}.${tm}.${+tp + 1}-0`; } else { to = `<=${to}`; } return `${from} ${to}`.trim(); }; var testSet = (set, version, options) => { for (let i = 0; i < set.length; i++) { if (!set[i].test(version)) { return false; } } if (version.prerelease.length && !options.includePrerelease) { for (let i = 0; i < set.length; i++) { debug(set[i].semver); if (set[i].semver === Comparator.ANY) { continue; } if (set[i].semver.prerelease.length > 0) { const allowed = set[i].semver; if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { return true; } } } return false; } return true; }; }); // node_modules/semver/classes/comparator.js var require_comparator = __commonJS((exports2, module2) => { var ANY = Symbol("SemVer ANY"); var Comparator = class { static get ANY() { return ANY; } constructor(comp, options) { options = parseOptions(options); if (comp instanceof Comparator) { if (comp.loose === !!options.loose) { return comp; } else { comp = comp.value; } } debug("comparator", comp, options); this.options = options; this.loose = !!options.loose; this.parse(comp); if (this.semver === ANY) { this.value = ""; } else { this.value = this.operator + this.semver.version; } debug("comp", this); } parse(comp) { const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]; const m = comp.match(r); if (!m) { throw new TypeError(`Invalid comparator: ${comp}`); } this.operator = m[1] !== void 0 ? m[1] : ""; if (this.operator === "=") { this.operator = ""; } if (!m[2]) { this.semver = ANY; } else { this.semver = new SemVer(m[2], this.options.loose); } } toString() { return this.value; } test(version) { debug("Comparator.test", version, this.options.loose); if (this.semver === ANY || version === ANY) { return true; } if (typeof version === "string") { try { version = new SemVer(version, this.options); } catch (er) { return false; } } return cmp(version, this.operator, this.semver, this.options); } intersects(comp, options) { if (!(comp instanceof Comparator)) { throw new TypeError("a Comparator is required"); } if (!options || typeof options !== "object") { options = { loose: !!options, includePrerelease: false }; } if (this.operator === "") { if (this.value === "") { return true; } return new Range3(comp.value, options).test(this.value); } else if (comp.operator === "") { if (comp.value === "") { return true; } return new Range3(this.value, options).test(comp.semver); } const sameDirectionIncreasing = (this.operator === ">=" || this.operator === ">") && (comp.operator === ">=" || comp.operator === ">"); const sameDirectionDecreasing = (this.operator === "<=" || this.operator === "<") && (comp.operator === "<=" || comp.operator === "<"); const sameSemVer = this.semver.version === comp.semver.version; const differentDirectionsInclusive = (this.operator === ">=" || this.operator === "<=") && (comp.operator === ">=" || comp.operator === "<="); const oppositeDirectionsLessThan = cmp(this.semver, "<", comp.semver, options) && (this.operator === ">=" || this.operator === ">") && (comp.operator === "<=" || comp.operator === "<"); const oppositeDirectionsGreaterThan = cmp(this.semver, ">", comp.semver, options) && (this.operator === "<=" || this.operator === "<") && (comp.operator === ">=" || comp.operator === ">"); return sameDirectionIncreasing || sameDirectionDecreasing || sameSemVer && differentDirectionsInclusive || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan; } }; module2.exports = Comparator; var parseOptions = require_parse_options(); var {re, t} = require_re(); var cmp = require_cmp(); var debug = require_debug(); var SemVer = require_semver(); var Range3 = require_range(); }); // node_modules/semver/functions/satisfies.js var require_satisfies = __commonJS((exports2, module2) => { var Range3 = require_range(); var satisfies = (version, range, options) => { try { range = new Range3(range, options); } catch (er) { return false; } return range.test(version); }; module2.exports = satisfies; }); // node_modules/semver/ranges/to-comparators.js var require_to_comparators = __commonJS((exports2, module2) => { var Range3 = require_range(); var toComparators = (range, options) => new Range3(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" ")); module2.exports = toComparators; }); // node_modules/semver/ranges/max-satisfying.js var require_max_satisfying = __commonJS((exports2, module2) => { var SemVer = require_semver(); var Range3 = require_range(); var maxSatisfying = (versions, range, options) => { let max = null; let maxSV = null; let rangeObj = null; try { rangeObj = new Range3(range, options); } catch (er) { return null; } versions.forEach((v) => { if (rangeObj.test(v)) { if (!max || maxSV.compare(v) === -1) { max = v; maxSV = new SemVer(max, options); } } }); return max; }; module2.exports = maxSatisfying; }); // node_modules/semver/ranges/min-satisfying.js var require_min_satisfying = __commonJS((exports2, module2) => { var SemVer = require_semver(); var Range3 = require_range(); var minSatisfying = (versions, range, options) => { let min = null; let minSV = null; let rangeObj = null; try { rangeObj = new Range3(range, options); } catch (er) { return null; } versions.forEach((v) => { if (rangeObj.test(v)) { if (!min || minSV.compare(v) === 1) { min = v; minSV = new SemVer(min, options); } } }); return min; }; module2.exports = minSatisfying; }); // node_modules/semver/ranges/min-version.js var require_min_version = __commonJS((exports2, module2) => { var SemVer = require_semver(); var Range3 = require_range(); var gt = require_gt(); var minVersion = (range, loose) => { range = new Range3(range, loose); let minver = new SemVer("0.0.0"); if (range.test(minver)) { return minver; } minver = new SemVer("0.0.0-0"); if (range.test(minver)) { return minver; } minver = null; for (let i = 0; i < range.set.length; ++i) { const comparators = range.set[i]; let setMin = null; comparators.forEach((comparator) => { const compver = new SemVer(comparator.semver.version); switch (comparator.operator) { case ">": if (compver.prerelease.length === 0) { compver.patch++; } else { compver.prerelease.push(0); } compver.raw = compver.format(); case "": case ">=": if (!setMin || gt(compver, setMin)) { setMin = compver; } break; case "<": case "<=": break; default: throw new Error(`Unexpected operation: ${comparator.operator}`); } }); if (setMin && (!minver || gt(minver, setMin))) minver = setMin; } if (minver && range.test(minver)) { return minver; } return null; }; module2.exports = minVersion; }); // node_modules/semver/ranges/valid.js var require_valid2 = __commonJS((exports2, module2) => { var Range3 = require_range(); var validRange = (range, options) => { try { return new Range3(range, options).range || "*"; } catch (er) { return null; } }; module2.exports = validRange; }); // node_modules/semver/ranges/outside.js var require_outside = __commonJS((exports2, module2) => { var SemVer = require_semver(); var Comparator = require_comparator(); var {ANY} = Comparator; var Range3 = require_range(); var satisfies = require_satisfies(); var gt = require_gt(); var lt = require_lt(); var lte = require_lte(); var gte = require_gte(); var outside = (version, range, hilo, options) => { version = new SemVer(version, options); range = new Range3(range, options); let gtfn, ltefn, ltfn, comp, ecomp; switch (hilo) { case ">": gtfn = gt; ltefn = lte; ltfn = lt; comp = ">"; ecomp = ">="; break; case "<": gtfn = lt; ltefn = gte; ltfn = gt; comp = "<"; ecomp = "<="; break; default: throw new TypeError('Must provide a hilo val of "<" or ">"'); } if (satisfies(version, range, options)) { return false; } for (let i = 0; i < range.set.length; ++i) { const comparators = range.set[i]; let high = null; let low = null; comparators.forEach((comparator) => { if (comparator.semver === ANY) { comparator = new Comparator(">=0.0.0"); } high = high || comparator; low = low || comparator; if (gtfn(comparator.semver, high.semver, options)) { high = comparator; } else if (ltfn(comparator.semver, low.semver, options)) { low = comparator; } }); if (high.operator === comp || high.operator === ecomp) { return false; } if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { return false; } else if (low.operator === ecomp && ltfn(version, low.semver)) { return false; } } return true; }; module2.exports = outside; }); // node_modules/semver/ranges/gtr.js var require_gtr = __commonJS((exports2, module2) => { var outside = require_outside(); var gtr = (version, range, options) => outside(version, range, ">", options); module2.exports = gtr; }); // node_modules/semver/ranges/ltr.js var require_ltr = __commonJS((exports2, module2) => { var outside = require_outside(); var ltr = (version, range, options) => outside(version, range, "<", options); module2.exports = ltr; }); // node_modules/semver/ranges/intersects.js var require_intersects = __commonJS((exports2, module2) => { var Range3 = require_range(); var intersects = (r1, r2, options) => { r1 = new Range3(r1, options); r2 = new Range3(r2, options); return r1.intersects(r2); }; module2.exports = intersects; }); // node_modules/semver/ranges/simplify.js var require_simplify = __commonJS((exports2, module2) => { var satisfies = require_satisfies(); var compare = require_compare(); module2.exports = (versions, range, options) => { const set = []; let min = null; let prev = null; const v = versions.sort((a, b) => compare(a, b, options)); for (const version of v) { const included = satisfies(version, range, options); if (included) { prev = version; if (!min) min = version; } else { if (prev) { set.push([min, prev]); } prev = null; min = null; } } if (min) set.push([min, null]); const ranges = []; for (const [min2, max] of set) { if (min2 === max) ranges.push(min2); else if (!max && min2 === v[0]) ranges.push("*"); else if (!max) ranges.push(`>=${min2}`); else if (min2 === v[0]) ranges.push(`<=${max}`); else ranges.push(`${min2} - ${max}`); } const simplified = ranges.join(" || "); const original = typeof range.raw === "string" ? range.raw : String(range); return simplified.length < original.length ? simplified : range; }; }); // node_modules/semver/ranges/subset.js var require_subset = __commonJS((exports2, module2) => { var Range3 = require_range(); var {ANY} = require_comparator(); var satisfies = require_satisfies(); var compare = require_compare(); var subset = (sub, dom, options) => { if (sub === dom) return true; sub = new Range3(sub, options); dom = new Range3(dom, options); let sawNonNull = false; OUTER: for (const simpleSub of sub.set) { for (const simpleDom of dom.set) { const isSub = simpleSubset(simpleSub, simpleDom, options); sawNonNull = sawNonNull || isSub !== null; if (isSub) continue OUTER; } if (sawNonNull) return false; } return true; }; var simpleSubset = (sub, dom, options) => { if (sub === dom) return true; if (sub.length === 1 && sub[0].semver === ANY) return dom.length === 1 && dom[0].semver === ANY; const eqSet = new Set(); let gt, lt; for (const c of sub) { if (c.operator === ">" || c.operator === ">=") gt = higherGT(gt, c, options); else if (c.operator === "<" || c.operator === "<=") lt = lowerLT(lt, c, options); else eqSet.add(c.semver); } if (eqSet.size > 1) return null; let gtltComp; if (gt && lt) { gtltComp = compare(gt.semver, lt.semver, options); if (gtltComp > 0) return null; else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) return null; } for (const eq of eqSet) { if (gt && !satisfies(eq, String(gt), options)) return null; if (lt && !satisfies(eq, String(lt), options)) return null; for (const c of dom) { if (!satisfies(eq, String(c), options)) return false; } return true; } let higher, lower; let hasDomLT, hasDomGT; for (const c of dom) { hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">="; hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<="; if (gt) { if (c.operator === ">" || c.operator === ">=") { higher = higherGT(gt, c, options); if (higher === c && higher !== gt) return false; } else if (gt.operator === ">=" && !satisfies(gt.semver, String(c), options)) return false; } if (lt) { if (c.operator === "<" || c.operator === "<=") { lower = lowerLT(lt, c, options); if (lower === c && lower !== lt) return false; } else if (lt.operator === "<=" && !satisfies(lt.semver, String(c), options)) return false; } if (!c.operator && (lt || gt) && gtltComp !== 0) return false; } if (gt && hasDomLT && !lt && gtltComp !== 0) return false; if (lt && hasDomGT && !gt && gtltComp !== 0) return false; return true; }; var higherGT = (a, b, options) => { if (!a) return b; const comp = compare(a.semver, b.semver, options); return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a; }; var lowerLT = (a, b, options) => { if (!a) return b; const comp = compare(a.semver, b.semver, options); return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a; }; module2.exports = subset; }); // node_modules/semver/index.js var require_semver2 = __commonJS((exports2, module2) => { var internalRe = require_re(); module2.exports = { re: internalRe.re, src: internalRe.src, tokens: internalRe.t, SEMVER_SPEC_VERSION: require_constants2().SEMVER_SPEC_VERSION, SemVer: require_semver(), compareIdentifiers: require_identifiers().compareIdentifiers, rcompareIdentifiers: require_identifiers().rcompareIdentifiers, parse: require_parse2(), valid: require_valid(), clean: require_clean(), inc: require_inc(), diff: require_diff(), major: require_major(), minor: require_minor(), patch: require_patch(), prerelease: require_prerelease(), compare: require_compare(), rcompare: require_rcompare(), compareLoose: require_compare_loose(), compareBuild: require_compare_build(), sort: require_sort(), rsort: require_rsort(), gt: require_gt(), lt: require_lt(), eq: require_eq(), neq: require_neq(), gte: require_gte(), lte: require_lte(), cmp: require_cmp(), coerce: require_coerce(), Comparator: require_comparator(), Range: require_range(), satisfies: require_satisfies(), toComparators: require_to_comparators(), maxSatisfying: require_max_satisfying(), minSatisfying: require_min_satisfying(), minVersion: require_min_version(), validRange: require_valid2(), outside: require_outside(), gtr: require_gtr(), ltr: require_ltr(), intersects: require_intersects(), simplifyRange: require_simplify(), subset: require_subset() }; }); // node_modules/listenercount/index.js var require_listenercount = __commonJS((exports2, module2) => { "use strict"; var listenerCount = require("events").listenerCount; listenerCount = listenerCount || function(ee, event) { var listeners = ee && ee._events && ee._events[event]; if (Array.isArray(listeners)) { return listeners.length; } else if (typeof listeners === "function") { return 1; } else { return 0; } }; module2.exports = listenerCount; }); // node_modules/buffer-indexof-polyfill/index.js var require_buffer_indexof_polyfill = __commonJS(() => { "use strict"; if (!Buffer.prototype.indexOf) { Buffer.prototype.indexOf = function(value, offset) { offset = offset || 0; if (typeof value === "string" || value instanceof String) { value = new Buffer(value); } else if (typeof value === "number" || value instanceof Number) { value = new Buffer([value]); } var len = value.length; for (var i = offset; i <= this.length - len; i++) { var mismatch = false; for (var j = 0; j < len; j++) { if (this[i + j] != value[j]) { mismatch = true; break; } } if (!mismatch) { return i; } } return -1; }; } function bufferLastIndexOf(value, offset) { if (typeof value === "string" || value instanceof String) { value = new Buffer(value); } else if (typeof value === "number" || value instanceof Number) { value = new Buffer([value]); } var len = value.length; offset = offset || this.length - len; for (var i = offset; i >= 0; i--) { var mismatch = false; for (var j = 0; j < len; j++) { if (this[i + j] != value[j]) { mismatch = true; break; } } if (!mismatch) { return i; } } return -1; } if (Buffer.prototype.lastIndexOf) { if (new Buffer("ABC").lastIndexOf("ABC") === -1) Buffer.prototype.lastIndexOf = bufferLastIndexOf; } else { Buffer.prototype.lastIndexOf = bufferLastIndexOf; } }); // node_modules/setimmediate/setImmediate.js var require_setImmediate = __commonJS((exports2) => { (function(global2, undefined2) { "use strict"; if (global2.setImmediate) { return; } var nextHandle = 1; var tasksByHandle = {}; var currentlyRunningATask = false; var doc = global2.document; var registerImmediate; function setImmediate2(callback) { if (typeof callback !== "function") { callback = new Function("" + callback); } var args = new Array(arguments.length - 1); for (var i = 0; i < args.length; i++) { args[i] = arguments[i + 1]; } var task = {callback, args}; tasksByHandle[nextHandle] = task; registerImmediate(nextHandle); return nextHandle++; } function clearImmediate2(handle) { delete tasksByHandle[handle]; } function run(task) { var callback = task.callback; var args = task.args; switch (args.length) { case 0: callback(); break; case 1: callback(args[0]); break; case 2: callback(args[0], args[1]); break; case 3: callback(args[0], args[1], args[2]); break; default: callback.apply(undefined2, args); break; } } function runIfPresent(handle) { if (currentlyRunningATask) { setTimeout(runIfPresent, 0, handle); } else { var task = tasksByHandle[handle]; if (task) { currentlyRunningATask = true; try { run(task); } finally { clearImmediate2(handle); currentlyRunningATask = false; } } } } function installNextTickImplementation() { registerImmediate = function(handle) { process.nextTick(function() { runIfPresent(handle); }); }; } function canUsePostMessage() { if (global2.postMessage && !global2.importScripts) { var postMessageIsAsynchronous = true; var oldOnMessage = global2.onmessage; global2.onmessage = function() { postMessageIsAsynchronous = false; }; global2.postMessage("", "*"); global2.onmessage = oldOnMessage; return postMessageIsAsynchronous; } } function installPostMessageImplementation() { var messagePrefix = "setImmediate$" + Math.random() + "$"; var onGlobalMessage = function(event) { if (event.source === global2 && typeof event.data === "string" && event.data.indexOf(messagePrefix) === 0) { runIfPresent(+event.data.slice(messagePrefix.length)); } }; if (global2.addEventListener) { global2.addEventListener("message", onGlobalMessage, false); } else { global2.attachEvent("onmessage", onGlobalMessage); } registerImmediate = function(handle) { global2.postMessage(messagePrefix + handle, "*"); }; } function installMessageChannelImplementation() { var channel = new MessageChannel(); channel.port1.onmessage = function(event) { var handle = event.data; runIfPresent(handle); }; registerImmediate = function(handle) { channel.port2.postMessage(handle); }; } function installReadyStateChangeImplementation() { var html = doc.documentElement; registerImmediate = function(handle) { var script = doc.createElement("script"); script.onreadystatechange = function() { runIfPresent(handle); script.onreadystatechange = null; html.removeChild(script); script = null; }; html.appendChild(script); }; } function installSetTimeoutImplementation() { registerImmediate = function(handle) { setTimeout(runIfPresent, 0, handle); }; } var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global2); attachTo = attachTo && attachTo.setTimeout ? attachTo : global2; if ({}.toString.call(global2.process) === "[object process]") { installNextTickImplementation(); } else if (canUsePostMessage()) { installPostMessageImplementation(); } else if (global2.MessageChannel) { installMessageChannelImplementation(); } else if (doc && "onreadystatechange" in doc.createElement("script")) { installReadyStateChangeImplementation(); } else { installSetTimeoutImplementation(); } attachTo.setImmediate = setImmediate2; attachTo.clearImmediate = clearImmediate2; })(typeof self === "undefined" ? typeof global === "undefined" ? exports2 : global : self); }); // node_modules/traverse/index.js var require_traverse = __commonJS((exports2, module2) => { module2.exports = Traverse; function Traverse(obj) { if (!(this instanceof Traverse)) return new Traverse(obj); this.value = obj; } Traverse.prototype.get = function(ps) { var node = this.value; for (var i = 0; i < ps.length; i++) { var key = ps[i]; if (!Object.hasOwnProperty.call(node, key)) { node = void 0; break; } node = node[key]; } return node; }; Traverse.prototype.set = function(ps, value) { var node = this.value; for (var i = 0; i < ps.length - 1; i++) { var key = ps[i]; if (!Object.hasOwnProperty.call(node, key)) node[key] = {}; node = node[key]; } node[ps[i]] = value; return value; }; Traverse.prototype.map = function(cb) { return walk(this.value, cb, true); }; Traverse.prototype.forEach = function(cb) { this.value = walk(this.value, cb, false); return this.value; }; Traverse.prototype.reduce = function(cb, init) { var skip = arguments.length === 1; var acc = skip ? this.value : init; this.forEach(function(x) { if (!this.isRoot || !skip) { acc = cb.call(this, acc, x); } }); return acc; }; Traverse.prototype.deepEqual = function(obj) { if (arguments.length !== 1) { throw new Error("deepEqual requires exactly one object to compare against"); } var equal = true; var node = obj; this.forEach(function(y) { var notEqual = function() { equal = false; return void 0; }.bind(this); if (!this.isRoot) { if (typeof node !== "object") return notEqual(); node = node[this.key]; } var x = node; this.post(function() { node = x; }); var toS = function(o) { return Object.prototype.toString.call(o); }; if (this.circular) { if (Traverse(obj).get(this.circular.path) !== x) notEqual(); } else if (typeof x !== typeof y) { notEqual(); } else if (x === null || y === null || x === void 0 || y === void 0) { if (x !== y) notEqual(); } else if (x.__proto__ !== y.__proto__) { notEqual(); } else if (x === y) { } else if (typeof x === "function") { if (x instanceof RegExp) { if (x.toString() != y.toString()) notEqual(); } else if (x !== y) notEqual(); } else if (typeof x === "object") { if (toS(y) === "[object Arguments]" || toS(x) === "[object Arguments]") { if (toS(x) !== toS(y)) { notEqual(); } } else if (x instanceof Date || y instanceof Date) { if (!(x instanceof Date) || !(y instanceof Date) || x.getTime() !== y.getTime()) { notEqual(); } } else { var kx = Object.keys(x); var ky = Object.keys(y); if (kx.length !== ky.length) return notEqual(); for (var i = 0; i < kx.length; i++) { var k = kx[i]; if (!Object.hasOwnProperty.call(y, k)) { notEqual(); } } } } }); return equal; }; Traverse.prototype.paths = function() { var acc = []; this.forEach(function(x) { acc.push(this.path); }); return acc; }; Traverse.prototype.nodes = function() { var acc = []; this.forEach(function(x) { acc.push(this.node); }); return acc; }; Traverse.prototype.clone = function() { var parents = [], nodes = []; return function clone(src) { for (var i = 0; i < parents.length; i++) { if (parents[i] === src) { return nodes[i]; } } if (typeof src === "object" && src !== null) { var dst = copy(src); parents.push(src); nodes.push(dst); Object.keys(src).forEach(function(key) { dst[key] = clone(src[key]); }); parents.pop(); nodes.pop(); return dst; } else { return src; } }(this.value); }; function walk(root, cb, immutable) { var path = []; var parents = []; var alive = true; return function walker(node_) { var node = immutable ? copy(node_) : node_; var modifiers = {}; var state = { node, node_, path: [].concat(path), parent: parents.slice(-1)[0], key: path.slice(-1)[0], isRoot: path.length === 0, level: path.length, circular: null, update: function(x) { if (!state.isRoot) { state.parent.node[state.key] = x; } state.node = x; }, delete: function() { delete state.parent.node[state.key]; }, remove: function() { if (Array.isArray(state.parent.node)) { state.parent.node.splice(state.key, 1); } else { delete state.parent.node[state.key]; } }, before: function(f) { modifiers.before = f; }, after: function(f) { modifiers.after = f; }, pre: function(f) { modifiers.pre = f; }, post: function(f) { modifiers.post = f; }, stop: function() { alive = false; } }; if (!alive) return state; if (typeof node === "object" && node !== null) { state.isLeaf = Object.keys(node).length == 0; for (var i = 0; i < parents.length; i++) { if (parents[i].node_ === node_) { state.circular = parents[i]; break; } } } else { state.isLeaf = true; } state.notLeaf = !state.isLeaf; state.notRoot = !state.isRoot; var ret2 = cb.call(state, state.node); if (ret2 !== void 0 && state.update) state.update(ret2); if (modifiers.before) modifiers.before.call(state, state.node); if (typeof state.node == "object" && state.node !== null && !state.circular) { parents.push(state); var keys = Object.keys(state.node); keys.forEach(function(key, i2) { path.push(key); if (modifiers.pre) modifiers.pre.call(state, state.node[key], key); var child = walker(state.node[key]); if (immutable && Object.hasOwnProperty.call(state.node, key)) { state.node[key] = child.node; } child.isLast = i2 == keys.length - 1; child.isFirst = i2 == 0; if (modifiers.post) modifiers.post.call(state, child); path.pop(); }); parents.pop(); } if (modifiers.after) modifiers.after.call(state, state.node); return state; }(root).node; } Object.keys(Traverse.prototype).forEach(function(key) { Traverse[key] = function(obj) { var args = [].slice.call(arguments, 1); var t = Traverse(obj); return t[key].apply(t, args); }; }); function copy(src) { if (typeof src === "object" && src !== null) { var dst; if (Array.isArray(src)) { dst = []; } else if (src instanceof Date) { dst = new Date(src); } else if (src instanceof Boolean) { dst = new Boolean(src); } else if (src instanceof Number) { dst = new Number(src); } else if (src instanceof String) { dst = new String(src); } else { dst = Object.create(Object.getPrototypeOf(src)); } Object.keys(src).forEach(function(key) { dst[key] = src[key]; }); return dst; } else return src; } }); // node_modules/chainsaw/index.js var require_chainsaw = __commonJS((exports2, module2) => { var Traverse = require_traverse(); var EventEmitter = require("events").EventEmitter; module2.exports = Chainsaw; function Chainsaw(builder) { var saw = Chainsaw.saw(builder, {}); var r = builder.call(saw.handlers, saw); if (r !== void 0) saw.handlers = r; saw.record(); return saw.chain(); } Chainsaw.light = function ChainsawLight(builder) { var saw = Chainsaw.saw(builder, {}); var r = builder.call(saw.handlers, saw); if (r !== void 0) saw.handlers = r; return saw.chain(); }; Chainsaw.saw = function(builder, handlers) { var saw = new EventEmitter(); saw.handlers = handlers; saw.actions = []; saw.chain = function() { var ch = Traverse(saw.handlers).map(function(node) { if (this.isRoot) return node; var ps = this.path; if (typeof node === "function") { this.update(function() { saw.actions.push({ path: ps, args: [].slice.call(arguments) }); return ch; }); } }); process.nextTick(function() { saw.emit("begin"); saw.next(); }); return ch; }; saw.pop = function() { return saw.actions.shift(); }; saw.next = function() { var action = saw.pop(); if (!action) { saw.emit("end"); } else if (!action.trap) { var node = saw.handlers; action.path.forEach(function(key) { node = node[key]; }); node.apply(saw.handlers, action.args); } }; saw.nest = function(cb) { var args = [].slice.call(arguments, 1); var autonext = true; if (typeof cb === "boolean") { var autonext = cb; cb = args.shift(); } var s = Chainsaw.saw(builder, {}); var r = builder.call(s.handlers, s); if (r !== void 0) s.handlers = r; if (typeof saw.step !== "undefined") { s.record(); } cb.apply(s.chain(), args); if (autonext !== false) s.on("end", saw.next); }; saw.record = function() { upgradeChainsaw(saw); }; ["trap", "down", "jump"].forEach(function(method) { saw[method] = function() { throw new Error("To use the trap, down and jump features, please call record() first to start recording actions."); }; }); return saw; }; function upgradeChainsaw(saw) { saw.step = 0; saw.pop = function() { return saw.actions[saw.step++]; }; saw.trap = function(name, cb) { var ps = Array.isArray(name) ? name : [name]; saw.actions.push({ path: ps, step: saw.step, cb, trap: true }); }; saw.down = function(name) { var ps = (Array.isArray(name) ? name : [name]).join("/"); var i = saw.actions.slice(saw.step).map(function(x) { if (x.trap && x.step <= saw.step) return false; return x.path.join("/") == ps; }).indexOf(true); if (i >= 0) saw.step += i; else saw.step = saw.actions.length; var act = saw.actions[saw.step - 1]; if (act && act.trap) { saw.step = act.step; act.cb(); } else saw.next(); }; saw.jump = function(step) { saw.step = step; saw.next(); }; } }); // node_modules/buffers/index.js var require_buffers = __commonJS((exports2, module2) => { module2.exports = Buffers; function Buffers(bufs) { if (!(this instanceof Buffers)) return new Buffers(bufs); this.buffers = bufs || []; this.length = this.buffers.reduce(function(size, buf) { return size + buf.length; }, 0); } Buffers.prototype.push = function() { for (var i = 0; i < arguments.length; i++) { if (!Buffer.isBuffer(arguments[i])) { throw new TypeError("Tried to push a non-buffer"); } } for (var i = 0; i < arguments.length; i++) { var buf = arguments[i]; this.buffers.push(buf); this.length += buf.length; } return this.length; }; Buffers.prototype.unshift = function() { for (var i = 0; i < arguments.length; i++) { if (!Buffer.isBuffer(arguments[i])) { throw new TypeError("Tried to unshift a non-buffer"); } } for (var i = 0; i < arguments.length; i++) { var buf = arguments[i]; this.buffers.unshift(buf); this.length += buf.length; } return this.length; }; Buffers.prototype.copy = function(dst, dStart, start, end) { return this.slice(start, end).copy(dst, dStart, 0, end - start); }; Buffers.prototype.splice = function(i, howMany) { var buffers = this.buffers; var index = i >= 0 ? i : this.length - i; var reps = [].slice.call(arguments, 2); if (howMany === void 0) { howMany = this.length - index; } else if (howMany > this.length - index) { howMany = this.length - index; } for (var i = 0; i < reps.length; i++) { this.length += reps[i].length; } var removed = new Buffers(); var bytes = 0; var startBytes = 0; for (var ii = 0; ii < buffers.length && startBytes + buffers[ii].length < index; ii++) { startBytes += buffers[ii].length; } if (index - startBytes > 0) { var start = index - startBytes; if (start + howMany < buffers[ii].length) { removed.push(buffers[ii].slice(start, start + howMany)); var orig = buffers[ii]; var buf0 = new Buffer(start); for (var i = 0; i < start; i++) { buf0[i] = orig[i]; } var buf1 = new Buffer(orig.length - start - howMany); for (var i = start + howMany; i < orig.length; i++) { buf1[i - howMany - start] = orig[i]; } if (reps.length > 0) { var reps_ = reps.slice(); reps_.unshift(buf0); reps_.push(buf1); buffers.splice.apply(buffers, [ii, 1].concat(reps_)); ii += reps_.length; reps = []; } else { buffers.splice(ii, 1, buf0, buf1); ii += 2; } } else { removed.push(buffers[ii].slice(start)); buffers[ii] = buffers[ii].slice(0, start); ii++; } } if (reps.length > 0) { buffers.splice.apply(buffers, [ii, 0].concat(reps)); ii += reps.length; } while (removed.length < howMany) { var buf = buffers[ii]; var len = buf.length; var take = Math.min(len, howMany - removed.length); if (take === len) { removed.push(buf); buffers.splice(ii, 1); } else { removed.push(buf.slice(0, take)); buffers[ii] = buffers[ii].slice(take); } } this.length -= removed.length; return removed; }; Buffers.prototype.slice = function(i, j) { var buffers = this.buffers; if (j === void 0) j = this.length; if (i === void 0) i = 0; if (j > this.length) j = this.length; var startBytes = 0; for (var si = 0; si < buffers.length && startBytes + buffers[si].length <= i; si++) { startBytes += buffers[si].length; } var target = new Buffer(j - i); var ti = 0; for (var ii = si; ti < j - i && ii < buffers.length; ii++) { var len = buffers[ii].length; var start = ti === 0 ? i - startBytes : 0; var end = ti + len >= j - i ? Math.min(start + (j - i) - ti, len) : len; buffers[ii].copy(target, ti, start, end); ti += end - start; } return target; }; Buffers.prototype.pos = function(i) { if (i < 0 || i >= this.length) throw new Error("oob"); var l = i, bi = 0, bu = null; for (; ; ) { bu = this.buffers[bi]; if (l < bu.length) { return {buf: bi, offset: l}; } else { l -= bu.length; } bi++; } }; Buffers.prototype.get = function get(i) { var pos = this.pos(i); return this.buffers[pos.buf].get(pos.offset); }; Buffers.prototype.set = function set(i, b) { var pos = this.pos(i); return this.buffers[pos.buf].set(pos.offset, b); }; Buffers.prototype.indexOf = function(needle, offset) { if (typeof needle === "string") { needle = new Buffer(needle); } else if (needle instanceof Buffer) { } else { throw new Error("Invalid type for a search string"); } if (!needle.length) { return 0; } if (!this.length) { return -1; } var i = 0, j = 0, match = 0, mstart, pos = 0; if (offset) { var p = this.pos(offset); i = p.buf; j = p.offset; pos = offset; } for (; ; ) { while (j >= this.buffers[i].length) { j = 0; i++; if (i >= this.buffers.length) { return -1; } } var char = this.buffers[i][j]; if (char == needle[match]) { if (match == 0) { mstart = { i, j, pos }; } match++; if (match == needle.length) { return mstart.pos; } } else if (match != 0) { i = mstart.i; j = mstart.j; pos = mstart.pos; match = 0; } j++; pos++; } }; Buffers.prototype.toBuffer = function() { return this.slice(); }; Buffers.prototype.toString = function(encoding, start, end) { return this.slice(start, end).toString(encoding); }; }); // node_modules/binary/lib/vars.js var require_vars = __commonJS((exports2, module2) => { module2.exports = function(store) { function getset(name, value) { var node = vars.store; var keys = name.split("."); keys.slice(0, -1).forEach(function(k) { if (node[k] === void 0) node[k] = {}; node = node[k]; }); var key = keys[keys.length - 1]; if (arguments.length == 1) { return node[key]; } else { return node[key] = value; } } var vars = { get: function(name) { return getset(name); }, set: function(name, value) { return getset(name, value); }, store: store || {} }; return vars; }; }); // node_modules/binary/index.js var require_binary = __commonJS((exports2, module2) => { var Chainsaw = require_chainsaw(); var EventEmitter = require("events").EventEmitter; var Buffers = require_buffers(); var Vars = require_vars(); var Stream = require("stream").Stream; exports2 = module2.exports = function(bufOrEm, eventName) { if (Buffer.isBuffer(bufOrEm)) { return exports2.parse(bufOrEm); } var s = exports2.stream(); if (bufOrEm && bufOrEm.pipe) { bufOrEm.pipe(s); } else if (bufOrEm) { bufOrEm.on(eventName || "data", function(buf) { s.write(buf); }); bufOrEm.on("end", function() { s.end(); }); } return s; }; exports2.stream = function(input) { if (input) return exports2.apply(null, arguments); var pending = null; function getBytes(bytes, cb, skip) { pending = { bytes, skip, cb: function(buf) { pending = null; cb(buf); } }; dispatch(); } var offset = null; function dispatch() { if (!pending) { if (caughtEnd) done = true; return; } if (typeof pending === "function") { pending(); } else { var bytes = offset + pending.bytes; if (buffers.length >= bytes) { var buf; if (offset == null) { buf = buffers.splice(0, bytes); if (!pending.skip) { buf = buf.slice(); } } else { if (!pending.skip) { buf = buffers.slice(offset, bytes); } offset = bytes; } if (pending.skip) { pending.cb(); } else { pending.cb(buf); } } } } function builder(saw) { function next() { if (!done) saw.next(); } var self2 = words(function(bytes, cb) { return function(name) { getBytes(bytes, function(buf) { vars.set(name, cb(buf)); next(); }); }; }); self2.tap = function(cb) { saw.nest(cb, vars.store); }; self2.into = function(key, cb) { if (!vars.get(key)) vars.set(key, {}); var parent = vars; vars = Vars(parent.get(key)); saw.nest(function() { cb.apply(this, arguments); this.tap(function() { vars = parent; }); }, vars.store); }; self2.flush = function() { vars.store = {}; next(); }; self2.loop = function(cb) { var end = false; saw.nest(false, function loop() { this.vars = vars.store; cb.call(this, function() { end = true; next(); }, vars.store); this.tap(function() { if (end) saw.next(); else loop.call(this); }.bind(this)); }, vars.store); }; self2.buffer = function(name, bytes) { if (typeof bytes === "string") { bytes = vars.get(bytes); } getBytes(bytes, function(buf) { vars.set(name, buf); next(); }); }; self2.skip = function(bytes) { if (typeof bytes === "string") { bytes = vars.get(bytes); } getBytes(bytes, function() { next(); }); }; self2.scan = function find(name, search) { if (typeof search === "string") { search = new Buffer(search); } else if (!Buffer.isBuffer(search)) { throw new Error("search must be a Buffer or a string"); } var taken = 0; pending = function() { var pos = buffers.indexOf(search, offset + taken); var i = pos - offset - taken; if (pos !== -1) { pending = null; if (offset != null) { vars.set(name, buffers.slice(offset, offset + taken + i)); offset += taken + i + search.length; } else { vars.set(name, buffers.slice(0, taken + i)); buffers.splice(0, taken + i + search.length); } next(); dispatch(); } else { i = Math.max(buffers.length - search.length - offset - taken, 0); } taken += i; }; dispatch(); }; self2.peek = function(cb) { offset = 0; saw.nest(function() { cb.call(this, vars.store); this.tap(function() { offset = null; }); }); }; return self2; } ; var stream = Chainsaw.light(builder); stream.writable = true; var buffers = Buffers(); stream.write = function(buf) { buffers.push(buf); dispatch(); }; var vars = Vars(); var done = false, caughtEnd = false; stream.end = function() { caughtEnd = true; }; stream.pipe = Stream.prototype.pipe; Object.getOwnPropertyNames(EventEmitter.prototype).forEach(function(name) { stream[name] = EventEmitter.prototype[name]; }); return stream; }; exports2.parse = function parse(buffer) { var self2 = words(function(bytes, cb) { return function(name) { if (offset + bytes <= buffer.length) { var buf = buffer.slice(offset, offset + bytes); offset += bytes; vars.set(name, cb(buf)); } else { vars.set(name, null); } return self2; }; }); var offset = 0; var vars = Vars(); self2.vars = vars.store; self2.tap = function(cb) { cb.call(self2, vars.store); return self2; }; self2.into = function(key, cb) { if (!vars.get(key)) { vars.set(key, {}); } var parent = vars; vars = Vars(parent.get(key)); cb.call(self2, vars.store); vars = parent; return self2; }; self2.loop = function(cb) { var end = false; var ender = function() { end = true; }; while (end === false) { cb.call(self2, ender, vars.store); } return self2; }; self2.buffer = function(name, size) { if (typeof size === "string") { size = vars.get(size); } var buf = buffer.slice(offset, Math.min(buffer.length, offset + size)); offset += size; vars.set(name, buf); return self2; }; self2.skip = function(bytes) { if (typeof bytes === "string") { bytes = vars.get(bytes); } offset += bytes; return self2; }; self2.scan = function(name, search) { if (typeof search === "string") { search = new Buffer(search); } else if (!Buffer.isBuffer(search)) { throw new Error("search must be a Buffer or a string"); } vars.set(name, null); for (var i = 0; i + offset <= buffer.length - search.length + 1; i++) { for (var j = 0; j < search.length && buffer[offset + i + j] === search[j]; j++) ; if (j === search.length) break; } vars.set(name, buffer.slice(offset, offset + i)); offset += i + search.length; return self2; }; self2.peek = function(cb) { var was = offset; cb.call(self2, vars.store); offset = was; return self2; }; self2.flush = function() { vars.store = {}; return self2; }; self2.eof = function() { return offset >= buffer.length; }; return self2; }; function decodeLEu(bytes) { var acc = 0; for (var i = 0; i < bytes.length; i++) { acc += Math.pow(256, i) * bytes[i]; } return acc; } function decodeBEu(bytes) { var acc = 0; for (var i = 0; i < bytes.length; i++) { acc += Math.pow(256, bytes.length - i - 1) * bytes[i]; } return acc; } function decodeBEs(bytes) { var val = decodeBEu(bytes); if ((bytes[0] & 128) == 128) { val -= Math.pow(256, bytes.length); } return val; } function decodeLEs(bytes) { var val = decodeLEu(bytes); if ((bytes[bytes.length - 1] & 128) == 128) { val -= Math.pow(256, bytes.length); } return val; } function words(decode) { var self2 = {}; [1, 2, 4, 8].forEach(function(bytes) { var bits = bytes * 8; self2["word" + bits + "le"] = self2["word" + bits + "lu"] = decode(bytes, decodeLEu); self2["word" + bits + "ls"] = decode(bytes, decodeLEs); self2["word" + bits + "be"] = self2["word" + bits + "bu"] = decode(bytes, decodeBEu); self2["word" + bits + "bs"] = decode(bytes, decodeBEs); }); self2.word8 = self2.word8u = self2.word8be; self2.word8s = self2.word8bs; return self2; } }); // node_modules/bluebird/js/release/es5.js var require_es5 = __commonJS((exports2, module2) => { var isES5 = function() { "use strict"; return this === void 0; }(); if (isES5) { module2.exports = { freeze: Object.freeze, defineProperty: Object.defineProperty, getDescriptor: Object.getOwnPropertyDescriptor, keys: Object.keys, names: Object.getOwnPropertyNames, getPrototypeOf: Object.getPrototypeOf, isArray: Array.isArray, isES5, propertyIsWritable: function(obj, prop) { var descriptor = Object.getOwnPropertyDescriptor(obj, prop); return !!(!descriptor || descriptor.writable || descriptor.set); } }; } else { has = {}.hasOwnProperty; str = {}.toString; proto = {}.constructor.prototype; ObjectKeys = function(o) { var ret2 = []; for (var key in o) { if (has.call(o, key)) { ret2.push(key); } } return ret2; }; ObjectGetDescriptor = function(o, key) { return {value: o[key]}; }; ObjectDefineProperty = function(o, key, desc) { o[key] = desc.value; return o; }; ObjectFreeze = function(obj) { return obj; }; ObjectGetPrototypeOf = function(obj) { try { return Object(obj).constructor.prototype; } catch (e) { return proto; } }; ArrayIsArray = function(obj) { try { return str.call(obj) === "[object Array]"; } catch (e) { return false; } }; module2.exports = { isArray: ArrayIsArray, keys: ObjectKeys, names: ObjectKeys, defineProperty: ObjectDefineProperty, getDescriptor: ObjectGetDescriptor, freeze: ObjectFreeze, getPrototypeOf: ObjectGetPrototypeOf, isES5, propertyIsWritable: function() { return true; } }; } var has; var str; var proto; var ObjectKeys; var ObjectGetDescriptor; var ObjectDefineProperty; var ObjectFreeze; var ObjectGetPrototypeOf; var ArrayIsArray; }); // node_modules/bluebird/js/release/util.js var require_util = __commonJS((exports, module) => { "use strict"; var es5 = require_es5(); var canEvaluate = typeof navigator == "undefined"; var errorObj = {e: {}}; var tryCatchTarget; var globalObject = typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : exports !== void 0 ? exports : null; function tryCatcher() { try { var target = tryCatchTarget; tryCatchTarget = null; return target.apply(this, arguments); } catch (e) { errorObj.e = e; return errorObj; } } function tryCatch(fn) { tryCatchTarget = fn; return tryCatcher; } var inherits = function(Child, Parent) { var hasProp = {}.hasOwnProperty; function T() { this.constructor = Child; this.constructor$ = Parent; for (var propertyName in Parent.prototype) { if (hasProp.call(Parent.prototype, propertyName) && propertyName.charAt(propertyName.length - 1) !== "$") { this[propertyName + "$"] = Parent.prototype[propertyName]; } } } T.prototype = Parent.prototype; Child.prototype = new T(); return Child.prototype; }; function isPrimitive(val) { return val == null || val === true || val === false || typeof val === "string" || typeof val === "number"; } function isObject(value) { return typeof value === "function" || typeof value === "object" && value !== null; } function maybeWrapAsError(maybeError) { if (!isPrimitive(maybeError)) return maybeError; return new Error(safeToString(maybeError)); } function withAppended(target, appendee) { var len = target.length; var ret2 = new Array(len + 1); var i; for (i = 0; i < len; ++i) { ret2[i] = target[i]; } ret2[i] = appendee; return ret2; } function getDataPropertyOrDefault(obj, key, defaultValue) { if (es5.isES5) { var desc = Object.getOwnPropertyDescriptor(obj, key); if (desc != null) { return desc.get == null && desc.set == null ? desc.value : defaultValue; } } else { return {}.hasOwnProperty.call(obj, key) ? obj[key] : void 0; } } function notEnumerableProp(obj, name, value) { if (isPrimitive(obj)) return obj; var descriptor = { value, configurable: true, enumerable: false, writable: true }; es5.defineProperty(obj, name, descriptor); return obj; } function thrower(r) { throw r; } var inheritedDataKeys = function() { var excludedPrototypes = [ Array.prototype, Object.prototype, Function.prototype ]; var isExcludedProto = function(val) { for (var i = 0; i < excludedPrototypes.length; ++i) { if (excludedPrototypes[i] === val) { return true; } } return false; }; if (es5.isES5) { var getKeys = Object.getOwnPropertyNames; return function(obj) { var ret2 = []; var visitedKeys = Object.create(null); while (obj != null && !isExcludedProto(obj)) { var keys; try { keys = getKeys(obj); } catch (e) { return ret2; } for (var i = 0; i < keys.length; ++i) { var key = keys[i]; if (visitedKeys[key]) continue; visitedKeys[key] = true; var desc = Object.getOwnPropertyDescriptor(obj, key); if (desc != null && desc.get == null && desc.set == null) { ret2.push(key); } } obj = es5.getPrototypeOf(obj); } return ret2; }; } else { var hasProp = {}.hasOwnProperty; return function(obj) { if (isExcludedProto(obj)) return []; var ret2 = []; enumeration: for (var key in obj) { if (hasProp.call(obj, key)) { ret2.push(key); } else { for (var i = 0; i < excludedPrototypes.length; ++i) { if (hasProp.call(excludedPrototypes[i], key)) { continue enumeration; } } ret2.push(key); } } return ret2; }; } }(); var thisAssignmentPattern = /this\s*\.\s*\S+\s*=/; function isClass(fn) { try { if (typeof fn === "function") { var keys = es5.names(fn.prototype); var hasMethods = es5.isES5 && keys.length > 1; var hasMethodsOtherThanConstructor = keys.length > 0 && !(keys.length === 1 && keys[0] === "constructor"); var hasThisAssignmentAndStaticMethods = thisAssignmentPattern.test(fn + "") && es5.names(fn).length > 0; if (hasMethods || hasMethodsOtherThanConstructor || hasThisAssignmentAndStaticMethods) { return true; } } return false; } catch (e) { return false; } } function toFastProperties(obj) { function FakeConstructor() { } FakeConstructor.prototype = obj; var l = 8; while (l--) new FakeConstructor(); return obj; eval(obj); } var rident = /^[a-z$_][a-z$_0-9]*$/i; function isIdentifier(str) { return rident.test(str); } function filledRange(count, prefix, suffix) { var ret2 = new Array(count); for (var i = 0; i < count; ++i) { ret2[i] = prefix + i + suffix; } return ret2; } function safeToString(obj) { try { return obj + ""; } catch (e) { return "[no string representation]"; } } function isError(obj) { return obj !== null && typeof obj === "object" && typeof obj.message === "string" && typeof obj.name === "string"; } function markAsOriginatingFromRejection(e) { try { notEnumerableProp(e, "isOperational", true); } catch (ignore) { } } function originatesFromRejection(e) { if (e == null) return false; return e instanceof Error["__BluebirdErrorTypes__"].OperationalError || e["isOperational"] === true; } function canAttachTrace(obj) { return isError(obj) && es5.propertyIsWritable(obj, "stack"); } var ensureErrorObject = function() { if (!("stack" in new Error())) { return function(value) { if (canAttachTrace(value)) return value; try { throw new Error(safeToString(value)); } catch (err) { return err; } }; } else { return function(value) { if (canAttachTrace(value)) return value; return new Error(safeToString(value)); }; } }(); function classString(obj) { return {}.toString.call(obj); } function copyDescriptors(from, to, filter) { var keys = es5.names(from); for (var i = 0; i < keys.length; ++i) { var key = keys[i]; if (filter(key)) { try { es5.defineProperty(to, key, es5.getDescriptor(from, key)); } catch (ignore) { } } } } var asArray = function(v) { if (es5.isArray(v)) { return v; } return null; }; if (typeof Symbol !== "undefined" && Symbol.iterator) { ArrayFrom = typeof Array.from === "function" ? function(v) { return Array.from(v); } : function(v) { var ret2 = []; var it = v[Symbol.iterator](); var itResult; while (!(itResult = it.next()).done) { ret2.push(itResult.value); } return ret2; }; asArray = function(v) { if (es5.isArray(v)) { return v; } else if (v != null && typeof v[Symbol.iterator] === "function") { return ArrayFrom(v); } return null; }; } var ArrayFrom; var isNode = typeof process !== "undefined" && classString(process).toLowerCase() === "[object process]"; var hasEnvVariables = typeof process !== "undefined" && typeof process.env !== "undefined"; function env(key) { return hasEnvVariables ? process.env[key] : void 0; } function getNativePromise() { if (typeof Promise === "function") { try { var promise = new Promise(function() { }); if ({}.toString.call(promise) === "[object Promise]") { return Promise; } } catch (e) { } } } function domainBind(self2, cb) { return self2.bind(cb); } var ret = { isClass, isIdentifier, inheritedDataKeys, getDataPropertyOrDefault, thrower, isArray: es5.isArray, asArray, notEnumerableProp, isPrimitive, isObject, isError, canEvaluate, errorObj, tryCatch, inherits, withAppended, maybeWrapAsError, toFastProperties, filledRange, toString: safeToString, canAttachTrace, ensureErrorObject, originatesFromRejection, markAsOriginatingFromRejection, classString, copyDescriptors, hasDevTools: typeof chrome !== "undefined" && chrome && typeof chrome.loadTimes === "function", isNode, hasEnvVariables, env, global: globalObject, getNativePromise, domainBind }; ret.isRecentNode = ret.isNode && function() { var version = process.versions.node.split(".").map(Number); return version[0] === 0 && version[1] > 10 || version[0] > 0; }(); if (ret.isNode) ret.toFastProperties(process); try { throw new Error(); } catch (e) { ret.lastLineError = e; } module.exports = ret; }); // node_modules/bluebird/js/release/schedule.js var require_schedule = __commonJS((exports2, module2) => { "use strict"; var util = require_util(); var schedule; var noAsyncScheduler = function() { throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n"); }; var NativePromise = util.getNativePromise(); if (util.isNode && typeof MutationObserver === "undefined") { GlobalSetImmediate = global.setImmediate; ProcessNextTick = process.nextTick; schedule = util.isRecentNode ? function(fn) { GlobalSetImmediate.call(global, fn); } : function(fn) { ProcessNextTick.call(process, fn); }; } else if (typeof NativePromise === "function" && typeof NativePromise.resolve === "function") { nativePromise = NativePromise.resolve(); schedule = function(fn) { nativePromise.then(fn); }; } else if (typeof MutationObserver !== "undefined" && !(typeof window !== "undefined" && window.navigator && (window.navigator.standalone || window.cordova))) { schedule = function() { var div = document.createElement("div"); var opts = {attributes: true}; var toggleScheduled = false; var div2 = document.createElement("div"); var o2 = new MutationObserver(function() { div.classList.toggle("foo"); toggleScheduled = false; }); o2.observe(div2, opts); var scheduleToggle = function() { if (toggleScheduled) return; toggleScheduled = true; div2.classList.toggle("foo"); }; return function schedule2(fn) { var o = new MutationObserver(function() { o.disconnect(); fn(); }); o.observe(div, opts); scheduleToggle(); }; }(); } else if (typeof setImmediate !== "undefined") { schedule = function(fn) { setImmediate(fn); }; } else if (typeof setTimeout !== "undefined") { schedule = function(fn) { setTimeout(fn, 0); }; } else { schedule = noAsyncScheduler; } var GlobalSetImmediate; var ProcessNextTick; var nativePromise; module2.exports = schedule; }); // node_modules/bluebird/js/release/queue.js var require_queue = __commonJS((exports2, module2) => { "use strict"; function arrayMove(src, srcIndex, dst, dstIndex, len) { for (var j = 0; j < len; ++j) { dst[j + dstIndex] = src[j + srcIndex]; src[j + srcIndex] = void 0; } } function Queue(capacity) { this._capacity = capacity; this._length = 0; this._front = 0; } Queue.prototype._willBeOverCapacity = function(size) { return this._capacity < size; }; Queue.prototype._pushOne = function(arg) { var length = this.length(); this._checkCapacity(length + 1); var i = this._front + length & this._capacity - 1; this[i] = arg; this._length = length + 1; }; Queue.prototype.push = function(fn, receiver, arg) { var length = this.length() + 3; if (this._willBeOverCapacity(length)) { this._pushOne(fn); this._pushOne(receiver); this._pushOne(arg); return; } var j = this._front + length - 3; this._checkCapacity(length); var wrapMask = this._capacity - 1; this[j + 0 & wrapMask] = fn; this[j + 1 & wrapMask] = receiver; this[j + 2 & wrapMask] = arg; this._length = length; }; Queue.prototype.shift = function() { var front = this._front, ret2 = this[front]; this[front] = void 0; this._front = front + 1 & this._capacity - 1; this._length--; return ret2; }; Queue.prototype.length = function() { return this._length; }; Queue.prototype._checkCapacity = function(size) { if (this._capacity < size) { this._resizeTo(this._capacity << 1); } }; Queue.prototype._resizeTo = function(capacity) { var oldCapacity = this._capacity; this._capacity = capacity; var front = this._front; var length = this._length; var moveItemsCount = front + length & oldCapacity - 1; arrayMove(this, 0, this, oldCapacity, moveItemsCount); }; module2.exports = Queue; }); // node_modules/bluebird/js/release/async.js var require_async = __commonJS((exports2, module2) => { "use strict"; var firstLineError; try { throw new Error(); } catch (e) { firstLineError = e; } var schedule = require_schedule(); var Queue = require_queue(); var util = require_util(); function Async() { this._customScheduler = false; this._isTickUsed = false; this._lateQueue = new Queue(16); this._normalQueue = new Queue(16); this._haveDrainedQueues = false; this._trampolineEnabled = true; var self2 = this; this.drainQueues = function() { self2._drainQueues(); }; this._schedule = schedule; } Async.prototype.setScheduler = function(fn) { var prev = this._schedule; this._schedule = fn; this._customScheduler = true; return prev; }; Async.prototype.hasCustomScheduler = function() { return this._customScheduler; }; Async.prototype.enableTrampoline = function() { this._trampolineEnabled = true; }; Async.prototype.disableTrampolineIfNecessary = function() { if (util.hasDevTools) { this._trampolineEnabled = false; } }; Async.prototype.haveItemsQueued = function() { return this._isTickUsed || this._haveDrainedQueues; }; Async.prototype.fatalError = function(e, isNode2) { if (isNode2) { process.stderr.write("Fatal " + (e instanceof Error ? e.stack : e) + "\n"); process.exit(2); } else { this.throwLater(e); } }; Async.prototype.throwLater = function(fn, arg) { if (arguments.length === 1) { arg = fn; fn = function() { throw arg; }; } if (typeof setTimeout !== "undefined") { setTimeout(function() { fn(arg); }, 0); } else try { this._schedule(function() { fn(arg); }); } catch (e) { throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n"); } }; function AsyncInvokeLater(fn, receiver, arg) { this._lateQueue.push(fn, receiver, arg); this._queueTick(); } function AsyncInvoke(fn, receiver, arg) { this._normalQueue.push(fn, receiver, arg); this._queueTick(); } function AsyncSettlePromises(promise) { this._normalQueue._pushOne(promise); this._queueTick(); } if (!util.hasDevTools) { Async.prototype.invokeLater = AsyncInvokeLater; Async.prototype.invoke = AsyncInvoke; Async.prototype.settlePromises = AsyncSettlePromises; } else { Async.prototype.invokeLater = function(fn, receiver, arg) { if (this._trampolineEnabled) { AsyncInvokeLater.call(this, fn, receiver, arg); } else { this._schedule(function() { setTimeout(function() { fn.call(receiver, arg); }, 100); }); } }; Async.prototype.invoke = function(fn, receiver, arg) { if (this._trampolineEnabled) { AsyncInvoke.call(this, fn, receiver, arg); } else { this._schedule(function() { fn.call(receiver, arg); }); } }; Async.prototype.settlePromises = function(promise) { if (this._trampolineEnabled) { AsyncSettlePromises.call(this, promise); } else { this._schedule(function() { promise._settlePromises(); }); } }; } Async.prototype._drainQueue = function(queue) { while (queue.length() > 0) { var fn = queue.shift(); if (typeof fn !== "function") { fn._settlePromises(); continue; } var receiver = queue.shift(); var arg = queue.shift(); fn.call(receiver, arg); } }; Async.prototype._drainQueues = function() { this._drainQueue(this._normalQueue); this._reset(); this._haveDrainedQueues = true; this._drainQueue(this._lateQueue); }; Async.prototype._queueTick = function() { if (!this._isTickUsed) { this._isTickUsed = true; this._schedule(this.drainQueues); } }; Async.prototype._reset = function() { this._isTickUsed = false; }; module2.exports = Async; module2.exports.firstLineError = firstLineError; }); // node_modules/bluebird/js/release/errors.js var require_errors = __commonJS((exports2, module2) => { "use strict"; var es52 = require_es5(); var Objectfreeze = es52.freeze; var util = require_util(); var inherits2 = util.inherits; var notEnumerableProp2 = util.notEnumerableProp; function subError(nameProperty, defaultMessage) { function SubError(message) { if (!(this instanceof SubError)) return new SubError(message); notEnumerableProp2(this, "message", typeof message === "string" ? message : defaultMessage); notEnumerableProp2(this, "name", nameProperty); if (Error.captureStackTrace) { Error.captureStackTrace(this, this.constructor); } else { Error.call(this); } } inherits2(SubError, Error); return SubError; } var _TypeError; var _RangeError; var Warning = subError("Warning", "warning"); var CancellationError = subError("CancellationError", "cancellation error"); var TimeoutError = subError("TimeoutError", "timeout error"); var AggregateError = subError("AggregateError", "aggregate error"); try { _TypeError = TypeError; _RangeError = RangeError; } catch (e) { _TypeError = subError("TypeError", "type error"); _RangeError = subError("RangeError", "range error"); } var methods = "join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "); for (var i = 0; i < methods.length; ++i) { if (typeof Array.prototype[methods[i]] === "function") { AggregateError.prototype[methods[i]] = Array.prototype[methods[i]]; } } es52.defineProperty(AggregateError.prototype, "length", { value: 0, configurable: false, writable: true, enumerable: true }); AggregateError.prototype["isOperational"] = true; var level = 0; AggregateError.prototype.toString = function() { var indent = Array(level * 4 + 1).join(" "); var ret2 = "\n" + indent + "AggregateError of:\n"; level++; indent = Array(level * 4 + 1).join(" "); for (var i2 = 0; i2 < this.length; ++i2) { var str = this[i2] === this ? "[Circular AggregateError]" : this[i2] + ""; var lines = str.split("\n"); for (var j = 0; j < lines.length; ++j) { lines[j] = indent + lines[j]; } str = lines.join("\n"); ret2 += str + "\n"; } level--; return ret2; }; function OperationalError(message) { if (!(this instanceof OperationalError)) return new OperationalError(message); notEnumerableProp2(this, "name", "OperationalError"); notEnumerableProp2(this, "message", message); this.cause = message; this["isOperational"] = true; if (message instanceof Error) { notEnumerableProp2(this, "message", message.message); notEnumerableProp2(this, "stack", message.stack); } else if (Error.captureStackTrace) { Error.captureStackTrace(this, this.constructor); } } inherits2(OperationalError, Error); var errorTypes = Error["__BluebirdErrorTypes__"]; if (!errorTypes) { errorTypes = Objectfreeze({ CancellationError, TimeoutError, OperationalError, RejectionError: OperationalError, AggregateError }); es52.defineProperty(Error, "__BluebirdErrorTypes__", { value: errorTypes, writable: false, enumerable: false, configurable: false }); } module2.exports = { Error, TypeError: _TypeError, RangeError: _RangeError, CancellationError: errorTypes.CancellationError, OperationalError: errorTypes.OperationalError, TimeoutError: errorTypes.TimeoutError, AggregateError: errorTypes.AggregateError, Warning }; }); // node_modules/bluebird/js/release/thenables.js var require_thenables = __commonJS((exports2, module2) => { "use strict"; module2.exports = function(Promise2, INTERNAL) { var util = require_util(); var errorObj2 = util.errorObj; var isObject3 = util.isObject; function tryConvertToPromise(obj, context) { if (isObject3(obj)) { if (obj instanceof Promise2) return obj; var then = getThen(obj); if (then === errorObj2) { if (context) context._pushContext(); var ret2 = Promise2.reject(then.e); if (context) context._popContext(); return ret2; } else if (typeof then === "function") { if (isAnyBluebirdPromise(obj)) { var ret2 = new Promise2(INTERNAL); obj._then(ret2._fulfill, ret2._reject, void 0, ret2, null); return ret2; } return doThenable(obj, then, context); } } return obj; } function doGetThen(obj) { return obj.then; } function getThen(obj) { try { return doGetThen(obj); } catch (e) { errorObj2.e = e; return errorObj2; } } var hasProp = {}.hasOwnProperty; function isAnyBluebirdPromise(obj) { try { return hasProp.call(obj, "_promise0"); } catch (e) { return false; } } function doThenable(x, then, context) { var promise = new Promise2(INTERNAL); var ret2 = promise; if (context) context._pushContext(); promise._captureStackTrace(); if (context) context._popContext(); var synchronous = true; var result = util.tryCatch(then).call(x, resolve, reject); synchronous = false; if (promise && result === errorObj2) { promise._rejectCallback(result.e, true, true); promise = null; } function resolve(value) { if (!promise) return; promise._resolveCallback(value); promise = null; } function reject(reason) { if (!promise) return; promise._rejectCallback(reason, synchronous, true); promise = null; } return ret2; } return tryConvertToPromise; }; }); // node_modules/bluebird/js/release/promise_array.js var require_promise_array = __commonJS((exports2, module2) => { "use strict"; module2.exports = function(Promise2, INTERNAL, tryConvertToPromise, apiRejection, Proxyable) { var util = require_util(); var isArray = util.isArray; function toResolutionValue(val) { switch (val) { case -2: return []; case -3: return {}; } } function PromiseArray(values) { var promise = this._promise = new Promise2(INTERNAL); if (values instanceof Promise2) { promise._propagateFrom(values, 3); } promise._setOnCancel(this); this._values = values; this._length = 0; this._totalResolved = 0; this._init(void 0, -2); } util.inherits(PromiseArray, Proxyable); PromiseArray.prototype.length = function() { return this._length; }; PromiseArray.prototype.promise = function() { return this._promise; }; PromiseArray.prototype._init = function init(_, resolveValueIfEmpty) { var values = tryConvertToPromise(this._values, this._promise); if (values instanceof Promise2) { values = values._target(); var bitField = values._bitField; ; this._values = values; if ((bitField & 50397184) === 0) { this._promise._setAsyncGuaranteed(); return values._then(init, this._reject, void 0, this, resolveValueIfEmpty); } else if ((bitField & 33554432) !== 0) { values = values._value(); } else if ((bitField & 16777216) !== 0) { return this._reject(values._reason()); } else { return this._cancel(); } } values = util.asArray(values); if (values === null) { var err = apiRejection("expecting an array or an iterable object but got " + util.classString(values)).reason(); this._promise._rejectCallback(err, false); return; } if (values.length === 0) { if (resolveValueIfEmpty === -5) { this._resolveEmptyArray(); } else { this._resolve(toResolutionValue(resolveValueIfEmpty)); } return; } this._iterate(values); }; PromiseArray.prototype._iterate = function(values) { var len = this.getActualLength(values.length); this._length = len; this._values = this.shouldCopyValues() ? new Array(len) : this._values; var result = this._promise; var isResolved = false; var bitField = null; for (var i = 0; i < len; ++i) { var maybePromise = tryConvertToPromise(values[i], result); if (maybePromise instanceof Promise2) { maybePromise = maybePromise._target(); bitField = maybePromise._bitField; } else { bitField = null; } if (isResolved) { if (bitField !== null) { maybePromise.suppressUnhandledRejections(); } } else if (bitField !== null) { if ((bitField & 50397184) === 0) { maybePromise._proxy(this, i); this._values[i] = maybePromise; } else if ((bitField & 33554432) !== 0) { isResolved = this._promiseFulfilled(maybePromise._value(), i); } else if ((bitField & 16777216) !== 0) { isResolved = this._promiseRejected(maybePromise._reason(), i); } else { isResolved = this._promiseCancelled(i); } } else { isResolved = this._promiseFulfilled(maybePromise, i); } } if (!isResolved) result._setAsyncGuaranteed(); }; PromiseArray.prototype._isResolved = function() { return this._values === null; }; PromiseArray.prototype._resolve = function(value) { this._values = null; this._promise._fulfill(value); }; PromiseArray.prototype._cancel = function() { if (this._isResolved() || !this._promise._isCancellable()) return; this._values = null; this._promise._cancel(); }; PromiseArray.prototype._reject = function(reason) { this._values = null; this._promise._rejectCallback(reason, false); }; PromiseArray.prototype._promiseFulfilled = function(value, index) { this._values[index] = value; var totalResolved = ++this._totalResolved; if (totalResolved >= this._length) { this._resolve(this._values); return true; } return false; }; PromiseArray.prototype._promiseCancelled = function() { this._cancel(); return true; }; PromiseArray.prototype._promiseRejected = function(reason) { this._totalResolved++; this._reject(reason); return true; }; PromiseArray.prototype._resultCancelled = function() { if (this._isResolved()) return; var values = this._values; this._cancel(); if (values instanceof Promise2) { values.cancel(); } else { for (var i = 0; i < values.length; ++i) { if (values[i] instanceof Promise2) { values[i].cancel(); } } } }; PromiseArray.prototype.shouldCopyValues = function() { return true; }; PromiseArray.prototype.getActualLength = function(len) { return len; }; return PromiseArray; }; }); // node_modules/bluebird/js/release/context.js var require_context = __commonJS((exports2, module2) => { "use strict"; module2.exports = function(Promise2) { var longStackTraces = false; var contextStack = []; Promise2.prototype._promiseCreated = function() { }; Promise2.prototype._pushContext = function() { }; Promise2.prototype._popContext = function() { return null; }; Promise2._peekContext = Promise2.prototype._peekContext = function() { }; function Context() { this._trace = new Context.CapturedTrace(peekContext()); } Context.prototype._pushContext = function() { if (this._trace !== void 0) { this._trace._promiseCreated = null; contextStack.push(this._trace); } }; Context.prototype._popContext = function() { if (this._trace !== void 0) { var trace = contextStack.pop(); var ret2 = trace._promiseCreated; trace._promiseCreated = null; return ret2; } return null; }; function createContext() { if (longStackTraces) return new Context(); } function peekContext() { var lastIndex = contextStack.length - 1; if (lastIndex >= 0) { return contextStack[lastIndex]; } return void 0; } Context.CapturedTrace = null; Context.create = createContext; Context.deactivateLongStackTraces = function() { }; Context.activateLongStackTraces = function() { var Promise_pushContext = Promise2.prototype._pushContext; var Promise_popContext = Promise2.prototype._popContext; var Promise_PeekContext = Promise2._peekContext; var Promise_peekContext = Promise2.prototype._peekContext; var Promise_promiseCreated = Promise2.prototype._promiseCreated; Context.deactivateLongStackTraces = function() { Promise2.prototype._pushContext = Promise_pushContext; Promise2.prototype._popContext = Promise_popContext; Promise2._peekContext = Promise_PeekContext; Promise2.prototype._peekContext = Promise_peekContext; Promise2.prototype._promiseCreated = Promise_promiseCreated; longStackTraces = false; }; longStackTraces = true; Promise2.prototype._pushContext = Context.prototype._pushContext; Promise2.prototype._popContext = Context.prototype._popContext; Promise2._peekContext = Promise2.prototype._peekContext = peekContext; Promise2.prototype._promiseCreated = function() { var ctx = this._peekContext(); if (ctx && ctx._promiseCreated == null) ctx._promiseCreated = this; }; }; return Context; }; }); // node_modules/bluebird/js/release/debuggability.js var require_debuggability = __commonJS((exports2, module2) => { "use strict"; module2.exports = function(Promise2, Context) { var getDomain = Promise2._getDomain; var async = Promise2._async; var Warning = require_errors().Warning; var util = require_util(); var canAttachTrace2 = util.canAttachTrace; var unhandledRejectionHandled; var possiblyUnhandledRejection; var bluebirdFramePattern = /[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/; var nodeFramePattern = /\((?:timers\.js):\d+:\d+\)/; var parseLinePattern = /[\/<\(](.+?):(\d+):(\d+)\)?\s*$/; var stackFramePattern = null; var formatStack = null; var indentStackFrames = false; var printWarning; var debugging = !!(util.env("BLUEBIRD_DEBUG") != 0 && (util.env("BLUEBIRD_DEBUG") || util.env("NODE_ENV") === "development")); var warnings = !!(util.env("BLUEBIRD_WARNINGS") != 0 && (debugging || util.env("BLUEBIRD_WARNINGS"))); var longStackTraces = !!(util.env("BLUEBIRD_LONG_STACK_TRACES") != 0 && (debugging || util.env("BLUEBIRD_LONG_STACK_TRACES"))); var wForgottenReturn = util.env("BLUEBIRD_W_FORGOTTEN_RETURN") != 0 && (warnings || !!util.env("BLUEBIRD_W_FORGOTTEN_RETURN")); Promise2.prototype.suppressUnhandledRejections = function() { var target = this._target(); target._bitField = target._bitField & ~1048576 | 524288; }; Promise2.prototype._ensurePossibleRejectionHandled = function() { if ((this._bitField & 524288) !== 0) return; this._setRejectionIsUnhandled(); async.invokeLater(this._notifyUnhandledRejection, this, void 0); }; Promise2.prototype._notifyUnhandledRejectionIsHandled = function() { fireRejectionEvent("rejectionHandled", unhandledRejectionHandled, void 0, this); }; Promise2.prototype._setReturnedNonUndefined = function() { this._bitField = this._bitField | 268435456; }; Promise2.prototype._returnedNonUndefined = function() { return (this._bitField & 268435456) !== 0; }; Promise2.prototype._notifyUnhandledRejection = function() { if (this._isRejectionUnhandled()) { var reason = this._settledValue(); this._setUnhandledRejectionIsNotified(); fireRejectionEvent("unhandledRejection", possiblyUnhandledRejection, reason, this); } }; Promise2.prototype._setUnhandledRejectionIsNotified = function() { this._bitField = this._bitField | 262144; }; Promise2.prototype._unsetUnhandledRejectionIsNotified = function() { this._bitField = this._bitField & ~262144; }; Promise2.prototype._isUnhandledRejectionNotified = function() { return (this._bitField & 262144) > 0; }; Promise2.prototype._setRejectionIsUnhandled = function() { this._bitField = this._bitField | 1048576; }; Promise2.prototype._unsetRejectionIsUnhandled = function() { this._bitField = this._bitField & ~1048576; if (this._isUnhandledRejectionNotified()) { this._unsetUnhandledRejectionIsNotified(); this._notifyUnhandledRejectionIsHandled(); } }; Promise2.prototype._isRejectionUnhandled = function() { return (this._bitField & 1048576) > 0; }; Promise2.prototype._warn = function(message, shouldUseOwnTrace, promise) { return warn(message, shouldUseOwnTrace, promise || this); }; Promise2.onPossiblyUnhandledRejection = function(fn) { var domain = getDomain(); possiblyUnhandledRejection = typeof fn === "function" ? domain === null ? fn : util.domainBind(domain, fn) : void 0; }; Promise2.onUnhandledRejectionHandled = function(fn) { var domain = getDomain(); unhandledRejectionHandled = typeof fn === "function" ? domain === null ? fn : util.domainBind(domain, fn) : void 0; }; var disableLongStackTraces = function() { }; Promise2.longStackTraces = function() { if (async.haveItemsQueued() && !config.longStackTraces) { throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n"); } if (!config.longStackTraces && longStackTracesIsSupported()) { var Promise_captureStackTrace = Promise2.prototype._captureStackTrace; var Promise_attachExtraTrace = Promise2.prototype._attachExtraTrace; config.longStackTraces = true; disableLongStackTraces = function() { if (async.haveItemsQueued() && !config.longStackTraces) { throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n"); } Promise2.prototype._captureStackTrace = Promise_captureStackTrace; Promise2.prototype._attachExtraTrace = Promise_attachExtraTrace; Context.deactivateLongStackTraces(); async.enableTrampoline(); config.longStackTraces = false; }; Promise2.prototype._captureStackTrace = longStackTracesCaptureStackTrace; Promise2.prototype._attachExtraTrace = longStackTracesAttachExtraTrace; Context.activateLongStackTraces(); async.disableTrampolineIfNecessary(); } }; Promise2.hasLongStackTraces = function() { return config.longStackTraces && longStackTracesIsSupported(); }; var fireDomEvent = function() { try { if (typeof CustomEvent === "function") { var event = new CustomEvent("CustomEvent"); util.global.dispatchEvent(event); return function(name, event2) { var domEvent = new CustomEvent(name.toLowerCase(), { detail: event2, cancelable: true }); return !util.global.dispatchEvent(domEvent); }; } else if (typeof Event === "function") { var event = new Event("CustomEvent"); util.global.dispatchEvent(event); return function(name, event2) { var domEvent = new Event(name.toLowerCase(), { cancelable: true }); domEvent.detail = event2; return !util.global.dispatchEvent(domEvent); }; } else { var event = document.createEvent("CustomEvent"); event.initCustomEvent("testingtheevent", false, true, {}); util.global.dispatchEvent(event); return function(name, event2) { var domEvent = document.createEvent("CustomEvent"); domEvent.initCustomEvent(name.toLowerCase(), false, true, event2); return !util.global.dispatchEvent(domEvent); }; } } catch (e) { } return function() { return false; }; }(); var fireGlobalEvent = function() { if (util.isNode) { return function() { return process.emit.apply(process, arguments); }; } else { if (!util.global) { return function() { return false; }; } return function(name) { var methodName = "on" + name.toLowerCase(); var method = util.global[methodName]; if (!method) return false; method.apply(util.global, [].slice.call(arguments, 1)); return true; }; } }(); function generatePromiseLifecycleEventObject(name, promise) { return {promise}; } var eventToObjectGenerator = { promiseCreated: generatePromiseLifecycleEventObject, promiseFulfilled: generatePromiseLifecycleEventObject, promiseRejected: generatePromiseLifecycleEventObject, promiseResolved: generatePromiseLifecycleEventObject, promiseCancelled: generatePromiseLifecycleEventObject, promiseChained: function(name, promise, child) { return {promise, child}; }, warning: function(name, warning) { return {warning}; }, unhandledRejection: function(name, reason, promise) { return {reason, promise}; }, rejectionHandled: generatePromiseLifecycleEventObject }; var activeFireEvent = function(name) { var globalEventFired = false; try { globalEventFired = fireGlobalEvent.apply(null, arguments); } catch (e) { async.throwLater(e); globalEventFired = true; } var domEventFired = false; try { domEventFired = fireDomEvent(name, eventToObjectGenerator[name].apply(null, arguments)); } catch (e) { async.throwLater(e); domEventFired = true; } return domEventFired || globalEventFired; }; Promise2.config = function(opts) { opts = Object(opts); if ("longStackTraces" in opts) { if (opts.longStackTraces) { Promise2.longStackTraces(); } else if (!opts.longStackTraces && Promise2.hasLongStackTraces()) { disableLongStackTraces(); } } if ("warnings" in opts) { var warningsOption = opts.warnings; config.warnings = !!warningsOption; wForgottenReturn = config.warnings; if (util.isObject(warningsOption)) { if ("wForgottenReturn" in warningsOption) { wForgottenReturn = !!warningsOption.wForgottenReturn; } } } if ("cancellation" in opts && opts.cancellation && !config.cancellation) { if (async.haveItemsQueued()) { throw new Error("cannot enable cancellation after promises are in use"); } Promise2.prototype._clearCancellationData = cancellationClearCancellationData; Promise2.prototype._propagateFrom = cancellationPropagateFrom; Promise2.prototype._onCancel = cancellationOnCancel; Promise2.prototype._setOnCancel = cancellationSetOnCancel; Promise2.prototype._attachCancellationCallback = cancellationAttachCancellationCallback; Promise2.prototype._execute = cancellationExecute; propagateFromFunction = cancellationPropagateFrom; config.cancellation = true; } if ("monitoring" in opts) { if (opts.monitoring && !config.monitoring) { config.monitoring = true; Promise2.prototype._fireEvent = activeFireEvent; } else if (!opts.monitoring && config.monitoring) { config.monitoring = false; Promise2.prototype._fireEvent = defaultFireEvent; } } return Promise2; }; function defaultFireEvent() { return false; } Promise2.prototype._fireEvent = defaultFireEvent; Promise2.prototype._execute = function(executor, resolve, reject) { try { executor(resolve, reject); } catch (e) { return e; } }; Promise2.prototype._onCancel = function() { }; Promise2.prototype._setOnCancel = function(handler) { ; }; Promise2.prototype._attachCancellationCallback = function(onCancel) { ; }; Promise2.prototype._captureStackTrace = function() { }; Promise2.prototype._attachExtraTrace = function() { }; Promise2.prototype._clearCancellationData = function() { }; Promise2.prototype._propagateFrom = function(parent, flags) { ; ; }; function cancellationExecute(executor, resolve, reject) { var promise = this; try { executor(resolve, reject, function(onCancel) { if (typeof onCancel !== "function") { throw new TypeError("onCancel must be a function, got: " + util.toString(onCancel)); } promise._attachCancellationCallback(onCancel); }); } catch (e) { return e; } } function cancellationAttachCancellationCallback(onCancel) { if (!this._isCancellable()) return this; var previousOnCancel = this._onCancel(); if (previousOnCancel !== void 0) { if (util.isArray(previousOnCancel)) { previousOnCancel.push(onCancel); } else { this._setOnCancel([previousOnCancel, onCancel]); } } else { this._setOnCancel(onCancel); } } function cancellationOnCancel() { return this._onCancelField; } function cancellationSetOnCancel(onCancel) { this._onCancelField = onCancel; } function cancellationClearCancellationData() { this._cancellationParent = void 0; this._onCancelField = void 0; } function cancellationPropagateFrom(parent, flags) { if ((flags & 1) !== 0) { this._cancellationParent = parent; var branchesRemainingToCancel = parent._branchesRemainingToCancel; if (branchesRemainingToCancel === void 0) { branchesRemainingToCancel = 0; } parent._branchesRemainingToCancel = branchesRemainingToCancel + 1; } if ((flags & 2) !== 0 && parent._isBound()) { this._setBoundTo(parent._boundTo); } } function bindingPropagateFrom(parent, flags) { if ((flags & 2) !== 0 && parent._isBound()) { this._setBoundTo(parent._boundTo); } } var propagateFromFunction = bindingPropagateFrom; function boundValueFunction() { var ret2 = this._boundTo; if (ret2 !== void 0) { if (ret2 instanceof Promise2) { if (ret2.isFulfilled()) { return ret2.value(); } else { return void 0; } } } return ret2; } function longStackTracesCaptureStackTrace() { this._trace = new CapturedTrace(this._peekContext()); } function longStackTracesAttachExtraTrace(error, ignoreSelf) { if (canAttachTrace2(error)) { var trace = this._trace; if (trace !== void 0) { if (ignoreSelf) trace = trace._parent; } if (trace !== void 0) { trace.attachExtraTrace(error); } else if (!error.__stackCleaned__) { var parsed = parseStackAndMessage(error); util.notEnumerableProp(error, "stack", parsed.message + "\n" + parsed.stack.join("\n")); util.notEnumerableProp(error, "__stackCleaned__", true); } } } function checkForgottenReturns(returnValue, promiseCreated, name, promise, parent) { if (returnValue === void 0 && promiseCreated !== null && wForgottenReturn) { if (parent !== void 0 && parent._returnedNonUndefined()) return; if ((promise._bitField & 65535) === 0) return; if (name) name = name + " "; var handlerLine = ""; var creatorLine = ""; if (promiseCreated._trace) { var traceLines = promiseCreated._trace.stack.split("\n"); var stack = cleanStack(traceLines); for (var i = stack.length - 1; i >= 0; --i) { var line = stack[i]; if (!nodeFramePattern.test(line)) { var lineMatches = line.match(parseLinePattern); if (lineMatches) { handlerLine = "at " + lineMatches[1] + ":" + lineMatches[2] + ":" + lineMatches[3] + " "; } break; } } if (stack.length > 0) { var firstUserLine = stack[0]; for (var i = 0; i < traceLines.length; ++i) { if (traceLines[i] === firstUserLine) { if (i > 0) { creatorLine = "\n" + traceLines[i - 1]; } break; } } } } var msg = "a promise was created in a " + name + "handler " + handlerLine + "but was not returned from it, see http://goo.gl/rRqMUw" + creatorLine; promise._warn(msg, true, promiseCreated); } } function deprecated(name, replacement) { var message = name + " is deprecated and will be removed in a future version."; if (replacement) message += " Use " + replacement + " instead."; return warn(message); } function warn(message, shouldUseOwnTrace, promise) { if (!config.warnings) return; var warning = new Warning(message); var ctx; if (shouldUseOwnTrace) { promise._attachExtraTrace(warning); } else if (config.longStackTraces && (ctx = Promise2._peekContext())) { ctx.attachExtraTrace(warning); } else { var parsed = parseStackAndMessage(warning); warning.stack = parsed.message + "\n" + parsed.stack.join("\n"); } if (!activeFireEvent("warning", warning)) { formatAndLogError(warning, "", true); } } function reconstructStack(message, stacks) { for (var i = 0; i < stacks.length - 1; ++i) { stacks[i].push("From previous event:"); stacks[i] = stacks[i].join("\n"); } if (i < stacks.length) { stacks[i] = stacks[i].join("\n"); } return message + "\n" + stacks.join("\n"); } function removeDuplicateOrEmptyJumps(stacks) { for (var i = 0; i < stacks.length; ++i) { if (stacks[i].length === 0 || i + 1 < stacks.length && stacks[i][0] === stacks[i + 1][0]) { stacks.splice(i, 1); i--; } } } function removeCommonRoots(stacks) { var current = stacks[0]; for (var i = 1; i < stacks.length; ++i) { var prev = stacks[i]; var currentLastIndex = current.length - 1; var currentLastLine = current[currentLastIndex]; var commonRootMeetPoint = -1; for (var j = prev.length - 1; j >= 0; --j) { if (prev[j] === currentLastLine) { commonRootMeetPoint = j; break; } } for (var j = commonRootMeetPoint; j >= 0; --j) { var line = prev[j]; if (current[currentLastIndex] === line) { current.pop(); currentLastIndex--; } else { break; } } current = prev; } } function cleanStack(stack) { var ret2 = []; for (var i = 0; i < stack.length; ++i) { var line = stack[i]; var isTraceLine = line === " (No stack trace)" || stackFramePattern.test(line); var isInternalFrame = isTraceLine && shouldIgnore(line); if (isTraceLine && !isInternalFrame) { if (indentStackFrames && line.charAt(0) !== " ") { line = " " + line; } ret2.push(line); } } return ret2; } function stackFramesAsArray(error) { var stack = error.stack.replace(/\s+$/g, "").split("\n"); for (var i = 0; i < stack.length; ++i) { var line = stack[i]; if (line === " (No stack trace)" || stackFramePattern.test(line)) { break; } } if (i > 0 && error.name != "SyntaxError") { stack = stack.slice(i); } return stack; } function parseStackAndMessage(error) { var stack = error.stack; var message = error.toString(); stack = typeof stack === "string" && stack.length > 0 ? stackFramesAsArray(error) : [" (No stack trace)"]; return { message, stack: error.name == "SyntaxError" ? stack : cleanStack(stack) }; } function formatAndLogError(error, title, isSoft) { if (typeof console !== "undefined") { var message; if (util.isObject(error)) { var stack = error.stack; message = title + formatStack(stack, error); } else { message = title + String(error); } if (typeof printWarning === "function") { printWarning(message, isSoft); } else if (typeof console.log === "function" || typeof console.log === "object") { console.log(message); } } } function fireRejectionEvent(name, localHandler, reason, promise) { var localEventFired = false; try { if (typeof localHandler === "function") { localEventFired = true; if (name === "rejectionHandled") { localHandler(promise); } else { localHandler(reason, promise); } } } catch (e) { async.throwLater(e); } if (name === "unhandledRejection") { if (!activeFireEvent(name, reason, promise) && !localEventFired) { formatAndLogError(reason, "Unhandled rejection "); } } else { activeFireEvent(name, promise); } } function formatNonError(obj) { var str; if (typeof obj === "function") { str = "[function " + (obj.name || "anonymous") + "]"; } else { str = obj && typeof obj.toString === "function" ? obj.toString() : util.toString(obj); var ruselessToString = /\[object [a-zA-Z0-9$_]+\]/; if (ruselessToString.test(str)) { try { var newStr = JSON.stringify(obj); str = newStr; } catch (e) { } } if (str.length === 0) { str = "(empty array)"; } } return "(<" + snip(str) + ">, no stack trace)"; } function snip(str) { var maxChars = 41; if (str.length < maxChars) { return str; } return str.substr(0, maxChars - 3) + "..."; } function longStackTracesIsSupported() { return typeof captureStackTrace === "function"; } var shouldIgnore = function() { return false; }; var parseLineInfoRegex = /[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/; function parseLineInfo(line) { var matches = line.match(parseLineInfoRegex); if (matches) { return { fileName: matches[1], line: parseInt(matches[2], 10) }; } } function setBounds(firstLineError, lastLineError) { if (!longStackTracesIsSupported()) return; var firstStackLines = firstLineError.stack.split("\n"); var lastStackLines = lastLineError.stack.split("\n"); var firstIndex = -1; var lastIndex = -1; var firstFileName; var lastFileName; for (var i = 0; i < firstStackLines.length; ++i) { var result = parseLineInfo(firstStackLines[i]); if (result) { firstFileName = result.fileName; firstIndex = result.line; break; } } for (var i = 0; i < lastStackLines.length; ++i) { var result = parseLineInfo(lastStackLines[i]); if (result) { lastFileName = result.fileName; lastIndex = result.line; break; } } if (firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName || firstFileName !== lastFileName || firstIndex >= lastIndex) { return; } shouldIgnore = function(line) { if (bluebirdFramePattern.test(line)) return true; var info = parseLineInfo(line); if (info) { if (info.fileName === firstFileName && (firstIndex <= info.line && info.line <= lastIndex)) { return true; } } return false; }; } function CapturedTrace(parent) { this._parent = parent; this._promisesCreated = 0; var length = this._length = 1 + (parent === void 0 ? 0 : parent._length); captureStackTrace(this, CapturedTrace); if (length > 32) this.uncycle(); } util.inherits(CapturedTrace, Error); Context.CapturedTrace = CapturedTrace; CapturedTrace.prototype.uncycle = function() { var length = this._length; if (length < 2) return; var nodes = []; var stackToIndex = {}; for (var i = 0, node = this; node !== void 0; ++i) { nodes.push(node); node = node._parent; } length = this._length = i; for (var i = length - 1; i >= 0; --i) { var stack = nodes[i].stack; if (stackToIndex[stack] === void 0) { stackToIndex[stack] = i; } } for (var i = 0; i < length; ++i) { var currentStack = nodes[i].stack; var index = stackToIndex[currentStack]; if (index !== void 0 && index !== i) { if (index > 0) { nodes[index - 1]._parent = void 0; nodes[index - 1]._length = 1; } nodes[i]._parent = void 0; nodes[i]._length = 1; var cycleEdgeNode = i > 0 ? nodes[i - 1] : this; if (index < length - 1) { cycleEdgeNode._parent = nodes[index + 1]; cycleEdgeNode._parent.uncycle(); cycleEdgeNode._length = cycleEdgeNode._parent._length + 1; } else { cycleEdgeNode._parent = void 0; cycleEdgeNode._length = 1; } var currentChildLength = cycleEdgeNode._length + 1; for (var j = i - 2; j >= 0; --j) { nodes[j]._length = currentChildLength; currentChildLength++; } return; } } }; CapturedTrace.prototype.attachExtraTrace = function(error) { if (error.__stackCleaned__) return; this.uncycle(); var parsed = parseStackAndMessage(error); var message = parsed.message; var stacks = [parsed.stack]; var trace = this; while (trace !== void 0) { stacks.push(cleanStack(trace.stack.split("\n"))); trace = trace._parent; } removeCommonRoots(stacks); removeDuplicateOrEmptyJumps(stacks); util.notEnumerableProp(error, "stack", reconstructStack(message, stacks)); util.notEnumerableProp(error, "__stackCleaned__", true); }; var captureStackTrace = function stackDetection() { var v8stackFramePattern = /^\s*at\s*/; var v8stackFormatter = function(stack, error) { if (typeof stack === "string") return stack; if (error.name !== void 0 && error.message !== void 0) { return error.toString(); } return formatNonError(error); }; if (typeof Error.stackTraceLimit === "number" && typeof Error.captureStackTrace === "function") { Error.stackTraceLimit += 6; stackFramePattern = v8stackFramePattern; formatStack = v8stackFormatter; var captureStackTrace2 = Error.captureStackTrace; shouldIgnore = function(line) { return bluebirdFramePattern.test(line); }; return function(receiver, ignoreUntil) { Error.stackTraceLimit += 6; captureStackTrace2(receiver, ignoreUntil); Error.stackTraceLimit -= 6; }; } var err = new Error(); if (typeof err.stack === "string" && err.stack.split("\n")[0].indexOf("stackDetection@") >= 0) { stackFramePattern = /@/; formatStack = v8stackFormatter; indentStackFrames = true; return function captureStackTrace3(o) { o.stack = new Error().stack; }; } var hasStackAfterThrow; try { throw new Error(); } catch (e) { hasStackAfterThrow = "stack" in e; } if (!("stack" in err) && hasStackAfterThrow && typeof Error.stackTraceLimit === "number") { stackFramePattern = v8stackFramePattern; formatStack = v8stackFormatter; return function captureStackTrace3(o) { Error.stackTraceLimit += 6; try { throw new Error(); } catch (e) { o.stack = e.stack; } Error.stackTraceLimit -= 6; }; } formatStack = function(stack, error) { if (typeof stack === "string") return stack; if ((typeof error === "object" || typeof error === "function") && error.name !== void 0 && error.message !== void 0) { return error.toString(); } return formatNonError(error); }; return null; }([]); if (typeof console !== "undefined" && typeof console.warn !== "undefined") { printWarning = function(message) { console.warn(message); }; if (util.isNode && process.stderr.isTTY) { printWarning = function(message, isSoft) { var color = isSoft ? "" : ""; console.warn(color + message + "\n"); }; } else if (!util.isNode && typeof new Error().stack === "string") { printWarning = function(message, isSoft) { console.warn("%c" + message, isSoft ? "color: darkorange" : "color: red"); }; } } var config = { warnings, longStackTraces: false, cancellation: false, monitoring: false }; if (longStackTraces) Promise2.longStackTraces(); return { longStackTraces: function() { return config.longStackTraces; }, warnings: function() { return config.warnings; }, cancellation: function() { return config.cancellation; }, monitoring: function() { return config.monitoring; }, propagateFromFunction: function() { return propagateFromFunction; }, boundValueFunction: function() { return boundValueFunction; }, checkForgottenReturns, setBounds, warn, deprecated, CapturedTrace, fireDomEvent, fireGlobalEvent }; }; }); // node_modules/bluebird/js/release/finally.js var require_finally = __commonJS((exports2, module2) => { "use strict"; module2.exports = function(Promise2, tryConvertToPromise) { var util = require_util(); var CancellationError = Promise2.CancellationError; var errorObj2 = util.errorObj; function PassThroughHandlerContext(promise, type, handler) { this.promise = promise; this.type = type; this.handler = handler; this.called = false; this.cancelPromise = null; } PassThroughHandlerContext.prototype.isFinallyHandler = function() { return this.type === 0; }; function FinallyHandlerCancelReaction(finallyHandler2) { this.finallyHandler = finallyHandler2; } FinallyHandlerCancelReaction.prototype._resultCancelled = function() { checkCancel(this.finallyHandler); }; function checkCancel(ctx, reason) { if (ctx.cancelPromise != null) { if (arguments.length > 1) { ctx.cancelPromise._reject(reason); } else { ctx.cancelPromise._cancel(); } ctx.cancelPromise = null; return true; } return false; } function succeed() { return finallyHandler.call(this, this.promise._target()._settledValue()); } function fail(reason) { if (checkCancel(this, reason)) return; errorObj2.e = reason; return errorObj2; } function finallyHandler(reasonOrValue) { var promise = this.promise; var handler = this.handler; if (!this.called) { this.called = true; var ret2 = this.isFinallyHandler() ? handler.call(promise._boundValue()) : handler.call(promise._boundValue(), reasonOrValue); if (ret2 !== void 0) { promise._setReturnedNonUndefined(); var maybePromise = tryConvertToPromise(ret2, promise); if (maybePromise instanceof Promise2) { if (this.cancelPromise != null) { if (maybePromise._isCancelled()) { var reason = new CancellationError("late cancellation observer"); promise._attachExtraTrace(reason); errorObj2.e = reason; return errorObj2; } else if (maybePromise.isPending()) { maybePromise._attachCancellationCallback(new FinallyHandlerCancelReaction(this)); } } return maybePromise._then(succeed, fail, void 0, this, void 0); } } } if (promise.isRejected()) { checkCancel(this); errorObj2.e = reasonOrValue; return errorObj2; } else { checkCancel(this); return reasonOrValue; } } Promise2.prototype._passThrough = function(handler, type, success, fail2) { if (typeof handler !== "function") return this.then(); return this._then(success, fail2, void 0, new PassThroughHandlerContext(this, type, handler), void 0); }; Promise2.prototype.lastly = Promise2.prototype["finally"] = function(handler) { return this._passThrough(handler, 0, finallyHandler, finallyHandler); }; Promise2.prototype.tap = function(handler) { return this._passThrough(handler, 1, finallyHandler); }; return PassThroughHandlerContext; }; }); // node_modules/bluebird/js/release/catch_filter.js var require_catch_filter = __commonJS((exports2, module2) => { "use strict"; module2.exports = function(NEXT_FILTER) { var util = require_util(); var getKeys = require_es5().keys; var tryCatch2 = util.tryCatch; var errorObj2 = util.errorObj; function catchFilter(instances, cb, promise) { return function(e) { var boundTo = promise._boundValue(); predicateLoop: for (var i = 0; i < instances.length; ++i) { var item = instances[i]; if (item === Error || item != null && item.prototype instanceof Error) { if (e instanceof item) { return tryCatch2(cb).call(boundTo, e); } } else if (typeof item === "function") { var matchesPredicate = tryCatch2(item).call(boundTo, e); if (matchesPredicate === errorObj2) { return matchesPredicate; } else if (matchesPredicate) { return tryCatch2(cb).call(boundTo, e); } } else if (util.isObject(e)) { var keys = getKeys(item); for (var j = 0; j < keys.length; ++j) { var key = keys[j]; if (item[key] != e[key]) { continue predicateLoop; } } return tryCatch2(cb).call(boundTo, e); } } return NEXT_FILTER; }; } return catchFilter; }; }); // node_modules/bluebird/js/release/nodeback.js var require_nodeback = __commonJS((exports2, module2) => { "use strict"; var util = require_util(); var maybeWrapAsError2 = util.maybeWrapAsError; var errors = require_errors(); var OperationalError = errors.OperationalError; var es52 = require_es5(); function isUntypedError(obj) { return obj instanceof Error && es52.getPrototypeOf(obj) === Error.prototype; } var rErrorKey = /^(?:name|message|stack|cause)$/; function wrapAsOperationalError(obj) { var ret2; if (isUntypedError(obj)) { ret2 = new OperationalError(obj); ret2.name = obj.name; ret2.message = obj.message; ret2.stack = obj.stack; var keys = es52.keys(obj); for (var i = 0; i < keys.length; ++i) { var key = keys[i]; if (!rErrorKey.test(key)) { ret2[key] = obj[key]; } } return ret2; } util.markAsOriginatingFromRejection(obj); return obj; } function nodebackForPromise(promise, multiArgs) { return function(err, value) { if (promise === null) return; if (err) { var wrapped = wrapAsOperationalError(maybeWrapAsError2(err)); promise._attachExtraTrace(wrapped); promise._reject(wrapped); } else if (!multiArgs) { promise._fulfill(value); } else { var $_len = arguments.length; var args = new Array(Math.max($_len - 1, 0)); for (var $_i = 1; $_i < $_len; ++$_i) { args[$_i - 1] = arguments[$_i]; } ; promise._fulfill(args); } promise = null; }; } module2.exports = nodebackForPromise; }); // node_modules/bluebird/js/release/method.js var require_method = __commonJS((exports2, module2) => { "use strict"; module2.exports = function(Promise2, INTERNAL, tryConvertToPromise, apiRejection, debug) { var util = require_util(); var tryCatch2 = util.tryCatch; Promise2.method = function(fn) { if (typeof fn !== "function") { throw new Promise2.TypeError("expecting a function but got " + util.classString(fn)); } return function() { var ret2 = new Promise2(INTERNAL); ret2._captureStackTrace(); ret2._pushContext(); var value = tryCatch2(fn).apply(this, arguments); var promiseCreated = ret2._popContext(); debug.checkForgottenReturns(value, promiseCreated, "Promise.method", ret2); ret2._resolveFromSyncValue(value); return ret2; }; }; Promise2.attempt = Promise2["try"] = function(fn) { if (typeof fn !== "function") { return apiRejection("expecting a function but got " + util.classString(fn)); } var ret2 = new Promise2(INTERNAL); ret2._captureStackTrace(); ret2._pushContext(); var value; if (arguments.length > 1) { debug.deprecated("calling Promise.try with more than 1 argument"); var arg = arguments[1]; var ctx = arguments[2]; value = util.isArray(arg) ? tryCatch2(fn).apply(ctx, arg) : tryCatch2(fn).call(ctx, arg); } else { value = tryCatch2(fn)(); } var promiseCreated = ret2._popContext(); debug.checkForgottenReturns(value, promiseCreated, "Promise.try", ret2); ret2._resolveFromSyncValue(value); return ret2; }; Promise2.prototype._resolveFromSyncValue = function(value) { if (value === util.errorObj) { this._rejectCallback(value.e, false); } else { this._resolveCallback(value, true); } }; }; }); // node_modules/bluebird/js/release/bind.js var require_bind = __commonJS((exports2, module2) => { "use strict"; module2.exports = function(Promise2, INTERNAL, tryConvertToPromise, debug) { var calledBind = false; var rejectThis = function(_, e) { this._reject(e); }; var targetRejected = function(e, context) { context.promiseRejectionQueued = true; context.bindingPromise._then(rejectThis, rejectThis, null, this, e); }; var bindingResolved = function(thisArg, context) { if ((this._bitField & 50397184) === 0) { this._resolveCallback(context.target); } }; var bindingRejected = function(e, context) { if (!context.promiseRejectionQueued) this._reject(e); }; Promise2.prototype.bind = function(thisArg) { if (!calledBind) { calledBind = true; Promise2.prototype._propagateFrom = debug.propagateFromFunction(); Promise2.prototype._boundValue = debug.boundValueFunction(); } var maybePromise = tryConvertToPromise(thisArg); var ret2 = new Promise2(INTERNAL); ret2._propagateFrom(this, 1); var target = this._target(); ret2._setBoundTo(maybePromise); if (maybePromise instanceof Promise2) { var context = { promiseRejectionQueued: false, promise: ret2, target, bindingPromise: maybePromise }; target._then(INTERNAL, targetRejected, void 0, ret2, context); maybePromise._then(bindingResolved, bindingRejected, void 0, ret2, context); ret2._setOnCancel(maybePromise); } else { ret2._resolveCallback(target); } return ret2; }; Promise2.prototype._setBoundTo = function(obj) { if (obj !== void 0) { this._bitField = this._bitField | 2097152; this._boundTo = obj; } else { this._bitField = this._bitField & ~2097152; } }; Promise2.prototype._isBound = function() { return (this._bitField & 2097152) === 2097152; }; Promise2.bind = function(thisArg, value) { return Promise2.resolve(value).bind(thisArg); }; }; }); // node_modules/bluebird/js/release/cancel.js var require_cancel = __commonJS((exports2, module2) => { "use strict"; module2.exports = function(Promise2, PromiseArray, apiRejection, debug) { var util = require_util(); var tryCatch2 = util.tryCatch; var errorObj2 = util.errorObj; var async = Promise2._async; Promise2.prototype["break"] = Promise2.prototype.cancel = function() { if (!debug.cancellation()) return this._warn("cancellation is disabled"); var promise = this; var child = promise; while (promise._isCancellable()) { if (!promise._cancelBy(child)) { if (child._isFollowing()) { child._followee().cancel(); } else { child._cancelBranched(); } break; } var parent = promise._cancellationParent; if (parent == null || !parent._isCancellable()) { if (promise._isFollowing()) { promise._followee().cancel(); } else { promise._cancelBranched(); } break; } else { if (promise._isFollowing()) promise._followee().cancel(); promise._setWillBeCancelled(); child = promise; promise = parent; } } }; Promise2.prototype._branchHasCancelled = function() { this._branchesRemainingToCancel--; }; Promise2.prototype._enoughBranchesHaveCancelled = function() { return this._branchesRemainingToCancel === void 0 || this._branchesRemainingToCancel <= 0; }; Promise2.prototype._cancelBy = function(canceller) { if (canceller === this) { this._branchesRemainingToCancel = 0; this._invokeOnCancel(); return true; } else { this._branchHasCancelled(); if (this._enoughBranchesHaveCancelled()) { this._invokeOnCancel(); return true; } } return false; }; Promise2.prototype._cancelBranched = function() { if (this._enoughBranchesHaveCancelled()) { this._cancel(); } }; Promise2.prototype._cancel = function() { if (!this._isCancellable()) return; this._setCancelled(); async.invoke(this._cancelPromises, this, void 0); }; Promise2.prototype._cancelPromises = function() { if (this._length() > 0) this._settlePromises(); }; Promise2.prototype._unsetOnCancel = function() { this._onCancelField = void 0; }; Promise2.prototype._isCancellable = function() { return this.isPending() && !this._isCancelled(); }; Promise2.prototype.isCancellable = function() { return this.isPending() && !this.isCancelled(); }; Promise2.prototype._doInvokeOnCancel = function(onCancelCallback, internalOnly) { if (util.isArray(onCancelCallback)) { for (var i = 0; i < onCancelCallback.length; ++i) { this._doInvokeOnCancel(onCancelCallback[i], internalOnly); } } else if (onCancelCallback !== void 0) { if (typeof onCancelCallback === "function") { if (!internalOnly) { var e = tryCatch2(onCancelCallback).call(this._boundValue()); if (e === errorObj2) { this._attachExtraTrace(e.e); async.throwLater(e.e); } } } else { onCancelCallback._resultCancelled(this); } } }; Promise2.prototype._invokeOnCancel = function() { var onCancelCallback = this._onCancel(); this._unsetOnCancel(); async.invoke(this._doInvokeOnCancel, this, onCancelCallback); }; Promise2.prototype._invokeInternalOnCancel = function() { if (this._isCancellable()) { this._doInvokeOnCancel(this._onCancel(), true); this._unsetOnCancel(); } }; Promise2.prototype._resultCancelled = function() { this.cancel(); }; }; }); // node_modules/bluebird/js/release/direct_resolve.js var require_direct_resolve = __commonJS((exports2, module2) => { "use strict"; module2.exports = function(Promise2) { function returner() { return this.value; } function thrower2() { throw this.reason; } Promise2.prototype["return"] = Promise2.prototype.thenReturn = function(value) { if (value instanceof Promise2) value.suppressUnhandledRejections(); return this._then(returner, void 0, void 0, {value}, void 0); }; Promise2.prototype["throw"] = Promise2.prototype.thenThrow = function(reason) { return this._then(thrower2, void 0, void 0, {reason}, void 0); }; Promise2.prototype.catchThrow = function(reason) { if (arguments.length <= 1) { return this._then(void 0, thrower2, void 0, {reason}, void 0); } else { var _reason = arguments[1]; var handler = function() { throw _reason; }; return this.caught(reason, handler); } }; Promise2.prototype.catchReturn = function(value) { if (arguments.length <= 1) { if (value instanceof Promise2) value.suppressUnhandledRejections(); return this._then(void 0, returner, void 0, {value}, void 0); } else { var _value = arguments[1]; if (_value instanceof Promise2) _value.suppressUnhandledRejections(); var handler = function() { return _value; }; return this.caught(value, handler); } }; }; }); // node_modules/bluebird/js/release/synchronous_inspection.js var require_synchronous_inspection = __commonJS((exports2, module2) => { "use strict"; module2.exports = function(Promise2) { function PromiseInspection(promise) { if (promise !== void 0) { promise = promise._target(); this._bitField = promise._bitField; this._settledValueField = promise._isFateSealed() ? promise._settledValue() : void 0; } else { this._bitField = 0; this._settledValueField = void 0; } } PromiseInspection.prototype._settledValue = function() { return this._settledValueField; }; var value = PromiseInspection.prototype.value = function() { if (!this.isFulfilled()) { throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n"); } return this._settledValue(); }; var reason = PromiseInspection.prototype.error = PromiseInspection.prototype.reason = function() { if (!this.isRejected()) { throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n"); } return this._settledValue(); }; var isFulfilled = PromiseInspection.prototype.isFulfilled = function() { return (this._bitField & 33554432) !== 0; }; var isRejected = PromiseInspection.prototype.isRejected = function() { return (this._bitField & 16777216) !== 0; }; var isPending = PromiseInspection.prototype.isPending = function() { return (this._bitField & 50397184) === 0; }; var isResolved = PromiseInspection.prototype.isResolved = function() { return (this._bitField & 50331648) !== 0; }; PromiseInspection.prototype.isCancelled = function() { return (this._bitField & 8454144) !== 0; }; Promise2.prototype.__isCancelled = function() { return (this._bitField & 65536) === 65536; }; Promise2.prototype._isCancelled = function() { return this._target().__isCancelled(); }; Promise2.prototype.isCancelled = function() { return (this._target()._bitField & 8454144) !== 0; }; Promise2.prototype.isPending = function() { return isPending.call(this._target()); }; Promise2.prototype.isRejected = function() { return isRejected.call(this._target()); }; Promise2.prototype.isFulfilled = function() { return isFulfilled.call(this._target()); }; Promise2.prototype.isResolved = function() { return isResolved.call(this._target()); }; Promise2.prototype.value = function() { return value.call(this._target()); }; Promise2.prototype.reason = function() { var target = this._target(); target._unsetRejectionIsUnhandled(); return reason.call(target); }; Promise2.prototype._value = function() { return this._settledValue(); }; Promise2.prototype._reason = function() { this._unsetRejectionIsUnhandled(); return this._settledValue(); }; Promise2.PromiseInspection = PromiseInspection; }; }); // node_modules/bluebird/js/release/join.js var require_join = __commonJS((exports2, module2) => { "use strict"; module2.exports = function(Promise2, PromiseArray, tryConvertToPromise, INTERNAL, async, getDomain) { var util = require_util(); var canEvaluate2 = util.canEvaluate; var tryCatch2 = util.tryCatch; var errorObj2 = util.errorObj; var reject; if (true) { if (canEvaluate2) { var thenCallback = function(i2) { return new Function("value", "holder", " \n 'use strict'; \n holder.pIndex = value; \n holder.checkFulfillment(this); \n ".replace(/Index/g, i2)); }; var promiseSetter = function(i2) { return new Function("promise", "holder", " \n 'use strict'; \n holder.pIndex = promise; \n ".replace(/Index/g, i2)); }; var generateHolderClass = function(total) { var props = new Array(total); for (var i2 = 0; i2 < props.length; ++i2) { props[i2] = "this.p" + (i2 + 1); } var assignment = props.join(" = ") + " = null;"; var cancellationCode = "var promise;\n" + props.map(function(prop) { return " \n promise = " + prop + "; \n if (promise instanceof Promise) { \n promise.cancel(); \n } \n "; }).join("\n"); var passedArguments = props.join(", "); var name = "Holder$" + total; var code = "return function(tryCatch, errorObj, Promise, async) { \n 'use strict'; \n function [TheName](fn) { \n [TheProperties] \n this.fn = fn; \n this.asyncNeeded = true; \n this.now = 0; \n } \n \n [TheName].prototype._callFunction = function(promise) { \n promise._pushContext(); \n var ret = tryCatch(this.fn)([ThePassedArguments]); \n promise._popContext(); \n if (ret === errorObj) { \n promise._rejectCallback(ret.e, false); \n } else { \n promise._resolveCallback(ret); \n } \n }; \n \n [TheName].prototype.checkFulfillment = function(promise) { \n var now = ++this.now; \n if (now === [TheTotal]) { \n if (this.asyncNeeded) { \n async.invoke(this._callFunction, this, promise); \n } else { \n this._callFunction(promise); \n } \n \n } \n }; \n \n [TheName].prototype._resultCancelled = function() { \n [CancellationCode] \n }; \n \n return [TheName]; \n }(tryCatch, errorObj, Promise, async); \n "; code = code.replace(/\[TheName\]/g, name).replace(/\[TheTotal\]/g, total).replace(/\[ThePassedArguments\]/g, passedArguments).replace(/\[TheProperties\]/g, assignment).replace(/\[CancellationCode\]/g, cancellationCode); return new Function("tryCatch", "errorObj", "Promise", "async", code)(tryCatch2, errorObj2, Promise2, async); }; var holderClasses = []; var thenCallbacks = []; var promiseSetters = []; for (var i = 0; i < 8; ++i) { holderClasses.push(generateHolderClass(i + 1)); thenCallbacks.push(thenCallback(i + 1)); promiseSetters.push(promiseSetter(i + 1)); } reject = function(reason) { this._reject(reason); }; } } Promise2.join = function() { var last = arguments.length - 1; var fn; if (last > 0 && typeof arguments[last] === "function") { fn = arguments[last]; if (true) { if (last <= 8 && canEvaluate2) { var ret2 = new Promise2(INTERNAL); ret2._captureStackTrace(); var HolderClass = holderClasses[last - 1]; var holder = new HolderClass(fn); var callbacks = thenCallbacks; for (var i2 = 0; i2 < last; ++i2) { var maybePromise = tryConvertToPromise(arguments[i2], ret2); if (maybePromise instanceof Promise2) { maybePromise = maybePromise._target(); var bitField = maybePromise._bitField; ; if ((bitField & 50397184) === 0) { maybePromise._then(callbacks[i2], reject, void 0, ret2, holder); promiseSetters[i2](maybePromise, holder); holder.asyncNeeded = false; } else if ((bitField & 33554432) !== 0) { callbacks[i2].call(ret2, maybePromise._value(), holder); } else if ((bitField & 16777216) !== 0) { ret2._reject(maybePromise._reason()); } else { ret2._cancel(); } } else { callbacks[i2].call(ret2, maybePromise, holder); } } if (!ret2._isFateSealed()) { if (holder.asyncNeeded) { var domain = getDomain(); if (domain !== null) { holder.fn = util.domainBind(domain, holder.fn); } } ret2._setAsyncGuaranteed(); ret2._setOnCancel(holder); } return ret2; } } } var $_len = arguments.length; var args = new Array($_len); for (var $_i = 0; $_i < $_len; ++$_i) { args[$_i] = arguments[$_i]; } ; if (fn) args.pop(); var ret2 = new PromiseArray(args).promise(); return fn !== void 0 ? ret2.spread(fn) : ret2; }; }; }); // node_modules/bluebird/js/release/map.js var require_map = __commonJS((exports2, module2) => { "use strict"; module2.exports = function(Promise2, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug) { var getDomain = Promise2._getDomain; var util = require_util(); var tryCatch2 = util.tryCatch; var errorObj2 = util.errorObj; var async = Promise2._async; function MappingPromiseArray(promises, fn, limit, _filter) { this.constructor$(promises); this._promise._captureStackTrace(); var domain = getDomain(); this._callback = domain === null ? fn : util.domainBind(domain, fn); this._preservedValues = _filter === INTERNAL ? new Array(this.length()) : null; this._limit = limit; this._inFlight = 0; this._queue = []; async.invoke(this._asyncInit, this, void 0); } util.inherits(MappingPromiseArray, PromiseArray); MappingPromiseArray.prototype._asyncInit = function() { this._init$(void 0, -2); }; MappingPromiseArray.prototype._init = function() { }; MappingPromiseArray.prototype._promiseFulfilled = function(value, index) { var values = this._values; var length = this.length(); var preservedValues = this._preservedValues; var limit = this._limit; if (index < 0) { index = index * -1 - 1; values[index] = value; if (limit >= 1) { this._inFlight--; this._drainQueue(); if (this._isResolved()) return true; } } else { if (limit >= 1 && this._inFlight >= limit) { values[index] = value; this._queue.push(index); return false; } if (preservedValues !== null) preservedValues[index] = value; var promise = this._promise; var callback = this._callback; var receiver = promise._boundValue(); promise._pushContext(); var ret2 = tryCatch2(callback).call(receiver, value, index, length); var promiseCreated = promise._popContext(); debug.checkForgottenReturns(ret2, promiseCreated, preservedValues !== null ? "Promise.filter" : "Promise.map", promise); if (ret2 === errorObj2) { this._reject(ret2.e); return true; } var maybePromise = tryConvertToPromise(ret2, this._promise); if (maybePromise instanceof Promise2) { maybePromise = maybePromise._target(); var bitField = maybePromise._bitField; ; if ((bitField & 50397184) === 0) { if (limit >= 1) this._inFlight++; values[index] = maybePromise; maybePromise._proxy(this, (index + 1) * -1); return false; } else if ((bitField & 33554432) !== 0) { ret2 = maybePromise._value(); } else if ((bitField & 16777216) !== 0) { this._reject(maybePromise._reason()); return true; } else { this._cancel(); return true; } } values[index] = ret2; } var totalResolved = ++this._totalResolved; if (totalResolved >= length) { if (preservedValues !== null) { this._filter(values, preservedValues); } else { this._resolve(values); } return true; } return false; }; MappingPromiseArray.prototype._drainQueue = function() { var queue = this._queue; var limit = this._limit; var values = this._values; while (queue.length > 0 && this._inFlight < limit) { if (this._isResolved()) return; var index = queue.pop(); this._promiseFulfilled(values[index], index); } }; MappingPromiseArray.prototype._filter = function(booleans, values) { var len = values.length; var ret2 = new Array(len); var j = 0; for (var i = 0; i < len; ++i) { if (booleans[i]) ret2[j++] = values[i]; } ret2.length = j; this._resolve(ret2); }; MappingPromiseArray.prototype.preservedValues = function() { return this._preservedValues; }; function map(promises, fn, options, _filter) { if (typeof fn !== "function") { return apiRejection("expecting a function but got " + util.classString(fn)); } var limit = 0; if (options !== void 0) { if (typeof options === "object" && options !== null) { if (typeof options.concurrency !== "number") { return Promise2.reject(new TypeError("'concurrency' must be a number but it is " + util.classString(options.concurrency))); } limit = options.concurrency; } else { return Promise2.reject(new TypeError("options argument must be an object but it is " + util.classString(options))); } } limit = typeof limit === "number" && isFinite(limit) && limit >= 1 ? limit : 0; return new MappingPromiseArray(promises, fn, limit, _filter).promise(); } Promise2.prototype.map = function(fn, options) { return map(this, fn, options, null); }; Promise2.map = function(promises, fn, options, _filter) { return map(promises, fn, options, _filter); }; }; }); // node_modules/bluebird/js/release/call_get.js var require_call_get = __commonJS((exports2, module2) => { "use strict"; var cr = Object.create; if (cr) { callerCache = cr(null); getterCache = cr(null); callerCache[" size"] = getterCache[" size"] = 0; } var callerCache; var getterCache; module2.exports = function(Promise2) { var util = require_util(); var canEvaluate2 = util.canEvaluate; var isIdentifier2 = util.isIdentifier; var getMethodCaller; var getGetter; if (true) { var makeMethodCaller = function(methodName) { return new Function("ensureMethod", " \n return function(obj) { \n 'use strict' \n var len = this.length; \n ensureMethod(obj, 'methodName'); \n switch(len) { \n case 1: return obj.methodName(this[0]); \n case 2: return obj.methodName(this[0], this[1]); \n case 3: return obj.methodName(this[0], this[1], this[2]); \n case 0: return obj.methodName(); \n default: \n return obj.methodName.apply(obj, this); \n } \n }; \n ".replace(/methodName/g, methodName))(ensureMethod); }; var makeGetter = function(propertyName) { return new Function("obj", " \n 'use strict'; \n return obj.propertyName; \n ".replace("propertyName", propertyName)); }; var getCompiled = function(name, compiler, cache) { var ret2 = cache[name]; if (typeof ret2 !== "function") { if (!isIdentifier2(name)) { return null; } ret2 = compiler(name); cache[name] = ret2; cache[" size"]++; if (cache[" size"] > 512) { var keys = Object.keys(cache); for (var i = 0; i < 256; ++i) delete cache[keys[i]]; cache[" size"] = keys.length - 256; } } return ret2; }; getMethodCaller = function(name) { return getCompiled(name, makeMethodCaller, callerCache); }; getGetter = function(name) { return getCompiled(name, makeGetter, getterCache); }; } function ensureMethod(obj, methodName) { var fn; if (obj != null) fn = obj[methodName]; if (typeof fn !== "function") { var message = "Object " + util.classString(obj) + " has no method '" + util.toString(methodName) + "'"; throw new Promise2.TypeError(message); } return fn; } function caller(obj) { var methodName = this.pop(); var fn = ensureMethod(obj, methodName); return fn.apply(obj, this); } Promise2.prototype.call = function(methodName) { var $_len = arguments.length; var args = new Array(Math.max($_len - 1, 0)); for (var $_i = 1; $_i < $_len; ++$_i) { args[$_i - 1] = arguments[$_i]; } ; if (true) { if (canEvaluate2) { var maybeCaller = getMethodCaller(methodName); if (maybeCaller !== null) { return this._then(maybeCaller, void 0, void 0, args, void 0); } } } args.push(methodName); return this._then(caller, void 0, void 0, args, void 0); }; function namedGetter(obj) { return obj[this]; } function indexedGetter(obj) { var index = +this; if (index < 0) index = Math.max(0, index + obj.length); return obj[index]; } Promise2.prototype.get = function(propertyName) { var isIndex = typeof propertyName === "number"; var getter; if (!isIndex) { if (canEvaluate2) { var maybeGetter = getGetter(propertyName); getter = maybeGetter !== null ? maybeGetter : namedGetter; } else { getter = namedGetter; } } else { getter = indexedGetter; } return this._then(getter, void 0, void 0, propertyName, void 0); }; }; }); // node_modules/bluebird/js/release/using.js var require_using = __commonJS((exports2, module2) => { "use strict"; module2.exports = function(Promise2, apiRejection, tryConvertToPromise, createContext, INTERNAL, debug) { var util = require_util(); var TypeError2 = require_errors().TypeError; var inherits2 = require_util().inherits; var errorObj2 = util.errorObj; var tryCatch2 = util.tryCatch; var NULL = {}; function thrower2(e) { setTimeout(function() { throw e; }, 0); } function castPreservingDisposable(thenable) { var maybePromise = tryConvertToPromise(thenable); if (maybePromise !== thenable && typeof thenable._isDisposable === "function" && typeof thenable._getDisposer === "function" && thenable._isDisposable()) { maybePromise._setDisposable(thenable._getDisposer()); } return maybePromise; } function dispose(resources, inspection) { var i = 0; var len = resources.length; var ret2 = new Promise2(INTERNAL); function iterator() { if (i >= len) return ret2._fulfill(); var maybePromise = castPreservingDisposable(resources[i++]); if (maybePromise instanceof Promise2 && maybePromise._isDisposable()) { try { maybePromise = tryConvertToPromise(maybePromise._getDisposer().tryDispose(inspection), resources.promise); } catch (e) { return thrower2(e); } if (maybePromise instanceof Promise2) { return maybePromise._then(iterator, thrower2, null, null, null); } } iterator(); } iterator(); return ret2; } function Disposer(data, promise, context) { this._data = data; this._promise = promise; this._context = context; } Disposer.prototype.data = function() { return this._data; }; Disposer.prototype.promise = function() { return this._promise; }; Disposer.prototype.resource = function() { if (this.promise().isFulfilled()) { return this.promise().value(); } return NULL; }; Disposer.prototype.tryDispose = function(inspection) { var resource = this.resource(); var context = this._context; if (context !== void 0) context._pushContext(); var ret2 = resource !== NULL ? this.doDispose(resource, inspection) : null; if (context !== void 0) context._popContext(); this._promise._unsetDisposable(); this._data = null; return ret2; }; Disposer.isDisposer = function(d) { return d != null && typeof d.resource === "function" && typeof d.tryDispose === "function"; }; function FunctionDisposer(fn, promise, context) { this.constructor$(fn, promise, context); } inherits2(FunctionDisposer, Disposer); FunctionDisposer.prototype.doDispose = function(resource, inspection) { var fn = this.data(); return fn.call(resource, resource, inspection); }; function maybeUnwrapDisposer(value) { if (Disposer.isDisposer(value)) { this.resources[this.index]._setDisposable(value); return value.promise(); } return value; } function ResourceList(length) { this.length = length; this.promise = null; this[length - 1] = null; } ResourceList.prototype._resultCancelled = function() { var len = this.length; for (var i = 0; i < len; ++i) { var item = this[i]; if (item instanceof Promise2) { item.cancel(); } } }; Promise2.using = function() { var len = arguments.length; if (len < 2) return apiRejection("you must pass at least 2 arguments to Promise.using"); var fn = arguments[len - 1]; if (typeof fn !== "function") { return apiRejection("expecting a function but got " + util.classString(fn)); } var input; var spreadArgs = true; if (len === 2 && Array.isArray(arguments[0])) { input = arguments[0]; len = input.length; spreadArgs = false; } else { input = arguments; len--; } var resources = new ResourceList(len); for (var i = 0; i < len; ++i) { var resource = input[i]; if (Disposer.isDisposer(resource)) { var disposer = resource; resource = resource.promise(); resource._setDisposable(disposer); } else { var maybePromise = tryConvertToPromise(resource); if (maybePromise instanceof Promise2) { resource = maybePromise._then(maybeUnwrapDisposer, null, null, { resources, index: i }, void 0); } } resources[i] = resource; } var reflectedResources = new Array(resources.length); for (var i = 0; i < reflectedResources.length; ++i) { reflectedResources[i] = Promise2.resolve(resources[i]).reflect(); } var resultPromise = Promise2.all(reflectedResources).then(function(inspections) { for (var i2 = 0; i2 < inspections.length; ++i2) { var inspection = inspections[i2]; if (inspection.isRejected()) { errorObj2.e = inspection.error(); return errorObj2; } else if (!inspection.isFulfilled()) { resultPromise.cancel(); return; } inspections[i2] = inspection.value(); } promise._pushContext(); fn = tryCatch2(fn); var ret2 = spreadArgs ? fn.apply(void 0, inspections) : fn(inspections); var promiseCreated = promise._popContext(); debug.checkForgottenReturns(ret2, promiseCreated, "Promise.using", promise); return ret2; }); var promise = resultPromise.lastly(function() { var inspection = new Promise2.PromiseInspection(resultPromise); return dispose(resources, inspection); }); resources.promise = promise; promise._setOnCancel(resources); return promise; }; Promise2.prototype._setDisposable = function(disposer) { this._bitField = this._bitField | 131072; this._disposer = disposer; }; Promise2.prototype._isDisposable = function() { return (this._bitField & 131072) > 0; }; Promise2.prototype._getDisposer = function() { return this._disposer; }; Promise2.prototype._unsetDisposable = function() { this._bitField = this._bitField & ~131072; this._disposer = void 0; }; Promise2.prototype.disposer = function(fn) { if (typeof fn === "function") { return new FunctionDisposer(fn, this, createContext()); } throw new TypeError2(); }; }; }); // node_modules/bluebird/js/release/timers.js var require_timers = __commonJS((exports2, module2) => { "use strict"; module2.exports = function(Promise2, INTERNAL, debug) { var util = require_util(); var TimeoutError = Promise2.TimeoutError; function HandleWrapper(handle) { this.handle = handle; } HandleWrapper.prototype._resultCancelled = function() { clearTimeout(this.handle); }; var afterValue = function(value) { return delay(+this).thenReturn(value); }; var delay = Promise2.delay = function(ms, value) { var ret2; var handle; if (value !== void 0) { ret2 = Promise2.resolve(value)._then(afterValue, null, null, ms, void 0); if (debug.cancellation() && value instanceof Promise2) { ret2._setOnCancel(value); } } else { ret2 = new Promise2(INTERNAL); handle = setTimeout(function() { ret2._fulfill(); }, +ms); if (debug.cancellation()) { ret2._setOnCancel(new HandleWrapper(handle)); } ret2._captureStackTrace(); } ret2._setAsyncGuaranteed(); return ret2; }; Promise2.prototype.delay = function(ms) { return delay(ms, this); }; var afterTimeout = function(promise, message, parent) { var err; if (typeof message !== "string") { if (message instanceof Error) { err = message; } else { err = new TimeoutError("operation timed out"); } } else { err = new TimeoutError(message); } util.markAsOriginatingFromRejection(err); promise._attachExtraTrace(err); promise._reject(err); if (parent != null) { parent.cancel(); } }; function successClear(value) { clearTimeout(this.handle); return value; } function failureClear(reason) { clearTimeout(this.handle); throw reason; } Promise2.prototype.timeout = function(ms, message) { ms = +ms; var ret2, parent; var handleWrapper = new HandleWrapper(setTimeout(function timeoutTimeout() { if (ret2.isPending()) { afterTimeout(ret2, message, parent); } }, ms)); if (debug.cancellation()) { parent = this.then(); ret2 = parent._then(successClear, failureClear, void 0, handleWrapper, void 0); ret2._setOnCancel(handleWrapper); } else { ret2 = this._then(successClear, failureClear, void 0, handleWrapper, void 0); } return ret2; }; }; }); // node_modules/bluebird/js/release/generators.js var require_generators = __commonJS((exports2, module2) => { "use strict"; module2.exports = function(Promise2, apiRejection, INTERNAL, tryConvertToPromise, Proxyable, debug) { var errors = require_errors(); var TypeError2 = errors.TypeError; var util = require_util(); var errorObj2 = util.errorObj; var tryCatch2 = util.tryCatch; var yieldHandlers = []; function promiseFromYieldHandler(value, yieldHandlers2, traceParent) { for (var i = 0; i < yieldHandlers2.length; ++i) { traceParent._pushContext(); var result = tryCatch2(yieldHandlers2[i])(value); traceParent._popContext(); if (result === errorObj2) { traceParent._pushContext(); var ret2 = Promise2.reject(errorObj2.e); traceParent._popContext(); return ret2; } var maybePromise = tryConvertToPromise(result, traceParent); if (maybePromise instanceof Promise2) return maybePromise; } return null; } function PromiseSpawn(generatorFunction, receiver, yieldHandler, stack) { if (debug.cancellation()) { var internal = new Promise2(INTERNAL); var _finallyPromise = this._finallyPromise = new Promise2(INTERNAL); this._promise = internal.lastly(function() { return _finallyPromise; }); internal._captureStackTrace(); internal._setOnCancel(this); } else { var promise = this._promise = new Promise2(INTERNAL); promise._captureStackTrace(); } this._stack = stack; this._generatorFunction = generatorFunction; this._receiver = receiver; this._generator = void 0; this._yieldHandlers = typeof yieldHandler === "function" ? [yieldHandler].concat(yieldHandlers) : yieldHandlers; this._yieldedPromise = null; this._cancellationPhase = false; } util.inherits(PromiseSpawn, Proxyable); PromiseSpawn.prototype._isResolved = function() { return this._promise === null; }; PromiseSpawn.prototype._cleanup = function() { this._promise = this._generator = null; if (debug.cancellation() && this._finallyPromise !== null) { this._finallyPromise._fulfill(); this._finallyPromise = null; } }; PromiseSpawn.prototype._promiseCancelled = function() { if (this._isResolved()) return; var implementsReturn = typeof this._generator["return"] !== "undefined"; var result; if (!implementsReturn) { var reason = new Promise2.CancellationError("generator .return() sentinel"); Promise2.coroutine.returnSentinel = reason; this._promise._attachExtraTrace(reason); this._promise._pushContext(); result = tryCatch2(this._generator["throw"]).call(this._generator, reason); this._promise._popContext(); } else { this._promise._pushContext(); result = tryCatch2(this._generator["return"]).call(this._generator, void 0); this._promise._popContext(); } this._cancellationPhase = true; this._yieldedPromise = null; this._continue(result); }; PromiseSpawn.prototype._promiseFulfilled = function(value) { this._yieldedPromise = null; this._promise._pushContext(); var result = tryCatch2(this._generator.next).call(this._generator, value); this._promise._popContext(); this._continue(result); }; PromiseSpawn.prototype._promiseRejected = function(reason) { this._yieldedPromise = null; this._promise._attachExtraTrace(reason); this._promise._pushContext(); var result = tryCatch2(this._generator["throw"]).call(this._generator, reason); this._promise._popContext(); this._continue(result); }; PromiseSpawn.prototype._resultCancelled = function() { if (this._yieldedPromise instanceof Promise2) { var promise = this._yieldedPromise; this._yieldedPromise = null; promise.cancel(); } }; PromiseSpawn.prototype.promise = function() { return this._promise; }; PromiseSpawn.prototype._run = function() { this._generator = this._generatorFunction.call(this._receiver); this._receiver = this._generatorFunction = void 0; this._promiseFulfilled(void 0); }; PromiseSpawn.prototype._continue = function(result) { var promise = this._promise; if (result === errorObj2) { this._cleanup(); if (this._cancellationPhase) { return promise.cancel(); } else { return promise._rejectCallback(result.e, false); } } var value = result.value; if (result.done === true) { this._cleanup(); if (this._cancellationPhase) { return promise.cancel(); } else { return promise._resolveCallback(value); } } else { var maybePromise = tryConvertToPromise(value, this._promise); if (!(maybePromise instanceof Promise2)) { maybePromise = promiseFromYieldHandler(maybePromise, this._yieldHandlers, this._promise); if (maybePromise === null) { this._promiseRejected(new TypeError2("A value %s was yielded that could not be treated as a promise\n\n See http://goo.gl/MqrFmX\n\n".replace("%s", value) + "From coroutine:\n" + this._stack.split("\n").slice(1, -7).join("\n"))); return; } } maybePromise = maybePromise._target(); var bitField = maybePromise._bitField; ; if ((bitField & 50397184) === 0) { this._yieldedPromise = maybePromise; maybePromise._proxy(this, null); } else if ((bitField & 33554432) !== 0) { Promise2._async.invoke(this._promiseFulfilled, this, maybePromise._value()); } else if ((bitField & 16777216) !== 0) { Promise2._async.invoke(this._promiseRejected, this, maybePromise._reason()); } else { this._promiseCancelled(); } } }; Promise2.coroutine = function(generatorFunction, options) { if (typeof generatorFunction !== "function") { throw new TypeError2("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n"); } var yieldHandler = Object(options).yieldHandler; var PromiseSpawn$ = PromiseSpawn; var stack = new Error().stack; return function() { var generator = generatorFunction.apply(this, arguments); var spawn = new PromiseSpawn$(void 0, void 0, yieldHandler, stack); var ret2 = spawn.promise(); spawn._generator = generator; spawn._promiseFulfilled(void 0); return ret2; }; }; Promise2.coroutine.addYieldHandler = function(fn) { if (typeof fn !== "function") { throw new TypeError2("expecting a function but got " + util.classString(fn)); } yieldHandlers.push(fn); }; Promise2.spawn = function(generatorFunction) { debug.deprecated("Promise.spawn()", "Promise.coroutine()"); if (typeof generatorFunction !== "function") { return apiRejection("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n"); } var spawn = new PromiseSpawn(generatorFunction, this); var ret2 = spawn.promise(); spawn._run(Promise2.spawn); return ret2; }; }; }); // node_modules/bluebird/js/release/nodeify.js var require_nodeify = __commonJS((exports2, module2) => { "use strict"; module2.exports = function(Promise2) { var util = require_util(); var async = Promise2._async; var tryCatch2 = util.tryCatch; var errorObj2 = util.errorObj; function spreadAdapter(val, nodeback) { var promise = this; if (!util.isArray(val)) return successAdapter.call(promise, val, nodeback); var ret2 = tryCatch2(nodeback).apply(promise._boundValue(), [null].concat(val)); if (ret2 === errorObj2) { async.throwLater(ret2.e); } } function successAdapter(val, nodeback) { var promise = this; var receiver = promise._boundValue(); var ret2 = val === void 0 ? tryCatch2(nodeback).call(receiver, null) : tryCatch2(nodeback).call(receiver, null, val); if (ret2 === errorObj2) { async.throwLater(ret2.e); } } function errorAdapter(reason, nodeback) { var promise = this; if (!reason) { var newReason = new Error(reason + ""); newReason.cause = reason; reason = newReason; } var ret2 = tryCatch2(nodeback).call(promise._boundValue(), reason); if (ret2 === errorObj2) { async.throwLater(ret2.e); } } Promise2.prototype.asCallback = Promise2.prototype.nodeify = function(nodeback, options) { if (typeof nodeback == "function") { var adapter = successAdapter; if (options !== void 0 && Object(options).spread) { adapter = spreadAdapter; } this._then(adapter, errorAdapter, void 0, this, nodeback); } return this; }; }; }); // node_modules/bluebird/js/release/promisify.js var require_promisify = __commonJS((exports2, module2) => { "use strict"; module2.exports = function(Promise2, INTERNAL) { var THIS = {}; var util = require_util(); var nodebackForPromise = require_nodeback(); var withAppended2 = util.withAppended; var maybeWrapAsError2 = util.maybeWrapAsError; var canEvaluate2 = util.canEvaluate; var TypeError2 = require_errors().TypeError; var defaultSuffix = "Async"; var defaultPromisified = {__isPromisified__: true}; var noCopyProps = [ "arity", "length", "name", "arguments", "caller", "callee", "prototype", "__isPromisified__" ]; var noCopyPropsPattern = new RegExp("^(?:" + noCopyProps.join("|") + ")$"); var defaultFilter = function(name) { return util.isIdentifier(name) && name.charAt(0) !== "_" && name !== "constructor"; }; function propsFilter(key) { return !noCopyPropsPattern.test(key); } function isPromisified(fn) { try { return fn.__isPromisified__ === true; } catch (e) { return false; } } function hasPromisified(obj, key, suffix) { var val = util.getDataPropertyOrDefault(obj, key + suffix, defaultPromisified); return val ? isPromisified(val) : false; } function checkValid(ret2, suffix, suffixRegexp) { for (var i = 0; i < ret2.length; i += 2) { var key = ret2[i]; if (suffixRegexp.test(key)) { var keyWithoutAsyncSuffix = key.replace(suffixRegexp, ""); for (var j = 0; j < ret2.length; j += 2) { if (ret2[j] === keyWithoutAsyncSuffix) { throw new TypeError2("Cannot promisify an API that has normal methods with '%s'-suffix\n\n See http://goo.gl/MqrFmX\n".replace("%s", suffix)); } } } } } function promisifiableMethods(obj, suffix, suffixRegexp, filter) { var keys = util.inheritedDataKeys(obj); var ret2 = []; for (var i = 0; i < keys.length; ++i) { var key = keys[i]; var value = obj[key]; var passesDefaultFilter = filter === defaultFilter ? true : defaultFilter(key, value, obj); if (typeof value === "function" && !isPromisified(value) && !hasPromisified(obj, key, suffix) && filter(key, value, obj, passesDefaultFilter)) { ret2.push(key, value); } } checkValid(ret2, suffix, suffixRegexp); return ret2; } var escapeIdentRegex = function(str) { return str.replace(/([$])/, "\\$"); }; var makeNodePromisifiedEval; if (true) { var switchCaseArgumentOrder = function(likelyArgumentCount) { var ret2 = [likelyArgumentCount]; var min = Math.max(0, likelyArgumentCount - 1 - 3); for (var i = likelyArgumentCount - 1; i >= min; --i) { ret2.push(i); } for (var i = likelyArgumentCount + 1; i <= 3; ++i) { ret2.push(i); } return ret2; }; var argumentSequence = function(argumentCount) { return util.filledRange(argumentCount, "_arg", ""); }; var parameterDeclaration = function(parameterCount2) { return util.filledRange(Math.max(parameterCount2, 3), "_arg", ""); }; var parameterCount = function(fn) { if (typeof fn.length === "number") { return Math.max(Math.min(fn.length, 1023 + 1), 0); } return 0; }; makeNodePromisifiedEval = function(callback, receiver, originalName, fn, _, multiArgs) { var newParameterCount = Math.max(0, parameterCount(fn) - 1); var argumentOrder = switchCaseArgumentOrder(newParameterCount); var shouldProxyThis = typeof callback === "string" || receiver === THIS; function generateCallForArgumentCount(count) { var args = argumentSequence(count).join(", "); var comma = count > 0 ? ", " : ""; var ret2; if (shouldProxyThis) { ret2 = "ret = callback.call(this, {{args}}, nodeback); break;\n"; } else { ret2 = receiver === void 0 ? "ret = callback({{args}}, nodeback); break;\n" : "ret = callback.call(receiver, {{args}}, nodeback); break;\n"; } return ret2.replace("{{args}}", args).replace(", ", comma); } function generateArgumentSwitchCase() { var ret2 = ""; for (var i = 0; i < argumentOrder.length; ++i) { ret2 += "case " + argumentOrder[i] + ":" + generateCallForArgumentCount(argumentOrder[i]); } ret2 += " \n default: \n var args = new Array(len + 1); \n var i = 0; \n for (var i = 0; i < len; ++i) { \n args[i] = arguments[i]; \n } \n args[i] = nodeback; \n [CodeForCall] \n break; \n ".replace("[CodeForCall]", shouldProxyThis ? "ret = callback.apply(this, args);\n" : "ret = callback.apply(receiver, args);\n"); return ret2; } var getFunctionCode = typeof callback === "string" ? "this != null ? this['" + callback + "'] : fn" : "fn"; var body = "'use strict'; \n var ret = function (Parameters) { \n 'use strict'; \n var len = arguments.length; \n var promise = new Promise(INTERNAL); \n promise._captureStackTrace(); \n var nodeback = nodebackForPromise(promise, " + multiArgs + "); \n var ret; \n var callback = tryCatch([GetFunctionCode]); \n switch(len) { \n [CodeForSwitchCase] \n } \n if (ret === errorObj) { \n promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\n } \n if (!promise._isFateSealed()) promise._setAsyncGuaranteed(); \n return promise; \n }; \n notEnumerableProp(ret, '__isPromisified__', true); \n return ret; \n ".replace("[CodeForSwitchCase]", generateArgumentSwitchCase()).replace("[GetFunctionCode]", getFunctionCode); body = body.replace("Parameters", parameterDeclaration(newParameterCount)); return new Function("Promise", "fn", "receiver", "withAppended", "maybeWrapAsError", "nodebackForPromise", "tryCatch", "errorObj", "notEnumerableProp", "INTERNAL", body)(Promise2, fn, receiver, withAppended2, maybeWrapAsError2, nodebackForPromise, util.tryCatch, util.errorObj, util.notEnumerableProp, INTERNAL); }; } function makeNodePromisifiedClosure(callback, receiver, _, fn, __, multiArgs) { var defaultThis = function() { return this; }(); var method = callback; if (typeof method === "string") { callback = fn; } function promisified() { var _receiver = receiver; if (receiver === THIS) _receiver = this; var promise = new Promise2(INTERNAL); promise._captureStackTrace(); var cb = typeof method === "string" && this !== defaultThis ? this[method] : callback; var fn2 = nodebackForPromise(promise, multiArgs); try { cb.apply(_receiver, withAppended2(arguments, fn2)); } catch (e) { promise._rejectCallback(maybeWrapAsError2(e), true, true); } if (!promise._isFateSealed()) promise._setAsyncGuaranteed(); return promise; } util.notEnumerableProp(promisified, "__isPromisified__", true); return promisified; } var makeNodePromisified = canEvaluate2 ? makeNodePromisifiedEval : makeNodePromisifiedClosure; function promisifyAll(obj, suffix, filter, promisifier, multiArgs) { var suffixRegexp = new RegExp(escapeIdentRegex(suffix) + "$"); var methods = promisifiableMethods(obj, suffix, suffixRegexp, filter); for (var i = 0, len = methods.length; i < len; i += 2) { var key = methods[i]; var fn = methods[i + 1]; var promisifiedKey = key + suffix; if (promisifier === makeNodePromisified) { obj[promisifiedKey] = makeNodePromisified(key, THIS, key, fn, suffix, multiArgs); } else { var promisified = promisifier(fn, function() { return makeNodePromisified(key, THIS, key, fn, suffix, multiArgs); }); util.notEnumerableProp(promisified, "__isPromisified__", true); obj[promisifiedKey] = promisified; } } util.toFastProperties(obj); return obj; } function promisify(callback, receiver, multiArgs) { return makeNodePromisified(callback, receiver, void 0, callback, null, multiArgs); } Promise2.promisify = function(fn, options) { if (typeof fn !== "function") { throw new TypeError2("expecting a function but got " + util.classString(fn)); } if (isPromisified(fn)) { return fn; } options = Object(options); var receiver = options.context === void 0 ? THIS : options.context; var multiArgs = !!options.multiArgs; var ret2 = promisify(fn, receiver, multiArgs); util.copyDescriptors(fn, ret2, propsFilter); return ret2; }; Promise2.promisifyAll = function(target, options) { if (typeof target !== "function" && typeof target !== "object") { throw new TypeError2("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/MqrFmX\n"); } options = Object(options); var multiArgs = !!options.multiArgs; var suffix = options.suffix; if (typeof suffix !== "string") suffix = defaultSuffix; var filter = options.filter; if (typeof filter !== "function") filter = defaultFilter; var promisifier = options.promisifier; if (typeof promisifier !== "function") promisifier = makeNodePromisified; if (!util.isIdentifier(suffix)) { throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/MqrFmX\n"); } var keys = util.inheritedDataKeys(target); for (var i = 0; i < keys.length; ++i) { var value = target[keys[i]]; if (keys[i] !== "constructor" && util.isClass(value)) { promisifyAll(value.prototype, suffix, filter, promisifier, multiArgs); promisifyAll(value, suffix, filter, promisifier, multiArgs); } } return promisifyAll(target, suffix, filter, promisifier, multiArgs); }; }; }); // node_modules/bluebird/js/release/props.js var require_props = __commonJS((exports2, module2) => { "use strict"; module2.exports = function(Promise2, PromiseArray, tryConvertToPromise, apiRejection) { var util = require_util(); var isObject3 = util.isObject; var es52 = require_es5(); var Es6Map; if (typeof Map === "function") Es6Map = Map; var mapToEntries = function() { var index = 0; var size = 0; function extractEntry(value, key) { this[index] = value; this[index + size] = key; index++; } return function mapToEntries2(map) { size = map.size; index = 0; var ret2 = new Array(map.size * 2); map.forEach(extractEntry, ret2); return ret2; }; }(); var entriesToMap = function(entries) { var ret2 = new Es6Map(); var length = entries.length / 2 | 0; for (var i = 0; i < length; ++i) { var key = entries[length + i]; var value = entries[i]; ret2.set(key, value); } return ret2; }; function PropertiesPromiseArray(obj) { var isMap = false; var entries; if (Es6Map !== void 0 && obj instanceof Es6Map) { entries = mapToEntries(obj); isMap = true; } else { var keys = es52.keys(obj); var len = keys.length; entries = new Array(len * 2); for (var i = 0; i < len; ++i) { var key = keys[i]; entries[i] = obj[key]; entries[i + len] = key; } } this.constructor$(entries); this._isMap = isMap; this._init$(void 0, -3); } util.inherits(PropertiesPromiseArray, PromiseArray); PropertiesPromiseArray.prototype._init = function() { }; PropertiesPromiseArray.prototype._promiseFulfilled = function(value, index) { this._values[index] = value; var totalResolved = ++this._totalResolved; if (totalResolved >= this._length) { var val; if (this._isMap) { val = entriesToMap(this._values); } else { val = {}; var keyOffset = this.length(); for (var i = 0, len = this.length(); i < len; ++i) { val[this._values[i + keyOffset]] = this._values[i]; } } this._resolve(val); return true; } return false; }; PropertiesPromiseArray.prototype.shouldCopyValues = function() { return false; }; PropertiesPromiseArray.prototype.getActualLength = function(len) { return len >> 1; }; function props(promises) { var ret2; var castValue = tryConvertToPromise(promises); if (!isObject3(castValue)) { return apiRejection("cannot await properties of a non-object\n\n See http://goo.gl/MqrFmX\n"); } else if (castValue instanceof Promise2) { ret2 = castValue._then(Promise2.props, void 0, void 0, void 0, void 0); } else { ret2 = new PropertiesPromiseArray(castValue).promise(); } if (castValue instanceof Promise2) { ret2._propagateFrom(castValue, 2); } return ret2; } Promise2.prototype.props = function() { return props(this); }; Promise2.props = function(promises) { return props(promises); }; }; }); // node_modules/bluebird/js/release/race.js var require_race = __commonJS((exports2, module2) => { "use strict"; module2.exports = function(Promise2, INTERNAL, tryConvertToPromise, apiRejection) { var util = require_util(); var raceLater = function(promise) { return promise.then(function(array) { return race(array, promise); }); }; function race(promises, parent) { var maybePromise = tryConvertToPromise(promises); if (maybePromise instanceof Promise2) { return raceLater(maybePromise); } else { promises = util.asArray(promises); if (promises === null) return apiRejection("expecting an array or an iterable object but got " + util.classString(promises)); } var ret2 = new Promise2(INTERNAL); if (parent !== void 0) { ret2._propagateFrom(parent, 3); } var fulfill = ret2._fulfill; var reject = ret2._reject; for (var i = 0, len = promises.length; i < len; ++i) { var val = promises[i]; if (val === void 0 && !(i in promises)) { continue; } Promise2.cast(val)._then(fulfill, reject, void 0, ret2, null); } return ret2; } Promise2.race = function(promises) { return race(promises, void 0); }; Promise2.prototype.race = function() { return race(this, void 0); }; }; }); // node_modules/bluebird/js/release/reduce.js var require_reduce = __commonJS((exports2, module2) => { "use strict"; module2.exports = function(Promise2, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug) { var getDomain = Promise2._getDomain; var util = require_util(); var tryCatch2 = util.tryCatch; function ReductionPromiseArray(promises, fn, initialValue, _each) { this.constructor$(promises); var domain = getDomain(); this._fn = domain === null ? fn : util.domainBind(domain, fn); if (initialValue !== void 0) { initialValue = Promise2.resolve(initialValue); initialValue._attachCancellationCallback(this); } this._initialValue = initialValue; this._currentCancellable = null; if (_each === INTERNAL) { this._eachValues = Array(this._length); } else if (_each === 0) { this._eachValues = null; } else { this._eachValues = void 0; } this._promise._captureStackTrace(); this._init$(void 0, -5); } util.inherits(ReductionPromiseArray, PromiseArray); ReductionPromiseArray.prototype._gotAccum = function(accum) { if (this._eachValues !== void 0 && this._eachValues !== null && accum !== INTERNAL) { this._eachValues.push(accum); } }; ReductionPromiseArray.prototype._eachComplete = function(value) { if (this._eachValues !== null) { this._eachValues.push(value); } return this._eachValues; }; ReductionPromiseArray.prototype._init = function() { }; ReductionPromiseArray.prototype._resolveEmptyArray = function() { this._resolve(this._eachValues !== void 0 ? this._eachValues : this._initialValue); }; ReductionPromiseArray.prototype.shouldCopyValues = function() { return false; }; ReductionPromiseArray.prototype._resolve = function(value) { this._promise._resolveCallback(value); this._values = null; }; ReductionPromiseArray.prototype._resultCancelled = function(sender) { if (sender === this._initialValue) return this._cancel(); if (this._isResolved()) return; this._resultCancelled$(); if (this._currentCancellable instanceof Promise2) { this._currentCancellable.cancel(); } if (this._initialValue instanceof Promise2) { this._initialValue.cancel(); } }; ReductionPromiseArray.prototype._iterate = function(values) { this._values = values; var value; var i; var length = values.length; if (this._initialValue !== void 0) { value = this._initialValue; i = 0; } else { value = Promise2.resolve(values[0]); i = 1; } this._currentCancellable = value; if (!value.isRejected()) { for (; i < length; ++i) { var ctx = { accum: null, value: values[i], index: i, length, array: this }; value = value._then(gotAccum, void 0, void 0, ctx, void 0); } } if (this._eachValues !== void 0) { value = value._then(this._eachComplete, void 0, void 0, this, void 0); } value._then(completed, completed, void 0, value, this); }; Promise2.prototype.reduce = function(fn, initialValue) { return reduce(this, fn, initialValue, null); }; Promise2.reduce = function(promises, fn, initialValue, _each) { return reduce(promises, fn, initialValue, _each); }; function completed(valueOrReason, array) { if (this.isFulfilled()) { array._resolve(valueOrReason); } else { array._reject(valueOrReason); } } function reduce(promises, fn, initialValue, _each) { if (typeof fn !== "function") { return apiRejection("expecting a function but got " + util.classString(fn)); } var array = new ReductionPromiseArray(promises, fn, initialValue, _each); return array.promise(); } function gotAccum(accum) { this.accum = accum; this.array._gotAccum(accum); var value = tryConvertToPromise(this.value, this.array._promise); if (value instanceof Promise2) { this.array._currentCancellable = value; return value._then(gotValue, void 0, void 0, this, void 0); } else { return gotValue.call(this, value); } } function gotValue(value) { var array = this.array; var promise = array._promise; var fn = tryCatch2(array._fn); promise._pushContext(); var ret2; if (array._eachValues !== void 0) { ret2 = fn.call(promise._boundValue(), value, this.index, this.length); } else { ret2 = fn.call(promise._boundValue(), this.accum, value, this.index, this.length); } if (ret2 instanceof Promise2) { array._currentCancellable = ret2; } var promiseCreated = promise._popContext(); debug.checkForgottenReturns(ret2, promiseCreated, array._eachValues !== void 0 ? "Promise.each" : "Promise.reduce", promise); return ret2; } }; }); // node_modules/bluebird/js/release/settle.js var require_settle = __commonJS((exports2, module2) => { "use strict"; module2.exports = function(Promise2, PromiseArray, debug) { var PromiseInspection = Promise2.PromiseInspection; var util = require_util(); function SettledPromiseArray(values) { this.constructor$(values); } util.inherits(SettledPromiseArray, PromiseArray); SettledPromiseArray.prototype._promiseResolved = function(index, inspection) { this._values[index] = inspection; var totalResolved = ++this._totalResolved; if (totalResolved >= this._length) { this._resolve(this._values); return true; } return false; }; SettledPromiseArray.prototype._promiseFulfilled = function(value, index) { var ret2 = new PromiseInspection(); ret2._bitField = 33554432; ret2._settledValueField = value; return this._promiseResolved(index, ret2); }; SettledPromiseArray.prototype._promiseRejected = function(reason, index) { var ret2 = new PromiseInspection(); ret2._bitField = 16777216; ret2._settledValueField = reason; return this._promiseResolved(index, ret2); }; Promise2.settle = function(promises) { debug.deprecated(".settle()", ".reflect()"); return new SettledPromiseArray(promises).promise(); }; Promise2.prototype.settle = function() { return Promise2.settle(this); }; }; }); // node_modules/bluebird/js/release/some.js var require_some = __commonJS((exports2, module2) => { "use strict"; module2.exports = function(Promise2, PromiseArray, apiRejection) { var util = require_util(); var RangeError2 = require_errors().RangeError; var AggregateError = require_errors().AggregateError; var isArray = util.isArray; var CANCELLATION = {}; function SomePromiseArray(values) { this.constructor$(values); this._howMany = 0; this._unwrap = false; this._initialized = false; } util.inherits(SomePromiseArray, PromiseArray); SomePromiseArray.prototype._init = function() { if (!this._initialized) { return; } if (this._howMany === 0) { this._resolve([]); return; } this._init$(void 0, -5); var isArrayResolved = isArray(this._values); if (!this._isResolved() && isArrayResolved && this._howMany > this._canPossiblyFulfill()) { this._reject(this._getRangeError(this.length())); } }; SomePromiseArray.prototype.init = function() { this._initialized = true; this._init(); }; SomePromiseArray.prototype.setUnwrap = function() { this._unwrap = true; }; SomePromiseArray.prototype.howMany = function() { return this._howMany; }; SomePromiseArray.prototype.setHowMany = function(count) { this._howMany = count; }; SomePromiseArray.prototype._promiseFulfilled = function(value) { this._addFulfilled(value); if (this._fulfilled() === this.howMany()) { this._values.length = this.howMany(); if (this.howMany() === 1 && this._unwrap) { this._resolve(this._values[0]); } else { this._resolve(this._values); } return true; } return false; }; SomePromiseArray.prototype._promiseRejected = function(reason) { this._addRejected(reason); return this._checkOutcome(); }; SomePromiseArray.prototype._promiseCancelled = function() { if (this._values instanceof Promise2 || this._values == null) { return this._cancel(); } this._addRejected(CANCELLATION); return this._checkOutcome(); }; SomePromiseArray.prototype._checkOutcome = function() { if (this.howMany() > this._canPossiblyFulfill()) { var e = new AggregateError(); for (var i = this.length(); i < this._values.length; ++i) { if (this._values[i] !== CANCELLATION) { e.push(this._values[i]); } } if (e.length > 0) { this._reject(e); } else { this._cancel(); } return true; } return false; }; SomePromiseArray.prototype._fulfilled = function() { return this._totalResolved; }; SomePromiseArray.prototype._rejected = function() { return this._values.length - this.length(); }; SomePromiseArray.prototype._addRejected = function(reason) { this._values.push(reason); }; SomePromiseArray.prototype._addFulfilled = function(value) { this._values[this._totalResolved++] = value; }; SomePromiseArray.prototype._canPossiblyFulfill = function() { return this.length() - this._rejected(); }; SomePromiseArray.prototype._getRangeError = function(count) { var message = "Input array must contain at least " + this._howMany + " items but contains only " + count + " items"; return new RangeError2(message); }; SomePromiseArray.prototype._resolveEmptyArray = function() { this._reject(this._getRangeError(0)); }; function some(promises, howMany) { if ((howMany | 0) !== howMany || howMany < 0) { return apiRejection("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n"); } var ret2 = new SomePromiseArray(promises); var promise = ret2.promise(); ret2.setHowMany(howMany); ret2.init(); return promise; } Promise2.some = function(promises, howMany) { return some(promises, howMany); }; Promise2.prototype.some = function(howMany) { return some(this, howMany); }; Promise2._SomePromiseArray = SomePromiseArray; }; }); // node_modules/bluebird/js/release/filter.js var require_filter = __commonJS((exports2, module2) => { "use strict"; module2.exports = function(Promise2, INTERNAL) { var PromiseMap = Promise2.map; Promise2.prototype.filter = function(fn, options) { return PromiseMap(this, fn, options, INTERNAL); }; Promise2.filter = function(promises, fn, options) { return PromiseMap(promises, fn, options, INTERNAL); }; }; }); // node_modules/bluebird/js/release/each.js var require_each = __commonJS((exports2, module2) => { "use strict"; module2.exports = function(Promise2, INTERNAL) { var PromiseReduce = Promise2.reduce; var PromiseAll = Promise2.all; function promiseAllThis() { return PromiseAll(this); } function PromiseMapSeries(promises, fn) { return PromiseReduce(promises, fn, INTERNAL, INTERNAL); } Promise2.prototype.each = function(fn) { return PromiseReduce(this, fn, INTERNAL, 0)._then(promiseAllThis, void 0, void 0, this, void 0); }; Promise2.prototype.mapSeries = function(fn) { return PromiseReduce(this, fn, INTERNAL, INTERNAL); }; Promise2.each = function(promises, fn) { return PromiseReduce(promises, fn, INTERNAL, 0)._then(promiseAllThis, void 0, void 0, promises, void 0); }; Promise2.mapSeries = PromiseMapSeries; }; }); // node_modules/bluebird/js/release/any.js var require_any = __commonJS((exports2, module2) => { "use strict"; module2.exports = function(Promise2) { var SomePromiseArray = Promise2._SomePromiseArray; function any(promises) { var ret2 = new SomePromiseArray(promises); var promise = ret2.promise(); ret2.setHowMany(1); ret2.setUnwrap(); ret2.init(); return promise; } Promise2.any = function(promises) { return any(promises); }; Promise2.prototype.any = function() { return any(this); }; }; }); // node_modules/bluebird/js/release/promise.js var require_promise = __commonJS((exports2, module2) => { "use strict"; module2.exports = function() { var makeSelfResolutionError = function() { return new TypeError2("circular promise resolution chain\n\n See http://goo.gl/MqrFmX\n"); }; var reflectHandler = function() { return new Promise2.PromiseInspection(this._target()); }; var apiRejection = function(msg) { return Promise2.reject(new TypeError2(msg)); }; function Proxyable() { } var UNDEFINED_BINDING = {}; var util = require_util(); var getDomain; if (util.isNode) { getDomain = function() { var ret2 = process.domain; if (ret2 === void 0) ret2 = null; return ret2; }; } else { getDomain = function() { return null; }; } util.notEnumerableProp(Promise2, "_getDomain", getDomain); var es52 = require_es5(); var Async = require_async(); var async = new Async(); es52.defineProperty(Promise2, "_async", {value: async}); var errors = require_errors(); var TypeError2 = Promise2.TypeError = errors.TypeError; Promise2.RangeError = errors.RangeError; var CancellationError = Promise2.CancellationError = errors.CancellationError; Promise2.TimeoutError = errors.TimeoutError; Promise2.OperationalError = errors.OperationalError; Promise2.RejectionError = errors.OperationalError; Promise2.AggregateError = errors.AggregateError; var INTERNAL = function() { }; var APPLY = {}; var NEXT_FILTER = {}; var tryConvertToPromise = require_thenables()(Promise2, INTERNAL); var PromiseArray = require_promise_array()(Promise2, INTERNAL, tryConvertToPromise, apiRejection, Proxyable); var Context = require_context()(Promise2); var createContext = Context.create; var debug = require_debuggability()(Promise2, Context); var CapturedTrace = debug.CapturedTrace; var PassThroughHandlerContext = require_finally()(Promise2, tryConvertToPromise); var catchFilter = require_catch_filter()(NEXT_FILTER); var nodebackForPromise = require_nodeback(); var errorObj2 = util.errorObj; var tryCatch2 = util.tryCatch; function check(self2, executor) { if (typeof executor !== "function") { throw new TypeError2("expecting a function but got " + util.classString(executor)); } if (self2.constructor !== Promise2) { throw new TypeError2("the promise constructor cannot be invoked directly\n\n See http://goo.gl/MqrFmX\n"); } } function Promise2(executor) { this._bitField = 0; this._fulfillmentHandler0 = void 0; this._rejectionHandler0 = void 0; this._promise0 = void 0; this._receiver0 = void 0; if (executor !== INTERNAL) { check(this, executor); this._resolveFromExecutor(executor); } this._promiseCreated(); this._fireEvent("promiseCreated", this); } Promise2.prototype.toString = function() { return "[object Promise]"; }; Promise2.prototype.caught = Promise2.prototype["catch"] = function(fn) { var len = arguments.length; if (len > 1) { var catchInstances = new Array(len - 1), j = 0, i; for (i = 0; i < len - 1; ++i) { var item = arguments[i]; if (util.isObject(item)) { catchInstances[j++] = item; } else { return apiRejection("expecting an object but got A catch statement predicate " + util.classString(item)); } } catchInstances.length = j; fn = arguments[i]; return this.then(void 0, catchFilter(catchInstances, fn, this)); } return this.then(void 0, fn); }; Promise2.prototype.reflect = function() { return this._then(reflectHandler, reflectHandler, void 0, this, void 0); }; Promise2.prototype.then = function(didFulfill, didReject) { if (debug.warnings() && arguments.length > 0 && typeof didFulfill !== "function" && typeof didReject !== "function") { var msg = ".then() only accepts functions but was passed: " + util.classString(didFulfill); if (arguments.length > 1) { msg += ", " + util.classString(didReject); } this._warn(msg); } return this._then(didFulfill, didReject, void 0, void 0, void 0); }; Promise2.prototype.done = function(didFulfill, didReject) { var promise = this._then(didFulfill, didReject, void 0, void 0, void 0); promise._setIsFinal(); }; Promise2.prototype.spread = function(fn) { if (typeof fn !== "function") { return apiRejection("expecting a function but got " + util.classString(fn)); } return this.all()._then(fn, void 0, void 0, APPLY, void 0); }; Promise2.prototype.toJSON = function() { var ret2 = { isFulfilled: false, isRejected: false, fulfillmentValue: void 0, rejectionReason: void 0 }; if (this.isFulfilled()) { ret2.fulfillmentValue = this.value(); ret2.isFulfilled = true; } else if (this.isRejected()) { ret2.rejectionReason = this.reason(); ret2.isRejected = true; } return ret2; }; Promise2.prototype.all = function() { if (arguments.length > 0) { this._warn(".all() was passed arguments but it does not take any"); } return new PromiseArray(this).promise(); }; Promise2.prototype.error = function(fn) { return this.caught(util.originatesFromRejection, fn); }; Promise2.getNewLibraryCopy = module2.exports; Promise2.is = function(val) { return val instanceof Promise2; }; Promise2.fromNode = Promise2.fromCallback = function(fn) { var ret2 = new Promise2(INTERNAL); ret2._captureStackTrace(); var multiArgs = arguments.length > 1 ? !!Object(arguments[1]).multiArgs : false; var result = tryCatch2(fn)(nodebackForPromise(ret2, multiArgs)); if (result === errorObj2) { ret2._rejectCallback(result.e, true); } if (!ret2._isFateSealed()) ret2._setAsyncGuaranteed(); return ret2; }; Promise2.all = function(promises) { return new PromiseArray(promises).promise(); }; Promise2.cast = function(obj) { var ret2 = tryConvertToPromise(obj); if (!(ret2 instanceof Promise2)) { ret2 = new Promise2(INTERNAL); ret2._captureStackTrace(); ret2._setFulfilled(); ret2._rejectionHandler0 = obj; } return ret2; }; Promise2.resolve = Promise2.fulfilled = Promise2.cast; Promise2.reject = Promise2.rejected = function(reason) { var ret2 = new Promise2(INTERNAL); ret2._captureStackTrace(); ret2._rejectCallback(reason, true); return ret2; }; Promise2.setScheduler = function(fn) { if (typeof fn !== "function") { throw new TypeError2("expecting a function but got " + util.classString(fn)); } return async.setScheduler(fn); }; Promise2.prototype._then = function(didFulfill, didReject, _, receiver, internalData) { var haveInternalData = internalData !== void 0; var promise = haveInternalData ? internalData : new Promise2(INTERNAL); var target = this._target(); var bitField = target._bitField; if (!haveInternalData) { promise._propagateFrom(this, 3); promise._captureStackTrace(); if (receiver === void 0 && (this._bitField & 2097152) !== 0) { if (!((bitField & 50397184) === 0)) { receiver = this._boundValue(); } else { receiver = target === this ? void 0 : this._boundTo; } } this._fireEvent("promiseChained", this, promise); } var domain = getDomain(); if (!((bitField & 50397184) === 0)) { var handler, value, settler = target._settlePromiseCtx; if ((bitField & 33554432) !== 0) { value = target._rejectionHandler0; handler = didFulfill; } else if ((bitField & 16777216) !== 0) { value = target._fulfillmentHandler0; handler = didReject; target._unsetRejectionIsUnhandled(); } else { settler = target._settlePromiseLateCancellationObserver; value = new CancellationError("late cancellation observer"); target._attachExtraTrace(value); handler = didReject; } async.invoke(settler, target, { handler: domain === null ? handler : typeof handler === "function" && util.domainBind(domain, handler), promise, receiver, value }); } else { target._addCallbacks(didFulfill, didReject, promise, receiver, domain); } return promise; }; Promise2.prototype._length = function() { return this._bitField & 65535; }; Promise2.prototype._isFateSealed = function() { return (this._bitField & 117506048) !== 0; }; Promise2.prototype._isFollowing = function() { return (this._bitField & 67108864) === 67108864; }; Promise2.prototype._setLength = function(len) { this._bitField = this._bitField & -65536 | len & 65535; }; Promise2.prototype._setFulfilled = function() { this._bitField = this._bitField | 33554432; this._fireEvent("promiseFulfilled", this); }; Promise2.prototype._setRejected = function() { this._bitField = this._bitField | 16777216; this._fireEvent("promiseRejected", this); }; Promise2.prototype._setFollowing = function() { this._bitField = this._bitField | 67108864; this._fireEvent("promiseResolved", this); }; Promise2.prototype._setIsFinal = function() { this._bitField = this._bitField | 4194304; }; Promise2.prototype._isFinal = function() { return (this._bitField & 4194304) > 0; }; Promise2.prototype._unsetCancelled = function() { this._bitField = this._bitField & ~65536; }; Promise2.prototype._setCancelled = function() { this._bitField = this._bitField | 65536; this._fireEvent("promiseCancelled", this); }; Promise2.prototype._setWillBeCancelled = function() { this._bitField = this._bitField | 8388608; }; Promise2.prototype._setAsyncGuaranteed = function() { if (async.hasCustomScheduler()) return; this._bitField = this._bitField | 134217728; }; Promise2.prototype._receiverAt = function(index) { var ret2 = index === 0 ? this._receiver0 : this[index * 4 - 4 + 3]; if (ret2 === UNDEFINED_BINDING) { return void 0; } else if (ret2 === void 0 && this._isBound()) { return this._boundValue(); } return ret2; }; Promise2.prototype._promiseAt = function(index) { return this[index * 4 - 4 + 2]; }; Promise2.prototype._fulfillmentHandlerAt = function(index) { return this[index * 4 - 4 + 0]; }; Promise2.prototype._rejectionHandlerAt = function(index) { return this[index * 4 - 4 + 1]; }; Promise2.prototype._boundValue = function() { }; Promise2.prototype._migrateCallback0 = function(follower) { var bitField = follower._bitField; var fulfill = follower._fulfillmentHandler0; var reject = follower._rejectionHandler0; var promise = follower._promise0; var receiver = follower._receiverAt(0); if (receiver === void 0) receiver = UNDEFINED_BINDING; this._addCallbacks(fulfill, reject, promise, receiver, null); }; Promise2.prototype._migrateCallbackAt = function(follower, index) { var fulfill = follower._fulfillmentHandlerAt(index); var reject = follower._rejectionHandlerAt(index); var promise = follower._promiseAt(index); var receiver = follower._receiverAt(index); if (receiver === void 0) receiver = UNDEFINED_BINDING; this._addCallbacks(fulfill, reject, promise, receiver, null); }; Promise2.prototype._addCallbacks = function(fulfill, reject, promise, receiver, domain) { var index = this._length(); if (index >= 65535 - 4) { index = 0; this._setLength(0); } if (index === 0) { this._promise0 = promise; this._receiver0 = receiver; if (typeof fulfill === "function") { this._fulfillmentHandler0 = domain === null ? fulfill : util.domainBind(domain, fulfill); } if (typeof reject === "function") { this._rejectionHandler0 = domain === null ? reject : util.domainBind(domain, reject); } } else { var base = index * 4 - 4; this[base + 2] = promise; this[base + 3] = receiver; if (typeof fulfill === "function") { this[base + 0] = domain === null ? fulfill : util.domainBind(domain, fulfill); } if (typeof reject === "function") { this[base + 1] = domain === null ? reject : util.domainBind(domain, reject); } } this._setLength(index + 1); return index; }; Promise2.prototype._proxy = function(proxyable, arg) { this._addCallbacks(void 0, void 0, arg, proxyable, null); }; Promise2.prototype._resolveCallback = function(value, shouldBind) { if ((this._bitField & 117506048) !== 0) return; if (value === this) return this._rejectCallback(makeSelfResolutionError(), false); var maybePromise = tryConvertToPromise(value, this); if (!(maybePromise instanceof Promise2)) return this._fulfill(value); if (shouldBind) this._propagateFrom(maybePromise, 2); var promise = maybePromise._target(); if (promise === this) { this._reject(makeSelfResolutionError()); return; } var bitField = promise._bitField; if ((bitField & 50397184) === 0) { var len = this._length(); if (len > 0) promise._migrateCallback0(this); for (var i = 1; i < len; ++i) { promise._migrateCallbackAt(this, i); } this._setFollowing(); this._setLength(0); this._setFollowee(promise); } else if ((bitField & 33554432) !== 0) { this._fulfill(promise._value()); } else if ((bitField & 16777216) !== 0) { this._reject(promise._reason()); } else { var reason = new CancellationError("late cancellation observer"); promise._attachExtraTrace(reason); this._reject(reason); } }; Promise2.prototype._rejectCallback = function(reason, synchronous, ignoreNonErrorWarnings) { var trace = util.ensureErrorObject(reason); var hasStack = trace === reason; if (!hasStack && !ignoreNonErrorWarnings && debug.warnings()) { var message = "a promise was rejected with a non-error: " + util.classString(reason); this._warn(message, true); } this._attachExtraTrace(trace, synchronous ? hasStack : false); this._reject(reason); }; Promise2.prototype._resolveFromExecutor = function(executor) { var promise = this; this._captureStackTrace(); this._pushContext(); var synchronous = true; var r = this._execute(executor, function(value) { promise._resolveCallback(value); }, function(reason) { promise._rejectCallback(reason, synchronous); }); synchronous = false; this._popContext(); if (r !== void 0) { promise._rejectCallback(r, true); } }; Promise2.prototype._settlePromiseFromHandler = function(handler, receiver, value, promise) { var bitField = promise._bitField; if ((bitField & 65536) !== 0) return; promise._pushContext(); var x; if (receiver === APPLY) { if (!value || typeof value.length !== "number") { x = errorObj2; x.e = new TypeError2("cannot .spread() a non-array: " + util.classString(value)); } else { x = tryCatch2(handler).apply(this._boundValue(), value); } } else { x = tryCatch2(handler).call(receiver, value); } var promiseCreated = promise._popContext(); bitField = promise._bitField; if ((bitField & 65536) !== 0) return; if (x === NEXT_FILTER) { promise._reject(value); } else if (x === errorObj2) { promise._rejectCallback(x.e, false); } else { debug.checkForgottenReturns(x, promiseCreated, "", promise, this); promise._resolveCallback(x); } }; Promise2.prototype._target = function() { var ret2 = this; while (ret2._isFollowing()) ret2 = ret2._followee(); return ret2; }; Promise2.prototype._followee = function() { return this._rejectionHandler0; }; Promise2.prototype._setFollowee = function(promise) { this._rejectionHandler0 = promise; }; Promise2.prototype._settlePromise = function(promise, handler, receiver, value) { var isPromise = promise instanceof Promise2; var bitField = this._bitField; var asyncGuaranteed = (bitField & 134217728) !== 0; if ((bitField & 65536) !== 0) { if (isPromise) promise._invokeInternalOnCancel(); if (receiver instanceof PassThroughHandlerContext && receiver.isFinallyHandler()) { receiver.cancelPromise = promise; if (tryCatch2(handler).call(receiver, value) === errorObj2) { promise._reject(errorObj2.e); } } else if (handler === reflectHandler) { promise._fulfill(reflectHandler.call(receiver)); } else if (receiver instanceof Proxyable) { receiver._promiseCancelled(promise); } else if (isPromise || promise instanceof PromiseArray) { promise._cancel(); } else { receiver.cancel(); } } else if (typeof handler === "function") { if (!isPromise) { handler.call(receiver, value, promise); } else { if (asyncGuaranteed) promise._setAsyncGuaranteed(); this._settlePromiseFromHandler(handler, receiver, value, promise); } } else if (receiver instanceof Proxyable) { if (!receiver._isResolved()) { if ((bitField & 33554432) !== 0) { receiver._promiseFulfilled(value, promise); } else { receiver._promiseRejected(value, promise); } } } else if (isPromise) { if (asyncGuaranteed) promise._setAsyncGuaranteed(); if ((bitField & 33554432) !== 0) { promise._fulfill(value); } else { promise._reject(value); } } }; Promise2.prototype._settlePromiseLateCancellationObserver = function(ctx) { var handler = ctx.handler; var promise = ctx.promise; var receiver = ctx.receiver; var value = ctx.value; if (typeof handler === "function") { if (!(promise instanceof Promise2)) { handler.call(receiver, value, promise); } else { this._settlePromiseFromHandler(handler, receiver, value, promise); } } else if (promise instanceof Promise2) { promise._reject(value); } }; Promise2.prototype._settlePromiseCtx = function(ctx) { this._settlePromise(ctx.promise, ctx.handler, ctx.receiver, ctx.value); }; Promise2.prototype._settlePromise0 = function(handler, value, bitField) { var promise = this._promise0; var receiver = this._receiverAt(0); this._promise0 = void 0; this._receiver0 = void 0; this._settlePromise(promise, handler, receiver, value); }; Promise2.prototype._clearCallbackDataAtIndex = function(index) { var base = index * 4 - 4; this[base + 2] = this[base + 3] = this[base + 0] = this[base + 1] = void 0; }; Promise2.prototype._fulfill = function(value) { var bitField = this._bitField; if ((bitField & 117506048) >>> 16) return; if (value === this) { var err = makeSelfResolutionError(); this._attachExtraTrace(err); return this._reject(err); } this._setFulfilled(); this._rejectionHandler0 = value; if ((bitField & 65535) > 0) { if ((bitField & 134217728) !== 0) { this._settlePromises(); } else { async.settlePromises(this); } } }; Promise2.prototype._reject = function(reason) { var bitField = this._bitField; if ((bitField & 117506048) >>> 16) return; this._setRejected(); this._fulfillmentHandler0 = reason; if (this._isFinal()) { return async.fatalError(reason, util.isNode); } if ((bitField & 65535) > 0) { async.settlePromises(this); } else { this._ensurePossibleRejectionHandled(); } }; Promise2.prototype._fulfillPromises = function(len, value) { for (var i = 1; i < len; i++) { var handler = this._fulfillmentHandlerAt(i); var promise = this._promiseAt(i); var receiver = this._receiverAt(i); this._clearCallbackDataAtIndex(i); this._settlePromise(promise, handler, receiver, value); } }; Promise2.prototype._rejectPromises = function(len, reason) { for (var i = 1; i < len; i++) { var handler = this._rejectionHandlerAt(i); var promise = this._promiseAt(i); var receiver = this._receiverAt(i); this._clearCallbackDataAtIndex(i); this._settlePromise(promise, handler, receiver, reason); } }; Promise2.prototype._settlePromises = function() { var bitField = this._bitField; var len = bitField & 65535; if (len > 0) { if ((bitField & 16842752) !== 0) { var reason = this._fulfillmentHandler0; this._settlePromise0(this._rejectionHandler0, reason, bitField); this._rejectPromises(len, reason); } else { var value = this._rejectionHandler0; this._settlePromise0(this._fulfillmentHandler0, value, bitField); this._fulfillPromises(len, value); } this._setLength(0); } this._clearCancellationData(); }; Promise2.prototype._settledValue = function() { var bitField = this._bitField; if ((bitField & 33554432) !== 0) { return this._rejectionHandler0; } else if ((bitField & 16777216) !== 0) { return this._fulfillmentHandler0; } }; function deferResolve(v) { this.promise._resolveCallback(v); } function deferReject(v) { this.promise._rejectCallback(v, false); } Promise2.defer = Promise2.pending = function() { debug.deprecated("Promise.defer", "new Promise"); var promise = new Promise2(INTERNAL); return { promise, resolve: deferResolve, reject: deferReject }; }; util.notEnumerableProp(Promise2, "_makeSelfResolutionError", makeSelfResolutionError); require_method()(Promise2, INTERNAL, tryConvertToPromise, apiRejection, debug); require_bind()(Promise2, INTERNAL, tryConvertToPromise, debug); require_cancel()(Promise2, PromiseArray, apiRejection, debug); require_direct_resolve()(Promise2); require_synchronous_inspection()(Promise2); require_join()(Promise2, PromiseArray, tryConvertToPromise, INTERNAL, async, getDomain); Promise2.Promise = Promise2; Promise2.version = "3.4.7"; require_map()(Promise2, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug); require_call_get()(Promise2); require_using()(Promise2, apiRejection, tryConvertToPromise, createContext, INTERNAL, debug); require_timers()(Promise2, INTERNAL, debug); require_generators()(Promise2, apiRejection, INTERNAL, tryConvertToPromise, Proxyable, debug); require_nodeify()(Promise2); require_promisify()(Promise2, INTERNAL); require_props()(Promise2, PromiseArray, tryConvertToPromise, apiRejection); require_race()(Promise2, INTERNAL, tryConvertToPromise, apiRejection); require_reduce()(Promise2, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug); require_settle()(Promise2, PromiseArray, debug); require_some()(Promise2, PromiseArray, apiRejection); require_filter()(Promise2, INTERNAL); require_each()(Promise2, INTERNAL); require_any()(Promise2); util.toFastProperties(Promise2); util.toFastProperties(Promise2.prototype); function fillTypes(value) { var p = new Promise2(INTERNAL); p._fulfillmentHandler0 = value; p._rejectionHandler0 = value; p._promise0 = value; p._receiver0 = value; } fillTypes({a: 1}); fillTypes({b: 2}); fillTypes({c: 3}); fillTypes(1); fillTypes(function() { }); fillTypes(void 0); fillTypes(false); fillTypes(new Promise2(INTERNAL)); debug.setBounds(Async.firstLineError, util.lastLineError); return Promise2; }; }); // node_modules/bluebird/js/release/bluebird.js var require_bluebird = __commonJS((exports2, module2) => { "use strict"; var old; if (typeof Promise !== "undefined") old = Promise; function noConflict() { try { if (Promise === bluebird) Promise = old; } catch (e) { } return bluebird; } var bluebird = require_promise()(); bluebird.noConflict = noConflict; module2.exports = bluebird; }); // node_modules/unzipper/lib/Buffer.js var require_Buffer = __commonJS((exports2, module2) => { var Buffer2 = require("buffer").Buffer; if (Buffer2.from === void 0) { Buffer2.from = function(a, b, c) { return new Buffer2(a, b, c); }; Buffer2.alloc = Buffer2.from; } module2.exports = Buffer2; }); // node_modules/process-nextick-args/index.js var require_process_nextick_args = __commonJS((exports2, module2) => { "use strict"; if (typeof process === "undefined" || !process.version || process.version.indexOf("v0.") === 0 || process.version.indexOf("v1.") === 0 && process.version.indexOf("v1.8.") !== 0) { module2.exports = {nextTick}; } else { module2.exports = process; } function nextTick(fn, arg1, arg2, arg3) { if (typeof fn !== "function") { throw new TypeError('"callback" argument must be a function'); } var len = arguments.length; var args, i; switch (len) { case 0: case 1: return process.nextTick(fn); case 2: return process.nextTick(function afterTickOne() { fn.call(null, arg1); }); case 3: return process.nextTick(function afterTickTwo() { fn.call(null, arg1, arg2); }); case 4: return process.nextTick(function afterTickThree() { fn.call(null, arg1, arg2, arg3); }); default: args = new Array(len - 1); i = 0; while (i < args.length) { args[i++] = arguments[i]; } return process.nextTick(function afterTick() { fn.apply(null, args); }); } } }); // node_modules/isarray/index.js var require_isarray = __commonJS((exports2, module2) => { var toString = {}.toString; module2.exports = Array.isArray || function(arr) { return toString.call(arr) == "[object Array]"; }; }); // node_modules/readable-stream/lib/internal/streams/stream.js var require_stream = __commonJS((exports2, module2) => { module2.exports = require("stream"); }); // node_modules/safe-buffer/index.js var require_safe_buffer = __commonJS((exports2, module2) => { var buffer = require("buffer"); var Buffer2 = buffer.Buffer; function copyProps(src, dst) { for (var key in src) { dst[key] = src[key]; } } if (Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow) { module2.exports = buffer; } else { copyProps(buffer, exports2); exports2.Buffer = SafeBuffer; } function SafeBuffer(arg, encodingOrOffset, length) { return Buffer2(arg, encodingOrOffset, length); } copyProps(Buffer2, SafeBuffer); SafeBuffer.from = function(arg, encodingOrOffset, length) { if (typeof arg === "number") { throw new TypeError("Argument must not be a number"); } return Buffer2(arg, encodingOrOffset, length); }; SafeBuffer.alloc = function(size, fill, encoding) { if (typeof size !== "number") { throw new TypeError("Argument must be a number"); } var buf = Buffer2(size); if (fill !== void 0) { if (typeof encoding === "string") { buf.fill(fill, encoding); } else { buf.fill(fill); } } else { buf.fill(0); } return buf; }; SafeBuffer.allocUnsafe = function(size) { if (typeof size !== "number") { throw new TypeError("Argument must be a number"); } return Buffer2(size); }; SafeBuffer.allocUnsafeSlow = function(size) { if (typeof size !== "number") { throw new TypeError("Argument must be a number"); } return buffer.SlowBuffer(size); }; }); // node_modules/core-util-is/lib/util.js var require_util2 = __commonJS((exports2) => { function isArray(arg) { if (Array.isArray) { return Array.isArray(arg); } return objectToString(arg) === "[object Array]"; } exports2.isArray = isArray; function isBoolean(arg) { return typeof arg === "boolean"; } exports2.isBoolean = isBoolean; function isNull(arg) { return arg === null; } exports2.isNull = isNull; function isNullOrUndefined(arg) { return arg == null; } exports2.isNullOrUndefined = isNullOrUndefined; function isNumber(arg) { return typeof arg === "number"; } exports2.isNumber = isNumber; function isString(arg) { return typeof arg === "string"; } exports2.isString = isString; function isSymbol(arg) { return typeof arg === "symbol"; } exports2.isSymbol = isSymbol; function isUndefined(arg) { return arg === void 0; } exports2.isUndefined = isUndefined; function isRegExp(re) { return objectToString(re) === "[object RegExp]"; } exports2.isRegExp = isRegExp; function isObject3(arg) { return typeof arg === "object" && arg !== null; } exports2.isObject = isObject3; function isDate(d) { return objectToString(d) === "[object Date]"; } exports2.isDate = isDate; function isError2(e) { return objectToString(e) === "[object Error]" || e instanceof Error; } exports2.isError = isError2; function isFunction(arg) { return typeof arg === "function"; } exports2.isFunction = isFunction; function isPrimitive2(arg) { return arg === null || typeof arg === "boolean" || typeof arg === "number" || typeof arg === "string" || typeof arg === "symbol" || typeof arg === "undefined"; } exports2.isPrimitive = isPrimitive2; exports2.isBuffer = Buffer.isBuffer; function objectToString(o) { return Object.prototype.toString.call(o); } }); // node_modules/readable-stream/lib/internal/streams/BufferList.js var require_BufferList = __commonJS((exports2, module2) => { "use strict"; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var Buffer2 = require_safe_buffer().Buffer; var util = require("util"); function copyBuffer(src, target, offset) { src.copy(target, offset); } module2.exports = function() { function BufferList() { _classCallCheck(this, BufferList); this.head = null; this.tail = null; this.length = 0; } BufferList.prototype.push = function push(v) { var entry = {data: v, next: null}; if (this.length > 0) this.tail.next = entry; else this.head = entry; this.tail = entry; ++this.length; }; BufferList.prototype.unshift = function unshift(v) { var entry = {data: v, next: this.head}; if (this.length === 0) this.tail = entry; this.head = entry; ++this.length; }; BufferList.prototype.shift = function shift() { if (this.length === 0) return; var ret2 = this.head.data; if (this.length === 1) this.head = this.tail = null; else this.head = this.head.next; --this.length; return ret2; }; BufferList.prototype.clear = function clear() { this.head = this.tail = null; this.length = 0; }; BufferList.prototype.join = function join(s) { if (this.length === 0) return ""; var p = this.head; var ret2 = "" + p.data; while (p = p.next) { ret2 += s + p.data; } return ret2; }; BufferList.prototype.concat = function concat(n) { if (this.length === 0) return Buffer2.alloc(0); if (this.length === 1) return this.head.data; var ret2 = Buffer2.allocUnsafe(n >>> 0); var p = this.head; var i = 0; while (p) { copyBuffer(p.data, ret2, i); i += p.data.length; p = p.next; } return ret2; }; return BufferList; }(); if (util && util.inspect && util.inspect.custom) { module2.exports.prototype[util.inspect.custom] = function() { var obj = util.inspect({length: this.length}); return this.constructor.name + " " + obj; }; } }); // node_modules/readable-stream/lib/internal/streams/destroy.js var require_destroy = __commonJS((exports2, module2) => { "use strict"; var pna = require_process_nextick_args(); function destroy(err, cb) { var _this = this; var readableDestroyed = this._readableState && this._readableState.destroyed; var writableDestroyed = this._writableState && this._writableState.destroyed; if (readableDestroyed || writableDestroyed) { if (cb) { cb(err); } else if (err && (!this._writableState || !this._writableState.errorEmitted)) { pna.nextTick(emitErrorNT, this, err); } return this; } if (this._readableState) { this._readableState.destroyed = true; } if (this._writableState) { this._writableState.destroyed = true; } this._destroy(err || null, function(err2) { if (!cb && err2) { pna.nextTick(emitErrorNT, _this, err2); if (_this._writableState) { _this._writableState.errorEmitted = true; } } else if (cb) { cb(err2); } }); return this; } function undestroy() { if (this._readableState) { this._readableState.destroyed = false; this._readableState.reading = false; this._readableState.ended = false; this._readableState.endEmitted = false; } if (this._writableState) { this._writableState.destroyed = false; this._writableState.ended = false; this._writableState.ending = false; this._writableState.finished = false; this._writableState.errorEmitted = false; } } function emitErrorNT(self2, err) { self2.emit("error", err); } module2.exports = { destroy, undestroy }; }); // node_modules/util-deprecate/node.js var require_node2 = __commonJS((exports2, module2) => { module2.exports = require("util").deprecate; }); // node_modules/readable-stream/lib/_stream_writable.js var require_stream_writable = __commonJS((exports2, module2) => { "use strict"; var pna = require_process_nextick_args(); module2.exports = Writable; function CorkedRequest(state) { var _this = this; this.next = null; this.entry = null; this.finish = function() { onCorkedFinish(_this, state); }; } var asyncWrite = !process.browser && ["v0.10", "v0.9."].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; var Duplex; Writable.WritableState = WritableState; var util = Object.create(require_util2()); util.inherits = require_inherits(); var internalUtil = { deprecate: require_node2() }; var Stream = require_stream(); var Buffer2 = require_safe_buffer().Buffer; var OurUint8Array = global.Uint8Array || function() { }; function _uint8ArrayToBuffer(chunk) { return Buffer2.from(chunk); } function _isUint8Array(obj) { return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array; } var destroyImpl = require_destroy(); util.inherits(Writable, Stream); function nop() { } function WritableState(options, stream) { Duplex = Duplex || require_stream_duplex(); options = options || {}; var isDuplex = stream instanceof Duplex; this.objectMode = !!options.objectMode; if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; var hwm = options.highWaterMark; var writableHwm = options.writableHighWaterMark; var defaultHwm = this.objectMode ? 16 : 16 * 1024; if (hwm || hwm === 0) this.highWaterMark = hwm; else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm; else this.highWaterMark = defaultHwm; this.highWaterMark = Math.floor(this.highWaterMark); this.finalCalled = false; this.needDrain = false; this.ending = false; this.ended = false; this.finished = false; this.destroyed = false; var noDecode = options.decodeStrings === false; this.decodeStrings = !noDecode; this.defaultEncoding = options.defaultEncoding || "utf8"; this.length = 0; this.writing = false; this.corked = 0; this.sync = true; this.bufferProcessing = false; this.onwrite = function(er) { onwrite(stream, er); }; this.writecb = null; this.writelen = 0; this.bufferedRequest = null; this.lastBufferedRequest = null; this.pendingcb = 0; this.prefinished = false; this.errorEmitted = false; this.bufferedRequestCount = 0; this.corkedRequestsFree = new CorkedRequest(this); } WritableState.prototype.getBuffer = function getBuffer() { var current = this.bufferedRequest; var out = []; while (current) { out.push(current); current = current.next; } return out; }; (function() { try { Object.defineProperty(WritableState.prototype, "buffer", { get: internalUtil.deprecate(function() { return this.getBuffer(); }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003") }); } catch (_) { } })(); var realHasInstance; if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") { realHasInstance = Function.prototype[Symbol.hasInstance]; Object.defineProperty(Writable, Symbol.hasInstance, { value: function(object) { if (realHasInstance.call(this, object)) return true; if (this !== Writable) return false; return object && object._writableState instanceof WritableState; } }); } else { realHasInstance = function(object) { return object instanceof this; }; } function Writable(options) { Duplex = Duplex || require_stream_duplex(); if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { return new Writable(options); } this._writableState = new WritableState(options, this); this.writable = true; if (options) { if (typeof options.write === "function") this._write = options.write; if (typeof options.writev === "function") this._writev = options.writev; if (typeof options.destroy === "function") this._destroy = options.destroy; if (typeof options.final === "function") this._final = options.final; } Stream.call(this); } Writable.prototype.pipe = function() { this.emit("error", new Error("Cannot pipe, not readable")); }; function writeAfterEnd(stream, cb) { var er = new Error("write after end"); stream.emit("error", er); pna.nextTick(cb, er); } function validChunk(stream, state, chunk, cb) { var valid = true; var er = false; if (chunk === null) { er = new TypeError("May not write null values to stream"); } else if (typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) { er = new TypeError("Invalid non-string/buffer chunk"); } if (er) { stream.emit("error", er); pna.nextTick(cb, er); valid = false; } return valid; } Writable.prototype.write = function(chunk, encoding, cb) { var state = this._writableState; var ret2 = false; var isBuf = !state.objectMode && _isUint8Array(chunk); if (isBuf && !Buffer2.isBuffer(chunk)) { chunk = _uint8ArrayToBuffer(chunk); } if (typeof encoding === "function") { cb = encoding; encoding = null; } if (isBuf) encoding = "buffer"; else if (!encoding) encoding = state.defaultEncoding; if (typeof cb !== "function") cb = nop; if (state.ended) writeAfterEnd(this, cb); else if (isBuf || validChunk(this, state, chunk, cb)) { state.pendingcb++; ret2 = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); } return ret2; }; Writable.prototype.cork = function() { var state = this._writableState; state.corked++; }; Writable.prototype.uncork = function() { var state = this._writableState; if (state.corked) { state.corked--; if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); } }; Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { if (typeof encoding === "string") encoding = encoding.toLowerCase(); if (!(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((encoding + "").toLowerCase()) > -1)) throw new TypeError("Unknown encoding: " + encoding); this._writableState.defaultEncoding = encoding; return this; }; function decodeChunk(state, chunk, encoding) { if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") { chunk = Buffer2.from(chunk, encoding); } return chunk; } Object.defineProperty(Writable.prototype, "writableHighWaterMark", { enumerable: false, get: function() { return this._writableState.highWaterMark; } }); function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { if (!isBuf) { var newChunk = decodeChunk(state, chunk, encoding); if (chunk !== newChunk) { isBuf = true; encoding = "buffer"; chunk = newChunk; } } var len = state.objectMode ? 1 : chunk.length; state.length += len; var ret2 = state.length < state.highWaterMark; if (!ret2) state.needDrain = true; if (state.writing || state.corked) { var last = state.lastBufferedRequest; state.lastBufferedRequest = { chunk, encoding, isBuf, callback: cb, next: null }; if (last) { last.next = state.lastBufferedRequest; } else { state.bufferedRequest = state.lastBufferedRequest; } state.bufferedRequestCount += 1; } else { doWrite(stream, state, false, len, chunk, encoding, cb); } return ret2; } function doWrite(stream, state, writev, len, chunk, encoding, cb) { state.writelen = len; state.writecb = cb; state.writing = true; state.sync = true; if (writev) stream._writev(chunk, state.onwrite); else stream._write(chunk, encoding, state.onwrite); state.sync = false; } function onwriteError(stream, state, sync, er, cb) { --state.pendingcb; if (sync) { pna.nextTick(cb, er); pna.nextTick(finishMaybe, stream, state); stream._writableState.errorEmitted = true; stream.emit("error", er); } else { cb(er); stream._writableState.errorEmitted = true; stream.emit("error", er); finishMaybe(stream, state); } } function onwriteStateUpdate(state) { state.writing = false; state.writecb = null; state.length -= state.writelen; state.writelen = 0; } function onwrite(stream, er) { var state = stream._writableState; var sync = state.sync; var cb = state.writecb; onwriteStateUpdate(state); if (er) onwriteError(stream, state, sync, er, cb); else { var finished = needFinish(state); if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { clearBuffer(stream, state); } if (sync) { asyncWrite(afterWrite, stream, state, finished, cb); } else { afterWrite(stream, state, finished, cb); } } } function afterWrite(stream, state, finished, cb) { if (!finished) onwriteDrain(stream, state); state.pendingcb--; cb(); finishMaybe(stream, state); } function onwriteDrain(stream, state) { if (state.length === 0 && state.needDrain) { state.needDrain = false; stream.emit("drain"); } } function clearBuffer(stream, state) { state.bufferProcessing = true; var entry = state.bufferedRequest; if (stream._writev && entry && entry.next) { var l = state.bufferedRequestCount; var buffer = new Array(l); var holder = state.corkedRequestsFree; holder.entry = entry; var count = 0; var allBuffers = true; while (entry) { buffer[count] = entry; if (!entry.isBuf) allBuffers = false; entry = entry.next; count += 1; } buffer.allBuffers = allBuffers; doWrite(stream, state, true, state.length, buffer, "", holder.finish); state.pendingcb++; state.lastBufferedRequest = null; if (holder.next) { state.corkedRequestsFree = holder.next; holder.next = null; } else { state.corkedRequestsFree = new CorkedRequest(state); } state.bufferedRequestCount = 0; } else { while (entry) { var chunk = entry.chunk; var encoding = entry.encoding; var cb = entry.callback; var len = state.objectMode ? 1 : chunk.length; doWrite(stream, state, false, len, chunk, encoding, cb); entry = entry.next; state.bufferedRequestCount--; if (state.writing) { break; } } if (entry === null) state.lastBufferedRequest = null; } state.bufferedRequest = entry; state.bufferProcessing = false; } Writable.prototype._write = function(chunk, encoding, cb) { cb(new Error("_write() is not implemented")); }; Writable.prototype._writev = null; Writable.prototype.end = function(chunk, encoding, cb) { var state = this._writableState; if (typeof chunk === "function") { cb = chunk; chunk = null; encoding = null; } else if (typeof encoding === "function") { cb = encoding; encoding = null; } if (chunk !== null && chunk !== void 0) this.write(chunk, encoding); if (state.corked) { state.corked = 1; this.uncork(); } if (!state.ending && !state.finished) endWritable(this, state, cb); }; function needFinish(state) { return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; } function callFinal(stream, state) { stream._final(function(err) { state.pendingcb--; if (err) { stream.emit("error", err); } state.prefinished = true; stream.emit("prefinish"); finishMaybe(stream, state); }); } function prefinish(stream, state) { if (!state.prefinished && !state.finalCalled) { if (typeof stream._final === "function") { state.pendingcb++; state.finalCalled = true; pna.nextTick(callFinal, stream, state); } else { state.prefinished = true; stream.emit("prefinish"); } } } function finishMaybe(stream, state) { var need = needFinish(state); if (need) { prefinish(stream, state); if (state.pendingcb === 0) { state.finished = true; stream.emit("finish"); } } return need; } function endWritable(stream, state, cb) { state.ending = true; finishMaybe(stream, state); if (cb) { if (state.finished) pna.nextTick(cb); else stream.once("finish", cb); } state.ended = true; stream.writable = false; } function onCorkedFinish(corkReq, state, err) { var entry = corkReq.entry; corkReq.entry = null; while (entry) { var cb = entry.callback; state.pendingcb--; cb(err); entry = entry.next; } if (state.corkedRequestsFree) { state.corkedRequestsFree.next = corkReq; } else { state.corkedRequestsFree = corkReq; } } Object.defineProperty(Writable.prototype, "destroyed", { get: function() { if (this._writableState === void 0) { return false; } return this._writableState.destroyed; }, set: function(value) { if (!this._writableState) { return; } this._writableState.destroyed = value; } }); Writable.prototype.destroy = destroyImpl.destroy; Writable.prototype._undestroy = destroyImpl.undestroy; Writable.prototype._destroy = function(err, cb) { this.end(); cb(err); }; }); // node_modules/readable-stream/lib/_stream_duplex.js var require_stream_duplex = __commonJS((exports2, module2) => { "use strict"; var pna = require_process_nextick_args(); var objectKeys = Object.keys || function(obj) { var keys2 = []; for (var key in obj) { keys2.push(key); } return keys2; }; module2.exports = Duplex; var util = Object.create(require_util2()); util.inherits = require_inherits(); var Readable = require_stream_readable(); var Writable = require_stream_writable(); util.inherits(Duplex, Readable); { keys = objectKeys(Writable.prototype); for (v = 0; v < keys.length; v++) { method = keys[v]; if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; } } var keys; var method; var v; function Duplex(options) { if (!(this instanceof Duplex)) return new Duplex(options); Readable.call(this, options); Writable.call(this, options); if (options && options.readable === false) this.readable = false; if (options && options.writable === false) this.writable = false; this.allowHalfOpen = true; if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; this.once("end", onend); } Object.defineProperty(Duplex.prototype, "writableHighWaterMark", { enumerable: false, get: function() { return this._writableState.highWaterMark; } }); function onend() { if (this.allowHalfOpen || this._writableState.ended) return; pna.nextTick(onEndNT, this); } function onEndNT(self2) { self2.end(); } Object.defineProperty(Duplex.prototype, "destroyed", { get: function() { if (this._readableState === void 0 || this._writableState === void 0) { return false; } return this._readableState.destroyed && this._writableState.destroyed; }, set: function(value) { if (this._readableState === void 0 || this._writableState === void 0) { return; } this._readableState.destroyed = value; this._writableState.destroyed = value; } }); Duplex.prototype._destroy = function(err, cb) { this.push(null); this.end(); pna.nextTick(cb, err); }; }); // node_modules/readable-stream/lib/_stream_readable.js var require_stream_readable = __commonJS((exports2, module2) => { "use strict"; var pna = require_process_nextick_args(); module2.exports = Readable; var isArray = require_isarray(); var Duplex; Readable.ReadableState = ReadableState; var EE = require("events").EventEmitter; var EElistenerCount = function(emitter, type) { return emitter.listeners(type).length; }; var Stream = require_stream(); var Buffer2 = require_safe_buffer().Buffer; var OurUint8Array = global.Uint8Array || function() { }; function _uint8ArrayToBuffer(chunk) { return Buffer2.from(chunk); } function _isUint8Array(obj) { return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array; } var util = Object.create(require_util2()); util.inherits = require_inherits(); var debugUtil = require("util"); var debug = void 0; if (debugUtil && debugUtil.debuglog) { debug = debugUtil.debuglog("stream"); } else { debug = function() { }; } var BufferList = require_BufferList(); var destroyImpl = require_destroy(); var StringDecoder; util.inherits(Readable, Stream); var kProxyEvents = ["error", "close", "destroy", "pause", "resume"]; function prependListener(emitter, event, fn) { if (typeof emitter.prependListener === "function") return emitter.prependListener(event, fn); if (!emitter._events || !emitter._events[event]) emitter.on(event, fn); else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn); else emitter._events[event] = [fn, emitter._events[event]]; } function ReadableState(options, stream) { Duplex = Duplex || require_stream_duplex(); options = options || {}; var isDuplex = stream instanceof Duplex; this.objectMode = !!options.objectMode; if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; var hwm = options.highWaterMark; var readableHwm = options.readableHighWaterMark; var defaultHwm = this.objectMode ? 16 : 16 * 1024; if (hwm || hwm === 0) this.highWaterMark = hwm; else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm; else this.highWaterMark = defaultHwm; this.highWaterMark = Math.floor(this.highWaterMark); this.buffer = new BufferList(); this.length = 0; this.pipes = null; this.pipesCount = 0; this.flowing = null; this.ended = false; this.endEmitted = false; this.reading = false; this.sync = true; this.needReadable = false; this.emittedReadable = false; this.readableListening = false; this.resumeScheduled = false; this.destroyed = false; this.defaultEncoding = options.defaultEncoding || "utf8"; this.awaitDrain = 0; this.readingMore = false; this.decoder = null; this.encoding = null; if (options.encoding) { if (!StringDecoder) StringDecoder = require("string_decoder/").StringDecoder; this.decoder = new StringDecoder(options.encoding); this.encoding = options.encoding; } } function Readable(options) { Duplex = Duplex || require_stream_duplex(); if (!(this instanceof Readable)) return new Readable(options); this._readableState = new ReadableState(options, this); this.readable = true; if (options) { if (typeof options.read === "function") this._read = options.read; if (typeof options.destroy === "function") this._destroy = options.destroy; } Stream.call(this); } Object.defineProperty(Readable.prototype, "destroyed", { get: function() { if (this._readableState === void 0) { return false; } return this._readableState.destroyed; }, set: function(value) { if (!this._readableState) { return; } this._readableState.destroyed = value; } }); Readable.prototype.destroy = destroyImpl.destroy; Readable.prototype._undestroy = destroyImpl.undestroy; Readable.prototype._destroy = function(err, cb) { this.push(null); cb(err); }; Readable.prototype.push = function(chunk, encoding) { var state = this._readableState; var skipChunkCheck; if (!state.objectMode) { if (typeof chunk === "string") { encoding = encoding || state.defaultEncoding; if (encoding !== state.encoding) { chunk = Buffer2.from(chunk, encoding); encoding = ""; } skipChunkCheck = true; } } else { skipChunkCheck = true; } return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); }; Readable.prototype.unshift = function(chunk) { return readableAddChunk(this, chunk, null, true, false); }; function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { var state = stream._readableState; if (chunk === null) { state.reading = false; onEofChunk(stream, state); } else { var er; if (!skipChunkCheck) er = chunkInvalid(state, chunk); if (er) { stream.emit("error", er); } else if (state.objectMode || chunk && chunk.length > 0) { if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer2.prototype) { chunk = _uint8ArrayToBuffer(chunk); } if (addToFront) { if (state.endEmitted) stream.emit("error", new Error("stream.unshift() after end event")); else addChunk(stream, state, chunk, true); } else if (state.ended) { stream.emit("error", new Error("stream.push() after EOF")); } else { state.reading = false; if (state.decoder && !encoding) { chunk = state.decoder.write(chunk); if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false); else maybeReadMore(stream, state); } else { addChunk(stream, state, chunk, false); } } } else if (!addToFront) { state.reading = false; } } return needMoreData(state); } function addChunk(stream, state, chunk, addToFront) { if (state.flowing && state.length === 0 && !state.sync) { stream.emit("data", chunk); stream.read(0); } else { state.length += state.objectMode ? 1 : chunk.length; if (addToFront) state.buffer.unshift(chunk); else state.buffer.push(chunk); if (state.needReadable) emitReadable(stream); } maybeReadMore(stream, state); } function chunkInvalid(state, chunk) { var er; if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) { er = new TypeError("Invalid non-string/buffer chunk"); } return er; } function needMoreData(state) { return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); } Readable.prototype.isPaused = function() { return this._readableState.flowing === false; }; Readable.prototype.setEncoding = function(enc) { if (!StringDecoder) StringDecoder = require("string_decoder/").StringDecoder; this._readableState.decoder = new StringDecoder(enc); this._readableState.encoding = enc; return this; }; var MAX_HWM = 8388608; function computeNewHighWaterMark(n) { if (n >= MAX_HWM) { n = MAX_HWM; } else { n--; n |= n >>> 1; n |= n >>> 2; n |= n >>> 4; n |= n >>> 8; n |= n >>> 16; n++; } return n; } function howMuchToRead(n, state) { if (n <= 0 || state.length === 0 && state.ended) return 0; if (state.objectMode) return 1; if (n !== n) { if (state.flowing && state.length) return state.buffer.head.data.length; else return state.length; } if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); if (n <= state.length) return n; if (!state.ended) { state.needReadable = true; return 0; } return state.length; } Readable.prototype.read = function(n) { debug("read", n); n = parseInt(n, 10); var state = this._readableState; var nOrig = n; if (n !== 0) state.emittedReadable = false; if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { debug("read: emitReadable", state.length, state.ended); if (state.length === 0 && state.ended) endReadable(this); else emitReadable(this); return null; } n = howMuchToRead(n, state); if (n === 0 && state.ended) { if (state.length === 0) endReadable(this); return null; } var doRead = state.needReadable; debug("need readable", doRead); if (state.length === 0 || state.length - n < state.highWaterMark) { doRead = true; debug("length less than watermark", doRead); } if (state.ended || state.reading) { doRead = false; debug("reading or ended", doRead); } else if (doRead) { debug("do read"); state.reading = true; state.sync = true; if (state.length === 0) state.needReadable = true; this._read(state.highWaterMark); state.sync = false; if (!state.reading) n = howMuchToRead(nOrig, state); } var ret2; if (n > 0) ret2 = fromList(n, state); else ret2 = null; if (ret2 === null) { state.needReadable = true; n = 0; } else { state.length -= n; } if (state.length === 0) { if (!state.ended) state.needReadable = true; if (nOrig !== n && state.ended) endReadable(this); } if (ret2 !== null) this.emit("data", ret2); return ret2; }; function onEofChunk(stream, state) { if (state.ended) return; if (state.decoder) { var chunk = state.decoder.end(); if (chunk && chunk.length) { state.buffer.push(chunk); state.length += state.objectMode ? 1 : chunk.length; } } state.ended = true; emitReadable(stream); } function emitReadable(stream) { var state = stream._readableState; state.needReadable = false; if (!state.emittedReadable) { debug("emitReadable", state.flowing); state.emittedReadable = true; if (state.sync) pna.nextTick(emitReadable_, stream); else emitReadable_(stream); } } function emitReadable_(stream) { debug("emit readable"); stream.emit("readable"); flow(stream); } function maybeReadMore(stream, state) { if (!state.readingMore) { state.readingMore = true; pna.nextTick(maybeReadMore_, stream, state); } } function maybeReadMore_(stream, state) { var len = state.length; while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { debug("maybeReadMore read 0"); stream.read(0); if (len === state.length) break; else len = state.length; } state.readingMore = false; } Readable.prototype._read = function(n) { this.emit("error", new Error("_read() is not implemented")); }; Readable.prototype.pipe = function(dest, pipeOpts) { var src = this; var state = this._readableState; switch (state.pipesCount) { case 0: state.pipes = dest; break; case 1: state.pipes = [state.pipes, dest]; break; default: state.pipes.push(dest); break; } state.pipesCount += 1; debug("pipe count=%d opts=%j", state.pipesCount, pipeOpts); var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; var endFn = doEnd ? onend : unpipe; if (state.endEmitted) pna.nextTick(endFn); else src.once("end", endFn); dest.on("unpipe", onunpipe); function onunpipe(readable, unpipeInfo) { debug("onunpipe"); if (readable === src) { if (unpipeInfo && unpipeInfo.hasUnpiped === false) { unpipeInfo.hasUnpiped = true; cleanup(); } } } function onend() { debug("onend"); dest.end(); } var ondrain = pipeOnDrain(src); dest.on("drain", ondrain); var cleanedUp = false; function cleanup() { debug("cleanup"); dest.removeListener("close", onclose); dest.removeListener("finish", onfinish); dest.removeListener("drain", ondrain); dest.removeListener("error", onerror); dest.removeListener("unpipe", onunpipe); src.removeListener("end", onend); src.removeListener("end", unpipe); src.removeListener("data", ondata); cleanedUp = true; if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); } var increasedAwaitDrain = false; src.on("data", ondata); function ondata(chunk) { debug("ondata"); increasedAwaitDrain = false; var ret2 = dest.write(chunk); if (ret2 === false && !increasedAwaitDrain) { if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { debug("false write response, pause", src._readableState.awaitDrain); src._readableState.awaitDrain++; increasedAwaitDrain = true; } src.pause(); } } function onerror(er) { debug("onerror", er); unpipe(); dest.removeListener("error", onerror); if (EElistenerCount(dest, "error") === 0) dest.emit("error", er); } prependListener(dest, "error", onerror); function onclose() { dest.removeListener("finish", onfinish); unpipe(); } dest.once("close", onclose); function onfinish() { debug("onfinish"); dest.removeListener("close", onclose); unpipe(); } dest.once("finish", onfinish); function unpipe() { debug("unpipe"); src.unpipe(dest); } dest.emit("pipe", src); if (!state.flowing) { debug("pipe resume"); src.resume(); } return dest; }; function pipeOnDrain(src) { return function() { var state = src._readableState; debug("pipeOnDrain", state.awaitDrain); if (state.awaitDrain) state.awaitDrain--; if (state.awaitDrain === 0 && EElistenerCount(src, "data")) { state.flowing = true; flow(src); } }; } Readable.prototype.unpipe = function(dest) { var state = this._readableState; var unpipeInfo = {hasUnpiped: false}; if (state.pipesCount === 0) return this; if (state.pipesCount === 1) { if (dest && dest !== state.pipes) return this; if (!dest) dest = state.pipes; state.pipes = null; state.pipesCount = 0; state.flowing = false; if (dest) dest.emit("unpipe", this, unpipeInfo); return this; } if (!dest) { var dests = state.pipes; var len = state.pipesCount; state.pipes = null; state.pipesCount = 0; state.flowing = false; for (var i = 0; i < len; i++) { dests[i].emit("unpipe", this, unpipeInfo); } return this; } var index = indexOf(state.pipes, dest); if (index === -1) return this; state.pipes.splice(index, 1); state.pipesCount -= 1; if (state.pipesCount === 1) state.pipes = state.pipes[0]; dest.emit("unpipe", this, unpipeInfo); return this; }; Readable.prototype.on = function(ev, fn) { var res = Stream.prototype.on.call(this, ev, fn); if (ev === "data") { if (this._readableState.flowing !== false) this.resume(); } else if (ev === "readable") { var state = this._readableState; if (!state.endEmitted && !state.readableListening) { state.readableListening = state.needReadable = true; state.emittedReadable = false; if (!state.reading) { pna.nextTick(nReadingNextTick, this); } else if (state.length) { emitReadable(this); } } } return res; }; Readable.prototype.addListener = Readable.prototype.on; function nReadingNextTick(self2) { debug("readable nexttick read 0"); self2.read(0); } Readable.prototype.resume = function() { var state = this._readableState; if (!state.flowing) { debug("resume"); state.flowing = true; resume(this, state); } return this; }; function resume(stream, state) { if (!state.resumeScheduled) { state.resumeScheduled = true; pna.nextTick(resume_, stream, state); } } function resume_(stream, state) { if (!state.reading) { debug("resume read 0"); stream.read(0); } state.resumeScheduled = false; state.awaitDrain = 0; stream.emit("resume"); flow(stream); if (state.flowing && !state.reading) stream.read(0); } Readable.prototype.pause = function() { debug("call pause flowing=%j", this._readableState.flowing); if (this._readableState.flowing !== false) { debug("pause"); this._readableState.flowing = false; this.emit("pause"); } return this; }; function flow(stream) { var state = stream._readableState; debug("flow", state.flowing); while (state.flowing && stream.read() !== null) { } } Readable.prototype.wrap = function(stream) { var _this = this; var state = this._readableState; var paused = false; stream.on("end", function() { debug("wrapped end"); if (state.decoder && !state.ended) { var chunk = state.decoder.end(); if (chunk && chunk.length) _this.push(chunk); } _this.push(null); }); stream.on("data", function(chunk) { debug("wrapped data"); if (state.decoder) chunk = state.decoder.write(chunk); if (state.objectMode && (chunk === null || chunk === void 0)) return; else if (!state.objectMode && (!chunk || !chunk.length)) return; var ret2 = _this.push(chunk); if (!ret2) { paused = true; stream.pause(); } }); for (var i in stream) { if (this[i] === void 0 && typeof stream[i] === "function") { this[i] = function(method) { return function() { return stream[method].apply(stream, arguments); }; }(i); } } for (var n = 0; n < kProxyEvents.length; n++) { stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); } this._read = function(n2) { debug("wrapped _read", n2); if (paused) { paused = false; stream.resume(); } }; return this; }; Object.defineProperty(Readable.prototype, "readableHighWaterMark", { enumerable: false, get: function() { return this._readableState.highWaterMark; } }); Readable._fromList = fromList; function fromList(n, state) { if (state.length === 0) return null; var ret2; if (state.objectMode) ret2 = state.buffer.shift(); else if (!n || n >= state.length) { if (state.decoder) ret2 = state.buffer.join(""); else if (state.buffer.length === 1) ret2 = state.buffer.head.data; else ret2 = state.buffer.concat(state.length); state.buffer.clear(); } else { ret2 = fromListPartial(n, state.buffer, state.decoder); } return ret2; } function fromListPartial(n, list, hasStrings) { var ret2; if (n < list.head.data.length) { ret2 = list.head.data.slice(0, n); list.head.data = list.head.data.slice(n); } else if (n === list.head.data.length) { ret2 = list.shift(); } else { ret2 = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); } return ret2; } function copyFromBufferString(n, list) { var p = list.head; var c = 1; var ret2 = p.data; n -= ret2.length; while (p = p.next) { var str = p.data; var nb = n > str.length ? str.length : n; if (nb === str.length) ret2 += str; else ret2 += str.slice(0, n); n -= nb; if (n === 0) { if (nb === str.length) { ++c; if (p.next) list.head = p.next; else list.head = list.tail = null; } else { list.head = p; p.data = str.slice(nb); } break; } ++c; } list.length -= c; return ret2; } function copyFromBuffer(n, list) { var ret2 = Buffer2.allocUnsafe(n); var p = list.head; var c = 1; p.data.copy(ret2); n -= p.data.length; while (p = p.next) { var buf = p.data; var nb = n > buf.length ? buf.length : n; buf.copy(ret2, ret2.length - n, 0, nb); n -= nb; if (n === 0) { if (nb === buf.length) { ++c; if (p.next) list.head = p.next; else list.head = list.tail = null; } else { list.head = p; p.data = buf.slice(nb); } break; } ++c; } list.length -= c; return ret2; } function endReadable(stream) { var state = stream._readableState; if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); if (!state.endEmitted) { state.ended = true; pna.nextTick(endReadableNT, state, stream); } } function endReadableNT(state, stream) { if (!state.endEmitted && state.length === 0) { state.endEmitted = true; stream.readable = false; stream.emit("end"); } } function indexOf(xs, x) { for (var i = 0, l = xs.length; i < l; i++) { if (xs[i] === x) return i; } return -1; } }); // node_modules/readable-stream/lib/_stream_transform.js var require_stream_transform = __commonJS((exports2, module2) => { "use strict"; module2.exports = Transform; var Duplex = require_stream_duplex(); var util = Object.create(require_util2()); util.inherits = require_inherits(); util.inherits(Transform, Duplex); function afterTransform(er, data) { var ts = this._transformState; ts.transforming = false; var cb = ts.writecb; if (!cb) { return this.emit("error", new Error("write callback called multiple times")); } ts.writechunk = null; ts.writecb = null; if (data != null) this.push(data); cb(er); var rs = this._readableState; rs.reading = false; if (rs.needReadable || rs.length < rs.highWaterMark) { this._read(rs.highWaterMark); } } function Transform(options) { if (!(this instanceof Transform)) return new Transform(options); Duplex.call(this, options); this._transformState = { afterTransform: afterTransform.bind(this), needTransform: false, transforming: false, writecb: null, writechunk: null, writeencoding: null }; this._readableState.needReadable = true; this._readableState.sync = false; if (options) { if (typeof options.transform === "function") this._transform = options.transform; if (typeof options.flush === "function") this._flush = options.flush; } this.on("prefinish", prefinish); } function prefinish() { var _this = this; if (typeof this._flush === "function") { this._flush(function(er, data) { done(_this, er, data); }); } else { done(this, null, null); } } Transform.prototype.push = function(chunk, encoding) { this._transformState.needTransform = false; return Duplex.prototype.push.call(this, chunk, encoding); }; Transform.prototype._transform = function(chunk, encoding, cb) { throw new Error("_transform() is not implemented"); }; Transform.prototype._write = function(chunk, encoding, cb) { var ts = this._transformState; ts.writecb = cb; ts.writechunk = chunk; ts.writeencoding = encoding; if (!ts.transforming) { var rs = this._readableState; if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); } }; Transform.prototype._read = function(n) { var ts = this._transformState; if (ts.writechunk !== null && ts.writecb && !ts.transforming) { ts.transforming = true; this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); } else { ts.needTransform = true; } }; Transform.prototype._destroy = function(err, cb) { var _this2 = this; Duplex.prototype._destroy.call(this, err, function(err2) { cb(err2); _this2.emit("close"); }); }; function done(stream, er, data) { if (er) return stream.emit("error", er); if (data != null) stream.push(data); if (stream._writableState.length) throw new Error("Calling transform done when ws.length != 0"); if (stream._transformState.transforming) throw new Error("Calling transform done when still transforming"); return stream.push(null); } }); // node_modules/readable-stream/lib/_stream_passthrough.js var require_stream_passthrough = __commonJS((exports2, module2) => { "use strict"; module2.exports = PassThrough; var Transform = require_stream_transform(); var util = Object.create(require_util2()); util.inherits = require_inherits(); util.inherits(PassThrough, Transform); function PassThrough(options) { if (!(this instanceof PassThrough)) return new PassThrough(options); Transform.call(this, options); } PassThrough.prototype._transform = function(chunk, encoding, cb) { cb(null, chunk); }; }); // node_modules/readable-stream/readable.js var require_readable = __commonJS((exports2, module2) => { var Stream = require("stream"); if (process.env.READABLE_STREAM === "disable" && Stream) { module2.exports = Stream; exports2 = module2.exports = Stream.Readable; exports2.Readable = Stream.Readable; exports2.Writable = Stream.Writable; exports2.Duplex = Stream.Duplex; exports2.Transform = Stream.Transform; exports2.PassThrough = Stream.PassThrough; exports2.Stream = Stream; } else { exports2 = module2.exports = require_stream_readable(); exports2.Stream = Stream || exports2; exports2.Readable = exports2; exports2.Writable = require_stream_writable(); exports2.Duplex = require_stream_duplex(); exports2.Transform = require_stream_transform(); exports2.PassThrough = require_stream_passthrough(); } }); // node_modules/unzipper/lib/PullStream.js var require_PullStream = __commonJS((exports2, module2) => { var Stream = require("stream"); var Promise2 = require_bluebird(); var util = require("util"); var Buffer2 = require_Buffer(); var strFunction = "function"; if (!Stream.Writable || !Stream.Writable.prototype.destroy) Stream = require_readable(); function PullStream() { if (!(this instanceof PullStream)) return new PullStream(); Stream.Duplex.call(this, {decodeStrings: false, objectMode: true}); this.buffer = Buffer2.from(""); var self2 = this; self2.on("finish", function() { self2.finished = true; self2.emit("chunk", false); }); } util.inherits(PullStream, Stream.Duplex); PullStream.prototype._write = function(chunk, e, cb) { this.buffer = Buffer2.concat([this.buffer, chunk]); this.cb = cb; this.emit("chunk"); }; PullStream.prototype.stream = function(eof, includeEof) { var p = Stream.PassThrough(); var done, self2 = this; function cb() { if (typeof self2.cb === strFunction) { var callback = self2.cb; self2.cb = void 0; return callback(); } } function pull() { var packet; if (self2.buffer && self2.buffer.length) { if (typeof eof === "number") { packet = self2.buffer.slice(0, eof); self2.buffer = self2.buffer.slice(eof); eof -= packet.length; done = !eof; } else { var match = self2.buffer.indexOf(eof); if (match !== -1) { self2.match = match; if (includeEof) match = match + eof.length; packet = self2.buffer.slice(0, match); self2.buffer = self2.buffer.slice(match); done = true; } else { var len = self2.buffer.length - eof.length; if (len <= 0) { cb(); } else { packet = self2.buffer.slice(0, len); self2.buffer = self2.buffer.slice(len); } } } if (packet) p.write(packet, function() { if (self2.buffer.length === 0 || eof.length && self2.buffer.length <= eof.length) cb(); }); } if (!done) { if (self2.finished && !this.__ended) { self2.removeListener("chunk", pull); self2.emit("error", new Error("FILE_ENDED")); this.__ended = true; return; } } else { self2.removeListener("chunk", pull); p.end(); } } self2.on("chunk", pull); pull(); return p; }; PullStream.prototype.pull = function(eof, includeEof) { if (eof === 0) return Promise2.resolve(""); if (!isNaN(eof) && this.buffer.length > eof) { var data = this.buffer.slice(0, eof); this.buffer = this.buffer.slice(eof); return Promise2.resolve(data); } var buffer = Buffer2.from(""), self2 = this; var concatStream = Stream.Transform(); concatStream._transform = function(d, e, cb) { buffer = Buffer2.concat([buffer, d]); cb(); }; var rejectHandler; var pullStreamRejectHandler; return new Promise2(function(resolve, reject) { rejectHandler = reject; pullStreamRejectHandler = function(e) { self2.__emittedError = e; reject(e); }; if (self2.finished) return reject(new Error("FILE_ENDED")); self2.once("error", pullStreamRejectHandler); self2.stream(eof, includeEof).on("error", reject).pipe(concatStream).on("finish", function() { resolve(buffer); }).on("error", reject); }).finally(function() { self2.removeListener("error", rejectHandler); self2.removeListener("error", pullStreamRejectHandler); }); }; PullStream.prototype._read = function() { }; module2.exports = PullStream; }); // node_modules/unzipper/lib/NoopStream.js var require_NoopStream = __commonJS((exports2, module2) => { var Stream = require("stream"); var util = require("util"); if (!Stream.Writable || !Stream.Writable.prototype.destroy) Stream = require_readable(); function NoopStream() { if (!(this instanceof NoopStream)) { return new NoopStream(); } Stream.Transform.call(this); } util.inherits(NoopStream, Stream.Transform); NoopStream.prototype._transform = function(d, e, cb) { cb(); }; module2.exports = NoopStream; }); // node_modules/unzipper/lib/BufferStream.js var require_BufferStream = __commonJS((exports2, module2) => { var Promise2 = require_bluebird(); var Stream = require("stream"); var Buffer2 = require_Buffer(); if (!Stream.Writable || !Stream.Writable.prototype.destroy) Stream = require_readable(); module2.exports = function(entry) { return new Promise2(function(resolve, reject) { var chunks = []; var bufferStream = Stream.Transform().on("finish", function() { resolve(Buffer2.concat(chunks)); }).on("error", reject); bufferStream._transform = function(d, e, cb) { chunks.push(d); cb(); }; entry.on("error", reject).pipe(bufferStream); }); }; }); // node_modules/unzipper/lib/parseExtraField.js var require_parseExtraField = __commonJS((exports2, module2) => { var binary = require_binary(); module2.exports = function(extraField, vars) { var extra; while (!extra && extraField && extraField.length) { var candidateExtra = binary.parse(extraField).word16lu("signature").word16lu("partsize").word64lu("uncompressedSize").word64lu("compressedSize").word64lu("offset").word64lu("disknum").vars; if (candidateExtra.signature === 1) { extra = candidateExtra; } else { extraField = extraField.slice(candidateExtra.partsize + 4); } } extra = extra || {}; if (vars.compressedSize === 4294967295) vars.compressedSize = extra.compressedSize; if (vars.uncompressedSize === 4294967295) vars.uncompressedSize = extra.uncompressedSize; if (vars.offsetToLocalFileHeader === 4294967295) vars.offsetToLocalFileHeader = extra.offset; return extra; }; }); // node_modules/unzipper/lib/parseDateTime.js var require_parseDateTime = __commonJS((exports2, module2) => { module2.exports = function parseDateTime(date, time) { const day = date & 31; const month = date >> 5 & 15; const year = (date >> 9 & 127) + 1980; const seconds = time ? (time & 31) * 2 : 0; const minutes = time ? time >> 5 & 63 : 0; const hours = time ? time >> 11 : 0; return new Date(Date.UTC(year, month - 1, day, hours, minutes, seconds)); }; }); // node_modules/unzipper/lib/parse.js var require_parse3 = __commonJS((exports2, module2) => { var util = require("util"); var zlib = require("zlib"); var Stream = require("stream"); var binary = require_binary(); var Promise2 = require_bluebird(); var PullStream = require_PullStream(); var NoopStream = require_NoopStream(); var BufferStream = require_BufferStream(); var parseExtraField = require_parseExtraField(); var Buffer2 = require_Buffer(); var parseDateTime = require_parseDateTime(); if (!Stream.Writable || !Stream.Writable.prototype.destroy) Stream = require_readable(); var endDirectorySignature = Buffer2.alloc(4); endDirectorySignature.writeUInt32LE(101010256, 0); function Parse(opts) { if (!(this instanceof Parse)) { return new Parse(opts); } var self2 = this; self2._opts = opts || {verbose: false}; PullStream.call(self2, self2._opts); self2.on("finish", function() { self2.emit("close"); }); self2._readRecord().catch(function(e) { if (!self2.__emittedError || self2.__emittedError !== e) self2.emit("error", e); }); } util.inherits(Parse, PullStream); Parse.prototype._readRecord = function() { var self2 = this; return self2.pull(4).then(function(data) { if (data.length === 0) return; var signature = data.readUInt32LE(0); if (signature === 875721283) { return self2._readCrxHeader(); } if (signature === 67324752) { return self2._readFile(); } else if (signature === 33639248) { self2.__ended = true; return self2._readCentralDirectoryFileHeader(); } else if (signature === 101010256) { return self2._readEndOfCentralDirectoryRecord(); } else if (self2.__ended) { return self2.pull(endDirectorySignature).then(function() { return self2._readEndOfCentralDirectoryRecord(); }); } else self2.emit("error", new Error("invalid signature: 0x" + signature.toString(16))); }); }; Parse.prototype._readCrxHeader = function() { var self2 = this; return self2.pull(12).then(function(data) { self2.crxHeader = binary.parse(data).word32lu("version").word32lu("pubKeyLength").word32lu("signatureLength").vars; return self2.pull(self2.crxHeader.pubKeyLength + self2.crxHeader.signatureLength); }).then(function(data) { self2.crxHeader.publicKey = data.slice(0, self2.crxHeader.pubKeyLength); self2.crxHeader.signature = data.slice(self2.crxHeader.pubKeyLength); self2.emit("crx-header", self2.crxHeader); return self2._readRecord(); }); }; Parse.prototype._readFile = function() { var self2 = this; return self2.pull(26).then(function(data) { var vars = binary.parse(data).word16lu("versionsNeededToExtract").word16lu("flags").word16lu("compressionMethod").word16lu("lastModifiedTime").word16lu("lastModifiedDate").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").word16lu("fileNameLength").word16lu("extraFieldLength").vars; vars.lastModifiedDateTime = parseDateTime(vars.lastModifiedDate, vars.lastModifiedTime); if (self2.crxHeader) vars.crxHeader = self2.crxHeader; return self2.pull(vars.fileNameLength).then(function(fileNameBuffer) { var fileName = fileNameBuffer.toString("utf8"); var entry = Stream.PassThrough(); var __autodraining = false; entry.autodrain = function() { __autodraining = true; var draining = entry.pipe(NoopStream()); draining.promise = function() { return new Promise2(function(resolve, reject) { draining.on("finish", resolve); draining.on("error", reject); }); }; return draining; }; entry.buffer = function() { return BufferStream(entry); }; entry.path = fileName; entry.props = {}; entry.props.path = fileName; entry.props.pathBuffer = fileNameBuffer; entry.props.flags = { isUnicode: vars.flags & 17 }; entry.type = vars.uncompressedSize === 0 && /[\/\\]$/.test(fileName) ? "Directory" : "File"; if (self2._opts.verbose) { if (entry.type === "Directory") { console.log(" creating:", fileName); } else if (entry.type === "File") { if (vars.compressionMethod === 0) { console.log(" extracting:", fileName); } else { console.log(" inflating:", fileName); } } } return self2.pull(vars.extraFieldLength).then(function(extraField) { var extra = parseExtraField(extraField, vars); entry.vars = vars; entry.extra = extra; if (self2._opts.forceStream) { self2.push(entry); } else { self2.emit("entry", entry); if (self2._readableState.pipesCount || self2._readableState.pipes && self2._readableState.pipes.length) self2.push(entry); } if (self2._opts.verbose) console.log({ filename: fileName, vars, extra }); var fileSizeKnown = !(vars.flags & 8) || vars.compressedSize > 0, eof; entry.__autodraining = __autodraining; var inflater = vars.compressionMethod && !__autodraining ? zlib.createInflateRaw() : Stream.PassThrough(); if (fileSizeKnown) { entry.size = vars.uncompressedSize; eof = vars.compressedSize; } else { eof = Buffer2.alloc(4); eof.writeUInt32LE(134695760, 0); } return new Promise2(function(resolve, reject) { self2.stream(eof).pipe(inflater).on("error", function(err) { self2.emit("error", err); }).pipe(entry).on("finish", function() { return fileSizeKnown ? self2._readRecord().then(resolve).catch(reject) : self2._processDataDescriptor(entry).then(resolve).catch(reject); }); }); }); }); }); }; Parse.prototype._processDataDescriptor = function(entry) { var self2 = this; return self2.pull(16).then(function(data) { var vars = binary.parse(data).word32lu("dataDescriptorSignature").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").vars; entry.size = vars.uncompressedSize; return self2._readRecord(); }); }; Parse.prototype._readCentralDirectoryFileHeader = function() { var self2 = this; return self2.pull(42).then(function(data) { var vars = binary.parse(data).word16lu("versionMadeBy").word16lu("versionsNeededToExtract").word16lu("flags").word16lu("compressionMethod").word16lu("lastModifiedTime").word16lu("lastModifiedDate").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").word16lu("fileNameLength").word16lu("extraFieldLength").word16lu("fileCommentLength").word16lu("diskNumber").word16lu("internalFileAttributes").word32lu("externalFileAttributes").word32lu("offsetToLocalFileHeader").vars; return self2.pull(vars.fileNameLength).then(function(fileName) { vars.fileName = fileName.toString("utf8"); return self2.pull(vars.extraFieldLength); }).then(function(extraField) { return self2.pull(vars.fileCommentLength); }).then(function(fileComment) { return self2._readRecord(); }); }); }; Parse.prototype._readEndOfCentralDirectoryRecord = function() { var self2 = this; return self2.pull(18).then(function(data) { var vars = binary.parse(data).word16lu("diskNumber").word16lu("diskStart").word16lu("numberOfRecordsOnDisk").word16lu("numberOfRecords").word32lu("sizeOfCentralDirectory").word32lu("offsetToStartOfCentralDirectory").word16lu("commentLength").vars; return self2.pull(vars.commentLength).then(function(comment) { comment = comment.toString("utf8"); self2.end(); self2.push(null); }); }); }; Parse.prototype.promise = function() { var self2 = this; return new Promise2(function(resolve, reject) { self2.on("finish", resolve); self2.on("error", reject); }); }; module2.exports = Parse; }); // node_modules/duplexer2/index.js var require_duplexer2 = __commonJS((exports2, module2) => { "use strict"; var stream = require_readable(); function DuplexWrapper(options, writable, readable) { if (typeof readable === "undefined") { readable = writable; writable = options; options = null; } stream.Duplex.call(this, options); if (typeof readable.read !== "function") { readable = new stream.Readable(options).wrap(readable); } this._writable = writable; this._readable = readable; this._waiting = false; var self2 = this; writable.once("finish", function() { self2.end(); }); this.once("finish", function() { writable.end(); }); readable.on("readable", function() { if (self2._waiting) { self2._waiting = false; self2._read(); } }); readable.once("end", function() { self2.push(null); }); if (!options || typeof options.bubbleErrors === "undefined" || options.bubbleErrors) { writable.on("error", function(err) { self2.emit("error", err); }); readable.on("error", function(err) { self2.emit("error", err); }); } } DuplexWrapper.prototype = Object.create(stream.Duplex.prototype, {constructor: {value: DuplexWrapper}}); DuplexWrapper.prototype._write = function _write(input, encoding, done) { this._writable.write(input, encoding, done); }; DuplexWrapper.prototype._read = function _read() { var buf; var reads = 0; while ((buf = this._readable.read()) !== null) { this.push(buf); reads++; } if (reads === 0) { this._waiting = true; } }; module2.exports = function duplex2(options, writable, readable) { return new DuplexWrapper(options, writable, readable); }; module2.exports.DuplexWrapper = DuplexWrapper; }); // node_modules/unzipper/lib/parseOne.js var require_parseOne = __commonJS((exports2, module2) => { var Stream = require("stream"); var Parse = require_parse3(); var duplexer2 = require_duplexer2(); var BufferStream = require_BufferStream(); if (!Stream.Writable || !Stream.Writable.prototype.destroy) Stream = require_readable(); function parseOne(match, opts) { var inStream = Stream.PassThrough({objectMode: true}); var outStream = Stream.PassThrough(); var transform = Stream.Transform({objectMode: true}); var re = match instanceof RegExp ? match : match && new RegExp(match); var found; transform._transform = function(entry, e, cb) { if (found || re && !re.exec(entry.path)) { entry.autodrain(); return cb(); } else { found = true; out.emit("entry", entry); entry.on("error", function(e2) { outStream.emit("error", e2); }); entry.pipe(outStream).on("error", function(err) { cb(err); }).on("finish", function(d) { cb(null, d); }); } }; inStream.pipe(Parse(opts)).on("error", function(err) { outStream.emit("error", err); }).pipe(transform).on("error", Object).on("finish", function() { if (!found) outStream.emit("error", new Error("PATTERN_NOT_FOUND")); else outStream.end(); }); var out = duplexer2(inStream, outStream); out.buffer = function() { return BufferStream(outStream); }; return out; } module2.exports = parseOne; }); // node_modules/fstream/lib/abstract.js var require_abstract = __commonJS((exports2, module2) => { module2.exports = Abstract; var Stream = require("stream").Stream; var inherits2 = require_inherits(); function Abstract() { Stream.call(this); } inherits2(Abstract, Stream); Abstract.prototype.on = function(ev, fn) { if (ev === "ready" && this.ready) { process.nextTick(fn.bind(this)); } else { Stream.prototype.on.call(this, ev, fn); } return this; }; Abstract.prototype.abort = function() { this._aborted = true; this.emit("abort"); }; Abstract.prototype.destroy = function() { }; Abstract.prototype.warn = function(msg, code) { var self2 = this; var er = decorate(msg, code, self2); if (!self2.listeners("warn")) { console.error("%s %s\npath = %s\nsyscall = %s\nfstream_type = %s\nfstream_path = %s\nfstream_unc_path = %s\nfstream_class = %s\nfstream_stack =\n%s\n", code || "UNKNOWN", er.stack, er.path, er.syscall, er.fstream_type, er.fstream_path, er.fstream_unc_path, er.fstream_class, er.fstream_stack.join("\n")); } else { self2.emit("warn", er); } }; Abstract.prototype.info = function(msg, code) { this.emit("info", msg, code); }; Abstract.prototype.error = function(msg, code, th) { var er = decorate(msg, code, this); if (th) throw er; else this.emit("error", er); }; function decorate(er, code, self2) { if (!(er instanceof Error)) er = new Error(er); er.code = er.code || code; er.path = er.path || self2.path; er.fstream_type = er.fstream_type || self2.type; er.fstream_path = er.fstream_path || self2.path; if (self2._path !== self2.path) { er.fstream_unc_path = er.fstream_unc_path || self2._path; } if (self2.linkpath) { er.fstream_linkpath = er.fstream_linkpath || self2.linkpath; } er.fstream_class = er.fstream_class || self2.constructor.name; er.fstream_stack = er.fstream_stack || new Error().stack.split(/\n/).slice(3).map(function(s) { return s.replace(/^ {4}at /, ""); }); return er; } }); // node_modules/graceful-fs/polyfills.js var require_polyfills = __commonJS((exports2, module2) => { var constants = require("constants"); var origCwd = process.cwd; var cwd = null; var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform; process.cwd = function() { if (!cwd) cwd = origCwd.call(process); return cwd; }; try { process.cwd(); } catch (er) { } var chdir = process.chdir; process.chdir = function(d) { cwd = null; chdir.call(process, d); }; module2.exports = patch; function patch(fs) { if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { patchLchmod(fs); } if (!fs.lutimes) { patchLutimes(fs); } fs.chown = chownFix(fs.chown); fs.fchown = chownFix(fs.fchown); fs.lchown = chownFix(fs.lchown); fs.chmod = chmodFix(fs.chmod); fs.fchmod = chmodFix(fs.fchmod); fs.lchmod = chmodFix(fs.lchmod); fs.chownSync = chownFixSync(fs.chownSync); fs.fchownSync = chownFixSync(fs.fchownSync); fs.lchownSync = chownFixSync(fs.lchownSync); fs.chmodSync = chmodFixSync(fs.chmodSync); fs.fchmodSync = chmodFixSync(fs.fchmodSync); fs.lchmodSync = chmodFixSync(fs.lchmodSync); fs.stat = statFix(fs.stat); fs.fstat = statFix(fs.fstat); fs.lstat = statFix(fs.lstat); fs.statSync = statFixSync(fs.statSync); fs.fstatSync = statFixSync(fs.fstatSync); fs.lstatSync = statFixSync(fs.lstatSync); if (!fs.lchmod) { fs.lchmod = function(path, mode, cb) { if (cb) process.nextTick(cb); }; fs.lchmodSync = function() { }; } if (!fs.lchown) { fs.lchown = function(path, uid, gid, cb) { if (cb) process.nextTick(cb); }; fs.lchownSync = function() { }; } if (platform === "win32") { fs.rename = function(fs$rename) { return function(from, to, cb) { var start = Date.now(); var backoff = 0; fs$rename(from, to, function CB(er) { if (er && (er.code === "EACCES" || er.code === "EPERM") && Date.now() - start < 6e4) { setTimeout(function() { fs.stat(to, function(stater, st) { if (stater && stater.code === "ENOENT") fs$rename(from, to, CB); else cb(er); }); }, backoff); if (backoff < 100) backoff += 10; return; } if (cb) cb(er); }); }; }(fs.rename); } fs.read = function(fs$read) { function read(fd, buffer, offset, length, position, callback_) { var callback; if (callback_ && typeof callback_ === "function") { var eagCounter = 0; callback = function(er, _, __) { if (er && er.code === "EAGAIN" && eagCounter < 10) { eagCounter++; return fs$read.call(fs, fd, buffer, offset, length, position, callback); } callback_.apply(this, arguments); }; } return fs$read.call(fs, fd, buffer, offset, length, position, callback); } read.__proto__ = fs$read; return read; }(fs.read); fs.readSync = function(fs$readSync) { return function(fd, buffer, offset, length, position) { var eagCounter = 0; while (true) { try { return fs$readSync.call(fs, fd, buffer, offset, length, position); } catch (er) { if (er.code === "EAGAIN" && eagCounter < 10) { eagCounter++; continue; } throw er; } } }; }(fs.readSync); function patchLchmod(fs2) { fs2.lchmod = function(path, mode, callback) { fs2.open(path, constants.O_WRONLY | constants.O_SYMLINK, mode, function(err, fd) { if (err) { if (callback) callback(err); return; } fs2.fchmod(fd, mode, function(err2) { fs2.close(fd, function(err22) { if (callback) callback(err2 || err22); }); }); }); }; fs2.lchmodSync = function(path, mode) { var fd = fs2.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode); var threw = true; var ret2; try { ret2 = fs2.fchmodSync(fd, mode); threw = false; } finally { if (threw) { try { fs2.closeSync(fd); } catch (er) { } } else { fs2.closeSync(fd); } } return ret2; }; } function patchLutimes(fs2) { if (constants.hasOwnProperty("O_SYMLINK")) { fs2.lutimes = function(path, at, mt, cb) { fs2.open(path, constants.O_SYMLINK, function(er, fd) { if (er) { if (cb) cb(er); return; } fs2.futimes(fd, at, mt, function(er2) { fs2.close(fd, function(er22) { if (cb) cb(er2 || er22); }); }); }); }; fs2.lutimesSync = function(path, at, mt) { var fd = fs2.openSync(path, constants.O_SYMLINK); var ret2; var threw = true; try { ret2 = fs2.futimesSync(fd, at, mt); threw = false; } finally { if (threw) { try { fs2.closeSync(fd); } catch (er) { } } else { fs2.closeSync(fd); } } return ret2; }; } else { fs2.lutimes = function(_a, _b, _c, cb) { if (cb) process.nextTick(cb); }; fs2.lutimesSync = function() { }; } } function chmodFix(orig) { if (!orig) return orig; return function(target, mode, cb) { return orig.call(fs, target, mode, function(er) { if (chownErOk(er)) er = null; if (cb) cb.apply(this, arguments); }); }; } function chmodFixSync(orig) { if (!orig) return orig; return function(target, mode) { try { return orig.call(fs, target, mode); } catch (er) { if (!chownErOk(er)) throw er; } }; } function chownFix(orig) { if (!orig) return orig; return function(target, uid, gid, cb) { return orig.call(fs, target, uid, gid, function(er) { if (chownErOk(er)) er = null; if (cb) cb.apply(this, arguments); }); }; } function chownFixSync(orig) { if (!orig) return orig; return function(target, uid, gid) { try { return orig.call(fs, target, uid, gid); } catch (er) { if (!chownErOk(er)) throw er; } }; } function statFix(orig) { if (!orig) return orig; return function(target, options, cb) { if (typeof options === "function") { cb = options; options = null; } function callback(er, stats) { if (stats) { if (stats.uid < 0) stats.uid += 4294967296; if (stats.gid < 0) stats.gid += 4294967296; } if (cb) cb.apply(this, arguments); } return options ? orig.call(fs, target, options, callback) : orig.call(fs, target, callback); }; } function statFixSync(orig) { if (!orig) return orig; return function(target, options) { var stats = options ? orig.call(fs, target, options) : orig.call(fs, target); if (stats.uid < 0) stats.uid += 4294967296; if (stats.gid < 0) stats.gid += 4294967296; return stats; }; } function chownErOk(er) { if (!er) return true; if (er.code === "ENOSYS") return true; var nonroot = !process.getuid || process.getuid() !== 0; if (nonroot) { if (er.code === "EINVAL" || er.code === "EPERM") return true; } return false; } } }); // node_modules/graceful-fs/legacy-streams.js var require_legacy_streams = __commonJS((exports2, module2) => { var Stream = require("stream").Stream; module2.exports = legacy; function legacy(fs) { return { ReadStream, WriteStream }; function ReadStream(path, options) { if (!(this instanceof ReadStream)) return new ReadStream(path, options); Stream.call(this); var self2 = this; this.path = path; this.fd = null; this.readable = true; this.paused = false; this.flags = "r"; this.mode = 438; this.bufferSize = 64 * 1024; options = options || {}; var keys = Object.keys(options); for (var index = 0, length = keys.length; index < length; index++) { var key = keys[index]; this[key] = options[key]; } if (this.encoding) this.setEncoding(this.encoding); if (this.start !== void 0) { if (typeof this.start !== "number") { throw TypeError("start must be a Number"); } if (this.end === void 0) { this.end = Infinity; } else if (typeof this.end !== "number") { throw TypeError("end must be a Number"); } if (this.start > this.end) { throw new Error("start must be <= end"); } this.pos = this.start; } if (this.fd !== null) { process.nextTick(function() { self2._read(); }); return; } fs.open(this.path, this.flags, this.mode, function(err, fd) { if (err) { self2.emit("error", err); self2.readable = false; return; } self2.fd = fd; self2.emit("open", fd); self2._read(); }); } function WriteStream(path, options) { if (!(this instanceof WriteStream)) return new WriteStream(path, options); Stream.call(this); this.path = path; this.fd = null; this.writable = true; this.flags = "w"; this.encoding = "binary"; this.mode = 438; this.bytesWritten = 0; options = options || {}; var keys = Object.keys(options); for (var index = 0, length = keys.length; index < length; index++) { var key = keys[index]; this[key] = options[key]; } if (this.start !== void 0) { if (typeof this.start !== "number") { throw TypeError("start must be a Number"); } if (this.start < 0) { throw new Error("start must be >= zero"); } this.pos = this.start; } this.busy = false; this._queue = []; if (this.fd === null) { this._open = fs.open; this._queue.push([this._open, this.path, this.flags, this.mode, void 0]); this.flush(); } } } }); // node_modules/graceful-fs/clone.js var require_clone = __commonJS((exports2, module2) => { "use strict"; module2.exports = clone; function clone(obj) { if (obj === null || typeof obj !== "object") return obj; if (obj instanceof Object) var copy = {__proto__: obj.__proto__}; else var copy = Object.create(null); Object.getOwnPropertyNames(obj).forEach(function(key) { Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)); }); return copy; } }); // node_modules/graceful-fs/graceful-fs.js var require_graceful_fs = __commonJS((exports2, module2) => { var fs = require("fs"); var polyfills = require_polyfills(); var legacy = require_legacy_streams(); var clone = require_clone(); var util = require("util"); var gracefulQueue; var previousSymbol; if (typeof Symbol === "function" && typeof Symbol.for === "function") { gracefulQueue = Symbol.for("graceful-fs.queue"); previousSymbol = Symbol.for("graceful-fs.previous"); } else { gracefulQueue = "___graceful-fs.queue"; previousSymbol = "___graceful-fs.previous"; } function noop() { } function publishQueue(context, queue2) { Object.defineProperty(context, gracefulQueue, { get: function() { return queue2; } }); } var debug = noop; if (util.debuglog) debug = util.debuglog("gfs4"); else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) debug = function() { var m = util.format.apply(util, arguments); m = "GFS4: " + m.split(/\n/).join("\nGFS4: "); console.error(m); }; if (!fs[gracefulQueue]) { queue = global[gracefulQueue] || []; publishQueue(fs, queue); fs.close = function(fs$close) { function close(fd, cb) { return fs$close.call(fs, fd, function(err) { if (!err) { retry(); } if (typeof cb === "function") cb.apply(this, arguments); }); } Object.defineProperty(close, previousSymbol, { value: fs$close }); return close; }(fs.close); fs.closeSync = function(fs$closeSync) { function closeSync(fd) { fs$closeSync.apply(fs, arguments); retry(); } Object.defineProperty(closeSync, previousSymbol, { value: fs$closeSync }); return closeSync; }(fs.closeSync); if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) { process.on("exit", function() { debug(fs[gracefulQueue]); require("assert").equal(fs[gracefulQueue].length, 0); }); } } var queue; if (!global[gracefulQueue]) { publishQueue(global, fs[gracefulQueue]); } module2.exports = patch(clone(fs)); if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) { module2.exports = patch(fs); fs.__patched = true; } function patch(fs2) { polyfills(fs2); fs2.gracefulify = patch; fs2.createReadStream = createReadStream; fs2.createWriteStream = createWriteStream; var fs$readFile = fs2.readFile; fs2.readFile = readFile; function readFile(path, options, cb) { if (typeof options === "function") cb = options, options = null; return go$readFile(path, options, cb); function go$readFile(path2, options2, cb2) { return fs$readFile(path2, options2, function(err) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([go$readFile, [path2, options2, cb2]]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); retry(); } }); } } var fs$writeFile = fs2.writeFile; fs2.writeFile = writeFile; function writeFile(path, data, options, cb) { if (typeof options === "function") cb = options, options = null; return go$writeFile(path, data, options, cb); function go$writeFile(path2, data2, options2, cb2) { return fs$writeFile(path2, data2, options2, function(err) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([go$writeFile, [path2, data2, options2, cb2]]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); retry(); } }); } } var fs$appendFile = fs2.appendFile; if (fs$appendFile) fs2.appendFile = appendFile; function appendFile(path, data, options, cb) { if (typeof options === "function") cb = options, options = null; return go$appendFile(path, data, options, cb); function go$appendFile(path2, data2, options2, cb2) { return fs$appendFile(path2, data2, options2, function(err) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([go$appendFile, [path2, data2, options2, cb2]]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); retry(); } }); } } var fs$readdir = fs2.readdir; fs2.readdir = readdir; function readdir(path, options, cb) { var args = [path]; if (typeof options !== "function") { args.push(options); } else { cb = options; } args.push(go$readdir$cb); return go$readdir(args); function go$readdir$cb(err, files) { if (files && files.sort) files.sort(); if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([go$readdir, [args]]); else { if (typeof cb === "function") cb.apply(this, arguments); retry(); } } } function go$readdir(args) { return fs$readdir.apply(fs2, args); } if (process.version.substr(0, 4) === "v0.8") { var legStreams = legacy(fs2); ReadStream = legStreams.ReadStream; WriteStream = legStreams.WriteStream; } var fs$ReadStream = fs2.ReadStream; if (fs$ReadStream) { ReadStream.prototype = Object.create(fs$ReadStream.prototype); ReadStream.prototype.open = ReadStream$open; } var fs$WriteStream = fs2.WriteStream; if (fs$WriteStream) { WriteStream.prototype = Object.create(fs$WriteStream.prototype); WriteStream.prototype.open = WriteStream$open; } Object.defineProperty(fs2, "ReadStream", { get: function() { return ReadStream; }, set: function(val) { ReadStream = val; }, enumerable: true, configurable: true }); Object.defineProperty(fs2, "WriteStream", { get: function() { return WriteStream; }, set: function(val) { WriteStream = val; }, enumerable: true, configurable: true }); var FileReadStream = ReadStream; Object.defineProperty(fs2, "FileReadStream", { get: function() { return FileReadStream; }, set: function(val) { FileReadStream = val; }, enumerable: true, configurable: true }); var FileWriteStream = WriteStream; Object.defineProperty(fs2, "FileWriteStream", { get: function() { return FileWriteStream; }, set: function(val) { FileWriteStream = val; }, enumerable: true, configurable: true }); function ReadStream(path, options) { if (this instanceof ReadStream) return fs$ReadStream.apply(this, arguments), this; else return ReadStream.apply(Object.create(ReadStream.prototype), arguments); } function ReadStream$open() { var that = this; open(that.path, that.flags, that.mode, function(err, fd) { if (err) { if (that.autoClose) that.destroy(); that.emit("error", err); } else { that.fd = fd; that.emit("open", fd); that.read(); } }); } function WriteStream(path, options) { if (this instanceof WriteStream) return fs$WriteStream.apply(this, arguments), this; else return WriteStream.apply(Object.create(WriteStream.prototype), arguments); } function WriteStream$open() { var that = this; open(that.path, that.flags, that.mode, function(err, fd) { if (err) { that.destroy(); that.emit("error", err); } else { that.fd = fd; that.emit("open", fd); } }); } function createReadStream(path, options) { return new fs2.ReadStream(path, options); } function createWriteStream(path, options) { return new fs2.WriteStream(path, options); } var fs$open = fs2.open; fs2.open = open; function open(path, flags, mode, cb) { if (typeof mode === "function") cb = mode, mode = null; return go$open(path, flags, mode, cb); function go$open(path2, flags2, mode2, cb2) { return fs$open(path2, flags2, mode2, function(err, fd) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([go$open, [path2, flags2, mode2, cb2]]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); retry(); } }); } } return fs2; } function enqueue(elem) { debug("ENQUEUE", elem[0].name, elem[1]); fs[gracefulQueue].push(elem); } function retry() { var elem = fs[gracefulQueue].shift(); if (elem) { debug("RETRY", elem[0].name, elem[1]); elem[0].apply(null, elem[1]); } } }); // node_modules/fstream/lib/get-type.js var require_get_type = __commonJS((exports2, module2) => { module2.exports = getType; function getType(st) { var types = [ "Directory", "File", "SymbolicLink", "Link", "BlockDevice", "CharacterDevice", "FIFO", "Socket" ]; var type; if (st.type && types.indexOf(st.type) !== -1) { st[st.type] = true; return st.type; } for (var i = 0, l = types.length; i < l; i++) { type = types[i]; var is = st[type] || st["is" + type]; if (typeof is === "function") is = is.call(st); if (is) { st[type] = true; st.type = type; return type; } } return null; } }); // node_modules/fstream/lib/link-reader.js var require_link_reader = __commonJS((exports2, module2) => { module2.exports = LinkReader; var fs = require_graceful_fs(); var inherits2 = require_inherits(); var Reader = require_reader(); inherits2(LinkReader, Reader); function LinkReader(props) { var self2 = this; if (!(self2 instanceof LinkReader)) { throw new Error("LinkReader must be called as constructor."); } if (!(props.type === "Link" && props.Link || props.type === "SymbolicLink" && props.SymbolicLink)) { throw new Error("Non-link type " + props.type); } Reader.call(self2, props); } LinkReader.prototype._stat = function(currentStat) { var self2 = this; fs.readlink(self2._path, function(er, linkpath) { if (er) return self2.error(er); self2.linkpath = self2.props.linkpath = linkpath; self2.emit("linkpath", linkpath); Reader.prototype._stat.call(self2, currentStat); }); }; LinkReader.prototype._read = function() { var self2 = this; if (self2._paused) return; if (!self2._ended) { self2.emit("end"); self2.emit("close"); self2._ended = true; } }; }); // node_modules/fstream/lib/dir-reader.js var require_dir_reader = __commonJS((exports2, module2) => { module2.exports = DirReader; var fs = require_graceful_fs(); var inherits2 = require_inherits(); var path = require("path"); var Reader = require_reader(); var assert = require("assert").ok; inherits2(DirReader, Reader); function DirReader(props) { var self2 = this; if (!(self2 instanceof DirReader)) { throw new Error("DirReader must be called as constructor."); } if (props.type !== "Directory" || !props.Directory) { throw new Error("Non-directory type " + props.type); } self2.entries = null; self2._index = -1; self2._paused = false; self2._length = -1; if (props.sort) { this.sort = props.sort; } Reader.call(this, props); } DirReader.prototype._getEntries = function() { var self2 = this; if (self2._gotEntries) return; self2._gotEntries = true; fs.readdir(self2._path, function(er, entries) { if (er) return self2.error(er); self2.entries = entries; self2.emit("entries", entries); if (self2._paused) self2.once("resume", processEntries); else processEntries(); function processEntries() { self2._length = self2.entries.length; if (typeof self2.sort === "function") { self2.entries = self2.entries.sort(self2.sort.bind(self2)); } self2._read(); } }); }; DirReader.prototype._read = function() { var self2 = this; if (!self2.entries) return self2._getEntries(); if (self2._paused || self2._currentEntry || self2._aborted) { return; } self2._index++; if (self2._index >= self2.entries.length) { if (!self2._ended) { self2._ended = true; self2.emit("end"); self2.emit("close"); } return; } var p = path.resolve(self2._path, self2.entries[self2._index]); assert(p !== self2._path); assert(self2.entries[self2._index]); self2._currentEntry = p; fs[self2.props.follow ? "stat" : "lstat"](p, function(er, stat) { if (er) return self2.error(er); var who = self2._proxy || self2; stat.path = p; stat.basename = path.basename(p); stat.dirname = path.dirname(p); var childProps = self2.getChildProps.call(who, stat); childProps.path = p; childProps.basename = path.basename(p); childProps.dirname = path.dirname(p); var entry = Reader(childProps, stat); self2._currentEntry = entry; entry.on("pause", function(who2) { if (!self2._paused && !entry._disowned) { self2.pause(who2); } }); entry.on("resume", function(who2) { if (self2._paused && !entry._disowned) { self2.resume(who2); } }); entry.on("stat", function(props) { self2.emit("_entryStat", entry, props); if (entry._aborted) return; if (entry._paused) { entry.once("resume", function() { self2.emit("entryStat", entry, props); }); } else self2.emit("entryStat", entry, props); }); entry.on("ready", function EMITCHILD() { if (self2._paused) { entry.pause(self2); return self2.once("resume", EMITCHILD); } if (entry.type === "Socket") { self2.emit("socket", entry); } else { self2.emitEntry(entry); } }); var ended = false; entry.on("close", onend); entry.on("disown", onend); function onend() { if (ended) return; ended = true; self2.emit("childEnd", entry); self2.emit("entryEnd", entry); self2._currentEntry = null; if (!self2._paused) { self2._read(); } } entry.on("error", function(er2) { if (entry._swallowErrors) { self2.warn(er2); entry.emit("end"); entry.emit("close"); } else { self2.emit("error", er2); } }); [ "child", "childEnd", "warn" ].forEach(function(ev) { entry.on(ev, self2.emit.bind(self2, ev)); }); }); }; DirReader.prototype.disown = function(entry) { entry.emit("beforeDisown"); entry._disowned = true; entry.parent = entry.root = null; if (entry === this._currentEntry) { this._currentEntry = null; } entry.emit("disown"); }; DirReader.prototype.getChildProps = function() { return { depth: this.depth + 1, root: this.root || this, parent: this, follow: this.follow, filter: this.filter, sort: this.props.sort, hardlinks: this.props.hardlinks }; }; DirReader.prototype.pause = function(who) { var self2 = this; if (self2._paused) return; who = who || self2; self2._paused = true; if (self2._currentEntry && self2._currentEntry.pause) { self2._currentEntry.pause(who); } self2.emit("pause", who); }; DirReader.prototype.resume = function(who) { var self2 = this; if (!self2._paused) return; who = who || self2; self2._paused = false; self2.emit("resume", who); if (self2._paused) { return; } if (self2._currentEntry) { if (self2._currentEntry.resume) self2._currentEntry.resume(who); } else self2._read(); }; DirReader.prototype.emitEntry = function(entry) { this.emit("entry", entry); this.emit("child", entry); }; }); // node_modules/fstream/lib/file-reader.js var require_file_reader = __commonJS((exports2, module2) => { module2.exports = FileReader; var fs = require_graceful_fs(); var inherits2 = require_inherits(); var Reader = require_reader(); var EOF = {EOF: true}; var CLOSE = {CLOSE: true}; inherits2(FileReader, Reader); function FileReader(props) { var self2 = this; if (!(self2 instanceof FileReader)) { throw new Error("FileReader must be called as constructor."); } if (!(props.type === "Link" && props.Link || props.type === "File" && props.File)) { throw new Error("Non-file type " + props.type); } self2._buffer = []; self2._bytesEmitted = 0; Reader.call(self2, props); } FileReader.prototype._getStream = function() { var self2 = this; var stream = self2._stream = fs.createReadStream(self2._path, self2.props); if (self2.props.blksize) { stream.bufferSize = self2.props.blksize; } stream.on("open", self2.emit.bind(self2, "open")); stream.on("data", function(c) { self2._bytesEmitted += c.length; if (!c.length) { return; } else if (self2._paused || self2._buffer.length) { self2._buffer.push(c); self2._read(); } else self2.emit("data", c); }); stream.on("end", function() { if (self2._paused || self2._buffer.length) { self2._buffer.push(EOF); self2._read(); } else { self2.emit("end"); } if (self2._bytesEmitted !== self2.props.size) { self2.error("Didn't get expected byte count\nexpect: " + self2.props.size + "\nactual: " + self2._bytesEmitted); } }); stream.on("close", function() { if (self2._paused || self2._buffer.length) { self2._buffer.push(CLOSE); self2._read(); } else { self2.emit("close"); } }); stream.on("error", function(e) { self2.emit("error", e); }); self2._read(); }; FileReader.prototype._read = function() { var self2 = this; if (self2._paused) { return; } if (!self2._stream) { return self2._getStream(); } if (self2._buffer.length) { var buf = self2._buffer; for (var i = 0, l = buf.length; i < l; i++) { var c = buf[i]; if (c === EOF) { self2.emit("end"); } else if (c === CLOSE) { self2.emit("close"); } else { self2.emit("data", c); } if (self2._paused) { self2._buffer = buf.slice(i); return; } } self2._buffer.length = 0; } }; FileReader.prototype.pause = function(who) { var self2 = this; if (self2._paused) return; who = who || self2; self2._paused = true; if (self2._stream) self2._stream.pause(); self2.emit("pause", who); }; FileReader.prototype.resume = function(who) { var self2 = this; if (!self2._paused) return; who = who || self2; self2.emit("resume", who); self2._paused = false; if (self2._stream) self2._stream.resume(); self2._read(); }; }); // node_modules/fstream/lib/socket-reader.js var require_socket_reader = __commonJS((exports2, module2) => { module2.exports = SocketReader; var inherits2 = require_inherits(); var Reader = require_reader(); inherits2(SocketReader, Reader); function SocketReader(props) { var self2 = this; if (!(self2 instanceof SocketReader)) { throw new Error("SocketReader must be called as constructor."); } if (!(props.type === "Socket" && props.Socket)) { throw new Error("Non-socket type " + props.type); } Reader.call(self2, props); } SocketReader.prototype._read = function() { var self2 = this; if (self2._paused) return; if (!self2._ended) { self2.emit("end"); self2.emit("close"); self2._ended = true; } }; }); // node_modules/fstream/lib/proxy-reader.js var require_proxy_reader = __commonJS((exports2, module2) => { module2.exports = ProxyReader; var Reader = require_reader(); var getType = require_get_type(); var inherits2 = require_inherits(); var fs = require_graceful_fs(); inherits2(ProxyReader, Reader); function ProxyReader(props) { var self2 = this; if (!(self2 instanceof ProxyReader)) { throw new Error("ProxyReader must be called as constructor."); } self2.props = props; self2._buffer = []; self2.ready = false; Reader.call(self2, props); } ProxyReader.prototype._stat = function() { var self2 = this; var props = self2.props; var stat = props.follow ? "stat" : "lstat"; fs[stat](props.path, function(er, current) { var type; if (er || !current) { type = "File"; } else { type = getType(current); } props[type] = true; props.type = self2.type = type; self2._old = current; self2._addProxy(Reader(props, current)); }); }; ProxyReader.prototype._addProxy = function(proxy) { var self2 = this; if (self2._proxyTarget) { return self2.error("proxy already set"); } self2._proxyTarget = proxy; proxy._proxy = self2; [ "error", "data", "end", "close", "linkpath", "entry", "entryEnd", "child", "childEnd", "warn", "stat" ].forEach(function(ev) { proxy.on(ev, self2.emit.bind(self2, ev)); }); self2.emit("proxy", proxy); proxy.on("ready", function() { self2.ready = true; self2.emit("ready"); }); var calls = self2._buffer; self2._buffer.length = 0; calls.forEach(function(c) { proxy[c[0]].apply(proxy, c[1]); }); }; ProxyReader.prototype.pause = function() { return this._proxyTarget ? this._proxyTarget.pause() : false; }; ProxyReader.prototype.resume = function() { return this._proxyTarget ? this._proxyTarget.resume() : false; }; }); // node_modules/fstream/lib/reader.js var require_reader = __commonJS((exports2, module2) => { module2.exports = Reader; var fs = require_graceful_fs(); var Stream = require("stream").Stream; var inherits2 = require_inherits(); var path = require("path"); var getType = require_get_type(); var hardLinks = Reader.hardLinks = {}; var Abstract = require_abstract(); inherits2(Reader, Abstract); var LinkReader = require_link_reader(); function Reader(props, currentStat) { var self2 = this; if (!(self2 instanceof Reader)) return new Reader(props, currentStat); if (typeof props === "string") { props = {path: props}; } var type; var ClassType; if (props.type && typeof props.type === "function") { type = props.type; ClassType = type; } else { type = getType(props); ClassType = Reader; } if (currentStat && !type) { type = getType(currentStat); props[type] = true; props.type = type; } switch (type) { case "Directory": ClassType = require_dir_reader(); break; case "Link": case "File": ClassType = require_file_reader(); break; case "SymbolicLink": ClassType = LinkReader; break; case "Socket": ClassType = require_socket_reader(); break; case null: ClassType = require_proxy_reader(); break; } if (!(self2 instanceof ClassType)) { return new ClassType(props); } Abstract.call(self2); if (!props.path) { self2.error("Must provide a path", null, true); } self2.readable = true; self2.writable = false; self2.type = type; self2.props = props; self2.depth = props.depth = props.depth || 0; self2.parent = props.parent || null; self2.root = props.root || props.parent && props.parent.root || self2; self2._path = self2.path = path.resolve(props.path); if (process.platform === "win32") { self2.path = self2._path = self2.path.replace(/\?/g, "_"); if (self2._path.length >= 260) { self2._swallowErrors = true; self2._path = "\\\\?\\" + self2.path.replace(/\//g, "\\"); } } self2.basename = props.basename = path.basename(self2.path); self2.dirname = props.dirname = path.dirname(self2.path); props.parent = props.root = null; self2.size = props.size; self2.filter = typeof props.filter === "function" ? props.filter : null; if (props.sort === "alpha") props.sort = alphasort; self2._stat(currentStat); } function alphasort(a, b) { return a === b ? 0 : a.toLowerCase() > b.toLowerCase() ? 1 : a.toLowerCase() < b.toLowerCase() ? -1 : a > b ? 1 : -1; } Reader.prototype._stat = function(currentStat) { var self2 = this; var props = self2.props; var stat = props.follow ? "stat" : "lstat"; if (currentStat) process.nextTick(statCb.bind(null, null, currentStat)); else fs[stat](self2._path, statCb); function statCb(er, props_) { if (er) return self2.error(er); Object.keys(props_).forEach(function(k2) { props[k2] = props_[k2]; }); if (self2.size !== void 0 && props.size !== self2.size) { return self2.error("incorrect size"); } self2.size = props.size; var type = getType(props); var handleHardlinks = props.hardlinks !== false; if (handleHardlinks && type !== "Directory" && props.nlink && props.nlink > 1) { var k = props.dev + ":" + props.ino; if (hardLinks[k] === self2._path || !hardLinks[k]) { hardLinks[k] = self2._path; } else { type = self2.type = self2.props.type = "Link"; self2.Link = self2.props.Link = true; self2.linkpath = self2.props.linkpath = hardLinks[k]; self2._stat = self2._read = LinkReader.prototype._read; } } if (self2.type && self2.type !== type) { self2.error("Unexpected type: " + type); } if (self2.filter) { var who = self2._proxy || self2; if (!self2.filter.call(who, who, props)) { if (!self2._disowned) { self2.abort(); self2.emit("end"); self2.emit("close"); } return; } } var events = ["_stat", "stat", "ready"]; var e = 0; (function go() { if (self2._aborted) { self2.emit("end"); self2.emit("close"); return; } if (self2._paused && self2.type !== "Directory") { self2.once("resume", go); return; } var ev = events[e++]; if (!ev) { return self2._read(); } self2.emit(ev, props); go(); })(); } }; Reader.prototype.pipe = function(dest) { var self2 = this; if (typeof dest.add === "function") { self2.on("entry", function(entry) { var ret2 = dest.add(entry); if (ret2 === false) { self2.pause(); } }); } return Stream.prototype.pipe.apply(this, arguments); }; Reader.prototype.pause = function(who) { this._paused = true; who = who || this; this.emit("pause", who); if (this._stream) this._stream.pause(who); }; Reader.prototype.resume = function(who) { this._paused = false; who = who || this; this.emit("resume", who); if (this._stream) this._stream.resume(who); this._read(); }; Reader.prototype._read = function() { this.error("Cannot read unknown type: " + this.type); }; }); // node_modules/fstream/node_modules/rimraf/rimraf.js var require_rimraf2 = __commonJS((exports2, module2) => { module2.exports = rimraf; rimraf.sync = rimrafSync; var assert = require("assert"); var path = require("path"); var fs = require("fs"); var glob = void 0; try { glob = require_glob(); } catch (_err) { } var _0666 = parseInt("666", 8); var defaultGlobOpts = { nosort: true, silent: true }; var timeout = 0; var isWindows = process.platform === "win32"; function defaults(options) { var methods = [ "unlink", "chmod", "stat", "lstat", "rmdir", "readdir" ]; methods.forEach(function(m) { options[m] = options[m] || fs[m]; m = m + "Sync"; options[m] = options[m] || fs[m]; }); options.maxBusyTries = options.maxBusyTries || 3; options.emfileWait = options.emfileWait || 1e3; if (options.glob === false) { options.disableGlob = true; } if (options.disableGlob !== true && glob === void 0) { throw Error("glob dependency not found, set `options.disableGlob = true` if intentional"); } options.disableGlob = options.disableGlob || false; options.glob = options.glob || defaultGlobOpts; } function rimraf(p, options, cb) { if (typeof options === "function") { cb = options; options = {}; } assert(p, "rimraf: missing path"); assert.equal(typeof p, "string", "rimraf: path should be a string"); assert.equal(typeof cb, "function", "rimraf: callback function required"); assert(options, "rimraf: invalid options argument provided"); assert.equal(typeof options, "object", "rimraf: options should be object"); defaults(options); var busyTries = 0; var errState = null; var n = 0; if (options.disableGlob || !glob.hasMagic(p)) return afterGlob(null, [p]); options.lstat(p, function(er, stat) { if (!er) return afterGlob(null, [p]); glob(p, options.glob, afterGlob); }); function next(er) { errState = errState || er; if (--n === 0) cb(errState); } function afterGlob(er, results) { if (er) return cb(er); n = results.length; if (n === 0) return cb(); results.forEach(function(p2) { rimraf_(p2, options, function CB(er2) { if (er2) { if ((er2.code === "EBUSY" || er2.code === "ENOTEMPTY" || er2.code === "EPERM") && busyTries < options.maxBusyTries) { busyTries++; var time = busyTries * 100; return setTimeout(function() { rimraf_(p2, options, CB); }, time); } if (er2.code === "EMFILE" && timeout < options.emfileWait) { return setTimeout(function() { rimraf_(p2, options, CB); }, timeout++); } if (er2.code === "ENOENT") er2 = null; } timeout = 0; next(er2); }); }); } } function rimraf_(p, options, cb) { assert(p); assert(options); assert(typeof cb === "function"); options.lstat(p, function(er, st) { if (er && er.code === "ENOENT") return cb(null); if (er && er.code === "EPERM" && isWindows) fixWinEPERM(p, options, er, cb); if (st && st.isDirectory()) return rmdir(p, options, er, cb); options.unlink(p, function(er2) { if (er2) { if (er2.code === "ENOENT") return cb(null); if (er2.code === "EPERM") return isWindows ? fixWinEPERM(p, options, er2, cb) : rmdir(p, options, er2, cb); if (er2.code === "EISDIR") return rmdir(p, options, er2, cb); } return cb(er2); }); }); } function fixWinEPERM(p, options, er, cb) { assert(p); assert(options); assert(typeof cb === "function"); if (er) assert(er instanceof Error); options.chmod(p, _0666, function(er2) { if (er2) cb(er2.code === "ENOENT" ? null : er); else options.stat(p, function(er3, stats) { if (er3) cb(er3.code === "ENOENT" ? null : er); else if (stats.isDirectory()) rmdir(p, options, er, cb); else options.unlink(p, cb); }); }); } function fixWinEPERMSync(p, options, er) { assert(p); assert(options); if (er) assert(er instanceof Error); try { options.chmodSync(p, _0666); } catch (er2) { if (er2.code === "ENOENT") return; else throw er; } try { var stats = options.statSync(p); } catch (er3) { if (er3.code === "ENOENT") return; else throw er; } if (stats.isDirectory()) rmdirSync(p, options, er); else options.unlinkSync(p); } function rmdir(p, options, originalEr, cb) { assert(p); assert(options); if (originalEr) assert(originalEr instanceof Error); assert(typeof cb === "function"); options.rmdir(p, function(er) { if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) rmkids(p, options, cb); else if (er && er.code === "ENOTDIR") cb(originalEr); else cb(er); }); } function rmkids(p, options, cb) { assert(p); assert(options); assert(typeof cb === "function"); options.readdir(p, function(er, files) { if (er) return cb(er); var n = files.length; if (n === 0) return options.rmdir(p, cb); var errState; files.forEach(function(f) { rimraf(path.join(p, f), options, function(er2) { if (errState) return; if (er2) return cb(errState = er2); if (--n === 0) options.rmdir(p, cb); }); }); }); } function rimrafSync(p, options) { options = options || {}; defaults(options); assert(p, "rimraf: missing path"); assert.equal(typeof p, "string", "rimraf: path should be a string"); assert(options, "rimraf: missing options"); assert.equal(typeof options, "object", "rimraf: options should be object"); var results; if (options.disableGlob || !glob.hasMagic(p)) { results = [p]; } else { try { options.lstatSync(p); results = [p]; } catch (er) { results = glob.sync(p, options.glob); } } if (!results.length) return; for (var i = 0; i < results.length; i++) { var p = results[i]; try { var st = options.lstatSync(p); } catch (er) { if (er.code === "ENOENT") return; if (er.code === "EPERM" && isWindows) fixWinEPERMSync(p, options, er); } try { if (st && st.isDirectory()) rmdirSync(p, options, null); else options.unlinkSync(p); } catch (er) { if (er.code === "ENOENT") return; if (er.code === "EPERM") return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er); if (er.code !== "EISDIR") throw er; rmdirSync(p, options, er); } } } function rmdirSync(p, options, originalEr) { assert(p); assert(options); if (originalEr) assert(originalEr instanceof Error); try { options.rmdirSync(p); } catch (er) { if (er.code === "ENOENT") return; if (er.code === "ENOTDIR") throw originalEr; if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") rmkidsSync(p, options); } } function rmkidsSync(p, options) { assert(p); assert(options); options.readdirSync(p).forEach(function(f) { rimrafSync(path.join(p, f), options); }); var retries = isWindows ? 100 : 1; var i = 0; do { var threw = true; try { var ret2 = options.rmdirSync(p, options); threw = false; return ret2; } finally { if (++i < retries && threw) continue; } } while (true); } }); // node_modules/mkdirp/index.js var require_mkdirp = __commonJS((exports2, module2) => { var path = require("path"); var fs = require("fs"); var _0777 = parseInt("0777", 8); module2.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; function mkdirP(p, opts, f, made) { if (typeof opts === "function") { f = opts; opts = {}; } else if (!opts || typeof opts !== "object") { opts = {mode: opts}; } var mode = opts.mode; var xfs = opts.fs || fs; if (mode === void 0) { mode = _0777; } if (!made) made = null; var cb = f || function() { }; p = path.resolve(p); xfs.mkdir(p, mode, function(er) { if (!er) { made = made || p; return cb(null, made); } switch (er.code) { case "ENOENT": if (path.dirname(p) === p) return cb(er); mkdirP(path.dirname(p), opts, function(er2, made2) { if (er2) cb(er2, made2); else mkdirP(p, opts, cb, made2); }); break; default: xfs.stat(p, function(er2, stat) { if (er2 || !stat.isDirectory()) cb(er, made); else cb(null, made); }); break; } }); } mkdirP.sync = function sync(p, opts, made) { if (!opts || typeof opts !== "object") { opts = {mode: opts}; } var mode = opts.mode; var xfs = opts.fs || fs; if (mode === void 0) { mode = _0777; } if (!made) made = null; p = path.resolve(p); try { xfs.mkdirSync(p, mode); made = made || p; } catch (err0) { switch (err0.code) { case "ENOENT": made = sync(path.dirname(p), opts, made); sync(p, opts, made); break; default: var stat; try { stat = xfs.statSync(p); } catch (err1) { throw err0; } if (!stat.isDirectory()) throw err0; break; } } return made; }; }); // node_modules/fstream/lib/collect.js var require_collect = __commonJS((exports2, module2) => { module2.exports = collect; function collect(stream) { if (stream._collected) return; if (stream._paused) return stream.on("resume", collect.bind(null, stream)); stream._collected = true; stream.pause(); stream.on("data", save); stream.on("end", save); var buf = []; function save(b) { if (typeof b === "string") b = new Buffer(b); if (Buffer.isBuffer(b) && !b.length) return; buf.push(b); } stream.on("entry", saveEntry); var entryBuffer = []; function saveEntry(e) { collect(e); entryBuffer.push(e); } stream.on("proxy", proxyPause); function proxyPause(p) { p.pause(); } stream.pipe = function(orig) { return function(dest) { var e = 0; (function unblockEntry() { var entry = entryBuffer[e++]; if (!entry) return resume(); entry.on("end", unblockEntry); if (dest) dest.add(entry); else stream.emit("entry", entry); })(); function resume() { stream.removeListener("entry", saveEntry); stream.removeListener("data", save); stream.removeListener("end", save); stream.pipe = orig; if (dest) stream.pipe(dest); buf.forEach(function(b) { if (b) stream.emit("data", b); else stream.emit("end"); }); stream.resume(); } return dest; }; }(stream.pipe); } }); // node_modules/fstream/lib/dir-writer.js var require_dir_writer = __commonJS((exports2, module2) => { module2.exports = DirWriter; var Writer = require_writer(); var inherits2 = require_inherits(); var mkdir = require_mkdirp(); var path = require("path"); var collect = require_collect(); inherits2(DirWriter, Writer); function DirWriter(props) { var self2 = this; if (!(self2 instanceof DirWriter)) { self2.error("DirWriter must be called as constructor.", null, true); } if (props.type !== "Directory" || !props.Directory) { self2.error("Non-directory type " + props.type + " " + JSON.stringify(props), null, true); } Writer.call(this, props); } DirWriter.prototype._create = function() { var self2 = this; mkdir(self2._path, Writer.dirmode, function(er) { if (er) return self2.error(er); self2.ready = true; self2.emit("ready"); self2._process(); }); }; DirWriter.prototype.write = function() { return true; }; DirWriter.prototype.end = function() { this._ended = true; this._process(); }; DirWriter.prototype.add = function(entry) { var self2 = this; collect(entry); if (!self2.ready || self2._currentEntry) { self2._buffer.push(entry); return false; } if (self2._ended) { return self2.error("add after end"); } self2._buffer.push(entry); self2._process(); return this._buffer.length === 0; }; DirWriter.prototype._process = function() { var self2 = this; if (self2._processing) return; var entry = self2._buffer.shift(); if (!entry) { self2.emit("drain"); if (self2._ended) self2._finish(); return; } self2._processing = true; self2.emit("entry", entry); var p = entry; var pp; do { pp = p._path || p.path; if (pp === self2.root._path || pp === self2._path || pp && pp.indexOf(self2._path) === 0) { self2._processing = false; if (entry._collected) entry.pipe(); return self2._process(); } p = p.parent; } while (p); var props = { parent: self2, root: self2.root || self2, type: entry.type, depth: self2.depth + 1 }; pp = entry._path || entry.path || entry.props.path; if (entry.parent) { pp = pp.substr(entry.parent._path.length + 1); } props.path = path.join(self2.path, path.join("/", pp)); props.filter = self2.filter; Object.keys(entry.props).forEach(function(k) { if (!props.hasOwnProperty(k)) { props[k] = entry.props[k]; } }); var child = self2._currentChild = new Writer(props); child.on("ready", function() { entry.pipe(child); entry.resume(); }); child.on("error", function(er) { if (child._swallowErrors) { self2.warn(er); child.emit("end"); child.emit("close"); } else { self2.emit("error", er); } }); child.on("close", onend); var ended = false; function onend() { if (ended) return; ended = true; self2._currentChild = null; self2._processing = false; self2._process(); } }; }); // node_modules/fstream/lib/link-writer.js var require_link_writer = __commonJS((exports2, module2) => { module2.exports = LinkWriter; var fs = require_graceful_fs(); var Writer = require_writer(); var inherits2 = require_inherits(); var path = require("path"); var rimraf = require_rimraf2(); inherits2(LinkWriter, Writer); function LinkWriter(props) { var self2 = this; if (!(self2 instanceof LinkWriter)) { throw new Error("LinkWriter must be called as constructor."); } if (!(props.type === "Link" && props.Link || props.type === "SymbolicLink" && props.SymbolicLink)) { throw new Error("Non-link type " + props.type); } if (props.linkpath === "") props.linkpath = "."; if (!props.linkpath) { self2.error("Need linkpath property to create " + props.type); } Writer.call(this, props); } LinkWriter.prototype._create = function() { var self2 = this; var hard = self2.type === "Link" || process.platform === "win32"; var link = hard ? "link" : "symlink"; var lp = hard ? path.resolve(self2.dirname, self2.linkpath) : self2.linkpath; if (hard) return clobber(self2, lp, link); fs.readlink(self2._path, function(er, p) { if (p && p === lp) return finish(self2); clobber(self2, lp, link); }); }; function clobber(self2, lp, link) { rimraf(self2._path, function(er) { if (er) return self2.error(er); create(self2, lp, link); }); } function create(self2, lp, link) { fs[link](lp, self2._path, function(er) { if (er) { if ((er.code === "ENOENT" || er.code === "EACCES" || er.code === "EPERM") && process.platform === "win32") { self2.ready = true; self2.emit("ready"); self2.emit("end"); self2.emit("close"); self2.end = self2._finish = function() { }; } else return self2.error(er); } finish(self2); }); } function finish(self2) { self2.ready = true; self2.emit("ready"); if (self2._ended && !self2._finished) self2._finish(); } LinkWriter.prototype.end = function() { this._ended = true; if (this.ready) { this._finished = true; this._finish(); } }; }); // node_modules/fstream/lib/file-writer.js var require_file_writer = __commonJS((exports2, module2) => { module2.exports = FileWriter; var fs = require_graceful_fs(); var Writer = require_writer(); var inherits2 = require_inherits(); var EOF = {}; inherits2(FileWriter, Writer); function FileWriter(props) { var self2 = this; if (!(self2 instanceof FileWriter)) { throw new Error("FileWriter must be called as constructor."); } if (props.type !== "File" || !props.File) { throw new Error("Non-file type " + props.type); } self2._buffer = []; self2._bytesWritten = 0; Writer.call(this, props); } FileWriter.prototype._create = function() { var self2 = this; if (self2._stream) return; var so = {}; if (self2.props.flags) so.flags = self2.props.flags; so.mode = Writer.filemode; if (self2._old && self2._old.blksize) so.bufferSize = self2._old.blksize; self2._stream = fs.createWriteStream(self2._path, so); self2._stream.on("open", function() { self2.ready = true; self2._buffer.forEach(function(c) { if (c === EOF) self2._stream.end(); else self2._stream.write(c); }); self2.emit("ready"); self2.emit("drain"); }); self2._stream.on("error", function(er) { self2.emit("error", er); }); self2._stream.on("drain", function() { self2.emit("drain"); }); self2._stream.on("close", function() { self2._finish(); }); }; FileWriter.prototype.write = function(c) { var self2 = this; self2._bytesWritten += c.length; if (!self2.ready) { if (!Buffer.isBuffer(c) && typeof c !== "string") { throw new Error("invalid write data"); } self2._buffer.push(c); return false; } var ret2 = self2._stream.write(c); if (ret2 === false && self2._stream._queue) { return self2._stream._queue.length <= 2; } else { return ret2; } }; FileWriter.prototype.end = function(c) { var self2 = this; if (c) self2.write(c); if (!self2.ready) { self2._buffer.push(EOF); return false; } return self2._stream.end(); }; FileWriter.prototype._finish = function() { var self2 = this; if (typeof self2.size === "number" && self2._bytesWritten !== self2.size) { self2.error("Did not get expected byte count.\nexpect: " + self2.size + "\nactual: " + self2._bytesWritten); } Writer.prototype._finish.call(self2); }; }); // node_modules/fstream/lib/proxy-writer.js var require_proxy_writer = __commonJS((exports2, module2) => { module2.exports = ProxyWriter; var Writer = require_writer(); var getType = require_get_type(); var inherits2 = require_inherits(); var collect = require_collect(); var fs = require("fs"); inherits2(ProxyWriter, Writer); function ProxyWriter(props) { var self2 = this; if (!(self2 instanceof ProxyWriter)) { throw new Error("ProxyWriter must be called as constructor."); } self2.props = props; self2._needDrain = false; Writer.call(self2, props); } ProxyWriter.prototype._stat = function() { var self2 = this; var props = self2.props; var stat = props.follow ? "stat" : "lstat"; fs[stat](props.path, function(er, current) { var type; if (er || !current) { type = "File"; } else { type = getType(current); } props[type] = true; props.type = self2.type = type; self2._old = current; self2._addProxy(Writer(props, current)); }); }; ProxyWriter.prototype._addProxy = function(proxy) { var self2 = this; if (self2._proxy) { return self2.error("proxy already set"); } self2._proxy = proxy; [ "ready", "error", "close", "pipe", "drain", "warn" ].forEach(function(ev) { proxy.on(ev, self2.emit.bind(self2, ev)); }); self2.emit("proxy", proxy); var calls = self2._buffer; calls.forEach(function(c) { proxy[c[0]].apply(proxy, c[1]); }); self2._buffer.length = 0; if (self2._needsDrain) self2.emit("drain"); }; ProxyWriter.prototype.add = function(entry) { collect(entry); if (!this._proxy) { this._buffer.push(["add", [entry]]); this._needDrain = true; return false; } return this._proxy.add(entry); }; ProxyWriter.prototype.write = function(c) { if (!this._proxy) { this._buffer.push(["write", [c]]); this._needDrain = true; return false; } return this._proxy.write(c); }; ProxyWriter.prototype.end = function(c) { if (!this._proxy) { this._buffer.push(["end", [c]]); return false; } return this._proxy.end(c); }; }); // node_modules/fstream/lib/writer.js var require_writer = __commonJS((exports2, module2) => { module2.exports = Writer; var fs = require_graceful_fs(); var inherits2 = require_inherits(); var rimraf = require_rimraf2(); var mkdir = require_mkdirp(); var path = require("path"); var umask = process.platform === "win32" ? 0 : process.umask(); var getType = require_get_type(); var Abstract = require_abstract(); inherits2(Writer, Abstract); Writer.dirmode = parseInt("0777", 8) & ~umask; Writer.filemode = parseInt("0666", 8) & ~umask; var DirWriter = require_dir_writer(); var LinkWriter = require_link_writer(); var FileWriter = require_file_writer(); var ProxyWriter = require_proxy_writer(); function Writer(props, current) { var self2 = this; if (typeof props === "string") { props = {path: props}; } var type = getType(props); var ClassType = Writer; switch (type) { case "Directory": ClassType = DirWriter; break; case "File": ClassType = FileWriter; break; case "Link": case "SymbolicLink": ClassType = LinkWriter; break; case null: default: ClassType = ProxyWriter; break; } if (!(self2 instanceof ClassType)) return new ClassType(props); Abstract.call(self2); if (!props.path) self2.error("Must provide a path", null, true); self2.type = props.type; self2.props = props; self2.depth = props.depth || 0; self2.clobber = props.clobber === false ? props.clobber : true; self2.parent = props.parent || null; self2.root = props.root || props.parent && props.parent.root || self2; self2._path = self2.path = path.resolve(props.path); if (process.platform === "win32") { self2.path = self2._path = self2.path.replace(/\?/g, "_"); if (self2._path.length >= 260) { self2._swallowErrors = true; self2._path = "\\\\?\\" + self2.path.replace(/\//g, "\\"); } } self2.basename = path.basename(props.path); self2.dirname = path.dirname(props.path); self2.linkpath = props.linkpath || null; props.parent = props.root = null; self2.size = props.size; if (typeof props.mode === "string") { props.mode = parseInt(props.mode, 8); } self2.readable = false; self2.writable = true; self2._buffer = []; self2.ready = false; self2.filter = typeof props.filter === "function" ? props.filter : null; self2._stat(current); } Writer.prototype._create = function() { var self2 = this; fs[self2.props.follow ? "stat" : "lstat"](self2._path, function(er) { if (er) { return self2.warn("Cannot create " + self2._path + "\nUnsupported type: " + self2.type, "ENOTSUP"); } self2._finish(); }); }; Writer.prototype._stat = function(current) { var self2 = this; var props = self2.props; var stat = props.follow ? "stat" : "lstat"; var who = self2._proxy || self2; if (current) statCb(null, current); else fs[stat](self2._path, statCb); function statCb(er, current2) { if (self2.filter && !self2.filter.call(who, who, current2)) { self2._aborted = true; self2.emit("end"); self2.emit("close"); return; } if (er || !current2) { return create(self2); } self2._old = current2; var currentType = getType(current2); if (currentType !== self2.type || self2.type === "File" && current2.nlink > 1) { return rimraf(self2._path, function(er2) { if (er2) return self2.error(er2); self2._old = null; create(self2); }); } create(self2); } }; function create(self2) { mkdir(path.dirname(self2._path), Writer.dirmode, function(er, made) { if (er) return self2.error(er); self2._madeDir = made; return self2._create(); }); } function endChmod(self2, want, current, path2, cb) { var wantMode = want.mode; var chmod = want.follow || self2.type !== "SymbolicLink" ? "chmod" : "lchmod"; if (!fs[chmod]) return cb(); if (typeof wantMode !== "number") return cb(); var curMode = current.mode & parseInt("0777", 8); wantMode = wantMode & parseInt("0777", 8); if (wantMode === curMode) return cb(); fs[chmod](path2, wantMode, cb); } function endChown(self2, want, current, path2, cb) { if (process.platform === "win32") return cb(); if (!process.getuid || process.getuid() !== 0) return cb(); if (typeof want.uid !== "number" && typeof want.gid !== "number") return cb(); if (current.uid === want.uid && current.gid === want.gid) return cb(); var chown = self2.props.follow || self2.type !== "SymbolicLink" ? "chown" : "lchown"; if (!fs[chown]) return cb(); if (typeof want.uid !== "number") want.uid = current.uid; if (typeof want.gid !== "number") want.gid = current.gid; fs[chown](path2, want.uid, want.gid, cb); } function endUtimes(self2, want, current, path2, cb) { if (!fs.utimes || process.platform === "win32") return cb(); var utimes = want.follow || self2.type !== "SymbolicLink" ? "utimes" : "lutimes"; if (utimes === "lutimes" && !fs[utimes]) { utimes = "utimes"; } if (!fs[utimes]) return cb(); var curA = current.atime; var curM = current.mtime; var meA = want.atime; var meM = want.mtime; if (meA === void 0) meA = curA; if (meM === void 0) meM = curM; if (!isDate(meA)) meA = new Date(meA); if (!isDate(meM)) meA = new Date(meM); if (meA.getTime() === curA.getTime() && meM.getTime() === curM.getTime()) return cb(); fs[utimes](path2, meA, meM, cb); } Writer.prototype._finish = function() { var self2 = this; if (self2._finishing) return; self2._finishing = true; var todo = 0; var errState = null; var done = false; if (self2._old) { self2._old.atime = new Date(0); self2._old.mtime = new Date(0); setProps(self2._old); } else { var stat = self2.props.follow ? "stat" : "lstat"; fs[stat](self2._path, function(er, current) { if (er) { if (er.code === "ENOENT" && (self2.type === "Link" || self2.type === "SymbolicLink") && process.platform === "win32") { self2.ready = true; self2.emit("ready"); self2.emit("end"); self2.emit("close"); self2.end = self2._finish = function() { }; return; } else return self2.error(er); } setProps(self2._old = current); }); } return; function setProps(current) { todo += 3; endChmod(self2, self2.props, current, self2._path, next("chmod")); endChown(self2, self2.props, current, self2._path, next("chown")); endUtimes(self2, self2.props, current, self2._path, next("utimes")); } function next(what) { return function(er) { if (errState) return; if (er) { er.fstream_finish_call = what; return self2.error(errState = er); } if (--todo > 0) return; if (done) return; done = true; if (!self2._madeDir) return end(); else endMadeDir(self2, self2._path, end); function end(er2) { if (er2) { er2.fstream_finish_call = "setupMadeDir"; return self2.error(er2); } self2.emit("end"); self2.emit("close"); } }; } }; function endMadeDir(self2, p, cb) { var made = self2._madeDir; var d = path.dirname(p); endMadeDir_(self2, d, function(er) { if (er) return cb(er); if (d === made) { return cb(); } endMadeDir(self2, d, cb); }); } function endMadeDir_(self2, p, cb) { var dirProps = {}; Object.keys(self2.props).forEach(function(k) { dirProps[k] = self2.props[k]; if (k === "mode" && self2.type !== "Directory") { dirProps[k] = dirProps[k] | parseInt("0111", 8); } }); var todo = 3; var errState = null; fs.stat(p, function(er, current) { if (er) return cb(errState = er); endChmod(self2, dirProps, current, p, next); endChown(self2, dirProps, current, p, next); endUtimes(self2, dirProps, current, p, next); }); function next(er) { if (errState) return; if (er) return cb(errState = er); if (--todo === 0) return cb(); } } Writer.prototype.pipe = function() { this.error("Can't pipe from writable stream"); }; Writer.prototype.add = function() { this.error("Can't add to non-Directory type"); }; Writer.prototype.write = function() { return true; }; function objectToString(d) { return Object.prototype.toString.call(d); } function isDate(d) { return typeof d === "object" && objectToString(d) === "[object Date]"; } }); // node_modules/fstream/fstream.js var require_fstream = __commonJS((exports2) => { exports2.Abstract = require_abstract(); exports2.Reader = require_reader(); exports2.Writer = require_writer(); exports2.File = { Reader: require_file_reader(), Writer: require_file_writer() }; exports2.Dir = { Reader: require_dir_reader(), Writer: require_dir_writer() }; exports2.Link = { Reader: require_link_reader(), Writer: require_link_writer() }; exports2.Proxy = { Reader: require_proxy_reader(), Writer: require_proxy_writer() }; exports2.Reader.Dir = exports2.DirReader = exports2.Dir.Reader; exports2.Reader.File = exports2.FileReader = exports2.File.Reader; exports2.Reader.Link = exports2.LinkReader = exports2.Link.Reader; exports2.Reader.Proxy = exports2.ProxyReader = exports2.Proxy.Reader; exports2.Writer.Dir = exports2.DirWriter = exports2.Dir.Writer; exports2.Writer.File = exports2.FileWriter = exports2.File.Writer; exports2.Writer.Link = exports2.LinkWriter = exports2.Link.Writer; exports2.Writer.Proxy = exports2.ProxyWriter = exports2.Proxy.Writer; exports2.collect = require_collect(); }); // node_modules/unzipper/lib/extract.js var require_extract = __commonJS((exports2, module2) => { module2.exports = Extract; var Parse = require_parse3(); var Writer = require_fstream().Writer; var path = require("path"); var stream = require("stream"); var duplexer2 = require_duplexer2(); var Promise2 = require_bluebird(); function Extract(opts) { opts.path = path.resolve(path.normalize(opts.path)); var parser = new Parse(opts); var outStream = new stream.Writable({objectMode: true}); outStream._write = function(entry, encoding, cb) { if (entry.type == "Directory") return cb(); var extractPath = path.join(opts.path, entry.path); if (extractPath.indexOf(opts.path) != 0) { return cb(); } const writer = opts.getWriter ? opts.getWriter({path: extractPath}) : Writer({path: extractPath}); entry.pipe(writer).on("error", cb).on("close", cb); }; var extract = duplexer2(parser, outStream); parser.once("crx-header", function(crxHeader) { extract.crxHeader = crxHeader; }); parser.pipe(outStream).on("finish", function() { extract.emit("close"); }); extract.promise = function() { return new Promise2(function(resolve, reject) { extract.on("close", resolve); extract.on("error", reject); }); }; return extract; } }); // node_modules/big-integer/BigInteger.js var require_BigInteger = __commonJS((exports2, module2) => { var bigInt = function(undefined2) { "use strict"; var BASE = 1e7, LOG_BASE = 7, MAX_INT = 9007199254740992, MAX_INT_ARR = smallToArray(MAX_INT), DEFAULT_ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz"; var supportsNativeBigInt = typeof BigInt === "function"; function Integer(v, radix, alphabet, caseSensitive) { if (typeof v === "undefined") return Integer[0]; if (typeof radix !== "undefined") return +radix === 10 && !alphabet ? parseValue(v) : parseBase(v, radix, alphabet, caseSensitive); return parseValue(v); } function BigInteger(value, sign) { this.value = value; this.sign = sign; this.isSmall = false; } BigInteger.prototype = Object.create(Integer.prototype); function SmallInteger(value) { this.value = value; this.sign = value < 0; this.isSmall = true; } SmallInteger.prototype = Object.create(Integer.prototype); function NativeBigInt(value) { this.value = value; } NativeBigInt.prototype = Object.create(Integer.prototype); function isPrecise(n) { return -MAX_INT < n && n < MAX_INT; } function smallToArray(n) { if (n < 1e7) return [n]; if (n < 1e14) return [n % 1e7, Math.floor(n / 1e7)]; return [n % 1e7, Math.floor(n / 1e7) % 1e7, Math.floor(n / 1e14)]; } function arrayToSmall(arr) { trim(arr); var length = arr.length; if (length < 4 && compareAbs(arr, MAX_INT_ARR) < 0) { switch (length) { case 0: return 0; case 1: return arr[0]; case 2: return arr[0] + arr[1] * BASE; default: return arr[0] + (arr[1] + arr[2] * BASE) * BASE; } } return arr; } function trim(v) { var i2 = v.length; while (v[--i2] === 0) ; v.length = i2 + 1; } function createArray(length) { var x = new Array(length); var i2 = -1; while (++i2 < length) { x[i2] = 0; } return x; } function truncate(n) { if (n > 0) return Math.floor(n); return Math.ceil(n); } function add(a, b) { var l_a = a.length, l_b = b.length, r = new Array(l_a), carry = 0, base = BASE, sum, i2; for (i2 = 0; i2 < l_b; i2++) { sum = a[i2] + b[i2] + carry; carry = sum >= base ? 1 : 0; r[i2] = sum - carry * base; } while (i2 < l_a) { sum = a[i2] + carry; carry = sum === base ? 1 : 0; r[i2++] = sum - carry * base; } if (carry > 0) r.push(carry); return r; } function addAny(a, b) { if (a.length >= b.length) return add(a, b); return add(b, a); } function addSmall(a, carry) { var l = a.length, r = new Array(l), base = BASE, sum, i2; for (i2 = 0; i2 < l; i2++) { sum = a[i2] - base + carry; carry = Math.floor(sum / base); r[i2] = sum - carry * base; carry += 1; } while (carry > 0) { r[i2++] = carry % base; carry = Math.floor(carry / base); } return r; } BigInteger.prototype.add = function(v) { var n = parseValue(v); if (this.sign !== n.sign) { return this.subtract(n.negate()); } var a = this.value, b = n.value; if (n.isSmall) { return new BigInteger(addSmall(a, Math.abs(b)), this.sign); } return new BigInteger(addAny(a, b), this.sign); }; BigInteger.prototype.plus = BigInteger.prototype.add; SmallInteger.prototype.add = function(v) { var n = parseValue(v); var a = this.value; if (a < 0 !== n.sign) { return this.subtract(n.negate()); } var b = n.value; if (n.isSmall) { if (isPrecise(a + b)) return new SmallInteger(a + b); b = smallToArray(Math.abs(b)); } return new BigInteger(addSmall(b, Math.abs(a)), a < 0); }; SmallInteger.prototype.plus = SmallInteger.prototype.add; NativeBigInt.prototype.add = function(v) { return new NativeBigInt(this.value + parseValue(v).value); }; NativeBigInt.prototype.plus = NativeBigInt.prototype.add; function subtract(a, b) { var a_l = a.length, b_l = b.length, r = new Array(a_l), borrow = 0, base = BASE, i2, difference; for (i2 = 0; i2 < b_l; i2++) { difference = a[i2] - borrow - b[i2]; if (difference < 0) { difference += base; borrow = 1; } else borrow = 0; r[i2] = difference; } for (i2 = b_l; i2 < a_l; i2++) { difference = a[i2] - borrow; if (difference < 0) difference += base; else { r[i2++] = difference; break; } r[i2] = difference; } for (; i2 < a_l; i2++) { r[i2] = a[i2]; } trim(r); return r; } function subtractAny(a, b, sign) { var value; if (compareAbs(a, b) >= 0) { value = subtract(a, b); } else { value = subtract(b, a); sign = !sign; } value = arrayToSmall(value); if (typeof value === "number") { if (sign) value = -value; return new SmallInteger(value); } return new BigInteger(value, sign); } function subtractSmall(a, b, sign) { var l = a.length, r = new Array(l), carry = -b, base = BASE, i2, difference; for (i2 = 0; i2 < l; i2++) { difference = a[i2] + carry; carry = Math.floor(difference / base); difference %= base; r[i2] = difference < 0 ? difference + base : difference; } r = arrayToSmall(r); if (typeof r === "number") { if (sign) r = -r; return new SmallInteger(r); } return new BigInteger(r, sign); } BigInteger.prototype.subtract = function(v) { var n = parseValue(v); if (this.sign !== n.sign) { return this.add(n.negate()); } var a = this.value, b = n.value; if (n.isSmall) return subtractSmall(a, Math.abs(b), this.sign); return subtractAny(a, b, this.sign); }; BigInteger.prototype.minus = BigInteger.prototype.subtract; SmallInteger.prototype.subtract = function(v) { var n = parseValue(v); var a = this.value; if (a < 0 !== n.sign) { return this.add(n.negate()); } var b = n.value; if (n.isSmall) { return new SmallInteger(a - b); } return subtractSmall(b, Math.abs(a), a >= 0); }; SmallInteger.prototype.minus = SmallInteger.prototype.subtract; NativeBigInt.prototype.subtract = function(v) { return new NativeBigInt(this.value - parseValue(v).value); }; NativeBigInt.prototype.minus = NativeBigInt.prototype.subtract; BigInteger.prototype.negate = function() { return new BigInteger(this.value, !this.sign); }; SmallInteger.prototype.negate = function() { var sign = this.sign; var small = new SmallInteger(-this.value); small.sign = !sign; return small; }; NativeBigInt.prototype.negate = function() { return new NativeBigInt(-this.value); }; BigInteger.prototype.abs = function() { return new BigInteger(this.value, false); }; SmallInteger.prototype.abs = function() { return new SmallInteger(Math.abs(this.value)); }; NativeBigInt.prototype.abs = function() { return new NativeBigInt(this.value >= 0 ? this.value : -this.value); }; function multiplyLong(a, b) { var a_l = a.length, b_l = b.length, l = a_l + b_l, r = createArray(l), base = BASE, product, carry, i2, a_i, b_j; for (i2 = 0; i2 < a_l; ++i2) { a_i = a[i2]; for (var j = 0; j < b_l; ++j) { b_j = b[j]; product = a_i * b_j + r[i2 + j]; carry = Math.floor(product / base); r[i2 + j] = product - carry * base; r[i2 + j + 1] += carry; } } trim(r); return r; } function multiplySmall(a, b) { var l = a.length, r = new Array(l), base = BASE, carry = 0, product, i2; for (i2 = 0; i2 < l; i2++) { product = a[i2] * b + carry; carry = Math.floor(product / base); r[i2] = product - carry * base; } while (carry > 0) { r[i2++] = carry % base; carry = Math.floor(carry / base); } return r; } function shiftLeft(x, n) { var r = []; while (n-- > 0) r.push(0); return r.concat(x); } function multiplyKaratsuba(x, y) { var n = Math.max(x.length, y.length); if (n <= 30) return multiplyLong(x, y); n = Math.ceil(n / 2); var b = x.slice(n), a = x.slice(0, n), d = y.slice(n), c = y.slice(0, n); var ac = multiplyKaratsuba(a, c), bd = multiplyKaratsuba(b, d), abcd = multiplyKaratsuba(addAny(a, b), addAny(c, d)); var product = addAny(addAny(ac, shiftLeft(subtract(subtract(abcd, ac), bd), n)), shiftLeft(bd, 2 * n)); trim(product); return product; } function useKaratsuba(l1, l2) { return -0.012 * l1 - 0.012 * l2 + 15e-6 * l1 * l2 > 0; } BigInteger.prototype.multiply = function(v) { var n = parseValue(v), a = this.value, b = n.value, sign = this.sign !== n.sign, abs; if (n.isSmall) { if (b === 0) return Integer[0]; if (b === 1) return this; if (b === -1) return this.negate(); abs = Math.abs(b); if (abs < BASE) { return new BigInteger(multiplySmall(a, abs), sign); } b = smallToArray(abs); } if (useKaratsuba(a.length, b.length)) return new BigInteger(multiplyKaratsuba(a, b), sign); return new BigInteger(multiplyLong(a, b), sign); }; BigInteger.prototype.times = BigInteger.prototype.multiply; function multiplySmallAndArray(a, b, sign) { if (a < BASE) { return new BigInteger(multiplySmall(b, a), sign); } return new BigInteger(multiplyLong(b, smallToArray(a)), sign); } SmallInteger.prototype._multiplyBySmall = function(a) { if (isPrecise(a.value * this.value)) { return new SmallInteger(a.value * this.value); } return multiplySmallAndArray(Math.abs(a.value), smallToArray(Math.abs(this.value)), this.sign !== a.sign); }; BigInteger.prototype._multiplyBySmall = function(a) { if (a.value === 0) return Integer[0]; if (a.value === 1) return this; if (a.value === -1) return this.negate(); return multiplySmallAndArray(Math.abs(a.value), this.value, this.sign !== a.sign); }; SmallInteger.prototype.multiply = function(v) { return parseValue(v)._multiplyBySmall(this); }; SmallInteger.prototype.times = SmallInteger.prototype.multiply; NativeBigInt.prototype.multiply = function(v) { return new NativeBigInt(this.value * parseValue(v).value); }; NativeBigInt.prototype.times = NativeBigInt.prototype.multiply; function square(a) { var l = a.length, r = createArray(l + l), base = BASE, product, carry, i2, a_i, a_j; for (i2 = 0; i2 < l; i2++) { a_i = a[i2]; carry = 0 - a_i * a_i; for (var j = i2; j < l; j++) { a_j = a[j]; product = 2 * (a_i * a_j) + r[i2 + j] + carry; carry = Math.floor(product / base); r[i2 + j] = product - carry * base; } r[i2 + l] = carry; } trim(r); return r; } BigInteger.prototype.square = function() { return new BigInteger(square(this.value), false); }; SmallInteger.prototype.square = function() { var value = this.value * this.value; if (isPrecise(value)) return new SmallInteger(value); return new BigInteger(square(smallToArray(Math.abs(this.value))), false); }; NativeBigInt.prototype.square = function(v) { return new NativeBigInt(this.value * this.value); }; function divMod1(a, b) { var a_l = a.length, b_l = b.length, base = BASE, result = createArray(b.length), divisorMostSignificantDigit = b[b_l - 1], lambda = Math.ceil(base / (2 * divisorMostSignificantDigit)), remainder = multiplySmall(a, lambda), divisor = multiplySmall(b, lambda), quotientDigit, shift, carry, borrow, i2, l, q; if (remainder.length <= a_l) remainder.push(0); divisor.push(0); divisorMostSignificantDigit = divisor[b_l - 1]; for (shift = a_l - b_l; shift >= 0; shift--) { quotientDigit = base - 1; if (remainder[shift + b_l] !== divisorMostSignificantDigit) { quotientDigit = Math.floor((remainder[shift + b_l] * base + remainder[shift + b_l - 1]) / divisorMostSignificantDigit); } carry = 0; borrow = 0; l = divisor.length; for (i2 = 0; i2 < l; i2++) { carry += quotientDigit * divisor[i2]; q = Math.floor(carry / base); borrow += remainder[shift + i2] - (carry - q * base); carry = q; if (borrow < 0) { remainder[shift + i2] = borrow + base; borrow = -1; } else { remainder[shift + i2] = borrow; borrow = 0; } } while (borrow !== 0) { quotientDigit -= 1; carry = 0; for (i2 = 0; i2 < l; i2++) { carry += remainder[shift + i2] - base + divisor[i2]; if (carry < 0) { remainder[shift + i2] = carry + base; carry = 0; } else { remainder[shift + i2] = carry; carry = 1; } } borrow += carry; } result[shift] = quotientDigit; } remainder = divModSmall(remainder, lambda)[0]; return [arrayToSmall(result), arrayToSmall(remainder)]; } function divMod2(a, b) { var a_l = a.length, b_l = b.length, result = [], part = [], base = BASE, guess, xlen, highx, highy, check; while (a_l) { part.unshift(a[--a_l]); trim(part); if (compareAbs(part, b) < 0) { result.push(0); continue; } xlen = part.length; highx = part[xlen - 1] * base + part[xlen - 2]; highy = b[b_l - 1] * base + b[b_l - 2]; if (xlen > b_l) { highx = (highx + 1) * base; } guess = Math.ceil(highx / highy); do { check = multiplySmall(b, guess); if (compareAbs(check, part) <= 0) break; guess--; } while (guess); result.push(guess); part = subtract(part, check); } result.reverse(); return [arrayToSmall(result), arrayToSmall(part)]; } function divModSmall(value, lambda) { var length = value.length, quotient = createArray(length), base = BASE, i2, q, remainder, divisor; remainder = 0; for (i2 = length - 1; i2 >= 0; --i2) { divisor = remainder * base + value[i2]; q = truncate(divisor / lambda); remainder = divisor - q * lambda; quotient[i2] = q | 0; } return [quotient, remainder | 0]; } function divModAny(self2, v) { var value, n = parseValue(v); if (supportsNativeBigInt) { return [new NativeBigInt(self2.value / n.value), new NativeBigInt(self2.value % n.value)]; } var a = self2.value, b = n.value; var quotient; if (b === 0) throw new Error("Cannot divide by zero"); if (self2.isSmall) { if (n.isSmall) { return [new SmallInteger(truncate(a / b)), new SmallInteger(a % b)]; } return [Integer[0], self2]; } if (n.isSmall) { if (b === 1) return [self2, Integer[0]]; if (b == -1) return [self2.negate(), Integer[0]]; var abs = Math.abs(b); if (abs < BASE) { value = divModSmall(a, abs); quotient = arrayToSmall(value[0]); var remainder = value[1]; if (self2.sign) remainder = -remainder; if (typeof quotient === "number") { if (self2.sign !== n.sign) quotient = -quotient; return [new SmallInteger(quotient), new SmallInteger(remainder)]; } return [new BigInteger(quotient, self2.sign !== n.sign), new SmallInteger(remainder)]; } b = smallToArray(abs); } var comparison = compareAbs(a, b); if (comparison === -1) return [Integer[0], self2]; if (comparison === 0) return [Integer[self2.sign === n.sign ? 1 : -1], Integer[0]]; if (a.length + b.length <= 200) value = divMod1(a, b); else value = divMod2(a, b); quotient = value[0]; var qSign = self2.sign !== n.sign, mod = value[1], mSign = self2.sign; if (typeof quotient === "number") { if (qSign) quotient = -quotient; quotient = new SmallInteger(quotient); } else quotient = new BigInteger(quotient, qSign); if (typeof mod === "number") { if (mSign) mod = -mod; mod = new SmallInteger(mod); } else mod = new BigInteger(mod, mSign); return [quotient, mod]; } BigInteger.prototype.divmod = function(v) { var result = divModAny(this, v); return { quotient: result[0], remainder: result[1] }; }; NativeBigInt.prototype.divmod = SmallInteger.prototype.divmod = BigInteger.prototype.divmod; BigInteger.prototype.divide = function(v) { return divModAny(this, v)[0]; }; NativeBigInt.prototype.over = NativeBigInt.prototype.divide = function(v) { return new NativeBigInt(this.value / parseValue(v).value); }; SmallInteger.prototype.over = SmallInteger.prototype.divide = BigInteger.prototype.over = BigInteger.prototype.divide; BigInteger.prototype.mod = function(v) { return divModAny(this, v)[1]; }; NativeBigInt.prototype.mod = NativeBigInt.prototype.remainder = function(v) { return new NativeBigInt(this.value % parseValue(v).value); }; SmallInteger.prototype.remainder = SmallInteger.prototype.mod = BigInteger.prototype.remainder = BigInteger.prototype.mod; BigInteger.prototype.pow = function(v) { var n = parseValue(v), a = this.value, b = n.value, value, x, y; if (b === 0) return Integer[1]; if (a === 0) return Integer[0]; if (a === 1) return Integer[1]; if (a === -1) return n.isEven() ? Integer[1] : Integer[-1]; if (n.sign) { return Integer[0]; } if (!n.isSmall) throw new Error("The exponent " + n.toString() + " is too large."); if (this.isSmall) { if (isPrecise(value = Math.pow(a, b))) return new SmallInteger(truncate(value)); } x = this; y = Integer[1]; while (true) { if (b & true) { y = y.times(x); --b; } if (b === 0) break; b /= 2; x = x.square(); } return y; }; SmallInteger.prototype.pow = BigInteger.prototype.pow; NativeBigInt.prototype.pow = function(v) { var n = parseValue(v); var a = this.value, b = n.value; var _0 = BigInt(0), _1 = BigInt(1), _2 = BigInt(2); if (b === _0) return Integer[1]; if (a === _0) return Integer[0]; if (a === _1) return Integer[1]; if (a === BigInt(-1)) return n.isEven() ? Integer[1] : Integer[-1]; if (n.isNegative()) return new NativeBigInt(_0); var x = this; var y = Integer[1]; while (true) { if ((b & _1) === _1) { y = y.times(x); --b; } if (b === _0) break; b /= _2; x = x.square(); } return y; }; BigInteger.prototype.modPow = function(exp, mod) { exp = parseValue(exp); mod = parseValue(mod); if (mod.isZero()) throw new Error("Cannot take modPow with modulus 0"); var r = Integer[1], base = this.mod(mod); if (exp.isNegative()) { exp = exp.multiply(Integer[-1]); base = base.modInv(mod); } while (exp.isPositive()) { if (base.isZero()) return Integer[0]; if (exp.isOdd()) r = r.multiply(base).mod(mod); exp = exp.divide(2); base = base.square().mod(mod); } return r; }; NativeBigInt.prototype.modPow = SmallInteger.prototype.modPow = BigInteger.prototype.modPow; function compareAbs(a, b) { if (a.length !== b.length) { return a.length > b.length ? 1 : -1; } for (var i2 = a.length - 1; i2 >= 0; i2--) { if (a[i2] !== b[i2]) return a[i2] > b[i2] ? 1 : -1; } return 0; } BigInteger.prototype.compareAbs = function(v) { var n = parseValue(v), a = this.value, b = n.value; if (n.isSmall) return 1; return compareAbs(a, b); }; SmallInteger.prototype.compareAbs = function(v) { var n = parseValue(v), a = Math.abs(this.value), b = n.value; if (n.isSmall) { b = Math.abs(b); return a === b ? 0 : a > b ? 1 : -1; } return -1; }; NativeBigInt.prototype.compareAbs = function(v) { var a = this.value; var b = parseValue(v).value; a = a >= 0 ? a : -a; b = b >= 0 ? b : -b; return a === b ? 0 : a > b ? 1 : -1; }; BigInteger.prototype.compare = function(v) { if (v === Infinity) { return -1; } if (v === -Infinity) { return 1; } var n = parseValue(v), a = this.value, b = n.value; if (this.sign !== n.sign) { return n.sign ? 1 : -1; } if (n.isSmall) { return this.sign ? -1 : 1; } return compareAbs(a, b) * (this.sign ? -1 : 1); }; BigInteger.prototype.compareTo = BigInteger.prototype.compare; SmallInteger.prototype.compare = function(v) { if (v === Infinity) { return -1; } if (v === -Infinity) { return 1; } var n = parseValue(v), a = this.value, b = n.value; if (n.isSmall) { return a == b ? 0 : a > b ? 1 : -1; } if (a < 0 !== n.sign) { return a < 0 ? -1 : 1; } return a < 0 ? 1 : -1; }; SmallInteger.prototype.compareTo = SmallInteger.prototype.compare; NativeBigInt.prototype.compare = function(v) { if (v === Infinity) { return -1; } if (v === -Infinity) { return 1; } var a = this.value; var b = parseValue(v).value; return a === b ? 0 : a > b ? 1 : -1; }; NativeBigInt.prototype.compareTo = NativeBigInt.prototype.compare; BigInteger.prototype.equals = function(v) { return this.compare(v) === 0; }; NativeBigInt.prototype.eq = NativeBigInt.prototype.equals = SmallInteger.prototype.eq = SmallInteger.prototype.equals = BigInteger.prototype.eq = BigInteger.prototype.equals; BigInteger.prototype.notEquals = function(v) { return this.compare(v) !== 0; }; NativeBigInt.prototype.neq = NativeBigInt.prototype.notEquals = SmallInteger.prototype.neq = SmallInteger.prototype.notEquals = BigInteger.prototype.neq = BigInteger.prototype.notEquals; BigInteger.prototype.greater = function(v) { return this.compare(v) > 0; }; NativeBigInt.prototype.gt = NativeBigInt.prototype.greater = SmallInteger.prototype.gt = SmallInteger.prototype.greater = BigInteger.prototype.gt = BigInteger.prototype.greater; BigInteger.prototype.lesser = function(v) { return this.compare(v) < 0; }; NativeBigInt.prototype.lt = NativeBigInt.prototype.lesser = SmallInteger.prototype.lt = SmallInteger.prototype.lesser = BigInteger.prototype.lt = BigInteger.prototype.lesser; BigInteger.prototype.greaterOrEquals = function(v) { return this.compare(v) >= 0; }; NativeBigInt.prototype.geq = NativeBigInt.prototype.greaterOrEquals = SmallInteger.prototype.geq = SmallInteger.prototype.greaterOrEquals = BigInteger.prototype.geq = BigInteger.prototype.greaterOrEquals; BigInteger.prototype.lesserOrEquals = function(v) { return this.compare(v) <= 0; }; NativeBigInt.prototype.leq = NativeBigInt.prototype.lesserOrEquals = SmallInteger.prototype.leq = SmallInteger.prototype.lesserOrEquals = BigInteger.prototype.leq = BigInteger.prototype.lesserOrEquals; BigInteger.prototype.isEven = function() { return (this.value[0] & 1) === 0; }; SmallInteger.prototype.isEven = function() { return (this.value & 1) === 0; }; NativeBigInt.prototype.isEven = function() { return (this.value & BigInt(1)) === BigInt(0); }; BigInteger.prototype.isOdd = function() { return (this.value[0] & 1) === 1; }; SmallInteger.prototype.isOdd = function() { return (this.value & 1) === 1; }; NativeBigInt.prototype.isOdd = function() { return (this.value & BigInt(1)) === BigInt(1); }; BigInteger.prototype.isPositive = function() { return !this.sign; }; SmallInteger.prototype.isPositive = function() { return this.value > 0; }; NativeBigInt.prototype.isPositive = SmallInteger.prototype.isPositive; BigInteger.prototype.isNegative = function() { return this.sign; }; SmallInteger.prototype.isNegative = function() { return this.value < 0; }; NativeBigInt.prototype.isNegative = SmallInteger.prototype.isNegative; BigInteger.prototype.isUnit = function() { return false; }; SmallInteger.prototype.isUnit = function() { return Math.abs(this.value) === 1; }; NativeBigInt.prototype.isUnit = function() { return this.abs().value === BigInt(1); }; BigInteger.prototype.isZero = function() { return false; }; SmallInteger.prototype.isZero = function() { return this.value === 0; }; NativeBigInt.prototype.isZero = function() { return this.value === BigInt(0); }; BigInteger.prototype.isDivisibleBy = function(v) { var n = parseValue(v); if (n.isZero()) return false; if (n.isUnit()) return true; if (n.compareAbs(2) === 0) return this.isEven(); return this.mod(n).isZero(); }; NativeBigInt.prototype.isDivisibleBy = SmallInteger.prototype.isDivisibleBy = BigInteger.prototype.isDivisibleBy; function isBasicPrime(v) { var n = v.abs(); if (n.isUnit()) return false; if (n.equals(2) || n.equals(3) || n.equals(5)) return true; if (n.isEven() || n.isDivisibleBy(3) || n.isDivisibleBy(5)) return false; if (n.lesser(49)) return true; } function millerRabinTest(n, a) { var nPrev = n.prev(), b = nPrev, r = 0, d, t, i2, x; while (b.isEven()) b = b.divide(2), r++; next: for (i2 = 0; i2 < a.length; i2++) { if (n.lesser(a[i2])) continue; x = bigInt(a[i2]).modPow(b, n); if (x.isUnit() || x.equals(nPrev)) continue; for (d = r - 1; d != 0; d--) { x = x.square().mod(n); if (x.isUnit()) return false; if (x.equals(nPrev)) continue next; } return false; } return true; } BigInteger.prototype.isPrime = function(strict) { var isPrime = isBasicPrime(this); if (isPrime !== undefined2) return isPrime; var n = this.abs(); var bits = n.bitLength(); if (bits <= 64) return millerRabinTest(n, [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]); var logN = Math.log(2) * bits.toJSNumber(); var t = Math.ceil(strict === true ? 2 * Math.pow(logN, 2) : logN); for (var a = [], i2 = 0; i2 < t; i2++) { a.push(bigInt(i2 + 2)); } return millerRabinTest(n, a); }; NativeBigInt.prototype.isPrime = SmallInteger.prototype.isPrime = BigInteger.prototype.isPrime; BigInteger.prototype.isProbablePrime = function(iterations, rng) { var isPrime = isBasicPrime(this); if (isPrime !== undefined2) return isPrime; var n = this.abs(); var t = iterations === undefined2 ? 5 : iterations; for (var a = [], i2 = 0; i2 < t; i2++) { a.push(bigInt.randBetween(2, n.minus(2), rng)); } return millerRabinTest(n, a); }; NativeBigInt.prototype.isProbablePrime = SmallInteger.prototype.isProbablePrime = BigInteger.prototype.isProbablePrime; BigInteger.prototype.modInv = function(n) { var t = bigInt.zero, newT = bigInt.one, r = parseValue(n), newR = this.abs(), q, lastT, lastR; while (!newR.isZero()) { q = r.divide(newR); lastT = t; lastR = r; t = newT; r = newR; newT = lastT.subtract(q.multiply(newT)); newR = lastR.subtract(q.multiply(newR)); } if (!r.isUnit()) throw new Error(this.toString() + " and " + n.toString() + " are not co-prime"); if (t.compare(0) === -1) { t = t.add(n); } if (this.isNegative()) { return t.negate(); } return t; }; NativeBigInt.prototype.modInv = SmallInteger.prototype.modInv = BigInteger.prototype.modInv; BigInteger.prototype.next = function() { var value = this.value; if (this.sign) { return subtractSmall(value, 1, this.sign); } return new BigInteger(addSmall(value, 1), this.sign); }; SmallInteger.prototype.next = function() { var value = this.value; if (value + 1 < MAX_INT) return new SmallInteger(value + 1); return new BigInteger(MAX_INT_ARR, false); }; NativeBigInt.prototype.next = function() { return new NativeBigInt(this.value + BigInt(1)); }; BigInteger.prototype.prev = function() { var value = this.value; if (this.sign) { return new BigInteger(addSmall(value, 1), true); } return subtractSmall(value, 1, this.sign); }; SmallInteger.prototype.prev = function() { var value = this.value; if (value - 1 > -MAX_INT) return new SmallInteger(value - 1); return new BigInteger(MAX_INT_ARR, true); }; NativeBigInt.prototype.prev = function() { return new NativeBigInt(this.value - BigInt(1)); }; var powersOfTwo = [1]; while (2 * powersOfTwo[powersOfTwo.length - 1] <= BASE) powersOfTwo.push(2 * powersOfTwo[powersOfTwo.length - 1]); var powers2Length = powersOfTwo.length, highestPower2 = powersOfTwo[powers2Length - 1]; function shift_isSmall(n) { return Math.abs(n) <= BASE; } BigInteger.prototype.shiftLeft = function(v) { var n = parseValue(v).toJSNumber(); if (!shift_isSmall(n)) { throw new Error(String(n) + " is too large for shifting."); } if (n < 0) return this.shiftRight(-n); var result = this; if (result.isZero()) return result; while (n >= powers2Length) { result = result.multiply(highestPower2); n -= powers2Length - 1; } return result.multiply(powersOfTwo[n]); }; NativeBigInt.prototype.shiftLeft = SmallInteger.prototype.shiftLeft = BigInteger.prototype.shiftLeft; BigInteger.prototype.shiftRight = function(v) { var remQuo; var n = parseValue(v).toJSNumber(); if (!shift_isSmall(n)) { throw new Error(String(n) + " is too large for shifting."); } if (n < 0) return this.shiftLeft(-n); var result = this; while (n >= powers2Length) { if (result.isZero() || result.isNegative() && result.isUnit()) return result; remQuo = divModAny(result, highestPower2); result = remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0]; n -= powers2Length - 1; } remQuo = divModAny(result, powersOfTwo[n]); return remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0]; }; NativeBigInt.prototype.shiftRight = SmallInteger.prototype.shiftRight = BigInteger.prototype.shiftRight; function bitwise(x, y, fn) { y = parseValue(y); var xSign = x.isNegative(), ySign = y.isNegative(); var xRem = xSign ? x.not() : x, yRem = ySign ? y.not() : y; var xDigit = 0, yDigit = 0; var xDivMod = null, yDivMod = null; var result = []; while (!xRem.isZero() || !yRem.isZero()) { xDivMod = divModAny(xRem, highestPower2); xDigit = xDivMod[1].toJSNumber(); if (xSign) { xDigit = highestPower2 - 1 - xDigit; } yDivMod = divModAny(yRem, highestPower2); yDigit = yDivMod[1].toJSNumber(); if (ySign) { yDigit = highestPower2 - 1 - yDigit; } xRem = xDivMod[0]; yRem = yDivMod[0]; result.push(fn(xDigit, yDigit)); } var sum = fn(xSign ? 1 : 0, ySign ? 1 : 0) !== 0 ? bigInt(-1) : bigInt(0); for (var i2 = result.length - 1; i2 >= 0; i2 -= 1) { sum = sum.multiply(highestPower2).add(bigInt(result[i2])); } return sum; } BigInteger.prototype.not = function() { return this.negate().prev(); }; NativeBigInt.prototype.not = SmallInteger.prototype.not = BigInteger.prototype.not; BigInteger.prototype.and = function(n) { return bitwise(this, n, function(a, b) { return a & b; }); }; NativeBigInt.prototype.and = SmallInteger.prototype.and = BigInteger.prototype.and; BigInteger.prototype.or = function(n) { return bitwise(this, n, function(a, b) { return a | b; }); }; NativeBigInt.prototype.or = SmallInteger.prototype.or = BigInteger.prototype.or; BigInteger.prototype.xor = function(n) { return bitwise(this, n, function(a, b) { return a ^ b; }); }; NativeBigInt.prototype.xor = SmallInteger.prototype.xor = BigInteger.prototype.xor; var LOBMASK_I = 1 << 30, LOBMASK_BI = (BASE & -BASE) * (BASE & -BASE) | LOBMASK_I; function roughLOB(n) { var v = n.value, x = typeof v === "number" ? v | LOBMASK_I : typeof v === "bigint" ? v | BigInt(LOBMASK_I) : v[0] + v[1] * BASE | LOBMASK_BI; return x & -x; } function integerLogarithm(value, base) { if (base.compareTo(value) <= 0) { var tmp = integerLogarithm(value, base.square(base)); var p = tmp.p; var e = tmp.e; var t = p.multiply(base); return t.compareTo(value) <= 0 ? {p: t, e: e * 2 + 1} : {p, e: e * 2}; } return {p: bigInt(1), e: 0}; } BigInteger.prototype.bitLength = function() { var n = this; if (n.compareTo(bigInt(0)) < 0) { n = n.negate().subtract(bigInt(1)); } if (n.compareTo(bigInt(0)) === 0) { return bigInt(0); } return bigInt(integerLogarithm(n, bigInt(2)).e).add(bigInt(1)); }; NativeBigInt.prototype.bitLength = SmallInteger.prototype.bitLength = BigInteger.prototype.bitLength; function max(a, b) { a = parseValue(a); b = parseValue(b); return a.greater(b) ? a : b; } function min(a, b) { a = parseValue(a); b = parseValue(b); return a.lesser(b) ? a : b; } function gcd(a, b) { a = parseValue(a).abs(); b = parseValue(b).abs(); if (a.equals(b)) return a; if (a.isZero()) return b; if (b.isZero()) return a; var c = Integer[1], d, t; while (a.isEven() && b.isEven()) { d = min(roughLOB(a), roughLOB(b)); a = a.divide(d); b = b.divide(d); c = c.multiply(d); } while (a.isEven()) { a = a.divide(roughLOB(a)); } do { while (b.isEven()) { b = b.divide(roughLOB(b)); } if (a.greater(b)) { t = b; b = a; a = t; } b = b.subtract(a); } while (!b.isZero()); return c.isUnit() ? a : a.multiply(c); } function lcm(a, b) { a = parseValue(a).abs(); b = parseValue(b).abs(); return a.divide(gcd(a, b)).multiply(b); } function randBetween(a, b, rng) { a = parseValue(a); b = parseValue(b); var usedRNG = rng || Math.random; var low = min(a, b), high = max(a, b); var range = high.subtract(low).add(1); if (range.isSmall) return low.add(Math.floor(usedRNG() * range)); var digits = toBase(range, BASE).value; var result = [], restricted = true; for (var i2 = 0; i2 < digits.length; i2++) { var top = restricted ? digits[i2] : BASE; var digit = truncate(usedRNG() * top); result.push(digit); if (digit < top) restricted = false; } return low.add(Integer.fromArray(result, BASE, false)); } var parseBase = function(text, base, alphabet, caseSensitive) { alphabet = alphabet || DEFAULT_ALPHABET; text = String(text); if (!caseSensitive) { text = text.toLowerCase(); alphabet = alphabet.toLowerCase(); } var length = text.length; var i2; var absBase = Math.abs(base); var alphabetValues = {}; for (i2 = 0; i2 < alphabet.length; i2++) { alphabetValues[alphabet[i2]] = i2; } for (i2 = 0; i2 < length; i2++) { var c = text[i2]; if (c === "-") continue; if (c in alphabetValues) { if (alphabetValues[c] >= absBase) { if (c === "1" && absBase === 1) continue; throw new Error(c + " is not a valid digit in base " + base + "."); } } } base = parseValue(base); var digits = []; var isNegative = text[0] === "-"; for (i2 = isNegative ? 1 : 0; i2 < text.length; i2++) { var c = text[i2]; if (c in alphabetValues) digits.push(parseValue(alphabetValues[c])); else if (c === "<") { var start = i2; do { i2++; } while (text[i2] !== ">" && i2 < text.length); digits.push(parseValue(text.slice(start + 1, i2))); } else throw new Error(c + " is not a valid character"); } return parseBaseFromArray(digits, base, isNegative); }; function parseBaseFromArray(digits, base, isNegative) { var val = Integer[0], pow = Integer[1], i2; for (i2 = digits.length - 1; i2 >= 0; i2--) { val = val.add(digits[i2].times(pow)); pow = pow.times(base); } return isNegative ? val.negate() : val; } function stringify(digit, alphabet) { alphabet = alphabet || DEFAULT_ALPHABET; if (digit < alphabet.length) { return alphabet[digit]; } return "<" + digit + ">"; } function toBase(n, base) { base = bigInt(base); if (base.isZero()) { if (n.isZero()) return {value: [0], isNegative: false}; throw new Error("Cannot convert nonzero numbers to base 0."); } if (base.equals(-1)) { if (n.isZero()) return {value: [0], isNegative: false}; if (n.isNegative()) return { value: [].concat.apply([], Array.apply(null, Array(-n.toJSNumber())).map(Array.prototype.valueOf, [1, 0])), isNegative: false }; var arr = Array.apply(null, Array(n.toJSNumber() - 1)).map(Array.prototype.valueOf, [0, 1]); arr.unshift([1]); return { value: [].concat.apply([], arr), isNegative: false }; } var neg = false; if (n.isNegative() && base.isPositive()) { neg = true; n = n.abs(); } if (base.isUnit()) { if (n.isZero()) return {value: [0], isNegative: false}; return { value: Array.apply(null, Array(n.toJSNumber())).map(Number.prototype.valueOf, 1), isNegative: neg }; } var out = []; var left = n, divmod; while (left.isNegative() || left.compareAbs(base) >= 0) { divmod = left.divmod(base); left = divmod.quotient; var digit = divmod.remainder; if (digit.isNegative()) { digit = base.minus(digit).abs(); left = left.next(); } out.push(digit.toJSNumber()); } out.push(left.toJSNumber()); return {value: out.reverse(), isNegative: neg}; } function toBaseString(n, base, alphabet) { var arr = toBase(n, base); return (arr.isNegative ? "-" : "") + arr.value.map(function(x) { return stringify(x, alphabet); }).join(""); } BigInteger.prototype.toArray = function(radix) { return toBase(this, radix); }; SmallInteger.prototype.toArray = function(radix) { return toBase(this, radix); }; NativeBigInt.prototype.toArray = function(radix) { return toBase(this, radix); }; BigInteger.prototype.toString = function(radix, alphabet) { if (radix === undefined2) radix = 10; if (radix !== 10) return toBaseString(this, radix, alphabet); var v = this.value, l = v.length, str = String(v[--l]), zeros = "0000000", digit; while (--l >= 0) { digit = String(v[l]); str += zeros.slice(digit.length) + digit; } var sign = this.sign ? "-" : ""; return sign + str; }; SmallInteger.prototype.toString = function(radix, alphabet) { if (radix === undefined2) radix = 10; if (radix != 10) return toBaseString(this, radix, alphabet); return String(this.value); }; NativeBigInt.prototype.toString = SmallInteger.prototype.toString; NativeBigInt.prototype.toJSON = BigInteger.prototype.toJSON = SmallInteger.prototype.toJSON = function() { return this.toString(); }; BigInteger.prototype.valueOf = function() { return parseInt(this.toString(), 10); }; BigInteger.prototype.toJSNumber = BigInteger.prototype.valueOf; SmallInteger.prototype.valueOf = function() { return this.value; }; SmallInteger.prototype.toJSNumber = SmallInteger.prototype.valueOf; NativeBigInt.prototype.valueOf = NativeBigInt.prototype.toJSNumber = function() { return parseInt(this.toString(), 10); }; function parseStringValue(v) { if (isPrecise(+v)) { var x = +v; if (x === truncate(x)) return supportsNativeBigInt ? new NativeBigInt(BigInt(x)) : new SmallInteger(x); throw new Error("Invalid integer: " + v); } var sign = v[0] === "-"; if (sign) v = v.slice(1); var split = v.split(/e/i); if (split.length > 2) throw new Error("Invalid integer: " + split.join("e")); if (split.length === 2) { var exp = split[1]; if (exp[0] === "+") exp = exp.slice(1); exp = +exp; if (exp !== truncate(exp) || !isPrecise(exp)) throw new Error("Invalid integer: " + exp + " is not a valid exponent."); var text = split[0]; var decimalPlace = text.indexOf("."); if (decimalPlace >= 0) { exp -= text.length - decimalPlace - 1; text = text.slice(0, decimalPlace) + text.slice(decimalPlace + 1); } if (exp < 0) throw new Error("Cannot include negative exponent part for integers"); text += new Array(exp + 1).join("0"); v = text; } var isValid = /^([0-9][0-9]*)$/.test(v); if (!isValid) throw new Error("Invalid integer: " + v); if (supportsNativeBigInt) { return new NativeBigInt(BigInt(sign ? "-" + v : v)); } var r = [], max2 = v.length, l = LOG_BASE, min2 = max2 - l; while (max2 > 0) { r.push(+v.slice(min2, max2)); min2 -= l; if (min2 < 0) min2 = 0; max2 -= l; } trim(r); return new BigInteger(r, sign); } function parseNumberValue(v) { if (supportsNativeBigInt) { return new NativeBigInt(BigInt(v)); } if (isPrecise(v)) { if (v !== truncate(v)) throw new Error(v + " is not an integer."); return new SmallInteger(v); } return parseStringValue(v.toString()); } function parseValue(v) { if (typeof v === "number") { return parseNumberValue(v); } if (typeof v === "string") { return parseStringValue(v); } if (typeof v === "bigint") { return new NativeBigInt(v); } return v; } for (var i = 0; i < 1e3; i++) { Integer[i] = parseValue(i); if (i > 0) Integer[-i] = parseValue(-i); } Integer.one = Integer[1]; Integer.zero = Integer[0]; Integer.minusOne = Integer[-1]; Integer.max = max; Integer.min = min; Integer.gcd = gcd; Integer.lcm = lcm; Integer.isInstance = function(x) { return x instanceof BigInteger || x instanceof SmallInteger || x instanceof NativeBigInt; }; Integer.randBetween = randBetween; Integer.fromArray = function(digits, base, isNegative) { return parseBaseFromArray(digits.map(parseValue), parseValue(base || 10), isNegative); }; return Integer; }(); if (typeof module2 !== "undefined" && module2.hasOwnProperty("exports")) { module2.exports = bigInt; } if (typeof define === "function" && define.amd) { define(function() { return bigInt; }); } }); // node_modules/unzipper/lib/Decrypt.js var require_Decrypt = __commonJS((exports2, module2) => { var bigInt = require_BigInteger(); var Stream = require("stream"); if (!Stream.Writable || !Stream.Writable.prototype.destroy) Stream = require_readable(); var table; function generateTable() { var poly = 3988292384, c, n, k; table = []; for (n = 0; n < 256; n++) { c = n; for (k = 0; k < 8; k++) c = c & 1 ? poly ^ c >>> 1 : c = c >>> 1; table[n] = c >>> 0; } } function crc(ch, crc2) { if (!table) generateTable(); if (ch.charCodeAt) ch = ch.charCodeAt(0); return bigInt(crc2).shiftRight(8).and(16777215).xor(table[bigInt(crc2).xor(ch).and(255)]).value; } function Decrypt() { if (!(this instanceof Decrypt)) return new Decrypt(); this.key0 = 305419896; this.key1 = 591751049; this.key2 = 878082192; } Decrypt.prototype.update = function(h) { this.key0 = crc(h, this.key0); this.key1 = bigInt(this.key0).and(255).and(4294967295).add(this.key1); this.key1 = bigInt(this.key1).multiply(134775813).add(1).and(4294967295).value; this.key2 = crc(bigInt(this.key1).shiftRight(24).and(255), this.key2); }; Decrypt.prototype.decryptByte = function(c) { var k = bigInt(this.key2).or(2); c = c ^ bigInt(k).multiply(bigInt(k ^ 1)).shiftRight(8).and(255); this.update(c); return c; }; Decrypt.prototype.stream = function() { var stream = Stream.Transform(), self2 = this; stream._transform = function(d, e, cb) { for (var i = 0; i < d.length; i++) { d[i] = self2.decryptByte(d[i]); } this.push(d); cb(); }; return stream; }; module2.exports = Decrypt; }); // node_modules/unzipper/lib/Open/unzip.js var require_unzip = __commonJS((exports2, module2) => { var Promise2 = require_bluebird(); var Decrypt = require_Decrypt(); var PullStream = require_PullStream(); var Stream = require("stream"); var binary = require_binary(); var zlib = require("zlib"); var parseExtraField = require_parseExtraField(); var Buffer2 = require_Buffer(); var parseDateTime = require_parseDateTime(); if (!Stream.Writable || !Stream.Writable.prototype.destroy) Stream = require_readable(); module2.exports = function unzip(source, offset, _password, directoryVars) { var file = PullStream(), entry = Stream.PassThrough(); var req = source.stream(offset); req.pipe(file).on("error", function(e) { entry.emit("error", e); }); entry.vars = file.pull(30).then(function(data) { var vars = binary.parse(data).word32lu("signature").word16lu("versionsNeededToExtract").word16lu("flags").word16lu("compressionMethod").word16lu("lastModifiedTime").word16lu("lastModifiedDate").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").word16lu("fileNameLength").word16lu("extraFieldLength").vars; vars.lastModifiedDateTime = parseDateTime(vars.lastModifiedDate, vars.lastModifiedTime); return file.pull(vars.fileNameLength).then(function(fileName) { vars.fileName = fileName.toString("utf8"); return file.pull(vars.extraFieldLength); }).then(function(extraField) { var checkEncryption; vars.extra = parseExtraField(extraField, vars); if (directoryVars && directoryVars.compressedSize) vars = directoryVars; if (vars.flags & 1) checkEncryption = file.pull(12).then(function(header) { if (!_password) throw new Error("MISSING_PASSWORD"); var decrypt = Decrypt(); String(_password).split("").forEach(function(d) { decrypt.update(d); }); for (var i = 0; i < header.length; i++) header[i] = decrypt.decryptByte(header[i]); vars.decrypt = decrypt; vars.compressedSize -= 12; var check = vars.flags & 8 ? vars.lastModifiedTime >> 8 & 255 : vars.crc32 >> 24 & 255; if (header[11] !== check) throw new Error("BAD_PASSWORD"); return vars; }); return Promise2.resolve(checkEncryption).then(function() { entry.emit("vars", vars); return vars; }); }); }); entry.vars.then(function(vars) { var fileSizeKnown = !(vars.flags & 8) || vars.compressedSize > 0, eof; var inflater = vars.compressionMethod ? zlib.createInflateRaw() : Stream.PassThrough(); if (fileSizeKnown) { entry.size = vars.uncompressedSize; eof = vars.compressedSize; } else { eof = Buffer2.alloc(4); eof.writeUInt32LE(134695760, 0); } var stream = file.stream(eof); if (vars.decrypt) stream = stream.pipe(vars.decrypt.stream()); stream.pipe(inflater).on("error", function(err) { entry.emit("error", err); }).pipe(entry).on("finish", function() { if (req.abort) req.abort(); else if (req.close) req.close(); else if (req.push) req.push(); else console.log("warning - unable to close stream"); }); }).catch(function(e) { entry.emit("error", e); }); return entry; }; }); // node_modules/unzipper/lib/Open/directory.js var require_directory = __commonJS((exports2, module2) => { var binary = require_binary(); var PullStream = require_PullStream(); var unzip = require_unzip(); var Promise2 = require_bluebird(); var BufferStream = require_BufferStream(); var parseExtraField = require_parseExtraField(); var Buffer2 = require_Buffer(); var path = require("path"); var Writer = require_fstream().Writer; var parseDateTime = require_parseDateTime(); var signature = Buffer2.alloc(4); signature.writeUInt32LE(101010256, 0); function getCrxHeader(source) { var sourceStream = source.stream(0).pipe(PullStream()); return sourceStream.pull(4).then(function(data) { var signature2 = data.readUInt32LE(0); if (signature2 === 875721283) { var crxHeader; return sourceStream.pull(12).then(function(data2) { crxHeader = binary.parse(data2).word32lu("version").word32lu("pubKeyLength").word32lu("signatureLength").vars; }).then(function() { return sourceStream.pull(crxHeader.pubKeyLength + crxHeader.signatureLength); }).then(function(data2) { crxHeader.publicKey = data2.slice(0, crxHeader.pubKeyLength); crxHeader.signature = data2.slice(crxHeader.pubKeyLength); crxHeader.size = 16 + crxHeader.pubKeyLength + crxHeader.signatureLength; return crxHeader; }); } }); } function getZip64CentralDirectory(source, zip64CDL) { var d64loc = binary.parse(zip64CDL).word32lu("signature").word32lu("diskNumber").word64lu("offsetToStartOfCentralDirectory").word32lu("numberOfDisks").vars; if (d64loc.signature != 117853008) { throw new Error("invalid zip64 end of central dir locator signature (0x07064b50): 0x" + d64loc.signature.toString(16)); } var dir64 = PullStream(); source.stream(d64loc.offsetToStartOfCentralDirectory).pipe(dir64); return dir64.pull(56); } function parseZip64DirRecord(dir64record) { var vars = binary.parse(dir64record).word32lu("signature").word64lu("sizeOfCentralDirectory").word16lu("version").word16lu("versionsNeededToExtract").word32lu("diskNumber").word32lu("diskStart").word64lu("numberOfRecordsOnDisk").word64lu("numberOfRecords").word64lu("sizeOfCentralDirectory").word64lu("offsetToStartOfCentralDirectory").vars; if (vars.signature != 101075792) { throw new Error("invalid zip64 end of central dir locator signature (0x06064b50): 0x0" + vars.signature.toString(16)); } return vars; } module2.exports = function centralDirectory(source, options) { var endDir = PullStream(), records = PullStream(), tailSize = options && options.tailSize || 80, sourceSize, crxHeader, startOffset, vars; if (options && options.crx) crxHeader = getCrxHeader(source); return source.size().then(function(size) { sourceSize = size; source.stream(Math.max(0, size - tailSize)).on("error", function(error) { endDir.emit("error", error); }).pipe(endDir); return endDir.pull(signature); }).then(function() { return Promise2.props({directory: endDir.pull(22), crxHeader}); }).then(function(d) { var data = d.directory; startOffset = d.crxHeader && d.crxHeader.size || 0; vars = binary.parse(data).word32lu("signature").word16lu("diskNumber").word16lu("diskStart").word16lu("numberOfRecordsOnDisk").word16lu("numberOfRecords").word32lu("sizeOfCentralDirectory").word32lu("offsetToStartOfCentralDirectory").word16lu("commentLength").vars; if (vars.numberOfRecords == 65535 || vars.numberOfRecords == 65535 || vars.offsetToStartOfCentralDirectory == 4294967295) { const zip64CDLSize = 20; const zip64CDLOffset = sourceSize - (tailSize - endDir.match + zip64CDLSize); const zip64CDLStream = PullStream(); source.stream(zip64CDLOffset).pipe(zip64CDLStream); return zip64CDLStream.pull(zip64CDLSize).then(function(d2) { return getZip64CentralDirectory(source, d2); }).then(function(dir64record) { vars = parseZip64DirRecord(dir64record); }); } else { vars.offsetToStartOfCentralDirectory += startOffset; } }).then(function() { source.stream(vars.offsetToStartOfCentralDirectory).pipe(records); vars.extract = function(opts) { if (!opts || !opts.path) throw new Error("PATH_MISSING"); return vars.files.then(function(files) { return Promise2.map(files, function(entry) { if (entry.type == "Directory") return; var extractPath = path.join(opts.path, entry.path); if (extractPath.indexOf(opts.path) != 0) { return; } var writer = opts.getWriter ? opts.getWriter({path: extractPath}) : Writer({path: extractPath}); return new Promise2(function(resolve, reject) { entry.stream(opts.password).on("error", reject).pipe(writer).on("close", resolve).on("error", reject); }); }, opts.concurrency > 1 ? {concurrency: opts.concurrency || void 0} : void 0); }); }; vars.files = Promise2.mapSeries(Array(vars.numberOfRecords), function() { return records.pull(46).then(function(data) { var vars2 = binary.parse(data).word32lu("signature").word16lu("versionMadeBy").word16lu("versionsNeededToExtract").word16lu("flags").word16lu("compressionMethod").word16lu("lastModifiedTime").word16lu("lastModifiedDate").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").word16lu("fileNameLength").word16lu("extraFieldLength").word16lu("fileCommentLength").word16lu("diskNumber").word16lu("internalFileAttributes").word32lu("externalFileAttributes").word32lu("offsetToLocalFileHeader").vars; vars2.offsetToLocalFileHeader += startOffset; vars2.lastModifiedDateTime = parseDateTime(vars2.lastModifiedDate, vars2.lastModifiedTime); return records.pull(vars2.fileNameLength).then(function(fileNameBuffer) { vars2.pathBuffer = fileNameBuffer; vars2.path = fileNameBuffer.toString("utf8"); vars2.isUnicode = vars2.flags & 17; return records.pull(vars2.extraFieldLength); }).then(function(extraField) { vars2.extra = parseExtraField(extraField, vars2); return records.pull(vars2.fileCommentLength); }).then(function(comment) { vars2.comment = comment; vars2.type = vars2.uncompressedSize === 0 && /[\/\\]$/.test(vars2.path) ? "Directory" : "File"; vars2.stream = function(_password) { return unzip(source, vars2.offsetToLocalFileHeader, _password, vars2); }; vars2.buffer = function(_password) { return BufferStream(vars2.stream(_password)); }; return vars2; }); }); }); return Promise2.props(vars); }); }; }); // node_modules/unzipper/lib/Open/index.js var require_Open = __commonJS((exports2, module2) => { var fs = require_graceful_fs(); var Promise2 = require_bluebird(); var directory = require_directory(); var Stream = require("stream"); if (!Stream.Writable || !Stream.Writable.prototype.destroy) Stream = require_readable(); module2.exports = { buffer: function(buffer, options) { var source = { stream: function(offset, length) { var stream = Stream.PassThrough(); stream.end(buffer.slice(offset, length)); return stream; }, size: function() { return Promise2.resolve(buffer.length); } }; return directory(source, options); }, file: function(filename, options) { var source = { stream: function(offset, length) { return fs.createReadStream(filename, {start: offset, end: length && offset + length}); }, size: function() { return new Promise2(function(resolve, reject) { fs.stat(filename, function(err, d) { if (err) reject(err); else resolve(d.size); }); }); } }; return directory(source, options); }, url: function(request, params, options) { if (typeof params === "string") params = {url: params}; if (!params.url) throw "URL missing"; params.headers = params.headers || {}; var source = { stream: function(offset, length) { var options2 = Object.create(params); options2.headers = Object.create(params.headers); options2.headers.range = "bytes=" + offset + "-" + (length ? length : ""); return request(options2); }, size: function() { return new Promise2(function(resolve, reject) { var req = request(params); req.on("response", function(d) { req.abort(); if (!d.headers["content-length"]) reject(new Error("Missing content length header")); else resolve(d.headers["content-length"]); }).on("error", reject); }); } }; return directory(source, options); }, s3: function(client, params, options) { var source = { size: function() { return new Promise2(function(resolve, reject) { client.headObject(params, function(err, d) { if (err) reject(err); else resolve(d.ContentLength); }); }); }, stream: function(offset, length) { var d = {}; for (var key in params) d[key] = params[key]; d.Range = "bytes=" + offset + "-" + (length ? length : ""); return client.getObject(d).createReadStream(); } }; return directory(source, options); } }; }); // node_modules/unzipper/unzip.js var require_unzip2 = __commonJS((exports2) => { "use strict"; require_listenercount(); require_buffer_indexof_polyfill(); require_setImmediate(); exports2.Parse = require_parse3(); exports2.ParseOne = require_parseOne(); exports2.Extract = require_extract(); exports2.Open = require_Open(); }); // node_modules/isexe/windows.js var require_windows = __commonJS((exports2, module2) => { module2.exports = isexe; isexe.sync = sync; var fs = require("fs"); function checkPathExt(path, options) { var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT; if (!pathext) { return true; } pathext = pathext.split(";"); if (pathext.indexOf("") !== -1) { return true; } for (var i = 0; i < pathext.length; i++) { var p = pathext[i].toLowerCase(); if (p && path.substr(-p.length).toLowerCase() === p) { return true; } } return false; } function checkStat(stat, path, options) { if (!stat.isSymbolicLink() && !stat.isFile()) { return false; } return checkPathExt(path, options); } function isexe(path, options, cb) { fs.stat(path, function(er, stat) { cb(er, er ? false : checkStat(stat, path, options)); }); } function sync(path, options) { return checkStat(fs.statSync(path), path, options); } }); // node_modules/isexe/mode.js var require_mode = __commonJS((exports2, module2) => { module2.exports = isexe; isexe.sync = sync; var fs = require("fs"); function isexe(path, options, cb) { fs.stat(path, function(er, stat) { cb(er, er ? false : checkStat(stat, options)); }); } function sync(path, options) { return checkStat(fs.statSync(path), options); } function checkStat(stat, options) { return stat.isFile() && checkMode(stat, options); } function checkMode(stat, options) { var mod = stat.mode; var uid = stat.uid; var gid = stat.gid; var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid(); var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid(); var u = parseInt("100", 8); var g = parseInt("010", 8); var o = parseInt("001", 8); var ug = u | g; var ret2 = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0; return ret2; } }); // node_modules/isexe/index.js var require_isexe = __commonJS((exports2, module2) => { var fs = require("fs"); var core; if (process.platform === "win32" || global.TESTING_WINDOWS) { core = require_windows(); } else { core = require_mode(); } module2.exports = isexe; isexe.sync = sync; function isexe(path, options, cb) { if (typeof options === "function") { cb = options; options = {}; } if (!cb) { if (typeof Promise !== "function") { throw new TypeError("callback not provided"); } return new Promise(function(resolve, reject) { isexe(path, options || {}, function(er, is) { if (er) { reject(er); } else { resolve(is); } }); }); } core(path, options || {}, function(er, is) { if (er) { if (er.code === "EACCES" || options && options.ignoreErrors) { er = null; is = false; } } cb(er, is); }); } function sync(path, options) { try { return core.sync(path, options || {}); } catch (er) { if (options && options.ignoreErrors || er.code === "EACCES") { return false; } else { throw er; } } } }); // node_modules/which/which.js var require_which = __commonJS((exports2, module2) => { var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys"; var path = require("path"); var COLON = isWindows ? ";" : ":"; var isexe = require_isexe(); var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), {code: "ENOENT"}); var getPathInfo = (cmd, opt) => { const colon = opt.colon || COLON; const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [ ...isWindows ? [process.cwd()] : [], ...(opt.path || process.env.PATH || "").split(colon) ]; const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : ""; const pathExt = isWindows ? pathExtExe.split(colon) : [""]; if (isWindows) { if (cmd.indexOf(".") !== -1 && pathExt[0] !== "") pathExt.unshift(""); } return { pathEnv, pathExt, pathExtExe }; }; var which = (cmd, opt, cb) => { if (typeof opt === "function") { cb = opt; opt = {}; } if (!opt) opt = {}; const {pathEnv, pathExt, pathExtExe} = getPathInfo(cmd, opt); const found = []; const step = (i) => new Promise((resolve, reject) => { if (i === pathEnv.length) return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd)); const ppRaw = pathEnv[i]; const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw; const pCmd = path.join(pathPart, cmd); const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd; resolve(subStep(p, i, 0)); }); const subStep = (p, i, ii) => new Promise((resolve, reject) => { if (ii === pathExt.length) return resolve(step(i + 1)); const ext = pathExt[ii]; isexe(p + ext, {pathExt: pathExtExe}, (er, is) => { if (!er && is) { if (opt.all) found.push(p + ext); else return resolve(p + ext); } return resolve(subStep(p, i, ii + 1)); }); }); return cb ? step(0).then((res) => cb(null, res), cb) : step(0); }; var whichSync = (cmd, opt) => { opt = opt || {}; const {pathEnv, pathExt, pathExtExe} = getPathInfo(cmd, opt); const found = []; for (let i = 0; i < pathEnv.length; i++) { const ppRaw = pathEnv[i]; const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw; const pCmd = path.join(pathPart, cmd); const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd; for (let j = 0; j < pathExt.length; j++) { const cur = p + pathExt[j]; try { const is = isexe.sync(cur, {pathExt: pathExtExe}); if (is) { if (opt.all) found.push(cur); else return cur; } } catch (ex) { } } } if (opt.all && found.length) return found; if (opt.nothrow) return null; throw getNotFoundError(cmd); }; module2.exports = which; which.sync = whichSync; }); // node_modules/@clangd/install/out/src/index.js var require_src = __commonJS((exports2) => { "use strict"; var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve) { resolve(value); }); } return new (P || (P = Promise))(function(resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __asyncValues = exports2 && exports2.__asyncValues || function(o) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var m = o[Symbol.asyncIterator], i; return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { return this; }, i); function verb(n) { i[n] = o[n] && function(v) { return new Promise(function(resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v2) { resolve({value: v2, done: d}); }, reject); } }; Object.defineProperty(exports2, "__esModule", {value: true}); var abort_controller_1 = require_abort_controller(); var child_process = require("child_process"); var fs = require("fs"); var node_fetch_1 = require_lib(); var os = require("os"); var path = require("path"); var readdirp = require_readdirp(); var rimraf = require_rimraf(); var semver = require_semver2(); var stream = require("stream"); var unzipper = require_unzip2(); var util_1 = require("util"); var which = require_which(); function prepare2(ui, checkUpdate) { return __awaiter(this, void 0, void 0, function* () { try { var absPath = yield util_1.promisify(which)(ui.clangdPath); } catch (e) { return {clangdPath: null, background: recover(ui)}; } return { clangdPath: absPath, background: checkUpdate ? checkUpdates2(false, ui) : Promise.resolve() }; }); } exports2.prepare = prepare2; function installLatest2(ui) { return __awaiter(this, void 0, void 0, function* () { const abort = new abort_controller_1.AbortController(); try { const release = yield Github.latestRelease(); const asset = yield Github.chooseAsset(release); ui.clangdPath = yield Install.install(release, asset, abort, ui); ui.promptReload(`clangd ${release.name} is now installed.`); } catch (e) { if (!abort.signal.aborted) { console.error("Failed to install clangd: ", e); const message = `Failed to install clangd language server: ${e} You may want to install it manually.`; ui.showHelp(message, installURL); } } }); } exports2.installLatest = installLatest2; function checkUpdates2(requested, ui) { return __awaiter(this, void 0, void 0, function* () { try { var release = yield Github.latestRelease(); yield Github.chooseAsset(release); var upgrade = yield Version.upgrade(release, ui.clangdPath); } catch (e) { console.log("Failed to check for clangd update: ", e); if (requested) ui.error(`Failed to check for clangd update: ${e}`); return; } console.log("Checking for clangd update: available=", upgrade.new, " installed=", upgrade.old); if (!upgrade.upgrade) { if (requested) ui.info(`clangd is up-to-date (you have ${upgrade.old}, latest is ${upgrade.new})`); return; } ui.promptUpdate(upgrade.old, upgrade.new); }); } exports2.checkUpdates = checkUpdates2; function recover(ui) { return __awaiter(this, void 0, void 0, function* () { try { const release = yield Github.latestRelease(); yield Github.chooseAsset(release); ui.promptInstall(release.name); } catch (e) { console.error("Auto-install failed: ", e); ui.showHelp("The clangd language server is not installed.", installURL); } }); } var installURL = "https://clangd.llvm.org/installation.html"; var githubReleaseURL = "https://api.github.com/repos/clangd/clangd/releases/latest"; function fakeGitHubReleaseURL(u) { githubReleaseURL = u; } exports2.fakeGitHubReleaseURL = fakeGitHubReleaseURL; var lddCommand = "ldd"; function fakeLddCommand(l) { lddCommand = l; } exports2.fakeLddCommand = fakeLddCommand; var Github; (function(Github2) { function latestRelease() { return __awaiter(this, void 0, void 0, function* () { const response = yield node_fetch_1.default(githubReleaseURL); if (!response.ok) { console.log(response.url, response.status, response.statusText); throw new Error(`Can't fetch release: ${response.statusText}`); } return yield response.json(); }); } Github2.latestRelease = latestRelease; function chooseAsset(release) { return __awaiter(this, void 0, void 0, function* () { const variants = { win32: "windows", linux: "linux", darwin: "mac" }; const variant = variants[os.platform()]; if (variant == "linux") { const minGlibc = new semver.Range("2.18"); const oldGlibc = yield Version.oldGlibc(minGlibc); if (oldGlibc) { throw new Error(`The clangd release is not compatible with your system (glibc ${oldGlibc.raw} < ${minGlibc.raw}). Try to install it using your package manager instead.`); } } if (variant && (os.arch() == "x64" || variant == "windows")) { const asset = release.assets.find((a) => a.name.indexOf(variant) >= 0); if (asset) return asset; } throw new Error(`No clangd ${release.name} binary available for ${os.platform()}/${os.arch()}`); }); } Github2.chooseAsset = chooseAsset; })(Github || (Github = {})); var Install; (function(Install2) { function install2(release, asset, abort, ui) { return __awaiter(this, void 0, void 0, function* () { const dirs = yield createDirs(ui); const extractRoot = path.join(dirs.install, release.tag_name); if (yield util_1.promisify(fs.exists)(extractRoot)) { const reuse = yield ui.shouldReuse(release.name); if (reuse === void 0) { abort.abort(); throw new Error(`clangd ${release.name} already installed!`); } if (reuse) { let files = (yield readdirp.promise(extractRoot)).map((e) => e.fullPath); return findExecutable(files); } else { yield util_1.promisify(rimraf)(extractRoot); } } const zipFile = path.join(dirs.download, asset.name); yield download(asset.browser_download_url, zipFile, abort, ui); const archive = yield unzipper.Open.file(zipFile); const executable = findExecutable(archive.files.map((f) => f.path)); yield ui.slow(`Extracting ${asset.name}`, archive.extract({path: extractRoot})); const clangdPath = path.join(extractRoot, executable); yield fs.promises.chmod(clangdPath, 493); yield fs.promises.unlink(zipFile); return clangdPath; }); } Install2.install = install2; function createDirs(ui) { return __awaiter(this, void 0, void 0, function* () { const install3 = path.join(ui.storagePath, "install"); const download2 = path.join(ui.storagePath, "download"); for (const dir of [install3, download2]) yield fs.promises.mkdir(dir, {recursive: true}); return {install: install3, download: download2}; }); } function findExecutable(paths) { const filename = os.platform() == "win32" ? "clangd.exe" : "clangd"; const entry = paths.find((f) => path.posix.basename(f) == filename || path.win32.basename(f) == filename); if (entry == null) throw new Error("Didn't find a clangd executable!"); return entry; } function download(url, dest, abort, ui) { return __awaiter(this, void 0, void 0, function* () { console.log("Downloading ", url, " to ", dest); return ui.progress(`Downloading ${path.basename(dest)}`, abort, (progress) => __awaiter(this, void 0, void 0, function* () { const response = yield node_fetch_1.default(url, {signal: abort.signal}); if (!response.ok) throw new Error(`Failed to download $url`); const size = Number(response.headers.get("content-length")); let read = 0; response.body.on("data", (chunk) => { read += chunk.length; progress(read / size); }); const out = fs.createWriteStream(dest); yield util_1.promisify(stream.pipeline)(response.body, out).catch((e) => { fs.unlink(dest, (_) => null); throw e; }); })); }); } })(Install || (Install = {})); var Version; (function(Version2) { function upgrade(release, clangdPath) { return __awaiter(this, void 0, void 0, function* () { const releasedVer = released(release); const installedVer = yield installed(clangdPath); return { old: installedVer.raw, new: releasedVer.raw, upgrade: rangeGreater(releasedVer, installedVer) }; }); } Version2.upgrade = upgrade; const loose = { loose: true }; function installed(clangdPath) { return __awaiter(this, void 0, void 0, function* () { const output = yield run(clangdPath, ["--version"]); console.log(clangdPath, " --version output: ", output); const prefix = "clangd version "; if (!output.startsWith(prefix)) throw new Error(`Couldn't parse clangd --version output: ${output}`); const rawVersion = output.substr(prefix.length).split(" ", 1)[0]; return new semver.Range(rawVersion, loose); }); } function released(release) { return !semver.validRange(release.tag_name, loose) && semver.validRange(release.name, loose) ? new semver.Range(release.name, loose) : new semver.Range(release.tag_name, loose); } function oldGlibc(min) { return __awaiter(this, void 0, void 0, function* () { const output = yield run(lddCommand, ["--version"]); const line = output.split("\n", 1)[0]; const match = line.match(/^ldd .*glibc.* (\d+(?:\.\d+)+)[^ ]*$/i); if (!match || !semver.validRange(match[1], loose)) { console.error(`Can't glibc version from ldd --version output: ${line}`); return null; } const version = new semver.Range(match[1], loose); console.log("glibc is", version.raw, "min is", min.raw); return rangeGreater(min, version) ? version : null; }); } Version2.oldGlibc = oldGlibc; function run(command, flags) { var e_1, _a; return __awaiter(this, void 0, void 0, function* () { const child = child_process.spawn(command, flags, {stdio: ["ignore", "pipe", "ignore"]}); let output = ""; try { for (var _b = __asyncValues(child.stdout), _c; _c = yield _b.next(), !_c.done; ) { const chunk = _c.value; output += chunk; } } catch (e_1_1) { e_1 = {error: e_1_1}; } finally { try { if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b); } finally { if (e_1) throw e_1.error; } } return output; }); } function rangeGreater(newVer, oldVer) { return semver.gtr(semver.minVersion(newVer), oldVer); } })(Version || (Version = {})); }); // src/index.ts __markAsModule(exports); __export(exports, { activate: () => activate2 }); var import_coc7 = __toModule(require("coc.nvim")); // src/cmds.ts var import_coc = __toModule(require("coc.nvim")); var import_vscode_languageserver_protocol = __toModule(require_main3()); var SwitchSourceHeaderRequest; (function(SwitchSourceHeaderRequest2) { SwitchSourceHeaderRequest2.type = new import_vscode_languageserver_protocol.RequestType("textDocument/switchSourceHeader"); })(SwitchSourceHeaderRequest || (SwitchSourceHeaderRequest = {})); var SymbolInfoRequest; (function(SymbolInfoRequest2) { SymbolInfoRequest2.type = new import_vscode_languageserver_protocol.RequestType("textDocument/symbolInfo"); })(SymbolInfoRequest || (SymbolInfoRequest = {})); function switchSourceHeader(ctx) { return async () => { if (!ctx.client) { return; } const doc = await import_coc.workspace.document; if (!doc) { return; } const params = { uri: doc.uri }; const dest = await ctx.client.sendRequest(SwitchSourceHeaderRequest.type.method, params); if (!dest) { import_coc.window.showMessage(`Didn't find a corresponding file.`); return; } await import_coc.workspace.jumpTo(dest); }; } function symbolInfo(ctx) { return async () => { if (!ctx.client) { return; } const doc = await import_coc.workspace.document; if (!doc) { return; } const position = await import_coc.window.getCursorPosition(); const params = { textDocument: {uri: doc.uri}, position }; const details = await ctx.client.sendRequest(SymbolInfoRequest.type.method, params); if (!details.length) { return; } const detail = details[0]; import_coc.window.showMessage(`name: ${detail.name}, containerName: ${detail.containerName}, usr: ${detail.usr}`); }; } // src/ctx.ts var import_coc4 = __toModule(require("coc.nvim")); // src/config.ts var import_coc2 = __toModule(require("coc.nvim")); var Config = class { constructor() { this.cfg = import_coc2.workspace.getConfiguration("clangd"); } get enabled() { return this.cfg.get("enabled"); } get disableDiagnostics() { return this.cfg.get("disableDiagnostics"); } get disableSnippetCompletion() { return this.cfg.get("disableSnippetCompletion"); } get disableCompletion() { return this.cfg.get("disableCompletion"); } get arguments() { return this.cfg.get("arguments", []); } get trace() { return this.cfg.get("trace", ""); } get fallbackFlags() { return this.cfg.get("fallbackFlags", []); } get semanticHighlighting() { return this.cfg.get("semanticHighlighting"); } get showDBChangedNotification() { return this.cfg.get("showDBChangedNotification"); } get compilationDatabasePath() { return this.cfg.get("compilationDatabasePath"); } get serverCompletionRanking() { return this.cfg.get("serverCompletionRanking"); } }; // src/semantic-highlighting.ts var import_coc3 = __toModule(require("coc.nvim")); var import_vscode_languageserver_protocol2 = __toModule(require_main3()); var SemanticHighlightingFeature = class { constructor(client, context) { this.scopeTable = []; this.bufTokens = {}; context.subscriptions.push(client.onDidChangeState(({newState}) => { if (newState === import_coc3.State.Running) { const notification = new import_vscode_languageserver_protocol2.NotificationType("textDocument/semanticHighlighting"); client.onNotification(notification, this.handleNotification.bind(this)); } })); } dispose() { } initialize(capabilities) { const serverCapabilities = capabilities; if (!serverCapabilities.semanticHighlighting) return; this.scopeTable = serverCapabilities.semanticHighlighting.scopes; } fillClientCapabilities(capabilities) { const textDocumentCapabilities = capabilities.textDocument; textDocumentCapabilities.semanticHighlightingCapabilities = { semanticHighlighting: true }; } async handleNotification(params) { const doc = import_coc3.workspace.getDocument(params.textDocument.uri); if (!(doc.bufnr in this.bufTokens)) this.bufTokens[doc.bufnr] = []; const lines = this.bufTokens[doc.bufnr]; for (const line of params.lines) { while (line.line >= lines.length) lines.push([]); lines[line.line] = this.decodeTokens(line.tokens); } const symbols = []; const skipped = []; for (const [line, tokens] of lines.entries()) { for (const token of tokens) { if (token.kind === "InactiveCode") { skipped.push(import_vscode_languageserver_protocol2.Range.create(line, token.character, line, token.character + token.length)); } else { symbols.push({ id: 0, kind: token.kind, ranges: [import_vscode_languageserver_protocol2.Range.create(line, token.character, line, token.character + token.length)], parentKind: "Unknown", storage: "None" }); } } } await import_coc3.workspace.nvim.call("lsp_cxx_hl#hl#notify_symbols", [doc.bufnr, symbols]); if (skipped.length) { await import_coc3.workspace.nvim.call("lsp_cxx_hl#hl#notify_skipped", [doc.bufnr, skipped]); } } decodeTokens(tokens) { const scopeMask = 65535; const lenShift = 16; const uint32Size = 4; const buf = Buffer.from(tokens, "base64"); const retTokens = []; for (let i = 0, end = buf.length / uint32Size; i < end; i += 2) { const start = buf.readUInt32BE(i * uint32Size); const lenKind = buf.readUInt32BE((i + 1) * uint32Size); const scopeIndex = lenKind & scopeMask; const len = lenKind >>> lenShift; const kind = this.scopeTable[scopeIndex][0]; retTokens.push({character: start, scopeIndex, length: len, kind: this.decodeKind(kind)}); } return retTokens; } decodeKind(kind) { switch (kind) { case "entity.name.function.cpp": return "Function"; case "entity.name.function.method.cpp": return "Method"; case "entity.name.function.method.static.cpp": return "StaticMethod"; case "variable.other.cpp": return "Variable"; case "variable.other.local.cpp": return "LocalVariable"; case "variable.parameter.cpp": return "Parameter"; case "variable.other.field.cpp": return "Field"; case "variable.other.field.static.cpp": return "StaticField"; case "entity.name.type.class.cpp": return "Class"; case "entity.name.type.enum.cpp": return "Enum"; case "variable.other.enummember.cpp": return "EnumConstant"; case "entity.name.type.typedef.cpp": return "Typedef"; case "entity.name.type.dependent.cpp": return "DependentType"; case "entity.name.other.dependent.cpp": return "DependentName"; case "entity.name.namespace.cpp": return "Namespace"; case "entity.name.type.template.cpp": return "TemplateParameter"; case "entity.name.type.concept.cpp": return "Concept"; case "storage.type.primitive.cpp": return "Primitive"; case "entity.name.function.preprocessor.cpp": return "Macro"; case "meta.disabled": return "InactiveCode"; default: return "Unknown"; } } }; // src/ctx.ts var ClangdExtensionFeature = class { constructor() { } dispose() { } initialize() { } fillClientCapabilities(capabilities) { const extendedCompletionCapabilities = capabilities.textDocument.completion; if (extendedCompletionCapabilities) { extendedCompletionCapabilities.editsNearCursor = true; } } }; var Ctx = class { constructor(context) { this.context = context; this.client = null; this.config = new Config(); } async startServer(bin, ...features) { const old = this.client; if (old) { await old.stop(); } const exec = { command: bin, args: this.config.arguments }; if (!!this.config.trace) { exec.options = {env: {CLANGD_TRACE: this.config.trace}}; } const serverOptions = exec; const outputChannel = import_coc4.window.createOutputChannel("clangd"); const initializationOptions = {clangdFileStatus: true, fallbackFlags: this.config.fallbackFlags}; if (this.config.compilationDatabasePath) { initializationOptions.compilationDatabasePath = this.config.compilationDatabasePath; } const clientOptions = { documentSelector: [ {scheme: "file", language: "c"}, {scheme: "file", language: "cpp"}, {scheme: "file", language: "objc"}, {scheme: "file", language: "objcpp"}, {scheme: "file", language: "objective-c"}, {scheme: "file", language: "objective-cpp"}, {scheme: "file", language: "cuda"}, {scheme: "file", language: "arduino"} ], initializationOptions, disableDiagnostics: this.config.disableDiagnostics, disableSnippetCompletion: this.config.disableSnippetCompletion, disableCompletion: this.config.disableCompletion, outputChannel, middleware: { provideOnTypeFormattingEdits: (document2, position, ch, options, token, next) => { const line = document2.getText(import_coc4.Range.create(position.line, 0, position.line, position.character)); if (!line.trim().length) return; if (ch === "\n") ch = ""; return next(document2, position, ch, options, token); }, provideCompletionItem: async (document2, position, context, token, next) => { const list = await next(document2, position, context, token); if (!list) return []; if (!this.config.serverCompletionRanking) return list; const items = (Array.isArray(list) ? list : list.items).map((item) => { var _a; const start = (_a = item.textEdit) == null ? void 0 : _a.range.start; if (start) { const prefix = document2.getText(import_coc4.Range.create(start, position)); if (prefix) item.filterText = prefix + "_" + item.filterText; } return item; }); return {items, isIncomplete: true}; }, provideWorkspaceSymbols: async (query, token, next) => { const symbols = await next(query, token); if (!symbols) return; return symbols.map((symbol) => { if (query.includes("::")) { if (symbol.containerName) { symbol.name = `${symbol.containerName}::${symbol.name}`; } symbol.containerName = ""; } return symbol; }); } } }; const client = new import_coc4.LanguageClient("clangd", serverOptions, clientOptions); client.registerFeature(new ClangdExtensionFeature()); if (this.config.semanticHighlighting) { const lspCxx = await import_coc4.workspace.nvim.call("exists", "g:lsp_cxx_hl_loaded"); if (lspCxx === 1) { client.registerFeature(new SemanticHighlightingFeature(client, this.context)); } } for (const feature of features) client.registerFeature(feature); this.context.subscriptions.push(import_coc4.services.registLanguageClient(client)); await client.onReady(); this.client = client; } get subscriptions() { return this.context.subscriptions; } }; // src/file_status.ts var import_coc5 = __toModule(require("coc.nvim")); var FileStatus = class { constructor() { this.statuses = new Map(); this.statusBarItem = import_coc5.window.createStatusBarItem(0); } onFileUpdated(status) { this.statuses.set(status.uri, status); this.updateStatus(); } async updateStatus() { const doc = await import_coc5.workspace.document; if (!doc) { return; } const status = this.statuses.get(doc.uri); if (!status || status.state === "idle") { this.statusBarItem.hide(); return; } this.statusBarItem.text = `clangd: ` + status.state; this.statusBarItem.show(); } clear() { this.statuses.clear(); this.statusBarItem.hide(); } dispose() { this.statusBarItem.dispose(); } }; // node_modules/event-target-shim/dist/event-target-shim.mjs var privateData = new WeakMap(); var wrappers = new WeakMap(); function pd(event) { const retv = privateData.get(event); console.assert(retv != null, "'this' is expected an Event object, but got", event); return retv; } function setCancelFlag(data) { if (data.passiveListener != null) { if (typeof console !== "undefined" && typeof console.error === "function") { console.error("Unable to preventDefault inside passive event listener invocation.", data.passiveListener); } return; } if (!data.event.cancelable) { return; } data.canceled = true; if (typeof data.event.preventDefault === "function") { data.event.preventDefault(); } } function Event2(eventTarget, event) { privateData.set(this, { eventTarget, event, eventPhase: 2, currentTarget: eventTarget, canceled: false, stopped: false, immediateStopped: false, passiveListener: null, timeStamp: event.timeStamp || Date.now() }); Object.defineProperty(this, "isTrusted", {value: false, enumerable: true}); const keys = Object.keys(event); for (let i = 0; i < keys.length; ++i) { const key = keys[i]; if (!(key in this)) { Object.defineProperty(this, key, defineRedirectDescriptor(key)); } } } Event2.prototype = { get type() { return pd(this).event.type; }, get target() { return pd(this).eventTarget; }, get currentTarget() { return pd(this).currentTarget; }, composedPath() { const currentTarget = pd(this).currentTarget; if (currentTarget == null) { return []; } return [currentTarget]; }, get NONE() { return 0; }, get CAPTURING_PHASE() { return 1; }, get AT_TARGET() { return 2; }, get BUBBLING_PHASE() { return 3; }, get eventPhase() { return pd(this).eventPhase; }, stopPropagation() { const data = pd(this); data.stopped = true; if (typeof data.event.stopPropagation === "function") { data.event.stopPropagation(); } }, stopImmediatePropagation() { const data = pd(this); data.stopped = true; data.immediateStopped = true; if (typeof data.event.stopImmediatePropagation === "function") { data.event.stopImmediatePropagation(); } }, get bubbles() { return Boolean(pd(this).event.bubbles); }, get cancelable() { return Boolean(pd(this).event.cancelable); }, preventDefault() { setCancelFlag(pd(this)); }, get defaultPrevented() { return pd(this).canceled; }, get composed() { return Boolean(pd(this).event.composed); }, get timeStamp() { return pd(this).timeStamp; }, get srcElement() { return pd(this).eventTarget; }, get cancelBubble() { return pd(this).stopped; }, set cancelBubble(value) { if (!value) { return; } const data = pd(this); data.stopped = true; if (typeof data.event.cancelBubble === "boolean") { data.event.cancelBubble = true; } }, get returnValue() { return !pd(this).canceled; }, set returnValue(value) { if (!value) { setCancelFlag(pd(this)); } }, initEvent() { } }; Object.defineProperty(Event2.prototype, "constructor", { value: Event2, configurable: true, writable: true }); if (typeof window !== "undefined" && typeof window.Event !== "undefined") { Object.setPrototypeOf(Event2.prototype, window.Event.prototype); wrappers.set(window.Event.prototype, Event2); } function defineRedirectDescriptor(key) { return { get() { return pd(this).event[key]; }, set(value) { pd(this).event[key] = value; }, configurable: true, enumerable: true }; } function defineCallDescriptor(key) { return { value() { const event = pd(this).event; return event[key].apply(event, arguments); }, configurable: true, enumerable: true }; } function defineWrapper(BaseEvent, proto) { const keys = Object.keys(proto); if (keys.length === 0) { return BaseEvent; } function CustomEvent2(eventTarget, event) { BaseEvent.call(this, eventTarget, event); } CustomEvent2.prototype = Object.create(BaseEvent.prototype, { constructor: {value: CustomEvent2, configurable: true, writable: true} }); for (let i = 0; i < keys.length; ++i) { const key = keys[i]; if (!(key in BaseEvent.prototype)) { const descriptor = Object.getOwnPropertyDescriptor(proto, key); const isFunc = typeof descriptor.value === "function"; Object.defineProperty(CustomEvent2.prototype, key, isFunc ? defineCallDescriptor(key) : defineRedirectDescriptor(key)); } } return CustomEvent2; } function getWrapper(proto) { if (proto == null || proto === Object.prototype) { return Event2; } let wrapper = wrappers.get(proto); if (wrapper == null) { wrapper = defineWrapper(getWrapper(Object.getPrototypeOf(proto)), proto); wrappers.set(proto, wrapper); } return wrapper; } function wrapEvent(eventTarget, event) { const Wrapper = getWrapper(Object.getPrototypeOf(event)); return new Wrapper(eventTarget, event); } function isStopped(event) { return pd(event).immediateStopped; } function setEventPhase(event, eventPhase) { pd(event).eventPhase = eventPhase; } function setCurrentTarget(event, currentTarget) { pd(event).currentTarget = currentTarget; } function setPassiveListener(event, passiveListener) { pd(event).passiveListener = passiveListener; } var listenersMap = new WeakMap(); var CAPTURE = 1; var BUBBLE = 2; var ATTRIBUTE = 3; function isObject2(x) { return x !== null && typeof x === "object"; } function getListeners(eventTarget) { const listeners = listenersMap.get(eventTarget); if (listeners == null) { throw new TypeError("'this' is expected an EventTarget object, but got another value."); } return listeners; } function defineEventAttributeDescriptor(eventName) { return { get() { const listeners = getListeners(this); let node = listeners.get(eventName); while (node != null) { if (node.listenerType === ATTRIBUTE) { return node.listener; } node = node.next; } return null; }, set(listener) { if (typeof listener !== "function" && !isObject2(listener)) { listener = null; } const listeners = getListeners(this); let prev = null; let node = listeners.get(eventName); while (node != null) { if (node.listenerType === ATTRIBUTE) { if (prev !== null) { prev.next = node.next; } else if (node.next !== null) { listeners.set(eventName, node.next); } else { listeners.delete(eventName); } } else { prev = node; } node = node.next; } if (listener !== null) { const newNode = { listener, listenerType: ATTRIBUTE, passive: false, once: false, next: null }; if (prev === null) { listeners.set(eventName, newNode); } else { prev.next = newNode; } } }, configurable: true, enumerable: true }; } function defineEventAttribute(eventTargetPrototype, eventName) { Object.defineProperty(eventTargetPrototype, `on${eventName}`, defineEventAttributeDescriptor(eventName)); } function defineCustomEventTarget(eventNames) { function CustomEventTarget() { EventTarget.call(this); } CustomEventTarget.prototype = Object.create(EventTarget.prototype, { constructor: { value: CustomEventTarget, configurable: true, writable: true } }); for (let i = 0; i < eventNames.length; ++i) { defineEventAttribute(CustomEventTarget.prototype, eventNames[i]); } return CustomEventTarget; } function EventTarget() { if (this instanceof EventTarget) { listenersMap.set(this, new Map()); return; } if (arguments.length === 1 && Array.isArray(arguments[0])) { return defineCustomEventTarget(arguments[0]); } if (arguments.length > 0) { const types = new Array(arguments.length); for (let i = 0; i < arguments.length; ++i) { types[i] = arguments[i]; } return defineCustomEventTarget(types); } throw new TypeError("Cannot call a class as a function"); } EventTarget.prototype = { addEventListener(eventName, listener, options) { if (listener == null) { return; } if (typeof listener !== "function" && !isObject2(listener)) { throw new TypeError("'listener' should be a function or an object."); } const listeners = getListeners(this); const optionsIsObj = isObject2(options); const capture = optionsIsObj ? Boolean(options.capture) : Boolean(options); const listenerType = capture ? CAPTURE : BUBBLE; const newNode = { listener, listenerType, passive: optionsIsObj && Boolean(options.passive), once: optionsIsObj && Boolean(options.once), next: null }; let node = listeners.get(eventName); if (node === void 0) { listeners.set(eventName, newNode); return; } let prev = null; while (node != null) { if (node.listener === listener && node.listenerType === listenerType) { return; } prev = node; node = node.next; } prev.next = newNode; }, removeEventListener(eventName, listener, options) { if (listener == null) { return; } const listeners = getListeners(this); const capture = isObject2(options) ? Boolean(options.capture) : Boolean(options); const listenerType = capture ? CAPTURE : BUBBLE; let prev = null; let node = listeners.get(eventName); while (node != null) { if (node.listener === listener && node.listenerType === listenerType) { if (prev !== null) { prev.next = node.next; } else if (node.next !== null) { listeners.set(eventName, node.next); } else { listeners.delete(eventName); } return; } prev = node; node = node.next; } }, dispatchEvent(event) { if (event == null || typeof event.type !== "string") { throw new TypeError('"event.type" should be a string.'); } const listeners = getListeners(this); const eventName = event.type; let node = listeners.get(eventName); if (node == null) { return true; } const wrappedEvent = wrapEvent(this, event); let prev = null; while (node != null) { if (node.once) { if (prev !== null) { prev.next = node.next; } else if (node.next !== null) { listeners.set(eventName, node.next); } else { listeners.delete(eventName); } } else { prev = node; } setPassiveListener(wrappedEvent, node.passive ? node.listener : null); if (typeof node.listener === "function") { try { node.listener.call(this, wrappedEvent); } catch (err) { if (typeof console !== "undefined" && typeof console.error === "function") { console.error(err); } } } else if (node.listenerType !== ATTRIBUTE && typeof node.listener.handleEvent === "function") { node.listener.handleEvent(wrappedEvent); } if (isStopped(wrappedEvent)) { break; } node = node.next; } setPassiveListener(wrappedEvent, null); setEventPhase(wrappedEvent, 0); setCurrentTarget(wrappedEvent, null); return !wrappedEvent.defaultPrevented; } }; Object.defineProperty(EventTarget.prototype, "constructor", { value: EventTarget, configurable: true, writable: true }); if (typeof window !== "undefined" && typeof window.EventTarget !== "undefined") { Object.setPrototypeOf(EventTarget.prototype, window.EventTarget.prototype); } // src/install.ts var common = __toModule(require_src()); var coc = __toModule(require("coc.nvim")); var UI = class { constructor(context, config) { this.context = context; this.config = config; } get storagePath() { return this.context.storagePath; } slow(title, result) { coc.window.showMessage(title + "..."); return result; } error(s) { coc.window.showMessage(s, "error"); } info(s) { coc.window.showMessage(s); } progress(title, _cancel, body) { return this.slow(title, body(() => { })); } async shouldReuse(release) { coc.window.showMessage(`Reusing existing ${release} installation in ${this.storagePath}`); return true; } async promptReload() { await coc.commands.executeCommand("editor.action.restart"); } showHelp(message, url) { message += ` See ${url}.`; coc.window.showMessage(message); } async promptUpdate(oldVersion, newVersion) { const message = `clangd ${newVersion} is available (you have ${oldVersion}). :CocCommand clangd.install, or :CocSettings to disable clangd.checkUpdates.`; coc.window.showMessage(message); } async promptInstall(version) { const message = `clangd was not found on your PATH. :CocCommand clangd.install will install ${version}.`; coc.window.showMessage(message); } get clangdPath() { return this.config.get("path"); } set clangdPath(p) { this.config.update("path", p, true); } }; async function activate(context) { const cfg = coc.workspace.getConfiguration("clangd"); const ui = new UI(context, cfg); context.subscriptions.push(coc.commands.registerCommand("clangd.install", async () => common.installLatest(ui))); context.subscriptions.push(coc.commands.registerCommand("clangd.update", async () => common.checkUpdates(true, ui))); const status = await common.prepare(ui, cfg.get("checkUpdates", false)); return status.clangdPath; } // src/reload.ts var import_coc6 = __toModule(require("coc.nvim")); var import_path = __toModule(require("path")); var ReloadFeature = class { constructor(ctx, activate3) { this.ctx = ctx; this.activate = activate3; } dispose() { } initialize(caps) { var _a; if ((_a = caps.compilationDatabase) == null ? void 0 : _a.automaticReload) { return; } const fileWatcher = import_coc6.workspace.createFileSystemWatcher("**/{compile_commands.json,compile_flags.txt}"); this.ctx.subscriptions.push(fileWatcher, fileWatcher.onDidChange((e) => this.reload(e.fsPath)), fileWatcher.onDidCreate((e) => this.reload(e.fsPath))); } fillClientCapabilities() { } async reload(url) { const notification = this.ctx.config.showDBChangedNotification; if (notification) { const msg = `${import_path.basename(url)} has changed, clangd is reloading...`; import_coc6.window.showMessage(msg); } for (const sub of this.ctx.subscriptions) { try { sub.dispose(); } catch (e) { console.error(e); } } this.activate(); if (notification) import_coc6.window.showMessage(`clangd has reloaded`); } }; // src/index.ts async function activate2(context) { var _a; const ctx = new Ctx(context); if (!ctx.config.enabled) { return; } const service = import_coc7.services.getService("clangd"); if (service) { import_coc7.window.showMessage(`Looks like you've configured clangd in coc-settings.json, you should remove it to use coc-clangd`, "warning"); return; } const clangdPath = await activate(context); if (!clangdPath) { return; } try { await ctx.startServer(clangdPath, new ReloadFeature(ctx, () => activate2(context))); } catch (e) { return; } const fileStatus = new FileStatus(); context.subscriptions.push(fileStatus, import_coc7.commands.registerCommand("clangd.switchSourceHeader", switchSourceHeader(ctx)), import_coc7.commands.registerCommand("clangd.symbolInfo", symbolInfo(ctx)), ctx.client.onDidChangeState((e) => { var _a2; if (e.newState === import_coc7.State.Running) { (_a2 = ctx.client) == null ? void 0 : _a2.onNotification("textDocument/clangd.fileStatus", (status) => { fileStatus.onFileUpdated(status); }); } else if (e.newState === import_coc7.State.Stopped) { fileStatus.clear(); } }), import_coc7.workspace.onDidOpenTextDocument(() => { fileStatus.updateStatus(); })); (_a = ctx.client) == null ? void 0 : _a.onNotification("textDocument/clangd.fileStatus", (status) => { fileStatus.onFileUpdated(status); }); }