massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-clangd / lib / index.js
1 var __create = Object.create;
2 var __defProp = Object.defineProperty;
3 var __defProps = Object.defineProperties;
4 var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5 var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6 var __getOwnPropNames = Object.getOwnPropertyNames;
7 var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8 var __getProtoOf = Object.getPrototypeOf;
9 var __hasOwnProp = Object.prototype.hasOwnProperty;
10 var __propIsEnum = Object.prototype.propertyIsEnumerable;
11 var __defNormalProp = (obj2, key, value) => key in obj2 ? __defProp(obj2, key, { enumerable: true, configurable: true, writable: true, value }) : obj2[key] = value;
12 var __spreadValues = (a, b) => {
13   for (var prop in b || (b = {}))
14     if (__hasOwnProp.call(b, prop))
15       __defNormalProp(a, prop, b[prop]);
16   if (__getOwnPropSymbols)
17     for (var prop of __getOwnPropSymbols(b)) {
18       if (__propIsEnum.call(b, prop))
19         __defNormalProp(a, prop, b[prop]);
20     }
21   return a;
22 };
23 var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24 var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
25 var __esm = (fn, res) => function __init() {
26   return fn && (res = (0, fn[Object.keys(fn)[0]])(fn = 0)), res;
27 };
28 var __commonJS = (cb, mod) => function __require() {
29   return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
30 };
31 var __export = (target, all) => {
32   __markAsModule(target);
33   for (var name in all)
34     __defProp(target, name, { get: all[name], enumerable: true });
35 };
36 var __reExport = (target, module2, desc) => {
37   if (module2 && typeof module2 === "object" || typeof module2 === "function") {
38     for (let key of __getOwnPropNames(module2))
39       if (!__hasOwnProp.call(target, key) && key !== "default")
40         __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
41   }
42   return target;
43 };
44 var __toModule = (module2) => {
45   return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
46 };
47
48 // node_modules/vscode-jsonrpc/lib/common/ral.js
49 var require_ral = __commonJS({
50   "node_modules/vscode-jsonrpc/lib/common/ral.js"(exports2) {
51     "use strict";
52     Object.defineProperty(exports2, "__esModule", { value: true });
53     var _ral;
54     function RAL() {
55       if (_ral === void 0) {
56         throw new Error(`No runtime abstraction layer installed`);
57       }
58       return _ral;
59     }
60     (function(RAL2) {
61       function install2(ral) {
62         if (ral === void 0) {
63           throw new Error(`No runtime abstraction layer provided`);
64         }
65         _ral = ral;
66       }
67       RAL2.install = install2;
68     })(RAL || (RAL = {}));
69     exports2.default = RAL;
70   }
71 });
72
73 // node_modules/vscode-jsonrpc/lib/common/disposable.js
74 var require_disposable = __commonJS({
75   "node_modules/vscode-jsonrpc/lib/common/disposable.js"(exports2) {
76     "use strict";
77     Object.defineProperty(exports2, "__esModule", { value: true });
78     exports2.Disposable = void 0;
79     var Disposable3;
80     (function(Disposable4) {
81       function create(func) {
82         return {
83           dispose: func
84         };
85       }
86       Disposable4.create = create;
87     })(Disposable3 = exports2.Disposable || (exports2.Disposable = {}));
88   }
89 });
90
91 // node_modules/vscode-jsonrpc/lib/common/messageBuffer.js
92 var require_messageBuffer = __commonJS({
93   "node_modules/vscode-jsonrpc/lib/common/messageBuffer.js"(exports2) {
94     "use strict";
95     Object.defineProperty(exports2, "__esModule", { value: true });
96     exports2.AbstractMessageBuffer = void 0;
97     var CR = 13;
98     var LF = 10;
99     var CRLF = "\r\n";
100     var AbstractMessageBuffer = class {
101       constructor(encoding = "utf-8") {
102         this._encoding = encoding;
103         this._chunks = [];
104         this._totalLength = 0;
105       }
106       get encoding() {
107         return this._encoding;
108       }
109       append(chunk) {
110         const toAppend = typeof chunk === "string" ? this.fromString(chunk, this._encoding) : chunk;
111         this._chunks.push(toAppend);
112         this._totalLength += toAppend.byteLength;
113       }
114       tryReadHeaders() {
115         if (this._chunks.length === 0) {
116           return void 0;
117         }
118         let state = 0;
119         let chunkIndex = 0;
120         let offset = 0;
121         let chunkBytesRead = 0;
122         row:
123           while (chunkIndex < this._chunks.length) {
124             const chunk = this._chunks[chunkIndex];
125             offset = 0;
126             column:
127               while (offset < chunk.length) {
128                 const value = chunk[offset];
129                 switch (value) {
130                   case CR:
131                     switch (state) {
132                       case 0:
133                         state = 1;
134                         break;
135                       case 2:
136                         state = 3;
137                         break;
138                       default:
139                         state = 0;
140                     }
141                     break;
142                   case LF:
143                     switch (state) {
144                       case 1:
145                         state = 2;
146                         break;
147                       case 3:
148                         state = 4;
149                         offset++;
150                         break row;
151                       default:
152                         state = 0;
153                     }
154                     break;
155                   default:
156                     state = 0;
157                 }
158                 offset++;
159               }
160             chunkBytesRead += chunk.byteLength;
161             chunkIndex++;
162           }
163         if (state !== 4) {
164           return void 0;
165         }
166         const buffer = this._read(chunkBytesRead + offset);
167         const result = new Map();
168         const headers = this.toString(buffer, "ascii").split(CRLF);
169         if (headers.length < 2) {
170           return result;
171         }
172         for (let i = 0; i < headers.length - 2; i++) {
173           const header = headers[i];
174           const index = header.indexOf(":");
175           if (index === -1) {
176             throw new Error("Message header must separate key and value using :");
177           }
178           const key = header.substr(0, index);
179           const value = header.substr(index + 1).trim();
180           result.set(key, value);
181         }
182         return result;
183       }
184       tryReadBody(length) {
185         if (this._totalLength < length) {
186           return void 0;
187         }
188         return this._read(length);
189       }
190       get numberOfBytes() {
191         return this._totalLength;
192       }
193       _read(byteCount) {
194         if (byteCount === 0) {
195           return this.emptyBuffer();
196         }
197         if (byteCount > this._totalLength) {
198           throw new Error(`Cannot read so many bytes!`);
199         }
200         if (this._chunks[0].byteLength === byteCount) {
201           const chunk = this._chunks[0];
202           this._chunks.shift();
203           this._totalLength -= byteCount;
204           return this.asNative(chunk);
205         }
206         if (this._chunks[0].byteLength > byteCount) {
207           const chunk = this._chunks[0];
208           const result2 = this.asNative(chunk, byteCount);
209           this._chunks[0] = chunk.slice(byteCount);
210           this._totalLength -= byteCount;
211           return result2;
212         }
213         const result = this.allocNative(byteCount);
214         let resultOffset = 0;
215         let chunkIndex = 0;
216         while (byteCount > 0) {
217           const chunk = this._chunks[chunkIndex];
218           if (chunk.byteLength > byteCount) {
219             const chunkPart = chunk.slice(0, byteCount);
220             result.set(chunkPart, resultOffset);
221             resultOffset += byteCount;
222             this._chunks[chunkIndex] = chunk.slice(byteCount);
223             this._totalLength -= byteCount;
224             byteCount -= byteCount;
225           } else {
226             result.set(chunk, resultOffset);
227             resultOffset += chunk.byteLength;
228             this._chunks.shift();
229             this._totalLength -= chunk.byteLength;
230             byteCount -= chunk.byteLength;
231           }
232         }
233         return result;
234       }
235     };
236     exports2.AbstractMessageBuffer = AbstractMessageBuffer;
237   }
238 });
239
240 // node_modules/vscode-jsonrpc/lib/node/ril.js
241 var require_ril = __commonJS({
242   "node_modules/vscode-jsonrpc/lib/node/ril.js"(exports2) {
243     "use strict";
244     Object.defineProperty(exports2, "__esModule", { value: true });
245     var ral_1 = require_ral();
246     var util_1 = require("util");
247     var disposable_1 = require_disposable();
248     var messageBuffer_1 = require_messageBuffer();
249     var MessageBuffer = class extends messageBuffer_1.AbstractMessageBuffer {
250       constructor(encoding = "utf-8") {
251         super(encoding);
252       }
253       emptyBuffer() {
254         return MessageBuffer.emptyBuffer;
255       }
256       fromString(value, encoding) {
257         return Buffer.from(value, encoding);
258       }
259       toString(value, encoding) {
260         if (value instanceof Buffer) {
261           return value.toString(encoding);
262         } else {
263           return new util_1.TextDecoder(encoding).decode(value);
264         }
265       }
266       asNative(buffer, length) {
267         if (length === void 0) {
268           return buffer instanceof Buffer ? buffer : Buffer.from(buffer);
269         } else {
270           return buffer instanceof Buffer ? buffer.slice(0, length) : Buffer.from(buffer, 0, length);
271         }
272       }
273       allocNative(length) {
274         return Buffer.allocUnsafe(length);
275       }
276     };
277     MessageBuffer.emptyBuffer = Buffer.allocUnsafe(0);
278     var ReadableStreamWrapper = class {
279       constructor(stream) {
280         this.stream = stream;
281       }
282       onClose(listener) {
283         this.stream.on("close", listener);
284         return disposable_1.Disposable.create(() => this.stream.off("close", listener));
285       }
286       onError(listener) {
287         this.stream.on("error", listener);
288         return disposable_1.Disposable.create(() => this.stream.off("error", listener));
289       }
290       onEnd(listener) {
291         this.stream.on("end", listener);
292         return disposable_1.Disposable.create(() => this.stream.off("end", listener));
293       }
294       onData(listener) {
295         this.stream.on("data", listener);
296         return disposable_1.Disposable.create(() => this.stream.off("data", listener));
297       }
298     };
299     var WritableStreamWrapper = class {
300       constructor(stream) {
301         this.stream = stream;
302       }
303       onClose(listener) {
304         this.stream.on("close", listener);
305         return disposable_1.Disposable.create(() => this.stream.off("close", listener));
306       }
307       onError(listener) {
308         this.stream.on("error", listener);
309         return disposable_1.Disposable.create(() => this.stream.off("error", listener));
310       }
311       onEnd(listener) {
312         this.stream.on("end", listener);
313         return disposable_1.Disposable.create(() => this.stream.off("end", listener));
314       }
315       write(data, encoding) {
316         return new Promise((resolve, reject) => {
317           const callback = (error) => {
318             if (error === void 0 || error === null) {
319               resolve();
320             } else {
321               reject(error);
322             }
323           };
324           if (typeof data === "string") {
325             this.stream.write(data, encoding, callback);
326           } else {
327             this.stream.write(data, callback);
328           }
329         });
330       }
331       end() {
332         this.stream.end();
333       }
334     };
335     var _ril = Object.freeze({
336       messageBuffer: Object.freeze({
337         create: (encoding) => new MessageBuffer(encoding)
338       }),
339       applicationJson: Object.freeze({
340         encoder: Object.freeze({
341           name: "application/json",
342           encode: (msg, options) => {
343             try {
344               return Promise.resolve(Buffer.from(JSON.stringify(msg, void 0, 0), options.charset));
345             } catch (err) {
346               return Promise.reject(err);
347             }
348           }
349         }),
350         decoder: Object.freeze({
351           name: "application/json",
352           decode: (buffer, options) => {
353             try {
354               if (buffer instanceof Buffer) {
355                 return Promise.resolve(JSON.parse(buffer.toString(options.charset)));
356               } else {
357                 return Promise.resolve(JSON.parse(new util_1.TextDecoder(options.charset).decode(buffer)));
358               }
359             } catch (err) {
360               return Promise.reject(err);
361             }
362           }
363         })
364       }),
365       stream: Object.freeze({
366         asReadableStream: (stream) => new ReadableStreamWrapper(stream),
367         asWritableStream: (stream) => new WritableStreamWrapper(stream)
368       }),
369       console,
370       timer: Object.freeze({
371         setTimeout(callback, ms, ...args) {
372           return setTimeout(callback, ms, ...args);
373         },
374         clearTimeout(handle) {
375           clearTimeout(handle);
376         },
377         setImmediate(callback, ...args) {
378           return setImmediate(callback, ...args);
379         },
380         clearImmediate(handle) {
381           clearImmediate(handle);
382         }
383       })
384     });
385     function RIL() {
386       return _ril;
387     }
388     (function(RIL2) {
389       function install2() {
390         ral_1.default.install(_ril);
391       }
392       RIL2.install = install2;
393     })(RIL || (RIL = {}));
394     exports2.default = RIL;
395   }
396 });
397
398 // node_modules/vscode-jsonrpc/lib/common/is.js
399 var require_is = __commonJS({
400   "node_modules/vscode-jsonrpc/lib/common/is.js"(exports2) {
401     "use strict";
402     Object.defineProperty(exports2, "__esModule", { value: true });
403     exports2.stringArray = exports2.array = exports2.func = exports2.error = exports2.number = exports2.string = exports2.boolean = void 0;
404     function boolean(value) {
405       return value === true || value === false;
406     }
407     exports2.boolean = boolean;
408     function string(value) {
409       return typeof value === "string" || value instanceof String;
410     }
411     exports2.string = string;
412     function number(value) {
413       return typeof value === "number" || value instanceof Number;
414     }
415     exports2.number = number;
416     function error(value) {
417       return value instanceof Error;
418     }
419     exports2.error = error;
420     function func(value) {
421       return typeof value === "function";
422     }
423     exports2.func = func;
424     function array(value) {
425       return Array.isArray(value);
426     }
427     exports2.array = array;
428     function stringArray(value) {
429       return array(value) && value.every((elem) => string(elem));
430     }
431     exports2.stringArray = stringArray;
432   }
433 });
434
435 // node_modules/vscode-jsonrpc/lib/common/messages.js
436 var require_messages = __commonJS({
437   "node_modules/vscode-jsonrpc/lib/common/messages.js"(exports2) {
438     "use strict";
439     Object.defineProperty(exports2, "__esModule", { value: true });
440     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;
441     var is = require_is();
442     var ErrorCodes;
443     (function(ErrorCodes2) {
444       ErrorCodes2.ParseError = -32700;
445       ErrorCodes2.InvalidRequest = -32600;
446       ErrorCodes2.MethodNotFound = -32601;
447       ErrorCodes2.InvalidParams = -32602;
448       ErrorCodes2.InternalError = -32603;
449       ErrorCodes2.jsonrpcReservedErrorRangeStart = -32099;
450       ErrorCodes2.serverErrorStart = ErrorCodes2.jsonrpcReservedErrorRangeStart;
451       ErrorCodes2.MessageWriteError = -32099;
452       ErrorCodes2.MessageReadError = -32098;
453       ErrorCodes2.ServerNotInitialized = -32002;
454       ErrorCodes2.UnknownErrorCode = -32001;
455       ErrorCodes2.jsonrpcReservedErrorRangeEnd = -32e3;
456       ErrorCodes2.serverErrorEnd = ErrorCodes2.jsonrpcReservedErrorRangeEnd;
457     })(ErrorCodes = exports2.ErrorCodes || (exports2.ErrorCodes = {}));
458     var ResponseError = class extends Error {
459       constructor(code, message, data) {
460         super(message);
461         this.code = is.number(code) ? code : ErrorCodes.UnknownErrorCode;
462         this.data = data;
463         Object.setPrototypeOf(this, ResponseError.prototype);
464       }
465       toJson() {
466         return {
467           code: this.code,
468           message: this.message,
469           data: this.data
470         };
471       }
472     };
473     exports2.ResponseError = ResponseError;
474     var ParameterStructures = class {
475       constructor(kind) {
476         this.kind = kind;
477       }
478       static is(value) {
479         return value === ParameterStructures.auto || value === ParameterStructures.byName || value === ParameterStructures.byPosition;
480       }
481       toString() {
482         return this.kind;
483       }
484     };
485     exports2.ParameterStructures = ParameterStructures;
486     ParameterStructures.auto = new ParameterStructures("auto");
487     ParameterStructures.byPosition = new ParameterStructures("byPosition");
488     ParameterStructures.byName = new ParameterStructures("byName");
489     var AbstractMessageSignature = class {
490       constructor(method, numberOfParams) {
491         this.method = method;
492         this.numberOfParams = numberOfParams;
493       }
494       get parameterStructures() {
495         return ParameterStructures.auto;
496       }
497     };
498     exports2.AbstractMessageSignature = AbstractMessageSignature;
499     var RequestType02 = class extends AbstractMessageSignature {
500       constructor(method) {
501         super(method, 0);
502       }
503     };
504     exports2.RequestType0 = RequestType02;
505     var RequestType3 = class extends AbstractMessageSignature {
506       constructor(method, _parameterStructures = ParameterStructures.auto) {
507         super(method, 1);
508         this._parameterStructures = _parameterStructures;
509       }
510       get parameterStructures() {
511         return this._parameterStructures;
512       }
513     };
514     exports2.RequestType = RequestType3;
515     var RequestType1 = class extends AbstractMessageSignature {
516       constructor(method, _parameterStructures = ParameterStructures.auto) {
517         super(method, 1);
518         this._parameterStructures = _parameterStructures;
519       }
520       get parameterStructures() {
521         return this._parameterStructures;
522       }
523     };
524     exports2.RequestType1 = RequestType1;
525     var RequestType22 = class extends AbstractMessageSignature {
526       constructor(method) {
527         super(method, 2);
528       }
529     };
530     exports2.RequestType2 = RequestType22;
531     var RequestType32 = class extends AbstractMessageSignature {
532       constructor(method) {
533         super(method, 3);
534       }
535     };
536     exports2.RequestType3 = RequestType32;
537     var RequestType4 = class extends AbstractMessageSignature {
538       constructor(method) {
539         super(method, 4);
540       }
541     };
542     exports2.RequestType4 = RequestType4;
543     var RequestType5 = class extends AbstractMessageSignature {
544       constructor(method) {
545         super(method, 5);
546       }
547     };
548     exports2.RequestType5 = RequestType5;
549     var RequestType6 = class extends AbstractMessageSignature {
550       constructor(method) {
551         super(method, 6);
552       }
553     };
554     exports2.RequestType6 = RequestType6;
555     var RequestType7 = class extends AbstractMessageSignature {
556       constructor(method) {
557         super(method, 7);
558       }
559     };
560     exports2.RequestType7 = RequestType7;
561     var RequestType8 = class extends AbstractMessageSignature {
562       constructor(method) {
563         super(method, 8);
564       }
565     };
566     exports2.RequestType8 = RequestType8;
567     var RequestType9 = class extends AbstractMessageSignature {
568       constructor(method) {
569         super(method, 9);
570       }
571     };
572     exports2.RequestType9 = RequestType9;
573     var NotificationType2 = class extends AbstractMessageSignature {
574       constructor(method, _parameterStructures = ParameterStructures.auto) {
575         super(method, 1);
576         this._parameterStructures = _parameterStructures;
577       }
578       get parameterStructures() {
579         return this._parameterStructures;
580       }
581     };
582     exports2.NotificationType = NotificationType2;
583     var NotificationType0 = class extends AbstractMessageSignature {
584       constructor(method) {
585         super(method, 0);
586       }
587     };
588     exports2.NotificationType0 = NotificationType0;
589     var NotificationType1 = class extends AbstractMessageSignature {
590       constructor(method, _parameterStructures = ParameterStructures.auto) {
591         super(method, 1);
592         this._parameterStructures = _parameterStructures;
593       }
594       get parameterStructures() {
595         return this._parameterStructures;
596       }
597     };
598     exports2.NotificationType1 = NotificationType1;
599     var NotificationType22 = class extends AbstractMessageSignature {
600       constructor(method) {
601         super(method, 2);
602       }
603     };
604     exports2.NotificationType2 = NotificationType22;
605     var NotificationType3 = class extends AbstractMessageSignature {
606       constructor(method) {
607         super(method, 3);
608       }
609     };
610     exports2.NotificationType3 = NotificationType3;
611     var NotificationType4 = class extends AbstractMessageSignature {
612       constructor(method) {
613         super(method, 4);
614       }
615     };
616     exports2.NotificationType4 = NotificationType4;
617     var NotificationType5 = class extends AbstractMessageSignature {
618       constructor(method) {
619         super(method, 5);
620       }
621     };
622     exports2.NotificationType5 = NotificationType5;
623     var NotificationType6 = class extends AbstractMessageSignature {
624       constructor(method) {
625         super(method, 6);
626       }
627     };
628     exports2.NotificationType6 = NotificationType6;
629     var NotificationType7 = class extends AbstractMessageSignature {
630       constructor(method) {
631         super(method, 7);
632       }
633     };
634     exports2.NotificationType7 = NotificationType7;
635     var NotificationType8 = class extends AbstractMessageSignature {
636       constructor(method) {
637         super(method, 8);
638       }
639     };
640     exports2.NotificationType8 = NotificationType8;
641     var NotificationType9 = class extends AbstractMessageSignature {
642       constructor(method) {
643         super(method, 9);
644       }
645     };
646     exports2.NotificationType9 = NotificationType9;
647     function isRequestMessage(message) {
648       const candidate = message;
649       return candidate && is.string(candidate.method) && (is.string(candidate.id) || is.number(candidate.id));
650     }
651     exports2.isRequestMessage = isRequestMessage;
652     function isNotificationMessage(message) {
653       const candidate = message;
654       return candidate && is.string(candidate.method) && message.id === void 0;
655     }
656     exports2.isNotificationMessage = isNotificationMessage;
657     function isResponseMessage(message) {
658       const candidate = message;
659       return candidate && (candidate.result !== void 0 || !!candidate.error) && (is.string(candidate.id) || is.number(candidate.id) || candidate.id === null);
660     }
661     exports2.isResponseMessage = isResponseMessage;
662   }
663 });
664
665 // node_modules/vscode-jsonrpc/lib/common/events.js
666 var require_events = __commonJS({
667   "node_modules/vscode-jsonrpc/lib/common/events.js"(exports2) {
668     "use strict";
669     Object.defineProperty(exports2, "__esModule", { value: true });
670     exports2.Emitter = exports2.Event = void 0;
671     var ral_1 = require_ral();
672     var Event2;
673     (function(Event3) {
674       const _disposable = { dispose() {
675       } };
676       Event3.None = function() {
677         return _disposable;
678       };
679     })(Event2 = exports2.Event || (exports2.Event = {}));
680     var CallbackList = class {
681       add(callback, context = null, bucket) {
682         if (!this._callbacks) {
683           this._callbacks = [];
684           this._contexts = [];
685         }
686         this._callbacks.push(callback);
687         this._contexts.push(context);
688         if (Array.isArray(bucket)) {
689           bucket.push({ dispose: () => this.remove(callback, context) });
690         }
691       }
692       remove(callback, context = null) {
693         if (!this._callbacks) {
694           return;
695         }
696         let foundCallbackWithDifferentContext = false;
697         for (let i = 0, len = this._callbacks.length; i < len; i++) {
698           if (this._callbacks[i] === callback) {
699             if (this._contexts[i] === context) {
700               this._callbacks.splice(i, 1);
701               this._contexts.splice(i, 1);
702               return;
703             } else {
704               foundCallbackWithDifferentContext = true;
705             }
706           }
707         }
708         if (foundCallbackWithDifferentContext) {
709           throw new Error("When adding a listener with a context, you should remove it with the same context");
710         }
711       }
712       invoke(...args) {
713         if (!this._callbacks) {
714           return [];
715         }
716         const ret2 = [], callbacks = this._callbacks.slice(0), contexts = this._contexts.slice(0);
717         for (let i = 0, len = callbacks.length; i < len; i++) {
718           try {
719             ret2.push(callbacks[i].apply(contexts[i], args));
720           } catch (e) {
721             ral_1.default().console.error(e);
722           }
723         }
724         return ret2;
725       }
726       isEmpty() {
727         return !this._callbacks || this._callbacks.length === 0;
728       }
729       dispose() {
730         this._callbacks = void 0;
731         this._contexts = void 0;
732       }
733     };
734     var Emitter2 = class {
735       constructor(_options) {
736         this._options = _options;
737       }
738       get event() {
739         if (!this._event) {
740           this._event = (listener, thisArgs, disposables) => {
741             if (!this._callbacks) {
742               this._callbacks = new CallbackList();
743             }
744             if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) {
745               this._options.onFirstListenerAdd(this);
746             }
747             this._callbacks.add(listener, thisArgs);
748             const result = {
749               dispose: () => {
750                 if (!this._callbacks) {
751                   return;
752                 }
753                 this._callbacks.remove(listener, thisArgs);
754                 result.dispose = Emitter2._noop;
755                 if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) {
756                   this._options.onLastListenerRemove(this);
757                 }
758               }
759             };
760             if (Array.isArray(disposables)) {
761               disposables.push(result);
762             }
763             return result;
764           };
765         }
766         return this._event;
767       }
768       fire(event) {
769         if (this._callbacks) {
770           this._callbacks.invoke.call(this._callbacks, event);
771         }
772       }
773       dispose() {
774         if (this._callbacks) {
775           this._callbacks.dispose();
776           this._callbacks = void 0;
777         }
778       }
779     };
780     exports2.Emitter = Emitter2;
781     Emitter2._noop = function() {
782     };
783   }
784 });
785
786 // node_modules/vscode-jsonrpc/lib/common/cancellation.js
787 var require_cancellation = __commonJS({
788   "node_modules/vscode-jsonrpc/lib/common/cancellation.js"(exports2) {
789     "use strict";
790     Object.defineProperty(exports2, "__esModule", { value: true });
791     exports2.CancellationTokenSource = exports2.CancellationToken = void 0;
792     var ral_1 = require_ral();
793     var Is2 = require_is();
794     var events_1 = require_events();
795     var CancellationToken;
796     (function(CancellationToken2) {
797       CancellationToken2.None = Object.freeze({
798         isCancellationRequested: false,
799         onCancellationRequested: events_1.Event.None
800       });
801       CancellationToken2.Cancelled = Object.freeze({
802         isCancellationRequested: true,
803         onCancellationRequested: events_1.Event.None
804       });
805       function is(value) {
806         const candidate = value;
807         return candidate && (candidate === CancellationToken2.None || candidate === CancellationToken2.Cancelled || Is2.boolean(candidate.isCancellationRequested) && !!candidate.onCancellationRequested);
808       }
809       CancellationToken2.is = is;
810     })(CancellationToken = exports2.CancellationToken || (exports2.CancellationToken = {}));
811     var shortcutEvent = Object.freeze(function(callback, context) {
812       const handle = ral_1.default().timer.setTimeout(callback.bind(context), 0);
813       return { dispose() {
814         ral_1.default().timer.clearTimeout(handle);
815       } };
816     });
817     var MutableToken = class {
818       constructor() {
819         this._isCancelled = false;
820       }
821       cancel() {
822         if (!this._isCancelled) {
823           this._isCancelled = true;
824           if (this._emitter) {
825             this._emitter.fire(void 0);
826             this.dispose();
827           }
828         }
829       }
830       get isCancellationRequested() {
831         return this._isCancelled;
832       }
833       get onCancellationRequested() {
834         if (this._isCancelled) {
835           return shortcutEvent;
836         }
837         if (!this._emitter) {
838           this._emitter = new events_1.Emitter();
839         }
840         return this._emitter.event;
841       }
842       dispose() {
843         if (this._emitter) {
844           this._emitter.dispose();
845           this._emitter = void 0;
846         }
847       }
848     };
849     var CancellationTokenSource = class {
850       get token() {
851         if (!this._token) {
852           this._token = new MutableToken();
853         }
854         return this._token;
855       }
856       cancel() {
857         if (!this._token) {
858           this._token = CancellationToken.Cancelled;
859         } else {
860           this._token.cancel();
861         }
862       }
863       dispose() {
864         if (!this._token) {
865           this._token = CancellationToken.None;
866         } else if (this._token instanceof MutableToken) {
867           this._token.dispose();
868         }
869       }
870     };
871     exports2.CancellationTokenSource = CancellationTokenSource;
872   }
873 });
874
875 // node_modules/vscode-jsonrpc/lib/common/messageReader.js
876 var require_messageReader = __commonJS({
877   "node_modules/vscode-jsonrpc/lib/common/messageReader.js"(exports2) {
878     "use strict";
879     Object.defineProperty(exports2, "__esModule", { value: true });
880     exports2.ReadableStreamMessageReader = exports2.AbstractMessageReader = exports2.MessageReader = void 0;
881     var ral_1 = require_ral();
882     var Is2 = require_is();
883     var events_1 = require_events();
884     var MessageReader;
885     (function(MessageReader2) {
886       function is(value) {
887         let candidate = value;
888         return candidate && Is2.func(candidate.listen) && Is2.func(candidate.dispose) && Is2.func(candidate.onError) && Is2.func(candidate.onClose) && Is2.func(candidate.onPartialMessage);
889       }
890       MessageReader2.is = is;
891     })(MessageReader = exports2.MessageReader || (exports2.MessageReader = {}));
892     var AbstractMessageReader = class {
893       constructor() {
894         this.errorEmitter = new events_1.Emitter();
895         this.closeEmitter = new events_1.Emitter();
896         this.partialMessageEmitter = new events_1.Emitter();
897       }
898       dispose() {
899         this.errorEmitter.dispose();
900         this.closeEmitter.dispose();
901       }
902       get onError() {
903         return this.errorEmitter.event;
904       }
905       fireError(error) {
906         this.errorEmitter.fire(this.asError(error));
907       }
908       get onClose() {
909         return this.closeEmitter.event;
910       }
911       fireClose() {
912         this.closeEmitter.fire(void 0);
913       }
914       get onPartialMessage() {
915         return this.partialMessageEmitter.event;
916       }
917       firePartialMessage(info) {
918         this.partialMessageEmitter.fire(info);
919       }
920       asError(error) {
921         if (error instanceof Error) {
922           return error;
923         } else {
924           return new Error(`Reader received error. Reason: ${Is2.string(error.message) ? error.message : "unknown"}`);
925         }
926       }
927     };
928     exports2.AbstractMessageReader = AbstractMessageReader;
929     var ResolvedMessageReaderOptions;
930     (function(ResolvedMessageReaderOptions2) {
931       function fromOptions(options) {
932         var _a;
933         let charset;
934         let result;
935         let contentDecoder;
936         const contentDecoders = new Map();
937         let contentTypeDecoder;
938         const contentTypeDecoders = new Map();
939         if (options === void 0 || typeof options === "string") {
940           charset = options !== null && options !== void 0 ? options : "utf-8";
941         } else {
942           charset = (_a = options.charset) !== null && _a !== void 0 ? _a : "utf-8";
943           if (options.contentDecoder !== void 0) {
944             contentDecoder = options.contentDecoder;
945             contentDecoders.set(contentDecoder.name, contentDecoder);
946           }
947           if (options.contentDecoders !== void 0) {
948             for (const decoder of options.contentDecoders) {
949               contentDecoders.set(decoder.name, decoder);
950             }
951           }
952           if (options.contentTypeDecoder !== void 0) {
953             contentTypeDecoder = options.contentTypeDecoder;
954             contentTypeDecoders.set(contentTypeDecoder.name, contentTypeDecoder);
955           }
956           if (options.contentTypeDecoders !== void 0) {
957             for (const decoder of options.contentTypeDecoders) {
958               contentTypeDecoders.set(decoder.name, decoder);
959             }
960           }
961         }
962         if (contentTypeDecoder === void 0) {
963           contentTypeDecoder = ral_1.default().applicationJson.decoder;
964           contentTypeDecoders.set(contentTypeDecoder.name, contentTypeDecoder);
965         }
966         return { charset, contentDecoder, contentDecoders, contentTypeDecoder, contentTypeDecoders };
967       }
968       ResolvedMessageReaderOptions2.fromOptions = fromOptions;
969     })(ResolvedMessageReaderOptions || (ResolvedMessageReaderOptions = {}));
970     var ReadableStreamMessageReader = class extends AbstractMessageReader {
971       constructor(readable, options) {
972         super();
973         this.readable = readable;
974         this.options = ResolvedMessageReaderOptions.fromOptions(options);
975         this.buffer = ral_1.default().messageBuffer.create(this.options.charset);
976         this._partialMessageTimeout = 1e4;
977         this.nextMessageLength = -1;
978         this.messageToken = 0;
979       }
980       set partialMessageTimeout(timeout) {
981         this._partialMessageTimeout = timeout;
982       }
983       get partialMessageTimeout() {
984         return this._partialMessageTimeout;
985       }
986       listen(callback) {
987         this.nextMessageLength = -1;
988         this.messageToken = 0;
989         this.partialMessageTimer = void 0;
990         this.callback = callback;
991         const result = this.readable.onData((data) => {
992           this.onData(data);
993         });
994         this.readable.onError((error) => this.fireError(error));
995         this.readable.onClose(() => this.fireClose());
996         return result;
997       }
998       onData(data) {
999         this.buffer.append(data);
1000         while (true) {
1001           if (this.nextMessageLength === -1) {
1002             const headers = this.buffer.tryReadHeaders();
1003             if (!headers) {
1004               return;
1005             }
1006             const contentLength = headers.get("Content-Length");
1007             if (!contentLength) {
1008               throw new Error("Header must provide a Content-Length property.");
1009             }
1010             const length = parseInt(contentLength);
1011             if (isNaN(length)) {
1012               throw new Error("Content-Length value must be a number.");
1013             }
1014             this.nextMessageLength = length;
1015           }
1016           const body = this.buffer.tryReadBody(this.nextMessageLength);
1017           if (body === void 0) {
1018             this.setPartialMessageTimer();
1019             return;
1020           }
1021           this.clearPartialMessageTimer();
1022           this.nextMessageLength = -1;
1023           let p;
1024           if (this.options.contentDecoder !== void 0) {
1025             p = this.options.contentDecoder.decode(body);
1026           } else {
1027             p = Promise.resolve(body);
1028           }
1029           p.then((value) => {
1030             this.options.contentTypeDecoder.decode(value, this.options).then((msg) => {
1031               this.callback(msg);
1032             }, (error) => {
1033               this.fireError(error);
1034             });
1035           }, (error) => {
1036             this.fireError(error);
1037           });
1038         }
1039       }
1040       clearPartialMessageTimer() {
1041         if (this.partialMessageTimer) {
1042           ral_1.default().timer.clearTimeout(this.partialMessageTimer);
1043           this.partialMessageTimer = void 0;
1044         }
1045       }
1046       setPartialMessageTimer() {
1047         this.clearPartialMessageTimer();
1048         if (this._partialMessageTimeout <= 0) {
1049           return;
1050         }
1051         this.partialMessageTimer = ral_1.default().timer.setTimeout((token, timeout) => {
1052           this.partialMessageTimer = void 0;
1053           if (token === this.messageToken) {
1054             this.firePartialMessage({ messageToken: token, waitingTime: timeout });
1055             this.setPartialMessageTimer();
1056           }
1057         }, this._partialMessageTimeout, this.messageToken, this._partialMessageTimeout);
1058       }
1059     };
1060     exports2.ReadableStreamMessageReader = ReadableStreamMessageReader;
1061   }
1062 });
1063
1064 // node_modules/vscode-jsonrpc/lib/common/semaphore.js
1065 var require_semaphore = __commonJS({
1066   "node_modules/vscode-jsonrpc/lib/common/semaphore.js"(exports2) {
1067     "use strict";
1068     Object.defineProperty(exports2, "__esModule", { value: true });
1069     exports2.Semaphore = void 0;
1070     var ral_1 = require_ral();
1071     var Semaphore = class {
1072       constructor(capacity = 1) {
1073         if (capacity <= 0) {
1074           throw new Error("Capacity must be greater than 0");
1075         }
1076         this._capacity = capacity;
1077         this._active = 0;
1078         this._waiting = [];
1079       }
1080       lock(thunk) {
1081         return new Promise((resolve, reject) => {
1082           this._waiting.push({ thunk, resolve, reject });
1083           this.runNext();
1084         });
1085       }
1086       get active() {
1087         return this._active;
1088       }
1089       runNext() {
1090         if (this._waiting.length === 0 || this._active === this._capacity) {
1091           return;
1092         }
1093         ral_1.default().timer.setImmediate(() => this.doRunNext());
1094       }
1095       doRunNext() {
1096         if (this._waiting.length === 0 || this._active === this._capacity) {
1097           return;
1098         }
1099         const next = this._waiting.shift();
1100         this._active++;
1101         if (this._active > this._capacity) {
1102           throw new Error(`To many thunks active`);
1103         }
1104         try {
1105           const result = next.thunk();
1106           if (result instanceof Promise) {
1107             result.then((value) => {
1108               this._active--;
1109               next.resolve(value);
1110               this.runNext();
1111             }, (err) => {
1112               this._active--;
1113               next.reject(err);
1114               this.runNext();
1115             });
1116           } else {
1117             this._active--;
1118             next.resolve(result);
1119             this.runNext();
1120           }
1121         } catch (err) {
1122           this._active--;
1123           next.reject(err);
1124           this.runNext();
1125         }
1126       }
1127     };
1128     exports2.Semaphore = Semaphore;
1129   }
1130 });
1131
1132 // node_modules/vscode-jsonrpc/lib/common/messageWriter.js
1133 var require_messageWriter = __commonJS({
1134   "node_modules/vscode-jsonrpc/lib/common/messageWriter.js"(exports2) {
1135     "use strict";
1136     Object.defineProperty(exports2, "__esModule", { value: true });
1137     exports2.WriteableStreamMessageWriter = exports2.AbstractMessageWriter = exports2.MessageWriter = void 0;
1138     var ral_1 = require_ral();
1139     var Is2 = require_is();
1140     var semaphore_1 = require_semaphore();
1141     var events_1 = require_events();
1142     var ContentLength = "Content-Length: ";
1143     var CRLF = "\r\n";
1144     var MessageWriter;
1145     (function(MessageWriter2) {
1146       function is(value) {
1147         let candidate = value;
1148         return candidate && Is2.func(candidate.dispose) && Is2.func(candidate.onClose) && Is2.func(candidate.onError) && Is2.func(candidate.write);
1149       }
1150       MessageWriter2.is = is;
1151     })(MessageWriter = exports2.MessageWriter || (exports2.MessageWriter = {}));
1152     var AbstractMessageWriter = class {
1153       constructor() {
1154         this.errorEmitter = new events_1.Emitter();
1155         this.closeEmitter = new events_1.Emitter();
1156       }
1157       dispose() {
1158         this.errorEmitter.dispose();
1159         this.closeEmitter.dispose();
1160       }
1161       get onError() {
1162         return this.errorEmitter.event;
1163       }
1164       fireError(error, message, count) {
1165         this.errorEmitter.fire([this.asError(error), message, count]);
1166       }
1167       get onClose() {
1168         return this.closeEmitter.event;
1169       }
1170       fireClose() {
1171         this.closeEmitter.fire(void 0);
1172       }
1173       asError(error) {
1174         if (error instanceof Error) {
1175           return error;
1176         } else {
1177           return new Error(`Writer received error. Reason: ${Is2.string(error.message) ? error.message : "unknown"}`);
1178         }
1179       }
1180     };
1181     exports2.AbstractMessageWriter = AbstractMessageWriter;
1182     var ResolvedMessageWriterOptions;
1183     (function(ResolvedMessageWriterOptions2) {
1184       function fromOptions(options) {
1185         var _a, _b;
1186         if (options === void 0 || typeof options === "string") {
1187           return { charset: options !== null && options !== void 0 ? options : "utf-8", contentTypeEncoder: ral_1.default().applicationJson.encoder };
1188         } else {
1189           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 };
1190         }
1191       }
1192       ResolvedMessageWriterOptions2.fromOptions = fromOptions;
1193     })(ResolvedMessageWriterOptions || (ResolvedMessageWriterOptions = {}));
1194     var WriteableStreamMessageWriter = class extends AbstractMessageWriter {
1195       constructor(writable, options) {
1196         super();
1197         this.writable = writable;
1198         this.options = ResolvedMessageWriterOptions.fromOptions(options);
1199         this.errorCount = 0;
1200         this.writeSemaphore = new semaphore_1.Semaphore(1);
1201         this.writable.onError((error) => this.fireError(error));
1202         this.writable.onClose(() => this.fireClose());
1203       }
1204       async write(msg) {
1205         return this.writeSemaphore.lock(async () => {
1206           const payload = this.options.contentTypeEncoder.encode(msg, this.options).then((buffer) => {
1207             if (this.options.contentEncoder !== void 0) {
1208               return this.options.contentEncoder.encode(buffer);
1209             } else {
1210               return buffer;
1211             }
1212           });
1213           return payload.then((buffer) => {
1214             const headers = [];
1215             headers.push(ContentLength, buffer.byteLength.toString(), CRLF);
1216             headers.push(CRLF);
1217             return this.doWrite(msg, headers, buffer);
1218           }, (error) => {
1219             this.fireError(error);
1220             throw error;
1221           });
1222         });
1223       }
1224       async doWrite(msg, headers, data) {
1225         try {
1226           await this.writable.write(headers.join(""), "ascii");
1227           return this.writable.write(data);
1228         } catch (error) {
1229           this.handleError(error, msg);
1230           return Promise.reject(error);
1231         }
1232       }
1233       handleError(error, msg) {
1234         this.errorCount++;
1235         this.fireError(error, msg, this.errorCount);
1236       }
1237       end() {
1238         this.writable.end();
1239       }
1240     };
1241     exports2.WriteableStreamMessageWriter = WriteableStreamMessageWriter;
1242   }
1243 });
1244
1245 // node_modules/vscode-jsonrpc/lib/common/linkedMap.js
1246 var require_linkedMap = __commonJS({
1247   "node_modules/vscode-jsonrpc/lib/common/linkedMap.js"(exports2) {
1248     "use strict";
1249     Object.defineProperty(exports2, "__esModule", { value: true });
1250     exports2.LRUCache = exports2.LinkedMap = exports2.Touch = void 0;
1251     var Touch;
1252     (function(Touch2) {
1253       Touch2.None = 0;
1254       Touch2.First = 1;
1255       Touch2.AsOld = Touch2.First;
1256       Touch2.Last = 2;
1257       Touch2.AsNew = Touch2.Last;
1258     })(Touch = exports2.Touch || (exports2.Touch = {}));
1259     var LinkedMap = class {
1260       constructor() {
1261         this[Symbol.toStringTag] = "LinkedMap";
1262         this._map = new Map();
1263         this._head = void 0;
1264         this._tail = void 0;
1265         this._size = 0;
1266         this._state = 0;
1267       }
1268       clear() {
1269         this._map.clear();
1270         this._head = void 0;
1271         this._tail = void 0;
1272         this._size = 0;
1273         this._state++;
1274       }
1275       isEmpty() {
1276         return !this._head && !this._tail;
1277       }
1278       get size() {
1279         return this._size;
1280       }
1281       get first() {
1282         var _a;
1283         return (_a = this._head) === null || _a === void 0 ? void 0 : _a.value;
1284       }
1285       get last() {
1286         var _a;
1287         return (_a = this._tail) === null || _a === void 0 ? void 0 : _a.value;
1288       }
1289       has(key) {
1290         return this._map.has(key);
1291       }
1292       get(key, touch = Touch.None) {
1293         const item = this._map.get(key);
1294         if (!item) {
1295           return void 0;
1296         }
1297         if (touch !== Touch.None) {
1298           this.touch(item, touch);
1299         }
1300         return item.value;
1301       }
1302       set(key, value, touch = Touch.None) {
1303         let item = this._map.get(key);
1304         if (item) {
1305           item.value = value;
1306           if (touch !== Touch.None) {
1307             this.touch(item, touch);
1308           }
1309         } else {
1310           item = { key, value, next: void 0, previous: void 0 };
1311           switch (touch) {
1312             case Touch.None:
1313               this.addItemLast(item);
1314               break;
1315             case Touch.First:
1316               this.addItemFirst(item);
1317               break;
1318             case Touch.Last:
1319               this.addItemLast(item);
1320               break;
1321             default:
1322               this.addItemLast(item);
1323               break;
1324           }
1325           this._map.set(key, item);
1326           this._size++;
1327         }
1328         return this;
1329       }
1330       delete(key) {
1331         return !!this.remove(key);
1332       }
1333       remove(key) {
1334         const item = this._map.get(key);
1335         if (!item) {
1336           return void 0;
1337         }
1338         this._map.delete(key);
1339         this.removeItem(item);
1340         this._size--;
1341         return item.value;
1342       }
1343       shift() {
1344         if (!this._head && !this._tail) {
1345           return void 0;
1346         }
1347         if (!this._head || !this._tail) {
1348           throw new Error("Invalid list");
1349         }
1350         const item = this._head;
1351         this._map.delete(item.key);
1352         this.removeItem(item);
1353         this._size--;
1354         return item.value;
1355       }
1356       forEach(callbackfn, thisArg) {
1357         const state = this._state;
1358         let current = this._head;
1359         while (current) {
1360           if (thisArg) {
1361             callbackfn.bind(thisArg)(current.value, current.key, this);
1362           } else {
1363             callbackfn(current.value, current.key, this);
1364           }
1365           if (this._state !== state) {
1366             throw new Error(`LinkedMap got modified during iteration.`);
1367           }
1368           current = current.next;
1369         }
1370       }
1371       keys() {
1372         const map = this;
1373         const state = this._state;
1374         let current = this._head;
1375         const iterator = {
1376           [Symbol.iterator]() {
1377             return iterator;
1378           },
1379           next() {
1380             if (map._state !== state) {
1381               throw new Error(`LinkedMap got modified during iteration.`);
1382             }
1383             if (current) {
1384               const result = { value: current.key, done: false };
1385               current = current.next;
1386               return result;
1387             } else {
1388               return { value: void 0, done: true };
1389             }
1390           }
1391         };
1392         return iterator;
1393       }
1394       values() {
1395         const map = this;
1396         const state = this._state;
1397         let current = this._head;
1398         const iterator = {
1399           [Symbol.iterator]() {
1400             return iterator;
1401           },
1402           next() {
1403             if (map._state !== state) {
1404               throw new Error(`LinkedMap got modified during iteration.`);
1405             }
1406             if (current) {
1407               const result = { value: current.value, done: false };
1408               current = current.next;
1409               return result;
1410             } else {
1411               return { value: void 0, done: true };
1412             }
1413           }
1414         };
1415         return iterator;
1416       }
1417       entries() {
1418         const map = this;
1419         const state = this._state;
1420         let current = this._head;
1421         const iterator = {
1422           [Symbol.iterator]() {
1423             return iterator;
1424           },
1425           next() {
1426             if (map._state !== state) {
1427               throw new Error(`LinkedMap got modified during iteration.`);
1428             }
1429             if (current) {
1430               const result = { value: [current.key, current.value], done: false };
1431               current = current.next;
1432               return result;
1433             } else {
1434               return { value: void 0, done: true };
1435             }
1436           }
1437         };
1438         return iterator;
1439       }
1440       [Symbol.iterator]() {
1441         return this.entries();
1442       }
1443       trimOld(newSize) {
1444         if (newSize >= this.size) {
1445           return;
1446         }
1447         if (newSize === 0) {
1448           this.clear();
1449           return;
1450         }
1451         let current = this._head;
1452         let currentSize = this.size;
1453         while (current && currentSize > newSize) {
1454           this._map.delete(current.key);
1455           current = current.next;
1456           currentSize--;
1457         }
1458         this._head = current;
1459         this._size = currentSize;
1460         if (current) {
1461           current.previous = void 0;
1462         }
1463         this._state++;
1464       }
1465       addItemFirst(item) {
1466         if (!this._head && !this._tail) {
1467           this._tail = item;
1468         } else if (!this._head) {
1469           throw new Error("Invalid list");
1470         } else {
1471           item.next = this._head;
1472           this._head.previous = item;
1473         }
1474         this._head = item;
1475         this._state++;
1476       }
1477       addItemLast(item) {
1478         if (!this._head && !this._tail) {
1479           this._head = item;
1480         } else if (!this._tail) {
1481           throw new Error("Invalid list");
1482         } else {
1483           item.previous = this._tail;
1484           this._tail.next = item;
1485         }
1486         this._tail = item;
1487         this._state++;
1488       }
1489       removeItem(item) {
1490         if (item === this._head && item === this._tail) {
1491           this._head = void 0;
1492           this._tail = void 0;
1493         } else if (item === this._head) {
1494           if (!item.next) {
1495             throw new Error("Invalid list");
1496           }
1497           item.next.previous = void 0;
1498           this._head = item.next;
1499         } else if (item === this._tail) {
1500           if (!item.previous) {
1501             throw new Error("Invalid list");
1502           }
1503           item.previous.next = void 0;
1504           this._tail = item.previous;
1505         } else {
1506           const next = item.next;
1507           const previous = item.previous;
1508           if (!next || !previous) {
1509             throw new Error("Invalid list");
1510           }
1511           next.previous = previous;
1512           previous.next = next;
1513         }
1514         item.next = void 0;
1515         item.previous = void 0;
1516         this._state++;
1517       }
1518       touch(item, touch) {
1519         if (!this._head || !this._tail) {
1520           throw new Error("Invalid list");
1521         }
1522         if (touch !== Touch.First && touch !== Touch.Last) {
1523           return;
1524         }
1525         if (touch === Touch.First) {
1526           if (item === this._head) {
1527             return;
1528           }
1529           const next = item.next;
1530           const previous = item.previous;
1531           if (item === this._tail) {
1532             previous.next = void 0;
1533             this._tail = previous;
1534           } else {
1535             next.previous = previous;
1536             previous.next = next;
1537           }
1538           item.previous = void 0;
1539           item.next = this._head;
1540           this._head.previous = item;
1541           this._head = item;
1542           this._state++;
1543         } else if (touch === Touch.Last) {
1544           if (item === this._tail) {
1545             return;
1546           }
1547           const next = item.next;
1548           const previous = item.previous;
1549           if (item === this._head) {
1550             next.previous = void 0;
1551             this._head = next;
1552           } else {
1553             next.previous = previous;
1554             previous.next = next;
1555           }
1556           item.next = void 0;
1557           item.previous = this._tail;
1558           this._tail.next = item;
1559           this._tail = item;
1560           this._state++;
1561         }
1562       }
1563       toJSON() {
1564         const data = [];
1565         this.forEach((value, key) => {
1566           data.push([key, value]);
1567         });
1568         return data;
1569       }
1570       fromJSON(data) {
1571         this.clear();
1572         for (const [key, value] of data) {
1573           this.set(key, value);
1574         }
1575       }
1576     };
1577     exports2.LinkedMap = LinkedMap;
1578     var LRUCache = class extends LinkedMap {
1579       constructor(limit, ratio = 1) {
1580         super();
1581         this._limit = limit;
1582         this._ratio = Math.min(Math.max(0, ratio), 1);
1583       }
1584       get limit() {
1585         return this._limit;
1586       }
1587       set limit(limit) {
1588         this._limit = limit;
1589         this.checkTrim();
1590       }
1591       get ratio() {
1592         return this._ratio;
1593       }
1594       set ratio(ratio) {
1595         this._ratio = Math.min(Math.max(0, ratio), 1);
1596         this.checkTrim();
1597       }
1598       get(key, touch = Touch.AsNew) {
1599         return super.get(key, touch);
1600       }
1601       peek(key) {
1602         return super.get(key, Touch.None);
1603       }
1604       set(key, value) {
1605         super.set(key, value, Touch.Last);
1606         this.checkTrim();
1607         return this;
1608       }
1609       checkTrim() {
1610         if (this.size > this._limit) {
1611           this.trimOld(Math.round(this._limit * this._ratio));
1612         }
1613       }
1614     };
1615     exports2.LRUCache = LRUCache;
1616   }
1617 });
1618
1619 // node_modules/vscode-jsonrpc/lib/common/connection.js
1620 var require_connection = __commonJS({
1621   "node_modules/vscode-jsonrpc/lib/common/connection.js"(exports2) {
1622     "use strict";
1623     Object.defineProperty(exports2, "__esModule", { value: true });
1624     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;
1625     var ral_1 = require_ral();
1626     var Is2 = require_is();
1627     var messages_1 = require_messages();
1628     var linkedMap_1 = require_linkedMap();
1629     var events_1 = require_events();
1630     var cancellation_1 = require_cancellation();
1631     var CancelNotification;
1632     (function(CancelNotification2) {
1633       CancelNotification2.type = new messages_1.NotificationType("$/cancelRequest");
1634     })(CancelNotification || (CancelNotification = {}));
1635     var ProgressNotification;
1636     (function(ProgressNotification2) {
1637       ProgressNotification2.type = new messages_1.NotificationType("$/progress");
1638     })(ProgressNotification || (ProgressNotification = {}));
1639     var ProgressType = class {
1640       constructor() {
1641       }
1642     };
1643     exports2.ProgressType = ProgressType;
1644     var StarRequestHandler;
1645     (function(StarRequestHandler2) {
1646       function is(value) {
1647         return Is2.func(value);
1648       }
1649       StarRequestHandler2.is = is;
1650     })(StarRequestHandler || (StarRequestHandler = {}));
1651     exports2.NullLogger = Object.freeze({
1652       error: () => {
1653       },
1654       warn: () => {
1655       },
1656       info: () => {
1657       },
1658       log: () => {
1659       }
1660     });
1661     var Trace;
1662     (function(Trace2) {
1663       Trace2[Trace2["Off"] = 0] = "Off";
1664       Trace2[Trace2["Messages"] = 1] = "Messages";
1665       Trace2[Trace2["Verbose"] = 2] = "Verbose";
1666     })(Trace = exports2.Trace || (exports2.Trace = {}));
1667     (function(Trace2) {
1668       function fromString(value) {
1669         if (!Is2.string(value)) {
1670           return Trace2.Off;
1671         }
1672         value = value.toLowerCase();
1673         switch (value) {
1674           case "off":
1675             return Trace2.Off;
1676           case "messages":
1677             return Trace2.Messages;
1678           case "verbose":
1679             return Trace2.Verbose;
1680           default:
1681             return Trace2.Off;
1682         }
1683       }
1684       Trace2.fromString = fromString;
1685       function toString(value) {
1686         switch (value) {
1687           case Trace2.Off:
1688             return "off";
1689           case Trace2.Messages:
1690             return "messages";
1691           case Trace2.Verbose:
1692             return "verbose";
1693           default:
1694             return "off";
1695         }
1696       }
1697       Trace2.toString = toString;
1698     })(Trace = exports2.Trace || (exports2.Trace = {}));
1699     var TraceFormat;
1700     (function(TraceFormat2) {
1701       TraceFormat2["Text"] = "text";
1702       TraceFormat2["JSON"] = "json";
1703     })(TraceFormat = exports2.TraceFormat || (exports2.TraceFormat = {}));
1704     (function(TraceFormat2) {
1705       function fromString(value) {
1706         value = value.toLowerCase();
1707         if (value === "json") {
1708           return TraceFormat2.JSON;
1709         } else {
1710           return TraceFormat2.Text;
1711         }
1712       }
1713       TraceFormat2.fromString = fromString;
1714     })(TraceFormat = exports2.TraceFormat || (exports2.TraceFormat = {}));
1715     var SetTraceNotification;
1716     (function(SetTraceNotification2) {
1717       SetTraceNotification2.type = new messages_1.NotificationType("$/setTrace");
1718     })(SetTraceNotification = exports2.SetTraceNotification || (exports2.SetTraceNotification = {}));
1719     var LogTraceNotification;
1720     (function(LogTraceNotification2) {
1721       LogTraceNotification2.type = new messages_1.NotificationType("$/logTrace");
1722     })(LogTraceNotification = exports2.LogTraceNotification || (exports2.LogTraceNotification = {}));
1723     var ConnectionErrors;
1724     (function(ConnectionErrors2) {
1725       ConnectionErrors2[ConnectionErrors2["Closed"] = 1] = "Closed";
1726       ConnectionErrors2[ConnectionErrors2["Disposed"] = 2] = "Disposed";
1727       ConnectionErrors2[ConnectionErrors2["AlreadyListening"] = 3] = "AlreadyListening";
1728     })(ConnectionErrors = exports2.ConnectionErrors || (exports2.ConnectionErrors = {}));
1729     var ConnectionError = class extends Error {
1730       constructor(code, message) {
1731         super(message);
1732         this.code = code;
1733         Object.setPrototypeOf(this, ConnectionError.prototype);
1734       }
1735     };
1736     exports2.ConnectionError = ConnectionError;
1737     var ConnectionStrategy;
1738     (function(ConnectionStrategy2) {
1739       function is(value) {
1740         const candidate = value;
1741         return candidate && Is2.func(candidate.cancelUndispatched);
1742       }
1743       ConnectionStrategy2.is = is;
1744     })(ConnectionStrategy = exports2.ConnectionStrategy || (exports2.ConnectionStrategy = {}));
1745     var CancellationReceiverStrategy;
1746     (function(CancellationReceiverStrategy2) {
1747       CancellationReceiverStrategy2.Message = Object.freeze({
1748         createCancellationTokenSource(_) {
1749           return new cancellation_1.CancellationTokenSource();
1750         }
1751       });
1752       function is(value) {
1753         const candidate = value;
1754         return candidate && Is2.func(candidate.createCancellationTokenSource);
1755       }
1756       CancellationReceiverStrategy2.is = is;
1757     })(CancellationReceiverStrategy = exports2.CancellationReceiverStrategy || (exports2.CancellationReceiverStrategy = {}));
1758     var CancellationSenderStrategy;
1759     (function(CancellationSenderStrategy2) {
1760       CancellationSenderStrategy2.Message = Object.freeze({
1761         sendCancellation(conn, id) {
1762           conn.sendNotification(CancelNotification.type, { id });
1763         },
1764         cleanup(_) {
1765         }
1766       });
1767       function is(value) {
1768         const candidate = value;
1769         return candidate && Is2.func(candidate.sendCancellation) && Is2.func(candidate.cleanup);
1770       }
1771       CancellationSenderStrategy2.is = is;
1772     })(CancellationSenderStrategy = exports2.CancellationSenderStrategy || (exports2.CancellationSenderStrategy = {}));
1773     var CancellationStrategy;
1774     (function(CancellationStrategy2) {
1775       CancellationStrategy2.Message = Object.freeze({
1776         receiver: CancellationReceiverStrategy.Message,
1777         sender: CancellationSenderStrategy.Message
1778       });
1779       function is(value) {
1780         const candidate = value;
1781         return candidate && CancellationReceiverStrategy.is(candidate.receiver) && CancellationSenderStrategy.is(candidate.sender);
1782       }
1783       CancellationStrategy2.is = is;
1784     })(CancellationStrategy = exports2.CancellationStrategy || (exports2.CancellationStrategy = {}));
1785     var ConnectionOptions;
1786     (function(ConnectionOptions2) {
1787       function is(value) {
1788         const candidate = value;
1789         return candidate && (CancellationStrategy.is(candidate.cancellationStrategy) || ConnectionStrategy.is(candidate.connectionStrategy));
1790       }
1791       ConnectionOptions2.is = is;
1792     })(ConnectionOptions = exports2.ConnectionOptions || (exports2.ConnectionOptions = {}));
1793     var ConnectionState;
1794     (function(ConnectionState2) {
1795       ConnectionState2[ConnectionState2["New"] = 1] = "New";
1796       ConnectionState2[ConnectionState2["Listening"] = 2] = "Listening";
1797       ConnectionState2[ConnectionState2["Closed"] = 3] = "Closed";
1798       ConnectionState2[ConnectionState2["Disposed"] = 4] = "Disposed";
1799     })(ConnectionState || (ConnectionState = {}));
1800     function createMessageConnection(messageReader, messageWriter, _logger, options) {
1801       const logger = _logger !== void 0 ? _logger : exports2.NullLogger;
1802       let sequenceNumber = 0;
1803       let notificationSquenceNumber = 0;
1804       let unknownResponseSquenceNumber = 0;
1805       const version = "2.0";
1806       let starRequestHandler = void 0;
1807       const requestHandlers = Object.create(null);
1808       let starNotificationHandler = void 0;
1809       const notificationHandlers = Object.create(null);
1810       const progressHandlers = new Map();
1811       let timer;
1812       let messageQueue = new linkedMap_1.LinkedMap();
1813       let responsePromises = Object.create(null);
1814       let requestTokens = Object.create(null);
1815       let trace = Trace.Off;
1816       let traceFormat = TraceFormat.Text;
1817       let tracer;
1818       let state = ConnectionState.New;
1819       const errorEmitter = new events_1.Emitter();
1820       const closeEmitter = new events_1.Emitter();
1821       const unhandledNotificationEmitter = new events_1.Emitter();
1822       const unhandledProgressEmitter = new events_1.Emitter();
1823       const disposeEmitter = new events_1.Emitter();
1824       const cancellationStrategy = options && options.cancellationStrategy ? options.cancellationStrategy : CancellationStrategy.Message;
1825       function createRequestQueueKey(id) {
1826         if (id === null) {
1827           throw new Error(`Can't send requests with id null since the response can't be correlated.`);
1828         }
1829         return "req-" + id.toString();
1830       }
1831       function createResponseQueueKey(id) {
1832         if (id === null) {
1833           return "res-unknown-" + (++unknownResponseSquenceNumber).toString();
1834         } else {
1835           return "res-" + id.toString();
1836         }
1837       }
1838       function createNotificationQueueKey() {
1839         return "not-" + (++notificationSquenceNumber).toString();
1840       }
1841       function addMessageToQueue(queue, message) {
1842         if (messages_1.isRequestMessage(message)) {
1843           queue.set(createRequestQueueKey(message.id), message);
1844         } else if (messages_1.isResponseMessage(message)) {
1845           queue.set(createResponseQueueKey(message.id), message);
1846         } else {
1847           queue.set(createNotificationQueueKey(), message);
1848         }
1849       }
1850       function cancelUndispatched(_message) {
1851         return void 0;
1852       }
1853       function isListening() {
1854         return state === ConnectionState.Listening;
1855       }
1856       function isClosed() {
1857         return state === ConnectionState.Closed;
1858       }
1859       function isDisposed() {
1860         return state === ConnectionState.Disposed;
1861       }
1862       function closeHandler() {
1863         if (state === ConnectionState.New || state === ConnectionState.Listening) {
1864           state = ConnectionState.Closed;
1865           closeEmitter.fire(void 0);
1866         }
1867       }
1868       function readErrorHandler(error) {
1869         errorEmitter.fire([error, void 0, void 0]);
1870       }
1871       function writeErrorHandler(data) {
1872         errorEmitter.fire(data);
1873       }
1874       messageReader.onClose(closeHandler);
1875       messageReader.onError(readErrorHandler);
1876       messageWriter.onClose(closeHandler);
1877       messageWriter.onError(writeErrorHandler);
1878       function triggerMessageQueue() {
1879         if (timer || messageQueue.size === 0) {
1880           return;
1881         }
1882         timer = ral_1.default().timer.setImmediate(() => {
1883           timer = void 0;
1884           processMessageQueue();
1885         });
1886       }
1887       function processMessageQueue() {
1888         if (messageQueue.size === 0) {
1889           return;
1890         }
1891         const message = messageQueue.shift();
1892         try {
1893           if (messages_1.isRequestMessage(message)) {
1894             handleRequest(message);
1895           } else if (messages_1.isNotificationMessage(message)) {
1896             handleNotification(message);
1897           } else if (messages_1.isResponseMessage(message)) {
1898             handleResponse(message);
1899           } else {
1900             handleInvalidMessage(message);
1901           }
1902         } finally {
1903           triggerMessageQueue();
1904         }
1905       }
1906       const callback = (message) => {
1907         try {
1908           if (messages_1.isNotificationMessage(message) && message.method === CancelNotification.type.method) {
1909             const key = createRequestQueueKey(message.params.id);
1910             const toCancel = messageQueue.get(key);
1911             if (messages_1.isRequestMessage(toCancel)) {
1912               const strategy = options === null || options === void 0 ? void 0 : options.connectionStrategy;
1913               const response = strategy && strategy.cancelUndispatched ? strategy.cancelUndispatched(toCancel, cancelUndispatched) : cancelUndispatched(toCancel);
1914               if (response && (response.error !== void 0 || response.result !== void 0)) {
1915                 messageQueue.delete(key);
1916                 response.id = toCancel.id;
1917                 traceSendingResponse(response, message.method, Date.now());
1918                 messageWriter.write(response);
1919                 return;
1920               }
1921             }
1922           }
1923           addMessageToQueue(messageQueue, message);
1924         } finally {
1925           triggerMessageQueue();
1926         }
1927       };
1928       function handleRequest(requestMessage) {
1929         if (isDisposed()) {
1930           return;
1931         }
1932         function reply(resultOrError, method, startTime2) {
1933           const message = {
1934             jsonrpc: version,
1935             id: requestMessage.id
1936           };
1937           if (resultOrError instanceof messages_1.ResponseError) {
1938             message.error = resultOrError.toJson();
1939           } else {
1940             message.result = resultOrError === void 0 ? null : resultOrError;
1941           }
1942           traceSendingResponse(message, method, startTime2);
1943           messageWriter.write(message);
1944         }
1945         function replyError(error, method, startTime2) {
1946           const message = {
1947             jsonrpc: version,
1948             id: requestMessage.id,
1949             error: error.toJson()
1950           };
1951           traceSendingResponse(message, method, startTime2);
1952           messageWriter.write(message);
1953         }
1954         function replySuccess(result, method, startTime2) {
1955           if (result === void 0) {
1956             result = null;
1957           }
1958           const message = {
1959             jsonrpc: version,
1960             id: requestMessage.id,
1961             result
1962           };
1963           traceSendingResponse(message, method, startTime2);
1964           messageWriter.write(message);
1965         }
1966         traceReceivedRequest(requestMessage);
1967         const element = requestHandlers[requestMessage.method];
1968         let type;
1969         let requestHandler;
1970         if (element) {
1971           type = element.type;
1972           requestHandler = element.handler;
1973         }
1974         const startTime = Date.now();
1975         if (requestHandler || starRequestHandler) {
1976           const tokenKey = String(requestMessage.id);
1977           const cancellationSource = cancellationStrategy.receiver.createCancellationTokenSource(tokenKey);
1978           requestTokens[tokenKey] = cancellationSource;
1979           try {
1980             let handlerResult;
1981             if (requestHandler) {
1982               if (requestMessage.params === void 0) {
1983                 if (type !== void 0 && type.numberOfParams !== 0) {
1984                   replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InvalidParams, `Request ${requestMessage.method} defines ${type.numberOfParams} params but recevied none.`), requestMessage.method, startTime);
1985                   return;
1986                 }
1987                 handlerResult = requestHandler(cancellationSource.token);
1988               } else if (Array.isArray(requestMessage.params)) {
1989                 if (type !== void 0 && type.parameterStructures === messages_1.ParameterStructures.byName) {
1990                   replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InvalidParams, `Request ${requestMessage.method} defines parameters by name but received parameters by position`), requestMessage.method, startTime);
1991                   return;
1992                 }
1993                 handlerResult = requestHandler(...requestMessage.params, cancellationSource.token);
1994               } else {
1995                 if (type !== void 0 && type.parameterStructures === messages_1.ParameterStructures.byPosition) {
1996                   replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InvalidParams, `Request ${requestMessage.method} defines parameters by position but received parameters by name`), requestMessage.method, startTime);
1997                   return;
1998                 }
1999                 handlerResult = requestHandler(requestMessage.params, cancellationSource.token);
2000               }
2001             } else if (starRequestHandler) {
2002               handlerResult = starRequestHandler(requestMessage.method, requestMessage.params, cancellationSource.token);
2003             }
2004             const promise = handlerResult;
2005             if (!handlerResult) {
2006               delete requestTokens[tokenKey];
2007               replySuccess(handlerResult, requestMessage.method, startTime);
2008             } else if (promise.then) {
2009               promise.then((resultOrError) => {
2010                 delete requestTokens[tokenKey];
2011                 reply(resultOrError, requestMessage.method, startTime);
2012               }, (error) => {
2013                 delete requestTokens[tokenKey];
2014                 if (error instanceof messages_1.ResponseError) {
2015                   replyError(error, requestMessage.method, startTime);
2016                 } else if (error && Is2.string(error.message)) {
2017                   replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error.message}`), requestMessage.method, startTime);
2018                 } else {
2019                   replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime);
2020                 }
2021               });
2022             } else {
2023               delete requestTokens[tokenKey];
2024               reply(handlerResult, requestMessage.method, startTime);
2025             }
2026           } catch (error) {
2027             delete requestTokens[tokenKey];
2028             if (error instanceof messages_1.ResponseError) {
2029               reply(error, requestMessage.method, startTime);
2030             } else if (error && Is2.string(error.message)) {
2031               replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error.message}`), requestMessage.method, startTime);
2032             } else {
2033               replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime);
2034             }
2035           }
2036         } else {
2037           replyError(new messages_1.ResponseError(messages_1.ErrorCodes.MethodNotFound, `Unhandled method ${requestMessage.method}`), requestMessage.method, startTime);
2038         }
2039       }
2040       function handleResponse(responseMessage) {
2041         if (isDisposed()) {
2042           return;
2043         }
2044         if (responseMessage.id === null) {
2045           if (responseMessage.error) {
2046             logger.error(`Received response message without id: Error is: 
2047 ${JSON.stringify(responseMessage.error, void 0, 4)}`);
2048           } else {
2049             logger.error(`Received response message without id. No further error information provided.`);
2050           }
2051         } else {
2052           const key = String(responseMessage.id);
2053           const responsePromise = responsePromises[key];
2054           traceReceivedResponse(responseMessage, responsePromise);
2055           if (responsePromise) {
2056             delete responsePromises[key];
2057             try {
2058               if (responseMessage.error) {
2059                 const error = responseMessage.error;
2060                 responsePromise.reject(new messages_1.ResponseError(error.code, error.message, error.data));
2061               } else if (responseMessage.result !== void 0) {
2062                 responsePromise.resolve(responseMessage.result);
2063               } else {
2064                 throw new Error("Should never happen.");
2065               }
2066             } catch (error) {
2067               if (error.message) {
2068                 logger.error(`Response handler '${responsePromise.method}' failed with message: ${error.message}`);
2069               } else {
2070                 logger.error(`Response handler '${responsePromise.method}' failed unexpectedly.`);
2071               }
2072             }
2073           }
2074         }
2075       }
2076       function handleNotification(message) {
2077         if (isDisposed()) {
2078           return;
2079         }
2080         let type = void 0;
2081         let notificationHandler;
2082         if (message.method === CancelNotification.type.method) {
2083           notificationHandler = (params) => {
2084             const id = params.id;
2085             const source = requestTokens[String(id)];
2086             if (source) {
2087               source.cancel();
2088             }
2089           };
2090         } else {
2091           const element = notificationHandlers[message.method];
2092           if (element) {
2093             notificationHandler = element.handler;
2094             type = element.type;
2095           }
2096         }
2097         if (notificationHandler || starNotificationHandler) {
2098           try {
2099             traceReceivedNotification(message);
2100             if (notificationHandler) {
2101               if (message.params === void 0) {
2102                 if (type !== void 0) {
2103                   if (type.numberOfParams !== 0 && type.parameterStructures !== messages_1.ParameterStructures.byName) {
2104                     logger.error(`Notification ${message.method} defines ${type.numberOfParams} params but recevied none.`);
2105                   }
2106                 }
2107                 notificationHandler();
2108               } else if (Array.isArray(message.params)) {
2109                 if (type !== void 0) {
2110                   if (type.parameterStructures === messages_1.ParameterStructures.byName) {
2111                     logger.error(`Notification ${message.method} defines parameters by name but received parameters by position`);
2112                   }
2113                   if (type.numberOfParams !== message.params.length) {
2114                     logger.error(`Notification ${message.method} defines ${type.numberOfParams} params but received ${message.params.length} argumennts`);
2115                   }
2116                 }
2117                 notificationHandler(...message.params);
2118               } else {
2119                 if (type !== void 0 && type.parameterStructures === messages_1.ParameterStructures.byPosition) {
2120                   logger.error(`Notification ${message.method} defines parameters by position but received parameters by name`);
2121                 }
2122                 notificationHandler(message.params);
2123               }
2124             } else if (starNotificationHandler) {
2125               starNotificationHandler(message.method, message.params);
2126             }
2127           } catch (error) {
2128             if (error.message) {
2129               logger.error(`Notification handler '${message.method}' failed with message: ${error.message}`);
2130             } else {
2131               logger.error(`Notification handler '${message.method}' failed unexpectedly.`);
2132             }
2133           }
2134         } else {
2135           unhandledNotificationEmitter.fire(message);
2136         }
2137       }
2138       function handleInvalidMessage(message) {
2139         if (!message) {
2140           logger.error("Received empty message.");
2141           return;
2142         }
2143         logger.error(`Received message which is neither a response nor a notification message:
2144 ${JSON.stringify(message, null, 4)}`);
2145         const responseMessage = message;
2146         if (Is2.string(responseMessage.id) || Is2.number(responseMessage.id)) {
2147           const key = String(responseMessage.id);
2148           const responseHandler = responsePromises[key];
2149           if (responseHandler) {
2150             responseHandler.reject(new Error("The received response has neither a result nor an error property."));
2151           }
2152         }
2153       }
2154       function traceSendingRequest(message) {
2155         if (trace === Trace.Off || !tracer) {
2156           return;
2157         }
2158         if (traceFormat === TraceFormat.Text) {
2159           let data = void 0;
2160           if (trace === Trace.Verbose && message.params) {
2161             data = `Params: ${JSON.stringify(message.params, null, 4)}
2162
2163 `;
2164           }
2165           tracer.log(`Sending request '${message.method} - (${message.id})'.`, data);
2166         } else {
2167           logLSPMessage("send-request", message);
2168         }
2169       }
2170       function traceSendingNotification(message) {
2171         if (trace === Trace.Off || !tracer) {
2172           return;
2173         }
2174         if (traceFormat === TraceFormat.Text) {
2175           let data = void 0;
2176           if (trace === Trace.Verbose) {
2177             if (message.params) {
2178               data = `Params: ${JSON.stringify(message.params, null, 4)}
2179
2180 `;
2181             } else {
2182               data = "No parameters provided.\n\n";
2183             }
2184           }
2185           tracer.log(`Sending notification '${message.method}'.`, data);
2186         } else {
2187           logLSPMessage("send-notification", message);
2188         }
2189       }
2190       function traceSendingResponse(message, method, startTime) {
2191         if (trace === Trace.Off || !tracer) {
2192           return;
2193         }
2194         if (traceFormat === TraceFormat.Text) {
2195           let data = void 0;
2196           if (trace === Trace.Verbose) {
2197             if (message.error && message.error.data) {
2198               data = `Error data: ${JSON.stringify(message.error.data, null, 4)}
2199
2200 `;
2201             } else {
2202               if (message.result) {
2203                 data = `Result: ${JSON.stringify(message.result, null, 4)}
2204
2205 `;
2206               } else if (message.error === void 0) {
2207                 data = "No result returned.\n\n";
2208               }
2209             }
2210           }
2211           tracer.log(`Sending response '${method} - (${message.id})'. Processing request took ${Date.now() - startTime}ms`, data);
2212         } else {
2213           logLSPMessage("send-response", message);
2214         }
2215       }
2216       function traceReceivedRequest(message) {
2217         if (trace === Trace.Off || !tracer) {
2218           return;
2219         }
2220         if (traceFormat === TraceFormat.Text) {
2221           let data = void 0;
2222           if (trace === Trace.Verbose && message.params) {
2223             data = `Params: ${JSON.stringify(message.params, null, 4)}
2224
2225 `;
2226           }
2227           tracer.log(`Received request '${message.method} - (${message.id})'.`, data);
2228         } else {
2229           logLSPMessage("receive-request", message);
2230         }
2231       }
2232       function traceReceivedNotification(message) {
2233         if (trace === Trace.Off || !tracer || message.method === LogTraceNotification.type.method) {
2234           return;
2235         }
2236         if (traceFormat === TraceFormat.Text) {
2237           let data = void 0;
2238           if (trace === Trace.Verbose) {
2239             if (message.params) {
2240               data = `Params: ${JSON.stringify(message.params, null, 4)}
2241
2242 `;
2243             } else {
2244               data = "No parameters provided.\n\n";
2245             }
2246           }
2247           tracer.log(`Received notification '${message.method}'.`, data);
2248         } else {
2249           logLSPMessage("receive-notification", message);
2250         }
2251       }
2252       function traceReceivedResponse(message, responsePromise) {
2253         if (trace === Trace.Off || !tracer) {
2254           return;
2255         }
2256         if (traceFormat === TraceFormat.Text) {
2257           let data = void 0;
2258           if (trace === Trace.Verbose) {
2259             if (message.error && message.error.data) {
2260               data = `Error data: ${JSON.stringify(message.error.data, null, 4)}
2261
2262 `;
2263             } else {
2264               if (message.result) {
2265                 data = `Result: ${JSON.stringify(message.result, null, 4)}
2266
2267 `;
2268               } else if (message.error === void 0) {
2269                 data = "No result returned.\n\n";
2270               }
2271             }
2272           }
2273           if (responsePromise) {
2274             const error = message.error ? ` Request failed: ${message.error.message} (${message.error.code}).` : "";
2275             tracer.log(`Received response '${responsePromise.method} - (${message.id})' in ${Date.now() - responsePromise.timerStart}ms.${error}`, data);
2276           } else {
2277             tracer.log(`Received response ${message.id} without active response promise.`, data);
2278           }
2279         } else {
2280           logLSPMessage("receive-response", message);
2281         }
2282       }
2283       function logLSPMessage(type, message) {
2284         if (!tracer || trace === Trace.Off) {
2285           return;
2286         }
2287         const lspMessage = {
2288           isLSPMessage: true,
2289           type,
2290           message,
2291           timestamp: Date.now()
2292         };
2293         tracer.log(lspMessage);
2294       }
2295       function throwIfClosedOrDisposed() {
2296         if (isClosed()) {
2297           throw new ConnectionError(ConnectionErrors.Closed, "Connection is closed.");
2298         }
2299         if (isDisposed()) {
2300           throw new ConnectionError(ConnectionErrors.Disposed, "Connection is disposed.");
2301         }
2302       }
2303       function throwIfListening() {
2304         if (isListening()) {
2305           throw new ConnectionError(ConnectionErrors.AlreadyListening, "Connection is already listening");
2306         }
2307       }
2308       function throwIfNotListening() {
2309         if (!isListening()) {
2310           throw new Error("Call listen() first.");
2311         }
2312       }
2313       function undefinedToNull(param) {
2314         if (param === void 0) {
2315           return null;
2316         } else {
2317           return param;
2318         }
2319       }
2320       function nullToUndefined(param) {
2321         if (param === null) {
2322           return void 0;
2323         } else {
2324           return param;
2325         }
2326       }
2327       function isNamedParam(param) {
2328         return param !== void 0 && param !== null && !Array.isArray(param) && typeof param === "object";
2329       }
2330       function computeSingleParam(parameterStructures, param) {
2331         switch (parameterStructures) {
2332           case messages_1.ParameterStructures.auto:
2333             if (isNamedParam(param)) {
2334               return nullToUndefined(param);
2335             } else {
2336               return [undefinedToNull(param)];
2337             }
2338             break;
2339           case messages_1.ParameterStructures.byName:
2340             if (!isNamedParam(param)) {
2341               throw new Error(`Recevied parameters by name but param is not an object literal.`);
2342             }
2343             return nullToUndefined(param);
2344           case messages_1.ParameterStructures.byPosition:
2345             return [undefinedToNull(param)];
2346           default:
2347             throw new Error(`Unknown parameter structure ${parameterStructures.toString()}`);
2348         }
2349       }
2350       function computeMessageParams(type, params) {
2351         let result;
2352         const numberOfParams = type.numberOfParams;
2353         switch (numberOfParams) {
2354           case 0:
2355             result = void 0;
2356             break;
2357           case 1:
2358             result = computeSingleParam(type.parameterStructures, params[0]);
2359             break;
2360           default:
2361             result = [];
2362             for (let i = 0; i < params.length && i < numberOfParams; i++) {
2363               result.push(undefinedToNull(params[i]));
2364             }
2365             if (params.length < numberOfParams) {
2366               for (let i = params.length; i < numberOfParams; i++) {
2367                 result.push(null);
2368               }
2369             }
2370             break;
2371         }
2372         return result;
2373       }
2374       const connection = {
2375         sendNotification: (type, ...args) => {
2376           throwIfClosedOrDisposed();
2377           let method;
2378           let messageParams;
2379           if (Is2.string(type)) {
2380             method = type;
2381             const first = args[0];
2382             let paramStart = 0;
2383             let parameterStructures = messages_1.ParameterStructures.auto;
2384             if (messages_1.ParameterStructures.is(first)) {
2385               paramStart = 1;
2386               parameterStructures = first;
2387             }
2388             let paramEnd = args.length;
2389             const numberOfParams = paramEnd - paramStart;
2390             switch (numberOfParams) {
2391               case 0:
2392                 messageParams = void 0;
2393                 break;
2394               case 1:
2395                 messageParams = computeSingleParam(parameterStructures, args[paramStart]);
2396                 break;
2397               default:
2398                 if (parameterStructures === messages_1.ParameterStructures.byName) {
2399                   throw new Error(`Recevied ${numberOfParams} parameters for 'by Name' notification parameter structure.`);
2400                 }
2401                 messageParams = args.slice(paramStart, paramEnd).map((value) => undefinedToNull(value));
2402                 break;
2403             }
2404           } else {
2405             const params = args;
2406             method = type.method;
2407             messageParams = computeMessageParams(type, params);
2408           }
2409           const notificationMessage = {
2410             jsonrpc: version,
2411             method,
2412             params: messageParams
2413           };
2414           traceSendingNotification(notificationMessage);
2415           messageWriter.write(notificationMessage);
2416         },
2417         onNotification: (type, handler) => {
2418           throwIfClosedOrDisposed();
2419           let method;
2420           if (Is2.func(type)) {
2421             starNotificationHandler = type;
2422           } else if (handler) {
2423             if (Is2.string(type)) {
2424               method = type;
2425               notificationHandlers[type] = { type: void 0, handler };
2426             } else {
2427               method = type.method;
2428               notificationHandlers[type.method] = { type, handler };
2429             }
2430           }
2431           return {
2432             dispose: () => {
2433               if (method !== void 0) {
2434                 delete notificationHandlers[method];
2435               } else {
2436                 starNotificationHandler = void 0;
2437               }
2438             }
2439           };
2440         },
2441         onProgress: (_type, token, handler) => {
2442           if (progressHandlers.has(token)) {
2443             throw new Error(`Progress handler for token ${token} already registered`);
2444           }
2445           progressHandlers.set(token, handler);
2446           return {
2447             dispose: () => {
2448               progressHandlers.delete(token);
2449             }
2450           };
2451         },
2452         sendProgress: (_type, token, value) => {
2453           connection.sendNotification(ProgressNotification.type, { token, value });
2454         },
2455         onUnhandledProgress: unhandledProgressEmitter.event,
2456         sendRequest: (type, ...args) => {
2457           throwIfClosedOrDisposed();
2458           throwIfNotListening();
2459           let method;
2460           let messageParams;
2461           let token = void 0;
2462           if (Is2.string(type)) {
2463             method = type;
2464             const first = args[0];
2465             const last = args[args.length - 1];
2466             let paramStart = 0;
2467             let parameterStructures = messages_1.ParameterStructures.auto;
2468             if (messages_1.ParameterStructures.is(first)) {
2469               paramStart = 1;
2470               parameterStructures = first;
2471             }
2472             let paramEnd = args.length;
2473             if (cancellation_1.CancellationToken.is(last)) {
2474               paramEnd = paramEnd - 1;
2475               token = last;
2476             }
2477             const numberOfParams = paramEnd - paramStart;
2478             switch (numberOfParams) {
2479               case 0:
2480                 messageParams = void 0;
2481                 break;
2482               case 1:
2483                 messageParams = computeSingleParam(parameterStructures, args[paramStart]);
2484                 break;
2485               default:
2486                 if (parameterStructures === messages_1.ParameterStructures.byName) {
2487                   throw new Error(`Recevied ${numberOfParams} parameters for 'by Name' request parameter structure.`);
2488                 }
2489                 messageParams = args.slice(paramStart, paramEnd).map((value) => undefinedToNull(value));
2490                 break;
2491             }
2492           } else {
2493             const params = args;
2494             method = type.method;
2495             messageParams = computeMessageParams(type, params);
2496             const numberOfParams = type.numberOfParams;
2497             token = cancellation_1.CancellationToken.is(params[numberOfParams]) ? params[numberOfParams] : void 0;
2498           }
2499           const id = sequenceNumber++;
2500           let disposable;
2501           if (token) {
2502             disposable = token.onCancellationRequested(() => {
2503               cancellationStrategy.sender.sendCancellation(connection, id);
2504             });
2505           }
2506           const result = new Promise((resolve, reject) => {
2507             const requestMessage = {
2508               jsonrpc: version,
2509               id,
2510               method,
2511               params: messageParams
2512             };
2513             const resolveWithCleanup = (r) => {
2514               resolve(r);
2515               cancellationStrategy.sender.cleanup(id);
2516               disposable === null || disposable === void 0 ? void 0 : disposable.dispose();
2517             };
2518             const rejectWithCleanup = (r) => {
2519               reject(r);
2520               cancellationStrategy.sender.cleanup(id);
2521               disposable === null || disposable === void 0 ? void 0 : disposable.dispose();
2522             };
2523             let responsePromise = { method, timerStart: Date.now(), resolve: resolveWithCleanup, reject: rejectWithCleanup };
2524             traceSendingRequest(requestMessage);
2525             try {
2526               messageWriter.write(requestMessage);
2527             } catch (e) {
2528               responsePromise.reject(new messages_1.ResponseError(messages_1.ErrorCodes.MessageWriteError, e.message ? e.message : "Unknown reason"));
2529               responsePromise = null;
2530             }
2531             if (responsePromise) {
2532               responsePromises[String(id)] = responsePromise;
2533             }
2534           });
2535           return result;
2536         },
2537         onRequest: (type, handler) => {
2538           throwIfClosedOrDisposed();
2539           let method = null;
2540           if (StarRequestHandler.is(type)) {
2541             method = void 0;
2542             starRequestHandler = type;
2543           } else if (Is2.string(type)) {
2544             method = null;
2545             if (handler !== void 0) {
2546               method = type;
2547               requestHandlers[type] = { handler, type: void 0 };
2548             }
2549           } else {
2550             if (handler !== void 0) {
2551               method = type.method;
2552               requestHandlers[type.method] = { type, handler };
2553             }
2554           }
2555           return {
2556             dispose: () => {
2557               if (method === null) {
2558                 return;
2559               }
2560               if (method !== void 0) {
2561                 delete requestHandlers[method];
2562               } else {
2563                 starRequestHandler = void 0;
2564               }
2565             }
2566           };
2567         },
2568         trace: (_value, _tracer, sendNotificationOrTraceOptions) => {
2569           let _sendNotification = false;
2570           let _traceFormat = TraceFormat.Text;
2571           if (sendNotificationOrTraceOptions !== void 0) {
2572             if (Is2.boolean(sendNotificationOrTraceOptions)) {
2573               _sendNotification = sendNotificationOrTraceOptions;
2574             } else {
2575               _sendNotification = sendNotificationOrTraceOptions.sendNotification || false;
2576               _traceFormat = sendNotificationOrTraceOptions.traceFormat || TraceFormat.Text;
2577             }
2578           }
2579           trace = _value;
2580           traceFormat = _traceFormat;
2581           if (trace === Trace.Off) {
2582             tracer = void 0;
2583           } else {
2584             tracer = _tracer;
2585           }
2586           if (_sendNotification && !isClosed() && !isDisposed()) {
2587             connection.sendNotification(SetTraceNotification.type, { value: Trace.toString(_value) });
2588           }
2589         },
2590         onError: errorEmitter.event,
2591         onClose: closeEmitter.event,
2592         onUnhandledNotification: unhandledNotificationEmitter.event,
2593         onDispose: disposeEmitter.event,
2594         end: () => {
2595           messageWriter.end();
2596         },
2597         dispose: () => {
2598           if (isDisposed()) {
2599             return;
2600           }
2601           state = ConnectionState.Disposed;
2602           disposeEmitter.fire(void 0);
2603           const error = new Error("Connection got disposed.");
2604           Object.keys(responsePromises).forEach((key) => {
2605             responsePromises[key].reject(error);
2606           });
2607           responsePromises = Object.create(null);
2608           requestTokens = Object.create(null);
2609           messageQueue = new linkedMap_1.LinkedMap();
2610           if (Is2.func(messageWriter.dispose)) {
2611             messageWriter.dispose();
2612           }
2613           if (Is2.func(messageReader.dispose)) {
2614             messageReader.dispose();
2615           }
2616         },
2617         listen: () => {
2618           throwIfClosedOrDisposed();
2619           throwIfListening();
2620           state = ConnectionState.Listening;
2621           messageReader.listen(callback);
2622         },
2623         inspect: () => {
2624           ral_1.default().console.log("inspect");
2625         }
2626       };
2627       connection.onNotification(LogTraceNotification.type, (params) => {
2628         if (trace === Trace.Off || !tracer) {
2629           return;
2630         }
2631         tracer.log(params.message, trace === Trace.Verbose ? params.verbose : void 0);
2632       });
2633       connection.onNotification(ProgressNotification.type, (params) => {
2634         const handler = progressHandlers.get(params.token);
2635         if (handler) {
2636           handler(params.value);
2637         } else {
2638           unhandledProgressEmitter.fire(params);
2639         }
2640       });
2641       return connection;
2642     }
2643     exports2.createMessageConnection = createMessageConnection;
2644   }
2645 });
2646
2647 // node_modules/vscode-jsonrpc/lib/common/api.js
2648 var require_api = __commonJS({
2649   "node_modules/vscode-jsonrpc/lib/common/api.js"(exports2) {
2650     "use strict";
2651     Object.defineProperty(exports2, "__esModule", { value: true });
2652     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;
2653     exports2.CancellationStrategy = void 0;
2654     var messages_1 = require_messages();
2655     Object.defineProperty(exports2, "RequestType", { enumerable: true, get: function() {
2656       return messages_1.RequestType;
2657     } });
2658     Object.defineProperty(exports2, "RequestType0", { enumerable: true, get: function() {
2659       return messages_1.RequestType0;
2660     } });
2661     Object.defineProperty(exports2, "RequestType1", { enumerable: true, get: function() {
2662       return messages_1.RequestType1;
2663     } });
2664     Object.defineProperty(exports2, "RequestType2", { enumerable: true, get: function() {
2665       return messages_1.RequestType2;
2666     } });
2667     Object.defineProperty(exports2, "RequestType3", { enumerable: true, get: function() {
2668       return messages_1.RequestType3;
2669     } });
2670     Object.defineProperty(exports2, "RequestType4", { enumerable: true, get: function() {
2671       return messages_1.RequestType4;
2672     } });
2673     Object.defineProperty(exports2, "RequestType5", { enumerable: true, get: function() {
2674       return messages_1.RequestType5;
2675     } });
2676     Object.defineProperty(exports2, "RequestType6", { enumerable: true, get: function() {
2677       return messages_1.RequestType6;
2678     } });
2679     Object.defineProperty(exports2, "RequestType7", { enumerable: true, get: function() {
2680       return messages_1.RequestType7;
2681     } });
2682     Object.defineProperty(exports2, "RequestType8", { enumerable: true, get: function() {
2683       return messages_1.RequestType8;
2684     } });
2685     Object.defineProperty(exports2, "RequestType9", { enumerable: true, get: function() {
2686       return messages_1.RequestType9;
2687     } });
2688     Object.defineProperty(exports2, "ResponseError", { enumerable: true, get: function() {
2689       return messages_1.ResponseError;
2690     } });
2691     Object.defineProperty(exports2, "ErrorCodes", { enumerable: true, get: function() {
2692       return messages_1.ErrorCodes;
2693     } });
2694     Object.defineProperty(exports2, "NotificationType", { enumerable: true, get: function() {
2695       return messages_1.NotificationType;
2696     } });
2697     Object.defineProperty(exports2, "NotificationType0", { enumerable: true, get: function() {
2698       return messages_1.NotificationType0;
2699     } });
2700     Object.defineProperty(exports2, "NotificationType1", { enumerable: true, get: function() {
2701       return messages_1.NotificationType1;
2702     } });
2703     Object.defineProperty(exports2, "NotificationType2", { enumerable: true, get: function() {
2704       return messages_1.NotificationType2;
2705     } });
2706     Object.defineProperty(exports2, "NotificationType3", { enumerable: true, get: function() {
2707       return messages_1.NotificationType3;
2708     } });
2709     Object.defineProperty(exports2, "NotificationType4", { enumerable: true, get: function() {
2710       return messages_1.NotificationType4;
2711     } });
2712     Object.defineProperty(exports2, "NotificationType5", { enumerable: true, get: function() {
2713       return messages_1.NotificationType5;
2714     } });
2715     Object.defineProperty(exports2, "NotificationType6", { enumerable: true, get: function() {
2716       return messages_1.NotificationType6;
2717     } });
2718     Object.defineProperty(exports2, "NotificationType7", { enumerable: true, get: function() {
2719       return messages_1.NotificationType7;
2720     } });
2721     Object.defineProperty(exports2, "NotificationType8", { enumerable: true, get: function() {
2722       return messages_1.NotificationType8;
2723     } });
2724     Object.defineProperty(exports2, "NotificationType9", { enumerable: true, get: function() {
2725       return messages_1.NotificationType9;
2726     } });
2727     Object.defineProperty(exports2, "ParameterStructures", { enumerable: true, get: function() {
2728       return messages_1.ParameterStructures;
2729     } });
2730     var disposable_1 = require_disposable();
2731     Object.defineProperty(exports2, "Disposable", { enumerable: true, get: function() {
2732       return disposable_1.Disposable;
2733     } });
2734     var events_1 = require_events();
2735     Object.defineProperty(exports2, "Event", { enumerable: true, get: function() {
2736       return events_1.Event;
2737     } });
2738     Object.defineProperty(exports2, "Emitter", { enumerable: true, get: function() {
2739       return events_1.Emitter;
2740     } });
2741     var cancellation_1 = require_cancellation();
2742     Object.defineProperty(exports2, "CancellationTokenSource", { enumerable: true, get: function() {
2743       return cancellation_1.CancellationTokenSource;
2744     } });
2745     Object.defineProperty(exports2, "CancellationToken", { enumerable: true, get: function() {
2746       return cancellation_1.CancellationToken;
2747     } });
2748     var messageReader_1 = require_messageReader();
2749     Object.defineProperty(exports2, "MessageReader", { enumerable: true, get: function() {
2750       return messageReader_1.MessageReader;
2751     } });
2752     Object.defineProperty(exports2, "AbstractMessageReader", { enumerable: true, get: function() {
2753       return messageReader_1.AbstractMessageReader;
2754     } });
2755     Object.defineProperty(exports2, "ReadableStreamMessageReader", { enumerable: true, get: function() {
2756       return messageReader_1.ReadableStreamMessageReader;
2757     } });
2758     var messageWriter_1 = require_messageWriter();
2759     Object.defineProperty(exports2, "MessageWriter", { enumerable: true, get: function() {
2760       return messageWriter_1.MessageWriter;
2761     } });
2762     Object.defineProperty(exports2, "AbstractMessageWriter", { enumerable: true, get: function() {
2763       return messageWriter_1.AbstractMessageWriter;
2764     } });
2765     Object.defineProperty(exports2, "WriteableStreamMessageWriter", { enumerable: true, get: function() {
2766       return messageWriter_1.WriteableStreamMessageWriter;
2767     } });
2768     var connection_1 = require_connection();
2769     Object.defineProperty(exports2, "ConnectionStrategy", { enumerable: true, get: function() {
2770       return connection_1.ConnectionStrategy;
2771     } });
2772     Object.defineProperty(exports2, "ConnectionOptions", { enumerable: true, get: function() {
2773       return connection_1.ConnectionOptions;
2774     } });
2775     Object.defineProperty(exports2, "NullLogger", { enumerable: true, get: function() {
2776       return connection_1.NullLogger;
2777     } });
2778     Object.defineProperty(exports2, "createMessageConnection", { enumerable: true, get: function() {
2779       return connection_1.createMessageConnection;
2780     } });
2781     Object.defineProperty(exports2, "ProgressType", { enumerable: true, get: function() {
2782       return connection_1.ProgressType;
2783     } });
2784     Object.defineProperty(exports2, "Trace", { enumerable: true, get: function() {
2785       return connection_1.Trace;
2786     } });
2787     Object.defineProperty(exports2, "TraceFormat", { enumerable: true, get: function() {
2788       return connection_1.TraceFormat;
2789     } });
2790     Object.defineProperty(exports2, "SetTraceNotification", { enumerable: true, get: function() {
2791       return connection_1.SetTraceNotification;
2792     } });
2793     Object.defineProperty(exports2, "LogTraceNotification", { enumerable: true, get: function() {
2794       return connection_1.LogTraceNotification;
2795     } });
2796     Object.defineProperty(exports2, "ConnectionErrors", { enumerable: true, get: function() {
2797       return connection_1.ConnectionErrors;
2798     } });
2799     Object.defineProperty(exports2, "ConnectionError", { enumerable: true, get: function() {
2800       return connection_1.ConnectionError;
2801     } });
2802     Object.defineProperty(exports2, "CancellationReceiverStrategy", { enumerable: true, get: function() {
2803       return connection_1.CancellationReceiverStrategy;
2804     } });
2805     Object.defineProperty(exports2, "CancellationSenderStrategy", { enumerable: true, get: function() {
2806       return connection_1.CancellationSenderStrategy;
2807     } });
2808     Object.defineProperty(exports2, "CancellationStrategy", { enumerable: true, get: function() {
2809       return connection_1.CancellationStrategy;
2810     } });
2811     var ral_1 = require_ral();
2812     exports2.RAL = ral_1.default;
2813   }
2814 });
2815
2816 // node_modules/vscode-jsonrpc/lib/node/main.js
2817 var require_main = __commonJS({
2818   "node_modules/vscode-jsonrpc/lib/node/main.js"(exports2) {
2819     "use strict";
2820     var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
2821       if (k2 === void 0)
2822         k2 = k;
2823       Object.defineProperty(o, k2, { enumerable: true, get: function() {
2824         return m[k];
2825       } });
2826     } : function(o, m, k, k2) {
2827       if (k2 === void 0)
2828         k2 = k;
2829       o[k2] = m[k];
2830     });
2831     var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) {
2832       for (var p in m)
2833         if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p))
2834           __createBinding(exports3, m, p);
2835     };
2836     Object.defineProperty(exports2, "__esModule", { value: true });
2837     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;
2838     var ril_1 = require_ril();
2839     ril_1.default.install();
2840     var api_1 = require_api();
2841     var path2 = require("path");
2842     var os = require("os");
2843     var crypto_1 = require("crypto");
2844     var net_1 = require("net");
2845     __exportStar(require_api(), exports2);
2846     var IPCMessageReader = class extends api_1.AbstractMessageReader {
2847       constructor(process2) {
2848         super();
2849         this.process = process2;
2850         let eventEmitter = this.process;
2851         eventEmitter.on("error", (error) => this.fireError(error));
2852         eventEmitter.on("close", () => this.fireClose());
2853       }
2854       listen(callback) {
2855         this.process.on("message", callback);
2856         return api_1.Disposable.create(() => this.process.off("message", callback));
2857       }
2858     };
2859     exports2.IPCMessageReader = IPCMessageReader;
2860     var IPCMessageWriter = class extends api_1.AbstractMessageWriter {
2861       constructor(process2) {
2862         super();
2863         this.process = process2;
2864         this.errorCount = 0;
2865         let eventEmitter = this.process;
2866         eventEmitter.on("error", (error) => this.fireError(error));
2867         eventEmitter.on("close", () => this.fireClose);
2868       }
2869       write(msg) {
2870         try {
2871           if (typeof this.process.send === "function") {
2872             this.process.send(msg, void 0, void 0, (error) => {
2873               if (error) {
2874                 this.errorCount++;
2875                 this.handleError(error, msg);
2876               } else {
2877                 this.errorCount = 0;
2878               }
2879             });
2880           }
2881           return Promise.resolve();
2882         } catch (error) {
2883           this.handleError(error, msg);
2884           return Promise.reject(error);
2885         }
2886       }
2887       handleError(error, msg) {
2888         this.errorCount++;
2889         this.fireError(error, msg, this.errorCount);
2890       }
2891       end() {
2892       }
2893     };
2894     exports2.IPCMessageWriter = IPCMessageWriter;
2895     var SocketMessageReader = class extends api_1.ReadableStreamMessageReader {
2896       constructor(socket, encoding = "utf-8") {
2897         super(ril_1.default().stream.asReadableStream(socket), encoding);
2898       }
2899     };
2900     exports2.SocketMessageReader = SocketMessageReader;
2901     var SocketMessageWriter = class extends api_1.WriteableStreamMessageWriter {
2902       constructor(socket, options) {
2903         super(ril_1.default().stream.asWritableStream(socket), options);
2904         this.socket = socket;
2905       }
2906       dispose() {
2907         super.dispose();
2908         this.socket.destroy();
2909       }
2910     };
2911     exports2.SocketMessageWriter = SocketMessageWriter;
2912     var StreamMessageReader = class extends api_1.ReadableStreamMessageReader {
2913       constructor(readble, encoding) {
2914         super(ril_1.default().stream.asReadableStream(readble), encoding);
2915       }
2916     };
2917     exports2.StreamMessageReader = StreamMessageReader;
2918     var StreamMessageWriter = class extends api_1.WriteableStreamMessageWriter {
2919       constructor(writable, options) {
2920         super(ril_1.default().stream.asWritableStream(writable), options);
2921       }
2922     };
2923     exports2.StreamMessageWriter = StreamMessageWriter;
2924     var XDG_RUNTIME_DIR = process.env["XDG_RUNTIME_DIR"];
2925     var safeIpcPathLengths = new Map([
2926       ["linux", 107],
2927       ["darwin", 103]
2928     ]);
2929     function generateRandomPipeName() {
2930       const randomSuffix = crypto_1.randomBytes(21).toString("hex");
2931       if (process.platform === "win32") {
2932         return `\\\\.\\pipe\\vscode-jsonrpc-${randomSuffix}-sock`;
2933       }
2934       let result;
2935       if (XDG_RUNTIME_DIR) {
2936         result = path2.join(XDG_RUNTIME_DIR, `vscode-ipc-${randomSuffix}.sock`);
2937       } else {
2938         result = path2.join(os.tmpdir(), `vscode-${randomSuffix}.sock`);
2939       }
2940       const limit = safeIpcPathLengths.get(process.platform);
2941       if (limit !== void 0 && result.length >= limit) {
2942         ril_1.default().console.warn(`WARNING: IPC handle "${result}" is longer than ${limit} characters.`);
2943       }
2944       return result;
2945     }
2946     exports2.generateRandomPipeName = generateRandomPipeName;
2947     function createClientPipeTransport(pipeName, encoding = "utf-8") {
2948       let connectResolve;
2949       const connected = new Promise((resolve, _reject) => {
2950         connectResolve = resolve;
2951       });
2952       return new Promise((resolve, reject) => {
2953         let server = net_1.createServer((socket) => {
2954           server.close();
2955           connectResolve([
2956             new SocketMessageReader(socket, encoding),
2957             new SocketMessageWriter(socket, encoding)
2958           ]);
2959         });
2960         server.on("error", reject);
2961         server.listen(pipeName, () => {
2962           server.removeListener("error", reject);
2963           resolve({
2964             onConnected: () => {
2965               return connected;
2966             }
2967           });
2968         });
2969       });
2970     }
2971     exports2.createClientPipeTransport = createClientPipeTransport;
2972     function createServerPipeTransport(pipeName, encoding = "utf-8") {
2973       const socket = net_1.createConnection(pipeName);
2974       return [
2975         new SocketMessageReader(socket, encoding),
2976         new SocketMessageWriter(socket, encoding)
2977       ];
2978     }
2979     exports2.createServerPipeTransport = createServerPipeTransport;
2980     function createClientSocketTransport(port, encoding = "utf-8") {
2981       let connectResolve;
2982       const connected = new Promise((resolve, _reject) => {
2983         connectResolve = resolve;
2984       });
2985       return new Promise((resolve, reject) => {
2986         const server = net_1.createServer((socket) => {
2987           server.close();
2988           connectResolve([
2989             new SocketMessageReader(socket, encoding),
2990             new SocketMessageWriter(socket, encoding)
2991           ]);
2992         });
2993         server.on("error", reject);
2994         server.listen(port, "127.0.0.1", () => {
2995           server.removeListener("error", reject);
2996           resolve({
2997             onConnected: () => {
2998               return connected;
2999             }
3000           });
3001         });
3002       });
3003     }
3004     exports2.createClientSocketTransport = createClientSocketTransport;
3005     function createServerSocketTransport(port, encoding = "utf-8") {
3006       const socket = net_1.createConnection(port, "127.0.0.1");
3007       return [
3008         new SocketMessageReader(socket, encoding),
3009         new SocketMessageWriter(socket, encoding)
3010       ];
3011     }
3012     exports2.createServerSocketTransport = createServerSocketTransport;
3013     function isReadableStream(value) {
3014       const candidate = value;
3015       return candidate.read !== void 0 && candidate.addListener !== void 0;
3016     }
3017     function isWritableStream(value) {
3018       const candidate = value;
3019       return candidate.write !== void 0 && candidate.addListener !== void 0;
3020     }
3021     function createMessageConnection(input, output, logger, options) {
3022       if (!logger) {
3023         logger = api_1.NullLogger;
3024       }
3025       const reader = isReadableStream(input) ? new StreamMessageReader(input) : input;
3026       const writer = isWritableStream(output) ? new StreamMessageWriter(output) : output;
3027       if (api_1.ConnectionStrategy.is(options)) {
3028         options = { connectionStrategy: options };
3029       }
3030       return api_1.createMessageConnection(reader, writer, logger, options);
3031     }
3032     exports2.createMessageConnection = createMessageConnection;
3033   }
3034 });
3035
3036 // node_modules/vscode-jsonrpc/node.js
3037 var require_node = __commonJS({
3038   "node_modules/vscode-jsonrpc/node.js"(exports2, module2) {
3039     "use strict";
3040     module2.exports = require_main();
3041   }
3042 });
3043
3044 // node_modules/vscode-languageserver-types/lib/esm/main.js
3045 var main_exports = {};
3046 __export(main_exports, {
3047   AnnotatedTextEdit: () => AnnotatedTextEdit,
3048   ChangeAnnotation: () => ChangeAnnotation,
3049   ChangeAnnotationIdentifier: () => ChangeAnnotationIdentifier,
3050   CodeAction: () => CodeAction,
3051   CodeActionContext: () => CodeActionContext,
3052   CodeActionKind: () => CodeActionKind,
3053   CodeDescription: () => CodeDescription,
3054   CodeLens: () => CodeLens,
3055   Color: () => Color,
3056   ColorInformation: () => ColorInformation,
3057   ColorPresentation: () => ColorPresentation,
3058   Command: () => Command,
3059   CompletionItem: () => CompletionItem,
3060   CompletionItemKind: () => CompletionItemKind,
3061   CompletionItemTag: () => CompletionItemTag,
3062   CompletionList: () => CompletionList,
3063   CreateFile: () => CreateFile,
3064   DeleteFile: () => DeleteFile,
3065   Diagnostic: () => Diagnostic,
3066   DiagnosticRelatedInformation: () => DiagnosticRelatedInformation,
3067   DiagnosticSeverity: () => DiagnosticSeverity,
3068   DiagnosticTag: () => DiagnosticTag,
3069   DocumentHighlight: () => DocumentHighlight,
3070   DocumentHighlightKind: () => DocumentHighlightKind,
3071   DocumentLink: () => DocumentLink,
3072   DocumentSymbol: () => DocumentSymbol,
3073   EOL: () => EOL,
3074   FoldingRange: () => FoldingRange,
3075   FoldingRangeKind: () => FoldingRangeKind,
3076   FormattingOptions: () => FormattingOptions,
3077   Hover: () => Hover,
3078   InsertReplaceEdit: () => InsertReplaceEdit,
3079   InsertTextFormat: () => InsertTextFormat,
3080   InsertTextMode: () => InsertTextMode,
3081   Location: () => Location,
3082   LocationLink: () => LocationLink,
3083   MarkedString: () => MarkedString,
3084   MarkupContent: () => MarkupContent,
3085   MarkupKind: () => MarkupKind,
3086   OptionalVersionedTextDocumentIdentifier: () => OptionalVersionedTextDocumentIdentifier,
3087   ParameterInformation: () => ParameterInformation,
3088   Position: () => Position,
3089   Range: () => Range,
3090   RenameFile: () => RenameFile,
3091   SelectionRange: () => SelectionRange,
3092   SignatureInformation: () => SignatureInformation,
3093   SymbolInformation: () => SymbolInformation,
3094   SymbolKind: () => SymbolKind,
3095   SymbolTag: () => SymbolTag,
3096   TextDocument: () => TextDocument,
3097   TextDocumentEdit: () => TextDocumentEdit,
3098   TextDocumentIdentifier: () => TextDocumentIdentifier2,
3099   TextDocumentItem: () => TextDocumentItem,
3100   TextEdit: () => TextEdit,
3101   VersionedTextDocumentIdentifier: () => VersionedTextDocumentIdentifier,
3102   WorkspaceChange: () => WorkspaceChange,
3103   WorkspaceEdit: () => WorkspaceEdit,
3104   integer: () => integer,
3105   uinteger: () => uinteger
3106 });
3107 var integer, uinteger, Position, Range, Location, LocationLink, Color, ColorInformation, ColorPresentation, FoldingRangeKind, FoldingRange, DiagnosticRelatedInformation, DiagnosticSeverity, DiagnosticTag, CodeDescription, Diagnostic, Command, TextEdit, ChangeAnnotation, ChangeAnnotationIdentifier, AnnotatedTextEdit, TextDocumentEdit, CreateFile, RenameFile, DeleteFile, WorkspaceEdit, TextEditChangeImpl, ChangeAnnotations, WorkspaceChange, TextDocumentIdentifier2, VersionedTextDocumentIdentifier, OptionalVersionedTextDocumentIdentifier, TextDocumentItem, MarkupKind, MarkupContent, CompletionItemKind, InsertTextFormat, CompletionItemTag, InsertReplaceEdit, InsertTextMode, CompletionItem, CompletionList, MarkedString, Hover, ParameterInformation, SignatureInformation, DocumentHighlightKind, DocumentHighlight, SymbolKind, SymbolTag, SymbolInformation, DocumentSymbol, CodeActionKind, CodeActionContext, CodeAction, CodeLens, FormattingOptions, DocumentLink, SelectionRange, EOL, TextDocument, FullTextDocument, Is;
3108 var init_main = __esm({
3109   "node_modules/vscode-languageserver-types/lib/esm/main.js"() {
3110     "use strict";
3111     (function(integer2) {
3112       integer2.MIN_VALUE = -2147483648;
3113       integer2.MAX_VALUE = 2147483647;
3114     })(integer || (integer = {}));
3115     (function(uinteger2) {
3116       uinteger2.MIN_VALUE = 0;
3117       uinteger2.MAX_VALUE = 2147483647;
3118     })(uinteger || (uinteger = {}));
3119     (function(Position2) {
3120       function create(line, character) {
3121         if (line === Number.MAX_VALUE) {
3122           line = uinteger.MAX_VALUE;
3123         }
3124         if (character === Number.MAX_VALUE) {
3125           character = uinteger.MAX_VALUE;
3126         }
3127         return { line, character };
3128       }
3129       Position2.create = create;
3130       function is(value) {
3131         var candidate = value;
3132         return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character);
3133       }
3134       Position2.is = is;
3135     })(Position || (Position = {}));
3136     (function(Range5) {
3137       function create(one, two, three, four) {
3138         if (Is.uinteger(one) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four)) {
3139           return { start: Position.create(one, two), end: Position.create(three, four) };
3140         } else if (Position.is(one) && Position.is(two)) {
3141           return { start: one, end: two };
3142         } else {
3143           throw new Error("Range#create called with invalid arguments[" + one + ", " + two + ", " + three + ", " + four + "]");
3144         }
3145       }
3146       Range5.create = create;
3147       function is(value) {
3148         var candidate = value;
3149         return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);
3150       }
3151       Range5.is = is;
3152     })(Range || (Range = {}));
3153     (function(Location2) {
3154       function create(uri, range) {
3155         return { uri, range };
3156       }
3157       Location2.create = create;
3158       function is(value) {
3159         var candidate = value;
3160         return Is.defined(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));
3161       }
3162       Location2.is = is;
3163     })(Location || (Location = {}));
3164     (function(LocationLink2) {
3165       function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {
3166         return { targetUri, targetRange, targetSelectionRange, originSelectionRange };
3167       }
3168       LocationLink2.create = create;
3169       function is(value) {
3170         var candidate = value;
3171         return Is.defined(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri) && (Range.is(candidate.targetSelectionRange) || Is.undefined(candidate.targetSelectionRange)) && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));
3172       }
3173       LocationLink2.is = is;
3174     })(LocationLink || (LocationLink = {}));
3175     (function(Color2) {
3176       function create(red, green, blue, alpha) {
3177         return {
3178           red,
3179           green,
3180           blue,
3181           alpha
3182         };
3183       }
3184       Color2.create = create;
3185       function is(value) {
3186         var candidate = value;
3187         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);
3188       }
3189       Color2.is = is;
3190     })(Color || (Color = {}));
3191     (function(ColorInformation2) {
3192       function create(range, color) {
3193         return {
3194           range,
3195           color
3196         };
3197       }
3198       ColorInformation2.create = create;
3199       function is(value) {
3200         var candidate = value;
3201         return Range.is(candidate.range) && Color.is(candidate.color);
3202       }
3203       ColorInformation2.is = is;
3204     })(ColorInformation || (ColorInformation = {}));
3205     (function(ColorPresentation2) {
3206       function create(label, textEdit, additionalTextEdits) {
3207         return {
3208           label,
3209           textEdit,
3210           additionalTextEdits
3211         };
3212       }
3213       ColorPresentation2.create = create;
3214       function is(value) {
3215         var candidate = value;
3216         return Is.string(candidate.label) && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate)) && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));
3217       }
3218       ColorPresentation2.is = is;
3219     })(ColorPresentation || (ColorPresentation = {}));
3220     (function(FoldingRangeKind2) {
3221       FoldingRangeKind2["Comment"] = "comment";
3222       FoldingRangeKind2["Imports"] = "imports";
3223       FoldingRangeKind2["Region"] = "region";
3224     })(FoldingRangeKind || (FoldingRangeKind = {}));
3225     (function(FoldingRange2) {
3226       function create(startLine, endLine, startCharacter, endCharacter, kind) {
3227         var result = {
3228           startLine,
3229           endLine
3230         };
3231         if (Is.defined(startCharacter)) {
3232           result.startCharacter = startCharacter;
3233         }
3234         if (Is.defined(endCharacter)) {
3235           result.endCharacter = endCharacter;
3236         }
3237         if (Is.defined(kind)) {
3238           result.kind = kind;
3239         }
3240         return result;
3241       }
3242       FoldingRange2.create = create;
3243       function is(value) {
3244         var candidate = value;
3245         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));
3246       }
3247       FoldingRange2.is = is;
3248     })(FoldingRange || (FoldingRange = {}));
3249     (function(DiagnosticRelatedInformation2) {
3250       function create(location, message) {
3251         return {
3252           location,
3253           message
3254         };
3255       }
3256       DiagnosticRelatedInformation2.create = create;
3257       function is(value) {
3258         var candidate = value;
3259         return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);
3260       }
3261       DiagnosticRelatedInformation2.is = is;
3262     })(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {}));
3263     (function(DiagnosticSeverity2) {
3264       DiagnosticSeverity2.Error = 1;
3265       DiagnosticSeverity2.Warning = 2;
3266       DiagnosticSeverity2.Information = 3;
3267       DiagnosticSeverity2.Hint = 4;
3268     })(DiagnosticSeverity || (DiagnosticSeverity = {}));
3269     (function(DiagnosticTag2) {
3270       DiagnosticTag2.Unnecessary = 1;
3271       DiagnosticTag2.Deprecated = 2;
3272     })(DiagnosticTag || (DiagnosticTag = {}));
3273     (function(CodeDescription2) {
3274       function is(value) {
3275         var candidate = value;
3276         return candidate !== void 0 && candidate !== null && Is.string(candidate.href);
3277       }
3278       CodeDescription2.is = is;
3279     })(CodeDescription || (CodeDescription = {}));
3280     (function(Diagnostic2) {
3281       function create(range, message, severity, code, source, relatedInformation) {
3282         var result = { range, message };
3283         if (Is.defined(severity)) {
3284           result.severity = severity;
3285         }
3286         if (Is.defined(code)) {
3287           result.code = code;
3288         }
3289         if (Is.defined(source)) {
3290           result.source = source;
3291         }
3292         if (Is.defined(relatedInformation)) {
3293           result.relatedInformation = relatedInformation;
3294         }
3295         return result;
3296       }
3297       Diagnostic2.create = create;
3298       function is(value) {
3299         var _a;
3300         var candidate = value;
3301         return Is.defined(candidate) && Range.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));
3302       }
3303       Diagnostic2.is = is;
3304     })(Diagnostic || (Diagnostic = {}));
3305     (function(Command2) {
3306       function create(title, command) {
3307         var args = [];
3308         for (var _i = 2; _i < arguments.length; _i++) {
3309           args[_i - 2] = arguments[_i];
3310         }
3311         var result = { title, command };
3312         if (Is.defined(args) && args.length > 0) {
3313           result.arguments = args;
3314         }
3315         return result;
3316       }
3317       Command2.create = create;
3318       function is(value) {
3319         var candidate = value;
3320         return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);
3321       }
3322       Command2.is = is;
3323     })(Command || (Command = {}));
3324     (function(TextEdit2) {
3325       function replace(range, newText) {
3326         return { range, newText };
3327       }
3328       TextEdit2.replace = replace;
3329       function insert(position, newText) {
3330         return { range: { start: position, end: position }, newText };
3331       }
3332       TextEdit2.insert = insert;
3333       function del(range) {
3334         return { range, newText: "" };
3335       }
3336       TextEdit2.del = del;
3337       function is(value) {
3338         var candidate = value;
3339         return Is.objectLiteral(candidate) && Is.string(candidate.newText) && Range.is(candidate.range);
3340       }
3341       TextEdit2.is = is;
3342     })(TextEdit || (TextEdit = {}));
3343     (function(ChangeAnnotation2) {
3344       function create(label, needsConfirmation, description) {
3345         var result = { label };
3346         if (needsConfirmation !== void 0) {
3347           result.needsConfirmation = needsConfirmation;
3348         }
3349         if (description !== void 0) {
3350           result.description = description;
3351         }
3352         return result;
3353       }
3354       ChangeAnnotation2.create = create;
3355       function is(value) {
3356         var candidate = value;
3357         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);
3358       }
3359       ChangeAnnotation2.is = is;
3360     })(ChangeAnnotation || (ChangeAnnotation = {}));
3361     (function(ChangeAnnotationIdentifier2) {
3362       function is(value) {
3363         var candidate = value;
3364         return typeof candidate === "string";
3365       }
3366       ChangeAnnotationIdentifier2.is = is;
3367     })(ChangeAnnotationIdentifier || (ChangeAnnotationIdentifier = {}));
3368     (function(AnnotatedTextEdit2) {
3369       function replace(range, newText, annotation) {
3370         return { range, newText, annotationId: annotation };
3371       }
3372       AnnotatedTextEdit2.replace = replace;
3373       function insert(position, newText, annotation) {
3374         return { range: { start: position, end: position }, newText, annotationId: annotation };
3375       }
3376       AnnotatedTextEdit2.insert = insert;
3377       function del(range, annotation) {
3378         return { range, newText: "", annotationId: annotation };
3379       }
3380       AnnotatedTextEdit2.del = del;
3381       function is(value) {
3382         var candidate = value;
3383         return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId));
3384       }
3385       AnnotatedTextEdit2.is = is;
3386     })(AnnotatedTextEdit || (AnnotatedTextEdit = {}));
3387     (function(TextDocumentEdit2) {
3388       function create(textDocument, edits) {
3389         return { textDocument, edits };
3390       }
3391       TextDocumentEdit2.create = create;
3392       function is(value) {
3393         var candidate = value;
3394         return Is.defined(candidate) && OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument) && Array.isArray(candidate.edits);
3395       }
3396       TextDocumentEdit2.is = is;
3397     })(TextDocumentEdit || (TextDocumentEdit = {}));
3398     (function(CreateFile2) {
3399       function create(uri, options, annotation) {
3400         var result = {
3401           kind: "create",
3402           uri
3403         };
3404         if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {
3405           result.options = options;
3406         }
3407         if (annotation !== void 0) {
3408           result.annotationId = annotation;
3409         }
3410         return result;
3411       }
3412       CreateFile2.create = create;
3413       function is(value) {
3414         var candidate = value;
3415         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));
3416       }
3417       CreateFile2.is = is;
3418     })(CreateFile || (CreateFile = {}));
3419     (function(RenameFile2) {
3420       function create(oldUri, newUri, options, annotation) {
3421         var result = {
3422           kind: "rename",
3423           oldUri,
3424           newUri
3425         };
3426         if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {
3427           result.options = options;
3428         }
3429         if (annotation !== void 0) {
3430           result.annotationId = annotation;
3431         }
3432         return result;
3433       }
3434       RenameFile2.create = create;
3435       function is(value) {
3436         var candidate = value;
3437         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));
3438       }
3439       RenameFile2.is = is;
3440     })(RenameFile || (RenameFile = {}));
3441     (function(DeleteFile2) {
3442       function create(uri, options, annotation) {
3443         var result = {
3444           kind: "delete",
3445           uri
3446         };
3447         if (options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0)) {
3448           result.options = options;
3449         }
3450         if (annotation !== void 0) {
3451           result.annotationId = annotation;
3452         }
3453         return result;
3454       }
3455       DeleteFile2.create = create;
3456       function is(value) {
3457         var candidate = value;
3458         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));
3459       }
3460       DeleteFile2.is = is;
3461     })(DeleteFile || (DeleteFile = {}));
3462     (function(WorkspaceEdit2) {
3463       function is(value) {
3464         var candidate = value;
3465         return candidate && (candidate.changes !== void 0 || candidate.documentChanges !== void 0) && (candidate.documentChanges === void 0 || candidate.documentChanges.every(function(change) {
3466           if (Is.string(change.kind)) {
3467             return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);
3468           } else {
3469             return TextDocumentEdit.is(change);
3470           }
3471         }));
3472       }
3473       WorkspaceEdit2.is = is;
3474     })(WorkspaceEdit || (WorkspaceEdit = {}));
3475     TextEditChangeImpl = function() {
3476       function TextEditChangeImpl2(edits, changeAnnotations) {
3477         this.edits = edits;
3478         this.changeAnnotations = changeAnnotations;
3479       }
3480       TextEditChangeImpl2.prototype.insert = function(position, newText, annotation) {
3481         var edit;
3482         var id;
3483         if (annotation === void 0) {
3484           edit = TextEdit.insert(position, newText);
3485         } else if (ChangeAnnotationIdentifier.is(annotation)) {
3486           id = annotation;
3487           edit = AnnotatedTextEdit.insert(position, newText, annotation);
3488         } else {
3489           this.assertChangeAnnotations(this.changeAnnotations);
3490           id = this.changeAnnotations.manage(annotation);
3491           edit = AnnotatedTextEdit.insert(position, newText, id);
3492         }
3493         this.edits.push(edit);
3494         if (id !== void 0) {
3495           return id;
3496         }
3497       };
3498       TextEditChangeImpl2.prototype.replace = function(range, newText, annotation) {
3499         var edit;
3500         var id;
3501         if (annotation === void 0) {
3502           edit = TextEdit.replace(range, newText);
3503         } else if (ChangeAnnotationIdentifier.is(annotation)) {
3504           id = annotation;
3505           edit = AnnotatedTextEdit.replace(range, newText, annotation);
3506         } else {
3507           this.assertChangeAnnotations(this.changeAnnotations);
3508           id = this.changeAnnotations.manage(annotation);
3509           edit = AnnotatedTextEdit.replace(range, newText, id);
3510         }
3511         this.edits.push(edit);
3512         if (id !== void 0) {
3513           return id;
3514         }
3515       };
3516       TextEditChangeImpl2.prototype.delete = function(range, annotation) {
3517         var edit;
3518         var id;
3519         if (annotation === void 0) {
3520           edit = TextEdit.del(range);
3521         } else if (ChangeAnnotationIdentifier.is(annotation)) {
3522           id = annotation;
3523           edit = AnnotatedTextEdit.del(range, annotation);
3524         } else {
3525           this.assertChangeAnnotations(this.changeAnnotations);
3526           id = this.changeAnnotations.manage(annotation);
3527           edit = AnnotatedTextEdit.del(range, id);
3528         }
3529         this.edits.push(edit);
3530         if (id !== void 0) {
3531           return id;
3532         }
3533       };
3534       TextEditChangeImpl2.prototype.add = function(edit) {
3535         this.edits.push(edit);
3536       };
3537       TextEditChangeImpl2.prototype.all = function() {
3538         return this.edits;
3539       };
3540       TextEditChangeImpl2.prototype.clear = function() {
3541         this.edits.splice(0, this.edits.length);
3542       };
3543       TextEditChangeImpl2.prototype.assertChangeAnnotations = function(value) {
3544         if (value === void 0) {
3545           throw new Error("Text edit change is not configured to manage change annotations.");
3546         }
3547       };
3548       return TextEditChangeImpl2;
3549     }();
3550     ChangeAnnotations = function() {
3551       function ChangeAnnotations2(annotations) {
3552         this._annotations = annotations === void 0 ? Object.create(null) : annotations;
3553         this._counter = 0;
3554         this._size = 0;
3555       }
3556       ChangeAnnotations2.prototype.all = function() {
3557         return this._annotations;
3558       };
3559       Object.defineProperty(ChangeAnnotations2.prototype, "size", {
3560         get: function() {
3561           return this._size;
3562         },
3563         enumerable: false,
3564         configurable: true
3565       });
3566       ChangeAnnotations2.prototype.manage = function(idOrAnnotation, annotation) {
3567         var id;
3568         if (ChangeAnnotationIdentifier.is(idOrAnnotation)) {
3569           id = idOrAnnotation;
3570         } else {
3571           id = this.nextId();
3572           annotation = idOrAnnotation;
3573         }
3574         if (this._annotations[id] !== void 0) {
3575           throw new Error("Id " + id + " is already in use.");
3576         }
3577         if (annotation === void 0) {
3578           throw new Error("No annotation provided for id " + id);
3579         }
3580         this._annotations[id] = annotation;
3581         this._size++;
3582         return id;
3583       };
3584       ChangeAnnotations2.prototype.nextId = function() {
3585         this._counter++;
3586         return this._counter.toString();
3587       };
3588       return ChangeAnnotations2;
3589     }();
3590     WorkspaceChange = function() {
3591       function WorkspaceChange2(workspaceEdit) {
3592         var _this = this;
3593         this._textEditChanges = Object.create(null);
3594         if (workspaceEdit !== void 0) {
3595           this._workspaceEdit = workspaceEdit;
3596           if (workspaceEdit.documentChanges) {
3597             this._changeAnnotations = new ChangeAnnotations(workspaceEdit.changeAnnotations);
3598             workspaceEdit.changeAnnotations = this._changeAnnotations.all();
3599             workspaceEdit.documentChanges.forEach(function(change) {
3600               if (TextDocumentEdit.is(change)) {
3601                 var textEditChange = new TextEditChangeImpl(change.edits, _this._changeAnnotations);
3602                 _this._textEditChanges[change.textDocument.uri] = textEditChange;
3603               }
3604             });
3605           } else if (workspaceEdit.changes) {
3606             Object.keys(workspaceEdit.changes).forEach(function(key) {
3607               var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]);
3608               _this._textEditChanges[key] = textEditChange;
3609             });
3610           }
3611         } else {
3612           this._workspaceEdit = {};
3613         }
3614       }
3615       Object.defineProperty(WorkspaceChange2.prototype, "edit", {
3616         get: function() {
3617           this.initDocumentChanges();
3618           if (this._changeAnnotations !== void 0) {
3619             if (this._changeAnnotations.size === 0) {
3620               this._workspaceEdit.changeAnnotations = void 0;
3621             } else {
3622               this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
3623             }
3624           }
3625           return this._workspaceEdit;
3626         },
3627         enumerable: false,
3628         configurable: true
3629       });
3630       WorkspaceChange2.prototype.getTextEditChange = function(key) {
3631         if (OptionalVersionedTextDocumentIdentifier.is(key)) {
3632           this.initDocumentChanges();
3633           if (this._workspaceEdit.documentChanges === void 0) {
3634             throw new Error("Workspace edit is not configured for document changes.");
3635           }
3636           var textDocument = { uri: key.uri, version: key.version };
3637           var result = this._textEditChanges[textDocument.uri];
3638           if (!result) {
3639             var edits = [];
3640             var textDocumentEdit = {
3641               textDocument,
3642               edits
3643             };
3644             this._workspaceEdit.documentChanges.push(textDocumentEdit);
3645             result = new TextEditChangeImpl(edits, this._changeAnnotations);
3646             this._textEditChanges[textDocument.uri] = result;
3647           }
3648           return result;
3649         } else {
3650           this.initChanges();
3651           if (this._workspaceEdit.changes === void 0) {
3652             throw new Error("Workspace edit is not configured for normal text edit changes.");
3653           }
3654           var result = this._textEditChanges[key];
3655           if (!result) {
3656             var edits = [];
3657             this._workspaceEdit.changes[key] = edits;
3658             result = new TextEditChangeImpl(edits);
3659             this._textEditChanges[key] = result;
3660           }
3661           return result;
3662         }
3663       };
3664       WorkspaceChange2.prototype.initDocumentChanges = function() {
3665         if (this._workspaceEdit.documentChanges === void 0 && this._workspaceEdit.changes === void 0) {
3666           this._changeAnnotations = new ChangeAnnotations();
3667           this._workspaceEdit.documentChanges = [];
3668           this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
3669         }
3670       };
3671       WorkspaceChange2.prototype.initChanges = function() {
3672         if (this._workspaceEdit.documentChanges === void 0 && this._workspaceEdit.changes === void 0) {
3673           this._workspaceEdit.changes = Object.create(null);
3674         }
3675       };
3676       WorkspaceChange2.prototype.createFile = function(uri, optionsOrAnnotation, options) {
3677         this.initDocumentChanges();
3678         if (this._workspaceEdit.documentChanges === void 0) {
3679           throw new Error("Workspace edit is not configured for document changes.");
3680         }
3681         var annotation;
3682         if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
3683           annotation = optionsOrAnnotation;
3684         } else {
3685           options = optionsOrAnnotation;
3686         }
3687         var operation;
3688         var id;
3689         if (annotation === void 0) {
3690           operation = CreateFile.create(uri, options);
3691         } else {
3692           id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
3693           operation = CreateFile.create(uri, options, id);
3694         }
3695         this._workspaceEdit.documentChanges.push(operation);
3696         if (id !== void 0) {
3697           return id;
3698         }
3699       };
3700       WorkspaceChange2.prototype.renameFile = function(oldUri, newUri, optionsOrAnnotation, options) {
3701         this.initDocumentChanges();
3702         if (this._workspaceEdit.documentChanges === void 0) {
3703           throw new Error("Workspace edit is not configured for document changes.");
3704         }
3705         var annotation;
3706         if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
3707           annotation = optionsOrAnnotation;
3708         } else {
3709           options = optionsOrAnnotation;
3710         }
3711         var operation;
3712         var id;
3713         if (annotation === void 0) {
3714           operation = RenameFile.create(oldUri, newUri, options);
3715         } else {
3716           id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
3717           operation = RenameFile.create(oldUri, newUri, options, id);
3718         }
3719         this._workspaceEdit.documentChanges.push(operation);
3720         if (id !== void 0) {
3721           return id;
3722         }
3723       };
3724       WorkspaceChange2.prototype.deleteFile = function(uri, optionsOrAnnotation, options) {
3725         this.initDocumentChanges();
3726         if (this._workspaceEdit.documentChanges === void 0) {
3727           throw new Error("Workspace edit is not configured for document changes.");
3728         }
3729         var annotation;
3730         if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
3731           annotation = optionsOrAnnotation;
3732         } else {
3733           options = optionsOrAnnotation;
3734         }
3735         var operation;
3736         var id;
3737         if (annotation === void 0) {
3738           operation = DeleteFile.create(uri, options);
3739         } else {
3740           id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
3741           operation = DeleteFile.create(uri, options, id);
3742         }
3743         this._workspaceEdit.documentChanges.push(operation);
3744         if (id !== void 0) {
3745           return id;
3746         }
3747       };
3748       return WorkspaceChange2;
3749     }();
3750     (function(TextDocumentIdentifier4) {
3751       function create(uri) {
3752         return { uri };
3753       }
3754       TextDocumentIdentifier4.create = create;
3755       function is(value) {
3756         var candidate = value;
3757         return Is.defined(candidate) && Is.string(candidate.uri);
3758       }
3759       TextDocumentIdentifier4.is = is;
3760     })(TextDocumentIdentifier2 || (TextDocumentIdentifier2 = {}));
3761     (function(VersionedTextDocumentIdentifier3) {
3762       function create(uri, version) {
3763         return { uri, version };
3764       }
3765       VersionedTextDocumentIdentifier3.create = create;
3766       function is(value) {
3767         var candidate = value;
3768         return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version);
3769       }
3770       VersionedTextDocumentIdentifier3.is = is;
3771     })(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {}));
3772     (function(OptionalVersionedTextDocumentIdentifier2) {
3773       function create(uri, version) {
3774         return { uri, version };
3775       }
3776       OptionalVersionedTextDocumentIdentifier2.create = create;
3777       function is(value) {
3778         var candidate = value;
3779         return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version));
3780       }
3781       OptionalVersionedTextDocumentIdentifier2.is = is;
3782     })(OptionalVersionedTextDocumentIdentifier || (OptionalVersionedTextDocumentIdentifier = {}));
3783     (function(TextDocumentItem2) {
3784       function create(uri, languageId, version, text) {
3785         return { uri, languageId, version, text };
3786       }
3787       TextDocumentItem2.create = create;
3788       function is(value) {
3789         var candidate = value;
3790         return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text);
3791       }
3792       TextDocumentItem2.is = is;
3793     })(TextDocumentItem || (TextDocumentItem = {}));
3794     (function(MarkupKind2) {
3795       MarkupKind2.PlainText = "plaintext";
3796       MarkupKind2.Markdown = "markdown";
3797     })(MarkupKind || (MarkupKind = {}));
3798     (function(MarkupKind2) {
3799       function is(value) {
3800         var candidate = value;
3801         return candidate === MarkupKind2.PlainText || candidate === MarkupKind2.Markdown;
3802       }
3803       MarkupKind2.is = is;
3804     })(MarkupKind || (MarkupKind = {}));
3805     (function(MarkupContent2) {
3806       function is(value) {
3807         var candidate = value;
3808         return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);
3809       }
3810       MarkupContent2.is = is;
3811     })(MarkupContent || (MarkupContent = {}));
3812     (function(CompletionItemKind3) {
3813       CompletionItemKind3.Text = 1;
3814       CompletionItemKind3.Method = 2;
3815       CompletionItemKind3.Function = 3;
3816       CompletionItemKind3.Constructor = 4;
3817       CompletionItemKind3.Field = 5;
3818       CompletionItemKind3.Variable = 6;
3819       CompletionItemKind3.Class = 7;
3820       CompletionItemKind3.Interface = 8;
3821       CompletionItemKind3.Module = 9;
3822       CompletionItemKind3.Property = 10;
3823       CompletionItemKind3.Unit = 11;
3824       CompletionItemKind3.Value = 12;
3825       CompletionItemKind3.Enum = 13;
3826       CompletionItemKind3.Keyword = 14;
3827       CompletionItemKind3.Snippet = 15;
3828       CompletionItemKind3.Color = 16;
3829       CompletionItemKind3.File = 17;
3830       CompletionItemKind3.Reference = 18;
3831       CompletionItemKind3.Folder = 19;
3832       CompletionItemKind3.EnumMember = 20;
3833       CompletionItemKind3.Constant = 21;
3834       CompletionItemKind3.Struct = 22;
3835       CompletionItemKind3.Event = 23;
3836       CompletionItemKind3.Operator = 24;
3837       CompletionItemKind3.TypeParameter = 25;
3838     })(CompletionItemKind || (CompletionItemKind = {}));
3839     (function(InsertTextFormat3) {
3840       InsertTextFormat3.PlainText = 1;
3841       InsertTextFormat3.Snippet = 2;
3842     })(InsertTextFormat || (InsertTextFormat = {}));
3843     (function(CompletionItemTag2) {
3844       CompletionItemTag2.Deprecated = 1;
3845     })(CompletionItemTag || (CompletionItemTag = {}));
3846     (function(InsertReplaceEdit2) {
3847       function create(newText, insert, replace) {
3848         return { newText, insert, replace };
3849       }
3850       InsertReplaceEdit2.create = create;
3851       function is(value) {
3852         var candidate = value;
3853         return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace);
3854       }
3855       InsertReplaceEdit2.is = is;
3856     })(InsertReplaceEdit || (InsertReplaceEdit = {}));
3857     (function(InsertTextMode2) {
3858       InsertTextMode2.asIs = 1;
3859       InsertTextMode2.adjustIndentation = 2;
3860     })(InsertTextMode || (InsertTextMode = {}));
3861     (function(CompletionItem2) {
3862       function create(label) {
3863         return { label };
3864       }
3865       CompletionItem2.create = create;
3866     })(CompletionItem || (CompletionItem = {}));
3867     (function(CompletionList2) {
3868       function create(items, isIncomplete) {
3869         return { items: items ? items : [], isIncomplete: !!isIncomplete };
3870       }
3871       CompletionList2.create = create;
3872     })(CompletionList || (CompletionList = {}));
3873     (function(MarkedString2) {
3874       function fromPlainText(plainText) {
3875         return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&");
3876       }
3877       MarkedString2.fromPlainText = fromPlainText;
3878       function is(value) {
3879         var candidate = value;
3880         return Is.string(candidate) || Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value);
3881       }
3882       MarkedString2.is = is;
3883     })(MarkedString || (MarkedString = {}));
3884     (function(Hover2) {
3885       function is(value) {
3886         var candidate = value;
3887         return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) || MarkedString.is(candidate.contents) || Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || Range.is(value.range));
3888       }
3889       Hover2.is = is;
3890     })(Hover || (Hover = {}));
3891     (function(ParameterInformation2) {
3892       function create(label, documentation) {
3893         return documentation ? { label, documentation } : { label };
3894       }
3895       ParameterInformation2.create = create;
3896     })(ParameterInformation || (ParameterInformation = {}));
3897     (function(SignatureInformation2) {
3898       function create(label, documentation) {
3899         var parameters = [];
3900         for (var _i = 2; _i < arguments.length; _i++) {
3901           parameters[_i - 2] = arguments[_i];
3902         }
3903         var result = { label };
3904         if (Is.defined(documentation)) {
3905           result.documentation = documentation;
3906         }
3907         if (Is.defined(parameters)) {
3908           result.parameters = parameters;
3909         } else {
3910           result.parameters = [];
3911         }
3912         return result;
3913       }
3914       SignatureInformation2.create = create;
3915     })(SignatureInformation || (SignatureInformation = {}));
3916     (function(DocumentHighlightKind2) {
3917       DocumentHighlightKind2.Text = 1;
3918       DocumentHighlightKind2.Read = 2;
3919       DocumentHighlightKind2.Write = 3;
3920     })(DocumentHighlightKind || (DocumentHighlightKind = {}));
3921     (function(DocumentHighlight2) {
3922       function create(range, kind) {
3923         var result = { range };
3924         if (Is.number(kind)) {
3925           result.kind = kind;
3926         }
3927         return result;
3928       }
3929       DocumentHighlight2.create = create;
3930     })(DocumentHighlight || (DocumentHighlight = {}));
3931     (function(SymbolKind2) {
3932       SymbolKind2.File = 1;
3933       SymbolKind2.Module = 2;
3934       SymbolKind2.Namespace = 3;
3935       SymbolKind2.Package = 4;
3936       SymbolKind2.Class = 5;
3937       SymbolKind2.Method = 6;
3938       SymbolKind2.Property = 7;
3939       SymbolKind2.Field = 8;
3940       SymbolKind2.Constructor = 9;
3941       SymbolKind2.Enum = 10;
3942       SymbolKind2.Interface = 11;
3943       SymbolKind2.Function = 12;
3944       SymbolKind2.Variable = 13;
3945       SymbolKind2.Constant = 14;
3946       SymbolKind2.String = 15;
3947       SymbolKind2.Number = 16;
3948       SymbolKind2.Boolean = 17;
3949       SymbolKind2.Array = 18;
3950       SymbolKind2.Object = 19;
3951       SymbolKind2.Key = 20;
3952       SymbolKind2.Null = 21;
3953       SymbolKind2.EnumMember = 22;
3954       SymbolKind2.Struct = 23;
3955       SymbolKind2.Event = 24;
3956       SymbolKind2.Operator = 25;
3957       SymbolKind2.TypeParameter = 26;
3958     })(SymbolKind || (SymbolKind = {}));
3959     (function(SymbolTag2) {
3960       SymbolTag2.Deprecated = 1;
3961     })(SymbolTag || (SymbolTag = {}));
3962     (function(SymbolInformation2) {
3963       function create(name, kind, range, uri, containerName) {
3964         var result = {
3965           name,
3966           kind,
3967           location: { uri, range }
3968         };
3969         if (containerName) {
3970           result.containerName = containerName;
3971         }
3972         return result;
3973       }
3974       SymbolInformation2.create = create;
3975     })(SymbolInformation || (SymbolInformation = {}));
3976     (function(DocumentSymbol2) {
3977       function create(name, detail, kind, range, selectionRange, children) {
3978         var result = {
3979           name,
3980           detail,
3981           kind,
3982           range,
3983           selectionRange
3984         };
3985         if (children !== void 0) {
3986           result.children = children;
3987         }
3988         return result;
3989       }
3990       DocumentSymbol2.create = create;
3991       function is(value) {
3992         var candidate = value;
3993         return candidate && Is.string(candidate.name) && Is.number(candidate.kind) && Range.is(candidate.range) && Range.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));
3994       }
3995       DocumentSymbol2.is = is;
3996     })(DocumentSymbol || (DocumentSymbol = {}));
3997     (function(CodeActionKind2) {
3998       CodeActionKind2.Empty = "";
3999       CodeActionKind2.QuickFix = "quickfix";
4000       CodeActionKind2.Refactor = "refactor";
4001       CodeActionKind2.RefactorExtract = "refactor.extract";
4002       CodeActionKind2.RefactorInline = "refactor.inline";
4003       CodeActionKind2.RefactorRewrite = "refactor.rewrite";
4004       CodeActionKind2.Source = "source";
4005       CodeActionKind2.SourceOrganizeImports = "source.organizeImports";
4006       CodeActionKind2.SourceFixAll = "source.fixAll";
4007     })(CodeActionKind || (CodeActionKind = {}));
4008     (function(CodeActionContext2) {
4009       function create(diagnostics, only) {
4010         var result = { diagnostics };
4011         if (only !== void 0 && only !== null) {
4012           result.only = only;
4013         }
4014         return result;
4015       }
4016       CodeActionContext2.create = create;
4017       function is(value) {
4018         var candidate = value;
4019         return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string));
4020       }
4021       CodeActionContext2.is = is;
4022     })(CodeActionContext || (CodeActionContext = {}));
4023     (function(CodeAction2) {
4024       function create(title, kindOrCommandOrEdit, kind) {
4025         var result = { title };
4026         var checkKind = true;
4027         if (typeof kindOrCommandOrEdit === "string") {
4028           checkKind = false;
4029           result.kind = kindOrCommandOrEdit;
4030         } else if (Command.is(kindOrCommandOrEdit)) {
4031           result.command = kindOrCommandOrEdit;
4032         } else {
4033           result.edit = kindOrCommandOrEdit;
4034         }
4035         if (checkKind && kind !== void 0) {
4036           result.kind = kind;
4037         }
4038         return result;
4039       }
4040       CodeAction2.create = create;
4041       function is(value) {
4042         var candidate = value;
4043         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));
4044       }
4045       CodeAction2.is = is;
4046     })(CodeAction || (CodeAction = {}));
4047     (function(CodeLens2) {
4048       function create(range, data) {
4049         var result = { range };
4050         if (Is.defined(data)) {
4051           result.data = data;
4052         }
4053         return result;
4054       }
4055       CodeLens2.create = create;
4056       function is(value) {
4057         var candidate = value;
4058         return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));
4059       }
4060       CodeLens2.is = is;
4061     })(CodeLens || (CodeLens = {}));
4062     (function(FormattingOptions2) {
4063       function create(tabSize, insertSpaces) {
4064         return { tabSize, insertSpaces };
4065       }
4066       FormattingOptions2.create = create;
4067       function is(value) {
4068         var candidate = value;
4069         return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces);
4070       }
4071       FormattingOptions2.is = is;
4072     })(FormattingOptions || (FormattingOptions = {}));
4073     (function(DocumentLink2) {
4074       function create(range, target, data) {
4075         return { range, target, data };
4076       }
4077       DocumentLink2.create = create;
4078       function is(value) {
4079         var candidate = value;
4080         return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));
4081       }
4082       DocumentLink2.is = is;
4083     })(DocumentLink || (DocumentLink = {}));
4084     (function(SelectionRange2) {
4085       function create(range, parent) {
4086         return { range, parent };
4087       }
4088       SelectionRange2.create = create;
4089       function is(value) {
4090         var candidate = value;
4091         return candidate !== void 0 && Range.is(candidate.range) && (candidate.parent === void 0 || SelectionRange2.is(candidate.parent));
4092       }
4093       SelectionRange2.is = is;
4094     })(SelectionRange || (SelectionRange = {}));
4095     EOL = ["\n", "\r\n", "\r"];
4096     (function(TextDocument2) {
4097       function create(uri, languageId, version, content) {
4098         return new FullTextDocument(uri, languageId, version, content);
4099       }
4100       TextDocument2.create = create;
4101       function is(value) {
4102         var candidate = value;
4103         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;
4104       }
4105       TextDocument2.is = is;
4106       function applyEdits(document2, edits) {
4107         var text = document2.getText();
4108         var sortedEdits = mergeSort(edits, function(a, b) {
4109           var diff = a.range.start.line - b.range.start.line;
4110           if (diff === 0) {
4111             return a.range.start.character - b.range.start.character;
4112           }
4113           return diff;
4114         });
4115         var lastModifiedOffset = text.length;
4116         for (var i = sortedEdits.length - 1; i >= 0; i--) {
4117           var e = sortedEdits[i];
4118           var startOffset = document2.offsetAt(e.range.start);
4119           var endOffset = document2.offsetAt(e.range.end);
4120           if (endOffset <= lastModifiedOffset) {
4121             text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);
4122           } else {
4123             throw new Error("Overlapping edit");
4124           }
4125           lastModifiedOffset = startOffset;
4126         }
4127         return text;
4128       }
4129       TextDocument2.applyEdits = applyEdits;
4130       function mergeSort(data, compare) {
4131         if (data.length <= 1) {
4132           return data;
4133         }
4134         var p = data.length / 2 | 0;
4135         var left = data.slice(0, p);
4136         var right = data.slice(p);
4137         mergeSort(left, compare);
4138         mergeSort(right, compare);
4139         var leftIdx = 0;
4140         var rightIdx = 0;
4141         var i = 0;
4142         while (leftIdx < left.length && rightIdx < right.length) {
4143           var ret2 = compare(left[leftIdx], right[rightIdx]);
4144           if (ret2 <= 0) {
4145             data[i++] = left[leftIdx++];
4146           } else {
4147             data[i++] = right[rightIdx++];
4148           }
4149         }
4150         while (leftIdx < left.length) {
4151           data[i++] = left[leftIdx++];
4152         }
4153         while (rightIdx < right.length) {
4154           data[i++] = right[rightIdx++];
4155         }
4156         return data;
4157       }
4158     })(TextDocument || (TextDocument = {}));
4159     FullTextDocument = function() {
4160       function FullTextDocument2(uri, languageId, version, content) {
4161         this._uri = uri;
4162         this._languageId = languageId;
4163         this._version = version;
4164         this._content = content;
4165         this._lineOffsets = void 0;
4166       }
4167       Object.defineProperty(FullTextDocument2.prototype, "uri", {
4168         get: function() {
4169           return this._uri;
4170         },
4171         enumerable: false,
4172         configurable: true
4173       });
4174       Object.defineProperty(FullTextDocument2.prototype, "languageId", {
4175         get: function() {
4176           return this._languageId;
4177         },
4178         enumerable: false,
4179         configurable: true
4180       });
4181       Object.defineProperty(FullTextDocument2.prototype, "version", {
4182         get: function() {
4183           return this._version;
4184         },
4185         enumerable: false,
4186         configurable: true
4187       });
4188       FullTextDocument2.prototype.getText = function(range) {
4189         if (range) {
4190           var start = this.offsetAt(range.start);
4191           var end = this.offsetAt(range.end);
4192           return this._content.substring(start, end);
4193         }
4194         return this._content;
4195       };
4196       FullTextDocument2.prototype.update = function(event, version) {
4197         this._content = event.text;
4198         this._version = version;
4199         this._lineOffsets = void 0;
4200       };
4201       FullTextDocument2.prototype.getLineOffsets = function() {
4202         if (this._lineOffsets === void 0) {
4203           var lineOffsets = [];
4204           var text = this._content;
4205           var isLineStart = true;
4206           for (var i = 0; i < text.length; i++) {
4207             if (isLineStart) {
4208               lineOffsets.push(i);
4209               isLineStart = false;
4210             }
4211             var ch = text.charAt(i);
4212             isLineStart = ch === "\r" || ch === "\n";
4213             if (ch === "\r" && i + 1 < text.length && text.charAt(i + 1) === "\n") {
4214               i++;
4215             }
4216           }
4217           if (isLineStart && text.length > 0) {
4218             lineOffsets.push(text.length);
4219           }
4220           this._lineOffsets = lineOffsets;
4221         }
4222         return this._lineOffsets;
4223       };
4224       FullTextDocument2.prototype.positionAt = function(offset) {
4225         offset = Math.max(Math.min(offset, this._content.length), 0);
4226         var lineOffsets = this.getLineOffsets();
4227         var low = 0, high = lineOffsets.length;
4228         if (high === 0) {
4229           return Position.create(0, offset);
4230         }
4231         while (low < high) {
4232           var mid = Math.floor((low + high) / 2);
4233           if (lineOffsets[mid] > offset) {
4234             high = mid;
4235           } else {
4236             low = mid + 1;
4237           }
4238         }
4239         var line = low - 1;
4240         return Position.create(line, offset - lineOffsets[line]);
4241       };
4242       FullTextDocument2.prototype.offsetAt = function(position) {
4243         var lineOffsets = this.getLineOffsets();
4244         if (position.line >= lineOffsets.length) {
4245           return this._content.length;
4246         } else if (position.line < 0) {
4247           return 0;
4248         }
4249         var lineOffset = lineOffsets[position.line];
4250         var nextLineOffset = position.line + 1 < lineOffsets.length ? lineOffsets[position.line + 1] : this._content.length;
4251         return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);
4252       };
4253       Object.defineProperty(FullTextDocument2.prototype, "lineCount", {
4254         get: function() {
4255           return this.getLineOffsets().length;
4256         },
4257         enumerable: false,
4258         configurable: true
4259       });
4260       return FullTextDocument2;
4261     }();
4262     (function(Is2) {
4263       var toString = Object.prototype.toString;
4264       function defined(value) {
4265         return typeof value !== "undefined";
4266       }
4267       Is2.defined = defined;
4268       function undefined2(value) {
4269         return typeof value === "undefined";
4270       }
4271       Is2.undefined = undefined2;
4272       function boolean(value) {
4273         return value === true || value === false;
4274       }
4275       Is2.boolean = boolean;
4276       function string(value) {
4277         return toString.call(value) === "[object String]";
4278       }
4279       Is2.string = string;
4280       function number(value) {
4281         return toString.call(value) === "[object Number]";
4282       }
4283       Is2.number = number;
4284       function numberRange(value, min, max) {
4285         return toString.call(value) === "[object Number]" && min <= value && value <= max;
4286       }
4287       Is2.numberRange = numberRange;
4288       function integer2(value) {
4289         return toString.call(value) === "[object Number]" && -2147483648 <= value && value <= 2147483647;
4290       }
4291       Is2.integer = integer2;
4292       function uinteger2(value) {
4293         return toString.call(value) === "[object Number]" && 0 <= value && value <= 2147483647;
4294       }
4295       Is2.uinteger = uinteger2;
4296       function func(value) {
4297         return toString.call(value) === "[object Function]";
4298       }
4299       Is2.func = func;
4300       function objectLiteral(value) {
4301         return value !== null && typeof value === "object";
4302       }
4303       Is2.objectLiteral = objectLiteral;
4304       function typedArray(value, check) {
4305         return Array.isArray(value) && value.every(check);
4306       }
4307       Is2.typedArray = typedArray;
4308     })(Is || (Is = {}));
4309   }
4310 });
4311
4312 // node_modules/vscode-languageserver-protocol/lib/common/messages.js
4313 var require_messages2 = __commonJS({
4314   "node_modules/vscode-languageserver-protocol/lib/common/messages.js"(exports2) {
4315     "use strict";
4316     Object.defineProperty(exports2, "__esModule", { value: true });
4317     exports2.ProtocolNotificationType = exports2.ProtocolNotificationType0 = exports2.ProtocolRequestType = exports2.ProtocolRequestType0 = exports2.RegistrationType = void 0;
4318     var vscode_jsonrpc_1 = require_main();
4319     var RegistrationType = class {
4320       constructor(method) {
4321         this.method = method;
4322       }
4323     };
4324     exports2.RegistrationType = RegistrationType;
4325     var ProtocolRequestType0 = class extends vscode_jsonrpc_1.RequestType0 {
4326       constructor(method) {
4327         super(method);
4328       }
4329     };
4330     exports2.ProtocolRequestType0 = ProtocolRequestType0;
4331     var ProtocolRequestType = class extends vscode_jsonrpc_1.RequestType {
4332       constructor(method) {
4333         super(method, vscode_jsonrpc_1.ParameterStructures.byName);
4334       }
4335     };
4336     exports2.ProtocolRequestType = ProtocolRequestType;
4337     var ProtocolNotificationType0 = class extends vscode_jsonrpc_1.NotificationType0 {
4338       constructor(method) {
4339         super(method);
4340       }
4341     };
4342     exports2.ProtocolNotificationType0 = ProtocolNotificationType0;
4343     var ProtocolNotificationType = class extends vscode_jsonrpc_1.NotificationType {
4344       constructor(method) {
4345         super(method, vscode_jsonrpc_1.ParameterStructures.byName);
4346       }
4347     };
4348     exports2.ProtocolNotificationType = ProtocolNotificationType;
4349   }
4350 });
4351
4352 // node_modules/vscode-languageserver-protocol/lib/common/utils/is.js
4353 var require_is2 = __commonJS({
4354   "node_modules/vscode-languageserver-protocol/lib/common/utils/is.js"(exports2) {
4355     "use strict";
4356     Object.defineProperty(exports2, "__esModule", { value: true });
4357     exports2.objectLiteral = exports2.typedArray = exports2.stringArray = exports2.array = exports2.func = exports2.error = exports2.number = exports2.string = exports2.boolean = void 0;
4358     function boolean(value) {
4359       return value === true || value === false;
4360     }
4361     exports2.boolean = boolean;
4362     function string(value) {
4363       return typeof value === "string" || value instanceof String;
4364     }
4365     exports2.string = string;
4366     function number(value) {
4367       return typeof value === "number" || value instanceof Number;
4368     }
4369     exports2.number = number;
4370     function error(value) {
4371       return value instanceof Error;
4372     }
4373     exports2.error = error;
4374     function func(value) {
4375       return typeof value === "function";
4376     }
4377     exports2.func = func;
4378     function array(value) {
4379       return Array.isArray(value);
4380     }
4381     exports2.array = array;
4382     function stringArray(value) {
4383       return array(value) && value.every((elem) => string(elem));
4384     }
4385     exports2.stringArray = stringArray;
4386     function typedArray(value, check) {
4387       return Array.isArray(value) && value.every(check);
4388     }
4389     exports2.typedArray = typedArray;
4390     function objectLiteral(value) {
4391       return value !== null && typeof value === "object";
4392     }
4393     exports2.objectLiteral = objectLiteral;
4394   }
4395 });
4396
4397 // node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js
4398 var require_protocol_implementation = __commonJS({
4399   "node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js"(exports2) {
4400     "use strict";
4401     Object.defineProperty(exports2, "__esModule", { value: true });
4402     exports2.ImplementationRequest = void 0;
4403     var messages_1 = require_messages2();
4404     var ImplementationRequest;
4405     (function(ImplementationRequest2) {
4406       ImplementationRequest2.method = "textDocument/implementation";
4407       ImplementationRequest2.type = new messages_1.ProtocolRequestType(ImplementationRequest2.method);
4408     })(ImplementationRequest = exports2.ImplementationRequest || (exports2.ImplementationRequest = {}));
4409   }
4410 });
4411
4412 // node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js
4413 var require_protocol_typeDefinition = __commonJS({
4414   "node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js"(exports2) {
4415     "use strict";
4416     Object.defineProperty(exports2, "__esModule", { value: true });
4417     exports2.TypeDefinitionRequest = void 0;
4418     var messages_1 = require_messages2();
4419     var TypeDefinitionRequest;
4420     (function(TypeDefinitionRequest2) {
4421       TypeDefinitionRequest2.method = "textDocument/typeDefinition";
4422       TypeDefinitionRequest2.type = new messages_1.ProtocolRequestType(TypeDefinitionRequest2.method);
4423     })(TypeDefinitionRequest = exports2.TypeDefinitionRequest || (exports2.TypeDefinitionRequest = {}));
4424   }
4425 });
4426
4427 // node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolders.js
4428 var require_protocol_workspaceFolders = __commonJS({
4429   "node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolders.js"(exports2) {
4430     "use strict";
4431     Object.defineProperty(exports2, "__esModule", { value: true });
4432     exports2.DidChangeWorkspaceFoldersNotification = exports2.WorkspaceFoldersRequest = void 0;
4433     var messages_1 = require_messages2();
4434     var WorkspaceFoldersRequest;
4435     (function(WorkspaceFoldersRequest2) {
4436       WorkspaceFoldersRequest2.type = new messages_1.ProtocolRequestType0("workspace/workspaceFolders");
4437     })(WorkspaceFoldersRequest = exports2.WorkspaceFoldersRequest || (exports2.WorkspaceFoldersRequest = {}));
4438     var DidChangeWorkspaceFoldersNotification;
4439     (function(DidChangeWorkspaceFoldersNotification2) {
4440       DidChangeWorkspaceFoldersNotification2.type = new messages_1.ProtocolNotificationType("workspace/didChangeWorkspaceFolders");
4441     })(DidChangeWorkspaceFoldersNotification = exports2.DidChangeWorkspaceFoldersNotification || (exports2.DidChangeWorkspaceFoldersNotification = {}));
4442   }
4443 });
4444
4445 // node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js
4446 var require_protocol_configuration = __commonJS({
4447   "node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js"(exports2) {
4448     "use strict";
4449     Object.defineProperty(exports2, "__esModule", { value: true });
4450     exports2.ConfigurationRequest = void 0;
4451     var messages_1 = require_messages2();
4452     var ConfigurationRequest;
4453     (function(ConfigurationRequest2) {
4454       ConfigurationRequest2.type = new messages_1.ProtocolRequestType("workspace/configuration");
4455     })(ConfigurationRequest = exports2.ConfigurationRequest || (exports2.ConfigurationRequest = {}));
4456   }
4457 });
4458
4459 // node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js
4460 var require_protocol_colorProvider = __commonJS({
4461   "node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js"(exports2) {
4462     "use strict";
4463     Object.defineProperty(exports2, "__esModule", { value: true });
4464     exports2.ColorPresentationRequest = exports2.DocumentColorRequest = void 0;
4465     var messages_1 = require_messages2();
4466     var DocumentColorRequest;
4467     (function(DocumentColorRequest2) {
4468       DocumentColorRequest2.method = "textDocument/documentColor";
4469       DocumentColorRequest2.type = new messages_1.ProtocolRequestType(DocumentColorRequest2.method);
4470     })(DocumentColorRequest = exports2.DocumentColorRequest || (exports2.DocumentColorRequest = {}));
4471     var ColorPresentationRequest;
4472     (function(ColorPresentationRequest2) {
4473       ColorPresentationRequest2.type = new messages_1.ProtocolRequestType("textDocument/colorPresentation");
4474     })(ColorPresentationRequest = exports2.ColorPresentationRequest || (exports2.ColorPresentationRequest = {}));
4475   }
4476 });
4477
4478 // node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js
4479 var require_protocol_foldingRange = __commonJS({
4480   "node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js"(exports2) {
4481     "use strict";
4482     Object.defineProperty(exports2, "__esModule", { value: true });
4483     exports2.FoldingRangeRequest = exports2.FoldingRangeKind = void 0;
4484     var messages_1 = require_messages2();
4485     var FoldingRangeKind2;
4486     (function(FoldingRangeKind3) {
4487       FoldingRangeKind3["Comment"] = "comment";
4488       FoldingRangeKind3["Imports"] = "imports";
4489       FoldingRangeKind3["Region"] = "region";
4490     })(FoldingRangeKind2 = exports2.FoldingRangeKind || (exports2.FoldingRangeKind = {}));
4491     var FoldingRangeRequest;
4492     (function(FoldingRangeRequest2) {
4493       FoldingRangeRequest2.method = "textDocument/foldingRange";
4494       FoldingRangeRequest2.type = new messages_1.ProtocolRequestType(FoldingRangeRequest2.method);
4495     })(FoldingRangeRequest = exports2.FoldingRangeRequest || (exports2.FoldingRangeRequest = {}));
4496   }
4497 });
4498
4499 // node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js
4500 var require_protocol_declaration = __commonJS({
4501   "node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js"(exports2) {
4502     "use strict";
4503     Object.defineProperty(exports2, "__esModule", { value: true });
4504     exports2.DeclarationRequest = void 0;
4505     var messages_1 = require_messages2();
4506     var DeclarationRequest;
4507     (function(DeclarationRequest2) {
4508       DeclarationRequest2.method = "textDocument/declaration";
4509       DeclarationRequest2.type = new messages_1.ProtocolRequestType(DeclarationRequest2.method);
4510     })(DeclarationRequest = exports2.DeclarationRequest || (exports2.DeclarationRequest = {}));
4511   }
4512 });
4513
4514 // node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js
4515 var require_protocol_selectionRange = __commonJS({
4516   "node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js"(exports2) {
4517     "use strict";
4518     Object.defineProperty(exports2, "__esModule", { value: true });
4519     exports2.SelectionRangeRequest = void 0;
4520     var messages_1 = require_messages2();
4521     var SelectionRangeRequest;
4522     (function(SelectionRangeRequest2) {
4523       SelectionRangeRequest2.method = "textDocument/selectionRange";
4524       SelectionRangeRequest2.type = new messages_1.ProtocolRequestType(SelectionRangeRequest2.method);
4525     })(SelectionRangeRequest = exports2.SelectionRangeRequest || (exports2.SelectionRangeRequest = {}));
4526   }
4527 });
4528
4529 // node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js
4530 var require_protocol_progress = __commonJS({
4531   "node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js"(exports2) {
4532     "use strict";
4533     Object.defineProperty(exports2, "__esModule", { value: true });
4534     exports2.WorkDoneProgressCancelNotification = exports2.WorkDoneProgressCreateRequest = exports2.WorkDoneProgress = void 0;
4535     var vscode_jsonrpc_1 = require_main();
4536     var messages_1 = require_messages2();
4537     var WorkDoneProgress;
4538     (function(WorkDoneProgress2) {
4539       WorkDoneProgress2.type = new vscode_jsonrpc_1.ProgressType();
4540       function is(value) {
4541         return value === WorkDoneProgress2.type;
4542       }
4543       WorkDoneProgress2.is = is;
4544     })(WorkDoneProgress = exports2.WorkDoneProgress || (exports2.WorkDoneProgress = {}));
4545     var WorkDoneProgressCreateRequest;
4546     (function(WorkDoneProgressCreateRequest2) {
4547       WorkDoneProgressCreateRequest2.type = new messages_1.ProtocolRequestType("window/workDoneProgress/create");
4548     })(WorkDoneProgressCreateRequest = exports2.WorkDoneProgressCreateRequest || (exports2.WorkDoneProgressCreateRequest = {}));
4549     var WorkDoneProgressCancelNotification;
4550     (function(WorkDoneProgressCancelNotification2) {
4551       WorkDoneProgressCancelNotification2.type = new messages_1.ProtocolNotificationType("window/workDoneProgress/cancel");
4552     })(WorkDoneProgressCancelNotification = exports2.WorkDoneProgressCancelNotification || (exports2.WorkDoneProgressCancelNotification = {}));
4553   }
4554 });
4555
4556 // node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js
4557 var require_protocol_callHierarchy = __commonJS({
4558   "node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js"(exports2) {
4559     "use strict";
4560     Object.defineProperty(exports2, "__esModule", { value: true });
4561     exports2.CallHierarchyOutgoingCallsRequest = exports2.CallHierarchyIncomingCallsRequest = exports2.CallHierarchyPrepareRequest = void 0;
4562     var messages_1 = require_messages2();
4563     var CallHierarchyPrepareRequest;
4564     (function(CallHierarchyPrepareRequest2) {
4565       CallHierarchyPrepareRequest2.method = "textDocument/prepareCallHierarchy";
4566       CallHierarchyPrepareRequest2.type = new messages_1.ProtocolRequestType(CallHierarchyPrepareRequest2.method);
4567     })(CallHierarchyPrepareRequest = exports2.CallHierarchyPrepareRequest || (exports2.CallHierarchyPrepareRequest = {}));
4568     var CallHierarchyIncomingCallsRequest;
4569     (function(CallHierarchyIncomingCallsRequest2) {
4570       CallHierarchyIncomingCallsRequest2.method = "callHierarchy/incomingCalls";
4571       CallHierarchyIncomingCallsRequest2.type = new messages_1.ProtocolRequestType(CallHierarchyIncomingCallsRequest2.method);
4572     })(CallHierarchyIncomingCallsRequest = exports2.CallHierarchyIncomingCallsRequest || (exports2.CallHierarchyIncomingCallsRequest = {}));
4573     var CallHierarchyOutgoingCallsRequest;
4574     (function(CallHierarchyOutgoingCallsRequest2) {
4575       CallHierarchyOutgoingCallsRequest2.method = "callHierarchy/outgoingCalls";
4576       CallHierarchyOutgoingCallsRequest2.type = new messages_1.ProtocolRequestType(CallHierarchyOutgoingCallsRequest2.method);
4577     })(CallHierarchyOutgoingCallsRequest = exports2.CallHierarchyOutgoingCallsRequest || (exports2.CallHierarchyOutgoingCallsRequest = {}));
4578   }
4579 });
4580
4581 // node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js
4582 var require_protocol_semanticTokens = __commonJS({
4583   "node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js"(exports2) {
4584     "use strict";
4585     Object.defineProperty(exports2, "__esModule", { value: true });
4586     exports2.SemanticTokensRefreshRequest = exports2.SemanticTokensRangeRequest = exports2.SemanticTokensDeltaRequest = exports2.SemanticTokensRequest = exports2.SemanticTokensRegistrationType = exports2.TokenFormat = exports2.SemanticTokens = exports2.SemanticTokenModifiers = exports2.SemanticTokenTypes = void 0;
4587     var messages_1 = require_messages2();
4588     var SemanticTokenTypes;
4589     (function(SemanticTokenTypes2) {
4590       SemanticTokenTypes2["namespace"] = "namespace";
4591       SemanticTokenTypes2["type"] = "type";
4592       SemanticTokenTypes2["class"] = "class";
4593       SemanticTokenTypes2["enum"] = "enum";
4594       SemanticTokenTypes2["interface"] = "interface";
4595       SemanticTokenTypes2["struct"] = "struct";
4596       SemanticTokenTypes2["typeParameter"] = "typeParameter";
4597       SemanticTokenTypes2["parameter"] = "parameter";
4598       SemanticTokenTypes2["variable"] = "variable";
4599       SemanticTokenTypes2["property"] = "property";
4600       SemanticTokenTypes2["enumMember"] = "enumMember";
4601       SemanticTokenTypes2["event"] = "event";
4602       SemanticTokenTypes2["function"] = "function";
4603       SemanticTokenTypes2["method"] = "method";
4604       SemanticTokenTypes2["macro"] = "macro";
4605       SemanticTokenTypes2["keyword"] = "keyword";
4606       SemanticTokenTypes2["modifier"] = "modifier";
4607       SemanticTokenTypes2["comment"] = "comment";
4608       SemanticTokenTypes2["string"] = "string";
4609       SemanticTokenTypes2["number"] = "number";
4610       SemanticTokenTypes2["regexp"] = "regexp";
4611       SemanticTokenTypes2["operator"] = "operator";
4612     })(SemanticTokenTypes = exports2.SemanticTokenTypes || (exports2.SemanticTokenTypes = {}));
4613     var SemanticTokenModifiers;
4614     (function(SemanticTokenModifiers2) {
4615       SemanticTokenModifiers2["declaration"] = "declaration";
4616       SemanticTokenModifiers2["definition"] = "definition";
4617       SemanticTokenModifiers2["readonly"] = "readonly";
4618       SemanticTokenModifiers2["static"] = "static";
4619       SemanticTokenModifiers2["deprecated"] = "deprecated";
4620       SemanticTokenModifiers2["abstract"] = "abstract";
4621       SemanticTokenModifiers2["async"] = "async";
4622       SemanticTokenModifiers2["modification"] = "modification";
4623       SemanticTokenModifiers2["documentation"] = "documentation";
4624       SemanticTokenModifiers2["defaultLibrary"] = "defaultLibrary";
4625     })(SemanticTokenModifiers = exports2.SemanticTokenModifiers || (exports2.SemanticTokenModifiers = {}));
4626     var SemanticTokens;
4627     (function(SemanticTokens2) {
4628       function is(value) {
4629         const candidate = value;
4630         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");
4631       }
4632       SemanticTokens2.is = is;
4633     })(SemanticTokens = exports2.SemanticTokens || (exports2.SemanticTokens = {}));
4634     var TokenFormat;
4635     (function(TokenFormat2) {
4636       TokenFormat2.Relative = "relative";
4637     })(TokenFormat = exports2.TokenFormat || (exports2.TokenFormat = {}));
4638     var SemanticTokensRegistrationType;
4639     (function(SemanticTokensRegistrationType2) {
4640       SemanticTokensRegistrationType2.method = "textDocument/semanticTokens";
4641       SemanticTokensRegistrationType2.type = new messages_1.RegistrationType(SemanticTokensRegistrationType2.method);
4642     })(SemanticTokensRegistrationType = exports2.SemanticTokensRegistrationType || (exports2.SemanticTokensRegistrationType = {}));
4643     var SemanticTokensRequest;
4644     (function(SemanticTokensRequest2) {
4645       SemanticTokensRequest2.method = "textDocument/semanticTokens/full";
4646       SemanticTokensRequest2.type = new messages_1.ProtocolRequestType(SemanticTokensRequest2.method);
4647     })(SemanticTokensRequest = exports2.SemanticTokensRequest || (exports2.SemanticTokensRequest = {}));
4648     var SemanticTokensDeltaRequest;
4649     (function(SemanticTokensDeltaRequest2) {
4650       SemanticTokensDeltaRequest2.method = "textDocument/semanticTokens/full/delta";
4651       SemanticTokensDeltaRequest2.type = new messages_1.ProtocolRequestType(SemanticTokensDeltaRequest2.method);
4652     })(SemanticTokensDeltaRequest = exports2.SemanticTokensDeltaRequest || (exports2.SemanticTokensDeltaRequest = {}));
4653     var SemanticTokensRangeRequest;
4654     (function(SemanticTokensRangeRequest2) {
4655       SemanticTokensRangeRequest2.method = "textDocument/semanticTokens/range";
4656       SemanticTokensRangeRequest2.type = new messages_1.ProtocolRequestType(SemanticTokensRangeRequest2.method);
4657     })(SemanticTokensRangeRequest = exports2.SemanticTokensRangeRequest || (exports2.SemanticTokensRangeRequest = {}));
4658     var SemanticTokensRefreshRequest;
4659     (function(SemanticTokensRefreshRequest2) {
4660       SemanticTokensRefreshRequest2.method = `workspace/semanticTokens/refresh`;
4661       SemanticTokensRefreshRequest2.type = new messages_1.ProtocolRequestType0(SemanticTokensRefreshRequest2.method);
4662     })(SemanticTokensRefreshRequest = exports2.SemanticTokensRefreshRequest || (exports2.SemanticTokensRefreshRequest = {}));
4663   }
4664 });
4665
4666 // node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js
4667 var require_protocol_showDocument = __commonJS({
4668   "node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js"(exports2) {
4669     "use strict";
4670     Object.defineProperty(exports2, "__esModule", { value: true });
4671     exports2.ShowDocumentRequest = void 0;
4672     var messages_1 = require_messages2();
4673     var ShowDocumentRequest;
4674     (function(ShowDocumentRequest2) {
4675       ShowDocumentRequest2.method = "window/showDocument";
4676       ShowDocumentRequest2.type = new messages_1.ProtocolRequestType(ShowDocumentRequest2.method);
4677     })(ShowDocumentRequest = exports2.ShowDocumentRequest || (exports2.ShowDocumentRequest = {}));
4678   }
4679 });
4680
4681 // node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js
4682 var require_protocol_linkedEditingRange = __commonJS({
4683   "node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js"(exports2) {
4684     "use strict";
4685     Object.defineProperty(exports2, "__esModule", { value: true });
4686     exports2.LinkedEditingRangeRequest = void 0;
4687     var messages_1 = require_messages2();
4688     var LinkedEditingRangeRequest;
4689     (function(LinkedEditingRangeRequest2) {
4690       LinkedEditingRangeRequest2.method = "textDocument/linkedEditingRange";
4691       LinkedEditingRangeRequest2.type = new messages_1.ProtocolRequestType(LinkedEditingRangeRequest2.method);
4692     })(LinkedEditingRangeRequest = exports2.LinkedEditingRangeRequest || (exports2.LinkedEditingRangeRequest = {}));
4693   }
4694 });
4695
4696 // node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js
4697 var require_protocol_fileOperations = __commonJS({
4698   "node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js"(exports2) {
4699     "use strict";
4700     Object.defineProperty(exports2, "__esModule", { value: true });
4701     exports2.WillDeleteFilesRequest = exports2.DidDeleteFilesNotification = exports2.DidRenameFilesNotification = exports2.WillRenameFilesRequest = exports2.DidCreateFilesNotification = exports2.WillCreateFilesRequest = exports2.FileOperationPatternKind = void 0;
4702     var messages_1 = require_messages2();
4703     var FileOperationPatternKind;
4704     (function(FileOperationPatternKind2) {
4705       FileOperationPatternKind2.file = "file";
4706       FileOperationPatternKind2.folder = "folder";
4707     })(FileOperationPatternKind = exports2.FileOperationPatternKind || (exports2.FileOperationPatternKind = {}));
4708     var WillCreateFilesRequest;
4709     (function(WillCreateFilesRequest2) {
4710       WillCreateFilesRequest2.method = "workspace/willCreateFiles";
4711       WillCreateFilesRequest2.type = new messages_1.ProtocolRequestType(WillCreateFilesRequest2.method);
4712     })(WillCreateFilesRequest = exports2.WillCreateFilesRequest || (exports2.WillCreateFilesRequest = {}));
4713     var DidCreateFilesNotification;
4714     (function(DidCreateFilesNotification2) {
4715       DidCreateFilesNotification2.method = "workspace/didCreateFiles";
4716       DidCreateFilesNotification2.type = new messages_1.ProtocolNotificationType(DidCreateFilesNotification2.method);
4717     })(DidCreateFilesNotification = exports2.DidCreateFilesNotification || (exports2.DidCreateFilesNotification = {}));
4718     var WillRenameFilesRequest;
4719     (function(WillRenameFilesRequest2) {
4720       WillRenameFilesRequest2.method = "workspace/willRenameFiles";
4721       WillRenameFilesRequest2.type = new messages_1.ProtocolRequestType(WillRenameFilesRequest2.method);
4722     })(WillRenameFilesRequest = exports2.WillRenameFilesRequest || (exports2.WillRenameFilesRequest = {}));
4723     var DidRenameFilesNotification;
4724     (function(DidRenameFilesNotification2) {
4725       DidRenameFilesNotification2.method = "workspace/didRenameFiles";
4726       DidRenameFilesNotification2.type = new messages_1.ProtocolNotificationType(DidRenameFilesNotification2.method);
4727     })(DidRenameFilesNotification = exports2.DidRenameFilesNotification || (exports2.DidRenameFilesNotification = {}));
4728     var DidDeleteFilesNotification;
4729     (function(DidDeleteFilesNotification2) {
4730       DidDeleteFilesNotification2.method = "workspace/didDeleteFiles";
4731       DidDeleteFilesNotification2.type = new messages_1.ProtocolNotificationType(DidDeleteFilesNotification2.method);
4732     })(DidDeleteFilesNotification = exports2.DidDeleteFilesNotification || (exports2.DidDeleteFilesNotification = {}));
4733     var WillDeleteFilesRequest;
4734     (function(WillDeleteFilesRequest2) {
4735       WillDeleteFilesRequest2.method = "workspace/willDeleteFiles";
4736       WillDeleteFilesRequest2.type = new messages_1.ProtocolRequestType(WillDeleteFilesRequest2.method);
4737     })(WillDeleteFilesRequest = exports2.WillDeleteFilesRequest || (exports2.WillDeleteFilesRequest = {}));
4738   }
4739 });
4740
4741 // node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js
4742 var require_protocol_moniker = __commonJS({
4743   "node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js"(exports2) {
4744     "use strict";
4745     Object.defineProperty(exports2, "__esModule", { value: true });
4746     exports2.MonikerRequest = exports2.MonikerKind = exports2.UniquenessLevel = void 0;
4747     var messages_1 = require_messages2();
4748     var UniquenessLevel;
4749     (function(UniquenessLevel2) {
4750       UniquenessLevel2["document"] = "document";
4751       UniquenessLevel2["project"] = "project";
4752       UniquenessLevel2["group"] = "group";
4753       UniquenessLevel2["scheme"] = "scheme";
4754       UniquenessLevel2["global"] = "global";
4755     })(UniquenessLevel = exports2.UniquenessLevel || (exports2.UniquenessLevel = {}));
4756     var MonikerKind;
4757     (function(MonikerKind2) {
4758       MonikerKind2["import"] = "import";
4759       MonikerKind2["export"] = "export";
4760       MonikerKind2["local"] = "local";
4761     })(MonikerKind = exports2.MonikerKind || (exports2.MonikerKind = {}));
4762     var MonikerRequest;
4763     (function(MonikerRequest2) {
4764       MonikerRequest2.method = "textDocument/moniker";
4765       MonikerRequest2.type = new messages_1.ProtocolRequestType(MonikerRequest2.method);
4766     })(MonikerRequest = exports2.MonikerRequest || (exports2.MonikerRequest = {}));
4767   }
4768 });
4769
4770 // node_modules/vscode-languageserver-protocol/lib/common/protocol.js
4771 var require_protocol = __commonJS({
4772   "node_modules/vscode-languageserver-protocol/lib/common/protocol.js"(exports2) {
4773     "use strict";
4774     Object.defineProperty(exports2, "__esModule", { value: true });
4775     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;
4776     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;
4777     var Is2 = require_is2();
4778     var messages_1 = require_messages2();
4779     var protocol_implementation_1 = require_protocol_implementation();
4780     Object.defineProperty(exports2, "ImplementationRequest", { enumerable: true, get: function() {
4781       return protocol_implementation_1.ImplementationRequest;
4782     } });
4783     var protocol_typeDefinition_1 = require_protocol_typeDefinition();
4784     Object.defineProperty(exports2, "TypeDefinitionRequest", { enumerable: true, get: function() {
4785       return protocol_typeDefinition_1.TypeDefinitionRequest;
4786     } });
4787     var protocol_workspaceFolders_1 = require_protocol_workspaceFolders();
4788     Object.defineProperty(exports2, "WorkspaceFoldersRequest", { enumerable: true, get: function() {
4789       return protocol_workspaceFolders_1.WorkspaceFoldersRequest;
4790     } });
4791     Object.defineProperty(exports2, "DidChangeWorkspaceFoldersNotification", { enumerable: true, get: function() {
4792       return protocol_workspaceFolders_1.DidChangeWorkspaceFoldersNotification;
4793     } });
4794     var protocol_configuration_1 = require_protocol_configuration();
4795     Object.defineProperty(exports2, "ConfigurationRequest", { enumerable: true, get: function() {
4796       return protocol_configuration_1.ConfigurationRequest;
4797     } });
4798     var protocol_colorProvider_1 = require_protocol_colorProvider();
4799     Object.defineProperty(exports2, "DocumentColorRequest", { enumerable: true, get: function() {
4800       return protocol_colorProvider_1.DocumentColorRequest;
4801     } });
4802     Object.defineProperty(exports2, "ColorPresentationRequest", { enumerable: true, get: function() {
4803       return protocol_colorProvider_1.ColorPresentationRequest;
4804     } });
4805     var protocol_foldingRange_1 = require_protocol_foldingRange();
4806     Object.defineProperty(exports2, "FoldingRangeRequest", { enumerable: true, get: function() {
4807       return protocol_foldingRange_1.FoldingRangeRequest;
4808     } });
4809     var protocol_declaration_1 = require_protocol_declaration();
4810     Object.defineProperty(exports2, "DeclarationRequest", { enumerable: true, get: function() {
4811       return protocol_declaration_1.DeclarationRequest;
4812     } });
4813     var protocol_selectionRange_1 = require_protocol_selectionRange();
4814     Object.defineProperty(exports2, "SelectionRangeRequest", { enumerable: true, get: function() {
4815       return protocol_selectionRange_1.SelectionRangeRequest;
4816     } });
4817     var protocol_progress_1 = require_protocol_progress();
4818     Object.defineProperty(exports2, "WorkDoneProgress", { enumerable: true, get: function() {
4819       return protocol_progress_1.WorkDoneProgress;
4820     } });
4821     Object.defineProperty(exports2, "WorkDoneProgressCreateRequest", { enumerable: true, get: function() {
4822       return protocol_progress_1.WorkDoneProgressCreateRequest;
4823     } });
4824     Object.defineProperty(exports2, "WorkDoneProgressCancelNotification", { enumerable: true, get: function() {
4825       return protocol_progress_1.WorkDoneProgressCancelNotification;
4826     } });
4827     var protocol_callHierarchy_1 = require_protocol_callHierarchy();
4828     Object.defineProperty(exports2, "CallHierarchyIncomingCallsRequest", { enumerable: true, get: function() {
4829       return protocol_callHierarchy_1.CallHierarchyIncomingCallsRequest;
4830     } });
4831     Object.defineProperty(exports2, "CallHierarchyOutgoingCallsRequest", { enumerable: true, get: function() {
4832       return protocol_callHierarchy_1.CallHierarchyOutgoingCallsRequest;
4833     } });
4834     Object.defineProperty(exports2, "CallHierarchyPrepareRequest", { enumerable: true, get: function() {
4835       return protocol_callHierarchy_1.CallHierarchyPrepareRequest;
4836     } });
4837     var protocol_semanticTokens_1 = require_protocol_semanticTokens();
4838     Object.defineProperty(exports2, "SemanticTokenTypes", { enumerable: true, get: function() {
4839       return protocol_semanticTokens_1.SemanticTokenTypes;
4840     } });
4841     Object.defineProperty(exports2, "SemanticTokenModifiers", { enumerable: true, get: function() {
4842       return protocol_semanticTokens_1.SemanticTokenModifiers;
4843     } });
4844     Object.defineProperty(exports2, "SemanticTokens", { enumerable: true, get: function() {
4845       return protocol_semanticTokens_1.SemanticTokens;
4846     } });
4847     Object.defineProperty(exports2, "TokenFormat", { enumerable: true, get: function() {
4848       return protocol_semanticTokens_1.TokenFormat;
4849     } });
4850     Object.defineProperty(exports2, "SemanticTokensRequest", { enumerable: true, get: function() {
4851       return protocol_semanticTokens_1.SemanticTokensRequest;
4852     } });
4853     Object.defineProperty(exports2, "SemanticTokensDeltaRequest", { enumerable: true, get: function() {
4854       return protocol_semanticTokens_1.SemanticTokensDeltaRequest;
4855     } });
4856     Object.defineProperty(exports2, "SemanticTokensRangeRequest", { enumerable: true, get: function() {
4857       return protocol_semanticTokens_1.SemanticTokensRangeRequest;
4858     } });
4859     Object.defineProperty(exports2, "SemanticTokensRefreshRequest", { enumerable: true, get: function() {
4860       return protocol_semanticTokens_1.SemanticTokensRefreshRequest;
4861     } });
4862     Object.defineProperty(exports2, "SemanticTokensRegistrationType", { enumerable: true, get: function() {
4863       return protocol_semanticTokens_1.SemanticTokensRegistrationType;
4864     } });
4865     var protocol_showDocument_1 = require_protocol_showDocument();
4866     Object.defineProperty(exports2, "ShowDocumentRequest", { enumerable: true, get: function() {
4867       return protocol_showDocument_1.ShowDocumentRequest;
4868     } });
4869     var protocol_linkedEditingRange_1 = require_protocol_linkedEditingRange();
4870     Object.defineProperty(exports2, "LinkedEditingRangeRequest", { enumerable: true, get: function() {
4871       return protocol_linkedEditingRange_1.LinkedEditingRangeRequest;
4872     } });
4873     var protocol_fileOperations_1 = require_protocol_fileOperations();
4874     Object.defineProperty(exports2, "FileOperationPatternKind", { enumerable: true, get: function() {
4875       return protocol_fileOperations_1.FileOperationPatternKind;
4876     } });
4877     Object.defineProperty(exports2, "DidCreateFilesNotification", { enumerable: true, get: function() {
4878       return protocol_fileOperations_1.DidCreateFilesNotification;
4879     } });
4880     Object.defineProperty(exports2, "WillCreateFilesRequest", { enumerable: true, get: function() {
4881       return protocol_fileOperations_1.WillCreateFilesRequest;
4882     } });
4883     Object.defineProperty(exports2, "DidRenameFilesNotification", { enumerable: true, get: function() {
4884       return protocol_fileOperations_1.DidRenameFilesNotification;
4885     } });
4886     Object.defineProperty(exports2, "WillRenameFilesRequest", { enumerable: true, get: function() {
4887       return protocol_fileOperations_1.WillRenameFilesRequest;
4888     } });
4889     Object.defineProperty(exports2, "DidDeleteFilesNotification", { enumerable: true, get: function() {
4890       return protocol_fileOperations_1.DidDeleteFilesNotification;
4891     } });
4892     Object.defineProperty(exports2, "WillDeleteFilesRequest", { enumerable: true, get: function() {
4893       return protocol_fileOperations_1.WillDeleteFilesRequest;
4894     } });
4895     var protocol_moniker_1 = require_protocol_moniker();
4896     Object.defineProperty(exports2, "UniquenessLevel", { enumerable: true, get: function() {
4897       return protocol_moniker_1.UniquenessLevel;
4898     } });
4899     Object.defineProperty(exports2, "MonikerKind", { enumerable: true, get: function() {
4900       return protocol_moniker_1.MonikerKind;
4901     } });
4902     Object.defineProperty(exports2, "MonikerRequest", { enumerable: true, get: function() {
4903       return protocol_moniker_1.MonikerRequest;
4904     } });
4905     var DocumentFilter;
4906     (function(DocumentFilter2) {
4907       function is(value) {
4908         const candidate = value;
4909         return Is2.string(candidate.language) || Is2.string(candidate.scheme) || Is2.string(candidate.pattern);
4910       }
4911       DocumentFilter2.is = is;
4912     })(DocumentFilter = exports2.DocumentFilter || (exports2.DocumentFilter = {}));
4913     var DocumentSelector;
4914     (function(DocumentSelector2) {
4915       function is(value) {
4916         if (!Array.isArray(value)) {
4917           return false;
4918         }
4919         for (let elem of value) {
4920           if (!Is2.string(elem) && !DocumentFilter.is(elem)) {
4921             return false;
4922           }
4923         }
4924         return true;
4925       }
4926       DocumentSelector2.is = is;
4927     })(DocumentSelector = exports2.DocumentSelector || (exports2.DocumentSelector = {}));
4928     var RegistrationRequest;
4929     (function(RegistrationRequest2) {
4930       RegistrationRequest2.type = new messages_1.ProtocolRequestType("client/registerCapability");
4931     })(RegistrationRequest = exports2.RegistrationRequest || (exports2.RegistrationRequest = {}));
4932     var UnregistrationRequest;
4933     (function(UnregistrationRequest2) {
4934       UnregistrationRequest2.type = new messages_1.ProtocolRequestType("client/unregisterCapability");
4935     })(UnregistrationRequest = exports2.UnregistrationRequest || (exports2.UnregistrationRequest = {}));
4936     var ResourceOperationKind;
4937     (function(ResourceOperationKind2) {
4938       ResourceOperationKind2.Create = "create";
4939       ResourceOperationKind2.Rename = "rename";
4940       ResourceOperationKind2.Delete = "delete";
4941     })(ResourceOperationKind = exports2.ResourceOperationKind || (exports2.ResourceOperationKind = {}));
4942     var FailureHandlingKind;
4943     (function(FailureHandlingKind2) {
4944       FailureHandlingKind2.Abort = "abort";
4945       FailureHandlingKind2.Transactional = "transactional";
4946       FailureHandlingKind2.TextOnlyTransactional = "textOnlyTransactional";
4947       FailureHandlingKind2.Undo = "undo";
4948     })(FailureHandlingKind = exports2.FailureHandlingKind || (exports2.FailureHandlingKind = {}));
4949     var StaticRegistrationOptions;
4950     (function(StaticRegistrationOptions2) {
4951       function hasId(value) {
4952         const candidate = value;
4953         return candidate && Is2.string(candidate.id) && candidate.id.length > 0;
4954       }
4955       StaticRegistrationOptions2.hasId = hasId;
4956     })(StaticRegistrationOptions = exports2.StaticRegistrationOptions || (exports2.StaticRegistrationOptions = {}));
4957     var TextDocumentRegistrationOptions;
4958     (function(TextDocumentRegistrationOptions2) {
4959       function is(value) {
4960         const candidate = value;
4961         return candidate && (candidate.documentSelector === null || DocumentSelector.is(candidate.documentSelector));
4962       }
4963       TextDocumentRegistrationOptions2.is = is;
4964     })(TextDocumentRegistrationOptions = exports2.TextDocumentRegistrationOptions || (exports2.TextDocumentRegistrationOptions = {}));
4965     var WorkDoneProgressOptions;
4966     (function(WorkDoneProgressOptions2) {
4967       function is(value) {
4968         const candidate = value;
4969         return Is2.objectLiteral(candidate) && (candidate.workDoneProgress === void 0 || Is2.boolean(candidate.workDoneProgress));
4970       }
4971       WorkDoneProgressOptions2.is = is;
4972       function hasWorkDoneProgress(value) {
4973         const candidate = value;
4974         return candidate && Is2.boolean(candidate.workDoneProgress);
4975       }
4976       WorkDoneProgressOptions2.hasWorkDoneProgress = hasWorkDoneProgress;
4977     })(WorkDoneProgressOptions = exports2.WorkDoneProgressOptions || (exports2.WorkDoneProgressOptions = {}));
4978     var InitializeRequest;
4979     (function(InitializeRequest2) {
4980       InitializeRequest2.type = new messages_1.ProtocolRequestType("initialize");
4981     })(InitializeRequest = exports2.InitializeRequest || (exports2.InitializeRequest = {}));
4982     var InitializeError;
4983     (function(InitializeError2) {
4984       InitializeError2.unknownProtocolVersion = 1;
4985     })(InitializeError = exports2.InitializeError || (exports2.InitializeError = {}));
4986     var InitializedNotification;
4987     (function(InitializedNotification2) {
4988       InitializedNotification2.type = new messages_1.ProtocolNotificationType("initialized");
4989     })(InitializedNotification = exports2.InitializedNotification || (exports2.InitializedNotification = {}));
4990     var ShutdownRequest;
4991     (function(ShutdownRequest2) {
4992       ShutdownRequest2.type = new messages_1.ProtocolRequestType0("shutdown");
4993     })(ShutdownRequest = exports2.ShutdownRequest || (exports2.ShutdownRequest = {}));
4994     var ExitNotification;
4995     (function(ExitNotification2) {
4996       ExitNotification2.type = new messages_1.ProtocolNotificationType0("exit");
4997     })(ExitNotification = exports2.ExitNotification || (exports2.ExitNotification = {}));
4998     var DidChangeConfigurationNotification;
4999     (function(DidChangeConfigurationNotification2) {
5000       DidChangeConfigurationNotification2.type = new messages_1.ProtocolNotificationType("workspace/didChangeConfiguration");
5001     })(DidChangeConfigurationNotification = exports2.DidChangeConfigurationNotification || (exports2.DidChangeConfigurationNotification = {}));
5002     var MessageType;
5003     (function(MessageType2) {
5004       MessageType2.Error = 1;
5005       MessageType2.Warning = 2;
5006       MessageType2.Info = 3;
5007       MessageType2.Log = 4;
5008     })(MessageType = exports2.MessageType || (exports2.MessageType = {}));
5009     var ShowMessageNotification;
5010     (function(ShowMessageNotification2) {
5011       ShowMessageNotification2.type = new messages_1.ProtocolNotificationType("window/showMessage");
5012     })(ShowMessageNotification = exports2.ShowMessageNotification || (exports2.ShowMessageNotification = {}));
5013     var ShowMessageRequest;
5014     (function(ShowMessageRequest2) {
5015       ShowMessageRequest2.type = new messages_1.ProtocolRequestType("window/showMessageRequest");
5016     })(ShowMessageRequest = exports2.ShowMessageRequest || (exports2.ShowMessageRequest = {}));
5017     var LogMessageNotification;
5018     (function(LogMessageNotification2) {
5019       LogMessageNotification2.type = new messages_1.ProtocolNotificationType("window/logMessage");
5020     })(LogMessageNotification = exports2.LogMessageNotification || (exports2.LogMessageNotification = {}));
5021     var TelemetryEventNotification;
5022     (function(TelemetryEventNotification2) {
5023       TelemetryEventNotification2.type = new messages_1.ProtocolNotificationType("telemetry/event");
5024     })(TelemetryEventNotification = exports2.TelemetryEventNotification || (exports2.TelemetryEventNotification = {}));
5025     var TextDocumentSyncKind;
5026     (function(TextDocumentSyncKind2) {
5027       TextDocumentSyncKind2.None = 0;
5028       TextDocumentSyncKind2.Full = 1;
5029       TextDocumentSyncKind2.Incremental = 2;
5030     })(TextDocumentSyncKind = exports2.TextDocumentSyncKind || (exports2.TextDocumentSyncKind = {}));
5031     var DidOpenTextDocumentNotification;
5032     (function(DidOpenTextDocumentNotification2) {
5033       DidOpenTextDocumentNotification2.method = "textDocument/didOpen";
5034       DidOpenTextDocumentNotification2.type = new messages_1.ProtocolNotificationType(DidOpenTextDocumentNotification2.method);
5035     })(DidOpenTextDocumentNotification = exports2.DidOpenTextDocumentNotification || (exports2.DidOpenTextDocumentNotification = {}));
5036     var TextDocumentContentChangeEvent;
5037     (function(TextDocumentContentChangeEvent2) {
5038       function isIncremental(event) {
5039         let candidate = event;
5040         return candidate !== void 0 && candidate !== null && typeof candidate.text === "string" && candidate.range !== void 0 && (candidate.rangeLength === void 0 || typeof candidate.rangeLength === "number");
5041       }
5042       TextDocumentContentChangeEvent2.isIncremental = isIncremental;
5043       function isFull(event) {
5044         let candidate = event;
5045         return candidate !== void 0 && candidate !== null && typeof candidate.text === "string" && candidate.range === void 0 && candidate.rangeLength === void 0;
5046       }
5047       TextDocumentContentChangeEvent2.isFull = isFull;
5048     })(TextDocumentContentChangeEvent = exports2.TextDocumentContentChangeEvent || (exports2.TextDocumentContentChangeEvent = {}));
5049     var DidChangeTextDocumentNotification;
5050     (function(DidChangeTextDocumentNotification2) {
5051       DidChangeTextDocumentNotification2.method = "textDocument/didChange";
5052       DidChangeTextDocumentNotification2.type = new messages_1.ProtocolNotificationType(DidChangeTextDocumentNotification2.method);
5053     })(DidChangeTextDocumentNotification = exports2.DidChangeTextDocumentNotification || (exports2.DidChangeTextDocumentNotification = {}));
5054     var DidCloseTextDocumentNotification;
5055     (function(DidCloseTextDocumentNotification2) {
5056       DidCloseTextDocumentNotification2.method = "textDocument/didClose";
5057       DidCloseTextDocumentNotification2.type = new messages_1.ProtocolNotificationType(DidCloseTextDocumentNotification2.method);
5058     })(DidCloseTextDocumentNotification = exports2.DidCloseTextDocumentNotification || (exports2.DidCloseTextDocumentNotification = {}));
5059     var DidSaveTextDocumentNotification;
5060     (function(DidSaveTextDocumentNotification2) {
5061       DidSaveTextDocumentNotification2.method = "textDocument/didSave";
5062       DidSaveTextDocumentNotification2.type = new messages_1.ProtocolNotificationType(DidSaveTextDocumentNotification2.method);
5063     })(DidSaveTextDocumentNotification = exports2.DidSaveTextDocumentNotification || (exports2.DidSaveTextDocumentNotification = {}));
5064     var TextDocumentSaveReason;
5065     (function(TextDocumentSaveReason2) {
5066       TextDocumentSaveReason2.Manual = 1;
5067       TextDocumentSaveReason2.AfterDelay = 2;
5068       TextDocumentSaveReason2.FocusOut = 3;
5069     })(TextDocumentSaveReason = exports2.TextDocumentSaveReason || (exports2.TextDocumentSaveReason = {}));
5070     var WillSaveTextDocumentNotification;
5071     (function(WillSaveTextDocumentNotification2) {
5072       WillSaveTextDocumentNotification2.method = "textDocument/willSave";
5073       WillSaveTextDocumentNotification2.type = new messages_1.ProtocolNotificationType(WillSaveTextDocumentNotification2.method);
5074     })(WillSaveTextDocumentNotification = exports2.WillSaveTextDocumentNotification || (exports2.WillSaveTextDocumentNotification = {}));
5075     var WillSaveTextDocumentWaitUntilRequest;
5076     (function(WillSaveTextDocumentWaitUntilRequest2) {
5077       WillSaveTextDocumentWaitUntilRequest2.method = "textDocument/willSaveWaitUntil";
5078       WillSaveTextDocumentWaitUntilRequest2.type = new messages_1.ProtocolRequestType(WillSaveTextDocumentWaitUntilRequest2.method);
5079     })(WillSaveTextDocumentWaitUntilRequest = exports2.WillSaveTextDocumentWaitUntilRequest || (exports2.WillSaveTextDocumentWaitUntilRequest = {}));
5080     var DidChangeWatchedFilesNotification;
5081     (function(DidChangeWatchedFilesNotification2) {
5082       DidChangeWatchedFilesNotification2.type = new messages_1.ProtocolNotificationType("workspace/didChangeWatchedFiles");
5083     })(DidChangeWatchedFilesNotification = exports2.DidChangeWatchedFilesNotification || (exports2.DidChangeWatchedFilesNotification = {}));
5084     var FileChangeType;
5085     (function(FileChangeType2) {
5086       FileChangeType2.Created = 1;
5087       FileChangeType2.Changed = 2;
5088       FileChangeType2.Deleted = 3;
5089     })(FileChangeType = exports2.FileChangeType || (exports2.FileChangeType = {}));
5090     var WatchKind;
5091     (function(WatchKind2) {
5092       WatchKind2.Create = 1;
5093       WatchKind2.Change = 2;
5094       WatchKind2.Delete = 4;
5095     })(WatchKind = exports2.WatchKind || (exports2.WatchKind = {}));
5096     var PublishDiagnosticsNotification;
5097     (function(PublishDiagnosticsNotification2) {
5098       PublishDiagnosticsNotification2.type = new messages_1.ProtocolNotificationType("textDocument/publishDiagnostics");
5099     })(PublishDiagnosticsNotification = exports2.PublishDiagnosticsNotification || (exports2.PublishDiagnosticsNotification = {}));
5100     var CompletionTriggerKind;
5101     (function(CompletionTriggerKind2) {
5102       CompletionTriggerKind2.Invoked = 1;
5103       CompletionTriggerKind2.TriggerCharacter = 2;
5104       CompletionTriggerKind2.TriggerForIncompleteCompletions = 3;
5105     })(CompletionTriggerKind = exports2.CompletionTriggerKind || (exports2.CompletionTriggerKind = {}));
5106     var CompletionRequest;
5107     (function(CompletionRequest2) {
5108       CompletionRequest2.method = "textDocument/completion";
5109       CompletionRequest2.type = new messages_1.ProtocolRequestType(CompletionRequest2.method);
5110     })(CompletionRequest = exports2.CompletionRequest || (exports2.CompletionRequest = {}));
5111     var CompletionResolveRequest;
5112     (function(CompletionResolveRequest2) {
5113       CompletionResolveRequest2.method = "completionItem/resolve";
5114       CompletionResolveRequest2.type = new messages_1.ProtocolRequestType(CompletionResolveRequest2.method);
5115     })(CompletionResolveRequest = exports2.CompletionResolveRequest || (exports2.CompletionResolveRequest = {}));
5116     var HoverRequest;
5117     (function(HoverRequest2) {
5118       HoverRequest2.method = "textDocument/hover";
5119       HoverRequest2.type = new messages_1.ProtocolRequestType(HoverRequest2.method);
5120     })(HoverRequest = exports2.HoverRequest || (exports2.HoverRequest = {}));
5121     var SignatureHelpTriggerKind;
5122     (function(SignatureHelpTriggerKind2) {
5123       SignatureHelpTriggerKind2.Invoked = 1;
5124       SignatureHelpTriggerKind2.TriggerCharacter = 2;
5125       SignatureHelpTriggerKind2.ContentChange = 3;
5126     })(SignatureHelpTriggerKind = exports2.SignatureHelpTriggerKind || (exports2.SignatureHelpTriggerKind = {}));
5127     var SignatureHelpRequest;
5128     (function(SignatureHelpRequest2) {
5129       SignatureHelpRequest2.method = "textDocument/signatureHelp";
5130       SignatureHelpRequest2.type = new messages_1.ProtocolRequestType(SignatureHelpRequest2.method);
5131     })(SignatureHelpRequest = exports2.SignatureHelpRequest || (exports2.SignatureHelpRequest = {}));
5132     var DefinitionRequest;
5133     (function(DefinitionRequest2) {
5134       DefinitionRequest2.method = "textDocument/definition";
5135       DefinitionRequest2.type = new messages_1.ProtocolRequestType(DefinitionRequest2.method);
5136     })(DefinitionRequest = exports2.DefinitionRequest || (exports2.DefinitionRequest = {}));
5137     var ReferencesRequest;
5138     (function(ReferencesRequest2) {
5139       ReferencesRequest2.method = "textDocument/references";
5140       ReferencesRequest2.type = new messages_1.ProtocolRequestType(ReferencesRequest2.method);
5141     })(ReferencesRequest = exports2.ReferencesRequest || (exports2.ReferencesRequest = {}));
5142     var DocumentHighlightRequest;
5143     (function(DocumentHighlightRequest2) {
5144       DocumentHighlightRequest2.method = "textDocument/documentHighlight";
5145       DocumentHighlightRequest2.type = new messages_1.ProtocolRequestType(DocumentHighlightRequest2.method);
5146     })(DocumentHighlightRequest = exports2.DocumentHighlightRequest || (exports2.DocumentHighlightRequest = {}));
5147     var DocumentSymbolRequest;
5148     (function(DocumentSymbolRequest2) {
5149       DocumentSymbolRequest2.method = "textDocument/documentSymbol";
5150       DocumentSymbolRequest2.type = new messages_1.ProtocolRequestType(DocumentSymbolRequest2.method);
5151     })(DocumentSymbolRequest = exports2.DocumentSymbolRequest || (exports2.DocumentSymbolRequest = {}));
5152     var CodeActionRequest;
5153     (function(CodeActionRequest2) {
5154       CodeActionRequest2.method = "textDocument/codeAction";
5155       CodeActionRequest2.type = new messages_1.ProtocolRequestType(CodeActionRequest2.method);
5156     })(CodeActionRequest = exports2.CodeActionRequest || (exports2.CodeActionRequest = {}));
5157     var CodeActionResolveRequest;
5158     (function(CodeActionResolveRequest2) {
5159       CodeActionResolveRequest2.method = "codeAction/resolve";
5160       CodeActionResolveRequest2.type = new messages_1.ProtocolRequestType(CodeActionResolveRequest2.method);
5161     })(CodeActionResolveRequest = exports2.CodeActionResolveRequest || (exports2.CodeActionResolveRequest = {}));
5162     var WorkspaceSymbolRequest;
5163     (function(WorkspaceSymbolRequest2) {
5164       WorkspaceSymbolRequest2.method = "workspace/symbol";
5165       WorkspaceSymbolRequest2.type = new messages_1.ProtocolRequestType(WorkspaceSymbolRequest2.method);
5166     })(WorkspaceSymbolRequest = exports2.WorkspaceSymbolRequest || (exports2.WorkspaceSymbolRequest = {}));
5167     var CodeLensRequest;
5168     (function(CodeLensRequest2) {
5169       CodeLensRequest2.method = "textDocument/codeLens";
5170       CodeLensRequest2.type = new messages_1.ProtocolRequestType(CodeLensRequest2.method);
5171     })(CodeLensRequest = exports2.CodeLensRequest || (exports2.CodeLensRequest = {}));
5172     var CodeLensResolveRequest;
5173     (function(CodeLensResolveRequest2) {
5174       CodeLensResolveRequest2.method = "codeLens/resolve";
5175       CodeLensResolveRequest2.type = new messages_1.ProtocolRequestType(CodeLensResolveRequest2.method);
5176     })(CodeLensResolveRequest = exports2.CodeLensResolveRequest || (exports2.CodeLensResolveRequest = {}));
5177     var CodeLensRefreshRequest;
5178     (function(CodeLensRefreshRequest2) {
5179       CodeLensRefreshRequest2.method = `workspace/codeLens/refresh`;
5180       CodeLensRefreshRequest2.type = new messages_1.ProtocolRequestType0(CodeLensRefreshRequest2.method);
5181     })(CodeLensRefreshRequest = exports2.CodeLensRefreshRequest || (exports2.CodeLensRefreshRequest = {}));
5182     var DocumentLinkRequest;
5183     (function(DocumentLinkRequest2) {
5184       DocumentLinkRequest2.method = "textDocument/documentLink";
5185       DocumentLinkRequest2.type = new messages_1.ProtocolRequestType(DocumentLinkRequest2.method);
5186     })(DocumentLinkRequest = exports2.DocumentLinkRequest || (exports2.DocumentLinkRequest = {}));
5187     var DocumentLinkResolveRequest;
5188     (function(DocumentLinkResolveRequest2) {
5189       DocumentLinkResolveRequest2.method = "documentLink/resolve";
5190       DocumentLinkResolveRequest2.type = new messages_1.ProtocolRequestType(DocumentLinkResolveRequest2.method);
5191     })(DocumentLinkResolveRequest = exports2.DocumentLinkResolveRequest || (exports2.DocumentLinkResolveRequest = {}));
5192     var DocumentFormattingRequest;
5193     (function(DocumentFormattingRequest2) {
5194       DocumentFormattingRequest2.method = "textDocument/formatting";
5195       DocumentFormattingRequest2.type = new messages_1.ProtocolRequestType(DocumentFormattingRequest2.method);
5196     })(DocumentFormattingRequest = exports2.DocumentFormattingRequest || (exports2.DocumentFormattingRequest = {}));
5197     var DocumentRangeFormattingRequest;
5198     (function(DocumentRangeFormattingRequest2) {
5199       DocumentRangeFormattingRequest2.method = "textDocument/rangeFormatting";
5200       DocumentRangeFormattingRequest2.type = new messages_1.ProtocolRequestType(DocumentRangeFormattingRequest2.method);
5201     })(DocumentRangeFormattingRequest = exports2.DocumentRangeFormattingRequest || (exports2.DocumentRangeFormattingRequest = {}));
5202     var DocumentOnTypeFormattingRequest;
5203     (function(DocumentOnTypeFormattingRequest2) {
5204       DocumentOnTypeFormattingRequest2.method = "textDocument/onTypeFormatting";
5205       DocumentOnTypeFormattingRequest2.type = new messages_1.ProtocolRequestType(DocumentOnTypeFormattingRequest2.method);
5206     })(DocumentOnTypeFormattingRequest = exports2.DocumentOnTypeFormattingRequest || (exports2.DocumentOnTypeFormattingRequest = {}));
5207     var PrepareSupportDefaultBehavior;
5208     (function(PrepareSupportDefaultBehavior2) {
5209       PrepareSupportDefaultBehavior2.Identifier = 1;
5210     })(PrepareSupportDefaultBehavior = exports2.PrepareSupportDefaultBehavior || (exports2.PrepareSupportDefaultBehavior = {}));
5211     var RenameRequest;
5212     (function(RenameRequest2) {
5213       RenameRequest2.method = "textDocument/rename";
5214       RenameRequest2.type = new messages_1.ProtocolRequestType(RenameRequest2.method);
5215     })(RenameRequest = exports2.RenameRequest || (exports2.RenameRequest = {}));
5216     var PrepareRenameRequest;
5217     (function(PrepareRenameRequest2) {
5218       PrepareRenameRequest2.method = "textDocument/prepareRename";
5219       PrepareRenameRequest2.type = new messages_1.ProtocolRequestType(PrepareRenameRequest2.method);
5220     })(PrepareRenameRequest = exports2.PrepareRenameRequest || (exports2.PrepareRenameRequest = {}));
5221     var ExecuteCommandRequest;
5222     (function(ExecuteCommandRequest2) {
5223       ExecuteCommandRequest2.type = new messages_1.ProtocolRequestType("workspace/executeCommand");
5224     })(ExecuteCommandRequest = exports2.ExecuteCommandRequest || (exports2.ExecuteCommandRequest = {}));
5225     var ApplyWorkspaceEditRequest;
5226     (function(ApplyWorkspaceEditRequest2) {
5227       ApplyWorkspaceEditRequest2.type = new messages_1.ProtocolRequestType("workspace/applyEdit");
5228     })(ApplyWorkspaceEditRequest = exports2.ApplyWorkspaceEditRequest || (exports2.ApplyWorkspaceEditRequest = {}));
5229   }
5230 });
5231
5232 // node_modules/vscode-languageserver-protocol/lib/common/connection.js
5233 var require_connection2 = __commonJS({
5234   "node_modules/vscode-languageserver-protocol/lib/common/connection.js"(exports2) {
5235     "use strict";
5236     Object.defineProperty(exports2, "__esModule", { value: true });
5237     exports2.createProtocolConnection = void 0;
5238     var vscode_jsonrpc_1 = require_main();
5239     function createProtocolConnection(input, output, logger, options) {
5240       if (vscode_jsonrpc_1.ConnectionStrategy.is(options)) {
5241         options = { connectionStrategy: options };
5242       }
5243       return vscode_jsonrpc_1.createMessageConnection(input, output, logger, options);
5244     }
5245     exports2.createProtocolConnection = createProtocolConnection;
5246   }
5247 });
5248
5249 // node_modules/vscode-languageserver-protocol/lib/common/api.js
5250 var require_api2 = __commonJS({
5251   "node_modules/vscode-languageserver-protocol/lib/common/api.js"(exports2) {
5252     "use strict";
5253     var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
5254       if (k2 === void 0)
5255         k2 = k;
5256       Object.defineProperty(o, k2, { enumerable: true, get: function() {
5257         return m[k];
5258       } });
5259     } : function(o, m, k, k2) {
5260       if (k2 === void 0)
5261         k2 = k;
5262       o[k2] = m[k];
5263     });
5264     var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) {
5265       for (var p in m)
5266         if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p))
5267           __createBinding(exports3, m, p);
5268     };
5269     Object.defineProperty(exports2, "__esModule", { value: true });
5270     exports2.LSPErrorCodes = exports2.createProtocolConnection = void 0;
5271     __exportStar(require_main(), exports2);
5272     __exportStar((init_main(), main_exports), exports2);
5273     __exportStar(require_messages2(), exports2);
5274     __exportStar(require_protocol(), exports2);
5275     var connection_1 = require_connection2();
5276     Object.defineProperty(exports2, "createProtocolConnection", { enumerable: true, get: function() {
5277       return connection_1.createProtocolConnection;
5278     } });
5279     var LSPErrorCodes;
5280     (function(LSPErrorCodes2) {
5281       LSPErrorCodes2.lspReservedErrorRangeStart = -32899;
5282       LSPErrorCodes2.ContentModified = -32801;
5283       LSPErrorCodes2.RequestCancelled = -32800;
5284       LSPErrorCodes2.lspReservedErrorRangeEnd = -32800;
5285     })(LSPErrorCodes = exports2.LSPErrorCodes || (exports2.LSPErrorCodes = {}));
5286   }
5287 });
5288
5289 // node_modules/vscode-languageserver-protocol/lib/node/main.js
5290 var require_main2 = __commonJS({
5291   "node_modules/vscode-languageserver-protocol/lib/node/main.js"(exports2) {
5292     "use strict";
5293     var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
5294       if (k2 === void 0)
5295         k2 = k;
5296       Object.defineProperty(o, k2, { enumerable: true, get: function() {
5297         return m[k];
5298       } });
5299     } : function(o, m, k, k2) {
5300       if (k2 === void 0)
5301         k2 = k;
5302       o[k2] = m[k];
5303     });
5304     var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) {
5305       for (var p in m)
5306         if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p))
5307           __createBinding(exports3, m, p);
5308     };
5309     Object.defineProperty(exports2, "__esModule", { value: true });
5310     exports2.createProtocolConnection = void 0;
5311     var node_1 = require_node();
5312     __exportStar(require_node(), exports2);
5313     __exportStar(require_api2(), exports2);
5314     function createProtocolConnection(input, output, logger, options) {
5315       return node_1.createMessageConnection(input, output, logger, options);
5316     }
5317     exports2.createProtocolConnection = createProtocolConnection;
5318   }
5319 });
5320
5321 // node_modules/event-target-shim/dist/event-target-shim.js
5322 var require_event_target_shim = __commonJS({
5323   "node_modules/event-target-shim/dist/event-target-shim.js"(exports2, module2) {
5324     "use strict";
5325     Object.defineProperty(exports2, "__esModule", { value: true });
5326     var privateData = new WeakMap();
5327     var wrappers = new WeakMap();
5328     function pd(event) {
5329       const retv = privateData.get(event);
5330       console.assert(retv != null, "'this' is expected an Event object, but got", event);
5331       return retv;
5332     }
5333     function setCancelFlag(data) {
5334       if (data.passiveListener != null) {
5335         if (typeof console !== "undefined" && typeof console.error === "function") {
5336           console.error("Unable to preventDefault inside passive event listener invocation.", data.passiveListener);
5337         }
5338         return;
5339       }
5340       if (!data.event.cancelable) {
5341         return;
5342       }
5343       data.canceled = true;
5344       if (typeof data.event.preventDefault === "function") {
5345         data.event.preventDefault();
5346       }
5347     }
5348     function Event2(eventTarget, event) {
5349       privateData.set(this, {
5350         eventTarget,
5351         event,
5352         eventPhase: 2,
5353         currentTarget: eventTarget,
5354         canceled: false,
5355         stopped: false,
5356         immediateStopped: false,
5357         passiveListener: null,
5358         timeStamp: event.timeStamp || Date.now()
5359       });
5360       Object.defineProperty(this, "isTrusted", { value: false, enumerable: true });
5361       const keys = Object.keys(event);
5362       for (let i = 0; i < keys.length; ++i) {
5363         const key = keys[i];
5364         if (!(key in this)) {
5365           Object.defineProperty(this, key, defineRedirectDescriptor(key));
5366         }
5367       }
5368     }
5369     Event2.prototype = {
5370       get type() {
5371         return pd(this).event.type;
5372       },
5373       get target() {
5374         return pd(this).eventTarget;
5375       },
5376       get currentTarget() {
5377         return pd(this).currentTarget;
5378       },
5379       composedPath() {
5380         const currentTarget = pd(this).currentTarget;
5381         if (currentTarget == null) {
5382           return [];
5383         }
5384         return [currentTarget];
5385       },
5386       get NONE() {
5387         return 0;
5388       },
5389       get CAPTURING_PHASE() {
5390         return 1;
5391       },
5392       get AT_TARGET() {
5393         return 2;
5394       },
5395       get BUBBLING_PHASE() {
5396         return 3;
5397       },
5398       get eventPhase() {
5399         return pd(this).eventPhase;
5400       },
5401       stopPropagation() {
5402         const data = pd(this);
5403         data.stopped = true;
5404         if (typeof data.event.stopPropagation === "function") {
5405           data.event.stopPropagation();
5406         }
5407       },
5408       stopImmediatePropagation() {
5409         const data = pd(this);
5410         data.stopped = true;
5411         data.immediateStopped = true;
5412         if (typeof data.event.stopImmediatePropagation === "function") {
5413           data.event.stopImmediatePropagation();
5414         }
5415       },
5416       get bubbles() {
5417         return Boolean(pd(this).event.bubbles);
5418       },
5419       get cancelable() {
5420         return Boolean(pd(this).event.cancelable);
5421       },
5422       preventDefault() {
5423         setCancelFlag(pd(this));
5424       },
5425       get defaultPrevented() {
5426         return pd(this).canceled;
5427       },
5428       get composed() {
5429         return Boolean(pd(this).event.composed);
5430       },
5431       get timeStamp() {
5432         return pd(this).timeStamp;
5433       },
5434       get srcElement() {
5435         return pd(this).eventTarget;
5436       },
5437       get cancelBubble() {
5438         return pd(this).stopped;
5439       },
5440       set cancelBubble(value) {
5441         if (!value) {
5442           return;
5443         }
5444         const data = pd(this);
5445         data.stopped = true;
5446         if (typeof data.event.cancelBubble === "boolean") {
5447           data.event.cancelBubble = true;
5448         }
5449       },
5450       get returnValue() {
5451         return !pd(this).canceled;
5452       },
5453       set returnValue(value) {
5454         if (!value) {
5455           setCancelFlag(pd(this));
5456         }
5457       },
5458       initEvent() {
5459       }
5460     };
5461     Object.defineProperty(Event2.prototype, "constructor", {
5462       value: Event2,
5463       configurable: true,
5464       writable: true
5465     });
5466     if (typeof window !== "undefined" && typeof window.Event !== "undefined") {
5467       Object.setPrototypeOf(Event2.prototype, window.Event.prototype);
5468       wrappers.set(window.Event.prototype, Event2);
5469     }
5470     function defineRedirectDescriptor(key) {
5471       return {
5472         get() {
5473           return pd(this).event[key];
5474         },
5475         set(value) {
5476           pd(this).event[key] = value;
5477         },
5478         configurable: true,
5479         enumerable: true
5480       };
5481     }
5482     function defineCallDescriptor(key) {
5483       return {
5484         value() {
5485           const event = pd(this).event;
5486           return event[key].apply(event, arguments);
5487         },
5488         configurable: true,
5489         enumerable: true
5490       };
5491     }
5492     function defineWrapper(BaseEvent, proto) {
5493       const keys = Object.keys(proto);
5494       if (keys.length === 0) {
5495         return BaseEvent;
5496       }
5497       function CustomEvent2(eventTarget, event) {
5498         BaseEvent.call(this, eventTarget, event);
5499       }
5500       CustomEvent2.prototype = Object.create(BaseEvent.prototype, {
5501         constructor: { value: CustomEvent2, configurable: true, writable: true }
5502       });
5503       for (let i = 0; i < keys.length; ++i) {
5504         const key = keys[i];
5505         if (!(key in BaseEvent.prototype)) {
5506           const descriptor = Object.getOwnPropertyDescriptor(proto, key);
5507           const isFunc = typeof descriptor.value === "function";
5508           Object.defineProperty(CustomEvent2.prototype, key, isFunc ? defineCallDescriptor(key) : defineRedirectDescriptor(key));
5509         }
5510       }
5511       return CustomEvent2;
5512     }
5513     function getWrapper(proto) {
5514       if (proto == null || proto === Object.prototype) {
5515         return Event2;
5516       }
5517       let wrapper = wrappers.get(proto);
5518       if (wrapper == null) {
5519         wrapper = defineWrapper(getWrapper(Object.getPrototypeOf(proto)), proto);
5520         wrappers.set(proto, wrapper);
5521       }
5522       return wrapper;
5523     }
5524     function wrapEvent(eventTarget, event) {
5525       const Wrapper = getWrapper(Object.getPrototypeOf(event));
5526       return new Wrapper(eventTarget, event);
5527     }
5528     function isStopped(event) {
5529       return pd(event).immediateStopped;
5530     }
5531     function setEventPhase(event, eventPhase) {
5532       pd(event).eventPhase = eventPhase;
5533     }
5534     function setCurrentTarget(event, currentTarget) {
5535       pd(event).currentTarget = currentTarget;
5536     }
5537     function setPassiveListener(event, passiveListener) {
5538       pd(event).passiveListener = passiveListener;
5539     }
5540     var listenersMap = new WeakMap();
5541     var CAPTURE = 1;
5542     var BUBBLE = 2;
5543     var ATTRIBUTE = 3;
5544     function isObject2(x) {
5545       return x !== null && typeof x === "object";
5546     }
5547     function getListeners(eventTarget) {
5548       const listeners = listenersMap.get(eventTarget);
5549       if (listeners == null) {
5550         throw new TypeError("'this' is expected an EventTarget object, but got another value.");
5551       }
5552       return listeners;
5553     }
5554     function defineEventAttributeDescriptor(eventName) {
5555       return {
5556         get() {
5557           const listeners = getListeners(this);
5558           let node = listeners.get(eventName);
5559           while (node != null) {
5560             if (node.listenerType === ATTRIBUTE) {
5561               return node.listener;
5562             }
5563             node = node.next;
5564           }
5565           return null;
5566         },
5567         set(listener) {
5568           if (typeof listener !== "function" && !isObject2(listener)) {
5569             listener = null;
5570           }
5571           const listeners = getListeners(this);
5572           let prev = null;
5573           let node = listeners.get(eventName);
5574           while (node != null) {
5575             if (node.listenerType === ATTRIBUTE) {
5576               if (prev !== null) {
5577                 prev.next = node.next;
5578               } else if (node.next !== null) {
5579                 listeners.set(eventName, node.next);
5580               } else {
5581                 listeners.delete(eventName);
5582               }
5583             } else {
5584               prev = node;
5585             }
5586             node = node.next;
5587           }
5588           if (listener !== null) {
5589             const newNode = {
5590               listener,
5591               listenerType: ATTRIBUTE,
5592               passive: false,
5593               once: false,
5594               next: null
5595             };
5596             if (prev === null) {
5597               listeners.set(eventName, newNode);
5598             } else {
5599               prev.next = newNode;
5600             }
5601           }
5602         },
5603         configurable: true,
5604         enumerable: true
5605       };
5606     }
5607     function defineEventAttribute(eventTargetPrototype, eventName) {
5608       Object.defineProperty(eventTargetPrototype, `on${eventName}`, defineEventAttributeDescriptor(eventName));
5609     }
5610     function defineCustomEventTarget(eventNames) {
5611       function CustomEventTarget() {
5612         EventTarget.call(this);
5613       }
5614       CustomEventTarget.prototype = Object.create(EventTarget.prototype, {
5615         constructor: {
5616           value: CustomEventTarget,
5617           configurable: true,
5618           writable: true
5619         }
5620       });
5621       for (let i = 0; i < eventNames.length; ++i) {
5622         defineEventAttribute(CustomEventTarget.prototype, eventNames[i]);
5623       }
5624       return CustomEventTarget;
5625     }
5626     function EventTarget() {
5627       if (this instanceof EventTarget) {
5628         listenersMap.set(this, new Map());
5629         return;
5630       }
5631       if (arguments.length === 1 && Array.isArray(arguments[0])) {
5632         return defineCustomEventTarget(arguments[0]);
5633       }
5634       if (arguments.length > 0) {
5635         const types = new Array(arguments.length);
5636         for (let i = 0; i < arguments.length; ++i) {
5637           types[i] = arguments[i];
5638         }
5639         return defineCustomEventTarget(types);
5640       }
5641       throw new TypeError("Cannot call a class as a function");
5642     }
5643     EventTarget.prototype = {
5644       addEventListener(eventName, listener, options) {
5645         if (listener == null) {
5646           return;
5647         }
5648         if (typeof listener !== "function" && !isObject2(listener)) {
5649           throw new TypeError("'listener' should be a function or an object.");
5650         }
5651         const listeners = getListeners(this);
5652         const optionsIsObj = isObject2(options);
5653         const capture = optionsIsObj ? Boolean(options.capture) : Boolean(options);
5654         const listenerType = capture ? CAPTURE : BUBBLE;
5655         const newNode = {
5656           listener,
5657           listenerType,
5658           passive: optionsIsObj && Boolean(options.passive),
5659           once: optionsIsObj && Boolean(options.once),
5660           next: null
5661         };
5662         let node = listeners.get(eventName);
5663         if (node === void 0) {
5664           listeners.set(eventName, newNode);
5665           return;
5666         }
5667         let prev = null;
5668         while (node != null) {
5669           if (node.listener === listener && node.listenerType === listenerType) {
5670             return;
5671           }
5672           prev = node;
5673           node = node.next;
5674         }
5675         prev.next = newNode;
5676       },
5677       removeEventListener(eventName, listener, options) {
5678         if (listener == null) {
5679           return;
5680         }
5681         const listeners = getListeners(this);
5682         const capture = isObject2(options) ? Boolean(options.capture) : Boolean(options);
5683         const listenerType = capture ? CAPTURE : BUBBLE;
5684         let prev = null;
5685         let node = listeners.get(eventName);
5686         while (node != null) {
5687           if (node.listener === listener && node.listenerType === listenerType) {
5688             if (prev !== null) {
5689               prev.next = node.next;
5690             } else if (node.next !== null) {
5691               listeners.set(eventName, node.next);
5692             } else {
5693               listeners.delete(eventName);
5694             }
5695             return;
5696           }
5697           prev = node;
5698           node = node.next;
5699         }
5700       },
5701       dispatchEvent(event) {
5702         if (event == null || typeof event.type !== "string") {
5703           throw new TypeError('"event.type" should be a string.');
5704         }
5705         const listeners = getListeners(this);
5706         const eventName = event.type;
5707         let node = listeners.get(eventName);
5708         if (node == null) {
5709           return true;
5710         }
5711         const wrappedEvent = wrapEvent(this, event);
5712         let prev = null;
5713         while (node != null) {
5714           if (node.once) {
5715             if (prev !== null) {
5716               prev.next = node.next;
5717             } else if (node.next !== null) {
5718               listeners.set(eventName, node.next);
5719             } else {
5720               listeners.delete(eventName);
5721             }
5722           } else {
5723             prev = node;
5724           }
5725           setPassiveListener(wrappedEvent, node.passive ? node.listener : null);
5726           if (typeof node.listener === "function") {
5727             try {
5728               node.listener.call(this, wrappedEvent);
5729             } catch (err) {
5730               if (typeof console !== "undefined" && typeof console.error === "function") {
5731                 console.error(err);
5732               }
5733             }
5734           } else if (node.listenerType !== ATTRIBUTE && typeof node.listener.handleEvent === "function") {
5735             node.listener.handleEvent(wrappedEvent);
5736           }
5737           if (isStopped(wrappedEvent)) {
5738             break;
5739           }
5740           node = node.next;
5741         }
5742         setPassiveListener(wrappedEvent, null);
5743         setEventPhase(wrappedEvent, 0);
5744         setCurrentTarget(wrappedEvent, null);
5745         return !wrappedEvent.defaultPrevented;
5746       }
5747     };
5748     Object.defineProperty(EventTarget.prototype, "constructor", {
5749       value: EventTarget,
5750       configurable: true,
5751       writable: true
5752     });
5753     if (typeof window !== "undefined" && typeof window.EventTarget !== "undefined") {
5754       Object.setPrototypeOf(EventTarget.prototype, window.EventTarget.prototype);
5755     }
5756     exports2.defineEventAttribute = defineEventAttribute;
5757     exports2.EventTarget = EventTarget;
5758     exports2.default = EventTarget;
5759     module2.exports = EventTarget;
5760     module2.exports.EventTarget = module2.exports["default"] = EventTarget;
5761     module2.exports.defineEventAttribute = defineEventAttribute;
5762   }
5763 });
5764
5765 // node_modules/abort-controller/dist/abort-controller.js
5766 var require_abort_controller = __commonJS({
5767   "node_modules/abort-controller/dist/abort-controller.js"(exports2, module2) {
5768     "use strict";
5769     Object.defineProperty(exports2, "__esModule", { value: true });
5770     var eventTargetShim = require_event_target_shim();
5771     var AbortSignal = class extends eventTargetShim.EventTarget {
5772       constructor() {
5773         super();
5774         throw new TypeError("AbortSignal cannot be constructed directly");
5775       }
5776       get aborted() {
5777         const aborted = abortedFlags.get(this);
5778         if (typeof aborted !== "boolean") {
5779           throw new TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this === null ? "null" : typeof this}`);
5780         }
5781         return aborted;
5782       }
5783     };
5784     eventTargetShim.defineEventAttribute(AbortSignal.prototype, "abort");
5785     function createAbortSignal() {
5786       const signal = Object.create(AbortSignal.prototype);
5787       eventTargetShim.EventTarget.call(signal);
5788       abortedFlags.set(signal, false);
5789       return signal;
5790     }
5791     function abortSignal(signal) {
5792       if (abortedFlags.get(signal) !== false) {
5793         return;
5794       }
5795       abortedFlags.set(signal, true);
5796       signal.dispatchEvent({ type: "abort" });
5797     }
5798     var abortedFlags = new WeakMap();
5799     Object.defineProperties(AbortSignal.prototype, {
5800       aborted: { enumerable: true }
5801     });
5802     if (typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol") {
5803       Object.defineProperty(AbortSignal.prototype, Symbol.toStringTag, {
5804         configurable: true,
5805         value: "AbortSignal"
5806       });
5807     }
5808     var AbortController = class {
5809       constructor() {
5810         signals.set(this, createAbortSignal());
5811       }
5812       get signal() {
5813         return getSignal(this);
5814       }
5815       abort() {
5816         abortSignal(getSignal(this));
5817       }
5818     };
5819     var signals = new WeakMap();
5820     function getSignal(controller) {
5821       const signal = signals.get(controller);
5822       if (signal == null) {
5823         throw new TypeError(`Expected 'this' to be an 'AbortController' object, but got ${controller === null ? "null" : typeof controller}`);
5824       }
5825       return signal;
5826     }
5827     Object.defineProperties(AbortController.prototype, {
5828       signal: { enumerable: true },
5829       abort: { enumerable: true }
5830     });
5831     if (typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol") {
5832       Object.defineProperty(AbortController.prototype, Symbol.toStringTag, {
5833         configurable: true,
5834         value: "AbortController"
5835       });
5836     }
5837     exports2.AbortController = AbortController;
5838     exports2.AbortSignal = AbortSignal;
5839     exports2.default = AbortController;
5840     module2.exports = AbortController;
5841     module2.exports.AbortController = module2.exports["default"] = AbortController;
5842     module2.exports.AbortSignal = AbortSignal;
5843   }
5844 });
5845
5846 // node_modules/node-fetch/lib/index.mjs
5847 var lib_exports = {};
5848 __export(lib_exports, {
5849   FetchError: () => FetchError,
5850   Headers: () => Headers,
5851   Request: () => Request,
5852   Response: () => Response,
5853   default: () => lib_default
5854 });
5855 function FetchError(message, type, systemError) {
5856   Error.call(this, message);
5857   this.message = message;
5858   this.type = type;
5859   if (systemError) {
5860     this.code = this.errno = systemError.code;
5861   }
5862   Error.captureStackTrace(this, this.constructor);
5863 }
5864 function Body(body) {
5865   var _this = this;
5866   var _ref = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, _ref$size = _ref.size;
5867   let size = _ref$size === void 0 ? 0 : _ref$size;
5868   var _ref$timeout = _ref.timeout;
5869   let timeout = _ref$timeout === void 0 ? 0 : _ref$timeout;
5870   if (body == null) {
5871     body = null;
5872   } else if (isURLSearchParams(body)) {
5873     body = Buffer.from(body.toString());
5874   } else if (isBlob(body))
5875     ;
5876   else if (Buffer.isBuffer(body))
5877     ;
5878   else if (Object.prototype.toString.call(body) === "[object ArrayBuffer]") {
5879     body = Buffer.from(body);
5880   } else if (ArrayBuffer.isView(body)) {
5881     body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
5882   } else if (body instanceof import_stream.default)
5883     ;
5884   else {
5885     body = Buffer.from(String(body));
5886   }
5887   this[INTERNALS] = {
5888     body,
5889     disturbed: false,
5890     error: null
5891   };
5892   this.size = size;
5893   this.timeout = timeout;
5894   if (body instanceof import_stream.default) {
5895     body.on("error", function(err) {
5896       const error = err.name === "AbortError" ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, "system", err);
5897       _this[INTERNALS].error = error;
5898     });
5899   }
5900 }
5901 function consumeBody() {
5902   var _this4 = this;
5903   if (this[INTERNALS].disturbed) {
5904     return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
5905   }
5906   this[INTERNALS].disturbed = true;
5907   if (this[INTERNALS].error) {
5908     return Body.Promise.reject(this[INTERNALS].error);
5909   }
5910   let body = this.body;
5911   if (body === null) {
5912     return Body.Promise.resolve(Buffer.alloc(0));
5913   }
5914   if (isBlob(body)) {
5915     body = body.stream();
5916   }
5917   if (Buffer.isBuffer(body)) {
5918     return Body.Promise.resolve(body);
5919   }
5920   if (!(body instanceof import_stream.default)) {
5921     return Body.Promise.resolve(Buffer.alloc(0));
5922   }
5923   let accum = [];
5924   let accumBytes = 0;
5925   let abort = false;
5926   return new Body.Promise(function(resolve, reject) {
5927     let resTimeout;
5928     if (_this4.timeout) {
5929       resTimeout = setTimeout(function() {
5930         abort = true;
5931         reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, "body-timeout"));
5932       }, _this4.timeout);
5933     }
5934     body.on("error", function(err) {
5935       if (err.name === "AbortError") {
5936         abort = true;
5937         reject(err);
5938       } else {
5939         reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, "system", err));
5940       }
5941     });
5942     body.on("data", function(chunk) {
5943       if (abort || chunk === null) {
5944         return;
5945       }
5946       if (_this4.size && accumBytes + chunk.length > _this4.size) {
5947         abort = true;
5948         reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, "max-size"));
5949         return;
5950       }
5951       accumBytes += chunk.length;
5952       accum.push(chunk);
5953     });
5954     body.on("end", function() {
5955       if (abort) {
5956         return;
5957       }
5958       clearTimeout(resTimeout);
5959       try {
5960         resolve(Buffer.concat(accum, accumBytes));
5961       } catch (err) {
5962         reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, "system", err));
5963       }
5964     });
5965   });
5966 }
5967 function convertBody(buffer, headers) {
5968   if (typeof convert !== "function") {
5969     throw new Error("The package `encoding` must be installed to use the textConverted() function");
5970   }
5971   const ct = headers.get("content-type");
5972   let charset = "utf-8";
5973   let res, str;
5974   if (ct) {
5975     res = /charset=([^;]*)/i.exec(ct);
5976   }
5977   str = buffer.slice(0, 1024).toString();
5978   if (!res && str) {
5979     res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
5980   }
5981   if (!res && str) {
5982     res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
5983     if (!res) {
5984       res = /<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(str);
5985       if (res) {
5986         res.pop();
5987       }
5988     }
5989     if (res) {
5990       res = /charset=(.*)/i.exec(res.pop());
5991     }
5992   }
5993   if (!res && str) {
5994     res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
5995   }
5996   if (res) {
5997     charset = res.pop();
5998     if (charset === "gb2312" || charset === "gbk") {
5999       charset = "gb18030";
6000     }
6001   }
6002   return convert(buffer, "UTF-8", charset).toString();
6003 }
6004 function isURLSearchParams(obj2) {
6005   if (typeof obj2 !== "object" || typeof obj2.append !== "function" || typeof obj2.delete !== "function" || typeof obj2.get !== "function" || typeof obj2.getAll !== "function" || typeof obj2.has !== "function" || typeof obj2.set !== "function") {
6006     return false;
6007   }
6008   return obj2.constructor.name === "URLSearchParams" || Object.prototype.toString.call(obj2) === "[object URLSearchParams]" || typeof obj2.sort === "function";
6009 }
6010 function isBlob(obj2) {
6011   return typeof obj2 === "object" && typeof obj2.arrayBuffer === "function" && typeof obj2.type === "string" && typeof obj2.stream === "function" && typeof obj2.constructor === "function" && typeof obj2.constructor.name === "string" && /^(Blob|File)$/.test(obj2.constructor.name) && /^(Blob|File)$/.test(obj2[Symbol.toStringTag]);
6012 }
6013 function clone(instance) {
6014   let p1, p2;
6015   let body = instance.body;
6016   if (instance.bodyUsed) {
6017     throw new Error("cannot clone body after it is used");
6018   }
6019   if (body instanceof import_stream.default && typeof body.getBoundary !== "function") {
6020     p1 = new PassThrough();
6021     p2 = new PassThrough();
6022     body.pipe(p1);
6023     body.pipe(p2);
6024     instance[INTERNALS].body = p1;
6025     body = p2;
6026   }
6027   return body;
6028 }
6029 function extractContentType(body) {
6030   if (body === null) {
6031     return null;
6032   } else if (typeof body === "string") {
6033     return "text/plain;charset=UTF-8";
6034   } else if (isURLSearchParams(body)) {
6035     return "application/x-www-form-urlencoded;charset=UTF-8";
6036   } else if (isBlob(body)) {
6037     return body.type || null;
6038   } else if (Buffer.isBuffer(body)) {
6039     return null;
6040   } else if (Object.prototype.toString.call(body) === "[object ArrayBuffer]") {
6041     return null;
6042   } else if (ArrayBuffer.isView(body)) {
6043     return null;
6044   } else if (typeof body.getBoundary === "function") {
6045     return `multipart/form-data;boundary=${body.getBoundary()}`;
6046   } else if (body instanceof import_stream.default) {
6047     return null;
6048   } else {
6049     return "text/plain;charset=UTF-8";
6050   }
6051 }
6052 function getTotalBytes(instance) {
6053   const body = instance.body;
6054   if (body === null) {
6055     return 0;
6056   } else if (isBlob(body)) {
6057     return body.size;
6058   } else if (Buffer.isBuffer(body)) {
6059     return body.length;
6060   } else if (body && typeof body.getLengthSync === "function") {
6061     if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || body.hasKnownLength && body.hasKnownLength()) {
6062       return body.getLengthSync();
6063     }
6064     return null;
6065   } else {
6066     return null;
6067   }
6068 }
6069 function writeToStream(dest, instance) {
6070   const body = instance.body;
6071   if (body === null) {
6072     dest.end();
6073   } else if (isBlob(body)) {
6074     body.stream().pipe(dest);
6075   } else if (Buffer.isBuffer(body)) {
6076     dest.write(body);
6077     dest.end();
6078   } else {
6079     body.pipe(dest);
6080   }
6081 }
6082 function validateName(name) {
6083   name = `${name}`;
6084   if (invalidTokenRegex.test(name) || name === "") {
6085     throw new TypeError(`${name} is not a legal HTTP header name`);
6086   }
6087 }
6088 function validateValue(value) {
6089   value = `${value}`;
6090   if (invalidHeaderCharRegex.test(value)) {
6091     throw new TypeError(`${value} is not a legal HTTP header value`);
6092   }
6093 }
6094 function find(map, name) {
6095   name = name.toLowerCase();
6096   for (const key in map) {
6097     if (key.toLowerCase() === name) {
6098       return key;
6099     }
6100   }
6101   return void 0;
6102 }
6103 function getHeaders(headers) {
6104   let kind = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "key+value";
6105   const keys = Object.keys(headers[MAP]).sort();
6106   return keys.map(kind === "key" ? function(k) {
6107     return k.toLowerCase();
6108   } : kind === "value" ? function(k) {
6109     return headers[MAP][k].join(", ");
6110   } : function(k) {
6111     return [k.toLowerCase(), headers[MAP][k].join(", ")];
6112   });
6113 }
6114 function createHeadersIterator(target, kind) {
6115   const iterator = Object.create(HeadersIteratorPrototype);
6116   iterator[INTERNAL] = {
6117     target,
6118     kind,
6119     index: 0
6120   };
6121   return iterator;
6122 }
6123 function exportNodeCompatibleHeaders(headers) {
6124   const obj2 = Object.assign({ __proto__: null }, headers[MAP]);
6125   const hostHeaderKey = find(headers[MAP], "Host");
6126   if (hostHeaderKey !== void 0) {
6127     obj2[hostHeaderKey] = obj2[hostHeaderKey][0];
6128   }
6129   return obj2;
6130 }
6131 function createHeadersLenient(obj2) {
6132   const headers = new Headers();
6133   for (const name of Object.keys(obj2)) {
6134     if (invalidTokenRegex.test(name)) {
6135       continue;
6136     }
6137     if (Array.isArray(obj2[name])) {
6138       for (const val of obj2[name]) {
6139         if (invalidHeaderCharRegex.test(val)) {
6140           continue;
6141         }
6142         if (headers[MAP][name] === void 0) {
6143           headers[MAP][name] = [val];
6144         } else {
6145           headers[MAP][name].push(val);
6146         }
6147       }
6148     } else if (!invalidHeaderCharRegex.test(obj2[name])) {
6149       headers[MAP][name] = [obj2[name]];
6150     }
6151   }
6152   return headers;
6153 }
6154 function isRequest(input) {
6155   return typeof input === "object" && typeof input[INTERNALS$2] === "object";
6156 }
6157 function isAbortSignal(signal) {
6158   const proto = signal && typeof signal === "object" && Object.getPrototypeOf(signal);
6159   return !!(proto && proto.constructor.name === "AbortSignal");
6160 }
6161 function getNodeRequestOptions(request) {
6162   const parsedURL = request[INTERNALS$2].parsedURL;
6163   const headers = new Headers(request[INTERNALS$2].headers);
6164   if (!headers.has("Accept")) {
6165     headers.set("Accept", "*/*");
6166   }
6167   if (!parsedURL.protocol || !parsedURL.hostname) {
6168     throw new TypeError("Only absolute URLs are supported");
6169   }
6170   if (!/^https?:$/.test(parsedURL.protocol)) {
6171     throw new TypeError("Only HTTP(S) protocols are supported");
6172   }
6173   if (request.signal && request.body instanceof import_stream.default.Readable && !streamDestructionSupported) {
6174     throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");
6175   }
6176   let contentLengthValue = null;
6177   if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
6178     contentLengthValue = "0";
6179   }
6180   if (request.body != null) {
6181     const totalBytes = getTotalBytes(request);
6182     if (typeof totalBytes === "number") {
6183       contentLengthValue = String(totalBytes);
6184     }
6185   }
6186   if (contentLengthValue) {
6187     headers.set("Content-Length", contentLengthValue);
6188   }
6189   if (!headers.has("User-Agent")) {
6190     headers.set("User-Agent", "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)");
6191   }
6192   if (request.compress && !headers.has("Accept-Encoding")) {
6193     headers.set("Accept-Encoding", "gzip,deflate");
6194   }
6195   let agent = request.agent;
6196   if (typeof agent === "function") {
6197     agent = agent(parsedURL);
6198   }
6199   if (!headers.has("Connection") && !agent) {
6200     headers.set("Connection", "close");
6201   }
6202   return Object.assign({}, parsedURL, {
6203     method: request.method,
6204     headers: exportNodeCompatibleHeaders(headers),
6205     agent
6206   });
6207 }
6208 function AbortError(message) {
6209   Error.call(this, message);
6210   this.type = "aborted";
6211   this.message = message;
6212   Error.captureStackTrace(this, this.constructor);
6213 }
6214 function fetch(url, opts) {
6215   if (!fetch.Promise) {
6216     throw new Error("native promise missing, set fetch.Promise to your favorite alternative");
6217   }
6218   Body.Promise = fetch.Promise;
6219   return new fetch.Promise(function(resolve, reject) {
6220     const request = new Request(url, opts);
6221     const options = getNodeRequestOptions(request);
6222     const send = (options.protocol === "https:" ? import_https.default : import_http.default).request;
6223     const signal = request.signal;
6224     let response = null;
6225     const abort = function abort2() {
6226       let error = new AbortError("The user aborted a request.");
6227       reject(error);
6228       if (request.body && request.body instanceof import_stream.default.Readable) {
6229         request.body.destroy(error);
6230       }
6231       if (!response || !response.body)
6232         return;
6233       response.body.emit("error", error);
6234     };
6235     if (signal && signal.aborted) {
6236       abort();
6237       return;
6238     }
6239     const abortAndFinalize = function abortAndFinalize2() {
6240       abort();
6241       finalize();
6242     };
6243     const req = send(options);
6244     let reqTimeout;
6245     if (signal) {
6246       signal.addEventListener("abort", abortAndFinalize);
6247     }
6248     function finalize() {
6249       req.abort();
6250       if (signal)
6251         signal.removeEventListener("abort", abortAndFinalize);
6252       clearTimeout(reqTimeout);
6253     }
6254     if (request.timeout) {
6255       req.once("socket", function(socket) {
6256         reqTimeout = setTimeout(function() {
6257           reject(new FetchError(`network timeout at: ${request.url}`, "request-timeout"));
6258           finalize();
6259         }, request.timeout);
6260       });
6261     }
6262     req.on("error", function(err) {
6263       reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, "system", err));
6264       finalize();
6265     });
6266     req.on("response", function(res) {
6267       clearTimeout(reqTimeout);
6268       const headers = createHeadersLenient(res.headers);
6269       if (fetch.isRedirect(res.statusCode)) {
6270         const location = headers.get("Location");
6271         const locationURL = location === null ? null : resolve_url(request.url, location);
6272         switch (request.redirect) {
6273           case "error":
6274             reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, "no-redirect"));
6275             finalize();
6276             return;
6277           case "manual":
6278             if (locationURL !== null) {
6279               try {
6280                 headers.set("Location", locationURL);
6281               } catch (err) {
6282                 reject(err);
6283               }
6284             }
6285             break;
6286           case "follow":
6287             if (locationURL === null) {
6288               break;
6289             }
6290             if (request.counter >= request.follow) {
6291               reject(new FetchError(`maximum redirect reached at: ${request.url}`, "max-redirect"));
6292               finalize();
6293               return;
6294             }
6295             const requestOpts = {
6296               headers: new Headers(request.headers),
6297               follow: request.follow,
6298               counter: request.counter + 1,
6299               agent: request.agent,
6300               compress: request.compress,
6301               method: request.method,
6302               body: request.body,
6303               signal: request.signal,
6304               timeout: request.timeout,
6305               size: request.size
6306             };
6307             if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
6308               reject(new FetchError("Cannot follow redirect with body being a readable stream", "unsupported-redirect"));
6309               finalize();
6310               return;
6311             }
6312             if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === "POST") {
6313               requestOpts.method = "GET";
6314               requestOpts.body = void 0;
6315               requestOpts.headers.delete("content-length");
6316             }
6317             resolve(fetch(new Request(locationURL, requestOpts)));
6318             finalize();
6319             return;
6320         }
6321       }
6322       res.once("end", function() {
6323         if (signal)
6324           signal.removeEventListener("abort", abortAndFinalize);
6325       });
6326       let body = res.pipe(new PassThrough$1());
6327       const response_options = {
6328         url: request.url,
6329         status: res.statusCode,
6330         statusText: res.statusMessage,
6331         headers,
6332         size: request.size,
6333         timeout: request.timeout,
6334         counter: request.counter
6335       };
6336       const codings = headers.get("Content-Encoding");
6337       if (!request.compress || request.method === "HEAD" || codings === null || res.statusCode === 204 || res.statusCode === 304) {
6338         response = new Response(body, response_options);
6339         resolve(response);
6340         return;
6341       }
6342       const zlibOptions = {
6343         flush: import_zlib.default.Z_SYNC_FLUSH,
6344         finishFlush: import_zlib.default.Z_SYNC_FLUSH
6345       };
6346       if (codings == "gzip" || codings == "x-gzip") {
6347         body = body.pipe(import_zlib.default.createGunzip(zlibOptions));
6348         response = new Response(body, response_options);
6349         resolve(response);
6350         return;
6351       }
6352       if (codings == "deflate" || codings == "x-deflate") {
6353         const raw = res.pipe(new PassThrough$1());
6354         raw.once("data", function(chunk) {
6355           if ((chunk[0] & 15) === 8) {
6356             body = body.pipe(import_zlib.default.createInflate());
6357           } else {
6358             body = body.pipe(import_zlib.default.createInflateRaw());
6359           }
6360           response = new Response(body, response_options);
6361           resolve(response);
6362         });
6363         return;
6364       }
6365       if (codings == "br" && typeof import_zlib.default.createBrotliDecompress === "function") {
6366         body = body.pipe(import_zlib.default.createBrotliDecompress());
6367         response = new Response(body, response_options);
6368         resolve(response);
6369         return;
6370       }
6371       response = new Response(body, response_options);
6372       resolve(response);
6373     });
6374     writeToStream(req, request);
6375   });
6376 }
6377 var import_stream, import_http, import_url, import_https, import_zlib, Readable, BUFFER, TYPE, Blob, convert, INTERNALS, PassThrough, invalidTokenRegex, invalidHeaderCharRegex, MAP, Headers, INTERNAL, HeadersIteratorPrototype, INTERNALS$1, STATUS_CODES, Response, INTERNALS$2, parse_url, format_url, streamDestructionSupported, Request, PassThrough$1, resolve_url, lib_default;
6378 var init_lib = __esm({
6379   "node_modules/node-fetch/lib/index.mjs"() {
6380     import_stream = __toModule(require("stream"));
6381     import_http = __toModule(require("http"));
6382     import_url = __toModule(require("url"));
6383     import_https = __toModule(require("https"));
6384     import_zlib = __toModule(require("zlib"));
6385     Readable = import_stream.default.Readable;
6386     BUFFER = Symbol("buffer");
6387     TYPE = Symbol("type");
6388     Blob = class {
6389       constructor() {
6390         this[TYPE] = "";
6391         const blobParts = arguments[0];
6392         const options = arguments[1];
6393         const buffers = [];
6394         let size = 0;
6395         if (blobParts) {
6396           const a = blobParts;
6397           const length = Number(a.length);
6398           for (let i = 0; i < length; i++) {
6399             const element = a[i];
6400             let buffer;
6401             if (element instanceof Buffer) {
6402               buffer = element;
6403             } else if (ArrayBuffer.isView(element)) {
6404               buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
6405             } else if (element instanceof ArrayBuffer) {
6406               buffer = Buffer.from(element);
6407             } else if (element instanceof Blob) {
6408               buffer = element[BUFFER];
6409             } else {
6410               buffer = Buffer.from(typeof element === "string" ? element : String(element));
6411             }
6412             size += buffer.length;
6413             buffers.push(buffer);
6414           }
6415         }
6416         this[BUFFER] = Buffer.concat(buffers);
6417         let type = options && options.type !== void 0 && String(options.type).toLowerCase();
6418         if (type && !/[^\u0020-\u007E]/.test(type)) {
6419           this[TYPE] = type;
6420         }
6421       }
6422       get size() {
6423         return this[BUFFER].length;
6424       }
6425       get type() {
6426         return this[TYPE];
6427       }
6428       text() {
6429         return Promise.resolve(this[BUFFER].toString());
6430       }
6431       arrayBuffer() {
6432         const buf = this[BUFFER];
6433         const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
6434         return Promise.resolve(ab);
6435       }
6436       stream() {
6437         const readable = new Readable();
6438         readable._read = function() {
6439         };
6440         readable.push(this[BUFFER]);
6441         readable.push(null);
6442         return readable;
6443       }
6444       toString() {
6445         return "[object Blob]";
6446       }
6447       slice() {
6448         const size = this.size;
6449         const start = arguments[0];
6450         const end = arguments[1];
6451         let relativeStart, relativeEnd;
6452         if (start === void 0) {
6453           relativeStart = 0;
6454         } else if (start < 0) {
6455           relativeStart = Math.max(size + start, 0);
6456         } else {
6457           relativeStart = Math.min(start, size);
6458         }
6459         if (end === void 0) {
6460           relativeEnd = size;
6461         } else if (end < 0) {
6462           relativeEnd = Math.max(size + end, 0);
6463         } else {
6464           relativeEnd = Math.min(end, size);
6465         }
6466         const span = Math.max(relativeEnd - relativeStart, 0);
6467         const buffer = this[BUFFER];
6468         const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
6469         const blob = new Blob([], { type: arguments[2] });
6470         blob[BUFFER] = slicedBuffer;
6471         return blob;
6472       }
6473     };
6474     Object.defineProperties(Blob.prototype, {
6475       size: { enumerable: true },
6476       type: { enumerable: true },
6477       slice: { enumerable: true }
6478     });
6479     Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
6480       value: "Blob",
6481       writable: false,
6482       enumerable: false,
6483       configurable: true
6484     });
6485     FetchError.prototype = Object.create(Error.prototype);
6486     FetchError.prototype.constructor = FetchError;
6487     FetchError.prototype.name = "FetchError";
6488     try {
6489       convert = require("encoding").convert;
6490     } catch (e) {
6491     }
6492     INTERNALS = Symbol("Body internals");
6493     PassThrough = import_stream.default.PassThrough;
6494     Body.prototype = {
6495       get body() {
6496         return this[INTERNALS].body;
6497       },
6498       get bodyUsed() {
6499         return this[INTERNALS].disturbed;
6500       },
6501       arrayBuffer() {
6502         return consumeBody.call(this).then(function(buf) {
6503           return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
6504         });
6505       },
6506       blob() {
6507         let ct = this.headers && this.headers.get("content-type") || "";
6508         return consumeBody.call(this).then(function(buf) {
6509           return Object.assign(new Blob([], {
6510             type: ct.toLowerCase()
6511           }), {
6512             [BUFFER]: buf
6513           });
6514         });
6515       },
6516       json() {
6517         var _this2 = this;
6518         return consumeBody.call(this).then(function(buffer) {
6519           try {
6520             return JSON.parse(buffer.toString());
6521           } catch (err) {
6522             return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, "invalid-json"));
6523           }
6524         });
6525       },
6526       text() {
6527         return consumeBody.call(this).then(function(buffer) {
6528           return buffer.toString();
6529         });
6530       },
6531       buffer() {
6532         return consumeBody.call(this);
6533       },
6534       textConverted() {
6535         var _this3 = this;
6536         return consumeBody.call(this).then(function(buffer) {
6537           return convertBody(buffer, _this3.headers);
6538         });
6539       }
6540     };
6541     Object.defineProperties(Body.prototype, {
6542       body: { enumerable: true },
6543       bodyUsed: { enumerable: true },
6544       arrayBuffer: { enumerable: true },
6545       blob: { enumerable: true },
6546       json: { enumerable: true },
6547       text: { enumerable: true }
6548     });
6549     Body.mixIn = function(proto) {
6550       for (const name of Object.getOwnPropertyNames(Body.prototype)) {
6551         if (!(name in proto)) {
6552           const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
6553           Object.defineProperty(proto, name, desc);
6554         }
6555       }
6556     };
6557     Body.Promise = global.Promise;
6558     invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
6559     invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
6560     MAP = Symbol("map");
6561     Headers = class {
6562       constructor() {
6563         let init = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : void 0;
6564         this[MAP] = Object.create(null);
6565         if (init instanceof Headers) {
6566           const rawHeaders = init.raw();
6567           const headerNames = Object.keys(rawHeaders);
6568           for (const headerName of headerNames) {
6569             for (const value of rawHeaders[headerName]) {
6570               this.append(headerName, value);
6571             }
6572           }
6573           return;
6574         }
6575         if (init == null)
6576           ;
6577         else if (typeof init === "object") {
6578           const method = init[Symbol.iterator];
6579           if (method != null) {
6580             if (typeof method !== "function") {
6581               throw new TypeError("Header pairs must be iterable");
6582             }
6583             const pairs = [];
6584             for (const pair of init) {
6585               if (typeof pair !== "object" || typeof pair[Symbol.iterator] !== "function") {
6586                 throw new TypeError("Each header pair must be iterable");
6587               }
6588               pairs.push(Array.from(pair));
6589             }
6590             for (const pair of pairs) {
6591               if (pair.length !== 2) {
6592                 throw new TypeError("Each header pair must be a name/value tuple");
6593               }
6594               this.append(pair[0], pair[1]);
6595             }
6596           } else {
6597             for (const key of Object.keys(init)) {
6598               const value = init[key];
6599               this.append(key, value);
6600             }
6601           }
6602         } else {
6603           throw new TypeError("Provided initializer must be an object");
6604         }
6605       }
6606       get(name) {
6607         name = `${name}`;
6608         validateName(name);
6609         const key = find(this[MAP], name);
6610         if (key === void 0) {
6611           return null;
6612         }
6613         return this[MAP][key].join(", ");
6614       }
6615       forEach(callback) {
6616         let thisArg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : void 0;
6617         let pairs = getHeaders(this);
6618         let i = 0;
6619         while (i < pairs.length) {
6620           var _pairs$i = pairs[i];
6621           const name = _pairs$i[0], value = _pairs$i[1];
6622           callback.call(thisArg, value, name, this);
6623           pairs = getHeaders(this);
6624           i++;
6625         }
6626       }
6627       set(name, value) {
6628         name = `${name}`;
6629         value = `${value}`;
6630         validateName(name);
6631         validateValue(value);
6632         const key = find(this[MAP], name);
6633         this[MAP][key !== void 0 ? key : name] = [value];
6634       }
6635       append(name, value) {
6636         name = `${name}`;
6637         value = `${value}`;
6638         validateName(name);
6639         validateValue(value);
6640         const key = find(this[MAP], name);
6641         if (key !== void 0) {
6642           this[MAP][key].push(value);
6643         } else {
6644           this[MAP][name] = [value];
6645         }
6646       }
6647       has(name) {
6648         name = `${name}`;
6649         validateName(name);
6650         return find(this[MAP], name) !== void 0;
6651       }
6652       delete(name) {
6653         name = `${name}`;
6654         validateName(name);
6655         const key = find(this[MAP], name);
6656         if (key !== void 0) {
6657           delete this[MAP][key];
6658         }
6659       }
6660       raw() {
6661         return this[MAP];
6662       }
6663       keys() {
6664         return createHeadersIterator(this, "key");
6665       }
6666       values() {
6667         return createHeadersIterator(this, "value");
6668       }
6669       [Symbol.iterator]() {
6670         return createHeadersIterator(this, "key+value");
6671       }
6672     };
6673     Headers.prototype.entries = Headers.prototype[Symbol.iterator];
6674     Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
6675       value: "Headers",
6676       writable: false,
6677       enumerable: false,
6678       configurable: true
6679     });
6680     Object.defineProperties(Headers.prototype, {
6681       get: { enumerable: true },
6682       forEach: { enumerable: true },
6683       set: { enumerable: true },
6684       append: { enumerable: true },
6685       has: { enumerable: true },
6686       delete: { enumerable: true },
6687       keys: { enumerable: true },
6688       values: { enumerable: true },
6689       entries: { enumerable: true }
6690     });
6691     INTERNAL = Symbol("internal");
6692     HeadersIteratorPrototype = Object.setPrototypeOf({
6693       next() {
6694         if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
6695           throw new TypeError("Value of `this` is not a HeadersIterator");
6696         }
6697         var _INTERNAL = this[INTERNAL];
6698         const target = _INTERNAL.target, kind = _INTERNAL.kind, index = _INTERNAL.index;
6699         const values = getHeaders(target, kind);
6700         const len = values.length;
6701         if (index >= len) {
6702           return {
6703             value: void 0,
6704             done: true
6705           };
6706         }
6707         this[INTERNAL].index = index + 1;
6708         return {
6709           value: values[index],
6710           done: false
6711         };
6712       }
6713     }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
6714     Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
6715       value: "HeadersIterator",
6716       writable: false,
6717       enumerable: false,
6718       configurable: true
6719     });
6720     INTERNALS$1 = Symbol("Response internals");
6721     STATUS_CODES = import_http.default.STATUS_CODES;
6722     Response = class {
6723       constructor() {
6724         let body = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null;
6725         let opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
6726         Body.call(this, body, opts);
6727         const status = opts.status || 200;
6728         const headers = new Headers(opts.headers);
6729         if (body != null && !headers.has("Content-Type")) {
6730           const contentType = extractContentType(body);
6731           if (contentType) {
6732             headers.append("Content-Type", contentType);
6733           }
6734         }
6735         this[INTERNALS$1] = {
6736           url: opts.url,
6737           status,
6738           statusText: opts.statusText || STATUS_CODES[status],
6739           headers,
6740           counter: opts.counter
6741         };
6742       }
6743       get url() {
6744         return this[INTERNALS$1].url || "";
6745       }
6746       get status() {
6747         return this[INTERNALS$1].status;
6748       }
6749       get ok() {
6750         return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
6751       }
6752       get redirected() {
6753         return this[INTERNALS$1].counter > 0;
6754       }
6755       get statusText() {
6756         return this[INTERNALS$1].statusText;
6757       }
6758       get headers() {
6759         return this[INTERNALS$1].headers;
6760       }
6761       clone() {
6762         return new Response(clone(this), {
6763           url: this.url,
6764           status: this.status,
6765           statusText: this.statusText,
6766           headers: this.headers,
6767           ok: this.ok,
6768           redirected: this.redirected
6769         });
6770       }
6771     };
6772     Body.mixIn(Response.prototype);
6773     Object.defineProperties(Response.prototype, {
6774       url: { enumerable: true },
6775       status: { enumerable: true },
6776       ok: { enumerable: true },
6777       redirected: { enumerable: true },
6778       statusText: { enumerable: true },
6779       headers: { enumerable: true },
6780       clone: { enumerable: true }
6781     });
6782     Object.defineProperty(Response.prototype, Symbol.toStringTag, {
6783       value: "Response",
6784       writable: false,
6785       enumerable: false,
6786       configurable: true
6787     });
6788     INTERNALS$2 = Symbol("Request internals");
6789     parse_url = import_url.default.parse;
6790     format_url = import_url.default.format;
6791     streamDestructionSupported = "destroy" in import_stream.default.Readable.prototype;
6792     Request = class {
6793       constructor(input) {
6794         let init = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
6795         let parsedURL;
6796         if (!isRequest(input)) {
6797           if (input && input.href) {
6798             parsedURL = parse_url(input.href);
6799           } else {
6800             parsedURL = parse_url(`${input}`);
6801           }
6802           input = {};
6803         } else {
6804           parsedURL = parse_url(input.url);
6805         }
6806         let method = init.method || input.method || "GET";
6807         method = method.toUpperCase();
6808         if ((init.body != null || isRequest(input) && input.body !== null) && (method === "GET" || method === "HEAD")) {
6809           throw new TypeError("Request with GET/HEAD method cannot have body");
6810         }
6811         let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
6812         Body.call(this, inputBody, {
6813           timeout: init.timeout || input.timeout || 0,
6814           size: init.size || input.size || 0
6815         });
6816         const headers = new Headers(init.headers || input.headers || {});
6817         if (inputBody != null && !headers.has("Content-Type")) {
6818           const contentType = extractContentType(inputBody);
6819           if (contentType) {
6820             headers.append("Content-Type", contentType);
6821           }
6822         }
6823         let signal = isRequest(input) ? input.signal : null;
6824         if ("signal" in init)
6825           signal = init.signal;
6826         if (signal != null && !isAbortSignal(signal)) {
6827           throw new TypeError("Expected signal to be an instanceof AbortSignal");
6828         }
6829         this[INTERNALS$2] = {
6830           method,
6831           redirect: init.redirect || input.redirect || "follow",
6832           headers,
6833           parsedURL,
6834           signal
6835         };
6836         this.follow = init.follow !== void 0 ? init.follow : input.follow !== void 0 ? input.follow : 20;
6837         this.compress = init.compress !== void 0 ? init.compress : input.compress !== void 0 ? input.compress : true;
6838         this.counter = init.counter || input.counter || 0;
6839         this.agent = init.agent || input.agent;
6840       }
6841       get method() {
6842         return this[INTERNALS$2].method;
6843       }
6844       get url() {
6845         return format_url(this[INTERNALS$2].parsedURL);
6846       }
6847       get headers() {
6848         return this[INTERNALS$2].headers;
6849       }
6850       get redirect() {
6851         return this[INTERNALS$2].redirect;
6852       }
6853       get signal() {
6854         return this[INTERNALS$2].signal;
6855       }
6856       clone() {
6857         return new Request(this);
6858       }
6859     };
6860     Body.mixIn(Request.prototype);
6861     Object.defineProperty(Request.prototype, Symbol.toStringTag, {
6862       value: "Request",
6863       writable: false,
6864       enumerable: false,
6865       configurable: true
6866     });
6867     Object.defineProperties(Request.prototype, {
6868       method: { enumerable: true },
6869       url: { enumerable: true },
6870       headers: { enumerable: true },
6871       redirect: { enumerable: true },
6872       clone: { enumerable: true },
6873       signal: { enumerable: true }
6874     });
6875     AbortError.prototype = Object.create(Error.prototype);
6876     AbortError.prototype.constructor = AbortError;
6877     AbortError.prototype.name = "AbortError";
6878     PassThrough$1 = import_stream.default.PassThrough;
6879     resolve_url = import_url.default.resolve;
6880     fetch.isRedirect = function(code) {
6881       return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
6882     };
6883     fetch.Promise = global.Promise;
6884     lib_default = fetch;
6885   }
6886 });
6887
6888 // node_modules/picomatch/lib/constants.js
6889 var require_constants = __commonJS({
6890   "node_modules/picomatch/lib/constants.js"(exports2, module2) {
6891     "use strict";
6892     var path2 = require("path");
6893     var WIN_SLASH = "\\\\/";
6894     var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
6895     var DOT_LITERAL = "\\.";
6896     var PLUS_LITERAL = "\\+";
6897     var QMARK_LITERAL = "\\?";
6898     var SLASH_LITERAL = "\\/";
6899     var ONE_CHAR = "(?=.)";
6900     var QMARK = "[^/]";
6901     var END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
6902     var START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
6903     var DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
6904     var NO_DOT = `(?!${DOT_LITERAL})`;
6905     var NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
6906     var NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
6907     var NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
6908     var QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
6909     var STAR = `${QMARK}*?`;
6910     var POSIX_CHARS = {
6911       DOT_LITERAL,
6912       PLUS_LITERAL,
6913       QMARK_LITERAL,
6914       SLASH_LITERAL,
6915       ONE_CHAR,
6916       QMARK,
6917       END_ANCHOR,
6918       DOTS_SLASH,
6919       NO_DOT,
6920       NO_DOTS,
6921       NO_DOT_SLASH,
6922       NO_DOTS_SLASH,
6923       QMARK_NO_DOT,
6924       STAR,
6925       START_ANCHOR
6926     };
6927     var WINDOWS_CHARS = __spreadProps(__spreadValues({}, POSIX_CHARS), {
6928       SLASH_LITERAL: `[${WIN_SLASH}]`,
6929       QMARK: WIN_NO_SLASH,
6930       STAR: `${WIN_NO_SLASH}*?`,
6931       DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
6932       NO_DOT: `(?!${DOT_LITERAL})`,
6933       NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
6934       NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
6935       NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
6936       QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
6937       START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
6938       END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
6939     });
6940     var POSIX_REGEX_SOURCE = {
6941       alnum: "a-zA-Z0-9",
6942       alpha: "a-zA-Z",
6943       ascii: "\\x00-\\x7F",
6944       blank: " \\t",
6945       cntrl: "\\x00-\\x1F\\x7F",
6946       digit: "0-9",
6947       graph: "\\x21-\\x7E",
6948       lower: "a-z",
6949       print: "\\x20-\\x7E ",
6950       punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
6951       space: " \\t\\r\\n\\v\\f",
6952       upper: "A-Z",
6953       word: "A-Za-z0-9_",
6954       xdigit: "A-Fa-f0-9"
6955     };
6956     module2.exports = {
6957       MAX_LENGTH: 1024 * 64,
6958       POSIX_REGEX_SOURCE,
6959       REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
6960       REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
6961       REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
6962       REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
6963       REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
6964       REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
6965       REPLACEMENTS: {
6966         "***": "*",
6967         "**/**": "**",
6968         "**/**/**": "**"
6969       },
6970       CHAR_0: 48,
6971       CHAR_9: 57,
6972       CHAR_UPPERCASE_A: 65,
6973       CHAR_LOWERCASE_A: 97,
6974       CHAR_UPPERCASE_Z: 90,
6975       CHAR_LOWERCASE_Z: 122,
6976       CHAR_LEFT_PARENTHESES: 40,
6977       CHAR_RIGHT_PARENTHESES: 41,
6978       CHAR_ASTERISK: 42,
6979       CHAR_AMPERSAND: 38,
6980       CHAR_AT: 64,
6981       CHAR_BACKWARD_SLASH: 92,
6982       CHAR_CARRIAGE_RETURN: 13,
6983       CHAR_CIRCUMFLEX_ACCENT: 94,
6984       CHAR_COLON: 58,
6985       CHAR_COMMA: 44,
6986       CHAR_DOT: 46,
6987       CHAR_DOUBLE_QUOTE: 34,
6988       CHAR_EQUAL: 61,
6989       CHAR_EXCLAMATION_MARK: 33,
6990       CHAR_FORM_FEED: 12,
6991       CHAR_FORWARD_SLASH: 47,
6992       CHAR_GRAVE_ACCENT: 96,
6993       CHAR_HASH: 35,
6994       CHAR_HYPHEN_MINUS: 45,
6995       CHAR_LEFT_ANGLE_BRACKET: 60,
6996       CHAR_LEFT_CURLY_BRACE: 123,
6997       CHAR_LEFT_SQUARE_BRACKET: 91,
6998       CHAR_LINE_FEED: 10,
6999       CHAR_NO_BREAK_SPACE: 160,
7000       CHAR_PERCENT: 37,
7001       CHAR_PLUS: 43,
7002       CHAR_QUESTION_MARK: 63,
7003       CHAR_RIGHT_ANGLE_BRACKET: 62,
7004       CHAR_RIGHT_CURLY_BRACE: 125,
7005       CHAR_RIGHT_SQUARE_BRACKET: 93,
7006       CHAR_SEMICOLON: 59,
7007       CHAR_SINGLE_QUOTE: 39,
7008       CHAR_SPACE: 32,
7009       CHAR_TAB: 9,
7010       CHAR_UNDERSCORE: 95,
7011       CHAR_VERTICAL_LINE: 124,
7012       CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
7013       SEP: path2.sep,
7014       extglobChars(chars) {
7015         return {
7016           "!": { type: "negate", open: "(?:(?!(?:", close: `))${chars.STAR})` },
7017           "?": { type: "qmark", open: "(?:", close: ")?" },
7018           "+": { type: "plus", open: "(?:", close: ")+" },
7019           "*": { type: "star", open: "(?:", close: ")*" },
7020           "@": { type: "at", open: "(?:", close: ")" }
7021         };
7022       },
7023       globChars(win32) {
7024         return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
7025       }
7026     };
7027   }
7028 });
7029
7030 // node_modules/picomatch/lib/utils.js
7031 var require_utils = __commonJS({
7032   "node_modules/picomatch/lib/utils.js"(exports2) {
7033     "use strict";
7034     var path2 = require("path");
7035     var win32 = process.platform === "win32";
7036     var {
7037       REGEX_BACKSLASH,
7038       REGEX_REMOVE_BACKSLASH,
7039       REGEX_SPECIAL_CHARS,
7040       REGEX_SPECIAL_CHARS_GLOBAL
7041     } = require_constants();
7042     exports2.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
7043     exports2.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
7044     exports2.isRegexChar = (str) => str.length === 1 && exports2.hasRegexChars(str);
7045     exports2.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
7046     exports2.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
7047     exports2.removeBackslashes = (str) => {
7048       return str.replace(REGEX_REMOVE_BACKSLASH, (match) => {
7049         return match === "\\" ? "" : match;
7050       });
7051     };
7052     exports2.supportsLookbehinds = () => {
7053       const segs = process.version.slice(1).split(".").map(Number);
7054       if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) {
7055         return true;
7056       }
7057       return false;
7058     };
7059     exports2.isWindows = (options) => {
7060       if (options && typeof options.windows === "boolean") {
7061         return options.windows;
7062       }
7063       return win32 === true || path2.sep === "\\";
7064     };
7065     exports2.escapeLast = (input, char, lastIdx) => {
7066       const idx = input.lastIndexOf(char, lastIdx);
7067       if (idx === -1)
7068         return input;
7069       if (input[idx - 1] === "\\")
7070         return exports2.escapeLast(input, char, idx - 1);
7071       return `${input.slice(0, idx)}\\${input.slice(idx)}`;
7072     };
7073     exports2.removePrefix = (input, state = {}) => {
7074       let output = input;
7075       if (output.startsWith("./")) {
7076         output = output.slice(2);
7077         state.prefix = "./";
7078       }
7079       return output;
7080     };
7081     exports2.wrapOutput = (input, state = {}, options = {}) => {
7082       const prepend = options.contains ? "" : "^";
7083       const append = options.contains ? "" : "$";
7084       let output = `${prepend}(?:${input})${append}`;
7085       if (state.negated === true) {
7086         output = `(?:^(?!${output}).*$)`;
7087       }
7088       return output;
7089     };
7090   }
7091 });
7092
7093 // node_modules/picomatch/lib/scan.js
7094 var require_scan = __commonJS({
7095   "node_modules/picomatch/lib/scan.js"(exports2, module2) {
7096     "use strict";
7097     var utils = require_utils();
7098     var {
7099       CHAR_ASTERISK,
7100       CHAR_AT,
7101       CHAR_BACKWARD_SLASH,
7102       CHAR_COMMA,
7103       CHAR_DOT,
7104       CHAR_EXCLAMATION_MARK,
7105       CHAR_FORWARD_SLASH,
7106       CHAR_LEFT_CURLY_BRACE,
7107       CHAR_LEFT_PARENTHESES,
7108       CHAR_LEFT_SQUARE_BRACKET,
7109       CHAR_PLUS,
7110       CHAR_QUESTION_MARK,
7111       CHAR_RIGHT_CURLY_BRACE,
7112       CHAR_RIGHT_PARENTHESES,
7113       CHAR_RIGHT_SQUARE_BRACKET
7114     } = require_constants();
7115     var isPathSeparator = (code) => {
7116       return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
7117     };
7118     var depth = (token) => {
7119       if (token.isPrefix !== true) {
7120         token.depth = token.isGlobstar ? Infinity : 1;
7121       }
7122     };
7123     var scan = (input, options) => {
7124       const opts = options || {};
7125       const length = input.length - 1;
7126       const scanToEnd = opts.parts === true || opts.scanToEnd === true;
7127       const slashes = [];
7128       const tokens = [];
7129       const parts = [];
7130       let str = input;
7131       let index = -1;
7132       let start = 0;
7133       let lastIndex = 0;
7134       let isBrace = false;
7135       let isBracket = false;
7136       let isGlob = false;
7137       let isExtglob = false;
7138       let isGlobstar = false;
7139       let braceEscaped = false;
7140       let backslashes = false;
7141       let negated = false;
7142       let negatedExtglob = false;
7143       let finished = false;
7144       let braces = 0;
7145       let prev;
7146       let code;
7147       let token = { value: "", depth: 0, isGlob: false };
7148       const eos = () => index >= length;
7149       const peek = () => str.charCodeAt(index + 1);
7150       const advance = () => {
7151         prev = code;
7152         return str.charCodeAt(++index);
7153       };
7154       while (index < length) {
7155         code = advance();
7156         let next;
7157         if (code === CHAR_BACKWARD_SLASH) {
7158           backslashes = token.backslashes = true;
7159           code = advance();
7160           if (code === CHAR_LEFT_CURLY_BRACE) {
7161             braceEscaped = true;
7162           }
7163           continue;
7164         }
7165         if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
7166           braces++;
7167           while (eos() !== true && (code = advance())) {
7168             if (code === CHAR_BACKWARD_SLASH) {
7169               backslashes = token.backslashes = true;
7170               advance();
7171               continue;
7172             }
7173             if (code === CHAR_LEFT_CURLY_BRACE) {
7174               braces++;
7175               continue;
7176             }
7177             if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
7178               isBrace = token.isBrace = true;
7179               isGlob = token.isGlob = true;
7180               finished = true;
7181               if (scanToEnd === true) {
7182                 continue;
7183               }
7184               break;
7185             }
7186             if (braceEscaped !== true && code === CHAR_COMMA) {
7187               isBrace = token.isBrace = true;
7188               isGlob = token.isGlob = true;
7189               finished = true;
7190               if (scanToEnd === true) {
7191                 continue;
7192               }
7193               break;
7194             }
7195             if (code === CHAR_RIGHT_CURLY_BRACE) {
7196               braces--;
7197               if (braces === 0) {
7198                 braceEscaped = false;
7199                 isBrace = token.isBrace = true;
7200                 finished = true;
7201                 break;
7202               }
7203             }
7204           }
7205           if (scanToEnd === true) {
7206             continue;
7207           }
7208           break;
7209         }
7210         if (code === CHAR_FORWARD_SLASH) {
7211           slashes.push(index);
7212           tokens.push(token);
7213           token = { value: "", depth: 0, isGlob: false };
7214           if (finished === true)
7215             continue;
7216           if (prev === CHAR_DOT && index === start + 1) {
7217             start += 2;
7218             continue;
7219           }
7220           lastIndex = index + 1;
7221           continue;
7222         }
7223         if (opts.noext !== true) {
7224           const isExtglobChar = code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK;
7225           if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
7226             isGlob = token.isGlob = true;
7227             isExtglob = token.isExtglob = true;
7228             finished = true;
7229             if (code === CHAR_EXCLAMATION_MARK && index === start) {
7230               negatedExtglob = true;
7231             }
7232             if (scanToEnd === true) {
7233               while (eos() !== true && (code = advance())) {
7234                 if (code === CHAR_BACKWARD_SLASH) {
7235                   backslashes = token.backslashes = true;
7236                   code = advance();
7237                   continue;
7238                 }
7239                 if (code === CHAR_RIGHT_PARENTHESES) {
7240                   isGlob = token.isGlob = true;
7241                   finished = true;
7242                   break;
7243                 }
7244               }
7245               continue;
7246             }
7247             break;
7248           }
7249         }
7250         if (code === CHAR_ASTERISK) {
7251           if (prev === CHAR_ASTERISK)
7252             isGlobstar = token.isGlobstar = true;
7253           isGlob = token.isGlob = true;
7254           finished = true;
7255           if (scanToEnd === true) {
7256             continue;
7257           }
7258           break;
7259         }
7260         if (code === CHAR_QUESTION_MARK) {
7261           isGlob = token.isGlob = true;
7262           finished = true;
7263           if (scanToEnd === true) {
7264             continue;
7265           }
7266           break;
7267         }
7268         if (code === CHAR_LEFT_SQUARE_BRACKET) {
7269           while (eos() !== true && (next = advance())) {
7270             if (next === CHAR_BACKWARD_SLASH) {
7271               backslashes = token.backslashes = true;
7272               advance();
7273               continue;
7274             }
7275             if (next === CHAR_RIGHT_SQUARE_BRACKET) {
7276               isBracket = token.isBracket = true;
7277               isGlob = token.isGlob = true;
7278               finished = true;
7279               break;
7280             }
7281           }
7282           if (scanToEnd === true) {
7283             continue;
7284           }
7285           break;
7286         }
7287         if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
7288           negated = token.negated = true;
7289           start++;
7290           continue;
7291         }
7292         if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
7293           isGlob = token.isGlob = true;
7294           if (scanToEnd === true) {
7295             while (eos() !== true && (code = advance())) {
7296               if (code === CHAR_LEFT_PARENTHESES) {
7297                 backslashes = token.backslashes = true;
7298                 code = advance();
7299                 continue;
7300               }
7301               if (code === CHAR_RIGHT_PARENTHESES) {
7302                 finished = true;
7303                 break;
7304               }
7305             }
7306             continue;
7307           }
7308           break;
7309         }
7310         if (isGlob === true) {
7311           finished = true;
7312           if (scanToEnd === true) {
7313             continue;
7314           }
7315           break;
7316         }
7317       }
7318       if (opts.noext === true) {
7319         isExtglob = false;
7320         isGlob = false;
7321       }
7322       let base = str;
7323       let prefix = "";
7324       let glob = "";
7325       if (start > 0) {
7326         prefix = str.slice(0, start);
7327         str = str.slice(start);
7328         lastIndex -= start;
7329       }
7330       if (base && isGlob === true && lastIndex > 0) {
7331         base = str.slice(0, lastIndex);
7332         glob = str.slice(lastIndex);
7333       } else if (isGlob === true) {
7334         base = "";
7335         glob = str;
7336       } else {
7337         base = str;
7338       }
7339       if (base && base !== "" && base !== "/" && base !== str) {
7340         if (isPathSeparator(base.charCodeAt(base.length - 1))) {
7341           base = base.slice(0, -1);
7342         }
7343       }
7344       if (opts.unescape === true) {
7345         if (glob)
7346           glob = utils.removeBackslashes(glob);
7347         if (base && backslashes === true) {
7348           base = utils.removeBackslashes(base);
7349         }
7350       }
7351       const state = {
7352         prefix,
7353         input,
7354         start,
7355         base,
7356         glob,
7357         isBrace,
7358         isBracket,
7359         isGlob,
7360         isExtglob,
7361         isGlobstar,
7362         negated,
7363         negatedExtglob
7364       };
7365       if (opts.tokens === true) {
7366         state.maxDepth = 0;
7367         if (!isPathSeparator(code)) {
7368           tokens.push(token);
7369         }
7370         state.tokens = tokens;
7371       }
7372       if (opts.parts === true || opts.tokens === true) {
7373         let prevIndex;
7374         for (let idx = 0; idx < slashes.length; idx++) {
7375           const n = prevIndex ? prevIndex + 1 : start;
7376           const i = slashes[idx];
7377           const value = input.slice(n, i);
7378           if (opts.tokens) {
7379             if (idx === 0 && start !== 0) {
7380               tokens[idx].isPrefix = true;
7381               tokens[idx].value = prefix;
7382             } else {
7383               tokens[idx].value = value;
7384             }
7385             depth(tokens[idx]);
7386             state.maxDepth += tokens[idx].depth;
7387           }
7388           if (idx !== 0 || value !== "") {
7389             parts.push(value);
7390           }
7391           prevIndex = i;
7392         }
7393         if (prevIndex && prevIndex + 1 < input.length) {
7394           const value = input.slice(prevIndex + 1);
7395           parts.push(value);
7396           if (opts.tokens) {
7397             tokens[tokens.length - 1].value = value;
7398             depth(tokens[tokens.length - 1]);
7399             state.maxDepth += tokens[tokens.length - 1].depth;
7400           }
7401         }
7402         state.slashes = slashes;
7403         state.parts = parts;
7404       }
7405       return state;
7406     };
7407     module2.exports = scan;
7408   }
7409 });
7410
7411 // node_modules/picomatch/lib/parse.js
7412 var require_parse = __commonJS({
7413   "node_modules/picomatch/lib/parse.js"(exports2, module2) {
7414     "use strict";
7415     var constants = require_constants();
7416     var utils = require_utils();
7417     var {
7418       MAX_LENGTH,
7419       POSIX_REGEX_SOURCE,
7420       REGEX_NON_SPECIAL_CHARS,
7421       REGEX_SPECIAL_CHARS_BACKREF,
7422       REPLACEMENTS
7423     } = constants;
7424     var expandRange = (args, options) => {
7425       if (typeof options.expandRange === "function") {
7426         return options.expandRange(...args, options);
7427       }
7428       args.sort();
7429       const value = `[${args.join("-")}]`;
7430       try {
7431         new RegExp(value);
7432       } catch (ex) {
7433         return args.map((v) => utils.escapeRegex(v)).join("..");
7434       }
7435       return value;
7436     };
7437     var syntaxError = (type, char) => {
7438       return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
7439     };
7440     var parse = (input, options) => {
7441       if (typeof input !== "string") {
7442         throw new TypeError("Expected a string");
7443       }
7444       input = REPLACEMENTS[input] || input;
7445       const opts = __spreadValues({}, options);
7446       const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
7447       let len = input.length;
7448       if (len > max) {
7449         throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
7450       }
7451       const bos = { type: "bos", value: "", output: opts.prepend || "" };
7452       const tokens = [bos];
7453       const capture = opts.capture ? "" : "?:";
7454       const win32 = utils.isWindows(options);
7455       const PLATFORM_CHARS = constants.globChars(win32);
7456       const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
7457       const {
7458         DOT_LITERAL,
7459         PLUS_LITERAL,
7460         SLASH_LITERAL,
7461         ONE_CHAR,
7462         DOTS_SLASH,
7463         NO_DOT,
7464         NO_DOT_SLASH,
7465         NO_DOTS_SLASH,
7466         QMARK,
7467         QMARK_NO_DOT,
7468         STAR,
7469         START_ANCHOR
7470       } = PLATFORM_CHARS;
7471       const globstar = (opts2) => {
7472         return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
7473       };
7474       const nodot = opts.dot ? "" : NO_DOT;
7475       const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
7476       let star = opts.bash === true ? globstar(opts) : STAR;
7477       if (opts.capture) {
7478         star = `(${star})`;
7479       }
7480       if (typeof opts.noext === "boolean") {
7481         opts.noextglob = opts.noext;
7482       }
7483       const state = {
7484         input,
7485         index: -1,
7486         start: 0,
7487         dot: opts.dot === true,
7488         consumed: "",
7489         output: "",
7490         prefix: "",
7491         backtrack: false,
7492         negated: false,
7493         brackets: 0,
7494         braces: 0,
7495         parens: 0,
7496         quotes: 0,
7497         globstar: false,
7498         tokens
7499       };
7500       input = utils.removePrefix(input, state);
7501       len = input.length;
7502       const extglobs = [];
7503       const braces = [];
7504       const stack = [];
7505       let prev = bos;
7506       let value;
7507       const eos = () => state.index === len - 1;
7508       const peek = state.peek = (n = 1) => input[state.index + n];
7509       const advance = state.advance = () => input[++state.index] || "";
7510       const remaining = () => input.slice(state.index + 1);
7511       const consume = (value2 = "", num = 0) => {
7512         state.consumed += value2;
7513         state.index += num;
7514       };
7515       const append = (token) => {
7516         state.output += token.output != null ? token.output : token.value;
7517         consume(token.value);
7518       };
7519       const negate = () => {
7520         let count = 1;
7521         while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) {
7522           advance();
7523           state.start++;
7524           count++;
7525         }
7526         if (count % 2 === 0) {
7527           return false;
7528         }
7529         state.negated = true;
7530         state.start++;
7531         return true;
7532       };
7533       const increment = (type) => {
7534         state[type]++;
7535         stack.push(type);
7536       };
7537       const decrement = (type) => {
7538         state[type]--;
7539         stack.pop();
7540       };
7541       const push = (tok) => {
7542         if (prev.type === "globstar") {
7543           const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace");
7544           const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
7545           if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) {
7546             state.output = state.output.slice(0, -prev.output.length);
7547             prev.type = "star";
7548             prev.value = "*";
7549             prev.output = star;
7550             state.output += prev.output;
7551           }
7552         }
7553         if (extglobs.length && tok.type !== "paren") {
7554           extglobs[extglobs.length - 1].inner += tok.value;
7555         }
7556         if (tok.value || tok.output)
7557           append(tok);
7558         if (prev && prev.type === "text" && tok.type === "text") {
7559           prev.value += tok.value;
7560           prev.output = (prev.output || "") + tok.value;
7561           return;
7562         }
7563         tok.prev = prev;
7564         tokens.push(tok);
7565         prev = tok;
7566       };
7567       const extglobOpen = (type, value2) => {
7568         const token = __spreadProps(__spreadValues({}, EXTGLOB_CHARS[value2]), { conditions: 1, inner: "" });
7569         token.prev = prev;
7570         token.parens = state.parens;
7571         token.output = state.output;
7572         const output = (opts.capture ? "(" : "") + token.open;
7573         increment("parens");
7574         push({ type, value: value2, output: state.output ? "" : ONE_CHAR });
7575         push({ type: "paren", extglob: true, value: advance(), output });
7576         extglobs.push(token);
7577       };
7578       const extglobClose = (token) => {
7579         let output = token.close + (opts.capture ? ")" : "");
7580         let rest;
7581         if (token.type === "negate") {
7582           let extglobStar = star;
7583           if (token.inner && token.inner.length > 1 && token.inner.includes("/")) {
7584             extglobStar = globstar(opts);
7585           }
7586           if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
7587             output = token.close = `)$))${extglobStar}`;
7588           }
7589           if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
7590             output = token.close = `)${rest})${extglobStar})`;
7591           }
7592           if (token.prev.type === "bos") {
7593             state.negatedExtglob = true;
7594           }
7595         }
7596         push({ type: "paren", extglob: true, value, output });
7597         decrement("parens");
7598       };
7599       if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
7600         let backslashes = false;
7601         let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
7602           if (first === "\\") {
7603             backslashes = true;
7604             return m;
7605           }
7606           if (first === "?") {
7607             if (esc) {
7608               return esc + first + (rest ? QMARK.repeat(rest.length) : "");
7609             }
7610             if (index === 0) {
7611               return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
7612             }
7613             return QMARK.repeat(chars.length);
7614           }
7615           if (first === ".") {
7616             return DOT_LITERAL.repeat(chars.length);
7617           }
7618           if (first === "*") {
7619             if (esc) {
7620               return esc + first + (rest ? star : "");
7621             }
7622             return star;
7623           }
7624           return esc ? m : `\\${m}`;
7625         });
7626         if (backslashes === true) {
7627           if (opts.unescape === true) {
7628             output = output.replace(/\\/g, "");
7629           } else {
7630             output = output.replace(/\\+/g, (m) => {
7631               return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
7632             });
7633           }
7634         }
7635         if (output === input && opts.contains === true) {
7636           state.output = input;
7637           return state;
7638         }
7639         state.output = utils.wrapOutput(output, state, options);
7640         return state;
7641       }
7642       while (!eos()) {
7643         value = advance();
7644         if (value === "\0") {
7645           continue;
7646         }
7647         if (value === "\\") {
7648           const next = peek();
7649           if (next === "/" && opts.bash !== true) {
7650             continue;
7651           }
7652           if (next === "." || next === ";") {
7653             continue;
7654           }
7655           if (!next) {
7656             value += "\\";
7657             push({ type: "text", value });
7658             continue;
7659           }
7660           const match = /^\\+/.exec(remaining());
7661           let slashes = 0;
7662           if (match && match[0].length > 2) {
7663             slashes = match[0].length;
7664             state.index += slashes;
7665             if (slashes % 2 !== 0) {
7666               value += "\\";
7667             }
7668           }
7669           if (opts.unescape === true) {
7670             value = advance();
7671           } else {
7672             value += advance();
7673           }
7674           if (state.brackets === 0) {
7675             push({ type: "text", value });
7676             continue;
7677           }
7678         }
7679         if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
7680           if (opts.posix !== false && value === ":") {
7681             const inner = prev.value.slice(1);
7682             if (inner.includes("[")) {
7683               prev.posix = true;
7684               if (inner.includes(":")) {
7685                 const idx = prev.value.lastIndexOf("[");
7686                 const pre = prev.value.slice(0, idx);
7687                 const rest2 = prev.value.slice(idx + 2);
7688                 const posix = POSIX_REGEX_SOURCE[rest2];
7689                 if (posix) {
7690                   prev.value = pre + posix;
7691                   state.backtrack = true;
7692                   advance();
7693                   if (!bos.output && tokens.indexOf(prev) === 1) {
7694                     bos.output = ONE_CHAR;
7695                   }
7696                   continue;
7697                 }
7698               }
7699             }
7700           }
7701           if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") {
7702             value = `\\${value}`;
7703           }
7704           if (value === "]" && (prev.value === "[" || prev.value === "[^")) {
7705             value = `\\${value}`;
7706           }
7707           if (opts.posix === true && value === "!" && prev.value === "[") {
7708             value = "^";
7709           }
7710           prev.value += value;
7711           append({ value });
7712           continue;
7713         }
7714         if (state.quotes === 1 && value !== '"') {
7715           value = utils.escapeRegex(value);
7716           prev.value += value;
7717           append({ value });
7718           continue;
7719         }
7720         if (value === '"') {
7721           state.quotes = state.quotes === 1 ? 0 : 1;
7722           if (opts.keepQuotes === true) {
7723             push({ type: "text", value });
7724           }
7725           continue;
7726         }
7727         if (value === "(") {
7728           increment("parens");
7729           push({ type: "paren", value });
7730           continue;
7731         }
7732         if (value === ")") {
7733           if (state.parens === 0 && opts.strictBrackets === true) {
7734             throw new SyntaxError(syntaxError("opening", "("));
7735           }
7736           const extglob = extglobs[extglobs.length - 1];
7737           if (extglob && state.parens === extglob.parens + 1) {
7738             extglobClose(extglobs.pop());
7739             continue;
7740           }
7741           push({ type: "paren", value, output: state.parens ? ")" : "\\)" });
7742           decrement("parens");
7743           continue;
7744         }
7745         if (value === "[") {
7746           if (opts.nobracket === true || !remaining().includes("]")) {
7747             if (opts.nobracket !== true && opts.strictBrackets === true) {
7748               throw new SyntaxError(syntaxError("closing", "]"));
7749             }
7750             value = `\\${value}`;
7751           } else {
7752             increment("brackets");
7753           }
7754           push({ type: "bracket", value });
7755           continue;
7756         }
7757         if (value === "]") {
7758           if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
7759             push({ type: "text", value, output: `\\${value}` });
7760             continue;
7761           }
7762           if (state.brackets === 0) {
7763             if (opts.strictBrackets === true) {
7764               throw new SyntaxError(syntaxError("opening", "["));
7765             }
7766             push({ type: "text", value, output: `\\${value}` });
7767             continue;
7768           }
7769           decrement("brackets");
7770           const prevValue = prev.value.slice(1);
7771           if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) {
7772             value = `/${value}`;
7773           }
7774           prev.value += value;
7775           append({ value });
7776           if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
7777             continue;
7778           }
7779           const escaped = utils.escapeRegex(prev.value);
7780           state.output = state.output.slice(0, -prev.value.length);
7781           if (opts.literalBrackets === true) {
7782             state.output += escaped;
7783             prev.value = escaped;
7784             continue;
7785           }
7786           prev.value = `(${capture}${escaped}|${prev.value})`;
7787           state.output += prev.value;
7788           continue;
7789         }
7790         if (value === "{" && opts.nobrace !== true) {
7791           increment("braces");
7792           const open = {
7793             type: "brace",
7794             value,
7795             output: "(",
7796             outputIndex: state.output.length,
7797             tokensIndex: state.tokens.length
7798           };
7799           braces.push(open);
7800           push(open);
7801           continue;
7802         }
7803         if (value === "}") {
7804           const brace = braces[braces.length - 1];
7805           if (opts.nobrace === true || !brace) {
7806             push({ type: "text", value, output: value });
7807             continue;
7808           }
7809           let output = ")";
7810           if (brace.dots === true) {
7811             const arr = tokens.slice();
7812             const range = [];
7813             for (let i = arr.length - 1; i >= 0; i--) {
7814               tokens.pop();
7815               if (arr[i].type === "brace") {
7816                 break;
7817               }
7818               if (arr[i].type !== "dots") {
7819                 range.unshift(arr[i].value);
7820               }
7821             }
7822             output = expandRange(range, opts);
7823             state.backtrack = true;
7824           }
7825           if (brace.comma !== true && brace.dots !== true) {
7826             const out = state.output.slice(0, brace.outputIndex);
7827             const toks = state.tokens.slice(brace.tokensIndex);
7828             brace.value = brace.output = "\\{";
7829             value = output = "\\}";
7830             state.output = out;
7831             for (const t of toks) {
7832               state.output += t.output || t.value;
7833             }
7834           }
7835           push({ type: "brace", value, output });
7836           decrement("braces");
7837           braces.pop();
7838           continue;
7839         }
7840         if (value === "|") {
7841           if (extglobs.length > 0) {
7842             extglobs[extglobs.length - 1].conditions++;
7843           }
7844           push({ type: "text", value });
7845           continue;
7846         }
7847         if (value === ",") {
7848           let output = value;
7849           const brace = braces[braces.length - 1];
7850           if (brace && stack[stack.length - 1] === "braces") {
7851             brace.comma = true;
7852             output = "|";
7853           }
7854           push({ type: "comma", value, output });
7855           continue;
7856         }
7857         if (value === "/") {
7858           if (prev.type === "dot" && state.index === state.start + 1) {
7859             state.start = state.index + 1;
7860             state.consumed = "";
7861             state.output = "";
7862             tokens.pop();
7863             prev = bos;
7864             continue;
7865           }
7866           push({ type: "slash", value, output: SLASH_LITERAL });
7867           continue;
7868         }
7869         if (value === ".") {
7870           if (state.braces > 0 && prev.type === "dot") {
7871             if (prev.value === ".")
7872               prev.output = DOT_LITERAL;
7873             const brace = braces[braces.length - 1];
7874             prev.type = "dots";
7875             prev.output += value;
7876             prev.value += value;
7877             brace.dots = true;
7878             continue;
7879           }
7880           if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
7881             push({ type: "text", value, output: DOT_LITERAL });
7882             continue;
7883           }
7884           push({ type: "dot", value, output: DOT_LITERAL });
7885           continue;
7886         }
7887         if (value === "?") {
7888           const isGroup = prev && prev.value === "(";
7889           if (!isGroup && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
7890             extglobOpen("qmark", value);
7891             continue;
7892           }
7893           if (prev && prev.type === "paren") {
7894             const next = peek();
7895             let output = value;
7896             if (next === "<" && !utils.supportsLookbehinds()) {
7897               throw new Error("Node.js v10 or higher is required for regex lookbehinds");
7898             }
7899             if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) {
7900               output = `\\${value}`;
7901             }
7902             push({ type: "text", value, output });
7903             continue;
7904           }
7905           if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) {
7906             push({ type: "qmark", value, output: QMARK_NO_DOT });
7907             continue;
7908           }
7909           push({ type: "qmark", value, output: QMARK });
7910           continue;
7911         }
7912         if (value === "!") {
7913           if (opts.noextglob !== true && peek() === "(") {
7914             if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) {
7915               extglobOpen("negate", value);
7916               continue;
7917             }
7918           }
7919           if (opts.nonegate !== true && state.index === 0) {
7920             negate();
7921             continue;
7922           }
7923         }
7924         if (value === "+") {
7925           if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
7926             extglobOpen("plus", value);
7927             continue;
7928           }
7929           if (prev && prev.value === "(" || opts.regex === false) {
7930             push({ type: "plus", value, output: PLUS_LITERAL });
7931             continue;
7932           }
7933           if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
7934             push({ type: "plus", value });
7935             continue;
7936           }
7937           push({ type: "plus", value: PLUS_LITERAL });
7938           continue;
7939         }
7940         if (value === "@") {
7941           if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
7942             push({ type: "at", extglob: true, value, output: "" });
7943             continue;
7944           }
7945           push({ type: "text", value });
7946           continue;
7947         }
7948         if (value !== "*") {
7949           if (value === "$" || value === "^") {
7950             value = `\\${value}`;
7951           }
7952           const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
7953           if (match) {
7954             value += match[0];
7955             state.index += match[0].length;
7956           }
7957           push({ type: "text", value });
7958           continue;
7959         }
7960         if (prev && (prev.type === "globstar" || prev.star === true)) {
7961           prev.type = "star";
7962           prev.star = true;
7963           prev.value += value;
7964           prev.output = star;
7965           state.backtrack = true;
7966           state.globstar = true;
7967           consume(value);
7968           continue;
7969         }
7970         let rest = remaining();
7971         if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
7972           extglobOpen("star", value);
7973           continue;
7974         }
7975         if (prev.type === "star") {
7976           if (opts.noglobstar === true) {
7977             consume(value);
7978             continue;
7979           }
7980           const prior = prev.prev;
7981           const before = prior.prev;
7982           const isStart = prior.type === "slash" || prior.type === "bos";
7983           const afterStar = before && (before.type === "star" || before.type === "globstar");
7984           if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
7985             push({ type: "star", value, output: "" });
7986             continue;
7987           }
7988           const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace");
7989           const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
7990           if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
7991             push({ type: "star", value, output: "" });
7992             continue;
7993           }
7994           while (rest.slice(0, 3) === "/**") {
7995             const after = input[state.index + 4];
7996             if (after && after !== "/") {
7997               break;
7998             }
7999             rest = rest.slice(3);
8000             consume("/**", 3);
8001           }
8002           if (prior.type === "bos" && eos()) {
8003             prev.type = "globstar";
8004             prev.value += value;
8005             prev.output = globstar(opts);
8006             state.output = prev.output;
8007             state.globstar = true;
8008             consume(value);
8009             continue;
8010           }
8011           if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
8012             state.output = state.output.slice(0, -(prior.output + prev.output).length);
8013             prior.output = `(?:${prior.output}`;
8014             prev.type = "globstar";
8015             prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)");
8016             prev.value += value;
8017             state.globstar = true;
8018             state.output += prior.output + prev.output;
8019             consume(value);
8020             continue;
8021           }
8022           if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
8023             const end = rest[1] !== void 0 ? "|$" : "";
8024             state.output = state.output.slice(0, -(prior.output + prev.output).length);
8025             prior.output = `(?:${prior.output}`;
8026             prev.type = "globstar";
8027             prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
8028             prev.value += value;
8029             state.output += prior.output + prev.output;
8030             state.globstar = true;
8031             consume(value + advance());
8032             push({ type: "slash", value: "/", output: "" });
8033             continue;
8034           }
8035           if (prior.type === "bos" && rest[0] === "/") {
8036             prev.type = "globstar";
8037             prev.value += value;
8038             prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
8039             state.output = prev.output;
8040             state.globstar = true;
8041             consume(value + advance());
8042             push({ type: "slash", value: "/", output: "" });
8043             continue;
8044           }
8045           state.output = state.output.slice(0, -prev.output.length);
8046           prev.type = "globstar";
8047           prev.output = globstar(opts);
8048           prev.value += value;
8049           state.output += prev.output;
8050           state.globstar = true;
8051           consume(value);
8052           continue;
8053         }
8054         const token = { type: "star", value, output: star };
8055         if (opts.bash === true) {
8056           token.output = ".*?";
8057           if (prev.type === "bos" || prev.type === "slash") {
8058             token.output = nodot + token.output;
8059           }
8060           push(token);
8061           continue;
8062         }
8063         if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) {
8064           token.output = value;
8065           push(token);
8066           continue;
8067         }
8068         if (state.index === state.start || prev.type === "slash" || prev.type === "dot") {
8069           if (prev.type === "dot") {
8070             state.output += NO_DOT_SLASH;
8071             prev.output += NO_DOT_SLASH;
8072           } else if (opts.dot === true) {
8073             state.output += NO_DOTS_SLASH;
8074             prev.output += NO_DOTS_SLASH;
8075           } else {
8076             state.output += nodot;
8077             prev.output += nodot;
8078           }
8079           if (peek() !== "*") {
8080             state.output += ONE_CHAR;
8081             prev.output += ONE_CHAR;
8082           }
8083         }
8084         push(token);
8085       }
8086       while (state.brackets > 0) {
8087         if (opts.strictBrackets === true)
8088           throw new SyntaxError(syntaxError("closing", "]"));
8089         state.output = utils.escapeLast(state.output, "[");
8090         decrement("brackets");
8091       }
8092       while (state.parens > 0) {
8093         if (opts.strictBrackets === true)
8094           throw new SyntaxError(syntaxError("closing", ")"));
8095         state.output = utils.escapeLast(state.output, "(");
8096         decrement("parens");
8097       }
8098       while (state.braces > 0) {
8099         if (opts.strictBrackets === true)
8100           throw new SyntaxError(syntaxError("closing", "}"));
8101         state.output = utils.escapeLast(state.output, "{");
8102         decrement("braces");
8103       }
8104       if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) {
8105         push({ type: "maybe_slash", value: "", output: `${SLASH_LITERAL}?` });
8106       }
8107       if (state.backtrack === true) {
8108         state.output = "";
8109         for (const token of state.tokens) {
8110           state.output += token.output != null ? token.output : token.value;
8111           if (token.suffix) {
8112             state.output += token.suffix;
8113           }
8114         }
8115       }
8116       return state;
8117     };
8118     parse.fastpaths = (input, options) => {
8119       const opts = __spreadValues({}, options);
8120       const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
8121       const len = input.length;
8122       if (len > max) {
8123         throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
8124       }
8125       input = REPLACEMENTS[input] || input;
8126       const win32 = utils.isWindows(options);
8127       const {
8128         DOT_LITERAL,
8129         SLASH_LITERAL,
8130         ONE_CHAR,
8131         DOTS_SLASH,
8132         NO_DOT,
8133         NO_DOTS,
8134         NO_DOTS_SLASH,
8135         STAR,
8136         START_ANCHOR
8137       } = constants.globChars(win32);
8138       const nodot = opts.dot ? NO_DOTS : NO_DOT;
8139       const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
8140       const capture = opts.capture ? "" : "?:";
8141       const state = { negated: false, prefix: "" };
8142       let star = opts.bash === true ? ".*?" : STAR;
8143       if (opts.capture) {
8144         star = `(${star})`;
8145       }
8146       const globstar = (opts2) => {
8147         if (opts2.noglobstar === true)
8148           return star;
8149         return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
8150       };
8151       const create = (str) => {
8152         switch (str) {
8153           case "*":
8154             return `${nodot}${ONE_CHAR}${star}`;
8155           case ".*":
8156             return `${DOT_LITERAL}${ONE_CHAR}${star}`;
8157           case "*.*":
8158             return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
8159           case "*/*":
8160             return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
8161           case "**":
8162             return nodot + globstar(opts);
8163           case "**/*":
8164             return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
8165           case "**/*.*":
8166             return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
8167           case "**/.*":
8168             return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
8169           default: {
8170             const match = /^(.*?)\.(\w+)$/.exec(str);
8171             if (!match)
8172               return;
8173             const source2 = create(match[1]);
8174             if (!source2)
8175               return;
8176             return source2 + DOT_LITERAL + match[2];
8177           }
8178         }
8179       };
8180       const output = utils.removePrefix(input, state);
8181       let source = create(output);
8182       if (source && opts.strictSlashes !== true) {
8183         source += `${SLASH_LITERAL}?`;
8184       }
8185       return source;
8186     };
8187     module2.exports = parse;
8188   }
8189 });
8190
8191 // node_modules/picomatch/lib/picomatch.js
8192 var require_picomatch = __commonJS({
8193   "node_modules/picomatch/lib/picomatch.js"(exports2, module2) {
8194     "use strict";
8195     var path2 = require("path");
8196     var scan = require_scan();
8197     var parse = require_parse();
8198     var utils = require_utils();
8199     var constants = require_constants();
8200     var isObject2 = (val) => val && typeof val === "object" && !Array.isArray(val);
8201     var picomatch = (glob, options, returnState = false) => {
8202       if (Array.isArray(glob)) {
8203         const fns = glob.map((input) => picomatch(input, options, returnState));
8204         const arrayMatcher = (str) => {
8205           for (const isMatch of fns) {
8206             const state2 = isMatch(str);
8207             if (state2)
8208               return state2;
8209           }
8210           return false;
8211         };
8212         return arrayMatcher;
8213       }
8214       const isState = isObject2(glob) && glob.tokens && glob.input;
8215       if (glob === "" || typeof glob !== "string" && !isState) {
8216         throw new TypeError("Expected pattern to be a non-empty string");
8217       }
8218       const opts = options || {};
8219       const posix = utils.isWindows(options);
8220       const regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true);
8221       const state = regex.state;
8222       delete regex.state;
8223       let isIgnored = () => false;
8224       if (opts.ignore) {
8225         const ignoreOpts = __spreadProps(__spreadValues({}, options), { ignore: null, onMatch: null, onResult: null });
8226         isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
8227       }
8228       const matcher = (input, returnObject = false) => {
8229         const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix });
8230         const result = { glob, state, regex, posix, input, output, match, isMatch };
8231         if (typeof opts.onResult === "function") {
8232           opts.onResult(result);
8233         }
8234         if (isMatch === false) {
8235           result.isMatch = false;
8236           return returnObject ? result : false;
8237         }
8238         if (isIgnored(input)) {
8239           if (typeof opts.onIgnore === "function") {
8240             opts.onIgnore(result);
8241           }
8242           result.isMatch = false;
8243           return returnObject ? result : false;
8244         }
8245         if (typeof opts.onMatch === "function") {
8246           opts.onMatch(result);
8247         }
8248         return returnObject ? result : true;
8249       };
8250       if (returnState) {
8251         matcher.state = state;
8252       }
8253       return matcher;
8254     };
8255     picomatch.test = (input, regex, options, { glob, posix } = {}) => {
8256       if (typeof input !== "string") {
8257         throw new TypeError("Expected input to be a string");
8258       }
8259       if (input === "") {
8260         return { isMatch: false, output: "" };
8261       }
8262       const opts = options || {};
8263       const format2 = opts.format || (posix ? utils.toPosixSlashes : null);
8264       let match = input === glob;
8265       let output = match && format2 ? format2(input) : input;
8266       if (match === false) {
8267         output = format2 ? format2(input) : input;
8268         match = output === glob;
8269       }
8270       if (match === false || opts.capture === true) {
8271         if (opts.matchBase === true || opts.basename === true) {
8272           match = picomatch.matchBase(input, regex, options, posix);
8273         } else {
8274           match = regex.exec(output);
8275         }
8276       }
8277       return { isMatch: Boolean(match), match, output };
8278     };
8279     picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
8280       const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
8281       return regex.test(path2.basename(input));
8282     };
8283     picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
8284     picomatch.parse = (pattern, options) => {
8285       if (Array.isArray(pattern))
8286         return pattern.map((p) => picomatch.parse(p, options));
8287       return parse(pattern, __spreadProps(__spreadValues({}, options), { fastpaths: false }));
8288     };
8289     picomatch.scan = (input, options) => scan(input, options);
8290     picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
8291       if (returnOutput === true) {
8292         return state.output;
8293       }
8294       const opts = options || {};
8295       const prepend = opts.contains ? "" : "^";
8296       const append = opts.contains ? "" : "$";
8297       let source = `${prepend}(?:${state.output})${append}`;
8298       if (state && state.negated === true) {
8299         source = `^(?!${source}).*$`;
8300       }
8301       const regex = picomatch.toRegex(source, options);
8302       if (returnState === true) {
8303         regex.state = state;
8304       }
8305       return regex;
8306     };
8307     picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
8308       if (!input || typeof input !== "string") {
8309         throw new TypeError("Expected a non-empty string");
8310       }
8311       let parsed = { negated: false, fastpaths: true };
8312       if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) {
8313         parsed.output = parse.fastpaths(input, options);
8314       }
8315       if (!parsed.output) {
8316         parsed = parse(input, options);
8317       }
8318       return picomatch.compileRe(parsed, options, returnOutput, returnState);
8319     };
8320     picomatch.toRegex = (source, options) => {
8321       try {
8322         const opts = options || {};
8323         return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
8324       } catch (err) {
8325         if (options && options.debug === true)
8326           throw err;
8327         return /$^/;
8328       }
8329     };
8330     picomatch.constants = constants;
8331     module2.exports = picomatch;
8332   }
8333 });
8334
8335 // node_modules/picomatch/index.js
8336 var require_picomatch2 = __commonJS({
8337   "node_modules/picomatch/index.js"(exports2, module2) {
8338     "use strict";
8339     module2.exports = require_picomatch();
8340   }
8341 });
8342
8343 // node_modules/readdirp/index.js
8344 var require_readdirp = __commonJS({
8345   "node_modules/readdirp/index.js"(exports2, module2) {
8346     "use strict";
8347     var fs2 = require("fs");
8348     var { Readable: Readable2 } = require("stream");
8349     var sysPath = require("path");
8350     var { promisify } = require("util");
8351     var picomatch = require_picomatch2();
8352     var readdir = promisify(fs2.readdir);
8353     var stat = promisify(fs2.stat);
8354     var lstat = promisify(fs2.lstat);
8355     var realpath = promisify(fs2.realpath);
8356     var BANG = "!";
8357     var NORMAL_FLOW_ERRORS = new Set(["ENOENT", "EPERM", "EACCES", "ELOOP"]);
8358     var FILE_TYPE = "files";
8359     var DIR_TYPE = "directories";
8360     var FILE_DIR_TYPE = "files_directories";
8361     var EVERYTHING_TYPE = "all";
8362     var ALL_TYPES = [FILE_TYPE, DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE];
8363     var isNormalFlowError = (error) => NORMAL_FLOW_ERRORS.has(error.code);
8364     var normalizeFilter = (filter) => {
8365       if (filter === void 0)
8366         return;
8367       if (typeof filter === "function")
8368         return filter;
8369       if (typeof filter === "string") {
8370         const glob = picomatch(filter.trim());
8371         return (entry) => glob(entry.basename);
8372       }
8373       if (Array.isArray(filter)) {
8374         const positive = [];
8375         const negative = [];
8376         for (const item of filter) {
8377           const trimmed = item.trim();
8378           if (trimmed.charAt(0) === BANG) {
8379             negative.push(picomatch(trimmed.slice(1)));
8380           } else {
8381             positive.push(picomatch(trimmed));
8382           }
8383         }
8384         if (negative.length > 0) {
8385           if (positive.length > 0) {
8386             return (entry) => positive.some((f) => f(entry.basename)) && !negative.some((f) => f(entry.basename));
8387           }
8388           return (entry) => !negative.some((f) => f(entry.basename));
8389         }
8390         return (entry) => positive.some((f) => f(entry.basename));
8391       }
8392     };
8393     var ReaddirpStream = class extends Readable2 {
8394       static get defaultOptions() {
8395         return {
8396           root: ".",
8397           fileFilter: (path2) => true,
8398           directoryFilter: (path2) => true,
8399           type: FILE_TYPE,
8400           lstat: false,
8401           depth: 2147483648,
8402           alwaysStat: false
8403         };
8404       }
8405       constructor(options = {}) {
8406         super({
8407           objectMode: true,
8408           autoDestroy: true,
8409           highWaterMark: options.highWaterMark || 4096
8410         });
8411         const opts = __spreadValues(__spreadValues({}, ReaddirpStream.defaultOptions), options);
8412         const { root, type } = opts;
8413         this._fileFilter = normalizeFilter(opts.fileFilter);
8414         this._directoryFilter = normalizeFilter(opts.directoryFilter);
8415         const statMethod = opts.lstat ? lstat : stat;
8416         if (process.platform === "win32" && stat.length === 3) {
8417           this._stat = (path2) => statMethod(path2, { bigint: true });
8418         } else {
8419           this._stat = statMethod;
8420         }
8421         this._maxDepth = opts.depth;
8422         this._wantsDir = [DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type);
8423         this._wantsFile = [FILE_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type);
8424         this._wantsEverything = type === EVERYTHING_TYPE;
8425         this._root = sysPath.resolve(root);
8426         this._isDirent = "Dirent" in fs2 && !opts.alwaysStat;
8427         this._statsProp = this._isDirent ? "dirent" : "stats";
8428         this._rdOptions = { encoding: "utf8", withFileTypes: this._isDirent };
8429         this.parents = [this._exploreDir(root, 1)];
8430         this.reading = false;
8431         this.parent = void 0;
8432       }
8433       async _read(batch) {
8434         if (this.reading)
8435           return;
8436         this.reading = true;
8437         try {
8438           while (!this.destroyed && batch > 0) {
8439             const { path: path2, depth, files = [] } = this.parent || {};
8440             if (files.length > 0) {
8441               const slice = files.splice(0, batch).map((dirent) => this._formatEntry(dirent, path2));
8442               for (const entry of await Promise.all(slice)) {
8443                 if (this.destroyed)
8444                   return;
8445                 const entryType = await this._getEntryType(entry);
8446                 if (entryType === "directory" && this._directoryFilter(entry)) {
8447                   if (depth <= this._maxDepth) {
8448                     this.parents.push(this._exploreDir(entry.fullPath, depth + 1));
8449                   }
8450                   if (this._wantsDir) {
8451                     this.push(entry);
8452                     batch--;
8453                   }
8454                 } else if ((entryType === "file" || this._includeAsFile(entry)) && this._fileFilter(entry)) {
8455                   if (this._wantsFile) {
8456                     this.push(entry);
8457                     batch--;
8458                   }
8459                 }
8460               }
8461             } else {
8462               const parent = this.parents.pop();
8463               if (!parent) {
8464                 this.push(null);
8465                 break;
8466               }
8467               this.parent = await parent;
8468               if (this.destroyed)
8469                 return;
8470             }
8471           }
8472         } catch (error) {
8473           this.destroy(error);
8474         } finally {
8475           this.reading = false;
8476         }
8477       }
8478       async _exploreDir(path2, depth) {
8479         let files;
8480         try {
8481           files = await readdir(path2, this._rdOptions);
8482         } catch (error) {
8483           this._onError(error);
8484         }
8485         return { files, depth, path: path2 };
8486       }
8487       async _formatEntry(dirent, path2) {
8488         let entry;
8489         try {
8490           const basename2 = this._isDirent ? dirent.name : dirent;
8491           const fullPath = sysPath.resolve(sysPath.join(path2, basename2));
8492           entry = { path: sysPath.relative(this._root, fullPath), fullPath, basename: basename2 };
8493           entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
8494         } catch (err) {
8495           this._onError(err);
8496         }
8497         return entry;
8498       }
8499       _onError(err) {
8500         if (isNormalFlowError(err) && !this.destroyed) {
8501           this.emit("warn", err);
8502         } else {
8503           this.destroy(err);
8504         }
8505       }
8506       async _getEntryType(entry) {
8507         const stats = entry && entry[this._statsProp];
8508         if (!stats) {
8509           return;
8510         }
8511         if (stats.isFile()) {
8512           return "file";
8513         }
8514         if (stats.isDirectory()) {
8515           return "directory";
8516         }
8517         if (stats && stats.isSymbolicLink()) {
8518           try {
8519             const entryRealPath = await realpath(entry.fullPath);
8520             const entryRealPathStats = await lstat(entryRealPath);
8521             if (entryRealPathStats.isFile()) {
8522               return "file";
8523             }
8524             if (entryRealPathStats.isDirectory()) {
8525               return "directory";
8526             }
8527           } catch (error) {
8528             this._onError(error);
8529           }
8530         }
8531       }
8532       _includeAsFile(entry) {
8533         const stats = entry && entry[this._statsProp];
8534         return stats && this._wantsEverything && !stats.isDirectory();
8535       }
8536     };
8537     var readdirp = (root, options = {}) => {
8538       let type = options.entryType || options.type;
8539       if (type === "both")
8540         type = FILE_DIR_TYPE;
8541       if (type)
8542         options.type = type;
8543       if (!root) {
8544         throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");
8545       } else if (typeof root !== "string") {
8546         throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");
8547       } else if (type && !ALL_TYPES.includes(type)) {
8548         throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(", ")}`);
8549       }
8550       options.root = root;
8551       return new ReaddirpStream(options);
8552     };
8553     var readdirpPromise = (root, options = {}) => {
8554       return new Promise((resolve, reject) => {
8555         const files = [];
8556         readdirp(root, options).on("data", (entry) => files.push(entry)).on("end", () => resolve(files)).on("error", (error) => reject(error));
8557       });
8558     };
8559     readdirp.promise = readdirpPromise;
8560     readdirp.ReaddirpStream = ReaddirpStream;
8561     readdirp.default = readdirp;
8562     module2.exports = readdirp;
8563   }
8564 });
8565
8566 // node_modules/fs.realpath/old.js
8567 var require_old = __commonJS({
8568   "node_modules/fs.realpath/old.js"(exports2) {
8569     var pathModule = require("path");
8570     var isWindows = process.platform === "win32";
8571     var fs2 = require("fs");
8572     var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG);
8573     function rethrow() {
8574       var callback;
8575       if (DEBUG) {
8576         var backtrace = new Error();
8577         callback = debugCallback;
8578       } else
8579         callback = missingCallback;
8580       return callback;
8581       function debugCallback(err) {
8582         if (err) {
8583           backtrace.message = err.message;
8584           err = backtrace;
8585           missingCallback(err);
8586         }
8587       }
8588       function missingCallback(err) {
8589         if (err) {
8590           if (process.throwDeprecation)
8591             throw err;
8592           else if (!process.noDeprecation) {
8593             var msg = "fs: missing callback " + (err.stack || err.message);
8594             if (process.traceDeprecation)
8595               console.trace(msg);
8596             else
8597               console.error(msg);
8598           }
8599         }
8600       }
8601     }
8602     function maybeCallback(cb) {
8603       return typeof cb === "function" ? cb : rethrow();
8604     }
8605     var normalize = pathModule.normalize;
8606     if (isWindows) {
8607       nextPartRe = /(.*?)(?:[\/\\]+|$)/g;
8608     } else {
8609       nextPartRe = /(.*?)(?:[\/]+|$)/g;
8610     }
8611     var nextPartRe;
8612     if (isWindows) {
8613       splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;
8614     } else {
8615       splitRootRe = /^[\/]*/;
8616     }
8617     var splitRootRe;
8618     exports2.realpathSync = function realpathSync(p, cache) {
8619       p = pathModule.resolve(p);
8620       if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
8621         return cache[p];
8622       }
8623       var original = p, seenLinks = {}, knownHard = {};
8624       var pos;
8625       var current;
8626       var base;
8627       var previous;
8628       start();
8629       function start() {
8630         var m = splitRootRe.exec(p);
8631         pos = m[0].length;
8632         current = m[0];
8633         base = m[0];
8634         previous = "";
8635         if (isWindows && !knownHard[base]) {
8636           fs2.lstatSync(base);
8637           knownHard[base] = true;
8638         }
8639       }
8640       while (pos < p.length) {
8641         nextPartRe.lastIndex = pos;
8642         var result = nextPartRe.exec(p);
8643         previous = current;
8644         current += result[0];
8645         base = previous + result[1];
8646         pos = nextPartRe.lastIndex;
8647         if (knownHard[base] || cache && cache[base] === base) {
8648           continue;
8649         }
8650         var resolvedLink;
8651         if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
8652           resolvedLink = cache[base];
8653         } else {
8654           var stat = fs2.lstatSync(base);
8655           if (!stat.isSymbolicLink()) {
8656             knownHard[base] = true;
8657             if (cache)
8658               cache[base] = base;
8659             continue;
8660           }
8661           var linkTarget = null;
8662           if (!isWindows) {
8663             var id = stat.dev.toString(32) + ":" + stat.ino.toString(32);
8664             if (seenLinks.hasOwnProperty(id)) {
8665               linkTarget = seenLinks[id];
8666             }
8667           }
8668           if (linkTarget === null) {
8669             fs2.statSync(base);
8670             linkTarget = fs2.readlinkSync(base);
8671           }
8672           resolvedLink = pathModule.resolve(previous, linkTarget);
8673           if (cache)
8674             cache[base] = resolvedLink;
8675           if (!isWindows)
8676             seenLinks[id] = linkTarget;
8677         }
8678         p = pathModule.resolve(resolvedLink, p.slice(pos));
8679         start();
8680       }
8681       if (cache)
8682         cache[original] = p;
8683       return p;
8684     };
8685     exports2.realpath = function realpath(p, cache, cb) {
8686       if (typeof cb !== "function") {
8687         cb = maybeCallback(cache);
8688         cache = null;
8689       }
8690       p = pathModule.resolve(p);
8691       if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
8692         return process.nextTick(cb.bind(null, null, cache[p]));
8693       }
8694       var original = p, seenLinks = {}, knownHard = {};
8695       var pos;
8696       var current;
8697       var base;
8698       var previous;
8699       start();
8700       function start() {
8701         var m = splitRootRe.exec(p);
8702         pos = m[0].length;
8703         current = m[0];
8704         base = m[0];
8705         previous = "";
8706         if (isWindows && !knownHard[base]) {
8707           fs2.lstat(base, function(err) {
8708             if (err)
8709               return cb(err);
8710             knownHard[base] = true;
8711             LOOP();
8712           });
8713         } else {
8714           process.nextTick(LOOP);
8715         }
8716       }
8717       function LOOP() {
8718         if (pos >= p.length) {
8719           if (cache)
8720             cache[original] = p;
8721           return cb(null, p);
8722         }
8723         nextPartRe.lastIndex = pos;
8724         var result = nextPartRe.exec(p);
8725         previous = current;
8726         current += result[0];
8727         base = previous + result[1];
8728         pos = nextPartRe.lastIndex;
8729         if (knownHard[base] || cache && cache[base] === base) {
8730           return process.nextTick(LOOP);
8731         }
8732         if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
8733           return gotResolvedLink(cache[base]);
8734         }
8735         return fs2.lstat(base, gotStat);
8736       }
8737       function gotStat(err, stat) {
8738         if (err)
8739           return cb(err);
8740         if (!stat.isSymbolicLink()) {
8741           knownHard[base] = true;
8742           if (cache)
8743             cache[base] = base;
8744           return process.nextTick(LOOP);
8745         }
8746         if (!isWindows) {
8747           var id = stat.dev.toString(32) + ":" + stat.ino.toString(32);
8748           if (seenLinks.hasOwnProperty(id)) {
8749             return gotTarget(null, seenLinks[id], base);
8750           }
8751         }
8752         fs2.stat(base, function(err2) {
8753           if (err2)
8754             return cb(err2);
8755           fs2.readlink(base, function(err3, target) {
8756             if (!isWindows)
8757               seenLinks[id] = target;
8758             gotTarget(err3, target);
8759           });
8760         });
8761       }
8762       function gotTarget(err, target, base2) {
8763         if (err)
8764           return cb(err);
8765         var resolvedLink = pathModule.resolve(previous, target);
8766         if (cache)
8767           cache[base2] = resolvedLink;
8768         gotResolvedLink(resolvedLink);
8769       }
8770       function gotResolvedLink(resolvedLink) {
8771         p = pathModule.resolve(resolvedLink, p.slice(pos));
8772         start();
8773       }
8774     };
8775   }
8776 });
8777
8778 // node_modules/fs.realpath/index.js
8779 var require_fs = __commonJS({
8780   "node_modules/fs.realpath/index.js"(exports2, module2) {
8781     module2.exports = realpath;
8782     realpath.realpath = realpath;
8783     realpath.sync = realpathSync;
8784     realpath.realpathSync = realpathSync;
8785     realpath.monkeypatch = monkeypatch;
8786     realpath.unmonkeypatch = unmonkeypatch;
8787     var fs2 = require("fs");
8788     var origRealpath = fs2.realpath;
8789     var origRealpathSync = fs2.realpathSync;
8790     var version = process.version;
8791     var ok = /^v[0-5]\./.test(version);
8792     var old = require_old();
8793     function newError(er) {
8794       return er && er.syscall === "realpath" && (er.code === "ELOOP" || er.code === "ENOMEM" || er.code === "ENAMETOOLONG");
8795     }
8796     function realpath(p, cache, cb) {
8797       if (ok) {
8798         return origRealpath(p, cache, cb);
8799       }
8800       if (typeof cache === "function") {
8801         cb = cache;
8802         cache = null;
8803       }
8804       origRealpath(p, cache, function(er, result) {
8805         if (newError(er)) {
8806           old.realpath(p, cache, cb);
8807         } else {
8808           cb(er, result);
8809         }
8810       });
8811     }
8812     function realpathSync(p, cache) {
8813       if (ok) {
8814         return origRealpathSync(p, cache);
8815       }
8816       try {
8817         return origRealpathSync(p, cache);
8818       } catch (er) {
8819         if (newError(er)) {
8820           return old.realpathSync(p, cache);
8821         } else {
8822           throw er;
8823         }
8824       }
8825     }
8826     function monkeypatch() {
8827       fs2.realpath = realpath;
8828       fs2.realpathSync = realpathSync;
8829     }
8830     function unmonkeypatch() {
8831       fs2.realpath = origRealpath;
8832       fs2.realpathSync = origRealpathSync;
8833     }
8834   }
8835 });
8836
8837 // node_modules/concat-map/index.js
8838 var require_concat_map = __commonJS({
8839   "node_modules/concat-map/index.js"(exports2, module2) {
8840     module2.exports = function(xs, fn) {
8841       var res = [];
8842       for (var i = 0; i < xs.length; i++) {
8843         var x = fn(xs[i], i);
8844         if (isArray(x))
8845           res.push.apply(res, x);
8846         else
8847           res.push(x);
8848       }
8849       return res;
8850     };
8851     var isArray = Array.isArray || function(xs) {
8852       return Object.prototype.toString.call(xs) === "[object Array]";
8853     };
8854   }
8855 });
8856
8857 // node_modules/balanced-match/index.js
8858 var require_balanced_match = __commonJS({
8859   "node_modules/balanced-match/index.js"(exports2, module2) {
8860     "use strict";
8861     module2.exports = balanced;
8862     function balanced(a, b, str) {
8863       if (a instanceof RegExp)
8864         a = maybeMatch(a, str);
8865       if (b instanceof RegExp)
8866         b = maybeMatch(b, str);
8867       var r = range(a, b, str);
8868       return r && {
8869         start: r[0],
8870         end: r[1],
8871         pre: str.slice(0, r[0]),
8872         body: str.slice(r[0] + a.length, r[1]),
8873         post: str.slice(r[1] + b.length)
8874       };
8875     }
8876     function maybeMatch(reg, str) {
8877       var m = str.match(reg);
8878       return m ? m[0] : null;
8879     }
8880     balanced.range = range;
8881     function range(a, b, str) {
8882       var begs, beg, left, right, result;
8883       var ai = str.indexOf(a);
8884       var bi = str.indexOf(b, ai + 1);
8885       var i = ai;
8886       if (ai >= 0 && bi > 0) {
8887         begs = [];
8888         left = str.length;
8889         while (i >= 0 && !result) {
8890           if (i == ai) {
8891             begs.push(i);
8892             ai = str.indexOf(a, i + 1);
8893           } else if (begs.length == 1) {
8894             result = [begs.pop(), bi];
8895           } else {
8896             beg = begs.pop();
8897             if (beg < left) {
8898               left = beg;
8899               right = bi;
8900             }
8901             bi = str.indexOf(b, i + 1);
8902           }
8903           i = ai < bi && ai >= 0 ? ai : bi;
8904         }
8905         if (begs.length) {
8906           result = [left, right];
8907         }
8908       }
8909       return result;
8910     }
8911   }
8912 });
8913
8914 // node_modules/brace-expansion/index.js
8915 var require_brace_expansion = __commonJS({
8916   "node_modules/brace-expansion/index.js"(exports2, module2) {
8917     var concatMap = require_concat_map();
8918     var balanced = require_balanced_match();
8919     module2.exports = expandTop;
8920     var escSlash = "\0SLASH" + Math.random() + "\0";
8921     var escOpen = "\0OPEN" + Math.random() + "\0";
8922     var escClose = "\0CLOSE" + Math.random() + "\0";
8923     var escComma = "\0COMMA" + Math.random() + "\0";
8924     var escPeriod = "\0PERIOD" + Math.random() + "\0";
8925     function numeric(str) {
8926       return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
8927     }
8928     function escapeBraces(str) {
8929       return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod);
8930     }
8931     function unescapeBraces(str) {
8932       return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".");
8933     }
8934     function parseCommaParts(str) {
8935       if (!str)
8936         return [""];
8937       var parts = [];
8938       var m = balanced("{", "}", str);
8939       if (!m)
8940         return str.split(",");
8941       var pre = m.pre;
8942       var body = m.body;
8943       var post = m.post;
8944       var p = pre.split(",");
8945       p[p.length - 1] += "{" + body + "}";
8946       var postParts = parseCommaParts(post);
8947       if (post.length) {
8948         p[p.length - 1] += postParts.shift();
8949         p.push.apply(p, postParts);
8950       }
8951       parts.push.apply(parts, p);
8952       return parts;
8953     }
8954     function expandTop(str) {
8955       if (!str)
8956         return [];
8957       if (str.substr(0, 2) === "{}") {
8958         str = "\\{\\}" + str.substr(2);
8959       }
8960       return expand(escapeBraces(str), true).map(unescapeBraces);
8961     }
8962     function embrace(str) {
8963       return "{" + str + "}";
8964     }
8965     function isPadded(el) {
8966       return /^-?0\d/.test(el);
8967     }
8968     function lte(i, y) {
8969       return i <= y;
8970     }
8971     function gte(i, y) {
8972       return i >= y;
8973     }
8974     function expand(str, isTop) {
8975       var expansions = [];
8976       var m = balanced("{", "}", str);
8977       if (!m || /\$$/.test(m.pre))
8978         return [str];
8979       var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
8980       var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
8981       var isSequence = isNumericSequence || isAlphaSequence;
8982       var isOptions = m.body.indexOf(",") >= 0;
8983       if (!isSequence && !isOptions) {
8984         if (m.post.match(/,.*\}/)) {
8985           str = m.pre + "{" + m.body + escClose + m.post;
8986           return expand(str);
8987         }
8988         return [str];
8989       }
8990       var n;
8991       if (isSequence) {
8992         n = m.body.split(/\.\./);
8993       } else {
8994         n = parseCommaParts(m.body);
8995         if (n.length === 1) {
8996           n = expand(n[0], false).map(embrace);
8997           if (n.length === 1) {
8998             var post = m.post.length ? expand(m.post, false) : [""];
8999             return post.map(function(p) {
9000               return m.pre + n[0] + p;
9001             });
9002           }
9003         }
9004       }
9005       var pre = m.pre;
9006       var post = m.post.length ? expand(m.post, false) : [""];
9007       var N;
9008       if (isSequence) {
9009         var x = numeric(n[0]);
9010         var y = numeric(n[1]);
9011         var width = Math.max(n[0].length, n[1].length);
9012         var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1;
9013         var test = lte;
9014         var reverse = y < x;
9015         if (reverse) {
9016           incr *= -1;
9017           test = gte;
9018         }
9019         var pad = n.some(isPadded);
9020         N = [];
9021         for (var i = x; test(i, y); i += incr) {
9022           var c;
9023           if (isAlphaSequence) {
9024             c = String.fromCharCode(i);
9025             if (c === "\\")
9026               c = "";
9027           } else {
9028             c = String(i);
9029             if (pad) {
9030               var need = width - c.length;
9031               if (need > 0) {
9032                 var z = new Array(need + 1).join("0");
9033                 if (i < 0)
9034                   c = "-" + z + c.slice(1);
9035                 else
9036                   c = z + c;
9037               }
9038             }
9039           }
9040           N.push(c);
9041         }
9042       } else {
9043         N = concatMap(n, function(el) {
9044           return expand(el, false);
9045         });
9046       }
9047       for (var j = 0; j < N.length; j++) {
9048         for (var k = 0; k < post.length; k++) {
9049           var expansion = pre + N[j] + post[k];
9050           if (!isTop || isSequence || expansion)
9051             expansions.push(expansion);
9052         }
9053       }
9054       return expansions;
9055     }
9056   }
9057 });
9058
9059 // node_modules/minimatch/minimatch.js
9060 var require_minimatch = __commonJS({
9061   "node_modules/minimatch/minimatch.js"(exports2, module2) {
9062     module2.exports = minimatch;
9063     minimatch.Minimatch = Minimatch;
9064     var path2 = { sep: "/" };
9065     try {
9066       path2 = require("path");
9067     } catch (er) {
9068     }
9069     var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {};
9070     var expand = require_brace_expansion();
9071     var plTypes = {
9072       "!": { open: "(?:(?!(?:", close: "))[^/]*?)" },
9073       "?": { open: "(?:", close: ")?" },
9074       "+": { open: "(?:", close: ")+" },
9075       "*": { open: "(?:", close: ")*" },
9076       "@": { open: "(?:", close: ")" }
9077     };
9078     var qmark = "[^/]";
9079     var star = qmark + "*?";
9080     var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
9081     var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
9082     var reSpecials = charSet("().*{}+?[]^$\\!");
9083     function charSet(s) {
9084       return s.split("").reduce(function(set, c) {
9085         set[c] = true;
9086         return set;
9087       }, {});
9088     }
9089     var slashSplit = /\/+/;
9090     minimatch.filter = filter;
9091     function filter(pattern, options) {
9092       options = options || {};
9093       return function(p, i, list) {
9094         return minimatch(p, pattern, options);
9095       };
9096     }
9097     function ext(a, b) {
9098       a = a || {};
9099       b = b || {};
9100       var t = {};
9101       Object.keys(b).forEach(function(k) {
9102         t[k] = b[k];
9103       });
9104       Object.keys(a).forEach(function(k) {
9105         t[k] = a[k];
9106       });
9107       return t;
9108     }
9109     minimatch.defaults = function(def) {
9110       if (!def || !Object.keys(def).length)
9111         return minimatch;
9112       var orig = minimatch;
9113       var m = function minimatch2(p, pattern, options) {
9114         return orig.minimatch(p, pattern, ext(def, options));
9115       };
9116       m.Minimatch = function Minimatch2(pattern, options) {
9117         return new orig.Minimatch(pattern, ext(def, options));
9118       };
9119       return m;
9120     };
9121     Minimatch.defaults = function(def) {
9122       if (!def || !Object.keys(def).length)
9123         return Minimatch;
9124       return minimatch.defaults(def).Minimatch;
9125     };
9126     function minimatch(p, pattern, options) {
9127       if (typeof pattern !== "string") {
9128         throw new TypeError("glob pattern string required");
9129       }
9130       if (!options)
9131         options = {};
9132       if (!options.nocomment && pattern.charAt(0) === "#") {
9133         return false;
9134       }
9135       if (pattern.trim() === "")
9136         return p === "";
9137       return new Minimatch(pattern, options).match(p);
9138     }
9139     function Minimatch(pattern, options) {
9140       if (!(this instanceof Minimatch)) {
9141         return new Minimatch(pattern, options);
9142       }
9143       if (typeof pattern !== "string") {
9144         throw new TypeError("glob pattern string required");
9145       }
9146       if (!options)
9147         options = {};
9148       pattern = pattern.trim();
9149       if (path2.sep !== "/") {
9150         pattern = pattern.split(path2.sep).join("/");
9151       }
9152       this.options = options;
9153       this.set = [];
9154       this.pattern = pattern;
9155       this.regexp = null;
9156       this.negate = false;
9157       this.comment = false;
9158       this.empty = false;
9159       this.make();
9160     }
9161     Minimatch.prototype.debug = function() {
9162     };
9163     Minimatch.prototype.make = make;
9164     function make() {
9165       if (this._made)
9166         return;
9167       var pattern = this.pattern;
9168       var options = this.options;
9169       if (!options.nocomment && pattern.charAt(0) === "#") {
9170         this.comment = true;
9171         return;
9172       }
9173       if (!pattern) {
9174         this.empty = true;
9175         return;
9176       }
9177       this.parseNegate();
9178       var set = this.globSet = this.braceExpand();
9179       if (options.debug)
9180         this.debug = console.error;
9181       this.debug(this.pattern, set);
9182       set = this.globParts = set.map(function(s) {
9183         return s.split(slashSplit);
9184       });
9185       this.debug(this.pattern, set);
9186       set = set.map(function(s, si, set2) {
9187         return s.map(this.parse, this);
9188       }, this);
9189       this.debug(this.pattern, set);
9190       set = set.filter(function(s) {
9191         return s.indexOf(false) === -1;
9192       });
9193       this.debug(this.pattern, set);
9194       this.set = set;
9195     }
9196     Minimatch.prototype.parseNegate = parseNegate;
9197     function parseNegate() {
9198       var pattern = this.pattern;
9199       var negate = false;
9200       var options = this.options;
9201       var negateOffset = 0;
9202       if (options.nonegate)
9203         return;
9204       for (var i = 0, l2 = pattern.length; i < l2 && pattern.charAt(i) === "!"; i++) {
9205         negate = !negate;
9206         negateOffset++;
9207       }
9208       if (negateOffset)
9209         this.pattern = pattern.substr(negateOffset);
9210       this.negate = negate;
9211     }
9212     minimatch.braceExpand = function(pattern, options) {
9213       return braceExpand(pattern, options);
9214     };
9215     Minimatch.prototype.braceExpand = braceExpand;
9216     function braceExpand(pattern, options) {
9217       if (!options) {
9218         if (this instanceof Minimatch) {
9219           options = this.options;
9220         } else {
9221           options = {};
9222         }
9223       }
9224       pattern = typeof pattern === "undefined" ? this.pattern : pattern;
9225       if (typeof pattern === "undefined") {
9226         throw new TypeError("undefined pattern");
9227       }
9228       if (options.nobrace || !pattern.match(/\{.*\}/)) {
9229         return [pattern];
9230       }
9231       return expand(pattern);
9232     }
9233     Minimatch.prototype.parse = parse;
9234     var SUBPARSE = {};
9235     function parse(pattern, isSub) {
9236       if (pattern.length > 1024 * 64) {
9237         throw new TypeError("pattern is too long");
9238       }
9239       var options = this.options;
9240       if (!options.noglobstar && pattern === "**")
9241         return GLOBSTAR;
9242       if (pattern === "")
9243         return "";
9244       var re = "";
9245       var hasMagic = !!options.nocase;
9246       var escaping = false;
9247       var patternListStack = [];
9248       var negativeLists = [];
9249       var stateChar;
9250       var inClass = false;
9251       var reClassStart = -1;
9252       var classStart = -1;
9253       var patternStart = pattern.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)";
9254       var self2 = this;
9255       function clearStateChar() {
9256         if (stateChar) {
9257           switch (stateChar) {
9258             case "*":
9259               re += star;
9260               hasMagic = true;
9261               break;
9262             case "?":
9263               re += qmark;
9264               hasMagic = true;
9265               break;
9266             default:
9267               re += "\\" + stateChar;
9268               break;
9269           }
9270           self2.debug("clearStateChar %j %j", stateChar, re);
9271           stateChar = false;
9272         }
9273       }
9274       for (var i = 0, len = pattern.length, c; i < len && (c = pattern.charAt(i)); i++) {
9275         this.debug("%s  %s %s %j", pattern, i, re, c);
9276         if (escaping && reSpecials[c]) {
9277           re += "\\" + c;
9278           escaping = false;
9279           continue;
9280         }
9281         switch (c) {
9282           case "/":
9283             return false;
9284           case "\\":
9285             clearStateChar();
9286             escaping = true;
9287             continue;
9288           case "?":
9289           case "*":
9290           case "+":
9291           case "@":
9292           case "!":
9293             this.debug("%s      %s %s %j <-- stateChar", pattern, i, re, c);
9294             if (inClass) {
9295               this.debug("  in class");
9296               if (c === "!" && i === classStart + 1)
9297                 c = "^";
9298               re += c;
9299               continue;
9300             }
9301             self2.debug("call clearStateChar %j", stateChar);
9302             clearStateChar();
9303             stateChar = c;
9304             if (options.noext)
9305               clearStateChar();
9306             continue;
9307           case "(":
9308             if (inClass) {
9309               re += "(";
9310               continue;
9311             }
9312             if (!stateChar) {
9313               re += "\\(";
9314               continue;
9315             }
9316             patternListStack.push({
9317               type: stateChar,
9318               start: i - 1,
9319               reStart: re.length,
9320               open: plTypes[stateChar].open,
9321               close: plTypes[stateChar].close
9322             });
9323             re += stateChar === "!" ? "(?:(?!(?:" : "(?:";
9324             this.debug("plType %j %j", stateChar, re);
9325             stateChar = false;
9326             continue;
9327           case ")":
9328             if (inClass || !patternListStack.length) {
9329               re += "\\)";
9330               continue;
9331             }
9332             clearStateChar();
9333             hasMagic = true;
9334             var pl = patternListStack.pop();
9335             re += pl.close;
9336             if (pl.type === "!") {
9337               negativeLists.push(pl);
9338             }
9339             pl.reEnd = re.length;
9340             continue;
9341           case "|":
9342             if (inClass || !patternListStack.length || escaping) {
9343               re += "\\|";
9344               escaping = false;
9345               continue;
9346             }
9347             clearStateChar();
9348             re += "|";
9349             continue;
9350           case "[":
9351             clearStateChar();
9352             if (inClass) {
9353               re += "\\" + c;
9354               continue;
9355             }
9356             inClass = true;
9357             classStart = i;
9358             reClassStart = re.length;
9359             re += c;
9360             continue;
9361           case "]":
9362             if (i === classStart + 1 || !inClass) {
9363               re += "\\" + c;
9364               escaping = false;
9365               continue;
9366             }
9367             if (inClass) {
9368               var cs = pattern.substring(classStart + 1, i);
9369               try {
9370                 RegExp("[" + cs + "]");
9371               } catch (er) {
9372                 var sp = this.parse(cs, SUBPARSE);
9373                 re = re.substr(0, reClassStart) + "\\[" + sp[0] + "\\]";
9374                 hasMagic = hasMagic || sp[1];
9375                 inClass = false;
9376                 continue;
9377               }
9378             }
9379             hasMagic = true;
9380             inClass = false;
9381             re += c;
9382             continue;
9383           default:
9384             clearStateChar();
9385             if (escaping) {
9386               escaping = false;
9387             } else if (reSpecials[c] && !(c === "^" && inClass)) {
9388               re += "\\";
9389             }
9390             re += c;
9391         }
9392       }
9393       if (inClass) {
9394         cs = pattern.substr(classStart + 1);
9395         sp = this.parse(cs, SUBPARSE);
9396         re = re.substr(0, reClassStart) + "\\[" + sp[0];
9397         hasMagic = hasMagic || sp[1];
9398       }
9399       for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
9400         var tail = re.slice(pl.reStart + pl.open.length);
9401         this.debug("setting tail", re, pl);
9402         tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function(_, $1, $2) {
9403           if (!$2) {
9404             $2 = "\\";
9405           }
9406           return $1 + $1 + $2 + "|";
9407         });
9408         this.debug("tail=%j\n   %s", tail, tail, pl, re);
9409         var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type;
9410         hasMagic = true;
9411         re = re.slice(0, pl.reStart) + t + "\\(" + tail;
9412       }
9413       clearStateChar();
9414       if (escaping) {
9415         re += "\\\\";
9416       }
9417       var addPatternStart = false;
9418       switch (re.charAt(0)) {
9419         case ".":
9420         case "[":
9421         case "(":
9422           addPatternStart = true;
9423       }
9424       for (var n = negativeLists.length - 1; n > -1; n--) {
9425         var nl = negativeLists[n];
9426         var nlBefore = re.slice(0, nl.reStart);
9427         var nlFirst = re.slice(nl.reStart, nl.reEnd - 8);
9428         var nlLast = re.slice(nl.reEnd - 8, nl.reEnd);
9429         var nlAfter = re.slice(nl.reEnd);
9430         nlLast += nlAfter;
9431         var openParensBefore = nlBefore.split("(").length - 1;
9432         var cleanAfter = nlAfter;
9433         for (i = 0; i < openParensBefore; i++) {
9434           cleanAfter = cleanAfter.replace(/\)[+*?]?/, "");
9435         }
9436         nlAfter = cleanAfter;
9437         var dollar = "";
9438         if (nlAfter === "" && isSub !== SUBPARSE) {
9439           dollar = "$";
9440         }
9441         var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast;
9442         re = newRe;
9443       }
9444       if (re !== "" && hasMagic) {
9445         re = "(?=.)" + re;
9446       }
9447       if (addPatternStart) {
9448         re = patternStart + re;
9449       }
9450       if (isSub === SUBPARSE) {
9451         return [re, hasMagic];
9452       }
9453       if (!hasMagic) {
9454         return globUnescape(pattern);
9455       }
9456       var flags = options.nocase ? "i" : "";
9457       try {
9458         var regExp = new RegExp("^" + re + "$", flags);
9459       } catch (er) {
9460         return new RegExp("$.");
9461       }
9462       regExp._glob = pattern;
9463       regExp._src = re;
9464       return regExp;
9465     }
9466     minimatch.makeRe = function(pattern, options) {
9467       return new Minimatch(pattern, options || {}).makeRe();
9468     };
9469     Minimatch.prototype.makeRe = makeRe;
9470     function makeRe() {
9471       if (this.regexp || this.regexp === false)
9472         return this.regexp;
9473       var set = this.set;
9474       if (!set.length) {
9475         this.regexp = false;
9476         return this.regexp;
9477       }
9478       var options = this.options;
9479       var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot;
9480       var flags = options.nocase ? "i" : "";
9481       var re = set.map(function(pattern) {
9482         return pattern.map(function(p) {
9483           return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(p) : p._src;
9484         }).join("\\/");
9485       }).join("|");
9486       re = "^(?:" + re + ")$";
9487       if (this.negate)
9488         re = "^(?!" + re + ").*$";
9489       try {
9490         this.regexp = new RegExp(re, flags);
9491       } catch (ex) {
9492         this.regexp = false;
9493       }
9494       return this.regexp;
9495     }
9496     minimatch.match = function(list, pattern, options) {
9497       options = options || {};
9498       var mm = new Minimatch(pattern, options);
9499       list = list.filter(function(f) {
9500         return mm.match(f);
9501       });
9502       if (mm.options.nonull && !list.length) {
9503         list.push(pattern);
9504       }
9505       return list;
9506     };
9507     Minimatch.prototype.match = match;
9508     function match(f, partial) {
9509       this.debug("match", f, this.pattern);
9510       if (this.comment)
9511         return false;
9512       if (this.empty)
9513         return f === "";
9514       if (f === "/" && partial)
9515         return true;
9516       var options = this.options;
9517       if (path2.sep !== "/") {
9518         f = f.split(path2.sep).join("/");
9519       }
9520       f = f.split(slashSplit);
9521       this.debug(this.pattern, "split", f);
9522       var set = this.set;
9523       this.debug(this.pattern, "set", set);
9524       var filename;
9525       var i;
9526       for (i = f.length - 1; i >= 0; i--) {
9527         filename = f[i];
9528         if (filename)
9529           break;
9530       }
9531       for (i = 0; i < set.length; i++) {
9532         var pattern = set[i];
9533         var file = f;
9534         if (options.matchBase && pattern.length === 1) {
9535           file = [filename];
9536         }
9537         var hit = this.matchOne(file, pattern, partial);
9538         if (hit) {
9539           if (options.flipNegate)
9540             return true;
9541           return !this.negate;
9542         }
9543       }
9544       if (options.flipNegate)
9545         return false;
9546       return this.negate;
9547     }
9548     Minimatch.prototype.matchOne = function(file, pattern, partial) {
9549       var options = this.options;
9550       this.debug("matchOne", { "this": this, file, pattern });
9551       this.debug("matchOne", file.length, pattern.length);
9552       for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
9553         this.debug("matchOne loop");
9554         var p = pattern[pi];
9555         var f = file[fi];
9556         this.debug(pattern, p, f);
9557         if (p === false)
9558           return false;
9559         if (p === GLOBSTAR) {
9560           this.debug("GLOBSTAR", [pattern, p, f]);
9561           var fr = fi;
9562           var pr = pi + 1;
9563           if (pr === pl) {
9564             this.debug("** at the end");
9565             for (; fi < fl; fi++) {
9566               if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
9567                 return false;
9568             }
9569             return true;
9570           }
9571           while (fr < fl) {
9572             var swallowee = file[fr];
9573             this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
9574             if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
9575               this.debug("globstar found match!", fr, fl, swallowee);
9576               return true;
9577             } else {
9578               if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
9579                 this.debug("dot detected!", file, fr, pattern, pr);
9580                 break;
9581               }
9582               this.debug("globstar swallow a segment, and continue");
9583               fr++;
9584             }
9585           }
9586           if (partial) {
9587             this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
9588             if (fr === fl)
9589               return true;
9590           }
9591           return false;
9592         }
9593         var hit;
9594         if (typeof p === "string") {
9595           if (options.nocase) {
9596             hit = f.toLowerCase() === p.toLowerCase();
9597           } else {
9598             hit = f === p;
9599           }
9600           this.debug("string match", p, f, hit);
9601         } else {
9602           hit = f.match(p);
9603           this.debug("pattern match", p, f, hit);
9604         }
9605         if (!hit)
9606           return false;
9607       }
9608       if (fi === fl && pi === pl) {
9609         return true;
9610       } else if (fi === fl) {
9611         return partial;
9612       } else if (pi === pl) {
9613         var emptyFileEnd = fi === fl - 1 && file[fi] === "";
9614         return emptyFileEnd;
9615       }
9616       throw new Error("wtf?");
9617     };
9618     function globUnescape(s) {
9619       return s.replace(/\\(.)/g, "$1");
9620     }
9621     function regExpEscape(s) {
9622       return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
9623     }
9624   }
9625 });
9626
9627 // node_modules/inherits/inherits_browser.js
9628 var require_inherits_browser = __commonJS({
9629   "node_modules/inherits/inherits_browser.js"(exports2, module2) {
9630     if (typeof Object.create === "function") {
9631       module2.exports = function inherits2(ctor, superCtor) {
9632         if (superCtor) {
9633           ctor.super_ = superCtor;
9634           ctor.prototype = Object.create(superCtor.prototype, {
9635             constructor: {
9636               value: ctor,
9637               enumerable: false,
9638               writable: true,
9639               configurable: true
9640             }
9641           });
9642         }
9643       };
9644     } else {
9645       module2.exports = function inherits2(ctor, superCtor) {
9646         if (superCtor) {
9647           ctor.super_ = superCtor;
9648           var TempCtor = function() {
9649           };
9650           TempCtor.prototype = superCtor.prototype;
9651           ctor.prototype = new TempCtor();
9652           ctor.prototype.constructor = ctor;
9653         }
9654       };
9655     }
9656   }
9657 });
9658
9659 // node_modules/inherits/inherits.js
9660 var require_inherits = __commonJS({
9661   "node_modules/inherits/inherits.js"(exports2, module2) {
9662     try {
9663       util = require("util");
9664       if (typeof util.inherits !== "function")
9665         throw "";
9666       module2.exports = util.inherits;
9667     } catch (e) {
9668       module2.exports = require_inherits_browser();
9669     }
9670     var util;
9671   }
9672 });
9673
9674 // node_modules/path-is-absolute/index.js
9675 var require_path_is_absolute = __commonJS({
9676   "node_modules/path-is-absolute/index.js"(exports2, module2) {
9677     "use strict";
9678     function posix(path2) {
9679       return path2.charAt(0) === "/";
9680     }
9681     function win32(path2) {
9682       var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
9683       var result = splitDeviceRe.exec(path2);
9684       var device = result[1] || "";
9685       var isUnc = Boolean(device && device.charAt(1) !== ":");
9686       return Boolean(result[2] || isUnc);
9687     }
9688     module2.exports = process.platform === "win32" ? win32 : posix;
9689     module2.exports.posix = posix;
9690     module2.exports.win32 = win32;
9691   }
9692 });
9693
9694 // node_modules/glob/common.js
9695 var require_common = __commonJS({
9696   "node_modules/glob/common.js"(exports2) {
9697     exports2.alphasort = alphasort;
9698     exports2.alphasorti = alphasorti;
9699     exports2.setopts = setopts;
9700     exports2.ownProp = ownProp;
9701     exports2.makeAbs = makeAbs;
9702     exports2.finish = finish;
9703     exports2.mark = mark;
9704     exports2.isIgnored = isIgnored;
9705     exports2.childrenIgnored = childrenIgnored;
9706     function ownProp(obj2, field) {
9707       return Object.prototype.hasOwnProperty.call(obj2, field);
9708     }
9709     var path2 = require("path");
9710     var minimatch = require_minimatch();
9711     var isAbsolute = require_path_is_absolute();
9712     var Minimatch = minimatch.Minimatch;
9713     function alphasorti(a, b) {
9714       return a.toLowerCase().localeCompare(b.toLowerCase());
9715     }
9716     function alphasort(a, b) {
9717       return a.localeCompare(b);
9718     }
9719     function setupIgnores(self2, options) {
9720       self2.ignore = options.ignore || [];
9721       if (!Array.isArray(self2.ignore))
9722         self2.ignore = [self2.ignore];
9723       if (self2.ignore.length) {
9724         self2.ignore = self2.ignore.map(ignoreMap);
9725       }
9726     }
9727     function ignoreMap(pattern) {
9728       var gmatcher = null;
9729       if (pattern.slice(-3) === "/**") {
9730         var gpattern = pattern.replace(/(\/\*\*)+$/, "");
9731         gmatcher = new Minimatch(gpattern, { dot: true });
9732       }
9733       return {
9734         matcher: new Minimatch(pattern, { dot: true }),
9735         gmatcher
9736       };
9737     }
9738     function setopts(self2, pattern, options) {
9739       if (!options)
9740         options = {};
9741       if (options.matchBase && pattern.indexOf("/") === -1) {
9742         if (options.noglobstar) {
9743           throw new Error("base matching requires globstar");
9744         }
9745         pattern = "**/" + pattern;
9746       }
9747       self2.silent = !!options.silent;
9748       self2.pattern = pattern;
9749       self2.strict = options.strict !== false;
9750       self2.realpath = !!options.realpath;
9751       self2.realpathCache = options.realpathCache || Object.create(null);
9752       self2.follow = !!options.follow;
9753       self2.dot = !!options.dot;
9754       self2.mark = !!options.mark;
9755       self2.nodir = !!options.nodir;
9756       if (self2.nodir)
9757         self2.mark = true;
9758       self2.sync = !!options.sync;
9759       self2.nounique = !!options.nounique;
9760       self2.nonull = !!options.nonull;
9761       self2.nosort = !!options.nosort;
9762       self2.nocase = !!options.nocase;
9763       self2.stat = !!options.stat;
9764       self2.noprocess = !!options.noprocess;
9765       self2.absolute = !!options.absolute;
9766       self2.maxLength = options.maxLength || Infinity;
9767       self2.cache = options.cache || Object.create(null);
9768       self2.statCache = options.statCache || Object.create(null);
9769       self2.symlinks = options.symlinks || Object.create(null);
9770       setupIgnores(self2, options);
9771       self2.changedCwd = false;
9772       var cwd = process.cwd();
9773       if (!ownProp(options, "cwd"))
9774         self2.cwd = cwd;
9775       else {
9776         self2.cwd = path2.resolve(options.cwd);
9777         self2.changedCwd = self2.cwd !== cwd;
9778       }
9779       self2.root = options.root || path2.resolve(self2.cwd, "/");
9780       self2.root = path2.resolve(self2.root);
9781       if (process.platform === "win32")
9782         self2.root = self2.root.replace(/\\/g, "/");
9783       self2.cwdAbs = isAbsolute(self2.cwd) ? self2.cwd : makeAbs(self2, self2.cwd);
9784       if (process.platform === "win32")
9785         self2.cwdAbs = self2.cwdAbs.replace(/\\/g, "/");
9786       self2.nomount = !!options.nomount;
9787       options.nonegate = true;
9788       options.nocomment = true;
9789       self2.minimatch = new Minimatch(pattern, options);
9790       self2.options = self2.minimatch.options;
9791     }
9792     function finish(self2) {
9793       var nou = self2.nounique;
9794       var all = nou ? [] : Object.create(null);
9795       for (var i = 0, l2 = self2.matches.length; i < l2; i++) {
9796         var matches = self2.matches[i];
9797         if (!matches || Object.keys(matches).length === 0) {
9798           if (self2.nonull) {
9799             var literal = self2.minimatch.globSet[i];
9800             if (nou)
9801               all.push(literal);
9802             else
9803               all[literal] = true;
9804           }
9805         } else {
9806           var m = Object.keys(matches);
9807           if (nou)
9808             all.push.apply(all, m);
9809           else
9810             m.forEach(function(m2) {
9811               all[m2] = true;
9812             });
9813         }
9814       }
9815       if (!nou)
9816         all = Object.keys(all);
9817       if (!self2.nosort)
9818         all = all.sort(self2.nocase ? alphasorti : alphasort);
9819       if (self2.mark) {
9820         for (var i = 0; i < all.length; i++) {
9821           all[i] = self2._mark(all[i]);
9822         }
9823         if (self2.nodir) {
9824           all = all.filter(function(e) {
9825             var notDir = !/\/$/.test(e);
9826             var c = self2.cache[e] || self2.cache[makeAbs(self2, e)];
9827             if (notDir && c)
9828               notDir = c !== "DIR" && !Array.isArray(c);
9829             return notDir;
9830           });
9831         }
9832       }
9833       if (self2.ignore.length)
9834         all = all.filter(function(m2) {
9835           return !isIgnored(self2, m2);
9836         });
9837       self2.found = all;
9838     }
9839     function mark(self2, p) {
9840       var abs = makeAbs(self2, p);
9841       var c = self2.cache[abs];
9842       var m = p;
9843       if (c) {
9844         var isDir = c === "DIR" || Array.isArray(c);
9845         var slash = p.slice(-1) === "/";
9846         if (isDir && !slash)
9847           m += "/";
9848         else if (!isDir && slash)
9849           m = m.slice(0, -1);
9850         if (m !== p) {
9851           var mabs = makeAbs(self2, m);
9852           self2.statCache[mabs] = self2.statCache[abs];
9853           self2.cache[mabs] = self2.cache[abs];
9854         }
9855       }
9856       return m;
9857     }
9858     function makeAbs(self2, f) {
9859       var abs = f;
9860       if (f.charAt(0) === "/") {
9861         abs = path2.join(self2.root, f);
9862       } else if (isAbsolute(f) || f === "") {
9863         abs = f;
9864       } else if (self2.changedCwd) {
9865         abs = path2.resolve(self2.cwd, f);
9866       } else {
9867         abs = path2.resolve(f);
9868       }
9869       if (process.platform === "win32")
9870         abs = abs.replace(/\\/g, "/");
9871       return abs;
9872     }
9873     function isIgnored(self2, path3) {
9874       if (!self2.ignore.length)
9875         return false;
9876       return self2.ignore.some(function(item) {
9877         return item.matcher.match(path3) || !!(item.gmatcher && item.gmatcher.match(path3));
9878       });
9879     }
9880     function childrenIgnored(self2, path3) {
9881       if (!self2.ignore.length)
9882         return false;
9883       return self2.ignore.some(function(item) {
9884         return !!(item.gmatcher && item.gmatcher.match(path3));
9885       });
9886     }
9887   }
9888 });
9889
9890 // node_modules/glob/sync.js
9891 var require_sync = __commonJS({
9892   "node_modules/glob/sync.js"(exports2, module2) {
9893     module2.exports = globSync;
9894     globSync.GlobSync = GlobSync;
9895     var fs2 = require("fs");
9896     var rp = require_fs();
9897     var minimatch = require_minimatch();
9898     var Minimatch = minimatch.Minimatch;
9899     var Glob = require_glob().Glob;
9900     var util = require("util");
9901     var path2 = require("path");
9902     var assert = require("assert");
9903     var isAbsolute = require_path_is_absolute();
9904     var common2 = require_common();
9905     var alphasort = common2.alphasort;
9906     var alphasorti = common2.alphasorti;
9907     var setopts = common2.setopts;
9908     var ownProp = common2.ownProp;
9909     var childrenIgnored = common2.childrenIgnored;
9910     var isIgnored = common2.isIgnored;
9911     function globSync(pattern, options) {
9912       if (typeof options === "function" || arguments.length === 3)
9913         throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");
9914       return new GlobSync(pattern, options).found;
9915     }
9916     function GlobSync(pattern, options) {
9917       if (!pattern)
9918         throw new Error("must provide pattern");
9919       if (typeof options === "function" || arguments.length === 3)
9920         throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");
9921       if (!(this instanceof GlobSync))
9922         return new GlobSync(pattern, options);
9923       setopts(this, pattern, options);
9924       if (this.noprocess)
9925         return this;
9926       var n = this.minimatch.set.length;
9927       this.matches = new Array(n);
9928       for (var i = 0; i < n; i++) {
9929         this._process(this.minimatch.set[i], i, false);
9930       }
9931       this._finish();
9932     }
9933     GlobSync.prototype._finish = function() {
9934       assert(this instanceof GlobSync);
9935       if (this.realpath) {
9936         var self2 = this;
9937         this.matches.forEach(function(matchset, index) {
9938           var set = self2.matches[index] = Object.create(null);
9939           for (var p in matchset) {
9940             try {
9941               p = self2._makeAbs(p);
9942               var real = rp.realpathSync(p, self2.realpathCache);
9943               set[real] = true;
9944             } catch (er) {
9945               if (er.syscall === "stat")
9946                 set[self2._makeAbs(p)] = true;
9947               else
9948                 throw er;
9949             }
9950           }
9951         });
9952       }
9953       common2.finish(this);
9954     };
9955     GlobSync.prototype._process = function(pattern, index, inGlobStar) {
9956       assert(this instanceof GlobSync);
9957       var n = 0;
9958       while (typeof pattern[n] === "string") {
9959         n++;
9960       }
9961       var prefix;
9962       switch (n) {
9963         case pattern.length:
9964           this._processSimple(pattern.join("/"), index);
9965           return;
9966         case 0:
9967           prefix = null;
9968           break;
9969         default:
9970           prefix = pattern.slice(0, n).join("/");
9971           break;
9972       }
9973       var remain = pattern.slice(n);
9974       var read;
9975       if (prefix === null)
9976         read = ".";
9977       else if (isAbsolute(prefix) || isAbsolute(pattern.join("/"))) {
9978         if (!prefix || !isAbsolute(prefix))
9979           prefix = "/" + prefix;
9980         read = prefix;
9981       } else
9982         read = prefix;
9983       var abs = this._makeAbs(read);
9984       if (childrenIgnored(this, read))
9985         return;
9986       var isGlobStar = remain[0] === minimatch.GLOBSTAR;
9987       if (isGlobStar)
9988         this._processGlobStar(prefix, read, abs, remain, index, inGlobStar);
9989       else
9990         this._processReaddir(prefix, read, abs, remain, index, inGlobStar);
9991     };
9992     GlobSync.prototype._processReaddir = function(prefix, read, abs, remain, index, inGlobStar) {
9993       var entries = this._readdir(abs, inGlobStar);
9994       if (!entries)
9995         return;
9996       var pn = remain[0];
9997       var negate = !!this.minimatch.negate;
9998       var rawGlob = pn._glob;
9999       var dotOk = this.dot || rawGlob.charAt(0) === ".";
10000       var matchedEntries = [];
10001       for (var i = 0; i < entries.length; i++) {
10002         var e = entries[i];
10003         if (e.charAt(0) !== "." || dotOk) {
10004           var m;
10005           if (negate && !prefix) {
10006             m = !e.match(pn);
10007           } else {
10008             m = e.match(pn);
10009           }
10010           if (m)
10011             matchedEntries.push(e);
10012         }
10013       }
10014       var len = matchedEntries.length;
10015       if (len === 0)
10016         return;
10017       if (remain.length === 1 && !this.mark && !this.stat) {
10018         if (!this.matches[index])
10019           this.matches[index] = Object.create(null);
10020         for (var i = 0; i < len; i++) {
10021           var e = matchedEntries[i];
10022           if (prefix) {
10023             if (prefix.slice(-1) !== "/")
10024               e = prefix + "/" + e;
10025             else
10026               e = prefix + e;
10027           }
10028           if (e.charAt(0) === "/" && !this.nomount) {
10029             e = path2.join(this.root, e);
10030           }
10031           this._emitMatch(index, e);
10032         }
10033         return;
10034       }
10035       remain.shift();
10036       for (var i = 0; i < len; i++) {
10037         var e = matchedEntries[i];
10038         var newPattern;
10039         if (prefix)
10040           newPattern = [prefix, e];
10041         else
10042           newPattern = [e];
10043         this._process(newPattern.concat(remain), index, inGlobStar);
10044       }
10045     };
10046     GlobSync.prototype._emitMatch = function(index, e) {
10047       if (isIgnored(this, e))
10048         return;
10049       var abs = this._makeAbs(e);
10050       if (this.mark)
10051         e = this._mark(e);
10052       if (this.absolute) {
10053         e = abs;
10054       }
10055       if (this.matches[index][e])
10056         return;
10057       if (this.nodir) {
10058         var c = this.cache[abs];
10059         if (c === "DIR" || Array.isArray(c))
10060           return;
10061       }
10062       this.matches[index][e] = true;
10063       if (this.stat)
10064         this._stat(e);
10065     };
10066     GlobSync.prototype._readdirInGlobStar = function(abs) {
10067       if (this.follow)
10068         return this._readdir(abs, false);
10069       var entries;
10070       var lstat;
10071       var stat;
10072       try {
10073         lstat = fs2.lstatSync(abs);
10074       } catch (er) {
10075         if (er.code === "ENOENT") {
10076           return null;
10077         }
10078       }
10079       var isSym = lstat && lstat.isSymbolicLink();
10080       this.symlinks[abs] = isSym;
10081       if (!isSym && lstat && !lstat.isDirectory())
10082         this.cache[abs] = "FILE";
10083       else
10084         entries = this._readdir(abs, false);
10085       return entries;
10086     };
10087     GlobSync.prototype._readdir = function(abs, inGlobStar) {
10088       var entries;
10089       if (inGlobStar && !ownProp(this.symlinks, abs))
10090         return this._readdirInGlobStar(abs);
10091       if (ownProp(this.cache, abs)) {
10092         var c = this.cache[abs];
10093         if (!c || c === "FILE")
10094           return null;
10095         if (Array.isArray(c))
10096           return c;
10097       }
10098       try {
10099         return this._readdirEntries(abs, fs2.readdirSync(abs));
10100       } catch (er) {
10101         this._readdirError(abs, er);
10102         return null;
10103       }
10104     };
10105     GlobSync.prototype._readdirEntries = function(abs, entries) {
10106       if (!this.mark && !this.stat) {
10107         for (var i = 0; i < entries.length; i++) {
10108           var e = entries[i];
10109           if (abs === "/")
10110             e = abs + e;
10111           else
10112             e = abs + "/" + e;
10113           this.cache[e] = true;
10114         }
10115       }
10116       this.cache[abs] = entries;
10117       return entries;
10118     };
10119     GlobSync.prototype._readdirError = function(f, er) {
10120       switch (er.code) {
10121         case "ENOTSUP":
10122         case "ENOTDIR":
10123           var abs = this._makeAbs(f);
10124           this.cache[abs] = "FILE";
10125           if (abs === this.cwdAbs) {
10126             var error = new Error(er.code + " invalid cwd " + this.cwd);
10127             error.path = this.cwd;
10128             error.code = er.code;
10129             throw error;
10130           }
10131           break;
10132         case "ENOENT":
10133         case "ELOOP":
10134         case "ENAMETOOLONG":
10135         case "UNKNOWN":
10136           this.cache[this._makeAbs(f)] = false;
10137           break;
10138         default:
10139           this.cache[this._makeAbs(f)] = false;
10140           if (this.strict)
10141             throw er;
10142           if (!this.silent)
10143             console.error("glob error", er);
10144           break;
10145       }
10146     };
10147     GlobSync.prototype._processGlobStar = function(prefix, read, abs, remain, index, inGlobStar) {
10148       var entries = this._readdir(abs, inGlobStar);
10149       if (!entries)
10150         return;
10151       var remainWithoutGlobStar = remain.slice(1);
10152       var gspref = prefix ? [prefix] : [];
10153       var noGlobStar = gspref.concat(remainWithoutGlobStar);
10154       this._process(noGlobStar, index, false);
10155       var len = entries.length;
10156       var isSym = this.symlinks[abs];
10157       if (isSym && inGlobStar)
10158         return;
10159       for (var i = 0; i < len; i++) {
10160         var e = entries[i];
10161         if (e.charAt(0) === "." && !this.dot)
10162           continue;
10163         var instead = gspref.concat(entries[i], remainWithoutGlobStar);
10164         this._process(instead, index, true);
10165         var below = gspref.concat(entries[i], remain);
10166         this._process(below, index, true);
10167       }
10168     };
10169     GlobSync.prototype._processSimple = function(prefix, index) {
10170       var exists = this._stat(prefix);
10171       if (!this.matches[index])
10172         this.matches[index] = Object.create(null);
10173       if (!exists)
10174         return;
10175       if (prefix && isAbsolute(prefix) && !this.nomount) {
10176         var trail = /[\/\\]$/.test(prefix);
10177         if (prefix.charAt(0) === "/") {
10178           prefix = path2.join(this.root, prefix);
10179         } else {
10180           prefix = path2.resolve(this.root, prefix);
10181           if (trail)
10182             prefix += "/";
10183         }
10184       }
10185       if (process.platform === "win32")
10186         prefix = prefix.replace(/\\/g, "/");
10187       this._emitMatch(index, prefix);
10188     };
10189     GlobSync.prototype._stat = function(f) {
10190       var abs = this._makeAbs(f);
10191       var needDir = f.slice(-1) === "/";
10192       if (f.length > this.maxLength)
10193         return false;
10194       if (!this.stat && ownProp(this.cache, abs)) {
10195         var c = this.cache[abs];
10196         if (Array.isArray(c))
10197           c = "DIR";
10198         if (!needDir || c === "DIR")
10199           return c;
10200         if (needDir && c === "FILE")
10201           return false;
10202       }
10203       var exists;
10204       var stat = this.statCache[abs];
10205       if (!stat) {
10206         var lstat;
10207         try {
10208           lstat = fs2.lstatSync(abs);
10209         } catch (er) {
10210           if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) {
10211             this.statCache[abs] = false;
10212             return false;
10213           }
10214         }
10215         if (lstat && lstat.isSymbolicLink()) {
10216           try {
10217             stat = fs2.statSync(abs);
10218           } catch (er) {
10219             stat = lstat;
10220           }
10221         } else {
10222           stat = lstat;
10223         }
10224       }
10225       this.statCache[abs] = stat;
10226       var c = true;
10227       if (stat)
10228         c = stat.isDirectory() ? "DIR" : "FILE";
10229       this.cache[abs] = this.cache[abs] || c;
10230       if (needDir && c === "FILE")
10231         return false;
10232       return c;
10233     };
10234     GlobSync.prototype._mark = function(p) {
10235       return common2.mark(this, p);
10236     };
10237     GlobSync.prototype._makeAbs = function(f) {
10238       return common2.makeAbs(this, f);
10239     };
10240   }
10241 });
10242
10243 // node_modules/wrappy/wrappy.js
10244 var require_wrappy = __commonJS({
10245   "node_modules/wrappy/wrappy.js"(exports2, module2) {
10246     module2.exports = wrappy;
10247     function wrappy(fn, cb) {
10248       if (fn && cb)
10249         return wrappy(fn)(cb);
10250       if (typeof fn !== "function")
10251         throw new TypeError("need wrapper function");
10252       Object.keys(fn).forEach(function(k) {
10253         wrapper[k] = fn[k];
10254       });
10255       return wrapper;
10256       function wrapper() {
10257         var args = new Array(arguments.length);
10258         for (var i = 0; i < args.length; i++) {
10259           args[i] = arguments[i];
10260         }
10261         var ret2 = fn.apply(this, args);
10262         var cb2 = args[args.length - 1];
10263         if (typeof ret2 === "function" && ret2 !== cb2) {
10264           Object.keys(cb2).forEach(function(k) {
10265             ret2[k] = cb2[k];
10266           });
10267         }
10268         return ret2;
10269       }
10270     }
10271   }
10272 });
10273
10274 // node_modules/once/once.js
10275 var require_once = __commonJS({
10276   "node_modules/once/once.js"(exports2, module2) {
10277     var wrappy = require_wrappy();
10278     module2.exports = wrappy(once);
10279     module2.exports.strict = wrappy(onceStrict);
10280     once.proto = once(function() {
10281       Object.defineProperty(Function.prototype, "once", {
10282         value: function() {
10283           return once(this);
10284         },
10285         configurable: true
10286       });
10287       Object.defineProperty(Function.prototype, "onceStrict", {
10288         value: function() {
10289           return onceStrict(this);
10290         },
10291         configurable: true
10292       });
10293     });
10294     function once(fn) {
10295       var f = function() {
10296         if (f.called)
10297           return f.value;
10298         f.called = true;
10299         return f.value = fn.apply(this, arguments);
10300       };
10301       f.called = false;
10302       return f;
10303     }
10304     function onceStrict(fn) {
10305       var f = function() {
10306         if (f.called)
10307           throw new Error(f.onceError);
10308         f.called = true;
10309         return f.value = fn.apply(this, arguments);
10310       };
10311       var name = fn.name || "Function wrapped with `once`";
10312       f.onceError = name + " shouldn't be called more than once";
10313       f.called = false;
10314       return f;
10315     }
10316   }
10317 });
10318
10319 // node_modules/inflight/inflight.js
10320 var require_inflight = __commonJS({
10321   "node_modules/inflight/inflight.js"(exports2, module2) {
10322     var wrappy = require_wrappy();
10323     var reqs = Object.create(null);
10324     var once = require_once();
10325     module2.exports = wrappy(inflight);
10326     function inflight(key, cb) {
10327       if (reqs[key]) {
10328         reqs[key].push(cb);
10329         return null;
10330       } else {
10331         reqs[key] = [cb];
10332         return makeres(key);
10333       }
10334     }
10335     function makeres(key) {
10336       return once(function RES() {
10337         var cbs = reqs[key];
10338         var len = cbs.length;
10339         var args = slice(arguments);
10340         try {
10341           for (var i = 0; i < len; i++) {
10342             cbs[i].apply(null, args);
10343           }
10344         } finally {
10345           if (cbs.length > len) {
10346             cbs.splice(0, len);
10347             process.nextTick(function() {
10348               RES.apply(null, args);
10349             });
10350           } else {
10351             delete reqs[key];
10352           }
10353         }
10354       });
10355     }
10356     function slice(args) {
10357       var length = args.length;
10358       var array = [];
10359       for (var i = 0; i < length; i++)
10360         array[i] = args[i];
10361       return array;
10362     }
10363   }
10364 });
10365
10366 // node_modules/glob/glob.js
10367 var require_glob = __commonJS({
10368   "node_modules/glob/glob.js"(exports2, module2) {
10369     module2.exports = glob;
10370     var fs2 = require("fs");
10371     var rp = require_fs();
10372     var minimatch = require_minimatch();
10373     var Minimatch = minimatch.Minimatch;
10374     var inherits2 = require_inherits();
10375     var EE = require("events").EventEmitter;
10376     var path2 = require("path");
10377     var assert = require("assert");
10378     var isAbsolute = require_path_is_absolute();
10379     var globSync = require_sync();
10380     var common2 = require_common();
10381     var alphasort = common2.alphasort;
10382     var alphasorti = common2.alphasorti;
10383     var setopts = common2.setopts;
10384     var ownProp = common2.ownProp;
10385     var inflight = require_inflight();
10386     var util = require("util");
10387     var childrenIgnored = common2.childrenIgnored;
10388     var isIgnored = common2.isIgnored;
10389     var once = require_once();
10390     function glob(pattern, options, cb) {
10391       if (typeof options === "function")
10392         cb = options, options = {};
10393       if (!options)
10394         options = {};
10395       if (options.sync) {
10396         if (cb)
10397           throw new TypeError("callback provided to sync glob");
10398         return globSync(pattern, options);
10399       }
10400       return new Glob(pattern, options, cb);
10401     }
10402     glob.sync = globSync;
10403     var GlobSync = glob.GlobSync = globSync.GlobSync;
10404     glob.glob = glob;
10405     function extend(origin, add) {
10406       if (add === null || typeof add !== "object") {
10407         return origin;
10408       }
10409       var keys = Object.keys(add);
10410       var i = keys.length;
10411       while (i--) {
10412         origin[keys[i]] = add[keys[i]];
10413       }
10414       return origin;
10415     }
10416     glob.hasMagic = function(pattern, options_) {
10417       var options = extend({}, options_);
10418       options.noprocess = true;
10419       var g = new Glob(pattern, options);
10420       var set = g.minimatch.set;
10421       if (!pattern)
10422         return false;
10423       if (set.length > 1)
10424         return true;
10425       for (var j = 0; j < set[0].length; j++) {
10426         if (typeof set[0][j] !== "string")
10427           return true;
10428       }
10429       return false;
10430     };
10431     glob.Glob = Glob;
10432     inherits2(Glob, EE);
10433     function Glob(pattern, options, cb) {
10434       if (typeof options === "function") {
10435         cb = options;
10436         options = null;
10437       }
10438       if (options && options.sync) {
10439         if (cb)
10440           throw new TypeError("callback provided to sync glob");
10441         return new GlobSync(pattern, options);
10442       }
10443       if (!(this instanceof Glob))
10444         return new Glob(pattern, options, cb);
10445       setopts(this, pattern, options);
10446       this._didRealPath = false;
10447       var n = this.minimatch.set.length;
10448       this.matches = new Array(n);
10449       if (typeof cb === "function") {
10450         cb = once(cb);
10451         this.on("error", cb);
10452         this.on("end", function(matches) {
10453           cb(null, matches);
10454         });
10455       }
10456       var self2 = this;
10457       this._processing = 0;
10458       this._emitQueue = [];
10459       this._processQueue = [];
10460       this.paused = false;
10461       if (this.noprocess)
10462         return this;
10463       if (n === 0)
10464         return done();
10465       var sync = true;
10466       for (var i = 0; i < n; i++) {
10467         this._process(this.minimatch.set[i], i, false, done);
10468       }
10469       sync = false;
10470       function done() {
10471         --self2._processing;
10472         if (self2._processing <= 0) {
10473           if (sync) {
10474             process.nextTick(function() {
10475               self2._finish();
10476             });
10477           } else {
10478             self2._finish();
10479           }
10480         }
10481       }
10482     }
10483     Glob.prototype._finish = function() {
10484       assert(this instanceof Glob);
10485       if (this.aborted)
10486         return;
10487       if (this.realpath && !this._didRealpath)
10488         return this._realpath();
10489       common2.finish(this);
10490       this.emit("end", this.found);
10491     };
10492     Glob.prototype._realpath = function() {
10493       if (this._didRealpath)
10494         return;
10495       this._didRealpath = true;
10496       var n = this.matches.length;
10497       if (n === 0)
10498         return this._finish();
10499       var self2 = this;
10500       for (var i = 0; i < this.matches.length; i++)
10501         this._realpathSet(i, next);
10502       function next() {
10503         if (--n === 0)
10504           self2._finish();
10505       }
10506     };
10507     Glob.prototype._realpathSet = function(index, cb) {
10508       var matchset = this.matches[index];
10509       if (!matchset)
10510         return cb();
10511       var found = Object.keys(matchset);
10512       var self2 = this;
10513       var n = found.length;
10514       if (n === 0)
10515         return cb();
10516       var set = this.matches[index] = Object.create(null);
10517       found.forEach(function(p, i) {
10518         p = self2._makeAbs(p);
10519         rp.realpath(p, self2.realpathCache, function(er, real) {
10520           if (!er)
10521             set[real] = true;
10522           else if (er.syscall === "stat")
10523             set[p] = true;
10524           else
10525             self2.emit("error", er);
10526           if (--n === 0) {
10527             self2.matches[index] = set;
10528             cb();
10529           }
10530         });
10531       });
10532     };
10533     Glob.prototype._mark = function(p) {
10534       return common2.mark(this, p);
10535     };
10536     Glob.prototype._makeAbs = function(f) {
10537       return common2.makeAbs(this, f);
10538     };
10539     Glob.prototype.abort = function() {
10540       this.aborted = true;
10541       this.emit("abort");
10542     };
10543     Glob.prototype.pause = function() {
10544       if (!this.paused) {
10545         this.paused = true;
10546         this.emit("pause");
10547       }
10548     };
10549     Glob.prototype.resume = function() {
10550       if (this.paused) {
10551         this.emit("resume");
10552         this.paused = false;
10553         if (this._emitQueue.length) {
10554           var eq = this._emitQueue.slice(0);
10555           this._emitQueue.length = 0;
10556           for (var i = 0; i < eq.length; i++) {
10557             var e = eq[i];
10558             this._emitMatch(e[0], e[1]);
10559           }
10560         }
10561         if (this._processQueue.length) {
10562           var pq = this._processQueue.slice(0);
10563           this._processQueue.length = 0;
10564           for (var i = 0; i < pq.length; i++) {
10565             var p = pq[i];
10566             this._processing--;
10567             this._process(p[0], p[1], p[2], p[3]);
10568           }
10569         }
10570       }
10571     };
10572     Glob.prototype._process = function(pattern, index, inGlobStar, cb) {
10573       assert(this instanceof Glob);
10574       assert(typeof cb === "function");
10575       if (this.aborted)
10576         return;
10577       this._processing++;
10578       if (this.paused) {
10579         this._processQueue.push([pattern, index, inGlobStar, cb]);
10580         return;
10581       }
10582       var n = 0;
10583       while (typeof pattern[n] === "string") {
10584         n++;
10585       }
10586       var prefix;
10587       switch (n) {
10588         case pattern.length:
10589           this._processSimple(pattern.join("/"), index, cb);
10590           return;
10591         case 0:
10592           prefix = null;
10593           break;
10594         default:
10595           prefix = pattern.slice(0, n).join("/");
10596           break;
10597       }
10598       var remain = pattern.slice(n);
10599       var read;
10600       if (prefix === null)
10601         read = ".";
10602       else if (isAbsolute(prefix) || isAbsolute(pattern.join("/"))) {
10603         if (!prefix || !isAbsolute(prefix))
10604           prefix = "/" + prefix;
10605         read = prefix;
10606       } else
10607         read = prefix;
10608       var abs = this._makeAbs(read);
10609       if (childrenIgnored(this, read))
10610         return cb();
10611       var isGlobStar = remain[0] === minimatch.GLOBSTAR;
10612       if (isGlobStar)
10613         this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb);
10614       else
10615         this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb);
10616     };
10617     Glob.prototype._processReaddir = function(prefix, read, abs, remain, index, inGlobStar, cb) {
10618       var self2 = this;
10619       this._readdir(abs, inGlobStar, function(er, entries) {
10620         return self2._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb);
10621       });
10622     };
10623     Glob.prototype._processReaddir2 = function(prefix, read, abs, remain, index, inGlobStar, entries, cb) {
10624       if (!entries)
10625         return cb();
10626       var pn = remain[0];
10627       var negate = !!this.minimatch.negate;
10628       var rawGlob = pn._glob;
10629       var dotOk = this.dot || rawGlob.charAt(0) === ".";
10630       var matchedEntries = [];
10631       for (var i = 0; i < entries.length; i++) {
10632         var e = entries[i];
10633         if (e.charAt(0) !== "." || dotOk) {
10634           var m;
10635           if (negate && !prefix) {
10636             m = !e.match(pn);
10637           } else {
10638             m = e.match(pn);
10639           }
10640           if (m)
10641             matchedEntries.push(e);
10642         }
10643       }
10644       var len = matchedEntries.length;
10645       if (len === 0)
10646         return cb();
10647       if (remain.length === 1 && !this.mark && !this.stat) {
10648         if (!this.matches[index])
10649           this.matches[index] = Object.create(null);
10650         for (var i = 0; i < len; i++) {
10651           var e = matchedEntries[i];
10652           if (prefix) {
10653             if (prefix !== "/")
10654               e = prefix + "/" + e;
10655             else
10656               e = prefix + e;
10657           }
10658           if (e.charAt(0) === "/" && !this.nomount) {
10659             e = path2.join(this.root, e);
10660           }
10661           this._emitMatch(index, e);
10662         }
10663         return cb();
10664       }
10665       remain.shift();
10666       for (var i = 0; i < len; i++) {
10667         var e = matchedEntries[i];
10668         var newPattern;
10669         if (prefix) {
10670           if (prefix !== "/")
10671             e = prefix + "/" + e;
10672           else
10673             e = prefix + e;
10674         }
10675         this._process([e].concat(remain), index, inGlobStar, cb);
10676       }
10677       cb();
10678     };
10679     Glob.prototype._emitMatch = function(index, e) {
10680       if (this.aborted)
10681         return;
10682       if (isIgnored(this, e))
10683         return;
10684       if (this.paused) {
10685         this._emitQueue.push([index, e]);
10686         return;
10687       }
10688       var abs = isAbsolute(e) ? e : this._makeAbs(e);
10689       if (this.mark)
10690         e = this._mark(e);
10691       if (this.absolute)
10692         e = abs;
10693       if (this.matches[index][e])
10694         return;
10695       if (this.nodir) {
10696         var c = this.cache[abs];
10697         if (c === "DIR" || Array.isArray(c))
10698           return;
10699       }
10700       this.matches[index][e] = true;
10701       var st = this.statCache[abs];
10702       if (st)
10703         this.emit("stat", e, st);
10704       this.emit("match", e);
10705     };
10706     Glob.prototype._readdirInGlobStar = function(abs, cb) {
10707       if (this.aborted)
10708         return;
10709       if (this.follow)
10710         return this._readdir(abs, false, cb);
10711       var lstatkey = "lstat\0" + abs;
10712       var self2 = this;
10713       var lstatcb = inflight(lstatkey, lstatcb_);
10714       if (lstatcb)
10715         fs2.lstat(abs, lstatcb);
10716       function lstatcb_(er, lstat) {
10717         if (er && er.code === "ENOENT")
10718           return cb();
10719         var isSym = lstat && lstat.isSymbolicLink();
10720         self2.symlinks[abs] = isSym;
10721         if (!isSym && lstat && !lstat.isDirectory()) {
10722           self2.cache[abs] = "FILE";
10723           cb();
10724         } else
10725           self2._readdir(abs, false, cb);
10726       }
10727     };
10728     Glob.prototype._readdir = function(abs, inGlobStar, cb) {
10729       if (this.aborted)
10730         return;
10731       cb = inflight("readdir\0" + abs + "\0" + inGlobStar, cb);
10732       if (!cb)
10733         return;
10734       if (inGlobStar && !ownProp(this.symlinks, abs))
10735         return this._readdirInGlobStar(abs, cb);
10736       if (ownProp(this.cache, abs)) {
10737         var c = this.cache[abs];
10738         if (!c || c === "FILE")
10739           return cb();
10740         if (Array.isArray(c))
10741           return cb(null, c);
10742       }
10743       var self2 = this;
10744       fs2.readdir(abs, readdirCb(this, abs, cb));
10745     };
10746     function readdirCb(self2, abs, cb) {
10747       return function(er, entries) {
10748         if (er)
10749           self2._readdirError(abs, er, cb);
10750         else
10751           self2._readdirEntries(abs, entries, cb);
10752       };
10753     }
10754     Glob.prototype._readdirEntries = function(abs, entries, cb) {
10755       if (this.aborted)
10756         return;
10757       if (!this.mark && !this.stat) {
10758         for (var i = 0; i < entries.length; i++) {
10759           var e = entries[i];
10760           if (abs === "/")
10761             e = abs + e;
10762           else
10763             e = abs + "/" + e;
10764           this.cache[e] = true;
10765         }
10766       }
10767       this.cache[abs] = entries;
10768       return cb(null, entries);
10769     };
10770     Glob.prototype._readdirError = function(f, er, cb) {
10771       if (this.aborted)
10772         return;
10773       switch (er.code) {
10774         case "ENOTSUP":
10775         case "ENOTDIR":
10776           var abs = this._makeAbs(f);
10777           this.cache[abs] = "FILE";
10778           if (abs === this.cwdAbs) {
10779             var error = new Error(er.code + " invalid cwd " + this.cwd);
10780             error.path = this.cwd;
10781             error.code = er.code;
10782             this.emit("error", error);
10783             this.abort();
10784           }
10785           break;
10786         case "ENOENT":
10787         case "ELOOP":
10788         case "ENAMETOOLONG":
10789         case "UNKNOWN":
10790           this.cache[this._makeAbs(f)] = false;
10791           break;
10792         default:
10793           this.cache[this._makeAbs(f)] = false;
10794           if (this.strict) {
10795             this.emit("error", er);
10796             this.abort();
10797           }
10798           if (!this.silent)
10799             console.error("glob error", er);
10800           break;
10801       }
10802       return cb();
10803     };
10804     Glob.prototype._processGlobStar = function(prefix, read, abs, remain, index, inGlobStar, cb) {
10805       var self2 = this;
10806       this._readdir(abs, inGlobStar, function(er, entries) {
10807         self2._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb);
10808       });
10809     };
10810     Glob.prototype._processGlobStar2 = function(prefix, read, abs, remain, index, inGlobStar, entries, cb) {
10811       if (!entries)
10812         return cb();
10813       var remainWithoutGlobStar = remain.slice(1);
10814       var gspref = prefix ? [prefix] : [];
10815       var noGlobStar = gspref.concat(remainWithoutGlobStar);
10816       this._process(noGlobStar, index, false, cb);
10817       var isSym = this.symlinks[abs];
10818       var len = entries.length;
10819       if (isSym && inGlobStar)
10820         return cb();
10821       for (var i = 0; i < len; i++) {
10822         var e = entries[i];
10823         if (e.charAt(0) === "." && !this.dot)
10824           continue;
10825         var instead = gspref.concat(entries[i], remainWithoutGlobStar);
10826         this._process(instead, index, true, cb);
10827         var below = gspref.concat(entries[i], remain);
10828         this._process(below, index, true, cb);
10829       }
10830       cb();
10831     };
10832     Glob.prototype._processSimple = function(prefix, index, cb) {
10833       var self2 = this;
10834       this._stat(prefix, function(er, exists) {
10835         self2._processSimple2(prefix, index, er, exists, cb);
10836       });
10837     };
10838     Glob.prototype._processSimple2 = function(prefix, index, er, exists, cb) {
10839       if (!this.matches[index])
10840         this.matches[index] = Object.create(null);
10841       if (!exists)
10842         return cb();
10843       if (prefix && isAbsolute(prefix) && !this.nomount) {
10844         var trail = /[\/\\]$/.test(prefix);
10845         if (prefix.charAt(0) === "/") {
10846           prefix = path2.join(this.root, prefix);
10847         } else {
10848           prefix = path2.resolve(this.root, prefix);
10849           if (trail)
10850             prefix += "/";
10851         }
10852       }
10853       if (process.platform === "win32")
10854         prefix = prefix.replace(/\\/g, "/");
10855       this._emitMatch(index, prefix);
10856       cb();
10857     };
10858     Glob.prototype._stat = function(f, cb) {
10859       var abs = this._makeAbs(f);
10860       var needDir = f.slice(-1) === "/";
10861       if (f.length > this.maxLength)
10862         return cb();
10863       if (!this.stat && ownProp(this.cache, abs)) {
10864         var c = this.cache[abs];
10865         if (Array.isArray(c))
10866           c = "DIR";
10867         if (!needDir || c === "DIR")
10868           return cb(null, c);
10869         if (needDir && c === "FILE")
10870           return cb();
10871       }
10872       var exists;
10873       var stat = this.statCache[abs];
10874       if (stat !== void 0) {
10875         if (stat === false)
10876           return cb(null, stat);
10877         else {
10878           var type = stat.isDirectory() ? "DIR" : "FILE";
10879           if (needDir && type === "FILE")
10880             return cb();
10881           else
10882             return cb(null, type, stat);
10883         }
10884       }
10885       var self2 = this;
10886       var statcb = inflight("stat\0" + abs, lstatcb_);
10887       if (statcb)
10888         fs2.lstat(abs, statcb);
10889       function lstatcb_(er, lstat) {
10890         if (lstat && lstat.isSymbolicLink()) {
10891           return fs2.stat(abs, function(er2, stat2) {
10892             if (er2)
10893               self2._stat2(f, abs, null, lstat, cb);
10894             else
10895               self2._stat2(f, abs, er2, stat2, cb);
10896           });
10897         } else {
10898           self2._stat2(f, abs, er, lstat, cb);
10899         }
10900       }
10901     };
10902     Glob.prototype._stat2 = function(f, abs, er, stat, cb) {
10903       if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) {
10904         this.statCache[abs] = false;
10905         return cb();
10906       }
10907       var needDir = f.slice(-1) === "/";
10908       this.statCache[abs] = stat;
10909       if (abs.slice(-1) === "/" && stat && !stat.isDirectory())
10910         return cb(null, false, stat);
10911       var c = true;
10912       if (stat)
10913         c = stat.isDirectory() ? "DIR" : "FILE";
10914       this.cache[abs] = this.cache[abs] || c;
10915       if (needDir && c === "FILE")
10916         return cb();
10917       return cb(null, c, stat);
10918     };
10919   }
10920 });
10921
10922 // node_modules/rimraf/rimraf.js
10923 var require_rimraf = __commonJS({
10924   "node_modules/rimraf/rimraf.js"(exports2, module2) {
10925     var assert = require("assert");
10926     var path2 = require("path");
10927     var fs2 = require("fs");
10928     var glob = void 0;
10929     try {
10930       glob = require_glob();
10931     } catch (_err) {
10932     }
10933     var defaultGlobOpts = {
10934       nosort: true,
10935       silent: true
10936     };
10937     var timeout = 0;
10938     var isWindows = process.platform === "win32";
10939     var defaults = (options) => {
10940       const methods = [
10941         "unlink",
10942         "chmod",
10943         "stat",
10944         "lstat",
10945         "rmdir",
10946         "readdir"
10947       ];
10948       methods.forEach((m) => {
10949         options[m] = options[m] || fs2[m];
10950         m = m + "Sync";
10951         options[m] = options[m] || fs2[m];
10952       });
10953       options.maxBusyTries = options.maxBusyTries || 3;
10954       options.emfileWait = options.emfileWait || 1e3;
10955       if (options.glob === false) {
10956         options.disableGlob = true;
10957       }
10958       if (options.disableGlob !== true && glob === void 0) {
10959         throw Error("glob dependency not found, set `options.disableGlob = true` if intentional");
10960       }
10961       options.disableGlob = options.disableGlob || false;
10962       options.glob = options.glob || defaultGlobOpts;
10963     };
10964     var rimraf = (p, options, cb) => {
10965       if (typeof options === "function") {
10966         cb = options;
10967         options = {};
10968       }
10969       assert(p, "rimraf: missing path");
10970       assert.equal(typeof p, "string", "rimraf: path should be a string");
10971       assert.equal(typeof cb, "function", "rimraf: callback function required");
10972       assert(options, "rimraf: invalid options argument provided");
10973       assert.equal(typeof options, "object", "rimraf: options should be object");
10974       defaults(options);
10975       let busyTries = 0;
10976       let errState = null;
10977       let n = 0;
10978       const next = (er) => {
10979         errState = errState || er;
10980         if (--n === 0)
10981           cb(errState);
10982       };
10983       const afterGlob = (er, results2) => {
10984         if (er)
10985           return cb(er);
10986         n = results2.length;
10987         if (n === 0)
10988           return cb();
10989         results2.forEach((p2) => {
10990           const CB = (er2) => {
10991             if (er2) {
10992               if ((er2.code === "EBUSY" || er2.code === "ENOTEMPTY" || er2.code === "EPERM") && busyTries < options.maxBusyTries) {
10993                 busyTries++;
10994                 return setTimeout(() => rimraf_(p2, options, CB), busyTries * 100);
10995               }
10996               if (er2.code === "EMFILE" && timeout < options.emfileWait) {
10997                 return setTimeout(() => rimraf_(p2, options, CB), timeout++);
10998               }
10999               if (er2.code === "ENOENT")
11000                 er2 = null;
11001             }
11002             timeout = 0;
11003             next(er2);
11004           };
11005           rimraf_(p2, options, CB);
11006         });
11007       };
11008       if (options.disableGlob || !glob.hasMagic(p))
11009         return afterGlob(null, [p]);
11010       options.lstat(p, (er, stat) => {
11011         if (!er)
11012           return afterGlob(null, [p]);
11013         glob(p, options.glob, afterGlob);
11014       });
11015     };
11016     var rimraf_ = (p, options, cb) => {
11017       assert(p);
11018       assert(options);
11019       assert(typeof cb === "function");
11020       options.lstat(p, (er, st) => {
11021         if (er && er.code === "ENOENT")
11022           return cb(null);
11023         if (er && er.code === "EPERM" && isWindows)
11024           fixWinEPERM(p, options, er, cb);
11025         if (st && st.isDirectory())
11026           return rmdir(p, options, er, cb);
11027         options.unlink(p, (er2) => {
11028           if (er2) {
11029             if (er2.code === "ENOENT")
11030               return cb(null);
11031             if (er2.code === "EPERM")
11032               return isWindows ? fixWinEPERM(p, options, er2, cb) : rmdir(p, options, er2, cb);
11033             if (er2.code === "EISDIR")
11034               return rmdir(p, options, er2, cb);
11035           }
11036           return cb(er2);
11037         });
11038       });
11039     };
11040     var fixWinEPERM = (p, options, er, cb) => {
11041       assert(p);
11042       assert(options);
11043       assert(typeof cb === "function");
11044       options.chmod(p, 438, (er2) => {
11045         if (er2)
11046           cb(er2.code === "ENOENT" ? null : er);
11047         else
11048           options.stat(p, (er3, stats) => {
11049             if (er3)
11050               cb(er3.code === "ENOENT" ? null : er);
11051             else if (stats.isDirectory())
11052               rmdir(p, options, er, cb);
11053             else
11054               options.unlink(p, cb);
11055           });
11056       });
11057     };
11058     var fixWinEPERMSync = (p, options, er) => {
11059       assert(p);
11060       assert(options);
11061       try {
11062         options.chmodSync(p, 438);
11063       } catch (er2) {
11064         if (er2.code === "ENOENT")
11065           return;
11066         else
11067           throw er;
11068       }
11069       let stats;
11070       try {
11071         stats = options.statSync(p);
11072       } catch (er3) {
11073         if (er3.code === "ENOENT")
11074           return;
11075         else
11076           throw er;
11077       }
11078       if (stats.isDirectory())
11079         rmdirSync(p, options, er);
11080       else
11081         options.unlinkSync(p);
11082     };
11083     var rmdir = (p, options, originalEr, cb) => {
11084       assert(p);
11085       assert(options);
11086       assert(typeof cb === "function");
11087       options.rmdir(p, (er) => {
11088         if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM"))
11089           rmkids(p, options, cb);
11090         else if (er && er.code === "ENOTDIR")
11091           cb(originalEr);
11092         else
11093           cb(er);
11094       });
11095     };
11096     var rmkids = (p, options, cb) => {
11097       assert(p);
11098       assert(options);
11099       assert(typeof cb === "function");
11100       options.readdir(p, (er, files) => {
11101         if (er)
11102           return cb(er);
11103         let n = files.length;
11104         if (n === 0)
11105           return options.rmdir(p, cb);
11106         let errState;
11107         files.forEach((f) => {
11108           rimraf(path2.join(p, f), options, (er2) => {
11109             if (errState)
11110               return;
11111             if (er2)
11112               return cb(errState = er2);
11113             if (--n === 0)
11114               options.rmdir(p, cb);
11115           });
11116         });
11117       });
11118     };
11119     var rimrafSync = (p, options) => {
11120       options = options || {};
11121       defaults(options);
11122       assert(p, "rimraf: missing path");
11123       assert.equal(typeof p, "string", "rimraf: path should be a string");
11124       assert(options, "rimraf: missing options");
11125       assert.equal(typeof options, "object", "rimraf: options should be object");
11126       let results2;
11127       if (options.disableGlob || !glob.hasMagic(p)) {
11128         results2 = [p];
11129       } else {
11130         try {
11131           options.lstatSync(p);
11132           results2 = [p];
11133         } catch (er) {
11134           results2 = glob.sync(p, options.glob);
11135         }
11136       }
11137       if (!results2.length)
11138         return;
11139       for (let i = 0; i < results2.length; i++) {
11140         const p2 = results2[i];
11141         let st;
11142         try {
11143           st = options.lstatSync(p2);
11144         } catch (er) {
11145           if (er.code === "ENOENT")
11146             return;
11147           if (er.code === "EPERM" && isWindows)
11148             fixWinEPERMSync(p2, options, er);
11149         }
11150         try {
11151           if (st && st.isDirectory())
11152             rmdirSync(p2, options, null);
11153           else
11154             options.unlinkSync(p2);
11155         } catch (er) {
11156           if (er.code === "ENOENT")
11157             return;
11158           if (er.code === "EPERM")
11159             return isWindows ? fixWinEPERMSync(p2, options, er) : rmdirSync(p2, options, er);
11160           if (er.code !== "EISDIR")
11161             throw er;
11162           rmdirSync(p2, options, er);
11163         }
11164       }
11165     };
11166     var rmdirSync = (p, options, originalEr) => {
11167       assert(p);
11168       assert(options);
11169       try {
11170         options.rmdirSync(p);
11171       } catch (er) {
11172         if (er.code === "ENOENT")
11173           return;
11174         if (er.code === "ENOTDIR")
11175           throw originalEr;
11176         if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")
11177           rmkidsSync(p, options);
11178       }
11179     };
11180     var rmkidsSync = (p, options) => {
11181       assert(p);
11182       assert(options);
11183       options.readdirSync(p).forEach((f) => rimrafSync(path2.join(p, f), options));
11184       const retries = isWindows ? 100 : 1;
11185       let i = 0;
11186       do {
11187         let threw = true;
11188         try {
11189           const ret2 = options.rmdirSync(p, options);
11190           threw = false;
11191           return ret2;
11192         } finally {
11193           if (++i < retries && threw)
11194             continue;
11195         }
11196       } while (true);
11197     };
11198     module2.exports = rimraf;
11199     rimraf.sync = rimrafSync;
11200   }
11201 });
11202
11203 // node_modules/semver/internal/constants.js
11204 var require_constants2 = __commonJS({
11205   "node_modules/semver/internal/constants.js"(exports2, module2) {
11206     var SEMVER_SPEC_VERSION = "2.0.0";
11207     var MAX_LENGTH = 256;
11208     var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
11209     var MAX_SAFE_COMPONENT_LENGTH = 16;
11210     module2.exports = {
11211       SEMVER_SPEC_VERSION,
11212       MAX_LENGTH,
11213       MAX_SAFE_INTEGER,
11214       MAX_SAFE_COMPONENT_LENGTH
11215     };
11216   }
11217 });
11218
11219 // node_modules/semver/internal/debug.js
11220 var require_debug = __commonJS({
11221   "node_modules/semver/internal/debug.js"(exports2, module2) {
11222     var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
11223     };
11224     module2.exports = debug;
11225   }
11226 });
11227
11228 // node_modules/semver/internal/re.js
11229 var require_re = __commonJS({
11230   "node_modules/semver/internal/re.js"(exports2, module2) {
11231     var { MAX_SAFE_COMPONENT_LENGTH } = require_constants2();
11232     var debug = require_debug();
11233     exports2 = module2.exports = {};
11234     var re = exports2.re = [];
11235     var src = exports2.src = [];
11236     var t = exports2.t = {};
11237     var R = 0;
11238     var createToken = (name, value, isGlobal) => {
11239       const index = R++;
11240       debug(index, value);
11241       t[name] = index;
11242       src[index] = value;
11243       re[index] = new RegExp(value, isGlobal ? "g" : void 0);
11244     };
11245     createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
11246     createToken("NUMERICIDENTIFIERLOOSE", "[0-9]+");
11247     createToken("NONNUMERICIDENTIFIER", "\\d*[a-zA-Z-][a-zA-Z0-9-]*");
11248     createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
11249     createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
11250     createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NUMERICIDENTIFIER]}|${src[t.NONNUMERICIDENTIFIER]})`);
11251     createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NUMERICIDENTIFIERLOOSE]}|${src[t.NONNUMERICIDENTIFIER]})`);
11252     createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
11253     createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
11254     createToken("BUILDIDENTIFIER", "[0-9A-Za-z-]+");
11255     createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
11256     createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
11257     createToken("FULL", `^${src[t.FULLPLAIN]}$`);
11258     createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
11259     createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
11260     createToken("GTLT", "((?:<|>)?=?)");
11261     createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
11262     createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
11263     createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
11264     createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
11265     createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
11266     createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
11267     createToken("COERCE", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:$|[^\\d])`);
11268     createToken("COERCERTL", src[t.COERCE], true);
11269     createToken("LONETILDE", "(?:~>?)");
11270     createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
11271     exports2.tildeTrimReplace = "$1~";
11272     createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
11273     createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
11274     createToken("LONECARET", "(?:\\^)");
11275     createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
11276     exports2.caretTrimReplace = "$1^";
11277     createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
11278     createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
11279     createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
11280     createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
11281     createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
11282     exports2.comparatorTrimReplace = "$1$2$3";
11283     createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
11284     createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
11285     createToken("STAR", "(<|>)?=?\\s*\\*");
11286     createToken("GTE0", "^\\s*>=\\s*0.0.0\\s*$");
11287     createToken("GTE0PRE", "^\\s*>=\\s*0.0.0-0\\s*$");
11288   }
11289 });
11290
11291 // node_modules/semver/internal/parse-options.js
11292 var require_parse_options = __commonJS({
11293   "node_modules/semver/internal/parse-options.js"(exports2, module2) {
11294     var opts = ["includePrerelease", "loose", "rtl"];
11295     var parseOptions = (options) => !options ? {} : typeof options !== "object" ? { loose: true } : opts.filter((k) => options[k]).reduce((options2, k) => {
11296       options2[k] = true;
11297       return options2;
11298     }, {});
11299     module2.exports = parseOptions;
11300   }
11301 });
11302
11303 // node_modules/semver/internal/identifiers.js
11304 var require_identifiers = __commonJS({
11305   "node_modules/semver/internal/identifiers.js"(exports2, module2) {
11306     var numeric = /^[0-9]+$/;
11307     var compareIdentifiers = (a, b) => {
11308       const anum = numeric.test(a);
11309       const bnum = numeric.test(b);
11310       if (anum && bnum) {
11311         a = +a;
11312         b = +b;
11313       }
11314       return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
11315     };
11316     var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
11317     module2.exports = {
11318       compareIdentifiers,
11319       rcompareIdentifiers
11320     };
11321   }
11322 });
11323
11324 // node_modules/semver/classes/semver.js
11325 var require_semver = __commonJS({
11326   "node_modules/semver/classes/semver.js"(exports2, module2) {
11327     var debug = require_debug();
11328     var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants2();
11329     var { re, t } = require_re();
11330     var parseOptions = require_parse_options();
11331     var { compareIdentifiers } = require_identifiers();
11332     var SemVer = class {
11333       constructor(version, options) {
11334         options = parseOptions(options);
11335         if (version instanceof SemVer) {
11336           if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {
11337             return version;
11338           } else {
11339             version = version.version;
11340           }
11341         } else if (typeof version !== "string") {
11342           throw new TypeError(`Invalid Version: ${version}`);
11343         }
11344         if (version.length > MAX_LENGTH) {
11345           throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);
11346         }
11347         debug("SemVer", version, options);
11348         this.options = options;
11349         this.loose = !!options.loose;
11350         this.includePrerelease = !!options.includePrerelease;
11351         const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
11352         if (!m) {
11353           throw new TypeError(`Invalid Version: ${version}`);
11354         }
11355         this.raw = version;
11356         this.major = +m[1];
11357         this.minor = +m[2];
11358         this.patch = +m[3];
11359         if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
11360           throw new TypeError("Invalid major version");
11361         }
11362         if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
11363           throw new TypeError("Invalid minor version");
11364         }
11365         if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
11366           throw new TypeError("Invalid patch version");
11367         }
11368         if (!m[4]) {
11369           this.prerelease = [];
11370         } else {
11371           this.prerelease = m[4].split(".").map((id) => {
11372             if (/^[0-9]+$/.test(id)) {
11373               const num = +id;
11374               if (num >= 0 && num < MAX_SAFE_INTEGER) {
11375                 return num;
11376               }
11377             }
11378             return id;
11379           });
11380         }
11381         this.build = m[5] ? m[5].split(".") : [];
11382         this.format();
11383       }
11384       format() {
11385         this.version = `${this.major}.${this.minor}.${this.patch}`;
11386         if (this.prerelease.length) {
11387           this.version += `-${this.prerelease.join(".")}`;
11388         }
11389         return this.version;
11390       }
11391       toString() {
11392         return this.version;
11393       }
11394       compare(other) {
11395         debug("SemVer.compare", this.version, this.options, other);
11396         if (!(other instanceof SemVer)) {
11397           if (typeof other === "string" && other === this.version) {
11398             return 0;
11399           }
11400           other = new SemVer(other, this.options);
11401         }
11402         if (other.version === this.version) {
11403           return 0;
11404         }
11405         return this.compareMain(other) || this.comparePre(other);
11406       }
11407       compareMain(other) {
11408         if (!(other instanceof SemVer)) {
11409           other = new SemVer(other, this.options);
11410         }
11411         return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
11412       }
11413       comparePre(other) {
11414         if (!(other instanceof SemVer)) {
11415           other = new SemVer(other, this.options);
11416         }
11417         if (this.prerelease.length && !other.prerelease.length) {
11418           return -1;
11419         } else if (!this.prerelease.length && other.prerelease.length) {
11420           return 1;
11421         } else if (!this.prerelease.length && !other.prerelease.length) {
11422           return 0;
11423         }
11424         let i = 0;
11425         do {
11426           const a = this.prerelease[i];
11427           const b = other.prerelease[i];
11428           debug("prerelease compare", i, a, b);
11429           if (a === void 0 && b === void 0) {
11430             return 0;
11431           } else if (b === void 0) {
11432             return 1;
11433           } else if (a === void 0) {
11434             return -1;
11435           } else if (a === b) {
11436             continue;
11437           } else {
11438             return compareIdentifiers(a, b);
11439           }
11440         } while (++i);
11441       }
11442       compareBuild(other) {
11443         if (!(other instanceof SemVer)) {
11444           other = new SemVer(other, this.options);
11445         }
11446         let i = 0;
11447         do {
11448           const a = this.build[i];
11449           const b = other.build[i];
11450           debug("prerelease compare", i, a, b);
11451           if (a === void 0 && b === void 0) {
11452             return 0;
11453           } else if (b === void 0) {
11454             return 1;
11455           } else if (a === void 0) {
11456             return -1;
11457           } else if (a === b) {
11458             continue;
11459           } else {
11460             return compareIdentifiers(a, b);
11461           }
11462         } while (++i);
11463       }
11464       inc(release, identifier) {
11465         switch (release) {
11466           case "premajor":
11467             this.prerelease.length = 0;
11468             this.patch = 0;
11469             this.minor = 0;
11470             this.major++;
11471             this.inc("pre", identifier);
11472             break;
11473           case "preminor":
11474             this.prerelease.length = 0;
11475             this.patch = 0;
11476             this.minor++;
11477             this.inc("pre", identifier);
11478             break;
11479           case "prepatch":
11480             this.prerelease.length = 0;
11481             this.inc("patch", identifier);
11482             this.inc("pre", identifier);
11483             break;
11484           case "prerelease":
11485             if (this.prerelease.length === 0) {
11486               this.inc("patch", identifier);
11487             }
11488             this.inc("pre", identifier);
11489             break;
11490           case "major":
11491             if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
11492               this.major++;
11493             }
11494             this.minor = 0;
11495             this.patch = 0;
11496             this.prerelease = [];
11497             break;
11498           case "minor":
11499             if (this.patch !== 0 || this.prerelease.length === 0) {
11500               this.minor++;
11501             }
11502             this.patch = 0;
11503             this.prerelease = [];
11504             break;
11505           case "patch":
11506             if (this.prerelease.length === 0) {
11507               this.patch++;
11508             }
11509             this.prerelease = [];
11510             break;
11511           case "pre":
11512             if (this.prerelease.length === 0) {
11513               this.prerelease = [0];
11514             } else {
11515               let i = this.prerelease.length;
11516               while (--i >= 0) {
11517                 if (typeof this.prerelease[i] === "number") {
11518                   this.prerelease[i]++;
11519                   i = -2;
11520                 }
11521               }
11522               if (i === -1) {
11523                 this.prerelease.push(0);
11524               }
11525             }
11526             if (identifier) {
11527               if (this.prerelease[0] === identifier) {
11528                 if (isNaN(this.prerelease[1])) {
11529                   this.prerelease = [identifier, 0];
11530                 }
11531               } else {
11532                 this.prerelease = [identifier, 0];
11533               }
11534             }
11535             break;
11536           default:
11537             throw new Error(`invalid increment argument: ${release}`);
11538         }
11539         this.format();
11540         this.raw = this.version;
11541         return this;
11542       }
11543     };
11544     module2.exports = SemVer;
11545   }
11546 });
11547
11548 // node_modules/semver/functions/parse.js
11549 var require_parse2 = __commonJS({
11550   "node_modules/semver/functions/parse.js"(exports2, module2) {
11551     var { MAX_LENGTH } = require_constants2();
11552     var { re, t } = require_re();
11553     var SemVer = require_semver();
11554     var parseOptions = require_parse_options();
11555     var parse = (version, options) => {
11556       options = parseOptions(options);
11557       if (version instanceof SemVer) {
11558         return version;
11559       }
11560       if (typeof version !== "string") {
11561         return null;
11562       }
11563       if (version.length > MAX_LENGTH) {
11564         return null;
11565       }
11566       const r = options.loose ? re[t.LOOSE] : re[t.FULL];
11567       if (!r.test(version)) {
11568         return null;
11569       }
11570       try {
11571         return new SemVer(version, options);
11572       } catch (er) {
11573         return null;
11574       }
11575     };
11576     module2.exports = parse;
11577   }
11578 });
11579
11580 // node_modules/semver/functions/valid.js
11581 var require_valid = __commonJS({
11582   "node_modules/semver/functions/valid.js"(exports2, module2) {
11583     var parse = require_parse2();
11584     var valid = (version, options) => {
11585       const v = parse(version, options);
11586       return v ? v.version : null;
11587     };
11588     module2.exports = valid;
11589   }
11590 });
11591
11592 // node_modules/semver/functions/clean.js
11593 var require_clean = __commonJS({
11594   "node_modules/semver/functions/clean.js"(exports2, module2) {
11595     var parse = require_parse2();
11596     var clean = (version, options) => {
11597       const s = parse(version.trim().replace(/^[=v]+/, ""), options);
11598       return s ? s.version : null;
11599     };
11600     module2.exports = clean;
11601   }
11602 });
11603
11604 // node_modules/semver/functions/inc.js
11605 var require_inc = __commonJS({
11606   "node_modules/semver/functions/inc.js"(exports2, module2) {
11607     var SemVer = require_semver();
11608     var inc = (version, release, options, identifier) => {
11609       if (typeof options === "string") {
11610         identifier = options;
11611         options = void 0;
11612       }
11613       try {
11614         return new SemVer(version, options).inc(release, identifier).version;
11615       } catch (er) {
11616         return null;
11617       }
11618     };
11619     module2.exports = inc;
11620   }
11621 });
11622
11623 // node_modules/semver/functions/compare.js
11624 var require_compare = __commonJS({
11625   "node_modules/semver/functions/compare.js"(exports2, module2) {
11626     var SemVer = require_semver();
11627     var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
11628     module2.exports = compare;
11629   }
11630 });
11631
11632 // node_modules/semver/functions/eq.js
11633 var require_eq = __commonJS({
11634   "node_modules/semver/functions/eq.js"(exports2, module2) {
11635     var compare = require_compare();
11636     var eq = (a, b, loose) => compare(a, b, loose) === 0;
11637     module2.exports = eq;
11638   }
11639 });
11640
11641 // node_modules/semver/functions/diff.js
11642 var require_diff = __commonJS({
11643   "node_modules/semver/functions/diff.js"(exports2, module2) {
11644     var parse = require_parse2();
11645     var eq = require_eq();
11646     var diff = (version1, version2) => {
11647       if (eq(version1, version2)) {
11648         return null;
11649       } else {
11650         const v1 = parse(version1);
11651         const v2 = parse(version2);
11652         const hasPre = v1.prerelease.length || v2.prerelease.length;
11653         const prefix = hasPre ? "pre" : "";
11654         const defaultResult = hasPre ? "prerelease" : "";
11655         for (const key in v1) {
11656           if (key === "major" || key === "minor" || key === "patch") {
11657             if (v1[key] !== v2[key]) {
11658               return prefix + key;
11659             }
11660           }
11661         }
11662         return defaultResult;
11663       }
11664     };
11665     module2.exports = diff;
11666   }
11667 });
11668
11669 // node_modules/semver/functions/major.js
11670 var require_major = __commonJS({
11671   "node_modules/semver/functions/major.js"(exports2, module2) {
11672     var SemVer = require_semver();
11673     var major = (a, loose) => new SemVer(a, loose).major;
11674     module2.exports = major;
11675   }
11676 });
11677
11678 // node_modules/semver/functions/minor.js
11679 var require_minor = __commonJS({
11680   "node_modules/semver/functions/minor.js"(exports2, module2) {
11681     var SemVer = require_semver();
11682     var minor = (a, loose) => new SemVer(a, loose).minor;
11683     module2.exports = minor;
11684   }
11685 });
11686
11687 // node_modules/semver/functions/patch.js
11688 var require_patch = __commonJS({
11689   "node_modules/semver/functions/patch.js"(exports2, module2) {
11690     var SemVer = require_semver();
11691     var patch = (a, loose) => new SemVer(a, loose).patch;
11692     module2.exports = patch;
11693   }
11694 });
11695
11696 // node_modules/semver/functions/prerelease.js
11697 var require_prerelease = __commonJS({
11698   "node_modules/semver/functions/prerelease.js"(exports2, module2) {
11699     var parse = require_parse2();
11700     var prerelease = (version, options) => {
11701       const parsed = parse(version, options);
11702       return parsed && parsed.prerelease.length ? parsed.prerelease : null;
11703     };
11704     module2.exports = prerelease;
11705   }
11706 });
11707
11708 // node_modules/semver/functions/rcompare.js
11709 var require_rcompare = __commonJS({
11710   "node_modules/semver/functions/rcompare.js"(exports2, module2) {
11711     var compare = require_compare();
11712     var rcompare = (a, b, loose) => compare(b, a, loose);
11713     module2.exports = rcompare;
11714   }
11715 });
11716
11717 // node_modules/semver/functions/compare-loose.js
11718 var require_compare_loose = __commonJS({
11719   "node_modules/semver/functions/compare-loose.js"(exports2, module2) {
11720     var compare = require_compare();
11721     var compareLoose = (a, b) => compare(a, b, true);
11722     module2.exports = compareLoose;
11723   }
11724 });
11725
11726 // node_modules/semver/functions/compare-build.js
11727 var require_compare_build = __commonJS({
11728   "node_modules/semver/functions/compare-build.js"(exports2, module2) {
11729     var SemVer = require_semver();
11730     var compareBuild = (a, b, loose) => {
11731       const versionA = new SemVer(a, loose);
11732       const versionB = new SemVer(b, loose);
11733       return versionA.compare(versionB) || versionA.compareBuild(versionB);
11734     };
11735     module2.exports = compareBuild;
11736   }
11737 });
11738
11739 // node_modules/semver/functions/sort.js
11740 var require_sort = __commonJS({
11741   "node_modules/semver/functions/sort.js"(exports2, module2) {
11742     var compareBuild = require_compare_build();
11743     var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
11744     module2.exports = sort;
11745   }
11746 });
11747
11748 // node_modules/semver/functions/rsort.js
11749 var require_rsort = __commonJS({
11750   "node_modules/semver/functions/rsort.js"(exports2, module2) {
11751     var compareBuild = require_compare_build();
11752     var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
11753     module2.exports = rsort;
11754   }
11755 });
11756
11757 // node_modules/semver/functions/gt.js
11758 var require_gt = __commonJS({
11759   "node_modules/semver/functions/gt.js"(exports2, module2) {
11760     var compare = require_compare();
11761     var gt = (a, b, loose) => compare(a, b, loose) > 0;
11762     module2.exports = gt;
11763   }
11764 });
11765
11766 // node_modules/semver/functions/lt.js
11767 var require_lt = __commonJS({
11768   "node_modules/semver/functions/lt.js"(exports2, module2) {
11769     var compare = require_compare();
11770     var lt = (a, b, loose) => compare(a, b, loose) < 0;
11771     module2.exports = lt;
11772   }
11773 });
11774
11775 // node_modules/semver/functions/neq.js
11776 var require_neq = __commonJS({
11777   "node_modules/semver/functions/neq.js"(exports2, module2) {
11778     var compare = require_compare();
11779     var neq = (a, b, loose) => compare(a, b, loose) !== 0;
11780     module2.exports = neq;
11781   }
11782 });
11783
11784 // node_modules/semver/functions/gte.js
11785 var require_gte = __commonJS({
11786   "node_modules/semver/functions/gte.js"(exports2, module2) {
11787     var compare = require_compare();
11788     var gte = (a, b, loose) => compare(a, b, loose) >= 0;
11789     module2.exports = gte;
11790   }
11791 });
11792
11793 // node_modules/semver/functions/lte.js
11794 var require_lte = __commonJS({
11795   "node_modules/semver/functions/lte.js"(exports2, module2) {
11796     var compare = require_compare();
11797     var lte = (a, b, loose) => compare(a, b, loose) <= 0;
11798     module2.exports = lte;
11799   }
11800 });
11801
11802 // node_modules/semver/functions/cmp.js
11803 var require_cmp = __commonJS({
11804   "node_modules/semver/functions/cmp.js"(exports2, module2) {
11805     var eq = require_eq();
11806     var neq = require_neq();
11807     var gt = require_gt();
11808     var gte = require_gte();
11809     var lt = require_lt();
11810     var lte = require_lte();
11811     var cmp = (a, op, b, loose) => {
11812       switch (op) {
11813         case "===":
11814           if (typeof a === "object")
11815             a = a.version;
11816           if (typeof b === "object")
11817             b = b.version;
11818           return a === b;
11819         case "!==":
11820           if (typeof a === "object")
11821             a = a.version;
11822           if (typeof b === "object")
11823             b = b.version;
11824           return a !== b;
11825         case "":
11826         case "=":
11827         case "==":
11828           return eq(a, b, loose);
11829         case "!=":
11830           return neq(a, b, loose);
11831         case ">":
11832           return gt(a, b, loose);
11833         case ">=":
11834           return gte(a, b, loose);
11835         case "<":
11836           return lt(a, b, loose);
11837         case "<=":
11838           return lte(a, b, loose);
11839         default:
11840           throw new TypeError(`Invalid operator: ${op}`);
11841       }
11842     };
11843     module2.exports = cmp;
11844   }
11845 });
11846
11847 // node_modules/semver/functions/coerce.js
11848 var require_coerce = __commonJS({
11849   "node_modules/semver/functions/coerce.js"(exports2, module2) {
11850     var SemVer = require_semver();
11851     var parse = require_parse2();
11852     var { re, t } = require_re();
11853     var coerce = (version, options) => {
11854       if (version instanceof SemVer) {
11855         return version;
11856       }
11857       if (typeof version === "number") {
11858         version = String(version);
11859       }
11860       if (typeof version !== "string") {
11861         return null;
11862       }
11863       options = options || {};
11864       let match = null;
11865       if (!options.rtl) {
11866         match = version.match(re[t.COERCE]);
11867       } else {
11868         let next;
11869         while ((next = re[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) {
11870           if (!match || next.index + next[0].length !== match.index + match[0].length) {
11871             match = next;
11872           }
11873           re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length;
11874         }
11875         re[t.COERCERTL].lastIndex = -1;
11876       }
11877       if (match === null)
11878         return null;
11879       return parse(`${match[2]}.${match[3] || "0"}.${match[4] || "0"}`, options);
11880     };
11881     module2.exports = coerce;
11882   }
11883 });
11884
11885 // node_modules/yallist/iterator.js
11886 var require_iterator = __commonJS({
11887   "node_modules/yallist/iterator.js"(exports2, module2) {
11888     "use strict";
11889     module2.exports = function(Yallist) {
11890       Yallist.prototype[Symbol.iterator] = function* () {
11891         for (let walker = this.head; walker; walker = walker.next) {
11892           yield walker.value;
11893         }
11894       };
11895     };
11896   }
11897 });
11898
11899 // node_modules/yallist/yallist.js
11900 var require_yallist = __commonJS({
11901   "node_modules/yallist/yallist.js"(exports2, module2) {
11902     "use strict";
11903     module2.exports = Yallist;
11904     Yallist.Node = Node;
11905     Yallist.create = Yallist;
11906     function Yallist(list) {
11907       var self2 = this;
11908       if (!(self2 instanceof Yallist)) {
11909         self2 = new Yallist();
11910       }
11911       self2.tail = null;
11912       self2.head = null;
11913       self2.length = 0;
11914       if (list && typeof list.forEach === "function") {
11915         list.forEach(function(item) {
11916           self2.push(item);
11917         });
11918       } else if (arguments.length > 0) {
11919         for (var i = 0, l2 = arguments.length; i < l2; i++) {
11920           self2.push(arguments[i]);
11921         }
11922       }
11923       return self2;
11924     }
11925     Yallist.prototype.removeNode = function(node) {
11926       if (node.list !== this) {
11927         throw new Error("removing node which does not belong to this list");
11928       }
11929       var next = node.next;
11930       var prev = node.prev;
11931       if (next) {
11932         next.prev = prev;
11933       }
11934       if (prev) {
11935         prev.next = next;
11936       }
11937       if (node === this.head) {
11938         this.head = next;
11939       }
11940       if (node === this.tail) {
11941         this.tail = prev;
11942       }
11943       node.list.length--;
11944       node.next = null;
11945       node.prev = null;
11946       node.list = null;
11947       return next;
11948     };
11949     Yallist.prototype.unshiftNode = function(node) {
11950       if (node === this.head) {
11951         return;
11952       }
11953       if (node.list) {
11954         node.list.removeNode(node);
11955       }
11956       var head = this.head;
11957       node.list = this;
11958       node.next = head;
11959       if (head) {
11960         head.prev = node;
11961       }
11962       this.head = node;
11963       if (!this.tail) {
11964         this.tail = node;
11965       }
11966       this.length++;
11967     };
11968     Yallist.prototype.pushNode = function(node) {
11969       if (node === this.tail) {
11970         return;
11971       }
11972       if (node.list) {
11973         node.list.removeNode(node);
11974       }
11975       var tail = this.tail;
11976       node.list = this;
11977       node.prev = tail;
11978       if (tail) {
11979         tail.next = node;
11980       }
11981       this.tail = node;
11982       if (!this.head) {
11983         this.head = node;
11984       }
11985       this.length++;
11986     };
11987     Yallist.prototype.push = function() {
11988       for (var i = 0, l2 = arguments.length; i < l2; i++) {
11989         push(this, arguments[i]);
11990       }
11991       return this.length;
11992     };
11993     Yallist.prototype.unshift = function() {
11994       for (var i = 0, l2 = arguments.length; i < l2; i++) {
11995         unshift(this, arguments[i]);
11996       }
11997       return this.length;
11998     };
11999     Yallist.prototype.pop = function() {
12000       if (!this.tail) {
12001         return void 0;
12002       }
12003       var res = this.tail.value;
12004       this.tail = this.tail.prev;
12005       if (this.tail) {
12006         this.tail.next = null;
12007       } else {
12008         this.head = null;
12009       }
12010       this.length--;
12011       return res;
12012     };
12013     Yallist.prototype.shift = function() {
12014       if (!this.head) {
12015         return void 0;
12016       }
12017       var res = this.head.value;
12018       this.head = this.head.next;
12019       if (this.head) {
12020         this.head.prev = null;
12021       } else {
12022         this.tail = null;
12023       }
12024       this.length--;
12025       return res;
12026     };
12027     Yallist.prototype.forEach = function(fn, thisp) {
12028       thisp = thisp || this;
12029       for (var walker = this.head, i = 0; walker !== null; i++) {
12030         fn.call(thisp, walker.value, i, this);
12031         walker = walker.next;
12032       }
12033     };
12034     Yallist.prototype.forEachReverse = function(fn, thisp) {
12035       thisp = thisp || this;
12036       for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
12037         fn.call(thisp, walker.value, i, this);
12038         walker = walker.prev;
12039       }
12040     };
12041     Yallist.prototype.get = function(n) {
12042       for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
12043         walker = walker.next;
12044       }
12045       if (i === n && walker !== null) {
12046         return walker.value;
12047       }
12048     };
12049     Yallist.prototype.getReverse = function(n) {
12050       for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
12051         walker = walker.prev;
12052       }
12053       if (i === n && walker !== null) {
12054         return walker.value;
12055       }
12056     };
12057     Yallist.prototype.map = function(fn, thisp) {
12058       thisp = thisp || this;
12059       var res = new Yallist();
12060       for (var walker = this.head; walker !== null; ) {
12061         res.push(fn.call(thisp, walker.value, this));
12062         walker = walker.next;
12063       }
12064       return res;
12065     };
12066     Yallist.prototype.mapReverse = function(fn, thisp) {
12067       thisp = thisp || this;
12068       var res = new Yallist();
12069       for (var walker = this.tail; walker !== null; ) {
12070         res.push(fn.call(thisp, walker.value, this));
12071         walker = walker.prev;
12072       }
12073       return res;
12074     };
12075     Yallist.prototype.reduce = function(fn, initial) {
12076       var acc;
12077       var walker = this.head;
12078       if (arguments.length > 1) {
12079         acc = initial;
12080       } else if (this.head) {
12081         walker = this.head.next;
12082         acc = this.head.value;
12083       } else {
12084         throw new TypeError("Reduce of empty list with no initial value");
12085       }
12086       for (var i = 0; walker !== null; i++) {
12087         acc = fn(acc, walker.value, i);
12088         walker = walker.next;
12089       }
12090       return acc;
12091     };
12092     Yallist.prototype.reduceReverse = function(fn, initial) {
12093       var acc;
12094       var walker = this.tail;
12095       if (arguments.length > 1) {
12096         acc = initial;
12097       } else if (this.tail) {
12098         walker = this.tail.prev;
12099         acc = this.tail.value;
12100       } else {
12101         throw new TypeError("Reduce of empty list with no initial value");
12102       }
12103       for (var i = this.length - 1; walker !== null; i--) {
12104         acc = fn(acc, walker.value, i);
12105         walker = walker.prev;
12106       }
12107       return acc;
12108     };
12109     Yallist.prototype.toArray = function() {
12110       var arr = new Array(this.length);
12111       for (var i = 0, walker = this.head; walker !== null; i++) {
12112         arr[i] = walker.value;
12113         walker = walker.next;
12114       }
12115       return arr;
12116     };
12117     Yallist.prototype.toArrayReverse = function() {
12118       var arr = new Array(this.length);
12119       for (var i = 0, walker = this.tail; walker !== null; i++) {
12120         arr[i] = walker.value;
12121         walker = walker.prev;
12122       }
12123       return arr;
12124     };
12125     Yallist.prototype.slice = function(from, to) {
12126       to = to || this.length;
12127       if (to < 0) {
12128         to += this.length;
12129       }
12130       from = from || 0;
12131       if (from < 0) {
12132         from += this.length;
12133       }
12134       var ret2 = new Yallist();
12135       if (to < from || to < 0) {
12136         return ret2;
12137       }
12138       if (from < 0) {
12139         from = 0;
12140       }
12141       if (to > this.length) {
12142         to = this.length;
12143       }
12144       for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
12145         walker = walker.next;
12146       }
12147       for (; walker !== null && i < to; i++, walker = walker.next) {
12148         ret2.push(walker.value);
12149       }
12150       return ret2;
12151     };
12152     Yallist.prototype.sliceReverse = function(from, to) {
12153       to = to || this.length;
12154       if (to < 0) {
12155         to += this.length;
12156       }
12157       from = from || 0;
12158       if (from < 0) {
12159         from += this.length;
12160       }
12161       var ret2 = new Yallist();
12162       if (to < from || to < 0) {
12163         return ret2;
12164       }
12165       if (from < 0) {
12166         from = 0;
12167       }
12168       if (to > this.length) {
12169         to = this.length;
12170       }
12171       for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
12172         walker = walker.prev;
12173       }
12174       for (; walker !== null && i > from; i--, walker = walker.prev) {
12175         ret2.push(walker.value);
12176       }
12177       return ret2;
12178     };
12179     Yallist.prototype.splice = function(start, deleteCount, ...nodes) {
12180       if (start > this.length) {
12181         start = this.length - 1;
12182       }
12183       if (start < 0) {
12184         start = this.length + start;
12185       }
12186       for (var i = 0, walker = this.head; walker !== null && i < start; i++) {
12187         walker = walker.next;
12188       }
12189       var ret2 = [];
12190       for (var i = 0; walker && i < deleteCount; i++) {
12191         ret2.push(walker.value);
12192         walker = this.removeNode(walker);
12193       }
12194       if (walker === null) {
12195         walker = this.tail;
12196       }
12197       if (walker !== this.head && walker !== this.tail) {
12198         walker = walker.prev;
12199       }
12200       for (var i = 0; i < nodes.length; i++) {
12201         walker = insert(this, walker, nodes[i]);
12202       }
12203       return ret2;
12204     };
12205     Yallist.prototype.reverse = function() {
12206       var head = this.head;
12207       var tail = this.tail;
12208       for (var walker = head; walker !== null; walker = walker.prev) {
12209         var p = walker.prev;
12210         walker.prev = walker.next;
12211         walker.next = p;
12212       }
12213       this.head = tail;
12214       this.tail = head;
12215       return this;
12216     };
12217     function insert(self2, node, value) {
12218       var inserted = node === self2.head ? new Node(value, null, node, self2) : new Node(value, node, node.next, self2);
12219       if (inserted.next === null) {
12220         self2.tail = inserted;
12221       }
12222       if (inserted.prev === null) {
12223         self2.head = inserted;
12224       }
12225       self2.length++;
12226       return inserted;
12227     }
12228     function push(self2, item) {
12229       self2.tail = new Node(item, self2.tail, null, self2);
12230       if (!self2.head) {
12231         self2.head = self2.tail;
12232       }
12233       self2.length++;
12234     }
12235     function unshift(self2, item) {
12236       self2.head = new Node(item, null, self2.head, self2);
12237       if (!self2.tail) {
12238         self2.tail = self2.head;
12239       }
12240       self2.length++;
12241     }
12242     function Node(value, prev, next, list) {
12243       if (!(this instanceof Node)) {
12244         return new Node(value, prev, next, list);
12245       }
12246       this.list = list;
12247       this.value = value;
12248       if (prev) {
12249         prev.next = this;
12250         this.prev = prev;
12251       } else {
12252         this.prev = null;
12253       }
12254       if (next) {
12255         next.prev = this;
12256         this.next = next;
12257       } else {
12258         this.next = null;
12259       }
12260     }
12261     try {
12262       require_iterator()(Yallist);
12263     } catch (er) {
12264     }
12265   }
12266 });
12267
12268 // node_modules/lru-cache/index.js
12269 var require_lru_cache = __commonJS({
12270   "node_modules/lru-cache/index.js"(exports2, module2) {
12271     "use strict";
12272     var Yallist = require_yallist();
12273     var MAX = Symbol("max");
12274     var LENGTH = Symbol("length");
12275     var LENGTH_CALCULATOR = Symbol("lengthCalculator");
12276     var ALLOW_STALE = Symbol("allowStale");
12277     var MAX_AGE = Symbol("maxAge");
12278     var DISPOSE = Symbol("dispose");
12279     var NO_DISPOSE_ON_SET = Symbol("noDisposeOnSet");
12280     var LRU_LIST = Symbol("lruList");
12281     var CACHE = Symbol("cache");
12282     var UPDATE_AGE_ON_GET = Symbol("updateAgeOnGet");
12283     var naiveLength = () => 1;
12284     var LRUCache = class {
12285       constructor(options) {
12286         if (typeof options === "number")
12287           options = { max: options };
12288         if (!options)
12289           options = {};
12290         if (options.max && (typeof options.max !== "number" || options.max < 0))
12291           throw new TypeError("max must be a non-negative number");
12292         const max = this[MAX] = options.max || Infinity;
12293         const lc = options.length || naiveLength;
12294         this[LENGTH_CALCULATOR] = typeof lc !== "function" ? naiveLength : lc;
12295         this[ALLOW_STALE] = options.stale || false;
12296         if (options.maxAge && typeof options.maxAge !== "number")
12297           throw new TypeError("maxAge must be a number");
12298         this[MAX_AGE] = options.maxAge || 0;
12299         this[DISPOSE] = options.dispose;
12300         this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;
12301         this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false;
12302         this.reset();
12303       }
12304       set max(mL) {
12305         if (typeof mL !== "number" || mL < 0)
12306           throw new TypeError("max must be a non-negative number");
12307         this[MAX] = mL || Infinity;
12308         trim(this);
12309       }
12310       get max() {
12311         return this[MAX];
12312       }
12313       set allowStale(allowStale) {
12314         this[ALLOW_STALE] = !!allowStale;
12315       }
12316       get allowStale() {
12317         return this[ALLOW_STALE];
12318       }
12319       set maxAge(mA) {
12320         if (typeof mA !== "number")
12321           throw new TypeError("maxAge must be a non-negative number");
12322         this[MAX_AGE] = mA;
12323         trim(this);
12324       }
12325       get maxAge() {
12326         return this[MAX_AGE];
12327       }
12328       set lengthCalculator(lC) {
12329         if (typeof lC !== "function")
12330           lC = naiveLength;
12331         if (lC !== this[LENGTH_CALCULATOR]) {
12332           this[LENGTH_CALCULATOR] = lC;
12333           this[LENGTH] = 0;
12334           this[LRU_LIST].forEach((hit) => {
12335             hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);
12336             this[LENGTH] += hit.length;
12337           });
12338         }
12339         trim(this);
12340       }
12341       get lengthCalculator() {
12342         return this[LENGTH_CALCULATOR];
12343       }
12344       get length() {
12345         return this[LENGTH];
12346       }
12347       get itemCount() {
12348         return this[LRU_LIST].length;
12349       }
12350       rforEach(fn, thisp) {
12351         thisp = thisp || this;
12352         for (let walker = this[LRU_LIST].tail; walker !== null; ) {
12353           const prev = walker.prev;
12354           forEachStep(this, fn, walker, thisp);
12355           walker = prev;
12356         }
12357       }
12358       forEach(fn, thisp) {
12359         thisp = thisp || this;
12360         for (let walker = this[LRU_LIST].head; walker !== null; ) {
12361           const next = walker.next;
12362           forEachStep(this, fn, walker, thisp);
12363           walker = next;
12364         }
12365       }
12366       keys() {
12367         return this[LRU_LIST].toArray().map((k) => k.key);
12368       }
12369       values() {
12370         return this[LRU_LIST].toArray().map((k) => k.value);
12371       }
12372       reset() {
12373         if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) {
12374           this[LRU_LIST].forEach((hit) => this[DISPOSE](hit.key, hit.value));
12375         }
12376         this[CACHE] = new Map();
12377         this[LRU_LIST] = new Yallist();
12378         this[LENGTH] = 0;
12379       }
12380       dump() {
12381         return this[LRU_LIST].map((hit) => isStale(this, hit) ? false : {
12382           k: hit.key,
12383           v: hit.value,
12384           e: hit.now + (hit.maxAge || 0)
12385         }).toArray().filter((h) => h);
12386       }
12387       dumpLru() {
12388         return this[LRU_LIST];
12389       }
12390       set(key, value, maxAge) {
12391         maxAge = maxAge || this[MAX_AGE];
12392         if (maxAge && typeof maxAge !== "number")
12393           throw new TypeError("maxAge must be a number");
12394         const now = maxAge ? Date.now() : 0;
12395         const len = this[LENGTH_CALCULATOR](value, key);
12396         if (this[CACHE].has(key)) {
12397           if (len > this[MAX]) {
12398             del(this, this[CACHE].get(key));
12399             return false;
12400           }
12401           const node = this[CACHE].get(key);
12402           const item = node.value;
12403           if (this[DISPOSE]) {
12404             if (!this[NO_DISPOSE_ON_SET])
12405               this[DISPOSE](key, item.value);
12406           }
12407           item.now = now;
12408           item.maxAge = maxAge;
12409           item.value = value;
12410           this[LENGTH] += len - item.length;
12411           item.length = len;
12412           this.get(key);
12413           trim(this);
12414           return true;
12415         }
12416         const hit = new Entry(key, value, len, now, maxAge);
12417         if (hit.length > this[MAX]) {
12418           if (this[DISPOSE])
12419             this[DISPOSE](key, value);
12420           return false;
12421         }
12422         this[LENGTH] += hit.length;
12423         this[LRU_LIST].unshift(hit);
12424         this[CACHE].set(key, this[LRU_LIST].head);
12425         trim(this);
12426         return true;
12427       }
12428       has(key) {
12429         if (!this[CACHE].has(key))
12430           return false;
12431         const hit = this[CACHE].get(key).value;
12432         return !isStale(this, hit);
12433       }
12434       get(key) {
12435         return get(this, key, true);
12436       }
12437       peek(key) {
12438         return get(this, key, false);
12439       }
12440       pop() {
12441         const node = this[LRU_LIST].tail;
12442         if (!node)
12443           return null;
12444         del(this, node);
12445         return node.value;
12446       }
12447       del(key) {
12448         del(this, this[CACHE].get(key));
12449       }
12450       load(arr) {
12451         this.reset();
12452         const now = Date.now();
12453         for (let l2 = arr.length - 1; l2 >= 0; l2--) {
12454           const hit = arr[l2];
12455           const expiresAt = hit.e || 0;
12456           if (expiresAt === 0)
12457             this.set(hit.k, hit.v);
12458           else {
12459             const maxAge = expiresAt - now;
12460             if (maxAge > 0) {
12461               this.set(hit.k, hit.v, maxAge);
12462             }
12463           }
12464         }
12465       }
12466       prune() {
12467         this[CACHE].forEach((value, key) => get(this, key, false));
12468       }
12469     };
12470     var get = (self2, key, doUse) => {
12471       const node = self2[CACHE].get(key);
12472       if (node) {
12473         const hit = node.value;
12474         if (isStale(self2, hit)) {
12475           del(self2, node);
12476           if (!self2[ALLOW_STALE])
12477             return void 0;
12478         } else {
12479           if (doUse) {
12480             if (self2[UPDATE_AGE_ON_GET])
12481               node.value.now = Date.now();
12482             self2[LRU_LIST].unshiftNode(node);
12483           }
12484         }
12485         return hit.value;
12486       }
12487     };
12488     var isStale = (self2, hit) => {
12489       if (!hit || !hit.maxAge && !self2[MAX_AGE])
12490         return false;
12491       const diff = Date.now() - hit.now;
12492       return hit.maxAge ? diff > hit.maxAge : self2[MAX_AGE] && diff > self2[MAX_AGE];
12493     };
12494     var trim = (self2) => {
12495       if (self2[LENGTH] > self2[MAX]) {
12496         for (let walker = self2[LRU_LIST].tail; self2[LENGTH] > self2[MAX] && walker !== null; ) {
12497           const prev = walker.prev;
12498           del(self2, walker);
12499           walker = prev;
12500         }
12501       }
12502     };
12503     var del = (self2, node) => {
12504       if (node) {
12505         const hit = node.value;
12506         if (self2[DISPOSE])
12507           self2[DISPOSE](hit.key, hit.value);
12508         self2[LENGTH] -= hit.length;
12509         self2[CACHE].delete(hit.key);
12510         self2[LRU_LIST].removeNode(node);
12511       }
12512     };
12513     var Entry = class {
12514       constructor(key, value, length, now, maxAge) {
12515         this.key = key;
12516         this.value = value;
12517         this.length = length;
12518         this.now = now;
12519         this.maxAge = maxAge || 0;
12520       }
12521     };
12522     var forEachStep = (self2, fn, node, thisp) => {
12523       let hit = node.value;
12524       if (isStale(self2, hit)) {
12525         del(self2, node);
12526         if (!self2[ALLOW_STALE])
12527           hit = void 0;
12528       }
12529       if (hit)
12530         fn.call(thisp, hit.value, hit.key, self2);
12531     };
12532     module2.exports = LRUCache;
12533   }
12534 });
12535
12536 // node_modules/semver/classes/range.js
12537 var require_range = __commonJS({
12538   "node_modules/semver/classes/range.js"(exports2, module2) {
12539     var Range5 = class {
12540       constructor(range, options) {
12541         options = parseOptions(options);
12542         if (range instanceof Range5) {
12543           if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
12544             return range;
12545           } else {
12546             return new Range5(range.raw, options);
12547           }
12548         }
12549         if (range instanceof Comparator) {
12550           this.raw = range.value;
12551           this.set = [[range]];
12552           this.format();
12553           return this;
12554         }
12555         this.options = options;
12556         this.loose = !!options.loose;
12557         this.includePrerelease = !!options.includePrerelease;
12558         this.raw = range;
12559         this.set = range.split(/\s*\|\|\s*/).map((range2) => this.parseRange(range2.trim())).filter((c) => c.length);
12560         if (!this.set.length) {
12561           throw new TypeError(`Invalid SemVer Range: ${range}`);
12562         }
12563         if (this.set.length > 1) {
12564           const first = this.set[0];
12565           this.set = this.set.filter((c) => !isNullSet(c[0]));
12566           if (this.set.length === 0)
12567             this.set = [first];
12568           else if (this.set.length > 1) {
12569             for (const c of this.set) {
12570               if (c.length === 1 && isAny(c[0])) {
12571                 this.set = [c];
12572                 break;
12573               }
12574             }
12575           }
12576         }
12577         this.format();
12578       }
12579       format() {
12580         this.range = this.set.map((comps) => {
12581           return comps.join(" ").trim();
12582         }).join("||").trim();
12583         return this.range;
12584       }
12585       toString() {
12586         return this.range;
12587       }
12588       parseRange(range) {
12589         range = range.trim();
12590         const memoOpts = Object.keys(this.options).join(",");
12591         const memoKey = `parseRange:${memoOpts}:${range}`;
12592         const cached = cache.get(memoKey);
12593         if (cached)
12594           return cached;
12595         const loose = this.options.loose;
12596         const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
12597         range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
12598         debug("hyphen replace", range);
12599         range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
12600         debug("comparator trim", range, re[t.COMPARATORTRIM]);
12601         range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
12602         range = range.replace(re[t.CARETTRIM], caretTrimReplace);
12603         range = range.split(/\s+/).join(" ");
12604         const compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
12605         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));
12606         const l2 = rangeList.length;
12607         const rangeMap = new Map();
12608         for (const comp of rangeList) {
12609           if (isNullSet(comp))
12610             return [comp];
12611           rangeMap.set(comp.value, comp);
12612         }
12613         if (rangeMap.size > 1 && rangeMap.has(""))
12614           rangeMap.delete("");
12615         const result = [...rangeMap.values()];
12616         cache.set(memoKey, result);
12617         return result;
12618       }
12619       intersects(range, options) {
12620         if (!(range instanceof Range5)) {
12621           throw new TypeError("a Range is required");
12622         }
12623         return this.set.some((thisComparators) => {
12624           return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
12625             return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
12626               return rangeComparators.every((rangeComparator) => {
12627                 return thisComparator.intersects(rangeComparator, options);
12628               });
12629             });
12630           });
12631         });
12632       }
12633       test(version) {
12634         if (!version) {
12635           return false;
12636         }
12637         if (typeof version === "string") {
12638           try {
12639             version = new SemVer(version, this.options);
12640           } catch (er) {
12641             return false;
12642           }
12643         }
12644         for (let i = 0; i < this.set.length; i++) {
12645           if (testSet(this.set[i], version, this.options)) {
12646             return true;
12647           }
12648         }
12649         return false;
12650       }
12651     };
12652     module2.exports = Range5;
12653     var LRU = require_lru_cache();
12654     var cache = new LRU({ max: 1e3 });
12655     var parseOptions = require_parse_options();
12656     var Comparator = require_comparator();
12657     var debug = require_debug();
12658     var SemVer = require_semver();
12659     var {
12660       re,
12661       t,
12662       comparatorTrimReplace,
12663       tildeTrimReplace,
12664       caretTrimReplace
12665     } = require_re();
12666     var isNullSet = (c) => c.value === "<0.0.0-0";
12667     var isAny = (c) => c.value === "";
12668     var isSatisfiable = (comparators, options) => {
12669       let result = true;
12670       const remainingComparators = comparators.slice();
12671       let testComparator = remainingComparators.pop();
12672       while (result && remainingComparators.length) {
12673         result = remainingComparators.every((otherComparator) => {
12674           return testComparator.intersects(otherComparator, options);
12675         });
12676         testComparator = remainingComparators.pop();
12677       }
12678       return result;
12679     };
12680     var parseComparator = (comp, options) => {
12681       debug("comp", comp, options);
12682       comp = replaceCarets(comp, options);
12683       debug("caret", comp);
12684       comp = replaceTildes(comp, options);
12685       debug("tildes", comp);
12686       comp = replaceXRanges(comp, options);
12687       debug("xrange", comp);
12688       comp = replaceStars(comp, options);
12689       debug("stars", comp);
12690       return comp;
12691     };
12692     var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
12693     var replaceTildes = (comp, options) => comp.trim().split(/\s+/).map((comp2) => {
12694       return replaceTilde(comp2, options);
12695     }).join(" ");
12696     var replaceTilde = (comp, options) => {
12697       const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
12698       return comp.replace(r, (_, M, m, p, pr) => {
12699         debug("tilde", comp, _, M, m, p, pr);
12700         let ret2;
12701         if (isX(M)) {
12702           ret2 = "";
12703         } else if (isX(m)) {
12704           ret2 = `>=${M}.0.0 <${+M + 1}.0.0-0`;
12705         } else if (isX(p)) {
12706           ret2 = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
12707         } else if (pr) {
12708           debug("replaceTilde pr", pr);
12709           ret2 = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
12710         } else {
12711           ret2 = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
12712         }
12713         debug("tilde return", ret2);
12714         return ret2;
12715       });
12716     };
12717     var replaceCarets = (comp, options) => comp.trim().split(/\s+/).map((comp2) => {
12718       return replaceCaret(comp2, options);
12719     }).join(" ");
12720     var replaceCaret = (comp, options) => {
12721       debug("caret", comp, options);
12722       const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
12723       const z = options.includePrerelease ? "-0" : "";
12724       return comp.replace(r, (_, M, m, p, pr) => {
12725         debug("caret", comp, _, M, m, p, pr);
12726         let ret2;
12727         if (isX(M)) {
12728           ret2 = "";
12729         } else if (isX(m)) {
12730           ret2 = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
12731         } else if (isX(p)) {
12732           if (M === "0") {
12733             ret2 = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
12734           } else {
12735             ret2 = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
12736           }
12737         } else if (pr) {
12738           debug("replaceCaret pr", pr);
12739           if (M === "0") {
12740             if (m === "0") {
12741               ret2 = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
12742             } else {
12743               ret2 = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
12744             }
12745           } else {
12746             ret2 = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
12747           }
12748         } else {
12749           debug("no pr");
12750           if (M === "0") {
12751             if (m === "0") {
12752               ret2 = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
12753             } else {
12754               ret2 = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;
12755             }
12756           } else {
12757             ret2 = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
12758           }
12759         }
12760         debug("caret return", ret2);
12761         return ret2;
12762       });
12763     };
12764     var replaceXRanges = (comp, options) => {
12765       debug("replaceXRanges", comp, options);
12766       return comp.split(/\s+/).map((comp2) => {
12767         return replaceXRange(comp2, options);
12768       }).join(" ");
12769     };
12770     var replaceXRange = (comp, options) => {
12771       comp = comp.trim();
12772       const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
12773       return comp.replace(r, (ret2, gtlt, M, m, p, pr) => {
12774         debug("xRange", comp, ret2, gtlt, M, m, p, pr);
12775         const xM = isX(M);
12776         const xm = xM || isX(m);
12777         const xp = xm || isX(p);
12778         const anyX = xp;
12779         if (gtlt === "=" && anyX) {
12780           gtlt = "";
12781         }
12782         pr = options.includePrerelease ? "-0" : "";
12783         if (xM) {
12784           if (gtlt === ">" || gtlt === "<") {
12785             ret2 = "<0.0.0-0";
12786           } else {
12787             ret2 = "*";
12788           }
12789         } else if (gtlt && anyX) {
12790           if (xm) {
12791             m = 0;
12792           }
12793           p = 0;
12794           if (gtlt === ">") {
12795             gtlt = ">=";
12796             if (xm) {
12797               M = +M + 1;
12798               m = 0;
12799               p = 0;
12800             } else {
12801               m = +m + 1;
12802               p = 0;
12803             }
12804           } else if (gtlt === "<=") {
12805             gtlt = "<";
12806             if (xm) {
12807               M = +M + 1;
12808             } else {
12809               m = +m + 1;
12810             }
12811           }
12812           if (gtlt === "<")
12813             pr = "-0";
12814           ret2 = `${gtlt + M}.${m}.${p}${pr}`;
12815         } else if (xm) {
12816           ret2 = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
12817         } else if (xp) {
12818           ret2 = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
12819         }
12820         debug("xRange return", ret2);
12821         return ret2;
12822       });
12823     };
12824     var replaceStars = (comp, options) => {
12825       debug("replaceStars", comp, options);
12826       return comp.trim().replace(re[t.STAR], "");
12827     };
12828     var replaceGTE0 = (comp, options) => {
12829       debug("replaceGTE0", comp, options);
12830       return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
12831     };
12832     var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) => {
12833       if (isX(fM)) {
12834         from = "";
12835       } else if (isX(fm)) {
12836         from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
12837       } else if (isX(fp)) {
12838         from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
12839       } else if (fpr) {
12840         from = `>=${from}`;
12841       } else {
12842         from = `>=${from}${incPr ? "-0" : ""}`;
12843       }
12844       if (isX(tM)) {
12845         to = "";
12846       } else if (isX(tm)) {
12847         to = `<${+tM + 1}.0.0-0`;
12848       } else if (isX(tp)) {
12849         to = `<${tM}.${+tm + 1}.0-0`;
12850       } else if (tpr) {
12851         to = `<=${tM}.${tm}.${tp}-${tpr}`;
12852       } else if (incPr) {
12853         to = `<${tM}.${tm}.${+tp + 1}-0`;
12854       } else {
12855         to = `<=${to}`;
12856       }
12857       return `${from} ${to}`.trim();
12858     };
12859     var testSet = (set, version, options) => {
12860       for (let i = 0; i < set.length; i++) {
12861         if (!set[i].test(version)) {
12862           return false;
12863         }
12864       }
12865       if (version.prerelease.length && !options.includePrerelease) {
12866         for (let i = 0; i < set.length; i++) {
12867           debug(set[i].semver);
12868           if (set[i].semver === Comparator.ANY) {
12869             continue;
12870           }
12871           if (set[i].semver.prerelease.length > 0) {
12872             const allowed = set[i].semver;
12873             if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
12874               return true;
12875             }
12876           }
12877         }
12878         return false;
12879       }
12880       return true;
12881     };
12882   }
12883 });
12884
12885 // node_modules/semver/classes/comparator.js
12886 var require_comparator = __commonJS({
12887   "node_modules/semver/classes/comparator.js"(exports2, module2) {
12888     var ANY = Symbol("SemVer ANY");
12889     var Comparator = class {
12890       static get ANY() {
12891         return ANY;
12892       }
12893       constructor(comp, options) {
12894         options = parseOptions(options);
12895         if (comp instanceof Comparator) {
12896           if (comp.loose === !!options.loose) {
12897             return comp;
12898           } else {
12899             comp = comp.value;
12900           }
12901         }
12902         debug("comparator", comp, options);
12903         this.options = options;
12904         this.loose = !!options.loose;
12905         this.parse(comp);
12906         if (this.semver === ANY) {
12907           this.value = "";
12908         } else {
12909           this.value = this.operator + this.semver.version;
12910         }
12911         debug("comp", this);
12912       }
12913       parse(comp) {
12914         const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
12915         const m = comp.match(r);
12916         if (!m) {
12917           throw new TypeError(`Invalid comparator: ${comp}`);
12918         }
12919         this.operator = m[1] !== void 0 ? m[1] : "";
12920         if (this.operator === "=") {
12921           this.operator = "";
12922         }
12923         if (!m[2]) {
12924           this.semver = ANY;
12925         } else {
12926           this.semver = new SemVer(m[2], this.options.loose);
12927         }
12928       }
12929       toString() {
12930         return this.value;
12931       }
12932       test(version) {
12933         debug("Comparator.test", version, this.options.loose);
12934         if (this.semver === ANY || version === ANY) {
12935           return true;
12936         }
12937         if (typeof version === "string") {
12938           try {
12939             version = new SemVer(version, this.options);
12940           } catch (er) {
12941             return false;
12942           }
12943         }
12944         return cmp(version, this.operator, this.semver, this.options);
12945       }
12946       intersects(comp, options) {
12947         if (!(comp instanceof Comparator)) {
12948           throw new TypeError("a Comparator is required");
12949         }
12950         if (!options || typeof options !== "object") {
12951           options = {
12952             loose: !!options,
12953             includePrerelease: false
12954           };
12955         }
12956         if (this.operator === "") {
12957           if (this.value === "") {
12958             return true;
12959           }
12960           return new Range5(comp.value, options).test(this.value);
12961         } else if (comp.operator === "") {
12962           if (comp.value === "") {
12963             return true;
12964           }
12965           return new Range5(this.value, options).test(comp.semver);
12966         }
12967         const sameDirectionIncreasing = (this.operator === ">=" || this.operator === ">") && (comp.operator === ">=" || comp.operator === ">");
12968         const sameDirectionDecreasing = (this.operator === "<=" || this.operator === "<") && (comp.operator === "<=" || comp.operator === "<");
12969         const sameSemVer = this.semver.version === comp.semver.version;
12970         const differentDirectionsInclusive = (this.operator === ">=" || this.operator === "<=") && (comp.operator === ">=" || comp.operator === "<=");
12971         const oppositeDirectionsLessThan = cmp(this.semver, "<", comp.semver, options) && (this.operator === ">=" || this.operator === ">") && (comp.operator === "<=" || comp.operator === "<");
12972         const oppositeDirectionsGreaterThan = cmp(this.semver, ">", comp.semver, options) && (this.operator === "<=" || this.operator === "<") && (comp.operator === ">=" || comp.operator === ">");
12973         return sameDirectionIncreasing || sameDirectionDecreasing || sameSemVer && differentDirectionsInclusive || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan;
12974       }
12975     };
12976     module2.exports = Comparator;
12977     var parseOptions = require_parse_options();
12978     var { re, t } = require_re();
12979     var cmp = require_cmp();
12980     var debug = require_debug();
12981     var SemVer = require_semver();
12982     var Range5 = require_range();
12983   }
12984 });
12985
12986 // node_modules/semver/functions/satisfies.js
12987 var require_satisfies = __commonJS({
12988   "node_modules/semver/functions/satisfies.js"(exports2, module2) {
12989     var Range5 = require_range();
12990     var satisfies = (version, range, options) => {
12991       try {
12992         range = new Range5(range, options);
12993       } catch (er) {
12994         return false;
12995       }
12996       return range.test(version);
12997     };
12998     module2.exports = satisfies;
12999   }
13000 });
13001
13002 // node_modules/semver/ranges/to-comparators.js
13003 var require_to_comparators = __commonJS({
13004   "node_modules/semver/ranges/to-comparators.js"(exports2, module2) {
13005     var Range5 = require_range();
13006     var toComparators = (range, options) => new Range5(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
13007     module2.exports = toComparators;
13008   }
13009 });
13010
13011 // node_modules/semver/ranges/max-satisfying.js
13012 var require_max_satisfying = __commonJS({
13013   "node_modules/semver/ranges/max-satisfying.js"(exports2, module2) {
13014     var SemVer = require_semver();
13015     var Range5 = require_range();
13016     var maxSatisfying = (versions, range, options) => {
13017       let max = null;
13018       let maxSV = null;
13019       let rangeObj = null;
13020       try {
13021         rangeObj = new Range5(range, options);
13022       } catch (er) {
13023         return null;
13024       }
13025       versions.forEach((v) => {
13026         if (rangeObj.test(v)) {
13027           if (!max || maxSV.compare(v) === -1) {
13028             max = v;
13029             maxSV = new SemVer(max, options);
13030           }
13031         }
13032       });
13033       return max;
13034     };
13035     module2.exports = maxSatisfying;
13036   }
13037 });
13038
13039 // node_modules/semver/ranges/min-satisfying.js
13040 var require_min_satisfying = __commonJS({
13041   "node_modules/semver/ranges/min-satisfying.js"(exports2, module2) {
13042     var SemVer = require_semver();
13043     var Range5 = require_range();
13044     var minSatisfying = (versions, range, options) => {
13045       let min = null;
13046       let minSV = null;
13047       let rangeObj = null;
13048       try {
13049         rangeObj = new Range5(range, options);
13050       } catch (er) {
13051         return null;
13052       }
13053       versions.forEach((v) => {
13054         if (rangeObj.test(v)) {
13055           if (!min || minSV.compare(v) === 1) {
13056             min = v;
13057             minSV = new SemVer(min, options);
13058           }
13059         }
13060       });
13061       return min;
13062     };
13063     module2.exports = minSatisfying;
13064   }
13065 });
13066
13067 // node_modules/semver/ranges/min-version.js
13068 var require_min_version = __commonJS({
13069   "node_modules/semver/ranges/min-version.js"(exports2, module2) {
13070     var SemVer = require_semver();
13071     var Range5 = require_range();
13072     var gt = require_gt();
13073     var minVersion = (range, loose) => {
13074       range = new Range5(range, loose);
13075       let minver = new SemVer("0.0.0");
13076       if (range.test(minver)) {
13077         return minver;
13078       }
13079       minver = new SemVer("0.0.0-0");
13080       if (range.test(minver)) {
13081         return minver;
13082       }
13083       minver = null;
13084       for (let i = 0; i < range.set.length; ++i) {
13085         const comparators = range.set[i];
13086         let setMin = null;
13087         comparators.forEach((comparator) => {
13088           const compver = new SemVer(comparator.semver.version);
13089           switch (comparator.operator) {
13090             case ">":
13091               if (compver.prerelease.length === 0) {
13092                 compver.patch++;
13093               } else {
13094                 compver.prerelease.push(0);
13095               }
13096               compver.raw = compver.format();
13097             case "":
13098             case ">=":
13099               if (!setMin || gt(compver, setMin)) {
13100                 setMin = compver;
13101               }
13102               break;
13103             case "<":
13104             case "<=":
13105               break;
13106             default:
13107               throw new Error(`Unexpected operation: ${comparator.operator}`);
13108           }
13109         });
13110         if (setMin && (!minver || gt(minver, setMin)))
13111           minver = setMin;
13112       }
13113       if (minver && range.test(minver)) {
13114         return minver;
13115       }
13116       return null;
13117     };
13118     module2.exports = minVersion;
13119   }
13120 });
13121
13122 // node_modules/semver/ranges/valid.js
13123 var require_valid2 = __commonJS({
13124   "node_modules/semver/ranges/valid.js"(exports2, module2) {
13125     var Range5 = require_range();
13126     var validRange = (range, options) => {
13127       try {
13128         return new Range5(range, options).range || "*";
13129       } catch (er) {
13130         return null;
13131       }
13132     };
13133     module2.exports = validRange;
13134   }
13135 });
13136
13137 // node_modules/semver/ranges/outside.js
13138 var require_outside = __commonJS({
13139   "node_modules/semver/ranges/outside.js"(exports2, module2) {
13140     var SemVer = require_semver();
13141     var Comparator = require_comparator();
13142     var { ANY } = Comparator;
13143     var Range5 = require_range();
13144     var satisfies = require_satisfies();
13145     var gt = require_gt();
13146     var lt = require_lt();
13147     var lte = require_lte();
13148     var gte = require_gte();
13149     var outside = (version, range, hilo, options) => {
13150       version = new SemVer(version, options);
13151       range = new Range5(range, options);
13152       let gtfn, ltefn, ltfn, comp, ecomp;
13153       switch (hilo) {
13154         case ">":
13155           gtfn = gt;
13156           ltefn = lte;
13157           ltfn = lt;
13158           comp = ">";
13159           ecomp = ">=";
13160           break;
13161         case "<":
13162           gtfn = lt;
13163           ltefn = gte;
13164           ltfn = gt;
13165           comp = "<";
13166           ecomp = "<=";
13167           break;
13168         default:
13169           throw new TypeError('Must provide a hilo val of "<" or ">"');
13170       }
13171       if (satisfies(version, range, options)) {
13172         return false;
13173       }
13174       for (let i = 0; i < range.set.length; ++i) {
13175         const comparators = range.set[i];
13176         let high = null;
13177         let low = null;
13178         comparators.forEach((comparator) => {
13179           if (comparator.semver === ANY) {
13180             comparator = new Comparator(">=0.0.0");
13181           }
13182           high = high || comparator;
13183           low = low || comparator;
13184           if (gtfn(comparator.semver, high.semver, options)) {
13185             high = comparator;
13186           } else if (ltfn(comparator.semver, low.semver, options)) {
13187             low = comparator;
13188           }
13189         });
13190         if (high.operator === comp || high.operator === ecomp) {
13191           return false;
13192         }
13193         if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) {
13194           return false;
13195         } else if (low.operator === ecomp && ltfn(version, low.semver)) {
13196           return false;
13197         }
13198       }
13199       return true;
13200     };
13201     module2.exports = outside;
13202   }
13203 });
13204
13205 // node_modules/semver/ranges/gtr.js
13206 var require_gtr = __commonJS({
13207   "node_modules/semver/ranges/gtr.js"(exports2, module2) {
13208     var outside = require_outside();
13209     var gtr = (version, range, options) => outside(version, range, ">", options);
13210     module2.exports = gtr;
13211   }
13212 });
13213
13214 // node_modules/semver/ranges/ltr.js
13215 var require_ltr = __commonJS({
13216   "node_modules/semver/ranges/ltr.js"(exports2, module2) {
13217     var outside = require_outside();
13218     var ltr = (version, range, options) => outside(version, range, "<", options);
13219     module2.exports = ltr;
13220   }
13221 });
13222
13223 // node_modules/semver/ranges/intersects.js
13224 var require_intersects = __commonJS({
13225   "node_modules/semver/ranges/intersects.js"(exports2, module2) {
13226     var Range5 = require_range();
13227     var intersects = (r1, r2, options) => {
13228       r1 = new Range5(r1, options);
13229       r2 = new Range5(r2, options);
13230       return r1.intersects(r2);
13231     };
13232     module2.exports = intersects;
13233   }
13234 });
13235
13236 // node_modules/semver/ranges/simplify.js
13237 var require_simplify = __commonJS({
13238   "node_modules/semver/ranges/simplify.js"(exports2, module2) {
13239     var satisfies = require_satisfies();
13240     var compare = require_compare();
13241     module2.exports = (versions, range, options) => {
13242       const set = [];
13243       let min = null;
13244       let prev = null;
13245       const v = versions.sort((a, b) => compare(a, b, options));
13246       for (const version of v) {
13247         const included = satisfies(version, range, options);
13248         if (included) {
13249           prev = version;
13250           if (!min)
13251             min = version;
13252         } else {
13253           if (prev) {
13254             set.push([min, prev]);
13255           }
13256           prev = null;
13257           min = null;
13258         }
13259       }
13260       if (min)
13261         set.push([min, null]);
13262       const ranges = [];
13263       for (const [min2, max] of set) {
13264         if (min2 === max)
13265           ranges.push(min2);
13266         else if (!max && min2 === v[0])
13267           ranges.push("*");
13268         else if (!max)
13269           ranges.push(`>=${min2}`);
13270         else if (min2 === v[0])
13271           ranges.push(`<=${max}`);
13272         else
13273           ranges.push(`${min2} - ${max}`);
13274       }
13275       const simplified = ranges.join(" || ");
13276       const original = typeof range.raw === "string" ? range.raw : String(range);
13277       return simplified.length < original.length ? simplified : range;
13278     };
13279   }
13280 });
13281
13282 // node_modules/semver/ranges/subset.js
13283 var require_subset = __commonJS({
13284   "node_modules/semver/ranges/subset.js"(exports2, module2) {
13285     var Range5 = require_range();
13286     var Comparator = require_comparator();
13287     var { ANY } = Comparator;
13288     var satisfies = require_satisfies();
13289     var compare = require_compare();
13290     var subset = (sub, dom, options = {}) => {
13291       if (sub === dom)
13292         return true;
13293       sub = new Range5(sub, options);
13294       dom = new Range5(dom, options);
13295       let sawNonNull = false;
13296       OUTER:
13297         for (const simpleSub of sub.set) {
13298           for (const simpleDom of dom.set) {
13299             const isSub = simpleSubset(simpleSub, simpleDom, options);
13300             sawNonNull = sawNonNull || isSub !== null;
13301             if (isSub)
13302               continue OUTER;
13303           }
13304           if (sawNonNull)
13305             return false;
13306         }
13307       return true;
13308     };
13309     var simpleSubset = (sub, dom, options) => {
13310       if (sub === dom)
13311         return true;
13312       if (sub.length === 1 && sub[0].semver === ANY) {
13313         if (dom.length === 1 && dom[0].semver === ANY)
13314           return true;
13315         else if (options.includePrerelease)
13316           sub = [new Comparator(">=0.0.0-0")];
13317         else
13318           sub = [new Comparator(">=0.0.0")];
13319       }
13320       if (dom.length === 1 && dom[0].semver === ANY) {
13321         if (options.includePrerelease)
13322           return true;
13323         else
13324           dom = [new Comparator(">=0.0.0")];
13325       }
13326       const eqSet = new Set();
13327       let gt, lt;
13328       for (const c of sub) {
13329         if (c.operator === ">" || c.operator === ">=")
13330           gt = higherGT(gt, c, options);
13331         else if (c.operator === "<" || c.operator === "<=")
13332           lt = lowerLT(lt, c, options);
13333         else
13334           eqSet.add(c.semver);
13335       }
13336       if (eqSet.size > 1)
13337         return null;
13338       let gtltComp;
13339       if (gt && lt) {
13340         gtltComp = compare(gt.semver, lt.semver, options);
13341         if (gtltComp > 0)
13342           return null;
13343         else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<="))
13344           return null;
13345       }
13346       for (const eq of eqSet) {
13347         if (gt && !satisfies(eq, String(gt), options))
13348           return null;
13349         if (lt && !satisfies(eq, String(lt), options))
13350           return null;
13351         for (const c of dom) {
13352           if (!satisfies(eq, String(c), options))
13353             return false;
13354         }
13355         return true;
13356       }
13357       let higher, lower;
13358       let hasDomLT, hasDomGT;
13359       let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
13360       let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
13361       if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) {
13362         needDomLTPre = false;
13363       }
13364       for (const c of dom) {
13365         hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
13366         hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
13367         if (gt) {
13368           if (needDomGTPre) {
13369             if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) {
13370               needDomGTPre = false;
13371             }
13372           }
13373           if (c.operator === ">" || c.operator === ">=") {
13374             higher = higherGT(gt, c, options);
13375             if (higher === c && higher !== gt)
13376               return false;
13377           } else if (gt.operator === ">=" && !satisfies(gt.semver, String(c), options))
13378             return false;
13379         }
13380         if (lt) {
13381           if (needDomLTPre) {
13382             if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) {
13383               needDomLTPre = false;
13384             }
13385           }
13386           if (c.operator === "<" || c.operator === "<=") {
13387             lower = lowerLT(lt, c, options);
13388             if (lower === c && lower !== lt)
13389               return false;
13390           } else if (lt.operator === "<=" && !satisfies(lt.semver, String(c), options))
13391             return false;
13392         }
13393         if (!c.operator && (lt || gt) && gtltComp !== 0)
13394           return false;
13395       }
13396       if (gt && hasDomLT && !lt && gtltComp !== 0)
13397         return false;
13398       if (lt && hasDomGT && !gt && gtltComp !== 0)
13399         return false;
13400       if (needDomGTPre || needDomLTPre)
13401         return false;
13402       return true;
13403     };
13404     var higherGT = (a, b, options) => {
13405       if (!a)
13406         return b;
13407       const comp = compare(a.semver, b.semver, options);
13408       return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
13409     };
13410     var lowerLT = (a, b, options) => {
13411       if (!a)
13412         return b;
13413       const comp = compare(a.semver, b.semver, options);
13414       return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
13415     };
13416     module2.exports = subset;
13417   }
13418 });
13419
13420 // node_modules/semver/index.js
13421 var require_semver2 = __commonJS({
13422   "node_modules/semver/index.js"(exports2, module2) {
13423     var internalRe = require_re();
13424     module2.exports = {
13425       re: internalRe.re,
13426       src: internalRe.src,
13427       tokens: internalRe.t,
13428       SEMVER_SPEC_VERSION: require_constants2().SEMVER_SPEC_VERSION,
13429       SemVer: require_semver(),
13430       compareIdentifiers: require_identifiers().compareIdentifiers,
13431       rcompareIdentifiers: require_identifiers().rcompareIdentifiers,
13432       parse: require_parse2(),
13433       valid: require_valid(),
13434       clean: require_clean(),
13435       inc: require_inc(),
13436       diff: require_diff(),
13437       major: require_major(),
13438       minor: require_minor(),
13439       patch: require_patch(),
13440       prerelease: require_prerelease(),
13441       compare: require_compare(),
13442       rcompare: require_rcompare(),
13443       compareLoose: require_compare_loose(),
13444       compareBuild: require_compare_build(),
13445       sort: require_sort(),
13446       rsort: require_rsort(),
13447       gt: require_gt(),
13448       lt: require_lt(),
13449       eq: require_eq(),
13450       neq: require_neq(),
13451       gte: require_gte(),
13452       lte: require_lte(),
13453       cmp: require_cmp(),
13454       coerce: require_coerce(),
13455       Comparator: require_comparator(),
13456       Range: require_range(),
13457       satisfies: require_satisfies(),
13458       toComparators: require_to_comparators(),
13459       maxSatisfying: require_max_satisfying(),
13460       minSatisfying: require_min_satisfying(),
13461       minVersion: require_min_version(),
13462       validRange: require_valid2(),
13463       outside: require_outside(),
13464       gtr: require_gtr(),
13465       ltr: require_ltr(),
13466       intersects: require_intersects(),
13467       simplifyRange: require_simplify(),
13468       subset: require_subset()
13469     };
13470   }
13471 });
13472
13473 // node_modules/listenercount/index.js
13474 var require_listenercount = __commonJS({
13475   "node_modules/listenercount/index.js"(exports2, module2) {
13476     "use strict";
13477     var listenerCount = require("events").listenerCount;
13478     listenerCount = listenerCount || function(ee, event) {
13479       var listeners = ee && ee._events && ee._events[event];
13480       if (Array.isArray(listeners)) {
13481         return listeners.length;
13482       } else if (typeof listeners === "function") {
13483         return 1;
13484       } else {
13485         return 0;
13486       }
13487     };
13488     module2.exports = listenerCount;
13489   }
13490 });
13491
13492 // node_modules/buffer-indexof-polyfill/index.js
13493 var require_buffer_indexof_polyfill = __commonJS({
13494   "node_modules/buffer-indexof-polyfill/index.js"() {
13495     "use strict";
13496     if (!Buffer.prototype.indexOf) {
13497       Buffer.prototype.indexOf = function(value, offset) {
13498         offset = offset || 0;
13499         if (typeof value === "string" || value instanceof String) {
13500           value = new Buffer(value);
13501         } else if (typeof value === "number" || value instanceof Number) {
13502           value = new Buffer([value]);
13503         }
13504         var len = value.length;
13505         for (var i = offset; i <= this.length - len; i++) {
13506           var mismatch = false;
13507           for (var j = 0; j < len; j++) {
13508             if (this[i + j] != value[j]) {
13509               mismatch = true;
13510               break;
13511             }
13512           }
13513           if (!mismatch) {
13514             return i;
13515           }
13516         }
13517         return -1;
13518       };
13519     }
13520     function bufferLastIndexOf(value, offset) {
13521       if (typeof value === "string" || value instanceof String) {
13522         value = new Buffer(value);
13523       } else if (typeof value === "number" || value instanceof Number) {
13524         value = new Buffer([value]);
13525       }
13526       var len = value.length;
13527       offset = offset || this.length - len;
13528       for (var i = offset; i >= 0; i--) {
13529         var mismatch = false;
13530         for (var j = 0; j < len; j++) {
13531           if (this[i + j] != value[j]) {
13532             mismatch = true;
13533             break;
13534           }
13535         }
13536         if (!mismatch) {
13537           return i;
13538         }
13539       }
13540       return -1;
13541     }
13542     if (Buffer.prototype.lastIndexOf) {
13543       if (new Buffer("ABC").lastIndexOf("ABC") === -1)
13544         Buffer.prototype.lastIndexOf = bufferLastIndexOf;
13545     } else {
13546       Buffer.prototype.lastIndexOf = bufferLastIndexOf;
13547     }
13548   }
13549 });
13550
13551 // node_modules/setimmediate/setImmediate.js
13552 var require_setImmediate = __commonJS({
13553   "node_modules/setimmediate/setImmediate.js"(exports2) {
13554     (function(global2, undefined2) {
13555       "use strict";
13556       if (global2.setImmediate) {
13557         return;
13558       }
13559       var nextHandle = 1;
13560       var tasksByHandle = {};
13561       var currentlyRunningATask = false;
13562       var doc = global2.document;
13563       var registerImmediate;
13564       function setImmediate2(callback) {
13565         if (typeof callback !== "function") {
13566           callback = new Function("" + callback);
13567         }
13568         var args = new Array(arguments.length - 1);
13569         for (var i = 0; i < args.length; i++) {
13570           args[i] = arguments[i + 1];
13571         }
13572         var task = { callback, args };
13573         tasksByHandle[nextHandle] = task;
13574         registerImmediate(nextHandle);
13575         return nextHandle++;
13576       }
13577       function clearImmediate2(handle) {
13578         delete tasksByHandle[handle];
13579       }
13580       function run(task) {
13581         var callback = task.callback;
13582         var args = task.args;
13583         switch (args.length) {
13584           case 0:
13585             callback();
13586             break;
13587           case 1:
13588             callback(args[0]);
13589             break;
13590           case 2:
13591             callback(args[0], args[1]);
13592             break;
13593           case 3:
13594             callback(args[0], args[1], args[2]);
13595             break;
13596           default:
13597             callback.apply(undefined2, args);
13598             break;
13599         }
13600       }
13601       function runIfPresent(handle) {
13602         if (currentlyRunningATask) {
13603           setTimeout(runIfPresent, 0, handle);
13604         } else {
13605           var task = tasksByHandle[handle];
13606           if (task) {
13607             currentlyRunningATask = true;
13608             try {
13609               run(task);
13610             } finally {
13611               clearImmediate2(handle);
13612               currentlyRunningATask = false;
13613             }
13614           }
13615         }
13616       }
13617       function installNextTickImplementation() {
13618         registerImmediate = function(handle) {
13619           process.nextTick(function() {
13620             runIfPresent(handle);
13621           });
13622         };
13623       }
13624       function canUsePostMessage() {
13625         if (global2.postMessage && !global2.importScripts) {
13626           var postMessageIsAsynchronous = true;
13627           var oldOnMessage = global2.onmessage;
13628           global2.onmessage = function() {
13629             postMessageIsAsynchronous = false;
13630           };
13631           global2.postMessage("", "*");
13632           global2.onmessage = oldOnMessage;
13633           return postMessageIsAsynchronous;
13634         }
13635       }
13636       function installPostMessageImplementation() {
13637         var messagePrefix = "setImmediate$" + Math.random() + "$";
13638         var onGlobalMessage = function(event) {
13639           if (event.source === global2 && typeof event.data === "string" && event.data.indexOf(messagePrefix) === 0) {
13640             runIfPresent(+event.data.slice(messagePrefix.length));
13641           }
13642         };
13643         if (global2.addEventListener) {
13644           global2.addEventListener("message", onGlobalMessage, false);
13645         } else {
13646           global2.attachEvent("onmessage", onGlobalMessage);
13647         }
13648         registerImmediate = function(handle) {
13649           global2.postMessage(messagePrefix + handle, "*");
13650         };
13651       }
13652       function installMessageChannelImplementation() {
13653         var channel = new MessageChannel();
13654         channel.port1.onmessage = function(event) {
13655           var handle = event.data;
13656           runIfPresent(handle);
13657         };
13658         registerImmediate = function(handle) {
13659           channel.port2.postMessage(handle);
13660         };
13661       }
13662       function installReadyStateChangeImplementation() {
13663         var html = doc.documentElement;
13664         registerImmediate = function(handle) {
13665           var script = doc.createElement("script");
13666           script.onreadystatechange = function() {
13667             runIfPresent(handle);
13668             script.onreadystatechange = null;
13669             html.removeChild(script);
13670             script = null;
13671           };
13672           html.appendChild(script);
13673         };
13674       }
13675       function installSetTimeoutImplementation() {
13676         registerImmediate = function(handle) {
13677           setTimeout(runIfPresent, 0, handle);
13678         };
13679       }
13680       var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global2);
13681       attachTo = attachTo && attachTo.setTimeout ? attachTo : global2;
13682       if ({}.toString.call(global2.process) === "[object process]") {
13683         installNextTickImplementation();
13684       } else if (canUsePostMessage()) {
13685         installPostMessageImplementation();
13686       } else if (global2.MessageChannel) {
13687         installMessageChannelImplementation();
13688       } else if (doc && "onreadystatechange" in doc.createElement("script")) {
13689         installReadyStateChangeImplementation();
13690       } else {
13691         installSetTimeoutImplementation();
13692       }
13693       attachTo.setImmediate = setImmediate2;
13694       attachTo.clearImmediate = clearImmediate2;
13695     })(typeof self === "undefined" ? typeof global === "undefined" ? exports2 : global : self);
13696   }
13697 });
13698
13699 // node_modules/traverse/index.js
13700 var require_traverse = __commonJS({
13701   "node_modules/traverse/index.js"(exports2, module2) {
13702     module2.exports = Traverse;
13703     function Traverse(obj2) {
13704       if (!(this instanceof Traverse))
13705         return new Traverse(obj2);
13706       this.value = obj2;
13707     }
13708     Traverse.prototype.get = function(ps) {
13709       var node = this.value;
13710       for (var i = 0; i < ps.length; i++) {
13711         var key = ps[i];
13712         if (!Object.hasOwnProperty.call(node, key)) {
13713           node = void 0;
13714           break;
13715         }
13716         node = node[key];
13717       }
13718       return node;
13719     };
13720     Traverse.prototype.set = function(ps, value) {
13721       var node = this.value;
13722       for (var i = 0; i < ps.length - 1; i++) {
13723         var key = ps[i];
13724         if (!Object.hasOwnProperty.call(node, key))
13725           node[key] = {};
13726         node = node[key];
13727       }
13728       node[ps[i]] = value;
13729       return value;
13730     };
13731     Traverse.prototype.map = function(cb) {
13732       return walk(this.value, cb, true);
13733     };
13734     Traverse.prototype.forEach = function(cb) {
13735       this.value = walk(this.value, cb, false);
13736       return this.value;
13737     };
13738     Traverse.prototype.reduce = function(cb, init) {
13739       var skip = arguments.length === 1;
13740       var acc = skip ? this.value : init;
13741       this.forEach(function(x) {
13742         if (!this.isRoot || !skip) {
13743           acc = cb.call(this, acc, x);
13744         }
13745       });
13746       return acc;
13747     };
13748     Traverse.prototype.deepEqual = function(obj2) {
13749       if (arguments.length !== 1) {
13750         throw new Error("deepEqual requires exactly one object to compare against");
13751       }
13752       var equal = true;
13753       var node = obj2;
13754       this.forEach(function(y) {
13755         var notEqual = function() {
13756           equal = false;
13757           return void 0;
13758         }.bind(this);
13759         if (!this.isRoot) {
13760           if (typeof node !== "object")
13761             return notEqual();
13762           node = node[this.key];
13763         }
13764         var x = node;
13765         this.post(function() {
13766           node = x;
13767         });
13768         var toS = function(o) {
13769           return Object.prototype.toString.call(o);
13770         };
13771         if (this.circular) {
13772           if (Traverse(obj2).get(this.circular.path) !== x)
13773             notEqual();
13774         } else if (typeof x !== typeof y) {
13775           notEqual();
13776         } else if (x === null || y === null || x === void 0 || y === void 0) {
13777           if (x !== y)
13778             notEqual();
13779         } else if (x.__proto__ !== y.__proto__) {
13780           notEqual();
13781         } else if (x === y) {
13782         } else if (typeof x === "function") {
13783           if (x instanceof RegExp) {
13784             if (x.toString() != y.toString())
13785               notEqual();
13786           } else if (x !== y)
13787             notEqual();
13788         } else if (typeof x === "object") {
13789           if (toS(y) === "[object Arguments]" || toS(x) === "[object Arguments]") {
13790             if (toS(x) !== toS(y)) {
13791               notEqual();
13792             }
13793           } else if (x instanceof Date || y instanceof Date) {
13794             if (!(x instanceof Date) || !(y instanceof Date) || x.getTime() !== y.getTime()) {
13795               notEqual();
13796             }
13797           } else {
13798             var kx = Object.keys(x);
13799             var ky = Object.keys(y);
13800             if (kx.length !== ky.length)
13801               return notEqual();
13802             for (var i = 0; i < kx.length; i++) {
13803               var k = kx[i];
13804               if (!Object.hasOwnProperty.call(y, k)) {
13805                 notEqual();
13806               }
13807             }
13808           }
13809         }
13810       });
13811       return equal;
13812     };
13813     Traverse.prototype.paths = function() {
13814       var acc = [];
13815       this.forEach(function(x) {
13816         acc.push(this.path);
13817       });
13818       return acc;
13819     };
13820     Traverse.prototype.nodes = function() {
13821       var acc = [];
13822       this.forEach(function(x) {
13823         acc.push(this.node);
13824       });
13825       return acc;
13826     };
13827     Traverse.prototype.clone = function() {
13828       var parents = [], nodes = [];
13829       return function clone2(src) {
13830         for (var i = 0; i < parents.length; i++) {
13831           if (parents[i] === src) {
13832             return nodes[i];
13833           }
13834         }
13835         if (typeof src === "object" && src !== null) {
13836           var dst = copy(src);
13837           parents.push(src);
13838           nodes.push(dst);
13839           Object.keys(src).forEach(function(key) {
13840             dst[key] = clone2(src[key]);
13841           });
13842           parents.pop();
13843           nodes.pop();
13844           return dst;
13845         } else {
13846           return src;
13847         }
13848       }(this.value);
13849     };
13850     function walk(root, cb, immutable) {
13851       var path2 = [];
13852       var parents = [];
13853       var alive = true;
13854       return function walker(node_) {
13855         var node = immutable ? copy(node_) : node_;
13856         var modifiers = {};
13857         var state = {
13858           node,
13859           node_,
13860           path: [].concat(path2),
13861           parent: parents.slice(-1)[0],
13862           key: path2.slice(-1)[0],
13863           isRoot: path2.length === 0,
13864           level: path2.length,
13865           circular: null,
13866           update: function(x) {
13867             if (!state.isRoot) {
13868               state.parent.node[state.key] = x;
13869             }
13870             state.node = x;
13871           },
13872           "delete": function() {
13873             delete state.parent.node[state.key];
13874           },
13875           remove: function() {
13876             if (Array.isArray(state.parent.node)) {
13877               state.parent.node.splice(state.key, 1);
13878             } else {
13879               delete state.parent.node[state.key];
13880             }
13881           },
13882           before: function(f) {
13883             modifiers.before = f;
13884           },
13885           after: function(f) {
13886             modifiers.after = f;
13887           },
13888           pre: function(f) {
13889             modifiers.pre = f;
13890           },
13891           post: function(f) {
13892             modifiers.post = f;
13893           },
13894           stop: function() {
13895             alive = false;
13896           }
13897         };
13898         if (!alive)
13899           return state;
13900         if (typeof node === "object" && node !== null) {
13901           state.isLeaf = Object.keys(node).length == 0;
13902           for (var i = 0; i < parents.length; i++) {
13903             if (parents[i].node_ === node_) {
13904               state.circular = parents[i];
13905               break;
13906             }
13907           }
13908         } else {
13909           state.isLeaf = true;
13910         }
13911         state.notLeaf = !state.isLeaf;
13912         state.notRoot = !state.isRoot;
13913         var ret2 = cb.call(state, state.node);
13914         if (ret2 !== void 0 && state.update)
13915           state.update(ret2);
13916         if (modifiers.before)
13917           modifiers.before.call(state, state.node);
13918         if (typeof state.node == "object" && state.node !== null && !state.circular) {
13919           parents.push(state);
13920           var keys = Object.keys(state.node);
13921           keys.forEach(function(key, i2) {
13922             path2.push(key);
13923             if (modifiers.pre)
13924               modifiers.pre.call(state, state.node[key], key);
13925             var child = walker(state.node[key]);
13926             if (immutable && Object.hasOwnProperty.call(state.node, key)) {
13927               state.node[key] = child.node;
13928             }
13929             child.isLast = i2 == keys.length - 1;
13930             child.isFirst = i2 == 0;
13931             if (modifiers.post)
13932               modifiers.post.call(state, child);
13933             path2.pop();
13934           });
13935           parents.pop();
13936         }
13937         if (modifiers.after)
13938           modifiers.after.call(state, state.node);
13939         return state;
13940       }(root).node;
13941     }
13942     Object.keys(Traverse.prototype).forEach(function(key) {
13943       Traverse[key] = function(obj2) {
13944         var args = [].slice.call(arguments, 1);
13945         var t = Traverse(obj2);
13946         return t[key].apply(t, args);
13947       };
13948     });
13949     function copy(src) {
13950       if (typeof src === "object" && src !== null) {
13951         var dst;
13952         if (Array.isArray(src)) {
13953           dst = [];
13954         } else if (src instanceof Date) {
13955           dst = new Date(src);
13956         } else if (src instanceof Boolean) {
13957           dst = new Boolean(src);
13958         } else if (src instanceof Number) {
13959           dst = new Number(src);
13960         } else if (src instanceof String) {
13961           dst = new String(src);
13962         } else {
13963           dst = Object.create(Object.getPrototypeOf(src));
13964         }
13965         Object.keys(src).forEach(function(key) {
13966           dst[key] = src[key];
13967         });
13968         return dst;
13969       } else
13970         return src;
13971     }
13972   }
13973 });
13974
13975 // node_modules/chainsaw/index.js
13976 var require_chainsaw = __commonJS({
13977   "node_modules/chainsaw/index.js"(exports2, module2) {
13978     var Traverse = require_traverse();
13979     var EventEmitter = require("events").EventEmitter;
13980     module2.exports = Chainsaw;
13981     function Chainsaw(builder) {
13982       var saw = Chainsaw.saw(builder, {});
13983       var r = builder.call(saw.handlers, saw);
13984       if (r !== void 0)
13985         saw.handlers = r;
13986       saw.record();
13987       return saw.chain();
13988     }
13989     Chainsaw.light = function ChainsawLight(builder) {
13990       var saw = Chainsaw.saw(builder, {});
13991       var r = builder.call(saw.handlers, saw);
13992       if (r !== void 0)
13993         saw.handlers = r;
13994       return saw.chain();
13995     };
13996     Chainsaw.saw = function(builder, handlers) {
13997       var saw = new EventEmitter();
13998       saw.handlers = handlers;
13999       saw.actions = [];
14000       saw.chain = function() {
14001         var ch = Traverse(saw.handlers).map(function(node) {
14002           if (this.isRoot)
14003             return node;
14004           var ps = this.path;
14005           if (typeof node === "function") {
14006             this.update(function() {
14007               saw.actions.push({
14008                 path: ps,
14009                 args: [].slice.call(arguments)
14010               });
14011               return ch;
14012             });
14013           }
14014         });
14015         process.nextTick(function() {
14016           saw.emit("begin");
14017           saw.next();
14018         });
14019         return ch;
14020       };
14021       saw.pop = function() {
14022         return saw.actions.shift();
14023       };
14024       saw.next = function() {
14025         var action = saw.pop();
14026         if (!action) {
14027           saw.emit("end");
14028         } else if (!action.trap) {
14029           var node = saw.handlers;
14030           action.path.forEach(function(key) {
14031             node = node[key];
14032           });
14033           node.apply(saw.handlers, action.args);
14034         }
14035       };
14036       saw.nest = function(cb) {
14037         var args = [].slice.call(arguments, 1);
14038         var autonext = true;
14039         if (typeof cb === "boolean") {
14040           var autonext = cb;
14041           cb = args.shift();
14042         }
14043         var s = Chainsaw.saw(builder, {});
14044         var r = builder.call(s.handlers, s);
14045         if (r !== void 0)
14046           s.handlers = r;
14047         if (typeof saw.step !== "undefined") {
14048           s.record();
14049         }
14050         cb.apply(s.chain(), args);
14051         if (autonext !== false)
14052           s.on("end", saw.next);
14053       };
14054       saw.record = function() {
14055         upgradeChainsaw(saw);
14056       };
14057       ["trap", "down", "jump"].forEach(function(method) {
14058         saw[method] = function() {
14059           throw new Error("To use the trap, down and jump features, please call record() first to start recording actions.");
14060         };
14061       });
14062       return saw;
14063     };
14064     function upgradeChainsaw(saw) {
14065       saw.step = 0;
14066       saw.pop = function() {
14067         return saw.actions[saw.step++];
14068       };
14069       saw.trap = function(name, cb) {
14070         var ps = Array.isArray(name) ? name : [name];
14071         saw.actions.push({
14072           path: ps,
14073           step: saw.step,
14074           cb,
14075           trap: true
14076         });
14077       };
14078       saw.down = function(name) {
14079         var ps = (Array.isArray(name) ? name : [name]).join("/");
14080         var i = saw.actions.slice(saw.step).map(function(x) {
14081           if (x.trap && x.step <= saw.step)
14082             return false;
14083           return x.path.join("/") == ps;
14084         }).indexOf(true);
14085         if (i >= 0)
14086           saw.step += i;
14087         else
14088           saw.step = saw.actions.length;
14089         var act = saw.actions[saw.step - 1];
14090         if (act && act.trap) {
14091           saw.step = act.step;
14092           act.cb();
14093         } else
14094           saw.next();
14095       };
14096       saw.jump = function(step) {
14097         saw.step = step;
14098         saw.next();
14099       };
14100     }
14101   }
14102 });
14103
14104 // node_modules/buffers/index.js
14105 var require_buffers = __commonJS({
14106   "node_modules/buffers/index.js"(exports2, module2) {
14107     module2.exports = Buffers;
14108     function Buffers(bufs) {
14109       if (!(this instanceof Buffers))
14110         return new Buffers(bufs);
14111       this.buffers = bufs || [];
14112       this.length = this.buffers.reduce(function(size, buf) {
14113         return size + buf.length;
14114       }, 0);
14115     }
14116     Buffers.prototype.push = function() {
14117       for (var i = 0; i < arguments.length; i++) {
14118         if (!Buffer.isBuffer(arguments[i])) {
14119           throw new TypeError("Tried to push a non-buffer");
14120         }
14121       }
14122       for (var i = 0; i < arguments.length; i++) {
14123         var buf = arguments[i];
14124         this.buffers.push(buf);
14125         this.length += buf.length;
14126       }
14127       return this.length;
14128     };
14129     Buffers.prototype.unshift = function() {
14130       for (var i = 0; i < arguments.length; i++) {
14131         if (!Buffer.isBuffer(arguments[i])) {
14132           throw new TypeError("Tried to unshift a non-buffer");
14133         }
14134       }
14135       for (var i = 0; i < arguments.length; i++) {
14136         var buf = arguments[i];
14137         this.buffers.unshift(buf);
14138         this.length += buf.length;
14139       }
14140       return this.length;
14141     };
14142     Buffers.prototype.copy = function(dst, dStart, start, end) {
14143       return this.slice(start, end).copy(dst, dStart, 0, end - start);
14144     };
14145     Buffers.prototype.splice = function(i, howMany) {
14146       var buffers = this.buffers;
14147       var index = i >= 0 ? i : this.length - i;
14148       var reps = [].slice.call(arguments, 2);
14149       if (howMany === void 0) {
14150         howMany = this.length - index;
14151       } else if (howMany > this.length - index) {
14152         howMany = this.length - index;
14153       }
14154       for (var i = 0; i < reps.length; i++) {
14155         this.length += reps[i].length;
14156       }
14157       var removed = new Buffers();
14158       var bytes = 0;
14159       var startBytes = 0;
14160       for (var ii = 0; ii < buffers.length && startBytes + buffers[ii].length < index; ii++) {
14161         startBytes += buffers[ii].length;
14162       }
14163       if (index - startBytes > 0) {
14164         var start = index - startBytes;
14165         if (start + howMany < buffers[ii].length) {
14166           removed.push(buffers[ii].slice(start, start + howMany));
14167           var orig = buffers[ii];
14168           var buf0 = new Buffer(start);
14169           for (var i = 0; i < start; i++) {
14170             buf0[i] = orig[i];
14171           }
14172           var buf1 = new Buffer(orig.length - start - howMany);
14173           for (var i = start + howMany; i < orig.length; i++) {
14174             buf1[i - howMany - start] = orig[i];
14175           }
14176           if (reps.length > 0) {
14177             var reps_ = reps.slice();
14178             reps_.unshift(buf0);
14179             reps_.push(buf1);
14180             buffers.splice.apply(buffers, [ii, 1].concat(reps_));
14181             ii += reps_.length;
14182             reps = [];
14183           } else {
14184             buffers.splice(ii, 1, buf0, buf1);
14185             ii += 2;
14186           }
14187         } else {
14188           removed.push(buffers[ii].slice(start));
14189           buffers[ii] = buffers[ii].slice(0, start);
14190           ii++;
14191         }
14192       }
14193       if (reps.length > 0) {
14194         buffers.splice.apply(buffers, [ii, 0].concat(reps));
14195         ii += reps.length;
14196       }
14197       while (removed.length < howMany) {
14198         var buf = buffers[ii];
14199         var len = buf.length;
14200         var take = Math.min(len, howMany - removed.length);
14201         if (take === len) {
14202           removed.push(buf);
14203           buffers.splice(ii, 1);
14204         } else {
14205           removed.push(buf.slice(0, take));
14206           buffers[ii] = buffers[ii].slice(take);
14207         }
14208       }
14209       this.length -= removed.length;
14210       return removed;
14211     };
14212     Buffers.prototype.slice = function(i, j) {
14213       var buffers = this.buffers;
14214       if (j === void 0)
14215         j = this.length;
14216       if (i === void 0)
14217         i = 0;
14218       if (j > this.length)
14219         j = this.length;
14220       var startBytes = 0;
14221       for (var si = 0; si < buffers.length && startBytes + buffers[si].length <= i; si++) {
14222         startBytes += buffers[si].length;
14223       }
14224       var target = new Buffer(j - i);
14225       var ti = 0;
14226       for (var ii = si; ti < j - i && ii < buffers.length; ii++) {
14227         var len = buffers[ii].length;
14228         var start = ti === 0 ? i - startBytes : 0;
14229         var end = ti + len >= j - i ? Math.min(start + (j - i) - ti, len) : len;
14230         buffers[ii].copy(target, ti, start, end);
14231         ti += end - start;
14232       }
14233       return target;
14234     };
14235     Buffers.prototype.pos = function(i) {
14236       if (i < 0 || i >= this.length)
14237         throw new Error("oob");
14238       var l2 = i, bi = 0, bu = null;
14239       for (; ; ) {
14240         bu = this.buffers[bi];
14241         if (l2 < bu.length) {
14242           return { buf: bi, offset: l2 };
14243         } else {
14244           l2 -= bu.length;
14245         }
14246         bi++;
14247       }
14248     };
14249     Buffers.prototype.get = function get(i) {
14250       var pos = this.pos(i);
14251       return this.buffers[pos.buf].get(pos.offset);
14252     };
14253     Buffers.prototype.set = function set(i, b) {
14254       var pos = this.pos(i);
14255       return this.buffers[pos.buf].set(pos.offset, b);
14256     };
14257     Buffers.prototype.indexOf = function(needle, offset) {
14258       if (typeof needle === "string") {
14259         needle = new Buffer(needle);
14260       } else if (needle instanceof Buffer) {
14261       } else {
14262         throw new Error("Invalid type for a search string");
14263       }
14264       if (!needle.length) {
14265         return 0;
14266       }
14267       if (!this.length) {
14268         return -1;
14269       }
14270       var i = 0, j = 0, match = 0, mstart, pos = 0;
14271       if (offset) {
14272         var p = this.pos(offset);
14273         i = p.buf;
14274         j = p.offset;
14275         pos = offset;
14276       }
14277       for (; ; ) {
14278         while (j >= this.buffers[i].length) {
14279           j = 0;
14280           i++;
14281           if (i >= this.buffers.length) {
14282             return -1;
14283           }
14284         }
14285         var char = this.buffers[i][j];
14286         if (char == needle[match]) {
14287           if (match == 0) {
14288             mstart = {
14289               i,
14290               j,
14291               pos
14292             };
14293           }
14294           match++;
14295           if (match == needle.length) {
14296             return mstart.pos;
14297           }
14298         } else if (match != 0) {
14299           i = mstart.i;
14300           j = mstart.j;
14301           pos = mstart.pos;
14302           match = 0;
14303         }
14304         j++;
14305         pos++;
14306       }
14307     };
14308     Buffers.prototype.toBuffer = function() {
14309       return this.slice();
14310     };
14311     Buffers.prototype.toString = function(encoding, start, end) {
14312       return this.slice(start, end).toString(encoding);
14313     };
14314   }
14315 });
14316
14317 // node_modules/binary/lib/vars.js
14318 var require_vars = __commonJS({
14319   "node_modules/binary/lib/vars.js"(exports2, module2) {
14320     module2.exports = function(store) {
14321       function getset(name, value) {
14322         var node = vars.store;
14323         var keys = name.split(".");
14324         keys.slice(0, -1).forEach(function(k) {
14325           if (node[k] === void 0)
14326             node[k] = {};
14327           node = node[k];
14328         });
14329         var key = keys[keys.length - 1];
14330         if (arguments.length == 1) {
14331           return node[key];
14332         } else {
14333           return node[key] = value;
14334         }
14335       }
14336       var vars = {
14337         get: function(name) {
14338           return getset(name);
14339         },
14340         set: function(name, value) {
14341           return getset(name, value);
14342         },
14343         store: store || {}
14344       };
14345       return vars;
14346     };
14347   }
14348 });
14349
14350 // node_modules/binary/index.js
14351 var require_binary = __commonJS({
14352   "node_modules/binary/index.js"(exports2, module2) {
14353     var Chainsaw = require_chainsaw();
14354     var EventEmitter = require("events").EventEmitter;
14355     var Buffers = require_buffers();
14356     var Vars = require_vars();
14357     var Stream2 = require("stream").Stream;
14358     exports2 = module2.exports = function(bufOrEm, eventName) {
14359       if (Buffer.isBuffer(bufOrEm)) {
14360         return exports2.parse(bufOrEm);
14361       }
14362       var s = exports2.stream();
14363       if (bufOrEm && bufOrEm.pipe) {
14364         bufOrEm.pipe(s);
14365       } else if (bufOrEm) {
14366         bufOrEm.on(eventName || "data", function(buf) {
14367           s.write(buf);
14368         });
14369         bufOrEm.on("end", function() {
14370           s.end();
14371         });
14372       }
14373       return s;
14374     };
14375     exports2.stream = function(input) {
14376       if (input)
14377         return exports2.apply(null, arguments);
14378       var pending = null;
14379       function getBytes(bytes, cb, skip) {
14380         pending = {
14381           bytes,
14382           skip,
14383           cb: function(buf) {
14384             pending = null;
14385             cb(buf);
14386           }
14387         };
14388         dispatch();
14389       }
14390       var offset = null;
14391       function dispatch() {
14392         if (!pending) {
14393           if (caughtEnd)
14394             done = true;
14395           return;
14396         }
14397         if (typeof pending === "function") {
14398           pending();
14399         } else {
14400           var bytes = offset + pending.bytes;
14401           if (buffers.length >= bytes) {
14402             var buf;
14403             if (offset == null) {
14404               buf = buffers.splice(0, bytes);
14405               if (!pending.skip) {
14406                 buf = buf.slice();
14407               }
14408             } else {
14409               if (!pending.skip) {
14410                 buf = buffers.slice(offset, bytes);
14411               }
14412               offset = bytes;
14413             }
14414             if (pending.skip) {
14415               pending.cb();
14416             } else {
14417               pending.cb(buf);
14418             }
14419           }
14420         }
14421       }
14422       function builder(saw) {
14423         function next() {
14424           if (!done)
14425             saw.next();
14426         }
14427         var self2 = words(function(bytes, cb) {
14428           return function(name) {
14429             getBytes(bytes, function(buf) {
14430               vars.set(name, cb(buf));
14431               next();
14432             });
14433           };
14434         });
14435         self2.tap = function(cb) {
14436           saw.nest(cb, vars.store);
14437         };
14438         self2.into = function(key, cb) {
14439           if (!vars.get(key))
14440             vars.set(key, {});
14441           var parent = vars;
14442           vars = Vars(parent.get(key));
14443           saw.nest(function() {
14444             cb.apply(this, arguments);
14445             this.tap(function() {
14446               vars = parent;
14447             });
14448           }, vars.store);
14449         };
14450         self2.flush = function() {
14451           vars.store = {};
14452           next();
14453         };
14454         self2.loop = function(cb) {
14455           var end = false;
14456           saw.nest(false, function loop() {
14457             this.vars = vars.store;
14458             cb.call(this, function() {
14459               end = true;
14460               next();
14461             }, vars.store);
14462             this.tap(function() {
14463               if (end)
14464                 saw.next();
14465               else
14466                 loop.call(this);
14467             }.bind(this));
14468           }, vars.store);
14469         };
14470         self2.buffer = function(name, bytes) {
14471           if (typeof bytes === "string") {
14472             bytes = vars.get(bytes);
14473           }
14474           getBytes(bytes, function(buf) {
14475             vars.set(name, buf);
14476             next();
14477           });
14478         };
14479         self2.skip = function(bytes) {
14480           if (typeof bytes === "string") {
14481             bytes = vars.get(bytes);
14482           }
14483           getBytes(bytes, function() {
14484             next();
14485           });
14486         };
14487         self2.scan = function find2(name, search) {
14488           if (typeof search === "string") {
14489             search = new Buffer(search);
14490           } else if (!Buffer.isBuffer(search)) {
14491             throw new Error("search must be a Buffer or a string");
14492           }
14493           var taken = 0;
14494           pending = function() {
14495             var pos = buffers.indexOf(search, offset + taken);
14496             var i = pos - offset - taken;
14497             if (pos !== -1) {
14498               pending = null;
14499               if (offset != null) {
14500                 vars.set(name, buffers.slice(offset, offset + taken + i));
14501                 offset += taken + i + search.length;
14502               } else {
14503                 vars.set(name, buffers.slice(0, taken + i));
14504                 buffers.splice(0, taken + i + search.length);
14505               }
14506               next();
14507               dispatch();
14508             } else {
14509               i = Math.max(buffers.length - search.length - offset - taken, 0);
14510             }
14511             taken += i;
14512           };
14513           dispatch();
14514         };
14515         self2.peek = function(cb) {
14516           offset = 0;
14517           saw.nest(function() {
14518             cb.call(this, vars.store);
14519             this.tap(function() {
14520               offset = null;
14521             });
14522           });
14523         };
14524         return self2;
14525       }
14526       ;
14527       var stream = Chainsaw.light(builder);
14528       stream.writable = true;
14529       var buffers = Buffers();
14530       stream.write = function(buf) {
14531         buffers.push(buf);
14532         dispatch();
14533       };
14534       var vars = Vars();
14535       var done = false, caughtEnd = false;
14536       stream.end = function() {
14537         caughtEnd = true;
14538       };
14539       stream.pipe = Stream2.prototype.pipe;
14540       Object.getOwnPropertyNames(EventEmitter.prototype).forEach(function(name) {
14541         stream[name] = EventEmitter.prototype[name];
14542       });
14543       return stream;
14544     };
14545     exports2.parse = function parse(buffer) {
14546       var self2 = words(function(bytes, cb) {
14547         return function(name) {
14548           if (offset + bytes <= buffer.length) {
14549             var buf = buffer.slice(offset, offset + bytes);
14550             offset += bytes;
14551             vars.set(name, cb(buf));
14552           } else {
14553             vars.set(name, null);
14554           }
14555           return self2;
14556         };
14557       });
14558       var offset = 0;
14559       var vars = Vars();
14560       self2.vars = vars.store;
14561       self2.tap = function(cb) {
14562         cb.call(self2, vars.store);
14563         return self2;
14564       };
14565       self2.into = function(key, cb) {
14566         if (!vars.get(key)) {
14567           vars.set(key, {});
14568         }
14569         var parent = vars;
14570         vars = Vars(parent.get(key));
14571         cb.call(self2, vars.store);
14572         vars = parent;
14573         return self2;
14574       };
14575       self2.loop = function(cb) {
14576         var end = false;
14577         var ender = function() {
14578           end = true;
14579         };
14580         while (end === false) {
14581           cb.call(self2, ender, vars.store);
14582         }
14583         return self2;
14584       };
14585       self2.buffer = function(name, size) {
14586         if (typeof size === "string") {
14587           size = vars.get(size);
14588         }
14589         var buf = buffer.slice(offset, Math.min(buffer.length, offset + size));
14590         offset += size;
14591         vars.set(name, buf);
14592         return self2;
14593       };
14594       self2.skip = function(bytes) {
14595         if (typeof bytes === "string") {
14596           bytes = vars.get(bytes);
14597         }
14598         offset += bytes;
14599         return self2;
14600       };
14601       self2.scan = function(name, search) {
14602         if (typeof search === "string") {
14603           search = new Buffer(search);
14604         } else if (!Buffer.isBuffer(search)) {
14605           throw new Error("search must be a Buffer or a string");
14606         }
14607         vars.set(name, null);
14608         for (var i = 0; i + offset <= buffer.length - search.length + 1; i++) {
14609           for (var j = 0; j < search.length && buffer[offset + i + j] === search[j]; j++)
14610             ;
14611           if (j === search.length)
14612             break;
14613         }
14614         vars.set(name, buffer.slice(offset, offset + i));
14615         offset += i + search.length;
14616         return self2;
14617       };
14618       self2.peek = function(cb) {
14619         var was = offset;
14620         cb.call(self2, vars.store);
14621         offset = was;
14622         return self2;
14623       };
14624       self2.flush = function() {
14625         vars.store = {};
14626         return self2;
14627       };
14628       self2.eof = function() {
14629         return offset >= buffer.length;
14630       };
14631       return self2;
14632     };
14633     function decodeLEu(bytes) {
14634       var acc = 0;
14635       for (var i = 0; i < bytes.length; i++) {
14636         acc += Math.pow(256, i) * bytes[i];
14637       }
14638       return acc;
14639     }
14640     function decodeBEu(bytes) {
14641       var acc = 0;
14642       for (var i = 0; i < bytes.length; i++) {
14643         acc += Math.pow(256, bytes.length - i - 1) * bytes[i];
14644       }
14645       return acc;
14646     }
14647     function decodeBEs(bytes) {
14648       var val = decodeBEu(bytes);
14649       if ((bytes[0] & 128) == 128) {
14650         val -= Math.pow(256, bytes.length);
14651       }
14652       return val;
14653     }
14654     function decodeLEs(bytes) {
14655       var val = decodeLEu(bytes);
14656       if ((bytes[bytes.length - 1] & 128) == 128) {
14657         val -= Math.pow(256, bytes.length);
14658       }
14659       return val;
14660     }
14661     function words(decode) {
14662       var self2 = {};
14663       [1, 2, 4, 8].forEach(function(bytes) {
14664         var bits = bytes * 8;
14665         self2["word" + bits + "le"] = self2["word" + bits + "lu"] = decode(bytes, decodeLEu);
14666         self2["word" + bits + "ls"] = decode(bytes, decodeLEs);
14667         self2["word" + bits + "be"] = self2["word" + bits + "bu"] = decode(bytes, decodeBEu);
14668         self2["word" + bits + "bs"] = decode(bytes, decodeBEs);
14669       });
14670       self2.word8 = self2.word8u = self2.word8be;
14671       self2.word8s = self2.word8bs;
14672       return self2;
14673     }
14674   }
14675 });
14676
14677 // node_modules/bluebird/js/release/es5.js
14678 var require_es5 = __commonJS({
14679   "node_modules/bluebird/js/release/es5.js"(exports2, module2) {
14680     var isES5 = function() {
14681       "use strict";
14682       return this === void 0;
14683     }();
14684     if (isES5) {
14685       module2.exports = {
14686         freeze: Object.freeze,
14687         defineProperty: Object.defineProperty,
14688         getDescriptor: Object.getOwnPropertyDescriptor,
14689         keys: Object.keys,
14690         names: Object.getOwnPropertyNames,
14691         getPrototypeOf: Object.getPrototypeOf,
14692         isArray: Array.isArray,
14693         isES5,
14694         propertyIsWritable: function(obj2, prop) {
14695           var descriptor = Object.getOwnPropertyDescriptor(obj2, prop);
14696           return !!(!descriptor || descriptor.writable || descriptor.set);
14697         }
14698       };
14699     } else {
14700       has = {}.hasOwnProperty;
14701       str = {}.toString;
14702       proto = {}.constructor.prototype;
14703       ObjectKeys = function(o) {
14704         var ret2 = [];
14705         for (var key in o) {
14706           if (has.call(o, key)) {
14707             ret2.push(key);
14708           }
14709         }
14710         return ret2;
14711       };
14712       ObjectGetDescriptor = function(o, key) {
14713         return { value: o[key] };
14714       };
14715       ObjectDefineProperty = function(o, key, desc) {
14716         o[key] = desc.value;
14717         return o;
14718       };
14719       ObjectFreeze = function(obj2) {
14720         return obj2;
14721       };
14722       ObjectGetPrototypeOf = function(obj2) {
14723         try {
14724           return Object(obj2).constructor.prototype;
14725         } catch (e) {
14726           return proto;
14727         }
14728       };
14729       ArrayIsArray = function(obj2) {
14730         try {
14731           return str.call(obj2) === "[object Array]";
14732         } catch (e) {
14733           return false;
14734         }
14735       };
14736       module2.exports = {
14737         isArray: ArrayIsArray,
14738         keys: ObjectKeys,
14739         names: ObjectKeys,
14740         defineProperty: ObjectDefineProperty,
14741         getDescriptor: ObjectGetDescriptor,
14742         freeze: ObjectFreeze,
14743         getPrototypeOf: ObjectGetPrototypeOf,
14744         isES5,
14745         propertyIsWritable: function() {
14746           return true;
14747         }
14748       };
14749     }
14750     var has;
14751     var str;
14752     var proto;
14753     var ObjectKeys;
14754     var ObjectGetDescriptor;
14755     var ObjectDefineProperty;
14756     var ObjectFreeze;
14757     var ObjectGetPrototypeOf;
14758     var ArrayIsArray;
14759   }
14760 });
14761
14762 // node_modules/bluebird/js/release/util.js
14763 var require_util = __commonJS({
14764   "node_modules/bluebird/js/release/util.js"(exports, module) {
14765     "use strict";
14766     var es5 = require_es5();
14767     var canEvaluate = typeof navigator == "undefined";
14768     var errorObj = { e: {} };
14769     var tryCatchTarget;
14770     var globalObject = typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : exports !== void 0 ? exports : null;
14771     function tryCatcher() {
14772       try {
14773         var target = tryCatchTarget;
14774         tryCatchTarget = null;
14775         return target.apply(this, arguments);
14776       } catch (e) {
14777         errorObj.e = e;
14778         return errorObj;
14779       }
14780     }
14781     function tryCatch(fn) {
14782       tryCatchTarget = fn;
14783       return tryCatcher;
14784     }
14785     var inherits = function(Child, Parent) {
14786       var hasProp = {}.hasOwnProperty;
14787       function T() {
14788         this.constructor = Child;
14789         this.constructor$ = Parent;
14790         for (var propertyName in Parent.prototype) {
14791           if (hasProp.call(Parent.prototype, propertyName) && propertyName.charAt(propertyName.length - 1) !== "$") {
14792             this[propertyName + "$"] = Parent.prototype[propertyName];
14793           }
14794         }
14795       }
14796       T.prototype = Parent.prototype;
14797       Child.prototype = new T();
14798       return Child.prototype;
14799     };
14800     function isPrimitive(val) {
14801       return val == null || val === true || val === false || typeof val === "string" || typeof val === "number";
14802     }
14803     function isObject(value) {
14804       return typeof value === "function" || typeof value === "object" && value !== null;
14805     }
14806     function maybeWrapAsError(maybeError) {
14807       if (!isPrimitive(maybeError))
14808         return maybeError;
14809       return new Error(safeToString(maybeError));
14810     }
14811     function withAppended(target, appendee) {
14812       var len = target.length;
14813       var ret2 = new Array(len + 1);
14814       var i;
14815       for (i = 0; i < len; ++i) {
14816         ret2[i] = target[i];
14817       }
14818       ret2[i] = appendee;
14819       return ret2;
14820     }
14821     function getDataPropertyOrDefault(obj2, key, defaultValue) {
14822       if (es5.isES5) {
14823         var desc = Object.getOwnPropertyDescriptor(obj2, key);
14824         if (desc != null) {
14825           return desc.get == null && desc.set == null ? desc.value : defaultValue;
14826         }
14827       } else {
14828         return {}.hasOwnProperty.call(obj2, key) ? obj2[key] : void 0;
14829       }
14830     }
14831     function notEnumerableProp(obj2, name, value) {
14832       if (isPrimitive(obj2))
14833         return obj2;
14834       var descriptor = {
14835         value,
14836         configurable: true,
14837         enumerable: false,
14838         writable: true
14839       };
14840       es5.defineProperty(obj2, name, descriptor);
14841       return obj2;
14842     }
14843     function thrower(r) {
14844       throw r;
14845     }
14846     var inheritedDataKeys = function() {
14847       var excludedPrototypes = [
14848         Array.prototype,
14849         Object.prototype,
14850         Function.prototype
14851       ];
14852       var isExcludedProto = function(val) {
14853         for (var i = 0; i < excludedPrototypes.length; ++i) {
14854           if (excludedPrototypes[i] === val) {
14855             return true;
14856           }
14857         }
14858         return false;
14859       };
14860       if (es5.isES5) {
14861         var getKeys = Object.getOwnPropertyNames;
14862         return function(obj2) {
14863           var ret2 = [];
14864           var visitedKeys = Object.create(null);
14865           while (obj2 != null && !isExcludedProto(obj2)) {
14866             var keys;
14867             try {
14868               keys = getKeys(obj2);
14869             } catch (e) {
14870               return ret2;
14871             }
14872             for (var i = 0; i < keys.length; ++i) {
14873               var key = keys[i];
14874               if (visitedKeys[key])
14875                 continue;
14876               visitedKeys[key] = true;
14877               var desc = Object.getOwnPropertyDescriptor(obj2, key);
14878               if (desc != null && desc.get == null && desc.set == null) {
14879                 ret2.push(key);
14880               }
14881             }
14882             obj2 = es5.getPrototypeOf(obj2);
14883           }
14884           return ret2;
14885         };
14886       } else {
14887         var hasProp = {}.hasOwnProperty;
14888         return function(obj2) {
14889           if (isExcludedProto(obj2))
14890             return [];
14891           var ret2 = [];
14892           enumeration:
14893             for (var key in obj2) {
14894               if (hasProp.call(obj2, key)) {
14895                 ret2.push(key);
14896               } else {
14897                 for (var i = 0; i < excludedPrototypes.length; ++i) {
14898                   if (hasProp.call(excludedPrototypes[i], key)) {
14899                     continue enumeration;
14900                   }
14901                 }
14902                 ret2.push(key);
14903               }
14904             }
14905           return ret2;
14906         };
14907       }
14908     }();
14909     var thisAssignmentPattern = /this\s*\.\s*\S+\s*=/;
14910     function isClass(fn) {
14911       try {
14912         if (typeof fn === "function") {
14913           var keys = es5.names(fn.prototype);
14914           var hasMethods = es5.isES5 && keys.length > 1;
14915           var hasMethodsOtherThanConstructor = keys.length > 0 && !(keys.length === 1 && keys[0] === "constructor");
14916           var hasThisAssignmentAndStaticMethods = thisAssignmentPattern.test(fn + "") && es5.names(fn).length > 0;
14917           if (hasMethods || hasMethodsOtherThanConstructor || hasThisAssignmentAndStaticMethods) {
14918             return true;
14919           }
14920         }
14921         return false;
14922       } catch (e) {
14923         return false;
14924       }
14925     }
14926     function toFastProperties(obj) {
14927       function FakeConstructor() {
14928       }
14929       FakeConstructor.prototype = obj;
14930       var l = 8;
14931       while (l--)
14932         new FakeConstructor();
14933       return obj;
14934       eval(obj);
14935     }
14936     var rident = /^[a-z$_][a-z$_0-9]*$/i;
14937     function isIdentifier(str) {
14938       return rident.test(str);
14939     }
14940     function filledRange(count, prefix, suffix) {
14941       var ret2 = new Array(count);
14942       for (var i = 0; i < count; ++i) {
14943         ret2[i] = prefix + i + suffix;
14944       }
14945       return ret2;
14946     }
14947     function safeToString(obj2) {
14948       try {
14949         return obj2 + "";
14950       } catch (e) {
14951         return "[no string representation]";
14952       }
14953     }
14954     function isError(obj2) {
14955       return obj2 !== null && typeof obj2 === "object" && typeof obj2.message === "string" && typeof obj2.name === "string";
14956     }
14957     function markAsOriginatingFromRejection(e) {
14958       try {
14959         notEnumerableProp(e, "isOperational", true);
14960       } catch (ignore) {
14961       }
14962     }
14963     function originatesFromRejection(e) {
14964       if (e == null)
14965         return false;
14966       return e instanceof Error["__BluebirdErrorTypes__"].OperationalError || e["isOperational"] === true;
14967     }
14968     function canAttachTrace(obj2) {
14969       return isError(obj2) && es5.propertyIsWritable(obj2, "stack");
14970     }
14971     var ensureErrorObject = function() {
14972       if (!("stack" in new Error())) {
14973         return function(value) {
14974           if (canAttachTrace(value))
14975             return value;
14976           try {
14977             throw new Error(safeToString(value));
14978           } catch (err) {
14979             return err;
14980           }
14981         };
14982       } else {
14983         return function(value) {
14984           if (canAttachTrace(value))
14985             return value;
14986           return new Error(safeToString(value));
14987         };
14988       }
14989     }();
14990     function classString(obj2) {
14991       return {}.toString.call(obj2);
14992     }
14993     function copyDescriptors(from, to, filter) {
14994       var keys = es5.names(from);
14995       for (var i = 0; i < keys.length; ++i) {
14996         var key = keys[i];
14997         if (filter(key)) {
14998           try {
14999             es5.defineProperty(to, key, es5.getDescriptor(from, key));
15000           } catch (ignore) {
15001           }
15002         }
15003       }
15004     }
15005     var asArray = function(v) {
15006       if (es5.isArray(v)) {
15007         return v;
15008       }
15009       return null;
15010     };
15011     if (typeof Symbol !== "undefined" && Symbol.iterator) {
15012       ArrayFrom = typeof Array.from === "function" ? function(v) {
15013         return Array.from(v);
15014       } : function(v) {
15015         var ret2 = [];
15016         var it = v[Symbol.iterator]();
15017         var itResult;
15018         while (!(itResult = it.next()).done) {
15019           ret2.push(itResult.value);
15020         }
15021         return ret2;
15022       };
15023       asArray = function(v) {
15024         if (es5.isArray(v)) {
15025           return v;
15026         } else if (v != null && typeof v[Symbol.iterator] === "function") {
15027           return ArrayFrom(v);
15028         }
15029         return null;
15030       };
15031     }
15032     var ArrayFrom;
15033     var isNode = typeof process !== "undefined" && classString(process).toLowerCase() === "[object process]";
15034     var hasEnvVariables = typeof process !== "undefined" && typeof process.env !== "undefined";
15035     function env(key) {
15036       return hasEnvVariables ? process.env[key] : void 0;
15037     }
15038     function getNativePromise() {
15039       if (typeof Promise === "function") {
15040         try {
15041           var promise = new Promise(function() {
15042           });
15043           if ({}.toString.call(promise) === "[object Promise]") {
15044             return Promise;
15045           }
15046         } catch (e) {
15047         }
15048       }
15049     }
15050     function domainBind(self2, cb) {
15051       return self2.bind(cb);
15052     }
15053     var ret = {
15054       isClass,
15055       isIdentifier,
15056       inheritedDataKeys,
15057       getDataPropertyOrDefault,
15058       thrower,
15059       isArray: es5.isArray,
15060       asArray,
15061       notEnumerableProp,
15062       isPrimitive,
15063       isObject,
15064       isError,
15065       canEvaluate,
15066       errorObj,
15067       tryCatch,
15068       inherits,
15069       withAppended,
15070       maybeWrapAsError,
15071       toFastProperties,
15072       filledRange,
15073       toString: safeToString,
15074       canAttachTrace,
15075       ensureErrorObject,
15076       originatesFromRejection,
15077       markAsOriginatingFromRejection,
15078       classString,
15079       copyDescriptors,
15080       hasDevTools: typeof chrome !== "undefined" && chrome && typeof chrome.loadTimes === "function",
15081       isNode,
15082       hasEnvVariables,
15083       env,
15084       global: globalObject,
15085       getNativePromise,
15086       domainBind
15087     };
15088     ret.isRecentNode = ret.isNode && function() {
15089       var version = process.versions.node.split(".").map(Number);
15090       return version[0] === 0 && version[1] > 10 || version[0] > 0;
15091     }();
15092     if (ret.isNode)
15093       ret.toFastProperties(process);
15094     try {
15095       throw new Error();
15096     } catch (e) {
15097       ret.lastLineError = e;
15098     }
15099     module.exports = ret;
15100   }
15101 });
15102
15103 // node_modules/bluebird/js/release/schedule.js
15104 var require_schedule = __commonJS({
15105   "node_modules/bluebird/js/release/schedule.js"(exports2, module2) {
15106     "use strict";
15107     var util = require_util();
15108     var schedule;
15109     var noAsyncScheduler = function() {
15110       throw new Error("No async scheduler available\n\n    See http://goo.gl/MqrFmX\n");
15111     };
15112     var NativePromise = util.getNativePromise();
15113     if (util.isNode && typeof MutationObserver === "undefined") {
15114       GlobalSetImmediate = global.setImmediate;
15115       ProcessNextTick = process.nextTick;
15116       schedule = util.isRecentNode ? function(fn) {
15117         GlobalSetImmediate.call(global, fn);
15118       } : function(fn) {
15119         ProcessNextTick.call(process, fn);
15120       };
15121     } else if (typeof NativePromise === "function" && typeof NativePromise.resolve === "function") {
15122       nativePromise = NativePromise.resolve();
15123       schedule = function(fn) {
15124         nativePromise.then(fn);
15125       };
15126     } else if (typeof MutationObserver !== "undefined" && !(typeof window !== "undefined" && window.navigator && (window.navigator.standalone || window.cordova))) {
15127       schedule = function() {
15128         var div = document.createElement("div");
15129         var opts = { attributes: true };
15130         var toggleScheduled = false;
15131         var div2 = document.createElement("div");
15132         var o2 = new MutationObserver(function() {
15133           div.classList.toggle("foo");
15134           toggleScheduled = false;
15135         });
15136         o2.observe(div2, opts);
15137         var scheduleToggle = function() {
15138           if (toggleScheduled)
15139             return;
15140           toggleScheduled = true;
15141           div2.classList.toggle("foo");
15142         };
15143         return function schedule2(fn) {
15144           var o = new MutationObserver(function() {
15145             o.disconnect();
15146             fn();
15147           });
15148           o.observe(div, opts);
15149           scheduleToggle();
15150         };
15151       }();
15152     } else if (typeof setImmediate !== "undefined") {
15153       schedule = function(fn) {
15154         setImmediate(fn);
15155       };
15156     } else if (typeof setTimeout !== "undefined") {
15157       schedule = function(fn) {
15158         setTimeout(fn, 0);
15159       };
15160     } else {
15161       schedule = noAsyncScheduler;
15162     }
15163     var GlobalSetImmediate;
15164     var ProcessNextTick;
15165     var nativePromise;
15166     module2.exports = schedule;
15167   }
15168 });
15169
15170 // node_modules/bluebird/js/release/queue.js
15171 var require_queue = __commonJS({
15172   "node_modules/bluebird/js/release/queue.js"(exports2, module2) {
15173     "use strict";
15174     function arrayMove(src, srcIndex, dst, dstIndex, len) {
15175       for (var j = 0; j < len; ++j) {
15176         dst[j + dstIndex] = src[j + srcIndex];
15177         src[j + srcIndex] = void 0;
15178       }
15179     }
15180     function Queue(capacity) {
15181       this._capacity = capacity;
15182       this._length = 0;
15183       this._front = 0;
15184     }
15185     Queue.prototype._willBeOverCapacity = function(size) {
15186       return this._capacity < size;
15187     };
15188     Queue.prototype._pushOne = function(arg) {
15189       var length = this.length();
15190       this._checkCapacity(length + 1);
15191       var i = this._front + length & this._capacity - 1;
15192       this[i] = arg;
15193       this._length = length + 1;
15194     };
15195     Queue.prototype.push = function(fn, receiver, arg) {
15196       var length = this.length() + 3;
15197       if (this._willBeOverCapacity(length)) {
15198         this._pushOne(fn);
15199         this._pushOne(receiver);
15200         this._pushOne(arg);
15201         return;
15202       }
15203       var j = this._front + length - 3;
15204       this._checkCapacity(length);
15205       var wrapMask = this._capacity - 1;
15206       this[j + 0 & wrapMask] = fn;
15207       this[j + 1 & wrapMask] = receiver;
15208       this[j + 2 & wrapMask] = arg;
15209       this._length = length;
15210     };
15211     Queue.prototype.shift = function() {
15212       var front = this._front, ret2 = this[front];
15213       this[front] = void 0;
15214       this._front = front + 1 & this._capacity - 1;
15215       this._length--;
15216       return ret2;
15217     };
15218     Queue.prototype.length = function() {
15219       return this._length;
15220     };
15221     Queue.prototype._checkCapacity = function(size) {
15222       if (this._capacity < size) {
15223         this._resizeTo(this._capacity << 1);
15224       }
15225     };
15226     Queue.prototype._resizeTo = function(capacity) {
15227       var oldCapacity = this._capacity;
15228       this._capacity = capacity;
15229       var front = this._front;
15230       var length = this._length;
15231       var moveItemsCount = front + length & oldCapacity - 1;
15232       arrayMove(this, 0, this, oldCapacity, moveItemsCount);
15233     };
15234     module2.exports = Queue;
15235   }
15236 });
15237
15238 // node_modules/bluebird/js/release/async.js
15239 var require_async = __commonJS({
15240   "node_modules/bluebird/js/release/async.js"(exports2, module2) {
15241     "use strict";
15242     var firstLineError;
15243     try {
15244       throw new Error();
15245     } catch (e) {
15246       firstLineError = e;
15247     }
15248     var schedule = require_schedule();
15249     var Queue = require_queue();
15250     var util = require_util();
15251     function Async() {
15252       this._customScheduler = false;
15253       this._isTickUsed = false;
15254       this._lateQueue = new Queue(16);
15255       this._normalQueue = new Queue(16);
15256       this._haveDrainedQueues = false;
15257       this._trampolineEnabled = true;
15258       var self2 = this;
15259       this.drainQueues = function() {
15260         self2._drainQueues();
15261       };
15262       this._schedule = schedule;
15263     }
15264     Async.prototype.setScheduler = function(fn) {
15265       var prev = this._schedule;
15266       this._schedule = fn;
15267       this._customScheduler = true;
15268       return prev;
15269     };
15270     Async.prototype.hasCustomScheduler = function() {
15271       return this._customScheduler;
15272     };
15273     Async.prototype.enableTrampoline = function() {
15274       this._trampolineEnabled = true;
15275     };
15276     Async.prototype.disableTrampolineIfNecessary = function() {
15277       if (util.hasDevTools) {
15278         this._trampolineEnabled = false;
15279       }
15280     };
15281     Async.prototype.haveItemsQueued = function() {
15282       return this._isTickUsed || this._haveDrainedQueues;
15283     };
15284     Async.prototype.fatalError = function(e, isNode2) {
15285       if (isNode2) {
15286         process.stderr.write("Fatal " + (e instanceof Error ? e.stack : e) + "\n");
15287         process.exit(2);
15288       } else {
15289         this.throwLater(e);
15290       }
15291     };
15292     Async.prototype.throwLater = function(fn, arg) {
15293       if (arguments.length === 1) {
15294         arg = fn;
15295         fn = function() {
15296           throw arg;
15297         };
15298       }
15299       if (typeof setTimeout !== "undefined") {
15300         setTimeout(function() {
15301           fn(arg);
15302         }, 0);
15303       } else
15304         try {
15305           this._schedule(function() {
15306             fn(arg);
15307           });
15308         } catch (e) {
15309           throw new Error("No async scheduler available\n\n    See http://goo.gl/MqrFmX\n");
15310         }
15311     };
15312     function AsyncInvokeLater(fn, receiver, arg) {
15313       this._lateQueue.push(fn, receiver, arg);
15314       this._queueTick();
15315     }
15316     function AsyncInvoke(fn, receiver, arg) {
15317       this._normalQueue.push(fn, receiver, arg);
15318       this._queueTick();
15319     }
15320     function AsyncSettlePromises(promise) {
15321       this._normalQueue._pushOne(promise);
15322       this._queueTick();
15323     }
15324     if (!util.hasDevTools) {
15325       Async.prototype.invokeLater = AsyncInvokeLater;
15326       Async.prototype.invoke = AsyncInvoke;
15327       Async.prototype.settlePromises = AsyncSettlePromises;
15328     } else {
15329       Async.prototype.invokeLater = function(fn, receiver, arg) {
15330         if (this._trampolineEnabled) {
15331           AsyncInvokeLater.call(this, fn, receiver, arg);
15332         } else {
15333           this._schedule(function() {
15334             setTimeout(function() {
15335               fn.call(receiver, arg);
15336             }, 100);
15337           });
15338         }
15339       };
15340       Async.prototype.invoke = function(fn, receiver, arg) {
15341         if (this._trampolineEnabled) {
15342           AsyncInvoke.call(this, fn, receiver, arg);
15343         } else {
15344           this._schedule(function() {
15345             fn.call(receiver, arg);
15346           });
15347         }
15348       };
15349       Async.prototype.settlePromises = function(promise) {
15350         if (this._trampolineEnabled) {
15351           AsyncSettlePromises.call(this, promise);
15352         } else {
15353           this._schedule(function() {
15354             promise._settlePromises();
15355           });
15356         }
15357       };
15358     }
15359     Async.prototype._drainQueue = function(queue) {
15360       while (queue.length() > 0) {
15361         var fn = queue.shift();
15362         if (typeof fn !== "function") {
15363           fn._settlePromises();
15364           continue;
15365         }
15366         var receiver = queue.shift();
15367         var arg = queue.shift();
15368         fn.call(receiver, arg);
15369       }
15370     };
15371     Async.prototype._drainQueues = function() {
15372       this._drainQueue(this._normalQueue);
15373       this._reset();
15374       this._haveDrainedQueues = true;
15375       this._drainQueue(this._lateQueue);
15376     };
15377     Async.prototype._queueTick = function() {
15378       if (!this._isTickUsed) {
15379         this._isTickUsed = true;
15380         this._schedule(this.drainQueues);
15381       }
15382     };
15383     Async.prototype._reset = function() {
15384       this._isTickUsed = false;
15385     };
15386     module2.exports = Async;
15387     module2.exports.firstLineError = firstLineError;
15388   }
15389 });
15390
15391 // node_modules/bluebird/js/release/errors.js
15392 var require_errors = __commonJS({
15393   "node_modules/bluebird/js/release/errors.js"(exports2, module2) {
15394     "use strict";
15395     var es52 = require_es5();
15396     var Objectfreeze = es52.freeze;
15397     var util = require_util();
15398     var inherits2 = util.inherits;
15399     var notEnumerableProp2 = util.notEnumerableProp;
15400     function subError(nameProperty, defaultMessage) {
15401       function SubError(message) {
15402         if (!(this instanceof SubError))
15403           return new SubError(message);
15404         notEnumerableProp2(this, "message", typeof message === "string" ? message : defaultMessage);
15405         notEnumerableProp2(this, "name", nameProperty);
15406         if (Error.captureStackTrace) {
15407           Error.captureStackTrace(this, this.constructor);
15408         } else {
15409           Error.call(this);
15410         }
15411       }
15412       inherits2(SubError, Error);
15413       return SubError;
15414     }
15415     var _TypeError;
15416     var _RangeError;
15417     var Warning = subError("Warning", "warning");
15418     var CancellationError = subError("CancellationError", "cancellation error");
15419     var TimeoutError = subError("TimeoutError", "timeout error");
15420     var AggregateError = subError("AggregateError", "aggregate error");
15421     try {
15422       _TypeError = TypeError;
15423       _RangeError = RangeError;
15424     } catch (e) {
15425       _TypeError = subError("TypeError", "type error");
15426       _RangeError = subError("RangeError", "range error");
15427     }
15428     var methods = "join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" ");
15429     for (i = 0; i < methods.length; ++i) {
15430       if (typeof Array.prototype[methods[i]] === "function") {
15431         AggregateError.prototype[methods[i]] = Array.prototype[methods[i]];
15432       }
15433     }
15434     var i;
15435     es52.defineProperty(AggregateError.prototype, "length", {
15436       value: 0,
15437       configurable: false,
15438       writable: true,
15439       enumerable: true
15440     });
15441     AggregateError.prototype["isOperational"] = true;
15442     var level = 0;
15443     AggregateError.prototype.toString = function() {
15444       var indent = Array(level * 4 + 1).join(" ");
15445       var ret2 = "\n" + indent + "AggregateError of:\n";
15446       level++;
15447       indent = Array(level * 4 + 1).join(" ");
15448       for (var i2 = 0; i2 < this.length; ++i2) {
15449         var str = this[i2] === this ? "[Circular AggregateError]" : this[i2] + "";
15450         var lines = str.split("\n");
15451         for (var j = 0; j < lines.length; ++j) {
15452           lines[j] = indent + lines[j];
15453         }
15454         str = lines.join("\n");
15455         ret2 += str + "\n";
15456       }
15457       level--;
15458       return ret2;
15459     };
15460     function OperationalError(message) {
15461       if (!(this instanceof OperationalError))
15462         return new OperationalError(message);
15463       notEnumerableProp2(this, "name", "OperationalError");
15464       notEnumerableProp2(this, "message", message);
15465       this.cause = message;
15466       this["isOperational"] = true;
15467       if (message instanceof Error) {
15468         notEnumerableProp2(this, "message", message.message);
15469         notEnumerableProp2(this, "stack", message.stack);
15470       } else if (Error.captureStackTrace) {
15471         Error.captureStackTrace(this, this.constructor);
15472       }
15473     }
15474     inherits2(OperationalError, Error);
15475     var errorTypes = Error["__BluebirdErrorTypes__"];
15476     if (!errorTypes) {
15477       errorTypes = Objectfreeze({
15478         CancellationError,
15479         TimeoutError,
15480         OperationalError,
15481         RejectionError: OperationalError,
15482         AggregateError
15483       });
15484       es52.defineProperty(Error, "__BluebirdErrorTypes__", {
15485         value: errorTypes,
15486         writable: false,
15487         enumerable: false,
15488         configurable: false
15489       });
15490     }
15491     module2.exports = {
15492       Error,
15493       TypeError: _TypeError,
15494       RangeError: _RangeError,
15495       CancellationError: errorTypes.CancellationError,
15496       OperationalError: errorTypes.OperationalError,
15497       TimeoutError: errorTypes.TimeoutError,
15498       AggregateError: errorTypes.AggregateError,
15499       Warning
15500     };
15501   }
15502 });
15503
15504 // node_modules/bluebird/js/release/thenables.js
15505 var require_thenables = __commonJS({
15506   "node_modules/bluebird/js/release/thenables.js"(exports2, module2) {
15507     "use strict";
15508     module2.exports = function(Promise2, INTERNAL2) {
15509       var util = require_util();
15510       var errorObj2 = util.errorObj;
15511       var isObject2 = util.isObject;
15512       function tryConvertToPromise(obj2, context) {
15513         if (isObject2(obj2)) {
15514           if (obj2 instanceof Promise2)
15515             return obj2;
15516           var then = getThen(obj2);
15517           if (then === errorObj2) {
15518             if (context)
15519               context._pushContext();
15520             var ret2 = Promise2.reject(then.e);
15521             if (context)
15522               context._popContext();
15523             return ret2;
15524           } else if (typeof then === "function") {
15525             if (isAnyBluebirdPromise(obj2)) {
15526               var ret2 = new Promise2(INTERNAL2);
15527               obj2._then(ret2._fulfill, ret2._reject, void 0, ret2, null);
15528               return ret2;
15529             }
15530             return doThenable(obj2, then, context);
15531           }
15532         }
15533         return obj2;
15534       }
15535       function doGetThen(obj2) {
15536         return obj2.then;
15537       }
15538       function getThen(obj2) {
15539         try {
15540           return doGetThen(obj2);
15541         } catch (e) {
15542           errorObj2.e = e;
15543           return errorObj2;
15544         }
15545       }
15546       var hasProp = {}.hasOwnProperty;
15547       function isAnyBluebirdPromise(obj2) {
15548         try {
15549           return hasProp.call(obj2, "_promise0");
15550         } catch (e) {
15551           return false;
15552         }
15553       }
15554       function doThenable(x, then, context) {
15555         var promise = new Promise2(INTERNAL2);
15556         var ret2 = promise;
15557         if (context)
15558           context._pushContext();
15559         promise._captureStackTrace();
15560         if (context)
15561           context._popContext();
15562         var synchronous = true;
15563         var result = util.tryCatch(then).call(x, resolve, reject);
15564         synchronous = false;
15565         if (promise && result === errorObj2) {
15566           promise._rejectCallback(result.e, true, true);
15567           promise = null;
15568         }
15569         function resolve(value) {
15570           if (!promise)
15571             return;
15572           promise._resolveCallback(value);
15573           promise = null;
15574         }
15575         function reject(reason) {
15576           if (!promise)
15577             return;
15578           promise._rejectCallback(reason, synchronous, true);
15579           promise = null;
15580         }
15581         return ret2;
15582       }
15583       return tryConvertToPromise;
15584     };
15585   }
15586 });
15587
15588 // node_modules/bluebird/js/release/promise_array.js
15589 var require_promise_array = __commonJS({
15590   "node_modules/bluebird/js/release/promise_array.js"(exports2, module2) {
15591     "use strict";
15592     module2.exports = function(Promise2, INTERNAL2, tryConvertToPromise, apiRejection, Proxyable) {
15593       var util = require_util();
15594       var isArray = util.isArray;
15595       function toResolutionValue(val) {
15596         switch (val) {
15597           case -2:
15598             return [];
15599           case -3:
15600             return {};
15601         }
15602       }
15603       function PromiseArray(values) {
15604         var promise = this._promise = new Promise2(INTERNAL2);
15605         if (values instanceof Promise2) {
15606           promise._propagateFrom(values, 3);
15607         }
15608         promise._setOnCancel(this);
15609         this._values = values;
15610         this._length = 0;
15611         this._totalResolved = 0;
15612         this._init(void 0, -2);
15613       }
15614       util.inherits(PromiseArray, Proxyable);
15615       PromiseArray.prototype.length = function() {
15616         return this._length;
15617       };
15618       PromiseArray.prototype.promise = function() {
15619         return this._promise;
15620       };
15621       PromiseArray.prototype._init = function init(_, resolveValueIfEmpty) {
15622         var values = tryConvertToPromise(this._values, this._promise);
15623         if (values instanceof Promise2) {
15624           values = values._target();
15625           var bitField = values._bitField;
15626           ;
15627           this._values = values;
15628           if ((bitField & 50397184) === 0) {
15629             this._promise._setAsyncGuaranteed();
15630             return values._then(init, this._reject, void 0, this, resolveValueIfEmpty);
15631           } else if ((bitField & 33554432) !== 0) {
15632             values = values._value();
15633           } else if ((bitField & 16777216) !== 0) {
15634             return this._reject(values._reason());
15635           } else {
15636             return this._cancel();
15637           }
15638         }
15639         values = util.asArray(values);
15640         if (values === null) {
15641           var err = apiRejection("expecting an array or an iterable object but got " + util.classString(values)).reason();
15642           this._promise._rejectCallback(err, false);
15643           return;
15644         }
15645         if (values.length === 0) {
15646           if (resolveValueIfEmpty === -5) {
15647             this._resolveEmptyArray();
15648           } else {
15649             this._resolve(toResolutionValue(resolveValueIfEmpty));
15650           }
15651           return;
15652         }
15653         this._iterate(values);
15654       };
15655       PromiseArray.prototype._iterate = function(values) {
15656         var len = this.getActualLength(values.length);
15657         this._length = len;
15658         this._values = this.shouldCopyValues() ? new Array(len) : this._values;
15659         var result = this._promise;
15660         var isResolved = false;
15661         var bitField = null;
15662         for (var i = 0; i < len; ++i) {
15663           var maybePromise = tryConvertToPromise(values[i], result);
15664           if (maybePromise instanceof Promise2) {
15665             maybePromise = maybePromise._target();
15666             bitField = maybePromise._bitField;
15667           } else {
15668             bitField = null;
15669           }
15670           if (isResolved) {
15671             if (bitField !== null) {
15672               maybePromise.suppressUnhandledRejections();
15673             }
15674           } else if (bitField !== null) {
15675             if ((bitField & 50397184) === 0) {
15676               maybePromise._proxy(this, i);
15677               this._values[i] = maybePromise;
15678             } else if ((bitField & 33554432) !== 0) {
15679               isResolved = this._promiseFulfilled(maybePromise._value(), i);
15680             } else if ((bitField & 16777216) !== 0) {
15681               isResolved = this._promiseRejected(maybePromise._reason(), i);
15682             } else {
15683               isResolved = this._promiseCancelled(i);
15684             }
15685           } else {
15686             isResolved = this._promiseFulfilled(maybePromise, i);
15687           }
15688         }
15689         if (!isResolved)
15690           result._setAsyncGuaranteed();
15691       };
15692       PromiseArray.prototype._isResolved = function() {
15693         return this._values === null;
15694       };
15695       PromiseArray.prototype._resolve = function(value) {
15696         this._values = null;
15697         this._promise._fulfill(value);
15698       };
15699       PromiseArray.prototype._cancel = function() {
15700         if (this._isResolved() || !this._promise._isCancellable())
15701           return;
15702         this._values = null;
15703         this._promise._cancel();
15704       };
15705       PromiseArray.prototype._reject = function(reason) {
15706         this._values = null;
15707         this._promise._rejectCallback(reason, false);
15708       };
15709       PromiseArray.prototype._promiseFulfilled = function(value, index) {
15710         this._values[index] = value;
15711         var totalResolved = ++this._totalResolved;
15712         if (totalResolved >= this._length) {
15713           this._resolve(this._values);
15714           return true;
15715         }
15716         return false;
15717       };
15718       PromiseArray.prototype._promiseCancelled = function() {
15719         this._cancel();
15720         return true;
15721       };
15722       PromiseArray.prototype._promiseRejected = function(reason) {
15723         this._totalResolved++;
15724         this._reject(reason);
15725         return true;
15726       };
15727       PromiseArray.prototype._resultCancelled = function() {
15728         if (this._isResolved())
15729           return;
15730         var values = this._values;
15731         this._cancel();
15732         if (values instanceof Promise2) {
15733           values.cancel();
15734         } else {
15735           for (var i = 0; i < values.length; ++i) {
15736             if (values[i] instanceof Promise2) {
15737               values[i].cancel();
15738             }
15739           }
15740         }
15741       };
15742       PromiseArray.prototype.shouldCopyValues = function() {
15743         return true;
15744       };
15745       PromiseArray.prototype.getActualLength = function(len) {
15746         return len;
15747       };
15748       return PromiseArray;
15749     };
15750   }
15751 });
15752
15753 // node_modules/bluebird/js/release/context.js
15754 var require_context = __commonJS({
15755   "node_modules/bluebird/js/release/context.js"(exports2, module2) {
15756     "use strict";
15757     module2.exports = function(Promise2) {
15758       var longStackTraces = false;
15759       var contextStack = [];
15760       Promise2.prototype._promiseCreated = function() {
15761       };
15762       Promise2.prototype._pushContext = function() {
15763       };
15764       Promise2.prototype._popContext = function() {
15765         return null;
15766       };
15767       Promise2._peekContext = Promise2.prototype._peekContext = function() {
15768       };
15769       function Context() {
15770         this._trace = new Context.CapturedTrace(peekContext());
15771       }
15772       Context.prototype._pushContext = function() {
15773         if (this._trace !== void 0) {
15774           this._trace._promiseCreated = null;
15775           contextStack.push(this._trace);
15776         }
15777       };
15778       Context.prototype._popContext = function() {
15779         if (this._trace !== void 0) {
15780           var trace = contextStack.pop();
15781           var ret2 = trace._promiseCreated;
15782           trace._promiseCreated = null;
15783           return ret2;
15784         }
15785         return null;
15786       };
15787       function createContext() {
15788         if (longStackTraces)
15789           return new Context();
15790       }
15791       function peekContext() {
15792         var lastIndex = contextStack.length - 1;
15793         if (lastIndex >= 0) {
15794           return contextStack[lastIndex];
15795         }
15796         return void 0;
15797       }
15798       Context.CapturedTrace = null;
15799       Context.create = createContext;
15800       Context.deactivateLongStackTraces = function() {
15801       };
15802       Context.activateLongStackTraces = function() {
15803         var Promise_pushContext = Promise2.prototype._pushContext;
15804         var Promise_popContext = Promise2.prototype._popContext;
15805         var Promise_PeekContext = Promise2._peekContext;
15806         var Promise_peekContext = Promise2.prototype._peekContext;
15807         var Promise_promiseCreated = Promise2.prototype._promiseCreated;
15808         Context.deactivateLongStackTraces = function() {
15809           Promise2.prototype._pushContext = Promise_pushContext;
15810           Promise2.prototype._popContext = Promise_popContext;
15811           Promise2._peekContext = Promise_PeekContext;
15812           Promise2.prototype._peekContext = Promise_peekContext;
15813           Promise2.prototype._promiseCreated = Promise_promiseCreated;
15814           longStackTraces = false;
15815         };
15816         longStackTraces = true;
15817         Promise2.prototype._pushContext = Context.prototype._pushContext;
15818         Promise2.prototype._popContext = Context.prototype._popContext;
15819         Promise2._peekContext = Promise2.prototype._peekContext = peekContext;
15820         Promise2.prototype._promiseCreated = function() {
15821           var ctx = this._peekContext();
15822           if (ctx && ctx._promiseCreated == null)
15823             ctx._promiseCreated = this;
15824         };
15825       };
15826       return Context;
15827     };
15828   }
15829 });
15830
15831 // node_modules/bluebird/js/release/debuggability.js
15832 var require_debuggability = __commonJS({
15833   "node_modules/bluebird/js/release/debuggability.js"(exports2, module2) {
15834     "use strict";
15835     module2.exports = function(Promise2, Context) {
15836       var getDomain = Promise2._getDomain;
15837       var async = Promise2._async;
15838       var Warning = require_errors().Warning;
15839       var util = require_util();
15840       var canAttachTrace2 = util.canAttachTrace;
15841       var unhandledRejectionHandled;
15842       var possiblyUnhandledRejection;
15843       var bluebirdFramePattern = /[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/;
15844       var nodeFramePattern = /\((?:timers\.js):\d+:\d+\)/;
15845       var parseLinePattern = /[\/<\(](.+?):(\d+):(\d+)\)?\s*$/;
15846       var stackFramePattern = null;
15847       var formatStack = null;
15848       var indentStackFrames = false;
15849       var printWarning;
15850       var debugging = !!(util.env("BLUEBIRD_DEBUG") != 0 && (util.env("BLUEBIRD_DEBUG") || util.env("NODE_ENV") === "development"));
15851       var warnings = !!(util.env("BLUEBIRD_WARNINGS") != 0 && (debugging || util.env("BLUEBIRD_WARNINGS")));
15852       var longStackTraces = !!(util.env("BLUEBIRD_LONG_STACK_TRACES") != 0 && (debugging || util.env("BLUEBIRD_LONG_STACK_TRACES")));
15853       var wForgottenReturn = util.env("BLUEBIRD_W_FORGOTTEN_RETURN") != 0 && (warnings || !!util.env("BLUEBIRD_W_FORGOTTEN_RETURN"));
15854       Promise2.prototype.suppressUnhandledRejections = function() {
15855         var target = this._target();
15856         target._bitField = target._bitField & ~1048576 | 524288;
15857       };
15858       Promise2.prototype._ensurePossibleRejectionHandled = function() {
15859         if ((this._bitField & 524288) !== 0)
15860           return;
15861         this._setRejectionIsUnhandled();
15862         async.invokeLater(this._notifyUnhandledRejection, this, void 0);
15863       };
15864       Promise2.prototype._notifyUnhandledRejectionIsHandled = function() {
15865         fireRejectionEvent("rejectionHandled", unhandledRejectionHandled, void 0, this);
15866       };
15867       Promise2.prototype._setReturnedNonUndefined = function() {
15868         this._bitField = this._bitField | 268435456;
15869       };
15870       Promise2.prototype._returnedNonUndefined = function() {
15871         return (this._bitField & 268435456) !== 0;
15872       };
15873       Promise2.prototype._notifyUnhandledRejection = function() {
15874         if (this._isRejectionUnhandled()) {
15875           var reason = this._settledValue();
15876           this._setUnhandledRejectionIsNotified();
15877           fireRejectionEvent("unhandledRejection", possiblyUnhandledRejection, reason, this);
15878         }
15879       };
15880       Promise2.prototype._setUnhandledRejectionIsNotified = function() {
15881         this._bitField = this._bitField | 262144;
15882       };
15883       Promise2.prototype._unsetUnhandledRejectionIsNotified = function() {
15884         this._bitField = this._bitField & ~262144;
15885       };
15886       Promise2.prototype._isUnhandledRejectionNotified = function() {
15887         return (this._bitField & 262144) > 0;
15888       };
15889       Promise2.prototype._setRejectionIsUnhandled = function() {
15890         this._bitField = this._bitField | 1048576;
15891       };
15892       Promise2.prototype._unsetRejectionIsUnhandled = function() {
15893         this._bitField = this._bitField & ~1048576;
15894         if (this._isUnhandledRejectionNotified()) {
15895           this._unsetUnhandledRejectionIsNotified();
15896           this._notifyUnhandledRejectionIsHandled();
15897         }
15898       };
15899       Promise2.prototype._isRejectionUnhandled = function() {
15900         return (this._bitField & 1048576) > 0;
15901       };
15902       Promise2.prototype._warn = function(message, shouldUseOwnTrace, promise) {
15903         return warn(message, shouldUseOwnTrace, promise || this);
15904       };
15905       Promise2.onPossiblyUnhandledRejection = function(fn) {
15906         var domain = getDomain();
15907         possiblyUnhandledRejection = typeof fn === "function" ? domain === null ? fn : util.domainBind(domain, fn) : void 0;
15908       };
15909       Promise2.onUnhandledRejectionHandled = function(fn) {
15910         var domain = getDomain();
15911         unhandledRejectionHandled = typeof fn === "function" ? domain === null ? fn : util.domainBind(domain, fn) : void 0;
15912       };
15913       var disableLongStackTraces = function() {
15914       };
15915       Promise2.longStackTraces = function() {
15916         if (async.haveItemsQueued() && !config.longStackTraces) {
15917           throw new Error("cannot enable long stack traces after promises have been created\n\n    See http://goo.gl/MqrFmX\n");
15918         }
15919         if (!config.longStackTraces && longStackTracesIsSupported()) {
15920           var Promise_captureStackTrace = Promise2.prototype._captureStackTrace;
15921           var Promise_attachExtraTrace = Promise2.prototype._attachExtraTrace;
15922           config.longStackTraces = true;
15923           disableLongStackTraces = function() {
15924             if (async.haveItemsQueued() && !config.longStackTraces) {
15925               throw new Error("cannot enable long stack traces after promises have been created\n\n    See http://goo.gl/MqrFmX\n");
15926             }
15927             Promise2.prototype._captureStackTrace = Promise_captureStackTrace;
15928             Promise2.prototype._attachExtraTrace = Promise_attachExtraTrace;
15929             Context.deactivateLongStackTraces();
15930             async.enableTrampoline();
15931             config.longStackTraces = false;
15932           };
15933           Promise2.prototype._captureStackTrace = longStackTracesCaptureStackTrace;
15934           Promise2.prototype._attachExtraTrace = longStackTracesAttachExtraTrace;
15935           Context.activateLongStackTraces();
15936           async.disableTrampolineIfNecessary();
15937         }
15938       };
15939       Promise2.hasLongStackTraces = function() {
15940         return config.longStackTraces && longStackTracesIsSupported();
15941       };
15942       var fireDomEvent = function() {
15943         try {
15944           if (typeof CustomEvent === "function") {
15945             var event = new CustomEvent("CustomEvent");
15946             util.global.dispatchEvent(event);
15947             return function(name, event2) {
15948               var domEvent = new CustomEvent(name.toLowerCase(), {
15949                 detail: event2,
15950                 cancelable: true
15951               });
15952               return !util.global.dispatchEvent(domEvent);
15953             };
15954           } else if (typeof Event === "function") {
15955             var event = new Event("CustomEvent");
15956             util.global.dispatchEvent(event);
15957             return function(name, event2) {
15958               var domEvent = new Event(name.toLowerCase(), {
15959                 cancelable: true
15960               });
15961               domEvent.detail = event2;
15962               return !util.global.dispatchEvent(domEvent);
15963             };
15964           } else {
15965             var event = document.createEvent("CustomEvent");
15966             event.initCustomEvent("testingtheevent", false, true, {});
15967             util.global.dispatchEvent(event);
15968             return function(name, event2) {
15969               var domEvent = document.createEvent("CustomEvent");
15970               domEvent.initCustomEvent(name.toLowerCase(), false, true, event2);
15971               return !util.global.dispatchEvent(domEvent);
15972             };
15973           }
15974         } catch (e) {
15975         }
15976         return function() {
15977           return false;
15978         };
15979       }();
15980       var fireGlobalEvent = function() {
15981         if (util.isNode) {
15982           return function() {
15983             return process.emit.apply(process, arguments);
15984           };
15985         } else {
15986           if (!util.global) {
15987             return function() {
15988               return false;
15989             };
15990           }
15991           return function(name) {
15992             var methodName = "on" + name.toLowerCase();
15993             var method = util.global[methodName];
15994             if (!method)
15995               return false;
15996             method.apply(util.global, [].slice.call(arguments, 1));
15997             return true;
15998           };
15999         }
16000       }();
16001       function generatePromiseLifecycleEventObject(name, promise) {
16002         return { promise };
16003       }
16004       var eventToObjectGenerator = {
16005         promiseCreated: generatePromiseLifecycleEventObject,
16006         promiseFulfilled: generatePromiseLifecycleEventObject,
16007         promiseRejected: generatePromiseLifecycleEventObject,
16008         promiseResolved: generatePromiseLifecycleEventObject,
16009         promiseCancelled: generatePromiseLifecycleEventObject,
16010         promiseChained: function(name, promise, child) {
16011           return { promise, child };
16012         },
16013         warning: function(name, warning) {
16014           return { warning };
16015         },
16016         unhandledRejection: function(name, reason, promise) {
16017           return { reason, promise };
16018         },
16019         rejectionHandled: generatePromiseLifecycleEventObject
16020       };
16021       var activeFireEvent = function(name) {
16022         var globalEventFired = false;
16023         try {
16024           globalEventFired = fireGlobalEvent.apply(null, arguments);
16025         } catch (e) {
16026           async.throwLater(e);
16027           globalEventFired = true;
16028         }
16029         var domEventFired = false;
16030         try {
16031           domEventFired = fireDomEvent(name, eventToObjectGenerator[name].apply(null, arguments));
16032         } catch (e) {
16033           async.throwLater(e);
16034           domEventFired = true;
16035         }
16036         return domEventFired || globalEventFired;
16037       };
16038       Promise2.config = function(opts) {
16039         opts = Object(opts);
16040         if ("longStackTraces" in opts) {
16041           if (opts.longStackTraces) {
16042             Promise2.longStackTraces();
16043           } else if (!opts.longStackTraces && Promise2.hasLongStackTraces()) {
16044             disableLongStackTraces();
16045           }
16046         }
16047         if ("warnings" in opts) {
16048           var warningsOption = opts.warnings;
16049           config.warnings = !!warningsOption;
16050           wForgottenReturn = config.warnings;
16051           if (util.isObject(warningsOption)) {
16052             if ("wForgottenReturn" in warningsOption) {
16053               wForgottenReturn = !!warningsOption.wForgottenReturn;
16054             }
16055           }
16056         }
16057         if ("cancellation" in opts && opts.cancellation && !config.cancellation) {
16058           if (async.haveItemsQueued()) {
16059             throw new Error("cannot enable cancellation after promises are in use");
16060           }
16061           Promise2.prototype._clearCancellationData = cancellationClearCancellationData;
16062           Promise2.prototype._propagateFrom = cancellationPropagateFrom;
16063           Promise2.prototype._onCancel = cancellationOnCancel;
16064           Promise2.prototype._setOnCancel = cancellationSetOnCancel;
16065           Promise2.prototype._attachCancellationCallback = cancellationAttachCancellationCallback;
16066           Promise2.prototype._execute = cancellationExecute;
16067           propagateFromFunction = cancellationPropagateFrom;
16068           config.cancellation = true;
16069         }
16070         if ("monitoring" in opts) {
16071           if (opts.monitoring && !config.monitoring) {
16072             config.monitoring = true;
16073             Promise2.prototype._fireEvent = activeFireEvent;
16074           } else if (!opts.monitoring && config.monitoring) {
16075             config.monitoring = false;
16076             Promise2.prototype._fireEvent = defaultFireEvent;
16077           }
16078         }
16079         return Promise2;
16080       };
16081       function defaultFireEvent() {
16082         return false;
16083       }
16084       Promise2.prototype._fireEvent = defaultFireEvent;
16085       Promise2.prototype._execute = function(executor, resolve, reject) {
16086         try {
16087           executor(resolve, reject);
16088         } catch (e) {
16089           return e;
16090         }
16091       };
16092       Promise2.prototype._onCancel = function() {
16093       };
16094       Promise2.prototype._setOnCancel = function(handler) {
16095         ;
16096       };
16097       Promise2.prototype._attachCancellationCallback = function(onCancel) {
16098         ;
16099       };
16100       Promise2.prototype._captureStackTrace = function() {
16101       };
16102       Promise2.prototype._attachExtraTrace = function() {
16103       };
16104       Promise2.prototype._clearCancellationData = function() {
16105       };
16106       Promise2.prototype._propagateFrom = function(parent, flags) {
16107         ;
16108         ;
16109       };
16110       function cancellationExecute(executor, resolve, reject) {
16111         var promise = this;
16112         try {
16113           executor(resolve, reject, function(onCancel) {
16114             if (typeof onCancel !== "function") {
16115               throw new TypeError("onCancel must be a function, got: " + util.toString(onCancel));
16116             }
16117             promise._attachCancellationCallback(onCancel);
16118           });
16119         } catch (e) {
16120           return e;
16121         }
16122       }
16123       function cancellationAttachCancellationCallback(onCancel) {
16124         if (!this._isCancellable())
16125           return this;
16126         var previousOnCancel = this._onCancel();
16127         if (previousOnCancel !== void 0) {
16128           if (util.isArray(previousOnCancel)) {
16129             previousOnCancel.push(onCancel);
16130           } else {
16131             this._setOnCancel([previousOnCancel, onCancel]);
16132           }
16133         } else {
16134           this._setOnCancel(onCancel);
16135         }
16136       }
16137       function cancellationOnCancel() {
16138         return this._onCancelField;
16139       }
16140       function cancellationSetOnCancel(onCancel) {
16141         this._onCancelField = onCancel;
16142       }
16143       function cancellationClearCancellationData() {
16144         this._cancellationParent = void 0;
16145         this._onCancelField = void 0;
16146       }
16147       function cancellationPropagateFrom(parent, flags) {
16148         if ((flags & 1) !== 0) {
16149           this._cancellationParent = parent;
16150           var branchesRemainingToCancel = parent._branchesRemainingToCancel;
16151           if (branchesRemainingToCancel === void 0) {
16152             branchesRemainingToCancel = 0;
16153           }
16154           parent._branchesRemainingToCancel = branchesRemainingToCancel + 1;
16155         }
16156         if ((flags & 2) !== 0 && parent._isBound()) {
16157           this._setBoundTo(parent._boundTo);
16158         }
16159       }
16160       function bindingPropagateFrom(parent, flags) {
16161         if ((flags & 2) !== 0 && parent._isBound()) {
16162           this._setBoundTo(parent._boundTo);
16163         }
16164       }
16165       var propagateFromFunction = bindingPropagateFrom;
16166       function boundValueFunction() {
16167         var ret2 = this._boundTo;
16168         if (ret2 !== void 0) {
16169           if (ret2 instanceof Promise2) {
16170             if (ret2.isFulfilled()) {
16171               return ret2.value();
16172             } else {
16173               return void 0;
16174             }
16175           }
16176         }
16177         return ret2;
16178       }
16179       function longStackTracesCaptureStackTrace() {
16180         this._trace = new CapturedTrace(this._peekContext());
16181       }
16182       function longStackTracesAttachExtraTrace(error, ignoreSelf) {
16183         if (canAttachTrace2(error)) {
16184           var trace = this._trace;
16185           if (trace !== void 0) {
16186             if (ignoreSelf)
16187               trace = trace._parent;
16188           }
16189           if (trace !== void 0) {
16190             trace.attachExtraTrace(error);
16191           } else if (!error.__stackCleaned__) {
16192             var parsed = parseStackAndMessage(error);
16193             util.notEnumerableProp(error, "stack", parsed.message + "\n" + parsed.stack.join("\n"));
16194             util.notEnumerableProp(error, "__stackCleaned__", true);
16195           }
16196         }
16197       }
16198       function checkForgottenReturns(returnValue, promiseCreated, name, promise, parent) {
16199         if (returnValue === void 0 && promiseCreated !== null && wForgottenReturn) {
16200           if (parent !== void 0 && parent._returnedNonUndefined())
16201             return;
16202           if ((promise._bitField & 65535) === 0)
16203             return;
16204           if (name)
16205             name = name + " ";
16206           var handlerLine = "";
16207           var creatorLine = "";
16208           if (promiseCreated._trace) {
16209             var traceLines = promiseCreated._trace.stack.split("\n");
16210             var stack = cleanStack(traceLines);
16211             for (var i = stack.length - 1; i >= 0; --i) {
16212               var line = stack[i];
16213               if (!nodeFramePattern.test(line)) {
16214                 var lineMatches = line.match(parseLinePattern);
16215                 if (lineMatches) {
16216                   handlerLine = "at " + lineMatches[1] + ":" + lineMatches[2] + ":" + lineMatches[3] + " ";
16217                 }
16218                 break;
16219               }
16220             }
16221             if (stack.length > 0) {
16222               var firstUserLine = stack[0];
16223               for (var i = 0; i < traceLines.length; ++i) {
16224                 if (traceLines[i] === firstUserLine) {
16225                   if (i > 0) {
16226                     creatorLine = "\n" + traceLines[i - 1];
16227                   }
16228                   break;
16229                 }
16230               }
16231             }
16232           }
16233           var msg = "a promise was created in a " + name + "handler " + handlerLine + "but was not returned from it, see http://goo.gl/rRqMUw" + creatorLine;
16234           promise._warn(msg, true, promiseCreated);
16235         }
16236       }
16237       function deprecated(name, replacement) {
16238         var message = name + " is deprecated and will be removed in a future version.";
16239         if (replacement)
16240           message += " Use " + replacement + " instead.";
16241         return warn(message);
16242       }
16243       function warn(message, shouldUseOwnTrace, promise) {
16244         if (!config.warnings)
16245           return;
16246         var warning = new Warning(message);
16247         var ctx;
16248         if (shouldUseOwnTrace) {
16249           promise._attachExtraTrace(warning);
16250         } else if (config.longStackTraces && (ctx = Promise2._peekContext())) {
16251           ctx.attachExtraTrace(warning);
16252         } else {
16253           var parsed = parseStackAndMessage(warning);
16254           warning.stack = parsed.message + "\n" + parsed.stack.join("\n");
16255         }
16256         if (!activeFireEvent("warning", warning)) {
16257           formatAndLogError(warning, "", true);
16258         }
16259       }
16260       function reconstructStack(message, stacks) {
16261         for (var i = 0; i < stacks.length - 1; ++i) {
16262           stacks[i].push("From previous event:");
16263           stacks[i] = stacks[i].join("\n");
16264         }
16265         if (i < stacks.length) {
16266           stacks[i] = stacks[i].join("\n");
16267         }
16268         return message + "\n" + stacks.join("\n");
16269       }
16270       function removeDuplicateOrEmptyJumps(stacks) {
16271         for (var i = 0; i < stacks.length; ++i) {
16272           if (stacks[i].length === 0 || i + 1 < stacks.length && stacks[i][0] === stacks[i + 1][0]) {
16273             stacks.splice(i, 1);
16274             i--;
16275           }
16276         }
16277       }
16278       function removeCommonRoots(stacks) {
16279         var current = stacks[0];
16280         for (var i = 1; i < stacks.length; ++i) {
16281           var prev = stacks[i];
16282           var currentLastIndex = current.length - 1;
16283           var currentLastLine = current[currentLastIndex];
16284           var commonRootMeetPoint = -1;
16285           for (var j = prev.length - 1; j >= 0; --j) {
16286             if (prev[j] === currentLastLine) {
16287               commonRootMeetPoint = j;
16288               break;
16289             }
16290           }
16291           for (var j = commonRootMeetPoint; j >= 0; --j) {
16292             var line = prev[j];
16293             if (current[currentLastIndex] === line) {
16294               current.pop();
16295               currentLastIndex--;
16296             } else {
16297               break;
16298             }
16299           }
16300           current = prev;
16301         }
16302       }
16303       function cleanStack(stack) {
16304         var ret2 = [];
16305         for (var i = 0; i < stack.length; ++i) {
16306           var line = stack[i];
16307           var isTraceLine = line === "    (No stack trace)" || stackFramePattern.test(line);
16308           var isInternalFrame = isTraceLine && shouldIgnore(line);
16309           if (isTraceLine && !isInternalFrame) {
16310             if (indentStackFrames && line.charAt(0) !== " ") {
16311               line = "    " + line;
16312             }
16313             ret2.push(line);
16314           }
16315         }
16316         return ret2;
16317       }
16318       function stackFramesAsArray(error) {
16319         var stack = error.stack.replace(/\s+$/g, "").split("\n");
16320         for (var i = 0; i < stack.length; ++i) {
16321           var line = stack[i];
16322           if (line === "    (No stack trace)" || stackFramePattern.test(line)) {
16323             break;
16324           }
16325         }
16326         if (i > 0 && error.name != "SyntaxError") {
16327           stack = stack.slice(i);
16328         }
16329         return stack;
16330       }
16331       function parseStackAndMessage(error) {
16332         var stack = error.stack;
16333         var message = error.toString();
16334         stack = typeof stack === "string" && stack.length > 0 ? stackFramesAsArray(error) : ["    (No stack trace)"];
16335         return {
16336           message,
16337           stack: error.name == "SyntaxError" ? stack : cleanStack(stack)
16338         };
16339       }
16340       function formatAndLogError(error, title, isSoft) {
16341         if (typeof console !== "undefined") {
16342           var message;
16343           if (util.isObject(error)) {
16344             var stack = error.stack;
16345             message = title + formatStack(stack, error);
16346           } else {
16347             message = title + String(error);
16348           }
16349           if (typeof printWarning === "function") {
16350             printWarning(message, isSoft);
16351           } else if (typeof console.log === "function" || typeof console.log === "object") {
16352             console.log(message);
16353           }
16354         }
16355       }
16356       function fireRejectionEvent(name, localHandler, reason, promise) {
16357         var localEventFired = false;
16358         try {
16359           if (typeof localHandler === "function") {
16360             localEventFired = true;
16361             if (name === "rejectionHandled") {
16362               localHandler(promise);
16363             } else {
16364               localHandler(reason, promise);
16365             }
16366           }
16367         } catch (e) {
16368           async.throwLater(e);
16369         }
16370         if (name === "unhandledRejection") {
16371           if (!activeFireEvent(name, reason, promise) && !localEventFired) {
16372             formatAndLogError(reason, "Unhandled rejection ");
16373           }
16374         } else {
16375           activeFireEvent(name, promise);
16376         }
16377       }
16378       function formatNonError(obj2) {
16379         var str;
16380         if (typeof obj2 === "function") {
16381           str = "[function " + (obj2.name || "anonymous") + "]";
16382         } else {
16383           str = obj2 && typeof obj2.toString === "function" ? obj2.toString() : util.toString(obj2);
16384           var ruselessToString = /\[object [a-zA-Z0-9$_]+\]/;
16385           if (ruselessToString.test(str)) {
16386             try {
16387               var newStr = JSON.stringify(obj2);
16388               str = newStr;
16389             } catch (e) {
16390             }
16391           }
16392           if (str.length === 0) {
16393             str = "(empty array)";
16394           }
16395         }
16396         return "(<" + snip(str) + ">, no stack trace)";
16397       }
16398       function snip(str) {
16399         var maxChars = 41;
16400         if (str.length < maxChars) {
16401           return str;
16402         }
16403         return str.substr(0, maxChars - 3) + "...";
16404       }
16405       function longStackTracesIsSupported() {
16406         return typeof captureStackTrace === "function";
16407       }
16408       var shouldIgnore = function() {
16409         return false;
16410       };
16411       var parseLineInfoRegex = /[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;
16412       function parseLineInfo(line) {
16413         var matches = line.match(parseLineInfoRegex);
16414         if (matches) {
16415           return {
16416             fileName: matches[1],
16417             line: parseInt(matches[2], 10)
16418           };
16419         }
16420       }
16421       function setBounds(firstLineError, lastLineError) {
16422         if (!longStackTracesIsSupported())
16423           return;
16424         var firstStackLines = firstLineError.stack.split("\n");
16425         var lastStackLines = lastLineError.stack.split("\n");
16426         var firstIndex = -1;
16427         var lastIndex = -1;
16428         var firstFileName;
16429         var lastFileName;
16430         for (var i = 0; i < firstStackLines.length; ++i) {
16431           var result = parseLineInfo(firstStackLines[i]);
16432           if (result) {
16433             firstFileName = result.fileName;
16434             firstIndex = result.line;
16435             break;
16436           }
16437         }
16438         for (var i = 0; i < lastStackLines.length; ++i) {
16439           var result = parseLineInfo(lastStackLines[i]);
16440           if (result) {
16441             lastFileName = result.fileName;
16442             lastIndex = result.line;
16443             break;
16444           }
16445         }
16446         if (firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName || firstFileName !== lastFileName || firstIndex >= lastIndex) {
16447           return;
16448         }
16449         shouldIgnore = function(line) {
16450           if (bluebirdFramePattern.test(line))
16451             return true;
16452           var info = parseLineInfo(line);
16453           if (info) {
16454             if (info.fileName === firstFileName && (firstIndex <= info.line && info.line <= lastIndex)) {
16455               return true;
16456             }
16457           }
16458           return false;
16459         };
16460       }
16461       function CapturedTrace(parent) {
16462         this._parent = parent;
16463         this._promisesCreated = 0;
16464         var length = this._length = 1 + (parent === void 0 ? 0 : parent._length);
16465         captureStackTrace(this, CapturedTrace);
16466         if (length > 32)
16467           this.uncycle();
16468       }
16469       util.inherits(CapturedTrace, Error);
16470       Context.CapturedTrace = CapturedTrace;
16471       CapturedTrace.prototype.uncycle = function() {
16472         var length = this._length;
16473         if (length < 2)
16474           return;
16475         var nodes = [];
16476         var stackToIndex = {};
16477         for (var i = 0, node = this; node !== void 0; ++i) {
16478           nodes.push(node);
16479           node = node._parent;
16480         }
16481         length = this._length = i;
16482         for (var i = length - 1; i >= 0; --i) {
16483           var stack = nodes[i].stack;
16484           if (stackToIndex[stack] === void 0) {
16485             stackToIndex[stack] = i;
16486           }
16487         }
16488         for (var i = 0; i < length; ++i) {
16489           var currentStack = nodes[i].stack;
16490           var index = stackToIndex[currentStack];
16491           if (index !== void 0 && index !== i) {
16492             if (index > 0) {
16493               nodes[index - 1]._parent = void 0;
16494               nodes[index - 1]._length = 1;
16495             }
16496             nodes[i]._parent = void 0;
16497             nodes[i]._length = 1;
16498             var cycleEdgeNode = i > 0 ? nodes[i - 1] : this;
16499             if (index < length - 1) {
16500               cycleEdgeNode._parent = nodes[index + 1];
16501               cycleEdgeNode._parent.uncycle();
16502               cycleEdgeNode._length = cycleEdgeNode._parent._length + 1;
16503             } else {
16504               cycleEdgeNode._parent = void 0;
16505               cycleEdgeNode._length = 1;
16506             }
16507             var currentChildLength = cycleEdgeNode._length + 1;
16508             for (var j = i - 2; j >= 0; --j) {
16509               nodes[j]._length = currentChildLength;
16510               currentChildLength++;
16511             }
16512             return;
16513           }
16514         }
16515       };
16516       CapturedTrace.prototype.attachExtraTrace = function(error) {
16517         if (error.__stackCleaned__)
16518           return;
16519         this.uncycle();
16520         var parsed = parseStackAndMessage(error);
16521         var message = parsed.message;
16522         var stacks = [parsed.stack];
16523         var trace = this;
16524         while (trace !== void 0) {
16525           stacks.push(cleanStack(trace.stack.split("\n")));
16526           trace = trace._parent;
16527         }
16528         removeCommonRoots(stacks);
16529         removeDuplicateOrEmptyJumps(stacks);
16530         util.notEnumerableProp(error, "stack", reconstructStack(message, stacks));
16531         util.notEnumerableProp(error, "__stackCleaned__", true);
16532       };
16533       var captureStackTrace = function stackDetection() {
16534         var v8stackFramePattern = /^\s*at\s*/;
16535         var v8stackFormatter = function(stack, error) {
16536           if (typeof stack === "string")
16537             return stack;
16538           if (error.name !== void 0 && error.message !== void 0) {
16539             return error.toString();
16540           }
16541           return formatNonError(error);
16542         };
16543         if (typeof Error.stackTraceLimit === "number" && typeof Error.captureStackTrace === "function") {
16544           Error.stackTraceLimit += 6;
16545           stackFramePattern = v8stackFramePattern;
16546           formatStack = v8stackFormatter;
16547           var captureStackTrace2 = Error.captureStackTrace;
16548           shouldIgnore = function(line) {
16549             return bluebirdFramePattern.test(line);
16550           };
16551           return function(receiver, ignoreUntil) {
16552             Error.stackTraceLimit += 6;
16553             captureStackTrace2(receiver, ignoreUntil);
16554             Error.stackTraceLimit -= 6;
16555           };
16556         }
16557         var err = new Error();
16558         if (typeof err.stack === "string" && err.stack.split("\n")[0].indexOf("stackDetection@") >= 0) {
16559           stackFramePattern = /@/;
16560           formatStack = v8stackFormatter;
16561           indentStackFrames = true;
16562           return function captureStackTrace3(o) {
16563             o.stack = new Error().stack;
16564           };
16565         }
16566         var hasStackAfterThrow;
16567         try {
16568           throw new Error();
16569         } catch (e) {
16570           hasStackAfterThrow = "stack" in e;
16571         }
16572         if (!("stack" in err) && hasStackAfterThrow && typeof Error.stackTraceLimit === "number") {
16573           stackFramePattern = v8stackFramePattern;
16574           formatStack = v8stackFormatter;
16575           return function captureStackTrace3(o) {
16576             Error.stackTraceLimit += 6;
16577             try {
16578               throw new Error();
16579             } catch (e) {
16580               o.stack = e.stack;
16581             }
16582             Error.stackTraceLimit -= 6;
16583           };
16584         }
16585         formatStack = function(stack, error) {
16586           if (typeof stack === "string")
16587             return stack;
16588           if ((typeof error === "object" || typeof error === "function") && error.name !== void 0 && error.message !== void 0) {
16589             return error.toString();
16590           }
16591           return formatNonError(error);
16592         };
16593         return null;
16594       }([]);
16595       if (typeof console !== "undefined" && typeof console.warn !== "undefined") {
16596         printWarning = function(message) {
16597           console.warn(message);
16598         };
16599         if (util.isNode && process.stderr.isTTY) {
16600           printWarning = function(message, isSoft) {
16601             var color = isSoft ? "\e[33m" : "\e[31m";
16602             console.warn(color + message + "\e[0m\n");
16603           };
16604         } else if (!util.isNode && typeof new Error().stack === "string") {
16605           printWarning = function(message, isSoft) {
16606             console.warn("%c" + message, isSoft ? "color: darkorange" : "color: red");
16607           };
16608         }
16609       }
16610       var config = {
16611         warnings,
16612         longStackTraces: false,
16613         cancellation: false,
16614         monitoring: false
16615       };
16616       if (longStackTraces)
16617         Promise2.longStackTraces();
16618       return {
16619         longStackTraces: function() {
16620           return config.longStackTraces;
16621         },
16622         warnings: function() {
16623           return config.warnings;
16624         },
16625         cancellation: function() {
16626           return config.cancellation;
16627         },
16628         monitoring: function() {
16629           return config.monitoring;
16630         },
16631         propagateFromFunction: function() {
16632           return propagateFromFunction;
16633         },
16634         boundValueFunction: function() {
16635           return boundValueFunction;
16636         },
16637         checkForgottenReturns,
16638         setBounds,
16639         warn,
16640         deprecated,
16641         CapturedTrace,
16642         fireDomEvent,
16643         fireGlobalEvent
16644       };
16645     };
16646   }
16647 });
16648
16649 // node_modules/bluebird/js/release/finally.js
16650 var require_finally = __commonJS({
16651   "node_modules/bluebird/js/release/finally.js"(exports2, module2) {
16652     "use strict";
16653     module2.exports = function(Promise2, tryConvertToPromise) {
16654       var util = require_util();
16655       var CancellationError = Promise2.CancellationError;
16656       var errorObj2 = util.errorObj;
16657       function PassThroughHandlerContext(promise, type, handler) {
16658         this.promise = promise;
16659         this.type = type;
16660         this.handler = handler;
16661         this.called = false;
16662         this.cancelPromise = null;
16663       }
16664       PassThroughHandlerContext.prototype.isFinallyHandler = function() {
16665         return this.type === 0;
16666       };
16667       function FinallyHandlerCancelReaction(finallyHandler2) {
16668         this.finallyHandler = finallyHandler2;
16669       }
16670       FinallyHandlerCancelReaction.prototype._resultCancelled = function() {
16671         checkCancel(this.finallyHandler);
16672       };
16673       function checkCancel(ctx, reason) {
16674         if (ctx.cancelPromise != null) {
16675           if (arguments.length > 1) {
16676             ctx.cancelPromise._reject(reason);
16677           } else {
16678             ctx.cancelPromise._cancel();
16679           }
16680           ctx.cancelPromise = null;
16681           return true;
16682         }
16683         return false;
16684       }
16685       function succeed() {
16686         return finallyHandler.call(this, this.promise._target()._settledValue());
16687       }
16688       function fail(reason) {
16689         if (checkCancel(this, reason))
16690           return;
16691         errorObj2.e = reason;
16692         return errorObj2;
16693       }
16694       function finallyHandler(reasonOrValue) {
16695         var promise = this.promise;
16696         var handler = this.handler;
16697         if (!this.called) {
16698           this.called = true;
16699           var ret2 = this.isFinallyHandler() ? handler.call(promise._boundValue()) : handler.call(promise._boundValue(), reasonOrValue);
16700           if (ret2 !== void 0) {
16701             promise._setReturnedNonUndefined();
16702             var maybePromise = tryConvertToPromise(ret2, promise);
16703             if (maybePromise instanceof Promise2) {
16704               if (this.cancelPromise != null) {
16705                 if (maybePromise._isCancelled()) {
16706                   var reason = new CancellationError("late cancellation observer");
16707                   promise._attachExtraTrace(reason);
16708                   errorObj2.e = reason;
16709                   return errorObj2;
16710                 } else if (maybePromise.isPending()) {
16711                   maybePromise._attachCancellationCallback(new FinallyHandlerCancelReaction(this));
16712                 }
16713               }
16714               return maybePromise._then(succeed, fail, void 0, this, void 0);
16715             }
16716           }
16717         }
16718         if (promise.isRejected()) {
16719           checkCancel(this);
16720           errorObj2.e = reasonOrValue;
16721           return errorObj2;
16722         } else {
16723           checkCancel(this);
16724           return reasonOrValue;
16725         }
16726       }
16727       Promise2.prototype._passThrough = function(handler, type, success, fail2) {
16728         if (typeof handler !== "function")
16729           return this.then();
16730         return this._then(success, fail2, void 0, new PassThroughHandlerContext(this, type, handler), void 0);
16731       };
16732       Promise2.prototype.lastly = Promise2.prototype["finally"] = function(handler) {
16733         return this._passThrough(handler, 0, finallyHandler, finallyHandler);
16734       };
16735       Promise2.prototype.tap = function(handler) {
16736         return this._passThrough(handler, 1, finallyHandler);
16737       };
16738       return PassThroughHandlerContext;
16739     };
16740   }
16741 });
16742
16743 // node_modules/bluebird/js/release/catch_filter.js
16744 var require_catch_filter = __commonJS({
16745   "node_modules/bluebird/js/release/catch_filter.js"(exports2, module2) {
16746     "use strict";
16747     module2.exports = function(NEXT_FILTER) {
16748       var util = require_util();
16749       var getKeys = require_es5().keys;
16750       var tryCatch2 = util.tryCatch;
16751       var errorObj2 = util.errorObj;
16752       function catchFilter(instances, cb, promise) {
16753         return function(e) {
16754           var boundTo = promise._boundValue();
16755           predicateLoop:
16756             for (var i = 0; i < instances.length; ++i) {
16757               var item = instances[i];
16758               if (item === Error || item != null && item.prototype instanceof Error) {
16759                 if (e instanceof item) {
16760                   return tryCatch2(cb).call(boundTo, e);
16761                 }
16762               } else if (typeof item === "function") {
16763                 var matchesPredicate = tryCatch2(item).call(boundTo, e);
16764                 if (matchesPredicate === errorObj2) {
16765                   return matchesPredicate;
16766                 } else if (matchesPredicate) {
16767                   return tryCatch2(cb).call(boundTo, e);
16768                 }
16769               } else if (util.isObject(e)) {
16770                 var keys = getKeys(item);
16771                 for (var j = 0; j < keys.length; ++j) {
16772                   var key = keys[j];
16773                   if (item[key] != e[key]) {
16774                     continue predicateLoop;
16775                   }
16776                 }
16777                 return tryCatch2(cb).call(boundTo, e);
16778               }
16779             }
16780           return NEXT_FILTER;
16781         };
16782       }
16783       return catchFilter;
16784     };
16785   }
16786 });
16787
16788 // node_modules/bluebird/js/release/nodeback.js
16789 var require_nodeback = __commonJS({
16790   "node_modules/bluebird/js/release/nodeback.js"(exports2, module2) {
16791     "use strict";
16792     var util = require_util();
16793     var maybeWrapAsError2 = util.maybeWrapAsError;
16794     var errors = require_errors();
16795     var OperationalError = errors.OperationalError;
16796     var es52 = require_es5();
16797     function isUntypedError(obj2) {
16798       return obj2 instanceof Error && es52.getPrototypeOf(obj2) === Error.prototype;
16799     }
16800     var rErrorKey = /^(?:name|message|stack|cause)$/;
16801     function wrapAsOperationalError(obj2) {
16802       var ret2;
16803       if (isUntypedError(obj2)) {
16804         ret2 = new OperationalError(obj2);
16805         ret2.name = obj2.name;
16806         ret2.message = obj2.message;
16807         ret2.stack = obj2.stack;
16808         var keys = es52.keys(obj2);
16809         for (var i = 0; i < keys.length; ++i) {
16810           var key = keys[i];
16811           if (!rErrorKey.test(key)) {
16812             ret2[key] = obj2[key];
16813           }
16814         }
16815         return ret2;
16816       }
16817       util.markAsOriginatingFromRejection(obj2);
16818       return obj2;
16819     }
16820     function nodebackForPromise(promise, multiArgs) {
16821       return function(err, value) {
16822         if (promise === null)
16823           return;
16824         if (err) {
16825           var wrapped = wrapAsOperationalError(maybeWrapAsError2(err));
16826           promise._attachExtraTrace(wrapped);
16827           promise._reject(wrapped);
16828         } else if (!multiArgs) {
16829           promise._fulfill(value);
16830         } else {
16831           var $_len = arguments.length;
16832           var args = new Array(Math.max($_len - 1, 0));
16833           for (var $_i = 1; $_i < $_len; ++$_i) {
16834             args[$_i - 1] = arguments[$_i];
16835           }
16836           ;
16837           promise._fulfill(args);
16838         }
16839         promise = null;
16840       };
16841     }
16842     module2.exports = nodebackForPromise;
16843   }
16844 });
16845
16846 // node_modules/bluebird/js/release/method.js
16847 var require_method = __commonJS({
16848   "node_modules/bluebird/js/release/method.js"(exports2, module2) {
16849     "use strict";
16850     module2.exports = function(Promise2, INTERNAL2, tryConvertToPromise, apiRejection, debug) {
16851       var util = require_util();
16852       var tryCatch2 = util.tryCatch;
16853       Promise2.method = function(fn) {
16854         if (typeof fn !== "function") {
16855           throw new Promise2.TypeError("expecting a function but got " + util.classString(fn));
16856         }
16857         return function() {
16858           var ret2 = new Promise2(INTERNAL2);
16859           ret2._captureStackTrace();
16860           ret2._pushContext();
16861           var value = tryCatch2(fn).apply(this, arguments);
16862           var promiseCreated = ret2._popContext();
16863           debug.checkForgottenReturns(value, promiseCreated, "Promise.method", ret2);
16864           ret2._resolveFromSyncValue(value);
16865           return ret2;
16866         };
16867       };
16868       Promise2.attempt = Promise2["try"] = function(fn) {
16869         if (typeof fn !== "function") {
16870           return apiRejection("expecting a function but got " + util.classString(fn));
16871         }
16872         var ret2 = new Promise2(INTERNAL2);
16873         ret2._captureStackTrace();
16874         ret2._pushContext();
16875         var value;
16876         if (arguments.length > 1) {
16877           debug.deprecated("calling Promise.try with more than 1 argument");
16878           var arg = arguments[1];
16879           var ctx = arguments[2];
16880           value = util.isArray(arg) ? tryCatch2(fn).apply(ctx, arg) : tryCatch2(fn).call(ctx, arg);
16881         } else {
16882           value = tryCatch2(fn)();
16883         }
16884         var promiseCreated = ret2._popContext();
16885         debug.checkForgottenReturns(value, promiseCreated, "Promise.try", ret2);
16886         ret2._resolveFromSyncValue(value);
16887         return ret2;
16888       };
16889       Promise2.prototype._resolveFromSyncValue = function(value) {
16890         if (value === util.errorObj) {
16891           this._rejectCallback(value.e, false);
16892         } else {
16893           this._resolveCallback(value, true);
16894         }
16895       };
16896     };
16897   }
16898 });
16899
16900 // node_modules/bluebird/js/release/bind.js
16901 var require_bind = __commonJS({
16902   "node_modules/bluebird/js/release/bind.js"(exports2, module2) {
16903     "use strict";
16904     module2.exports = function(Promise2, INTERNAL2, tryConvertToPromise, debug) {
16905       var calledBind = false;
16906       var rejectThis = function(_, e) {
16907         this._reject(e);
16908       };
16909       var targetRejected = function(e, context) {
16910         context.promiseRejectionQueued = true;
16911         context.bindingPromise._then(rejectThis, rejectThis, null, this, e);
16912       };
16913       var bindingResolved = function(thisArg, context) {
16914         if ((this._bitField & 50397184) === 0) {
16915           this._resolveCallback(context.target);
16916         }
16917       };
16918       var bindingRejected = function(e, context) {
16919         if (!context.promiseRejectionQueued)
16920           this._reject(e);
16921       };
16922       Promise2.prototype.bind = function(thisArg) {
16923         if (!calledBind) {
16924           calledBind = true;
16925           Promise2.prototype._propagateFrom = debug.propagateFromFunction();
16926           Promise2.prototype._boundValue = debug.boundValueFunction();
16927         }
16928         var maybePromise = tryConvertToPromise(thisArg);
16929         var ret2 = new Promise2(INTERNAL2);
16930         ret2._propagateFrom(this, 1);
16931         var target = this._target();
16932         ret2._setBoundTo(maybePromise);
16933         if (maybePromise instanceof Promise2) {
16934           var context = {
16935             promiseRejectionQueued: false,
16936             promise: ret2,
16937             target,
16938             bindingPromise: maybePromise
16939           };
16940           target._then(INTERNAL2, targetRejected, void 0, ret2, context);
16941           maybePromise._then(bindingResolved, bindingRejected, void 0, ret2, context);
16942           ret2._setOnCancel(maybePromise);
16943         } else {
16944           ret2._resolveCallback(target);
16945         }
16946         return ret2;
16947       };
16948       Promise2.prototype._setBoundTo = function(obj2) {
16949         if (obj2 !== void 0) {
16950           this._bitField = this._bitField | 2097152;
16951           this._boundTo = obj2;
16952         } else {
16953           this._bitField = this._bitField & ~2097152;
16954         }
16955       };
16956       Promise2.prototype._isBound = function() {
16957         return (this._bitField & 2097152) === 2097152;
16958       };
16959       Promise2.bind = function(thisArg, value) {
16960         return Promise2.resolve(value).bind(thisArg);
16961       };
16962     };
16963   }
16964 });
16965
16966 // node_modules/bluebird/js/release/cancel.js
16967 var require_cancel = __commonJS({
16968   "node_modules/bluebird/js/release/cancel.js"(exports2, module2) {
16969     "use strict";
16970     module2.exports = function(Promise2, PromiseArray, apiRejection, debug) {
16971       var util = require_util();
16972       var tryCatch2 = util.tryCatch;
16973       var errorObj2 = util.errorObj;
16974       var async = Promise2._async;
16975       Promise2.prototype["break"] = Promise2.prototype.cancel = function() {
16976         if (!debug.cancellation())
16977           return this._warn("cancellation is disabled");
16978         var promise = this;
16979         var child = promise;
16980         while (promise._isCancellable()) {
16981           if (!promise._cancelBy(child)) {
16982             if (child._isFollowing()) {
16983               child._followee().cancel();
16984             } else {
16985               child._cancelBranched();
16986             }
16987             break;
16988           }
16989           var parent = promise._cancellationParent;
16990           if (parent == null || !parent._isCancellable()) {
16991             if (promise._isFollowing()) {
16992               promise._followee().cancel();
16993             } else {
16994               promise._cancelBranched();
16995             }
16996             break;
16997           } else {
16998             if (promise._isFollowing())
16999               promise._followee().cancel();
17000             promise._setWillBeCancelled();
17001             child = promise;
17002             promise = parent;
17003           }
17004         }
17005       };
17006       Promise2.prototype._branchHasCancelled = function() {
17007         this._branchesRemainingToCancel--;
17008       };
17009       Promise2.prototype._enoughBranchesHaveCancelled = function() {
17010         return this._branchesRemainingToCancel === void 0 || this._branchesRemainingToCancel <= 0;
17011       };
17012       Promise2.prototype._cancelBy = function(canceller) {
17013         if (canceller === this) {
17014           this._branchesRemainingToCancel = 0;
17015           this._invokeOnCancel();
17016           return true;
17017         } else {
17018           this._branchHasCancelled();
17019           if (this._enoughBranchesHaveCancelled()) {
17020             this._invokeOnCancel();
17021             return true;
17022           }
17023         }
17024         return false;
17025       };
17026       Promise2.prototype._cancelBranched = function() {
17027         if (this._enoughBranchesHaveCancelled()) {
17028           this._cancel();
17029         }
17030       };
17031       Promise2.prototype._cancel = function() {
17032         if (!this._isCancellable())
17033           return;
17034         this._setCancelled();
17035         async.invoke(this._cancelPromises, this, void 0);
17036       };
17037       Promise2.prototype._cancelPromises = function() {
17038         if (this._length() > 0)
17039           this._settlePromises();
17040       };
17041       Promise2.prototype._unsetOnCancel = function() {
17042         this._onCancelField = void 0;
17043       };
17044       Promise2.prototype._isCancellable = function() {
17045         return this.isPending() && !this._isCancelled();
17046       };
17047       Promise2.prototype.isCancellable = function() {
17048         return this.isPending() && !this.isCancelled();
17049       };
17050       Promise2.prototype._doInvokeOnCancel = function(onCancelCallback, internalOnly) {
17051         if (util.isArray(onCancelCallback)) {
17052           for (var i = 0; i < onCancelCallback.length; ++i) {
17053             this._doInvokeOnCancel(onCancelCallback[i], internalOnly);
17054           }
17055         } else if (onCancelCallback !== void 0) {
17056           if (typeof onCancelCallback === "function") {
17057             if (!internalOnly) {
17058               var e = tryCatch2(onCancelCallback).call(this._boundValue());
17059               if (e === errorObj2) {
17060                 this._attachExtraTrace(e.e);
17061                 async.throwLater(e.e);
17062               }
17063             }
17064           } else {
17065             onCancelCallback._resultCancelled(this);
17066           }
17067         }
17068       };
17069       Promise2.prototype._invokeOnCancel = function() {
17070         var onCancelCallback = this._onCancel();
17071         this._unsetOnCancel();
17072         async.invoke(this._doInvokeOnCancel, this, onCancelCallback);
17073       };
17074       Promise2.prototype._invokeInternalOnCancel = function() {
17075         if (this._isCancellable()) {
17076           this._doInvokeOnCancel(this._onCancel(), true);
17077           this._unsetOnCancel();
17078         }
17079       };
17080       Promise2.prototype._resultCancelled = function() {
17081         this.cancel();
17082       };
17083     };
17084   }
17085 });
17086
17087 // node_modules/bluebird/js/release/direct_resolve.js
17088 var require_direct_resolve = __commonJS({
17089   "node_modules/bluebird/js/release/direct_resolve.js"(exports2, module2) {
17090     "use strict";
17091     module2.exports = function(Promise2) {
17092       function returner() {
17093         return this.value;
17094       }
17095       function thrower2() {
17096         throw this.reason;
17097       }
17098       Promise2.prototype["return"] = Promise2.prototype.thenReturn = function(value) {
17099         if (value instanceof Promise2)
17100           value.suppressUnhandledRejections();
17101         return this._then(returner, void 0, void 0, { value }, void 0);
17102       };
17103       Promise2.prototype["throw"] = Promise2.prototype.thenThrow = function(reason) {
17104         return this._then(thrower2, void 0, void 0, { reason }, void 0);
17105       };
17106       Promise2.prototype.catchThrow = function(reason) {
17107         if (arguments.length <= 1) {
17108           return this._then(void 0, thrower2, void 0, { reason }, void 0);
17109         } else {
17110           var _reason = arguments[1];
17111           var handler = function() {
17112             throw _reason;
17113           };
17114           return this.caught(reason, handler);
17115         }
17116       };
17117       Promise2.prototype.catchReturn = function(value) {
17118         if (arguments.length <= 1) {
17119           if (value instanceof Promise2)
17120             value.suppressUnhandledRejections();
17121           return this._then(void 0, returner, void 0, { value }, void 0);
17122         } else {
17123           var _value = arguments[1];
17124           if (_value instanceof Promise2)
17125             _value.suppressUnhandledRejections();
17126           var handler = function() {
17127             return _value;
17128           };
17129           return this.caught(value, handler);
17130         }
17131       };
17132     };
17133   }
17134 });
17135
17136 // node_modules/bluebird/js/release/synchronous_inspection.js
17137 var require_synchronous_inspection = __commonJS({
17138   "node_modules/bluebird/js/release/synchronous_inspection.js"(exports2, module2) {
17139     "use strict";
17140     module2.exports = function(Promise2) {
17141       function PromiseInspection(promise) {
17142         if (promise !== void 0) {
17143           promise = promise._target();
17144           this._bitField = promise._bitField;
17145           this._settledValueField = promise._isFateSealed() ? promise._settledValue() : void 0;
17146         } else {
17147           this._bitField = 0;
17148           this._settledValueField = void 0;
17149         }
17150       }
17151       PromiseInspection.prototype._settledValue = function() {
17152         return this._settledValueField;
17153       };
17154       var value = PromiseInspection.prototype.value = function() {
17155         if (!this.isFulfilled()) {
17156           throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n    See http://goo.gl/MqrFmX\n");
17157         }
17158         return this._settledValue();
17159       };
17160       var reason = PromiseInspection.prototype.error = PromiseInspection.prototype.reason = function() {
17161         if (!this.isRejected()) {
17162           throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n    See http://goo.gl/MqrFmX\n");
17163         }
17164         return this._settledValue();
17165       };
17166       var isFulfilled = PromiseInspection.prototype.isFulfilled = function() {
17167         return (this._bitField & 33554432) !== 0;
17168       };
17169       var isRejected = PromiseInspection.prototype.isRejected = function() {
17170         return (this._bitField & 16777216) !== 0;
17171       };
17172       var isPending = PromiseInspection.prototype.isPending = function() {
17173         return (this._bitField & 50397184) === 0;
17174       };
17175       var isResolved = PromiseInspection.prototype.isResolved = function() {
17176         return (this._bitField & 50331648) !== 0;
17177       };
17178       PromiseInspection.prototype.isCancelled = function() {
17179         return (this._bitField & 8454144) !== 0;
17180       };
17181       Promise2.prototype.__isCancelled = function() {
17182         return (this._bitField & 65536) === 65536;
17183       };
17184       Promise2.prototype._isCancelled = function() {
17185         return this._target().__isCancelled();
17186       };
17187       Promise2.prototype.isCancelled = function() {
17188         return (this._target()._bitField & 8454144) !== 0;
17189       };
17190       Promise2.prototype.isPending = function() {
17191         return isPending.call(this._target());
17192       };
17193       Promise2.prototype.isRejected = function() {
17194         return isRejected.call(this._target());
17195       };
17196       Promise2.prototype.isFulfilled = function() {
17197         return isFulfilled.call(this._target());
17198       };
17199       Promise2.prototype.isResolved = function() {
17200         return isResolved.call(this._target());
17201       };
17202       Promise2.prototype.value = function() {
17203         return value.call(this._target());
17204       };
17205       Promise2.prototype.reason = function() {
17206         var target = this._target();
17207         target._unsetRejectionIsUnhandled();
17208         return reason.call(target);
17209       };
17210       Promise2.prototype._value = function() {
17211         return this._settledValue();
17212       };
17213       Promise2.prototype._reason = function() {
17214         this._unsetRejectionIsUnhandled();
17215         return this._settledValue();
17216       };
17217       Promise2.PromiseInspection = PromiseInspection;
17218     };
17219   }
17220 });
17221
17222 // node_modules/bluebird/js/release/join.js
17223 var require_join = __commonJS({
17224   "node_modules/bluebird/js/release/join.js"(exports2, module2) {
17225     "use strict";
17226     module2.exports = function(Promise2, PromiseArray, tryConvertToPromise, INTERNAL2, async, getDomain) {
17227       var util = require_util();
17228       var canEvaluate2 = util.canEvaluate;
17229       var tryCatch2 = util.tryCatch;
17230       var errorObj2 = util.errorObj;
17231       var reject;
17232       if (true) {
17233         if (canEvaluate2) {
17234           var thenCallback = function(i2) {
17235             return new Function("value", "holder", "                             \n            'use strict';                                                    \n            holder.pIndex = value;                                           \n            holder.checkFulfillment(this);                                   \n            ".replace(/Index/g, i2));
17236           };
17237           var promiseSetter = function(i2) {
17238             return new Function("promise", "holder", "                           \n            'use strict';                                                    \n            holder.pIndex = promise;                                         \n            ".replace(/Index/g, i2));
17239           };
17240           var generateHolderClass = function(total) {
17241             var props = new Array(total);
17242             for (var i2 = 0; i2 < props.length; ++i2) {
17243               props[i2] = "this.p" + (i2 + 1);
17244             }
17245             var assignment = props.join(" = ") + " = null;";
17246             var cancellationCode = "var promise;\n" + props.map(function(prop) {
17247               return "                                                         \n                promise = " + prop + ";                                      \n                if (promise instanceof Promise) {                            \n                    promise.cancel();                                        \n                }                                                            \n            ";
17248             }).join("\n");
17249             var passedArguments = props.join(", ");
17250             var name = "Holder$" + total;
17251             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        ";
17252             code = code.replace(/\[TheName\]/g, name).replace(/\[TheTotal\]/g, total).replace(/\[ThePassedArguments\]/g, passedArguments).replace(/\[TheProperties\]/g, assignment).replace(/\[CancellationCode\]/g, cancellationCode);
17253             return new Function("tryCatch", "errorObj", "Promise", "async", code)(tryCatch2, errorObj2, Promise2, async);
17254           };
17255           var holderClasses = [];
17256           var thenCallbacks = [];
17257           var promiseSetters = [];
17258           for (var i = 0; i < 8; ++i) {
17259             holderClasses.push(generateHolderClass(i + 1));
17260             thenCallbacks.push(thenCallback(i + 1));
17261             promiseSetters.push(promiseSetter(i + 1));
17262           }
17263           reject = function(reason) {
17264             this._reject(reason);
17265           };
17266         }
17267       }
17268       Promise2.join = function() {
17269         var last = arguments.length - 1;
17270         var fn;
17271         if (last > 0 && typeof arguments[last] === "function") {
17272           fn = arguments[last];
17273           if (true) {
17274             if (last <= 8 && canEvaluate2) {
17275               var ret2 = new Promise2(INTERNAL2);
17276               ret2._captureStackTrace();
17277               var HolderClass = holderClasses[last - 1];
17278               var holder = new HolderClass(fn);
17279               var callbacks = thenCallbacks;
17280               for (var i2 = 0; i2 < last; ++i2) {
17281                 var maybePromise = tryConvertToPromise(arguments[i2], ret2);
17282                 if (maybePromise instanceof Promise2) {
17283                   maybePromise = maybePromise._target();
17284                   var bitField = maybePromise._bitField;
17285                   ;
17286                   if ((bitField & 50397184) === 0) {
17287                     maybePromise._then(callbacks[i2], reject, void 0, ret2, holder);
17288                     promiseSetters[i2](maybePromise, holder);
17289                     holder.asyncNeeded = false;
17290                   } else if ((bitField & 33554432) !== 0) {
17291                     callbacks[i2].call(ret2, maybePromise._value(), holder);
17292                   } else if ((bitField & 16777216) !== 0) {
17293                     ret2._reject(maybePromise._reason());
17294                   } else {
17295                     ret2._cancel();
17296                   }
17297                 } else {
17298                   callbacks[i2].call(ret2, maybePromise, holder);
17299                 }
17300               }
17301               if (!ret2._isFateSealed()) {
17302                 if (holder.asyncNeeded) {
17303                   var domain = getDomain();
17304                   if (domain !== null) {
17305                     holder.fn = util.domainBind(domain, holder.fn);
17306                   }
17307                 }
17308                 ret2._setAsyncGuaranteed();
17309                 ret2._setOnCancel(holder);
17310               }
17311               return ret2;
17312             }
17313           }
17314         }
17315         var $_len = arguments.length;
17316         var args = new Array($_len);
17317         for (var $_i = 0; $_i < $_len; ++$_i) {
17318           args[$_i] = arguments[$_i];
17319         }
17320         ;
17321         if (fn)
17322           args.pop();
17323         var ret2 = new PromiseArray(args).promise();
17324         return fn !== void 0 ? ret2.spread(fn) : ret2;
17325       };
17326     };
17327   }
17328 });
17329
17330 // node_modules/bluebird/js/release/map.js
17331 var require_map = __commonJS({
17332   "node_modules/bluebird/js/release/map.js"(exports2, module2) {
17333     "use strict";
17334     module2.exports = function(Promise2, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL2, debug) {
17335       var getDomain = Promise2._getDomain;
17336       var util = require_util();
17337       var tryCatch2 = util.tryCatch;
17338       var errorObj2 = util.errorObj;
17339       var async = Promise2._async;
17340       function MappingPromiseArray(promises, fn, limit, _filter) {
17341         this.constructor$(promises);
17342         this._promise._captureStackTrace();
17343         var domain = getDomain();
17344         this._callback = domain === null ? fn : util.domainBind(domain, fn);
17345         this._preservedValues = _filter === INTERNAL2 ? new Array(this.length()) : null;
17346         this._limit = limit;
17347         this._inFlight = 0;
17348         this._queue = [];
17349         async.invoke(this._asyncInit, this, void 0);
17350       }
17351       util.inherits(MappingPromiseArray, PromiseArray);
17352       MappingPromiseArray.prototype._asyncInit = function() {
17353         this._init$(void 0, -2);
17354       };
17355       MappingPromiseArray.prototype._init = function() {
17356       };
17357       MappingPromiseArray.prototype._promiseFulfilled = function(value, index) {
17358         var values = this._values;
17359         var length = this.length();
17360         var preservedValues = this._preservedValues;
17361         var limit = this._limit;
17362         if (index < 0) {
17363           index = index * -1 - 1;
17364           values[index] = value;
17365           if (limit >= 1) {
17366             this._inFlight--;
17367             this._drainQueue();
17368             if (this._isResolved())
17369               return true;
17370           }
17371         } else {
17372           if (limit >= 1 && this._inFlight >= limit) {
17373             values[index] = value;
17374             this._queue.push(index);
17375             return false;
17376           }
17377           if (preservedValues !== null)
17378             preservedValues[index] = value;
17379           var promise = this._promise;
17380           var callback = this._callback;
17381           var receiver = promise._boundValue();
17382           promise._pushContext();
17383           var ret2 = tryCatch2(callback).call(receiver, value, index, length);
17384           var promiseCreated = promise._popContext();
17385           debug.checkForgottenReturns(ret2, promiseCreated, preservedValues !== null ? "Promise.filter" : "Promise.map", promise);
17386           if (ret2 === errorObj2) {
17387             this._reject(ret2.e);
17388             return true;
17389           }
17390           var maybePromise = tryConvertToPromise(ret2, this._promise);
17391           if (maybePromise instanceof Promise2) {
17392             maybePromise = maybePromise._target();
17393             var bitField = maybePromise._bitField;
17394             ;
17395             if ((bitField & 50397184) === 0) {
17396               if (limit >= 1)
17397                 this._inFlight++;
17398               values[index] = maybePromise;
17399               maybePromise._proxy(this, (index + 1) * -1);
17400               return false;
17401             } else if ((bitField & 33554432) !== 0) {
17402               ret2 = maybePromise._value();
17403             } else if ((bitField & 16777216) !== 0) {
17404               this._reject(maybePromise._reason());
17405               return true;
17406             } else {
17407               this._cancel();
17408               return true;
17409             }
17410           }
17411           values[index] = ret2;
17412         }
17413         var totalResolved = ++this._totalResolved;
17414         if (totalResolved >= length) {
17415           if (preservedValues !== null) {
17416             this._filter(values, preservedValues);
17417           } else {
17418             this._resolve(values);
17419           }
17420           return true;
17421         }
17422         return false;
17423       };
17424       MappingPromiseArray.prototype._drainQueue = function() {
17425         var queue = this._queue;
17426         var limit = this._limit;
17427         var values = this._values;
17428         while (queue.length > 0 && this._inFlight < limit) {
17429           if (this._isResolved())
17430             return;
17431           var index = queue.pop();
17432           this._promiseFulfilled(values[index], index);
17433         }
17434       };
17435       MappingPromiseArray.prototype._filter = function(booleans, values) {
17436         var len = values.length;
17437         var ret2 = new Array(len);
17438         var j = 0;
17439         for (var i = 0; i < len; ++i) {
17440           if (booleans[i])
17441             ret2[j++] = values[i];
17442         }
17443         ret2.length = j;
17444         this._resolve(ret2);
17445       };
17446       MappingPromiseArray.prototype.preservedValues = function() {
17447         return this._preservedValues;
17448       };
17449       function map(promises, fn, options, _filter) {
17450         if (typeof fn !== "function") {
17451           return apiRejection("expecting a function but got " + util.classString(fn));
17452         }
17453         var limit = 0;
17454         if (options !== void 0) {
17455           if (typeof options === "object" && options !== null) {
17456             if (typeof options.concurrency !== "number") {
17457               return Promise2.reject(new TypeError("'concurrency' must be a number but it is " + util.classString(options.concurrency)));
17458             }
17459             limit = options.concurrency;
17460           } else {
17461             return Promise2.reject(new TypeError("options argument must be an object but it is " + util.classString(options)));
17462           }
17463         }
17464         limit = typeof limit === "number" && isFinite(limit) && limit >= 1 ? limit : 0;
17465         return new MappingPromiseArray(promises, fn, limit, _filter).promise();
17466       }
17467       Promise2.prototype.map = function(fn, options) {
17468         return map(this, fn, options, null);
17469       };
17470       Promise2.map = function(promises, fn, options, _filter) {
17471         return map(promises, fn, options, _filter);
17472       };
17473     };
17474   }
17475 });
17476
17477 // node_modules/bluebird/js/release/call_get.js
17478 var require_call_get = __commonJS({
17479   "node_modules/bluebird/js/release/call_get.js"(exports2, module2) {
17480     "use strict";
17481     var cr = Object.create;
17482     if (cr) {
17483       callerCache = cr(null);
17484       getterCache = cr(null);
17485       callerCache[" size"] = getterCache[" size"] = 0;
17486     }
17487     var callerCache;
17488     var getterCache;
17489     module2.exports = function(Promise2) {
17490       var util = require_util();
17491       var canEvaluate2 = util.canEvaluate;
17492       var isIdentifier2 = util.isIdentifier;
17493       var getMethodCaller;
17494       var getGetter;
17495       if (true) {
17496         var makeMethodCaller = function(methodName) {
17497           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);
17498         };
17499         var makeGetter = function(propertyName) {
17500           return new Function("obj", "                                             \n        'use strict';                                                        \n        return obj.propertyName;                                             \n        ".replace("propertyName", propertyName));
17501         };
17502         var getCompiled = function(name, compiler, cache) {
17503           var ret2 = cache[name];
17504           if (typeof ret2 !== "function") {
17505             if (!isIdentifier2(name)) {
17506               return null;
17507             }
17508             ret2 = compiler(name);
17509             cache[name] = ret2;
17510             cache[" size"]++;
17511             if (cache[" size"] > 512) {
17512               var keys = Object.keys(cache);
17513               for (var i = 0; i < 256; ++i)
17514                 delete cache[keys[i]];
17515               cache[" size"] = keys.length - 256;
17516             }
17517           }
17518           return ret2;
17519         };
17520         getMethodCaller = function(name) {
17521           return getCompiled(name, makeMethodCaller, callerCache);
17522         };
17523         getGetter = function(name) {
17524           return getCompiled(name, makeGetter, getterCache);
17525         };
17526       }
17527       function ensureMethod(obj2, methodName) {
17528         var fn;
17529         if (obj2 != null)
17530           fn = obj2[methodName];
17531         if (typeof fn !== "function") {
17532           var message = "Object " + util.classString(obj2) + " has no method '" + util.toString(methodName) + "'";
17533           throw new Promise2.TypeError(message);
17534         }
17535         return fn;
17536       }
17537       function caller(obj2) {
17538         var methodName = this.pop();
17539         var fn = ensureMethod(obj2, methodName);
17540         return fn.apply(obj2, this);
17541       }
17542       Promise2.prototype.call = function(methodName) {
17543         var $_len = arguments.length;
17544         var args = new Array(Math.max($_len - 1, 0));
17545         for (var $_i = 1; $_i < $_len; ++$_i) {
17546           args[$_i - 1] = arguments[$_i];
17547         }
17548         ;
17549         if (true) {
17550           if (canEvaluate2) {
17551             var maybeCaller = getMethodCaller(methodName);
17552             if (maybeCaller !== null) {
17553               return this._then(maybeCaller, void 0, void 0, args, void 0);
17554             }
17555           }
17556         }
17557         args.push(methodName);
17558         return this._then(caller, void 0, void 0, args, void 0);
17559       };
17560       function namedGetter(obj2) {
17561         return obj2[this];
17562       }
17563       function indexedGetter(obj2) {
17564         var index = +this;
17565         if (index < 0)
17566           index = Math.max(0, index + obj2.length);
17567         return obj2[index];
17568       }
17569       Promise2.prototype.get = function(propertyName) {
17570         var isIndex = typeof propertyName === "number";
17571         var getter;
17572         if (!isIndex) {
17573           if (canEvaluate2) {
17574             var maybeGetter = getGetter(propertyName);
17575             getter = maybeGetter !== null ? maybeGetter : namedGetter;
17576           } else {
17577             getter = namedGetter;
17578           }
17579         } else {
17580           getter = indexedGetter;
17581         }
17582         return this._then(getter, void 0, void 0, propertyName, void 0);
17583       };
17584     };
17585   }
17586 });
17587
17588 // node_modules/bluebird/js/release/using.js
17589 var require_using = __commonJS({
17590   "node_modules/bluebird/js/release/using.js"(exports2, module2) {
17591     "use strict";
17592     module2.exports = function(Promise2, apiRejection, tryConvertToPromise, createContext, INTERNAL2, debug) {
17593       var util = require_util();
17594       var TypeError2 = require_errors().TypeError;
17595       var inherits2 = require_util().inherits;
17596       var errorObj2 = util.errorObj;
17597       var tryCatch2 = util.tryCatch;
17598       var NULL = {};
17599       function thrower2(e) {
17600         setTimeout(function() {
17601           throw e;
17602         }, 0);
17603       }
17604       function castPreservingDisposable(thenable) {
17605         var maybePromise = tryConvertToPromise(thenable);
17606         if (maybePromise !== thenable && typeof thenable._isDisposable === "function" && typeof thenable._getDisposer === "function" && thenable._isDisposable()) {
17607           maybePromise._setDisposable(thenable._getDisposer());
17608         }
17609         return maybePromise;
17610       }
17611       function dispose(resources, inspection) {
17612         var i = 0;
17613         var len = resources.length;
17614         var ret2 = new Promise2(INTERNAL2);
17615         function iterator() {
17616           if (i >= len)
17617             return ret2._fulfill();
17618           var maybePromise = castPreservingDisposable(resources[i++]);
17619           if (maybePromise instanceof Promise2 && maybePromise._isDisposable()) {
17620             try {
17621               maybePromise = tryConvertToPromise(maybePromise._getDisposer().tryDispose(inspection), resources.promise);
17622             } catch (e) {
17623               return thrower2(e);
17624             }
17625             if (maybePromise instanceof Promise2) {
17626               return maybePromise._then(iterator, thrower2, null, null, null);
17627             }
17628           }
17629           iterator();
17630         }
17631         iterator();
17632         return ret2;
17633       }
17634       function Disposer(data, promise, context) {
17635         this._data = data;
17636         this._promise = promise;
17637         this._context = context;
17638       }
17639       Disposer.prototype.data = function() {
17640         return this._data;
17641       };
17642       Disposer.prototype.promise = function() {
17643         return this._promise;
17644       };
17645       Disposer.prototype.resource = function() {
17646         if (this.promise().isFulfilled()) {
17647           return this.promise().value();
17648         }
17649         return NULL;
17650       };
17651       Disposer.prototype.tryDispose = function(inspection) {
17652         var resource = this.resource();
17653         var context = this._context;
17654         if (context !== void 0)
17655           context._pushContext();
17656         var ret2 = resource !== NULL ? this.doDispose(resource, inspection) : null;
17657         if (context !== void 0)
17658           context._popContext();
17659         this._promise._unsetDisposable();
17660         this._data = null;
17661         return ret2;
17662       };
17663       Disposer.isDisposer = function(d) {
17664         return d != null && typeof d.resource === "function" && typeof d.tryDispose === "function";
17665       };
17666       function FunctionDisposer(fn, promise, context) {
17667         this.constructor$(fn, promise, context);
17668       }
17669       inherits2(FunctionDisposer, Disposer);
17670       FunctionDisposer.prototype.doDispose = function(resource, inspection) {
17671         var fn = this.data();
17672         return fn.call(resource, resource, inspection);
17673       };
17674       function maybeUnwrapDisposer(value) {
17675         if (Disposer.isDisposer(value)) {
17676           this.resources[this.index]._setDisposable(value);
17677           return value.promise();
17678         }
17679         return value;
17680       }
17681       function ResourceList(length) {
17682         this.length = length;
17683         this.promise = null;
17684         this[length - 1] = null;
17685       }
17686       ResourceList.prototype._resultCancelled = function() {
17687         var len = this.length;
17688         for (var i = 0; i < len; ++i) {
17689           var item = this[i];
17690           if (item instanceof Promise2) {
17691             item.cancel();
17692           }
17693         }
17694       };
17695       Promise2.using = function() {
17696         var len = arguments.length;
17697         if (len < 2)
17698           return apiRejection("you must pass at least 2 arguments to Promise.using");
17699         var fn = arguments[len - 1];
17700         if (typeof fn !== "function") {
17701           return apiRejection("expecting a function but got " + util.classString(fn));
17702         }
17703         var input;
17704         var spreadArgs = true;
17705         if (len === 2 && Array.isArray(arguments[0])) {
17706           input = arguments[0];
17707           len = input.length;
17708           spreadArgs = false;
17709         } else {
17710           input = arguments;
17711           len--;
17712         }
17713         var resources = new ResourceList(len);
17714         for (var i = 0; i < len; ++i) {
17715           var resource = input[i];
17716           if (Disposer.isDisposer(resource)) {
17717             var disposer = resource;
17718             resource = resource.promise();
17719             resource._setDisposable(disposer);
17720           } else {
17721             var maybePromise = tryConvertToPromise(resource);
17722             if (maybePromise instanceof Promise2) {
17723               resource = maybePromise._then(maybeUnwrapDisposer, null, null, {
17724                 resources,
17725                 index: i
17726               }, void 0);
17727             }
17728           }
17729           resources[i] = resource;
17730         }
17731         var reflectedResources = new Array(resources.length);
17732         for (var i = 0; i < reflectedResources.length; ++i) {
17733           reflectedResources[i] = Promise2.resolve(resources[i]).reflect();
17734         }
17735         var resultPromise = Promise2.all(reflectedResources).then(function(inspections) {
17736           for (var i2 = 0; i2 < inspections.length; ++i2) {
17737             var inspection = inspections[i2];
17738             if (inspection.isRejected()) {
17739               errorObj2.e = inspection.error();
17740               return errorObj2;
17741             } else if (!inspection.isFulfilled()) {
17742               resultPromise.cancel();
17743               return;
17744             }
17745             inspections[i2] = inspection.value();
17746           }
17747           promise._pushContext();
17748           fn = tryCatch2(fn);
17749           var ret2 = spreadArgs ? fn.apply(void 0, inspections) : fn(inspections);
17750           var promiseCreated = promise._popContext();
17751           debug.checkForgottenReturns(ret2, promiseCreated, "Promise.using", promise);
17752           return ret2;
17753         });
17754         var promise = resultPromise.lastly(function() {
17755           var inspection = new Promise2.PromiseInspection(resultPromise);
17756           return dispose(resources, inspection);
17757         });
17758         resources.promise = promise;
17759         promise._setOnCancel(resources);
17760         return promise;
17761       };
17762       Promise2.prototype._setDisposable = function(disposer) {
17763         this._bitField = this._bitField | 131072;
17764         this._disposer = disposer;
17765       };
17766       Promise2.prototype._isDisposable = function() {
17767         return (this._bitField & 131072) > 0;
17768       };
17769       Promise2.prototype._getDisposer = function() {
17770         return this._disposer;
17771       };
17772       Promise2.prototype._unsetDisposable = function() {
17773         this._bitField = this._bitField & ~131072;
17774         this._disposer = void 0;
17775       };
17776       Promise2.prototype.disposer = function(fn) {
17777         if (typeof fn === "function") {
17778           return new FunctionDisposer(fn, this, createContext());
17779         }
17780         throw new TypeError2();
17781       };
17782     };
17783   }
17784 });
17785
17786 // node_modules/bluebird/js/release/timers.js
17787 var require_timers = __commonJS({
17788   "node_modules/bluebird/js/release/timers.js"(exports2, module2) {
17789     "use strict";
17790     module2.exports = function(Promise2, INTERNAL2, debug) {
17791       var util = require_util();
17792       var TimeoutError = Promise2.TimeoutError;
17793       function HandleWrapper(handle) {
17794         this.handle = handle;
17795       }
17796       HandleWrapper.prototype._resultCancelled = function() {
17797         clearTimeout(this.handle);
17798       };
17799       var afterValue = function(value) {
17800         return delay(+this).thenReturn(value);
17801       };
17802       var delay = Promise2.delay = function(ms, value) {
17803         var ret2;
17804         var handle;
17805         if (value !== void 0) {
17806           ret2 = Promise2.resolve(value)._then(afterValue, null, null, ms, void 0);
17807           if (debug.cancellation() && value instanceof Promise2) {
17808             ret2._setOnCancel(value);
17809           }
17810         } else {
17811           ret2 = new Promise2(INTERNAL2);
17812           handle = setTimeout(function() {
17813             ret2._fulfill();
17814           }, +ms);
17815           if (debug.cancellation()) {
17816             ret2._setOnCancel(new HandleWrapper(handle));
17817           }
17818           ret2._captureStackTrace();
17819         }
17820         ret2._setAsyncGuaranteed();
17821         return ret2;
17822       };
17823       Promise2.prototype.delay = function(ms) {
17824         return delay(ms, this);
17825       };
17826       var afterTimeout = function(promise, message, parent) {
17827         var err;
17828         if (typeof message !== "string") {
17829           if (message instanceof Error) {
17830             err = message;
17831           } else {
17832             err = new TimeoutError("operation timed out");
17833           }
17834         } else {
17835           err = new TimeoutError(message);
17836         }
17837         util.markAsOriginatingFromRejection(err);
17838         promise._attachExtraTrace(err);
17839         promise._reject(err);
17840         if (parent != null) {
17841           parent.cancel();
17842         }
17843       };
17844       function successClear(value) {
17845         clearTimeout(this.handle);
17846         return value;
17847       }
17848       function failureClear(reason) {
17849         clearTimeout(this.handle);
17850         throw reason;
17851       }
17852       Promise2.prototype.timeout = function(ms, message) {
17853         ms = +ms;
17854         var ret2, parent;
17855         var handleWrapper = new HandleWrapper(setTimeout(function timeoutTimeout() {
17856           if (ret2.isPending()) {
17857             afterTimeout(ret2, message, parent);
17858           }
17859         }, ms));
17860         if (debug.cancellation()) {
17861           parent = this.then();
17862           ret2 = parent._then(successClear, failureClear, void 0, handleWrapper, void 0);
17863           ret2._setOnCancel(handleWrapper);
17864         } else {
17865           ret2 = this._then(successClear, failureClear, void 0, handleWrapper, void 0);
17866         }
17867         return ret2;
17868       };
17869     };
17870   }
17871 });
17872
17873 // node_modules/bluebird/js/release/generators.js
17874 var require_generators = __commonJS({
17875   "node_modules/bluebird/js/release/generators.js"(exports2, module2) {
17876     "use strict";
17877     module2.exports = function(Promise2, apiRejection, INTERNAL2, tryConvertToPromise, Proxyable, debug) {
17878       var errors = require_errors();
17879       var TypeError2 = errors.TypeError;
17880       var util = require_util();
17881       var errorObj2 = util.errorObj;
17882       var tryCatch2 = util.tryCatch;
17883       var yieldHandlers = [];
17884       function promiseFromYieldHandler(value, yieldHandlers2, traceParent) {
17885         for (var i = 0; i < yieldHandlers2.length; ++i) {
17886           traceParent._pushContext();
17887           var result = tryCatch2(yieldHandlers2[i])(value);
17888           traceParent._popContext();
17889           if (result === errorObj2) {
17890             traceParent._pushContext();
17891             var ret2 = Promise2.reject(errorObj2.e);
17892             traceParent._popContext();
17893             return ret2;
17894           }
17895           var maybePromise = tryConvertToPromise(result, traceParent);
17896           if (maybePromise instanceof Promise2)
17897             return maybePromise;
17898         }
17899         return null;
17900       }
17901       function PromiseSpawn(generatorFunction, receiver, yieldHandler, stack) {
17902         if (debug.cancellation()) {
17903           var internal = new Promise2(INTERNAL2);
17904           var _finallyPromise = this._finallyPromise = new Promise2(INTERNAL2);
17905           this._promise = internal.lastly(function() {
17906             return _finallyPromise;
17907           });
17908           internal._captureStackTrace();
17909           internal._setOnCancel(this);
17910         } else {
17911           var promise = this._promise = new Promise2(INTERNAL2);
17912           promise._captureStackTrace();
17913         }
17914         this._stack = stack;
17915         this._generatorFunction = generatorFunction;
17916         this._receiver = receiver;
17917         this._generator = void 0;
17918         this._yieldHandlers = typeof yieldHandler === "function" ? [yieldHandler].concat(yieldHandlers) : yieldHandlers;
17919         this._yieldedPromise = null;
17920         this._cancellationPhase = false;
17921       }
17922       util.inherits(PromiseSpawn, Proxyable);
17923       PromiseSpawn.prototype._isResolved = function() {
17924         return this._promise === null;
17925       };
17926       PromiseSpawn.prototype._cleanup = function() {
17927         this._promise = this._generator = null;
17928         if (debug.cancellation() && this._finallyPromise !== null) {
17929           this._finallyPromise._fulfill();
17930           this._finallyPromise = null;
17931         }
17932       };
17933       PromiseSpawn.prototype._promiseCancelled = function() {
17934         if (this._isResolved())
17935           return;
17936         var implementsReturn = typeof this._generator["return"] !== "undefined";
17937         var result;
17938         if (!implementsReturn) {
17939           var reason = new Promise2.CancellationError("generator .return() sentinel");
17940           Promise2.coroutine.returnSentinel = reason;
17941           this._promise._attachExtraTrace(reason);
17942           this._promise._pushContext();
17943           result = tryCatch2(this._generator["throw"]).call(this._generator, reason);
17944           this._promise._popContext();
17945         } else {
17946           this._promise._pushContext();
17947           result = tryCatch2(this._generator["return"]).call(this._generator, void 0);
17948           this._promise._popContext();
17949         }
17950         this._cancellationPhase = true;
17951         this._yieldedPromise = null;
17952         this._continue(result);
17953       };
17954       PromiseSpawn.prototype._promiseFulfilled = function(value) {
17955         this._yieldedPromise = null;
17956         this._promise._pushContext();
17957         var result = tryCatch2(this._generator.next).call(this._generator, value);
17958         this._promise._popContext();
17959         this._continue(result);
17960       };
17961       PromiseSpawn.prototype._promiseRejected = function(reason) {
17962         this._yieldedPromise = null;
17963         this._promise._attachExtraTrace(reason);
17964         this._promise._pushContext();
17965         var result = tryCatch2(this._generator["throw"]).call(this._generator, reason);
17966         this._promise._popContext();
17967         this._continue(result);
17968       };
17969       PromiseSpawn.prototype._resultCancelled = function() {
17970         if (this._yieldedPromise instanceof Promise2) {
17971           var promise = this._yieldedPromise;
17972           this._yieldedPromise = null;
17973           promise.cancel();
17974         }
17975       };
17976       PromiseSpawn.prototype.promise = function() {
17977         return this._promise;
17978       };
17979       PromiseSpawn.prototype._run = function() {
17980         this._generator = this._generatorFunction.call(this._receiver);
17981         this._receiver = this._generatorFunction = void 0;
17982         this._promiseFulfilled(void 0);
17983       };
17984       PromiseSpawn.prototype._continue = function(result) {
17985         var promise = this._promise;
17986         if (result === errorObj2) {
17987           this._cleanup();
17988           if (this._cancellationPhase) {
17989             return promise.cancel();
17990           } else {
17991             return promise._rejectCallback(result.e, false);
17992           }
17993         }
17994         var value = result.value;
17995         if (result.done === true) {
17996           this._cleanup();
17997           if (this._cancellationPhase) {
17998             return promise.cancel();
17999           } else {
18000             return promise._resolveCallback(value);
18001           }
18002         } else {
18003           var maybePromise = tryConvertToPromise(value, this._promise);
18004           if (!(maybePromise instanceof Promise2)) {
18005             maybePromise = promiseFromYieldHandler(maybePromise, this._yieldHandlers, this._promise);
18006             if (maybePromise === null) {
18007               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")));
18008               return;
18009             }
18010           }
18011           maybePromise = maybePromise._target();
18012           var bitField = maybePromise._bitField;
18013           ;
18014           if ((bitField & 50397184) === 0) {
18015             this._yieldedPromise = maybePromise;
18016             maybePromise._proxy(this, null);
18017           } else if ((bitField & 33554432) !== 0) {
18018             Promise2._async.invoke(this._promiseFulfilled, this, maybePromise._value());
18019           } else if ((bitField & 16777216) !== 0) {
18020             Promise2._async.invoke(this._promiseRejected, this, maybePromise._reason());
18021           } else {
18022             this._promiseCancelled();
18023           }
18024         }
18025       };
18026       Promise2.coroutine = function(generatorFunction, options) {
18027         if (typeof generatorFunction !== "function") {
18028           throw new TypeError2("generatorFunction must be a function\n\n    See http://goo.gl/MqrFmX\n");
18029         }
18030         var yieldHandler = Object(options).yieldHandler;
18031         var PromiseSpawn$ = PromiseSpawn;
18032         var stack = new Error().stack;
18033         return function() {
18034           var generator = generatorFunction.apply(this, arguments);
18035           var spawn = new PromiseSpawn$(void 0, void 0, yieldHandler, stack);
18036           var ret2 = spawn.promise();
18037           spawn._generator = generator;
18038           spawn._promiseFulfilled(void 0);
18039           return ret2;
18040         };
18041       };
18042       Promise2.coroutine.addYieldHandler = function(fn) {
18043         if (typeof fn !== "function") {
18044           throw new TypeError2("expecting a function but got " + util.classString(fn));
18045         }
18046         yieldHandlers.push(fn);
18047       };
18048       Promise2.spawn = function(generatorFunction) {
18049         debug.deprecated("Promise.spawn()", "Promise.coroutine()");
18050         if (typeof generatorFunction !== "function") {
18051           return apiRejection("generatorFunction must be a function\n\n    See http://goo.gl/MqrFmX\n");
18052         }
18053         var spawn = new PromiseSpawn(generatorFunction, this);
18054         var ret2 = spawn.promise();
18055         spawn._run(Promise2.spawn);
18056         return ret2;
18057       };
18058     };
18059   }
18060 });
18061
18062 // node_modules/bluebird/js/release/nodeify.js
18063 var require_nodeify = __commonJS({
18064   "node_modules/bluebird/js/release/nodeify.js"(exports2, module2) {
18065     "use strict";
18066     module2.exports = function(Promise2) {
18067       var util = require_util();
18068       var async = Promise2._async;
18069       var tryCatch2 = util.tryCatch;
18070       var errorObj2 = util.errorObj;
18071       function spreadAdapter(val, nodeback) {
18072         var promise = this;
18073         if (!util.isArray(val))
18074           return successAdapter.call(promise, val, nodeback);
18075         var ret2 = tryCatch2(nodeback).apply(promise._boundValue(), [null].concat(val));
18076         if (ret2 === errorObj2) {
18077           async.throwLater(ret2.e);
18078         }
18079       }
18080       function successAdapter(val, nodeback) {
18081         var promise = this;
18082         var receiver = promise._boundValue();
18083         var ret2 = val === void 0 ? tryCatch2(nodeback).call(receiver, null) : tryCatch2(nodeback).call(receiver, null, val);
18084         if (ret2 === errorObj2) {
18085           async.throwLater(ret2.e);
18086         }
18087       }
18088       function errorAdapter(reason, nodeback) {
18089         var promise = this;
18090         if (!reason) {
18091           var newReason = new Error(reason + "");
18092           newReason.cause = reason;
18093           reason = newReason;
18094         }
18095         var ret2 = tryCatch2(nodeback).call(promise._boundValue(), reason);
18096         if (ret2 === errorObj2) {
18097           async.throwLater(ret2.e);
18098         }
18099       }
18100       Promise2.prototype.asCallback = Promise2.prototype.nodeify = function(nodeback, options) {
18101         if (typeof nodeback == "function") {
18102           var adapter = successAdapter;
18103           if (options !== void 0 && Object(options).spread) {
18104             adapter = spreadAdapter;
18105           }
18106           this._then(adapter, errorAdapter, void 0, this, nodeback);
18107         }
18108         return this;
18109       };
18110     };
18111   }
18112 });
18113
18114 // node_modules/bluebird/js/release/promisify.js
18115 var require_promisify = __commonJS({
18116   "node_modules/bluebird/js/release/promisify.js"(exports2, module2) {
18117     "use strict";
18118     module2.exports = function(Promise2, INTERNAL2) {
18119       var THIS = {};
18120       var util = require_util();
18121       var nodebackForPromise = require_nodeback();
18122       var withAppended2 = util.withAppended;
18123       var maybeWrapAsError2 = util.maybeWrapAsError;
18124       var canEvaluate2 = util.canEvaluate;
18125       var TypeError2 = require_errors().TypeError;
18126       var defaultSuffix = "Async";
18127       var defaultPromisified = { __isPromisified__: true };
18128       var noCopyProps = [
18129         "arity",
18130         "length",
18131         "name",
18132         "arguments",
18133         "caller",
18134         "callee",
18135         "prototype",
18136         "__isPromisified__"
18137       ];
18138       var noCopyPropsPattern = new RegExp("^(?:" + noCopyProps.join("|") + ")$");
18139       var defaultFilter = function(name) {
18140         return util.isIdentifier(name) && name.charAt(0) !== "_" && name !== "constructor";
18141       };
18142       function propsFilter(key) {
18143         return !noCopyPropsPattern.test(key);
18144       }
18145       function isPromisified(fn) {
18146         try {
18147           return fn.__isPromisified__ === true;
18148         } catch (e) {
18149           return false;
18150         }
18151       }
18152       function hasPromisified(obj2, key, suffix) {
18153         var val = util.getDataPropertyOrDefault(obj2, key + suffix, defaultPromisified);
18154         return val ? isPromisified(val) : false;
18155       }
18156       function checkValid(ret2, suffix, suffixRegexp) {
18157         for (var i = 0; i < ret2.length; i += 2) {
18158           var key = ret2[i];
18159           if (suffixRegexp.test(key)) {
18160             var keyWithoutAsyncSuffix = key.replace(suffixRegexp, "");
18161             for (var j = 0; j < ret2.length; j += 2) {
18162               if (ret2[j] === keyWithoutAsyncSuffix) {
18163                 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));
18164               }
18165             }
18166           }
18167         }
18168       }
18169       function promisifiableMethods(obj2, suffix, suffixRegexp, filter) {
18170         var keys = util.inheritedDataKeys(obj2);
18171         var ret2 = [];
18172         for (var i = 0; i < keys.length; ++i) {
18173           var key = keys[i];
18174           var value = obj2[key];
18175           var passesDefaultFilter = filter === defaultFilter ? true : defaultFilter(key, value, obj2);
18176           if (typeof value === "function" && !isPromisified(value) && !hasPromisified(obj2, key, suffix) && filter(key, value, obj2, passesDefaultFilter)) {
18177             ret2.push(key, value);
18178           }
18179         }
18180         checkValid(ret2, suffix, suffixRegexp);
18181         return ret2;
18182       }
18183       var escapeIdentRegex = function(str) {
18184         return str.replace(/([$])/, "\\$");
18185       };
18186       var makeNodePromisifiedEval;
18187       if (true) {
18188         var switchCaseArgumentOrder = function(likelyArgumentCount) {
18189           var ret2 = [likelyArgumentCount];
18190           var min = Math.max(0, likelyArgumentCount - 1 - 3);
18191           for (var i = likelyArgumentCount - 1; i >= min; --i) {
18192             ret2.push(i);
18193           }
18194           for (var i = likelyArgumentCount + 1; i <= 3; ++i) {
18195             ret2.push(i);
18196           }
18197           return ret2;
18198         };
18199         var argumentSequence = function(argumentCount) {
18200           return util.filledRange(argumentCount, "_arg", "");
18201         };
18202         var parameterDeclaration = function(parameterCount2) {
18203           return util.filledRange(Math.max(parameterCount2, 3), "_arg", "");
18204         };
18205         var parameterCount = function(fn) {
18206           if (typeof fn.length === "number") {
18207             return Math.max(Math.min(fn.length, 1023 + 1), 0);
18208           }
18209           return 0;
18210         };
18211         makeNodePromisifiedEval = function(callback, receiver, originalName, fn, _, multiArgs) {
18212           var newParameterCount = Math.max(0, parameterCount(fn) - 1);
18213           var argumentOrder = switchCaseArgumentOrder(newParameterCount);
18214           var shouldProxyThis = typeof callback === "string" || receiver === THIS;
18215           function generateCallForArgumentCount(count) {
18216             var args = argumentSequence(count).join(", ");
18217             var comma = count > 0 ? ", " : "";
18218             var ret2;
18219             if (shouldProxyThis) {
18220               ret2 = "ret = callback.call(this, {{args}}, nodeback); break;\n";
18221             } else {
18222               ret2 = receiver === void 0 ? "ret = callback({{args}}, nodeback); break;\n" : "ret = callback.call(receiver, {{args}}, nodeback); break;\n";
18223             }
18224             return ret2.replace("{{args}}", args).replace(", ", comma);
18225           }
18226           function generateArgumentSwitchCase() {
18227             var ret2 = "";
18228             for (var i = 0; i < argumentOrder.length; ++i) {
18229               ret2 += "case " + argumentOrder[i] + ":" + generateCallForArgumentCount(argumentOrder[i]);
18230             }
18231             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");
18232             return ret2;
18233           }
18234           var getFunctionCode = typeof callback === "string" ? "this != null ? this['" + callback + "'] : fn" : "fn";
18235           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);
18236           body = body.replace("Parameters", parameterDeclaration(newParameterCount));
18237           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, INTERNAL2);
18238         };
18239       }
18240       function makeNodePromisifiedClosure(callback, receiver, _, fn, __, multiArgs) {
18241         var defaultThis = function() {
18242           return this;
18243         }();
18244         var method = callback;
18245         if (typeof method === "string") {
18246           callback = fn;
18247         }
18248         function promisified() {
18249           var _receiver = receiver;
18250           if (receiver === THIS)
18251             _receiver = this;
18252           var promise = new Promise2(INTERNAL2);
18253           promise._captureStackTrace();
18254           var cb = typeof method === "string" && this !== defaultThis ? this[method] : callback;
18255           var fn2 = nodebackForPromise(promise, multiArgs);
18256           try {
18257             cb.apply(_receiver, withAppended2(arguments, fn2));
18258           } catch (e) {
18259             promise._rejectCallback(maybeWrapAsError2(e), true, true);
18260           }
18261           if (!promise._isFateSealed())
18262             promise._setAsyncGuaranteed();
18263           return promise;
18264         }
18265         util.notEnumerableProp(promisified, "__isPromisified__", true);
18266         return promisified;
18267       }
18268       var makeNodePromisified = canEvaluate2 ? makeNodePromisifiedEval : makeNodePromisifiedClosure;
18269       function promisifyAll(obj2, suffix, filter, promisifier, multiArgs) {
18270         var suffixRegexp = new RegExp(escapeIdentRegex(suffix) + "$");
18271         var methods = promisifiableMethods(obj2, suffix, suffixRegexp, filter);
18272         for (var i = 0, len = methods.length; i < len; i += 2) {
18273           var key = methods[i];
18274           var fn = methods[i + 1];
18275           var promisifiedKey = key + suffix;
18276           if (promisifier === makeNodePromisified) {
18277             obj2[promisifiedKey] = makeNodePromisified(key, THIS, key, fn, suffix, multiArgs);
18278           } else {
18279             var promisified = promisifier(fn, function() {
18280               return makeNodePromisified(key, THIS, key, fn, suffix, multiArgs);
18281             });
18282             util.notEnumerableProp(promisified, "__isPromisified__", true);
18283             obj2[promisifiedKey] = promisified;
18284           }
18285         }
18286         util.toFastProperties(obj2);
18287         return obj2;
18288       }
18289       function promisify(callback, receiver, multiArgs) {
18290         return makeNodePromisified(callback, receiver, void 0, callback, null, multiArgs);
18291       }
18292       Promise2.promisify = function(fn, options) {
18293         if (typeof fn !== "function") {
18294           throw new TypeError2("expecting a function but got " + util.classString(fn));
18295         }
18296         if (isPromisified(fn)) {
18297           return fn;
18298         }
18299         options = Object(options);
18300         var receiver = options.context === void 0 ? THIS : options.context;
18301         var multiArgs = !!options.multiArgs;
18302         var ret2 = promisify(fn, receiver, multiArgs);
18303         util.copyDescriptors(fn, ret2, propsFilter);
18304         return ret2;
18305       };
18306       Promise2.promisifyAll = function(target, options) {
18307         if (typeof target !== "function" && typeof target !== "object") {
18308           throw new TypeError2("the target of promisifyAll must be an object or a function\n\n    See http://goo.gl/MqrFmX\n");
18309         }
18310         options = Object(options);
18311         var multiArgs = !!options.multiArgs;
18312         var suffix = options.suffix;
18313         if (typeof suffix !== "string")
18314           suffix = defaultSuffix;
18315         var filter = options.filter;
18316         if (typeof filter !== "function")
18317           filter = defaultFilter;
18318         var promisifier = options.promisifier;
18319         if (typeof promisifier !== "function")
18320           promisifier = makeNodePromisified;
18321         if (!util.isIdentifier(suffix)) {
18322           throw new RangeError("suffix must be a valid identifier\n\n    See http://goo.gl/MqrFmX\n");
18323         }
18324         var keys = util.inheritedDataKeys(target);
18325         for (var i = 0; i < keys.length; ++i) {
18326           var value = target[keys[i]];
18327           if (keys[i] !== "constructor" && util.isClass(value)) {
18328             promisifyAll(value.prototype, suffix, filter, promisifier, multiArgs);
18329             promisifyAll(value, suffix, filter, promisifier, multiArgs);
18330           }
18331         }
18332         return promisifyAll(target, suffix, filter, promisifier, multiArgs);
18333       };
18334     };
18335   }
18336 });
18337
18338 // node_modules/bluebird/js/release/props.js
18339 var require_props = __commonJS({
18340   "node_modules/bluebird/js/release/props.js"(exports2, module2) {
18341     "use strict";
18342     module2.exports = function(Promise2, PromiseArray, tryConvertToPromise, apiRejection) {
18343       var util = require_util();
18344       var isObject2 = util.isObject;
18345       var es52 = require_es5();
18346       var Es6Map;
18347       if (typeof Map === "function")
18348         Es6Map = Map;
18349       var mapToEntries = function() {
18350         var index = 0;
18351         var size = 0;
18352         function extractEntry(value, key) {
18353           this[index] = value;
18354           this[index + size] = key;
18355           index++;
18356         }
18357         return function mapToEntries2(map) {
18358           size = map.size;
18359           index = 0;
18360           var ret2 = new Array(map.size * 2);
18361           map.forEach(extractEntry, ret2);
18362           return ret2;
18363         };
18364       }();
18365       var entriesToMap = function(entries) {
18366         var ret2 = new Es6Map();
18367         var length = entries.length / 2 | 0;
18368         for (var i = 0; i < length; ++i) {
18369           var key = entries[length + i];
18370           var value = entries[i];
18371           ret2.set(key, value);
18372         }
18373         return ret2;
18374       };
18375       function PropertiesPromiseArray(obj2) {
18376         var isMap = false;
18377         var entries;
18378         if (Es6Map !== void 0 && obj2 instanceof Es6Map) {
18379           entries = mapToEntries(obj2);
18380           isMap = true;
18381         } else {
18382           var keys = es52.keys(obj2);
18383           var len = keys.length;
18384           entries = new Array(len * 2);
18385           for (var i = 0; i < len; ++i) {
18386             var key = keys[i];
18387             entries[i] = obj2[key];
18388             entries[i + len] = key;
18389           }
18390         }
18391         this.constructor$(entries);
18392         this._isMap = isMap;
18393         this._init$(void 0, -3);
18394       }
18395       util.inherits(PropertiesPromiseArray, PromiseArray);
18396       PropertiesPromiseArray.prototype._init = function() {
18397       };
18398       PropertiesPromiseArray.prototype._promiseFulfilled = function(value, index) {
18399         this._values[index] = value;
18400         var totalResolved = ++this._totalResolved;
18401         if (totalResolved >= this._length) {
18402           var val;
18403           if (this._isMap) {
18404             val = entriesToMap(this._values);
18405           } else {
18406             val = {};
18407             var keyOffset = this.length();
18408             for (var i = 0, len = this.length(); i < len; ++i) {
18409               val[this._values[i + keyOffset]] = this._values[i];
18410             }
18411           }
18412           this._resolve(val);
18413           return true;
18414         }
18415         return false;
18416       };
18417       PropertiesPromiseArray.prototype.shouldCopyValues = function() {
18418         return false;
18419       };
18420       PropertiesPromiseArray.prototype.getActualLength = function(len) {
18421         return len >> 1;
18422       };
18423       function props(promises) {
18424         var ret2;
18425         var castValue = tryConvertToPromise(promises);
18426         if (!isObject2(castValue)) {
18427           return apiRejection("cannot await properties of a non-object\n\n    See http://goo.gl/MqrFmX\n");
18428         } else if (castValue instanceof Promise2) {
18429           ret2 = castValue._then(Promise2.props, void 0, void 0, void 0, void 0);
18430         } else {
18431           ret2 = new PropertiesPromiseArray(castValue).promise();
18432         }
18433         if (castValue instanceof Promise2) {
18434           ret2._propagateFrom(castValue, 2);
18435         }
18436         return ret2;
18437       }
18438       Promise2.prototype.props = function() {
18439         return props(this);
18440       };
18441       Promise2.props = function(promises) {
18442         return props(promises);
18443       };
18444     };
18445   }
18446 });
18447
18448 // node_modules/bluebird/js/release/race.js
18449 var require_race = __commonJS({
18450   "node_modules/bluebird/js/release/race.js"(exports2, module2) {
18451     "use strict";
18452     module2.exports = function(Promise2, INTERNAL2, tryConvertToPromise, apiRejection) {
18453       var util = require_util();
18454       var raceLater = function(promise) {
18455         return promise.then(function(array) {
18456           return race(array, promise);
18457         });
18458       };
18459       function race(promises, parent) {
18460         var maybePromise = tryConvertToPromise(promises);
18461         if (maybePromise instanceof Promise2) {
18462           return raceLater(maybePromise);
18463         } else {
18464           promises = util.asArray(promises);
18465           if (promises === null)
18466             return apiRejection("expecting an array or an iterable object but got " + util.classString(promises));
18467         }
18468         var ret2 = new Promise2(INTERNAL2);
18469         if (parent !== void 0) {
18470           ret2._propagateFrom(parent, 3);
18471         }
18472         var fulfill = ret2._fulfill;
18473         var reject = ret2._reject;
18474         for (var i = 0, len = promises.length; i < len; ++i) {
18475           var val = promises[i];
18476           if (val === void 0 && !(i in promises)) {
18477             continue;
18478           }
18479           Promise2.cast(val)._then(fulfill, reject, void 0, ret2, null);
18480         }
18481         return ret2;
18482       }
18483       Promise2.race = function(promises) {
18484         return race(promises, void 0);
18485       };
18486       Promise2.prototype.race = function() {
18487         return race(this, void 0);
18488       };
18489     };
18490   }
18491 });
18492
18493 // node_modules/bluebird/js/release/reduce.js
18494 var require_reduce = __commonJS({
18495   "node_modules/bluebird/js/release/reduce.js"(exports2, module2) {
18496     "use strict";
18497     module2.exports = function(Promise2, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL2, debug) {
18498       var getDomain = Promise2._getDomain;
18499       var util = require_util();
18500       var tryCatch2 = util.tryCatch;
18501       function ReductionPromiseArray(promises, fn, initialValue, _each) {
18502         this.constructor$(promises);
18503         var domain = getDomain();
18504         this._fn = domain === null ? fn : util.domainBind(domain, fn);
18505         if (initialValue !== void 0) {
18506           initialValue = Promise2.resolve(initialValue);
18507           initialValue._attachCancellationCallback(this);
18508         }
18509         this._initialValue = initialValue;
18510         this._currentCancellable = null;
18511         if (_each === INTERNAL2) {
18512           this._eachValues = Array(this._length);
18513         } else if (_each === 0) {
18514           this._eachValues = null;
18515         } else {
18516           this._eachValues = void 0;
18517         }
18518         this._promise._captureStackTrace();
18519         this._init$(void 0, -5);
18520       }
18521       util.inherits(ReductionPromiseArray, PromiseArray);
18522       ReductionPromiseArray.prototype._gotAccum = function(accum) {
18523         if (this._eachValues !== void 0 && this._eachValues !== null && accum !== INTERNAL2) {
18524           this._eachValues.push(accum);
18525         }
18526       };
18527       ReductionPromiseArray.prototype._eachComplete = function(value) {
18528         if (this._eachValues !== null) {
18529           this._eachValues.push(value);
18530         }
18531         return this._eachValues;
18532       };
18533       ReductionPromiseArray.prototype._init = function() {
18534       };
18535       ReductionPromiseArray.prototype._resolveEmptyArray = function() {
18536         this._resolve(this._eachValues !== void 0 ? this._eachValues : this._initialValue);
18537       };
18538       ReductionPromiseArray.prototype.shouldCopyValues = function() {
18539         return false;
18540       };
18541       ReductionPromiseArray.prototype._resolve = function(value) {
18542         this._promise._resolveCallback(value);
18543         this._values = null;
18544       };
18545       ReductionPromiseArray.prototype._resultCancelled = function(sender) {
18546         if (sender === this._initialValue)
18547           return this._cancel();
18548         if (this._isResolved())
18549           return;
18550         this._resultCancelled$();
18551         if (this._currentCancellable instanceof Promise2) {
18552           this._currentCancellable.cancel();
18553         }
18554         if (this._initialValue instanceof Promise2) {
18555           this._initialValue.cancel();
18556         }
18557       };
18558       ReductionPromiseArray.prototype._iterate = function(values) {
18559         this._values = values;
18560         var value;
18561         var i;
18562         var length = values.length;
18563         if (this._initialValue !== void 0) {
18564           value = this._initialValue;
18565           i = 0;
18566         } else {
18567           value = Promise2.resolve(values[0]);
18568           i = 1;
18569         }
18570         this._currentCancellable = value;
18571         if (!value.isRejected()) {
18572           for (; i < length; ++i) {
18573             var ctx = {
18574               accum: null,
18575               value: values[i],
18576               index: i,
18577               length,
18578               array: this
18579             };
18580             value = value._then(gotAccum, void 0, void 0, ctx, void 0);
18581           }
18582         }
18583         if (this._eachValues !== void 0) {
18584           value = value._then(this._eachComplete, void 0, void 0, this, void 0);
18585         }
18586         value._then(completed, completed, void 0, value, this);
18587       };
18588       Promise2.prototype.reduce = function(fn, initialValue) {
18589         return reduce(this, fn, initialValue, null);
18590       };
18591       Promise2.reduce = function(promises, fn, initialValue, _each) {
18592         return reduce(promises, fn, initialValue, _each);
18593       };
18594       function completed(valueOrReason, array) {
18595         if (this.isFulfilled()) {
18596           array._resolve(valueOrReason);
18597         } else {
18598           array._reject(valueOrReason);
18599         }
18600       }
18601       function reduce(promises, fn, initialValue, _each) {
18602         if (typeof fn !== "function") {
18603           return apiRejection("expecting a function but got " + util.classString(fn));
18604         }
18605         var array = new ReductionPromiseArray(promises, fn, initialValue, _each);
18606         return array.promise();
18607       }
18608       function gotAccum(accum) {
18609         this.accum = accum;
18610         this.array._gotAccum(accum);
18611         var value = tryConvertToPromise(this.value, this.array._promise);
18612         if (value instanceof Promise2) {
18613           this.array._currentCancellable = value;
18614           return value._then(gotValue, void 0, void 0, this, void 0);
18615         } else {
18616           return gotValue.call(this, value);
18617         }
18618       }
18619       function gotValue(value) {
18620         var array = this.array;
18621         var promise = array._promise;
18622         var fn = tryCatch2(array._fn);
18623         promise._pushContext();
18624         var ret2;
18625         if (array._eachValues !== void 0) {
18626           ret2 = fn.call(promise._boundValue(), value, this.index, this.length);
18627         } else {
18628           ret2 = fn.call(promise._boundValue(), this.accum, value, this.index, this.length);
18629         }
18630         if (ret2 instanceof Promise2) {
18631           array._currentCancellable = ret2;
18632         }
18633         var promiseCreated = promise._popContext();
18634         debug.checkForgottenReturns(ret2, promiseCreated, array._eachValues !== void 0 ? "Promise.each" : "Promise.reduce", promise);
18635         return ret2;
18636       }
18637     };
18638   }
18639 });
18640
18641 // node_modules/bluebird/js/release/settle.js
18642 var require_settle = __commonJS({
18643   "node_modules/bluebird/js/release/settle.js"(exports2, module2) {
18644     "use strict";
18645     module2.exports = function(Promise2, PromiseArray, debug) {
18646       var PromiseInspection = Promise2.PromiseInspection;
18647       var util = require_util();
18648       function SettledPromiseArray(values) {
18649         this.constructor$(values);
18650       }
18651       util.inherits(SettledPromiseArray, PromiseArray);
18652       SettledPromiseArray.prototype._promiseResolved = function(index, inspection) {
18653         this._values[index] = inspection;
18654         var totalResolved = ++this._totalResolved;
18655         if (totalResolved >= this._length) {
18656           this._resolve(this._values);
18657           return true;
18658         }
18659         return false;
18660       };
18661       SettledPromiseArray.prototype._promiseFulfilled = function(value, index) {
18662         var ret2 = new PromiseInspection();
18663         ret2._bitField = 33554432;
18664         ret2._settledValueField = value;
18665         return this._promiseResolved(index, ret2);
18666       };
18667       SettledPromiseArray.prototype._promiseRejected = function(reason, index) {
18668         var ret2 = new PromiseInspection();
18669         ret2._bitField = 16777216;
18670         ret2._settledValueField = reason;
18671         return this._promiseResolved(index, ret2);
18672       };
18673       Promise2.settle = function(promises) {
18674         debug.deprecated(".settle()", ".reflect()");
18675         return new SettledPromiseArray(promises).promise();
18676       };
18677       Promise2.prototype.settle = function() {
18678         return Promise2.settle(this);
18679       };
18680     };
18681   }
18682 });
18683
18684 // node_modules/bluebird/js/release/some.js
18685 var require_some = __commonJS({
18686   "node_modules/bluebird/js/release/some.js"(exports2, module2) {
18687     "use strict";
18688     module2.exports = function(Promise2, PromiseArray, apiRejection) {
18689       var util = require_util();
18690       var RangeError2 = require_errors().RangeError;
18691       var AggregateError = require_errors().AggregateError;
18692       var isArray = util.isArray;
18693       var CANCELLATION = {};
18694       function SomePromiseArray(values) {
18695         this.constructor$(values);
18696         this._howMany = 0;
18697         this._unwrap = false;
18698         this._initialized = false;
18699       }
18700       util.inherits(SomePromiseArray, PromiseArray);
18701       SomePromiseArray.prototype._init = function() {
18702         if (!this._initialized) {
18703           return;
18704         }
18705         if (this._howMany === 0) {
18706           this._resolve([]);
18707           return;
18708         }
18709         this._init$(void 0, -5);
18710         var isArrayResolved = isArray(this._values);
18711         if (!this._isResolved() && isArrayResolved && this._howMany > this._canPossiblyFulfill()) {
18712           this._reject(this._getRangeError(this.length()));
18713         }
18714       };
18715       SomePromiseArray.prototype.init = function() {
18716         this._initialized = true;
18717         this._init();
18718       };
18719       SomePromiseArray.prototype.setUnwrap = function() {
18720         this._unwrap = true;
18721       };
18722       SomePromiseArray.prototype.howMany = function() {
18723         return this._howMany;
18724       };
18725       SomePromiseArray.prototype.setHowMany = function(count) {
18726         this._howMany = count;
18727       };
18728       SomePromiseArray.prototype._promiseFulfilled = function(value) {
18729         this._addFulfilled(value);
18730         if (this._fulfilled() === this.howMany()) {
18731           this._values.length = this.howMany();
18732           if (this.howMany() === 1 && this._unwrap) {
18733             this._resolve(this._values[0]);
18734           } else {
18735             this._resolve(this._values);
18736           }
18737           return true;
18738         }
18739         return false;
18740       };
18741       SomePromiseArray.prototype._promiseRejected = function(reason) {
18742         this._addRejected(reason);
18743         return this._checkOutcome();
18744       };
18745       SomePromiseArray.prototype._promiseCancelled = function() {
18746         if (this._values instanceof Promise2 || this._values == null) {
18747           return this._cancel();
18748         }
18749         this._addRejected(CANCELLATION);
18750         return this._checkOutcome();
18751       };
18752       SomePromiseArray.prototype._checkOutcome = function() {
18753         if (this.howMany() > this._canPossiblyFulfill()) {
18754           var e = new AggregateError();
18755           for (var i = this.length(); i < this._values.length; ++i) {
18756             if (this._values[i] !== CANCELLATION) {
18757               e.push(this._values[i]);
18758             }
18759           }
18760           if (e.length > 0) {
18761             this._reject(e);
18762           } else {
18763             this._cancel();
18764           }
18765           return true;
18766         }
18767         return false;
18768       };
18769       SomePromiseArray.prototype._fulfilled = function() {
18770         return this._totalResolved;
18771       };
18772       SomePromiseArray.prototype._rejected = function() {
18773         return this._values.length - this.length();
18774       };
18775       SomePromiseArray.prototype._addRejected = function(reason) {
18776         this._values.push(reason);
18777       };
18778       SomePromiseArray.prototype._addFulfilled = function(value) {
18779         this._values[this._totalResolved++] = value;
18780       };
18781       SomePromiseArray.prototype._canPossiblyFulfill = function() {
18782         return this.length() - this._rejected();
18783       };
18784       SomePromiseArray.prototype._getRangeError = function(count) {
18785         var message = "Input array must contain at least " + this._howMany + " items but contains only " + count + " items";
18786         return new RangeError2(message);
18787       };
18788       SomePromiseArray.prototype._resolveEmptyArray = function() {
18789         this._reject(this._getRangeError(0));
18790       };
18791       function some(promises, howMany) {
18792         if ((howMany | 0) !== howMany || howMany < 0) {
18793           return apiRejection("expecting a positive integer\n\n    See http://goo.gl/MqrFmX\n");
18794         }
18795         var ret2 = new SomePromiseArray(promises);
18796         var promise = ret2.promise();
18797         ret2.setHowMany(howMany);
18798         ret2.init();
18799         return promise;
18800       }
18801       Promise2.some = function(promises, howMany) {
18802         return some(promises, howMany);
18803       };
18804       Promise2.prototype.some = function(howMany) {
18805         return some(this, howMany);
18806       };
18807       Promise2._SomePromiseArray = SomePromiseArray;
18808     };
18809   }
18810 });
18811
18812 // node_modules/bluebird/js/release/filter.js
18813 var require_filter = __commonJS({
18814   "node_modules/bluebird/js/release/filter.js"(exports2, module2) {
18815     "use strict";
18816     module2.exports = function(Promise2, INTERNAL2) {
18817       var PromiseMap = Promise2.map;
18818       Promise2.prototype.filter = function(fn, options) {
18819         return PromiseMap(this, fn, options, INTERNAL2);
18820       };
18821       Promise2.filter = function(promises, fn, options) {
18822         return PromiseMap(promises, fn, options, INTERNAL2);
18823       };
18824     };
18825   }
18826 });
18827
18828 // node_modules/bluebird/js/release/each.js
18829 var require_each = __commonJS({
18830   "node_modules/bluebird/js/release/each.js"(exports2, module2) {
18831     "use strict";
18832     module2.exports = function(Promise2, INTERNAL2) {
18833       var PromiseReduce = Promise2.reduce;
18834       var PromiseAll = Promise2.all;
18835       function promiseAllThis() {
18836         return PromiseAll(this);
18837       }
18838       function PromiseMapSeries(promises, fn) {
18839         return PromiseReduce(promises, fn, INTERNAL2, INTERNAL2);
18840       }
18841       Promise2.prototype.each = function(fn) {
18842         return PromiseReduce(this, fn, INTERNAL2, 0)._then(promiseAllThis, void 0, void 0, this, void 0);
18843       };
18844       Promise2.prototype.mapSeries = function(fn) {
18845         return PromiseReduce(this, fn, INTERNAL2, INTERNAL2);
18846       };
18847       Promise2.each = function(promises, fn) {
18848         return PromiseReduce(promises, fn, INTERNAL2, 0)._then(promiseAllThis, void 0, void 0, promises, void 0);
18849       };
18850       Promise2.mapSeries = PromiseMapSeries;
18851     };
18852   }
18853 });
18854
18855 // node_modules/bluebird/js/release/any.js
18856 var require_any = __commonJS({
18857   "node_modules/bluebird/js/release/any.js"(exports2, module2) {
18858     "use strict";
18859     module2.exports = function(Promise2) {
18860       var SomePromiseArray = Promise2._SomePromiseArray;
18861       function any(promises) {
18862         var ret2 = new SomePromiseArray(promises);
18863         var promise = ret2.promise();
18864         ret2.setHowMany(1);
18865         ret2.setUnwrap();
18866         ret2.init();
18867         return promise;
18868       }
18869       Promise2.any = function(promises) {
18870         return any(promises);
18871       };
18872       Promise2.prototype.any = function() {
18873         return any(this);
18874       };
18875     };
18876   }
18877 });
18878
18879 // node_modules/bluebird/js/release/promise.js
18880 var require_promise = __commonJS({
18881   "node_modules/bluebird/js/release/promise.js"(exports2, module2) {
18882     "use strict";
18883     module2.exports = function() {
18884       var makeSelfResolutionError = function() {
18885         return new TypeError2("circular promise resolution chain\n\n    See http://goo.gl/MqrFmX\n");
18886       };
18887       var reflectHandler = function() {
18888         return new Promise2.PromiseInspection(this._target());
18889       };
18890       var apiRejection = function(msg) {
18891         return Promise2.reject(new TypeError2(msg));
18892       };
18893       function Proxyable() {
18894       }
18895       var UNDEFINED_BINDING = {};
18896       var util = require_util();
18897       var getDomain;
18898       if (util.isNode) {
18899         getDomain = function() {
18900           var ret2 = process.domain;
18901           if (ret2 === void 0)
18902             ret2 = null;
18903           return ret2;
18904         };
18905       } else {
18906         getDomain = function() {
18907           return null;
18908         };
18909       }
18910       util.notEnumerableProp(Promise2, "_getDomain", getDomain);
18911       var es52 = require_es5();
18912       var Async = require_async();
18913       var async = new Async();
18914       es52.defineProperty(Promise2, "_async", { value: async });
18915       var errors = require_errors();
18916       var TypeError2 = Promise2.TypeError = errors.TypeError;
18917       Promise2.RangeError = errors.RangeError;
18918       var CancellationError = Promise2.CancellationError = errors.CancellationError;
18919       Promise2.TimeoutError = errors.TimeoutError;
18920       Promise2.OperationalError = errors.OperationalError;
18921       Promise2.RejectionError = errors.OperationalError;
18922       Promise2.AggregateError = errors.AggregateError;
18923       var INTERNAL2 = function() {
18924       };
18925       var APPLY = {};
18926       var NEXT_FILTER = {};
18927       var tryConvertToPromise = require_thenables()(Promise2, INTERNAL2);
18928       var PromiseArray = require_promise_array()(Promise2, INTERNAL2, tryConvertToPromise, apiRejection, Proxyable);
18929       var Context = require_context()(Promise2);
18930       var createContext = Context.create;
18931       var debug = require_debuggability()(Promise2, Context);
18932       var CapturedTrace = debug.CapturedTrace;
18933       var PassThroughHandlerContext = require_finally()(Promise2, tryConvertToPromise);
18934       var catchFilter = require_catch_filter()(NEXT_FILTER);
18935       var nodebackForPromise = require_nodeback();
18936       var errorObj2 = util.errorObj;
18937       var tryCatch2 = util.tryCatch;
18938       function check(self2, executor) {
18939         if (typeof executor !== "function") {
18940           throw new TypeError2("expecting a function but got " + util.classString(executor));
18941         }
18942         if (self2.constructor !== Promise2) {
18943           throw new TypeError2("the promise constructor cannot be invoked directly\n\n    See http://goo.gl/MqrFmX\n");
18944         }
18945       }
18946       function Promise2(executor) {
18947         this._bitField = 0;
18948         this._fulfillmentHandler0 = void 0;
18949         this._rejectionHandler0 = void 0;
18950         this._promise0 = void 0;
18951         this._receiver0 = void 0;
18952         if (executor !== INTERNAL2) {
18953           check(this, executor);
18954           this._resolveFromExecutor(executor);
18955         }
18956         this._promiseCreated();
18957         this._fireEvent("promiseCreated", this);
18958       }
18959       Promise2.prototype.toString = function() {
18960         return "[object Promise]";
18961       };
18962       Promise2.prototype.caught = Promise2.prototype["catch"] = function(fn) {
18963         var len = arguments.length;
18964         if (len > 1) {
18965           var catchInstances = new Array(len - 1), j = 0, i;
18966           for (i = 0; i < len - 1; ++i) {
18967             var item = arguments[i];
18968             if (util.isObject(item)) {
18969               catchInstances[j++] = item;
18970             } else {
18971               return apiRejection("expecting an object but got A catch statement predicate " + util.classString(item));
18972             }
18973           }
18974           catchInstances.length = j;
18975           fn = arguments[i];
18976           return this.then(void 0, catchFilter(catchInstances, fn, this));
18977         }
18978         return this.then(void 0, fn);
18979       };
18980       Promise2.prototype.reflect = function() {
18981         return this._then(reflectHandler, reflectHandler, void 0, this, void 0);
18982       };
18983       Promise2.prototype.then = function(didFulfill, didReject) {
18984         if (debug.warnings() && arguments.length > 0 && typeof didFulfill !== "function" && typeof didReject !== "function") {
18985           var msg = ".then() only accepts functions but was passed: " + util.classString(didFulfill);
18986           if (arguments.length > 1) {
18987             msg += ", " + util.classString(didReject);
18988           }
18989           this._warn(msg);
18990         }
18991         return this._then(didFulfill, didReject, void 0, void 0, void 0);
18992       };
18993       Promise2.prototype.done = function(didFulfill, didReject) {
18994         var promise = this._then(didFulfill, didReject, void 0, void 0, void 0);
18995         promise._setIsFinal();
18996       };
18997       Promise2.prototype.spread = function(fn) {
18998         if (typeof fn !== "function") {
18999           return apiRejection("expecting a function but got " + util.classString(fn));
19000         }
19001         return this.all()._then(fn, void 0, void 0, APPLY, void 0);
19002       };
19003       Promise2.prototype.toJSON = function() {
19004         var ret2 = {
19005           isFulfilled: false,
19006           isRejected: false,
19007           fulfillmentValue: void 0,
19008           rejectionReason: void 0
19009         };
19010         if (this.isFulfilled()) {
19011           ret2.fulfillmentValue = this.value();
19012           ret2.isFulfilled = true;
19013         } else if (this.isRejected()) {
19014           ret2.rejectionReason = this.reason();
19015           ret2.isRejected = true;
19016         }
19017         return ret2;
19018       };
19019       Promise2.prototype.all = function() {
19020         if (arguments.length > 0) {
19021           this._warn(".all() was passed arguments but it does not take any");
19022         }
19023         return new PromiseArray(this).promise();
19024       };
19025       Promise2.prototype.error = function(fn) {
19026         return this.caught(util.originatesFromRejection, fn);
19027       };
19028       Promise2.getNewLibraryCopy = module2.exports;
19029       Promise2.is = function(val) {
19030         return val instanceof Promise2;
19031       };
19032       Promise2.fromNode = Promise2.fromCallback = function(fn) {
19033         var ret2 = new Promise2(INTERNAL2);
19034         ret2._captureStackTrace();
19035         var multiArgs = arguments.length > 1 ? !!Object(arguments[1]).multiArgs : false;
19036         var result = tryCatch2(fn)(nodebackForPromise(ret2, multiArgs));
19037         if (result === errorObj2) {
19038           ret2._rejectCallback(result.e, true);
19039         }
19040         if (!ret2._isFateSealed())
19041           ret2._setAsyncGuaranteed();
19042         return ret2;
19043       };
19044       Promise2.all = function(promises) {
19045         return new PromiseArray(promises).promise();
19046       };
19047       Promise2.cast = function(obj2) {
19048         var ret2 = tryConvertToPromise(obj2);
19049         if (!(ret2 instanceof Promise2)) {
19050           ret2 = new Promise2(INTERNAL2);
19051           ret2._captureStackTrace();
19052           ret2._setFulfilled();
19053           ret2._rejectionHandler0 = obj2;
19054         }
19055         return ret2;
19056       };
19057       Promise2.resolve = Promise2.fulfilled = Promise2.cast;
19058       Promise2.reject = Promise2.rejected = function(reason) {
19059         var ret2 = new Promise2(INTERNAL2);
19060         ret2._captureStackTrace();
19061         ret2._rejectCallback(reason, true);
19062         return ret2;
19063       };
19064       Promise2.setScheduler = function(fn) {
19065         if (typeof fn !== "function") {
19066           throw new TypeError2("expecting a function but got " + util.classString(fn));
19067         }
19068         return async.setScheduler(fn);
19069       };
19070       Promise2.prototype._then = function(didFulfill, didReject, _, receiver, internalData) {
19071         var haveInternalData = internalData !== void 0;
19072         var promise = haveInternalData ? internalData : new Promise2(INTERNAL2);
19073         var target = this._target();
19074         var bitField = target._bitField;
19075         if (!haveInternalData) {
19076           promise._propagateFrom(this, 3);
19077           promise._captureStackTrace();
19078           if (receiver === void 0 && (this._bitField & 2097152) !== 0) {
19079             if (!((bitField & 50397184) === 0)) {
19080               receiver = this._boundValue();
19081             } else {
19082               receiver = target === this ? void 0 : this._boundTo;
19083             }
19084           }
19085           this._fireEvent("promiseChained", this, promise);
19086         }
19087         var domain = getDomain();
19088         if (!((bitField & 50397184) === 0)) {
19089           var handler, value, settler = target._settlePromiseCtx;
19090           if ((bitField & 33554432) !== 0) {
19091             value = target._rejectionHandler0;
19092             handler = didFulfill;
19093           } else if ((bitField & 16777216) !== 0) {
19094             value = target._fulfillmentHandler0;
19095             handler = didReject;
19096             target._unsetRejectionIsUnhandled();
19097           } else {
19098             settler = target._settlePromiseLateCancellationObserver;
19099             value = new CancellationError("late cancellation observer");
19100             target._attachExtraTrace(value);
19101             handler = didReject;
19102           }
19103           async.invoke(settler, target, {
19104             handler: domain === null ? handler : typeof handler === "function" && util.domainBind(domain, handler),
19105             promise,
19106             receiver,
19107             value
19108           });
19109         } else {
19110           target._addCallbacks(didFulfill, didReject, promise, receiver, domain);
19111         }
19112         return promise;
19113       };
19114       Promise2.prototype._length = function() {
19115         return this._bitField & 65535;
19116       };
19117       Promise2.prototype._isFateSealed = function() {
19118         return (this._bitField & 117506048) !== 0;
19119       };
19120       Promise2.prototype._isFollowing = function() {
19121         return (this._bitField & 67108864) === 67108864;
19122       };
19123       Promise2.prototype._setLength = function(len) {
19124         this._bitField = this._bitField & -65536 | len & 65535;
19125       };
19126       Promise2.prototype._setFulfilled = function() {
19127         this._bitField = this._bitField | 33554432;
19128         this._fireEvent("promiseFulfilled", this);
19129       };
19130       Promise2.prototype._setRejected = function() {
19131         this._bitField = this._bitField | 16777216;
19132         this._fireEvent("promiseRejected", this);
19133       };
19134       Promise2.prototype._setFollowing = function() {
19135         this._bitField = this._bitField | 67108864;
19136         this._fireEvent("promiseResolved", this);
19137       };
19138       Promise2.prototype._setIsFinal = function() {
19139         this._bitField = this._bitField | 4194304;
19140       };
19141       Promise2.prototype._isFinal = function() {
19142         return (this._bitField & 4194304) > 0;
19143       };
19144       Promise2.prototype._unsetCancelled = function() {
19145         this._bitField = this._bitField & ~65536;
19146       };
19147       Promise2.prototype._setCancelled = function() {
19148         this._bitField = this._bitField | 65536;
19149         this._fireEvent("promiseCancelled", this);
19150       };
19151       Promise2.prototype._setWillBeCancelled = function() {
19152         this._bitField = this._bitField | 8388608;
19153       };
19154       Promise2.prototype._setAsyncGuaranteed = function() {
19155         if (async.hasCustomScheduler())
19156           return;
19157         this._bitField = this._bitField | 134217728;
19158       };
19159       Promise2.prototype._receiverAt = function(index) {
19160         var ret2 = index === 0 ? this._receiver0 : this[index * 4 - 4 + 3];
19161         if (ret2 === UNDEFINED_BINDING) {
19162           return void 0;
19163         } else if (ret2 === void 0 && this._isBound()) {
19164           return this._boundValue();
19165         }
19166         return ret2;
19167       };
19168       Promise2.prototype._promiseAt = function(index) {
19169         return this[index * 4 - 4 + 2];
19170       };
19171       Promise2.prototype._fulfillmentHandlerAt = function(index) {
19172         return this[index * 4 - 4 + 0];
19173       };
19174       Promise2.prototype._rejectionHandlerAt = function(index) {
19175         return this[index * 4 - 4 + 1];
19176       };
19177       Promise2.prototype._boundValue = function() {
19178       };
19179       Promise2.prototype._migrateCallback0 = function(follower) {
19180         var bitField = follower._bitField;
19181         var fulfill = follower._fulfillmentHandler0;
19182         var reject = follower._rejectionHandler0;
19183         var promise = follower._promise0;
19184         var receiver = follower._receiverAt(0);
19185         if (receiver === void 0)
19186           receiver = UNDEFINED_BINDING;
19187         this._addCallbacks(fulfill, reject, promise, receiver, null);
19188       };
19189       Promise2.prototype._migrateCallbackAt = function(follower, index) {
19190         var fulfill = follower._fulfillmentHandlerAt(index);
19191         var reject = follower._rejectionHandlerAt(index);
19192         var promise = follower._promiseAt(index);
19193         var receiver = follower._receiverAt(index);
19194         if (receiver === void 0)
19195           receiver = UNDEFINED_BINDING;
19196         this._addCallbacks(fulfill, reject, promise, receiver, null);
19197       };
19198       Promise2.prototype._addCallbacks = function(fulfill, reject, promise, receiver, domain) {
19199         var index = this._length();
19200         if (index >= 65535 - 4) {
19201           index = 0;
19202           this._setLength(0);
19203         }
19204         if (index === 0) {
19205           this._promise0 = promise;
19206           this._receiver0 = receiver;
19207           if (typeof fulfill === "function") {
19208             this._fulfillmentHandler0 = domain === null ? fulfill : util.domainBind(domain, fulfill);
19209           }
19210           if (typeof reject === "function") {
19211             this._rejectionHandler0 = domain === null ? reject : util.domainBind(domain, reject);
19212           }
19213         } else {
19214           var base = index * 4 - 4;
19215           this[base + 2] = promise;
19216           this[base + 3] = receiver;
19217           if (typeof fulfill === "function") {
19218             this[base + 0] = domain === null ? fulfill : util.domainBind(domain, fulfill);
19219           }
19220           if (typeof reject === "function") {
19221             this[base + 1] = domain === null ? reject : util.domainBind(domain, reject);
19222           }
19223         }
19224         this._setLength(index + 1);
19225         return index;
19226       };
19227       Promise2.prototype._proxy = function(proxyable, arg) {
19228         this._addCallbacks(void 0, void 0, arg, proxyable, null);
19229       };
19230       Promise2.prototype._resolveCallback = function(value, shouldBind) {
19231         if ((this._bitField & 117506048) !== 0)
19232           return;
19233         if (value === this)
19234           return this._rejectCallback(makeSelfResolutionError(), false);
19235         var maybePromise = tryConvertToPromise(value, this);
19236         if (!(maybePromise instanceof Promise2))
19237           return this._fulfill(value);
19238         if (shouldBind)
19239           this._propagateFrom(maybePromise, 2);
19240         var promise = maybePromise._target();
19241         if (promise === this) {
19242           this._reject(makeSelfResolutionError());
19243           return;
19244         }
19245         var bitField = promise._bitField;
19246         if ((bitField & 50397184) === 0) {
19247           var len = this._length();
19248           if (len > 0)
19249             promise._migrateCallback0(this);
19250           for (var i = 1; i < len; ++i) {
19251             promise._migrateCallbackAt(this, i);
19252           }
19253           this._setFollowing();
19254           this._setLength(0);
19255           this._setFollowee(promise);
19256         } else if ((bitField & 33554432) !== 0) {
19257           this._fulfill(promise._value());
19258         } else if ((bitField & 16777216) !== 0) {
19259           this._reject(promise._reason());
19260         } else {
19261           var reason = new CancellationError("late cancellation observer");
19262           promise._attachExtraTrace(reason);
19263           this._reject(reason);
19264         }
19265       };
19266       Promise2.prototype._rejectCallback = function(reason, synchronous, ignoreNonErrorWarnings) {
19267         var trace = util.ensureErrorObject(reason);
19268         var hasStack = trace === reason;
19269         if (!hasStack && !ignoreNonErrorWarnings && debug.warnings()) {
19270           var message = "a promise was rejected with a non-error: " + util.classString(reason);
19271           this._warn(message, true);
19272         }
19273         this._attachExtraTrace(trace, synchronous ? hasStack : false);
19274         this._reject(reason);
19275       };
19276       Promise2.prototype._resolveFromExecutor = function(executor) {
19277         var promise = this;
19278         this._captureStackTrace();
19279         this._pushContext();
19280         var synchronous = true;
19281         var r = this._execute(executor, function(value) {
19282           promise._resolveCallback(value);
19283         }, function(reason) {
19284           promise._rejectCallback(reason, synchronous);
19285         });
19286         synchronous = false;
19287         this._popContext();
19288         if (r !== void 0) {
19289           promise._rejectCallback(r, true);
19290         }
19291       };
19292       Promise2.prototype._settlePromiseFromHandler = function(handler, receiver, value, promise) {
19293         var bitField = promise._bitField;
19294         if ((bitField & 65536) !== 0)
19295           return;
19296         promise._pushContext();
19297         var x;
19298         if (receiver === APPLY) {
19299           if (!value || typeof value.length !== "number") {
19300             x = errorObj2;
19301             x.e = new TypeError2("cannot .spread() a non-array: " + util.classString(value));
19302           } else {
19303             x = tryCatch2(handler).apply(this._boundValue(), value);
19304           }
19305         } else {
19306           x = tryCatch2(handler).call(receiver, value);
19307         }
19308         var promiseCreated = promise._popContext();
19309         bitField = promise._bitField;
19310         if ((bitField & 65536) !== 0)
19311           return;
19312         if (x === NEXT_FILTER) {
19313           promise._reject(value);
19314         } else if (x === errorObj2) {
19315           promise._rejectCallback(x.e, false);
19316         } else {
19317           debug.checkForgottenReturns(x, promiseCreated, "", promise, this);
19318           promise._resolveCallback(x);
19319         }
19320       };
19321       Promise2.prototype._target = function() {
19322         var ret2 = this;
19323         while (ret2._isFollowing())
19324           ret2 = ret2._followee();
19325         return ret2;
19326       };
19327       Promise2.prototype._followee = function() {
19328         return this._rejectionHandler0;
19329       };
19330       Promise2.prototype._setFollowee = function(promise) {
19331         this._rejectionHandler0 = promise;
19332       };
19333       Promise2.prototype._settlePromise = function(promise, handler, receiver, value) {
19334         var isPromise = promise instanceof Promise2;
19335         var bitField = this._bitField;
19336         var asyncGuaranteed = (bitField & 134217728) !== 0;
19337         if ((bitField & 65536) !== 0) {
19338           if (isPromise)
19339             promise._invokeInternalOnCancel();
19340           if (receiver instanceof PassThroughHandlerContext && receiver.isFinallyHandler()) {
19341             receiver.cancelPromise = promise;
19342             if (tryCatch2(handler).call(receiver, value) === errorObj2) {
19343               promise._reject(errorObj2.e);
19344             }
19345           } else if (handler === reflectHandler) {
19346             promise._fulfill(reflectHandler.call(receiver));
19347           } else if (receiver instanceof Proxyable) {
19348             receiver._promiseCancelled(promise);
19349           } else if (isPromise || promise instanceof PromiseArray) {
19350             promise._cancel();
19351           } else {
19352             receiver.cancel();
19353           }
19354         } else if (typeof handler === "function") {
19355           if (!isPromise) {
19356             handler.call(receiver, value, promise);
19357           } else {
19358             if (asyncGuaranteed)
19359               promise._setAsyncGuaranteed();
19360             this._settlePromiseFromHandler(handler, receiver, value, promise);
19361           }
19362         } else if (receiver instanceof Proxyable) {
19363           if (!receiver._isResolved()) {
19364             if ((bitField & 33554432) !== 0) {
19365               receiver._promiseFulfilled(value, promise);
19366             } else {
19367               receiver._promiseRejected(value, promise);
19368             }
19369           }
19370         } else if (isPromise) {
19371           if (asyncGuaranteed)
19372             promise._setAsyncGuaranteed();
19373           if ((bitField & 33554432) !== 0) {
19374             promise._fulfill(value);
19375           } else {
19376             promise._reject(value);
19377           }
19378         }
19379       };
19380       Promise2.prototype._settlePromiseLateCancellationObserver = function(ctx) {
19381         var handler = ctx.handler;
19382         var promise = ctx.promise;
19383         var receiver = ctx.receiver;
19384         var value = ctx.value;
19385         if (typeof handler === "function") {
19386           if (!(promise instanceof Promise2)) {
19387             handler.call(receiver, value, promise);
19388           } else {
19389             this._settlePromiseFromHandler(handler, receiver, value, promise);
19390           }
19391         } else if (promise instanceof Promise2) {
19392           promise._reject(value);
19393         }
19394       };
19395       Promise2.prototype._settlePromiseCtx = function(ctx) {
19396         this._settlePromise(ctx.promise, ctx.handler, ctx.receiver, ctx.value);
19397       };
19398       Promise2.prototype._settlePromise0 = function(handler, value, bitField) {
19399         var promise = this._promise0;
19400         var receiver = this._receiverAt(0);
19401         this._promise0 = void 0;
19402         this._receiver0 = void 0;
19403         this._settlePromise(promise, handler, receiver, value);
19404       };
19405       Promise2.prototype._clearCallbackDataAtIndex = function(index) {
19406         var base = index * 4 - 4;
19407         this[base + 2] = this[base + 3] = this[base + 0] = this[base + 1] = void 0;
19408       };
19409       Promise2.prototype._fulfill = function(value) {
19410         var bitField = this._bitField;
19411         if ((bitField & 117506048) >>> 16)
19412           return;
19413         if (value === this) {
19414           var err = makeSelfResolutionError();
19415           this._attachExtraTrace(err);
19416           return this._reject(err);
19417         }
19418         this._setFulfilled();
19419         this._rejectionHandler0 = value;
19420         if ((bitField & 65535) > 0) {
19421           if ((bitField & 134217728) !== 0) {
19422             this._settlePromises();
19423           } else {
19424             async.settlePromises(this);
19425           }
19426         }
19427       };
19428       Promise2.prototype._reject = function(reason) {
19429         var bitField = this._bitField;
19430         if ((bitField & 117506048) >>> 16)
19431           return;
19432         this._setRejected();
19433         this._fulfillmentHandler0 = reason;
19434         if (this._isFinal()) {
19435           return async.fatalError(reason, util.isNode);
19436         }
19437         if ((bitField & 65535) > 0) {
19438           async.settlePromises(this);
19439         } else {
19440           this._ensurePossibleRejectionHandled();
19441         }
19442       };
19443       Promise2.prototype._fulfillPromises = function(len, value) {
19444         for (var i = 1; i < len; i++) {
19445           var handler = this._fulfillmentHandlerAt(i);
19446           var promise = this._promiseAt(i);
19447           var receiver = this._receiverAt(i);
19448           this._clearCallbackDataAtIndex(i);
19449           this._settlePromise(promise, handler, receiver, value);
19450         }
19451       };
19452       Promise2.prototype._rejectPromises = function(len, reason) {
19453         for (var i = 1; i < len; i++) {
19454           var handler = this._rejectionHandlerAt(i);
19455           var promise = this._promiseAt(i);
19456           var receiver = this._receiverAt(i);
19457           this._clearCallbackDataAtIndex(i);
19458           this._settlePromise(promise, handler, receiver, reason);
19459         }
19460       };
19461       Promise2.prototype._settlePromises = function() {
19462         var bitField = this._bitField;
19463         var len = bitField & 65535;
19464         if (len > 0) {
19465           if ((bitField & 16842752) !== 0) {
19466             var reason = this._fulfillmentHandler0;
19467             this._settlePromise0(this._rejectionHandler0, reason, bitField);
19468             this._rejectPromises(len, reason);
19469           } else {
19470             var value = this._rejectionHandler0;
19471             this._settlePromise0(this._fulfillmentHandler0, value, bitField);
19472             this._fulfillPromises(len, value);
19473           }
19474           this._setLength(0);
19475         }
19476         this._clearCancellationData();
19477       };
19478       Promise2.prototype._settledValue = function() {
19479         var bitField = this._bitField;
19480         if ((bitField & 33554432) !== 0) {
19481           return this._rejectionHandler0;
19482         } else if ((bitField & 16777216) !== 0) {
19483           return this._fulfillmentHandler0;
19484         }
19485       };
19486       function deferResolve(v) {
19487         this.promise._resolveCallback(v);
19488       }
19489       function deferReject(v) {
19490         this.promise._rejectCallback(v, false);
19491       }
19492       Promise2.defer = Promise2.pending = function() {
19493         debug.deprecated("Promise.defer", "new Promise");
19494         var promise = new Promise2(INTERNAL2);
19495         return {
19496           promise,
19497           resolve: deferResolve,
19498           reject: deferReject
19499         };
19500       };
19501       util.notEnumerableProp(Promise2, "_makeSelfResolutionError", makeSelfResolutionError);
19502       require_method()(Promise2, INTERNAL2, tryConvertToPromise, apiRejection, debug);
19503       require_bind()(Promise2, INTERNAL2, tryConvertToPromise, debug);
19504       require_cancel()(Promise2, PromiseArray, apiRejection, debug);
19505       require_direct_resolve()(Promise2);
19506       require_synchronous_inspection()(Promise2);
19507       require_join()(Promise2, PromiseArray, tryConvertToPromise, INTERNAL2, async, getDomain);
19508       Promise2.Promise = Promise2;
19509       Promise2.version = "3.4.7";
19510       require_map()(Promise2, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL2, debug);
19511       require_call_get()(Promise2);
19512       require_using()(Promise2, apiRejection, tryConvertToPromise, createContext, INTERNAL2, debug);
19513       require_timers()(Promise2, INTERNAL2, debug);
19514       require_generators()(Promise2, apiRejection, INTERNAL2, tryConvertToPromise, Proxyable, debug);
19515       require_nodeify()(Promise2);
19516       require_promisify()(Promise2, INTERNAL2);
19517       require_props()(Promise2, PromiseArray, tryConvertToPromise, apiRejection);
19518       require_race()(Promise2, INTERNAL2, tryConvertToPromise, apiRejection);
19519       require_reduce()(Promise2, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL2, debug);
19520       require_settle()(Promise2, PromiseArray, debug);
19521       require_some()(Promise2, PromiseArray, apiRejection);
19522       require_filter()(Promise2, INTERNAL2);
19523       require_each()(Promise2, INTERNAL2);
19524       require_any()(Promise2);
19525       util.toFastProperties(Promise2);
19526       util.toFastProperties(Promise2.prototype);
19527       function fillTypes(value) {
19528         var p = new Promise2(INTERNAL2);
19529         p._fulfillmentHandler0 = value;
19530         p._rejectionHandler0 = value;
19531         p._promise0 = value;
19532         p._receiver0 = value;
19533       }
19534       fillTypes({ a: 1 });
19535       fillTypes({ b: 2 });
19536       fillTypes({ c: 3 });
19537       fillTypes(1);
19538       fillTypes(function() {
19539       });
19540       fillTypes(void 0);
19541       fillTypes(false);
19542       fillTypes(new Promise2(INTERNAL2));
19543       debug.setBounds(Async.firstLineError, util.lastLineError);
19544       return Promise2;
19545     };
19546   }
19547 });
19548
19549 // node_modules/bluebird/js/release/bluebird.js
19550 var require_bluebird = __commonJS({
19551   "node_modules/bluebird/js/release/bluebird.js"(exports2, module2) {
19552     "use strict";
19553     var old;
19554     if (typeof Promise !== "undefined")
19555       old = Promise;
19556     function noConflict() {
19557       try {
19558         if (Promise === bluebird)
19559           Promise = old;
19560       } catch (e) {
19561       }
19562       return bluebird;
19563     }
19564     var bluebird = require_promise()();
19565     bluebird.noConflict = noConflict;
19566     module2.exports = bluebird;
19567   }
19568 });
19569
19570 // node_modules/unzipper/lib/Buffer.js
19571 var require_Buffer = __commonJS({
19572   "node_modules/unzipper/lib/Buffer.js"(exports2, module2) {
19573     var Buffer2 = require("buffer").Buffer;
19574     if (Buffer2.from === void 0) {
19575       Buffer2.from = function(a, b, c) {
19576         return new Buffer2(a, b, c);
19577       };
19578       Buffer2.alloc = Buffer2.from;
19579     }
19580     module2.exports = Buffer2;
19581   }
19582 });
19583
19584 // node_modules/process-nextick-args/index.js
19585 var require_process_nextick_args = __commonJS({
19586   "node_modules/process-nextick-args/index.js"(exports2, module2) {
19587     "use strict";
19588     if (typeof process === "undefined" || !process.version || process.version.indexOf("v0.") === 0 || process.version.indexOf("v1.") === 0 && process.version.indexOf("v1.8.") !== 0) {
19589       module2.exports = { nextTick };
19590     } else {
19591       module2.exports = process;
19592     }
19593     function nextTick(fn, arg1, arg2, arg3) {
19594       if (typeof fn !== "function") {
19595         throw new TypeError('"callback" argument must be a function');
19596       }
19597       var len = arguments.length;
19598       var args, i;
19599       switch (len) {
19600         case 0:
19601         case 1:
19602           return process.nextTick(fn);
19603         case 2:
19604           return process.nextTick(function afterTickOne() {
19605             fn.call(null, arg1);
19606           });
19607         case 3:
19608           return process.nextTick(function afterTickTwo() {
19609             fn.call(null, arg1, arg2);
19610           });
19611         case 4:
19612           return process.nextTick(function afterTickThree() {
19613             fn.call(null, arg1, arg2, arg3);
19614           });
19615         default:
19616           args = new Array(len - 1);
19617           i = 0;
19618           while (i < args.length) {
19619             args[i++] = arguments[i];
19620           }
19621           return process.nextTick(function afterTick() {
19622             fn.apply(null, args);
19623           });
19624       }
19625     }
19626   }
19627 });
19628
19629 // node_modules/isarray/index.js
19630 var require_isarray = __commonJS({
19631   "node_modules/isarray/index.js"(exports2, module2) {
19632     var toString = {}.toString;
19633     module2.exports = Array.isArray || function(arr) {
19634       return toString.call(arr) == "[object Array]";
19635     };
19636   }
19637 });
19638
19639 // node_modules/readable-stream/lib/internal/streams/stream.js
19640 var require_stream = __commonJS({
19641   "node_modules/readable-stream/lib/internal/streams/stream.js"(exports2, module2) {
19642     module2.exports = require("stream");
19643   }
19644 });
19645
19646 // node_modules/safe-buffer/index.js
19647 var require_safe_buffer = __commonJS({
19648   "node_modules/safe-buffer/index.js"(exports2, module2) {
19649     var buffer = require("buffer");
19650     var Buffer2 = buffer.Buffer;
19651     function copyProps(src, dst) {
19652       for (var key in src) {
19653         dst[key] = src[key];
19654       }
19655     }
19656     if (Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow) {
19657       module2.exports = buffer;
19658     } else {
19659       copyProps(buffer, exports2);
19660       exports2.Buffer = SafeBuffer;
19661     }
19662     function SafeBuffer(arg, encodingOrOffset, length) {
19663       return Buffer2(arg, encodingOrOffset, length);
19664     }
19665     copyProps(Buffer2, SafeBuffer);
19666     SafeBuffer.from = function(arg, encodingOrOffset, length) {
19667       if (typeof arg === "number") {
19668         throw new TypeError("Argument must not be a number");
19669       }
19670       return Buffer2(arg, encodingOrOffset, length);
19671     };
19672     SafeBuffer.alloc = function(size, fill, encoding) {
19673       if (typeof size !== "number") {
19674         throw new TypeError("Argument must be a number");
19675       }
19676       var buf = Buffer2(size);
19677       if (fill !== void 0) {
19678         if (typeof encoding === "string") {
19679           buf.fill(fill, encoding);
19680         } else {
19681           buf.fill(fill);
19682         }
19683       } else {
19684         buf.fill(0);
19685       }
19686       return buf;
19687     };
19688     SafeBuffer.allocUnsafe = function(size) {
19689       if (typeof size !== "number") {
19690         throw new TypeError("Argument must be a number");
19691       }
19692       return Buffer2(size);
19693     };
19694     SafeBuffer.allocUnsafeSlow = function(size) {
19695       if (typeof size !== "number") {
19696         throw new TypeError("Argument must be a number");
19697       }
19698       return buffer.SlowBuffer(size);
19699     };
19700   }
19701 });
19702
19703 // node_modules/core-util-is/lib/util.js
19704 var require_util2 = __commonJS({
19705   "node_modules/core-util-is/lib/util.js"(exports2) {
19706     function isArray(arg) {
19707       if (Array.isArray) {
19708         return Array.isArray(arg);
19709       }
19710       return objectToString(arg) === "[object Array]";
19711     }
19712     exports2.isArray = isArray;
19713     function isBoolean(arg) {
19714       return typeof arg === "boolean";
19715     }
19716     exports2.isBoolean = isBoolean;
19717     function isNull(arg) {
19718       return arg === null;
19719     }
19720     exports2.isNull = isNull;
19721     function isNullOrUndefined(arg) {
19722       return arg == null;
19723     }
19724     exports2.isNullOrUndefined = isNullOrUndefined;
19725     function isNumber(arg) {
19726       return typeof arg === "number";
19727     }
19728     exports2.isNumber = isNumber;
19729     function isString(arg) {
19730       return typeof arg === "string";
19731     }
19732     exports2.isString = isString;
19733     function isSymbol(arg) {
19734       return typeof arg === "symbol";
19735     }
19736     exports2.isSymbol = isSymbol;
19737     function isUndefined(arg) {
19738       return arg === void 0;
19739     }
19740     exports2.isUndefined = isUndefined;
19741     function isRegExp(re) {
19742       return objectToString(re) === "[object RegExp]";
19743     }
19744     exports2.isRegExp = isRegExp;
19745     function isObject2(arg) {
19746       return typeof arg === "object" && arg !== null;
19747     }
19748     exports2.isObject = isObject2;
19749     function isDate(d) {
19750       return objectToString(d) === "[object Date]";
19751     }
19752     exports2.isDate = isDate;
19753     function isError2(e) {
19754       return objectToString(e) === "[object Error]" || e instanceof Error;
19755     }
19756     exports2.isError = isError2;
19757     function isFunction(arg) {
19758       return typeof arg === "function";
19759     }
19760     exports2.isFunction = isFunction;
19761     function isPrimitive2(arg) {
19762       return arg === null || typeof arg === "boolean" || typeof arg === "number" || typeof arg === "string" || typeof arg === "symbol" || typeof arg === "undefined";
19763     }
19764     exports2.isPrimitive = isPrimitive2;
19765     exports2.isBuffer = Buffer.isBuffer;
19766     function objectToString(o) {
19767       return Object.prototype.toString.call(o);
19768     }
19769   }
19770 });
19771
19772 // node_modules/readable-stream/lib/internal/streams/BufferList.js
19773 var require_BufferList = __commonJS({
19774   "node_modules/readable-stream/lib/internal/streams/BufferList.js"(exports2, module2) {
19775     "use strict";
19776     function _classCallCheck(instance, Constructor) {
19777       if (!(instance instanceof Constructor)) {
19778         throw new TypeError("Cannot call a class as a function");
19779       }
19780     }
19781     var Buffer2 = require_safe_buffer().Buffer;
19782     var util = require("util");
19783     function copyBuffer(src, target, offset) {
19784       src.copy(target, offset);
19785     }
19786     module2.exports = function() {
19787       function BufferList() {
19788         _classCallCheck(this, BufferList);
19789         this.head = null;
19790         this.tail = null;
19791         this.length = 0;
19792       }
19793       BufferList.prototype.push = function push(v) {
19794         var entry = { data: v, next: null };
19795         if (this.length > 0)
19796           this.tail.next = entry;
19797         else
19798           this.head = entry;
19799         this.tail = entry;
19800         ++this.length;
19801       };
19802       BufferList.prototype.unshift = function unshift(v) {
19803         var entry = { data: v, next: this.head };
19804         if (this.length === 0)
19805           this.tail = entry;
19806         this.head = entry;
19807         ++this.length;
19808       };
19809       BufferList.prototype.shift = function shift() {
19810         if (this.length === 0)
19811           return;
19812         var ret2 = this.head.data;
19813         if (this.length === 1)
19814           this.head = this.tail = null;
19815         else
19816           this.head = this.head.next;
19817         --this.length;
19818         return ret2;
19819       };
19820       BufferList.prototype.clear = function clear() {
19821         this.head = this.tail = null;
19822         this.length = 0;
19823       };
19824       BufferList.prototype.join = function join2(s) {
19825         if (this.length === 0)
19826           return "";
19827         var p = this.head;
19828         var ret2 = "" + p.data;
19829         while (p = p.next) {
19830           ret2 += s + p.data;
19831         }
19832         return ret2;
19833       };
19834       BufferList.prototype.concat = function concat(n) {
19835         if (this.length === 0)
19836           return Buffer2.alloc(0);
19837         if (this.length === 1)
19838           return this.head.data;
19839         var ret2 = Buffer2.allocUnsafe(n >>> 0);
19840         var p = this.head;
19841         var i = 0;
19842         while (p) {
19843           copyBuffer(p.data, ret2, i);
19844           i += p.data.length;
19845           p = p.next;
19846         }
19847         return ret2;
19848       };
19849       return BufferList;
19850     }();
19851     if (util && util.inspect && util.inspect.custom) {
19852       module2.exports.prototype[util.inspect.custom] = function() {
19853         var obj2 = util.inspect({ length: this.length });
19854         return this.constructor.name + " " + obj2;
19855       };
19856     }
19857   }
19858 });
19859
19860 // node_modules/readable-stream/lib/internal/streams/destroy.js
19861 var require_destroy = __commonJS({
19862   "node_modules/readable-stream/lib/internal/streams/destroy.js"(exports2, module2) {
19863     "use strict";
19864     var pna = require_process_nextick_args();
19865     function destroy(err, cb) {
19866       var _this = this;
19867       var readableDestroyed = this._readableState && this._readableState.destroyed;
19868       var writableDestroyed = this._writableState && this._writableState.destroyed;
19869       if (readableDestroyed || writableDestroyed) {
19870         if (cb) {
19871           cb(err);
19872         } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {
19873           pna.nextTick(emitErrorNT, this, err);
19874         }
19875         return this;
19876       }
19877       if (this._readableState) {
19878         this._readableState.destroyed = true;
19879       }
19880       if (this._writableState) {
19881         this._writableState.destroyed = true;
19882       }
19883       this._destroy(err || null, function(err2) {
19884         if (!cb && err2) {
19885           pna.nextTick(emitErrorNT, _this, err2);
19886           if (_this._writableState) {
19887             _this._writableState.errorEmitted = true;
19888           }
19889         } else if (cb) {
19890           cb(err2);
19891         }
19892       });
19893       return this;
19894     }
19895     function undestroy() {
19896       if (this._readableState) {
19897         this._readableState.destroyed = false;
19898         this._readableState.reading = false;
19899         this._readableState.ended = false;
19900         this._readableState.endEmitted = false;
19901       }
19902       if (this._writableState) {
19903         this._writableState.destroyed = false;
19904         this._writableState.ended = false;
19905         this._writableState.ending = false;
19906         this._writableState.finished = false;
19907         this._writableState.errorEmitted = false;
19908       }
19909     }
19910     function emitErrorNT(self2, err) {
19911       self2.emit("error", err);
19912     }
19913     module2.exports = {
19914       destroy,
19915       undestroy
19916     };
19917   }
19918 });
19919
19920 // node_modules/util-deprecate/node.js
19921 var require_node2 = __commonJS({
19922   "node_modules/util-deprecate/node.js"(exports2, module2) {
19923     module2.exports = require("util").deprecate;
19924   }
19925 });
19926
19927 // node_modules/readable-stream/lib/_stream_writable.js
19928 var require_stream_writable = __commonJS({
19929   "node_modules/readable-stream/lib/_stream_writable.js"(exports2, module2) {
19930     "use strict";
19931     var pna = require_process_nextick_args();
19932     module2.exports = Writable;
19933     function CorkedRequest(state) {
19934       var _this = this;
19935       this.next = null;
19936       this.entry = null;
19937       this.finish = function() {
19938         onCorkedFinish(_this, state);
19939       };
19940     }
19941     var asyncWrite = !process.browser && ["v0.10", "v0.9."].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;
19942     var Duplex;
19943     Writable.WritableState = WritableState;
19944     var util = Object.create(require_util2());
19945     util.inherits = require_inherits();
19946     var internalUtil = {
19947       deprecate: require_node2()
19948     };
19949     var Stream2 = require_stream();
19950     var Buffer2 = require_safe_buffer().Buffer;
19951     var OurUint8Array = global.Uint8Array || function() {
19952     };
19953     function _uint8ArrayToBuffer(chunk) {
19954       return Buffer2.from(chunk);
19955     }
19956     function _isUint8Array(obj2) {
19957       return Buffer2.isBuffer(obj2) || obj2 instanceof OurUint8Array;
19958     }
19959     var destroyImpl = require_destroy();
19960     util.inherits(Writable, Stream2);
19961     function nop() {
19962     }
19963     function WritableState(options, stream) {
19964       Duplex = Duplex || require_stream_duplex();
19965       options = options || {};
19966       var isDuplex = stream instanceof Duplex;
19967       this.objectMode = !!options.objectMode;
19968       if (isDuplex)
19969         this.objectMode = this.objectMode || !!options.writableObjectMode;
19970       var hwm = options.highWaterMark;
19971       var writableHwm = options.writableHighWaterMark;
19972       var defaultHwm = this.objectMode ? 16 : 16 * 1024;
19973       if (hwm || hwm === 0)
19974         this.highWaterMark = hwm;
19975       else if (isDuplex && (writableHwm || writableHwm === 0))
19976         this.highWaterMark = writableHwm;
19977       else
19978         this.highWaterMark = defaultHwm;
19979       this.highWaterMark = Math.floor(this.highWaterMark);
19980       this.finalCalled = false;
19981       this.needDrain = false;
19982       this.ending = false;
19983       this.ended = false;
19984       this.finished = false;
19985       this.destroyed = false;
19986       var noDecode = options.decodeStrings === false;
19987       this.decodeStrings = !noDecode;
19988       this.defaultEncoding = options.defaultEncoding || "utf8";
19989       this.length = 0;
19990       this.writing = false;
19991       this.corked = 0;
19992       this.sync = true;
19993       this.bufferProcessing = false;
19994       this.onwrite = function(er) {
19995         onwrite(stream, er);
19996       };
19997       this.writecb = null;
19998       this.writelen = 0;
19999       this.bufferedRequest = null;
20000       this.lastBufferedRequest = null;
20001       this.pendingcb = 0;
20002       this.prefinished = false;
20003       this.errorEmitted = false;
20004       this.bufferedRequestCount = 0;
20005       this.corkedRequestsFree = new CorkedRequest(this);
20006     }
20007     WritableState.prototype.getBuffer = function getBuffer() {
20008       var current = this.bufferedRequest;
20009       var out = [];
20010       while (current) {
20011         out.push(current);
20012         current = current.next;
20013       }
20014       return out;
20015     };
20016     (function() {
20017       try {
20018         Object.defineProperty(WritableState.prototype, "buffer", {
20019           get: internalUtil.deprecate(function() {
20020             return this.getBuffer();
20021           }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003")
20022         });
20023       } catch (_) {
20024       }
20025     })();
20026     var realHasInstance;
20027     if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") {
20028       realHasInstance = Function.prototype[Symbol.hasInstance];
20029       Object.defineProperty(Writable, Symbol.hasInstance, {
20030         value: function(object) {
20031           if (realHasInstance.call(this, object))
20032             return true;
20033           if (this !== Writable)
20034             return false;
20035           return object && object._writableState instanceof WritableState;
20036         }
20037       });
20038     } else {
20039       realHasInstance = function(object) {
20040         return object instanceof this;
20041       };
20042     }
20043     function Writable(options) {
20044       Duplex = Duplex || require_stream_duplex();
20045       if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
20046         return new Writable(options);
20047       }
20048       this._writableState = new WritableState(options, this);
20049       this.writable = true;
20050       if (options) {
20051         if (typeof options.write === "function")
20052           this._write = options.write;
20053         if (typeof options.writev === "function")
20054           this._writev = options.writev;
20055         if (typeof options.destroy === "function")
20056           this._destroy = options.destroy;
20057         if (typeof options.final === "function")
20058           this._final = options.final;
20059       }
20060       Stream2.call(this);
20061     }
20062     Writable.prototype.pipe = function() {
20063       this.emit("error", new Error("Cannot pipe, not readable"));
20064     };
20065     function writeAfterEnd(stream, cb) {
20066       var er = new Error("write after end");
20067       stream.emit("error", er);
20068       pna.nextTick(cb, er);
20069     }
20070     function validChunk(stream, state, chunk, cb) {
20071       var valid = true;
20072       var er = false;
20073       if (chunk === null) {
20074         er = new TypeError("May not write null values to stream");
20075       } else if (typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) {
20076         er = new TypeError("Invalid non-string/buffer chunk");
20077       }
20078       if (er) {
20079         stream.emit("error", er);
20080         pna.nextTick(cb, er);
20081         valid = false;
20082       }
20083       return valid;
20084     }
20085     Writable.prototype.write = function(chunk, encoding, cb) {
20086       var state = this._writableState;
20087       var ret2 = false;
20088       var isBuf = !state.objectMode && _isUint8Array(chunk);
20089       if (isBuf && !Buffer2.isBuffer(chunk)) {
20090         chunk = _uint8ArrayToBuffer(chunk);
20091       }
20092       if (typeof encoding === "function") {
20093         cb = encoding;
20094         encoding = null;
20095       }
20096       if (isBuf)
20097         encoding = "buffer";
20098       else if (!encoding)
20099         encoding = state.defaultEncoding;
20100       if (typeof cb !== "function")
20101         cb = nop;
20102       if (state.ended)
20103         writeAfterEnd(this, cb);
20104       else if (isBuf || validChunk(this, state, chunk, cb)) {
20105         state.pendingcb++;
20106         ret2 = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
20107       }
20108       return ret2;
20109     };
20110     Writable.prototype.cork = function() {
20111       var state = this._writableState;
20112       state.corked++;
20113     };
20114     Writable.prototype.uncork = function() {
20115       var state = this._writableState;
20116       if (state.corked) {
20117         state.corked--;
20118         if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest)
20119           clearBuffer(this, state);
20120       }
20121     };
20122     Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
20123       if (typeof encoding === "string")
20124         encoding = encoding.toLowerCase();
20125       if (!(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((encoding + "").toLowerCase()) > -1))
20126         throw new TypeError("Unknown encoding: " + encoding);
20127       this._writableState.defaultEncoding = encoding;
20128       return this;
20129     };
20130     function decodeChunk(state, chunk, encoding) {
20131       if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") {
20132         chunk = Buffer2.from(chunk, encoding);
20133       }
20134       return chunk;
20135     }
20136     Object.defineProperty(Writable.prototype, "writableHighWaterMark", {
20137       enumerable: false,
20138       get: function() {
20139         return this._writableState.highWaterMark;
20140       }
20141     });
20142     function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
20143       if (!isBuf) {
20144         var newChunk = decodeChunk(state, chunk, encoding);
20145         if (chunk !== newChunk) {
20146           isBuf = true;
20147           encoding = "buffer";
20148           chunk = newChunk;
20149         }
20150       }
20151       var len = state.objectMode ? 1 : chunk.length;
20152       state.length += len;
20153       var ret2 = state.length < state.highWaterMark;
20154       if (!ret2)
20155         state.needDrain = true;
20156       if (state.writing || state.corked) {
20157         var last = state.lastBufferedRequest;
20158         state.lastBufferedRequest = {
20159           chunk,
20160           encoding,
20161           isBuf,
20162           callback: cb,
20163           next: null
20164         };
20165         if (last) {
20166           last.next = state.lastBufferedRequest;
20167         } else {
20168           state.bufferedRequest = state.lastBufferedRequest;
20169         }
20170         state.bufferedRequestCount += 1;
20171       } else {
20172         doWrite(stream, state, false, len, chunk, encoding, cb);
20173       }
20174       return ret2;
20175     }
20176     function doWrite(stream, state, writev, len, chunk, encoding, cb) {
20177       state.writelen = len;
20178       state.writecb = cb;
20179       state.writing = true;
20180       state.sync = true;
20181       if (writev)
20182         stream._writev(chunk, state.onwrite);
20183       else
20184         stream._write(chunk, encoding, state.onwrite);
20185       state.sync = false;
20186     }
20187     function onwriteError(stream, state, sync, er, cb) {
20188       --state.pendingcb;
20189       if (sync) {
20190         pna.nextTick(cb, er);
20191         pna.nextTick(finishMaybe, stream, state);
20192         stream._writableState.errorEmitted = true;
20193         stream.emit("error", er);
20194       } else {
20195         cb(er);
20196         stream._writableState.errorEmitted = true;
20197         stream.emit("error", er);
20198         finishMaybe(stream, state);
20199       }
20200     }
20201     function onwriteStateUpdate(state) {
20202       state.writing = false;
20203       state.writecb = null;
20204       state.length -= state.writelen;
20205       state.writelen = 0;
20206     }
20207     function onwrite(stream, er) {
20208       var state = stream._writableState;
20209       var sync = state.sync;
20210       var cb = state.writecb;
20211       onwriteStateUpdate(state);
20212       if (er)
20213         onwriteError(stream, state, sync, er, cb);
20214       else {
20215         var finished = needFinish(state);
20216         if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
20217           clearBuffer(stream, state);
20218         }
20219         if (sync) {
20220           asyncWrite(afterWrite, stream, state, finished, cb);
20221         } else {
20222           afterWrite(stream, state, finished, cb);
20223         }
20224       }
20225     }
20226     function afterWrite(stream, state, finished, cb) {
20227       if (!finished)
20228         onwriteDrain(stream, state);
20229       state.pendingcb--;
20230       cb();
20231       finishMaybe(stream, state);
20232     }
20233     function onwriteDrain(stream, state) {
20234       if (state.length === 0 && state.needDrain) {
20235         state.needDrain = false;
20236         stream.emit("drain");
20237       }
20238     }
20239     function clearBuffer(stream, state) {
20240       state.bufferProcessing = true;
20241       var entry = state.bufferedRequest;
20242       if (stream._writev && entry && entry.next) {
20243         var l2 = state.bufferedRequestCount;
20244         var buffer = new Array(l2);
20245         var holder = state.corkedRequestsFree;
20246         holder.entry = entry;
20247         var count = 0;
20248         var allBuffers = true;
20249         while (entry) {
20250           buffer[count] = entry;
20251           if (!entry.isBuf)
20252             allBuffers = false;
20253           entry = entry.next;
20254           count += 1;
20255         }
20256         buffer.allBuffers = allBuffers;
20257         doWrite(stream, state, true, state.length, buffer, "", holder.finish);
20258         state.pendingcb++;
20259         state.lastBufferedRequest = null;
20260         if (holder.next) {
20261           state.corkedRequestsFree = holder.next;
20262           holder.next = null;
20263         } else {
20264           state.corkedRequestsFree = new CorkedRequest(state);
20265         }
20266         state.bufferedRequestCount = 0;
20267       } else {
20268         while (entry) {
20269           var chunk = entry.chunk;
20270           var encoding = entry.encoding;
20271           var cb = entry.callback;
20272           var len = state.objectMode ? 1 : chunk.length;
20273           doWrite(stream, state, false, len, chunk, encoding, cb);
20274           entry = entry.next;
20275           state.bufferedRequestCount--;
20276           if (state.writing) {
20277             break;
20278           }
20279         }
20280         if (entry === null)
20281           state.lastBufferedRequest = null;
20282       }
20283       state.bufferedRequest = entry;
20284       state.bufferProcessing = false;
20285     }
20286     Writable.prototype._write = function(chunk, encoding, cb) {
20287       cb(new Error("_write() is not implemented"));
20288     };
20289     Writable.prototype._writev = null;
20290     Writable.prototype.end = function(chunk, encoding, cb) {
20291       var state = this._writableState;
20292       if (typeof chunk === "function") {
20293         cb = chunk;
20294         chunk = null;
20295         encoding = null;
20296       } else if (typeof encoding === "function") {
20297         cb = encoding;
20298         encoding = null;
20299       }
20300       if (chunk !== null && chunk !== void 0)
20301         this.write(chunk, encoding);
20302       if (state.corked) {
20303         state.corked = 1;
20304         this.uncork();
20305       }
20306       if (!state.ending && !state.finished)
20307         endWritable(this, state, cb);
20308     };
20309     function needFinish(state) {
20310       return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
20311     }
20312     function callFinal(stream, state) {
20313       stream._final(function(err) {
20314         state.pendingcb--;
20315         if (err) {
20316           stream.emit("error", err);
20317         }
20318         state.prefinished = true;
20319         stream.emit("prefinish");
20320         finishMaybe(stream, state);
20321       });
20322     }
20323     function prefinish(stream, state) {
20324       if (!state.prefinished && !state.finalCalled) {
20325         if (typeof stream._final === "function") {
20326           state.pendingcb++;
20327           state.finalCalled = true;
20328           pna.nextTick(callFinal, stream, state);
20329         } else {
20330           state.prefinished = true;
20331           stream.emit("prefinish");
20332         }
20333       }
20334     }
20335     function finishMaybe(stream, state) {
20336       var need = needFinish(state);
20337       if (need) {
20338         prefinish(stream, state);
20339         if (state.pendingcb === 0) {
20340           state.finished = true;
20341           stream.emit("finish");
20342         }
20343       }
20344       return need;
20345     }
20346     function endWritable(stream, state, cb) {
20347       state.ending = true;
20348       finishMaybe(stream, state);
20349       if (cb) {
20350         if (state.finished)
20351           pna.nextTick(cb);
20352         else
20353           stream.once("finish", cb);
20354       }
20355       state.ended = true;
20356       stream.writable = false;
20357     }
20358     function onCorkedFinish(corkReq, state, err) {
20359       var entry = corkReq.entry;
20360       corkReq.entry = null;
20361       while (entry) {
20362         var cb = entry.callback;
20363         state.pendingcb--;
20364         cb(err);
20365         entry = entry.next;
20366       }
20367       if (state.corkedRequestsFree) {
20368         state.corkedRequestsFree.next = corkReq;
20369       } else {
20370         state.corkedRequestsFree = corkReq;
20371       }
20372     }
20373     Object.defineProperty(Writable.prototype, "destroyed", {
20374       get: function() {
20375         if (this._writableState === void 0) {
20376           return false;
20377         }
20378         return this._writableState.destroyed;
20379       },
20380       set: function(value) {
20381         if (!this._writableState) {
20382           return;
20383         }
20384         this._writableState.destroyed = value;
20385       }
20386     });
20387     Writable.prototype.destroy = destroyImpl.destroy;
20388     Writable.prototype._undestroy = destroyImpl.undestroy;
20389     Writable.prototype._destroy = function(err, cb) {
20390       this.end();
20391       cb(err);
20392     };
20393   }
20394 });
20395
20396 // node_modules/readable-stream/lib/_stream_duplex.js
20397 var require_stream_duplex = __commonJS({
20398   "node_modules/readable-stream/lib/_stream_duplex.js"(exports2, module2) {
20399     "use strict";
20400     var pna = require_process_nextick_args();
20401     var objectKeys = Object.keys || function(obj2) {
20402       var keys2 = [];
20403       for (var key in obj2) {
20404         keys2.push(key);
20405       }
20406       return keys2;
20407     };
20408     module2.exports = Duplex;
20409     var util = Object.create(require_util2());
20410     util.inherits = require_inherits();
20411     var Readable2 = require_stream_readable();
20412     var Writable = require_stream_writable();
20413     util.inherits(Duplex, Readable2);
20414     {
20415       keys = objectKeys(Writable.prototype);
20416       for (v = 0; v < keys.length; v++) {
20417         method = keys[v];
20418         if (!Duplex.prototype[method])
20419           Duplex.prototype[method] = Writable.prototype[method];
20420       }
20421     }
20422     var keys;
20423     var method;
20424     var v;
20425     function Duplex(options) {
20426       if (!(this instanceof Duplex))
20427         return new Duplex(options);
20428       Readable2.call(this, options);
20429       Writable.call(this, options);
20430       if (options && options.readable === false)
20431         this.readable = false;
20432       if (options && options.writable === false)
20433         this.writable = false;
20434       this.allowHalfOpen = true;
20435       if (options && options.allowHalfOpen === false)
20436         this.allowHalfOpen = false;
20437       this.once("end", onend);
20438     }
20439     Object.defineProperty(Duplex.prototype, "writableHighWaterMark", {
20440       enumerable: false,
20441       get: function() {
20442         return this._writableState.highWaterMark;
20443       }
20444     });
20445     function onend() {
20446       if (this.allowHalfOpen || this._writableState.ended)
20447         return;
20448       pna.nextTick(onEndNT, this);
20449     }
20450     function onEndNT(self2) {
20451       self2.end();
20452     }
20453     Object.defineProperty(Duplex.prototype, "destroyed", {
20454       get: function() {
20455         if (this._readableState === void 0 || this._writableState === void 0) {
20456           return false;
20457         }
20458         return this._readableState.destroyed && this._writableState.destroyed;
20459       },
20460       set: function(value) {
20461         if (this._readableState === void 0 || this._writableState === void 0) {
20462           return;
20463         }
20464         this._readableState.destroyed = value;
20465         this._writableState.destroyed = value;
20466       }
20467     });
20468     Duplex.prototype._destroy = function(err, cb) {
20469       this.push(null);
20470       this.end();
20471       pna.nextTick(cb, err);
20472     };
20473   }
20474 });
20475
20476 // node_modules/readable-stream/lib/_stream_readable.js
20477 var require_stream_readable = __commonJS({
20478   "node_modules/readable-stream/lib/_stream_readable.js"(exports2, module2) {
20479     "use strict";
20480     var pna = require_process_nextick_args();
20481     module2.exports = Readable2;
20482     var isArray = require_isarray();
20483     var Duplex;
20484     Readable2.ReadableState = ReadableState;
20485     var EE = require("events").EventEmitter;
20486     var EElistenerCount = function(emitter, type) {
20487       return emitter.listeners(type).length;
20488     };
20489     var Stream2 = require_stream();
20490     var Buffer2 = require_safe_buffer().Buffer;
20491     var OurUint8Array = global.Uint8Array || function() {
20492     };
20493     function _uint8ArrayToBuffer(chunk) {
20494       return Buffer2.from(chunk);
20495     }
20496     function _isUint8Array(obj2) {
20497       return Buffer2.isBuffer(obj2) || obj2 instanceof OurUint8Array;
20498     }
20499     var util = Object.create(require_util2());
20500     util.inherits = require_inherits();
20501     var debugUtil = require("util");
20502     var debug = void 0;
20503     if (debugUtil && debugUtil.debuglog) {
20504       debug = debugUtil.debuglog("stream");
20505     } else {
20506       debug = function() {
20507       };
20508     }
20509     var BufferList = require_BufferList();
20510     var destroyImpl = require_destroy();
20511     var StringDecoder;
20512     util.inherits(Readable2, Stream2);
20513     var kProxyEvents = ["error", "close", "destroy", "pause", "resume"];
20514     function prependListener(emitter, event, fn) {
20515       if (typeof emitter.prependListener === "function")
20516         return emitter.prependListener(event, fn);
20517       if (!emitter._events || !emitter._events[event])
20518         emitter.on(event, fn);
20519       else if (isArray(emitter._events[event]))
20520         emitter._events[event].unshift(fn);
20521       else
20522         emitter._events[event] = [fn, emitter._events[event]];
20523     }
20524     function ReadableState(options, stream) {
20525       Duplex = Duplex || require_stream_duplex();
20526       options = options || {};
20527       var isDuplex = stream instanceof Duplex;
20528       this.objectMode = !!options.objectMode;
20529       if (isDuplex)
20530         this.objectMode = this.objectMode || !!options.readableObjectMode;
20531       var hwm = options.highWaterMark;
20532       var readableHwm = options.readableHighWaterMark;
20533       var defaultHwm = this.objectMode ? 16 : 16 * 1024;
20534       if (hwm || hwm === 0)
20535         this.highWaterMark = hwm;
20536       else if (isDuplex && (readableHwm || readableHwm === 0))
20537         this.highWaterMark = readableHwm;
20538       else
20539         this.highWaterMark = defaultHwm;
20540       this.highWaterMark = Math.floor(this.highWaterMark);
20541       this.buffer = new BufferList();
20542       this.length = 0;
20543       this.pipes = null;
20544       this.pipesCount = 0;
20545       this.flowing = null;
20546       this.ended = false;
20547       this.endEmitted = false;
20548       this.reading = false;
20549       this.sync = true;
20550       this.needReadable = false;
20551       this.emittedReadable = false;
20552       this.readableListening = false;
20553       this.resumeScheduled = false;
20554       this.destroyed = false;
20555       this.defaultEncoding = options.defaultEncoding || "utf8";
20556       this.awaitDrain = 0;
20557       this.readingMore = false;
20558       this.decoder = null;
20559       this.encoding = null;
20560       if (options.encoding) {
20561         if (!StringDecoder)
20562           StringDecoder = require("string_decoder/").StringDecoder;
20563         this.decoder = new StringDecoder(options.encoding);
20564         this.encoding = options.encoding;
20565       }
20566     }
20567     function Readable2(options) {
20568       Duplex = Duplex || require_stream_duplex();
20569       if (!(this instanceof Readable2))
20570         return new Readable2(options);
20571       this._readableState = new ReadableState(options, this);
20572       this.readable = true;
20573       if (options) {
20574         if (typeof options.read === "function")
20575           this._read = options.read;
20576         if (typeof options.destroy === "function")
20577           this._destroy = options.destroy;
20578       }
20579       Stream2.call(this);
20580     }
20581     Object.defineProperty(Readable2.prototype, "destroyed", {
20582       get: function() {
20583         if (this._readableState === void 0) {
20584           return false;
20585         }
20586         return this._readableState.destroyed;
20587       },
20588       set: function(value) {
20589         if (!this._readableState) {
20590           return;
20591         }
20592         this._readableState.destroyed = value;
20593       }
20594     });
20595     Readable2.prototype.destroy = destroyImpl.destroy;
20596     Readable2.prototype._undestroy = destroyImpl.undestroy;
20597     Readable2.prototype._destroy = function(err, cb) {
20598       this.push(null);
20599       cb(err);
20600     };
20601     Readable2.prototype.push = function(chunk, encoding) {
20602       var state = this._readableState;
20603       var skipChunkCheck;
20604       if (!state.objectMode) {
20605         if (typeof chunk === "string") {
20606           encoding = encoding || state.defaultEncoding;
20607           if (encoding !== state.encoding) {
20608             chunk = Buffer2.from(chunk, encoding);
20609             encoding = "";
20610           }
20611           skipChunkCheck = true;
20612         }
20613       } else {
20614         skipChunkCheck = true;
20615       }
20616       return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
20617     };
20618     Readable2.prototype.unshift = function(chunk) {
20619       return readableAddChunk(this, chunk, null, true, false);
20620     };
20621     function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
20622       var state = stream._readableState;
20623       if (chunk === null) {
20624         state.reading = false;
20625         onEofChunk(stream, state);
20626       } else {
20627         var er;
20628         if (!skipChunkCheck)
20629           er = chunkInvalid(state, chunk);
20630         if (er) {
20631           stream.emit("error", er);
20632         } else if (state.objectMode || chunk && chunk.length > 0) {
20633           if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer2.prototype) {
20634             chunk = _uint8ArrayToBuffer(chunk);
20635           }
20636           if (addToFront) {
20637             if (state.endEmitted)
20638               stream.emit("error", new Error("stream.unshift() after end event"));
20639             else
20640               addChunk(stream, state, chunk, true);
20641           } else if (state.ended) {
20642             stream.emit("error", new Error("stream.push() after EOF"));
20643           } else {
20644             state.reading = false;
20645             if (state.decoder && !encoding) {
20646               chunk = state.decoder.write(chunk);
20647               if (state.objectMode || chunk.length !== 0)
20648                 addChunk(stream, state, chunk, false);
20649               else
20650                 maybeReadMore(stream, state);
20651             } else {
20652               addChunk(stream, state, chunk, false);
20653             }
20654           }
20655         } else if (!addToFront) {
20656           state.reading = false;
20657         }
20658       }
20659       return needMoreData(state);
20660     }
20661     function addChunk(stream, state, chunk, addToFront) {
20662       if (state.flowing && state.length === 0 && !state.sync) {
20663         stream.emit("data", chunk);
20664         stream.read(0);
20665       } else {
20666         state.length += state.objectMode ? 1 : chunk.length;
20667         if (addToFront)
20668           state.buffer.unshift(chunk);
20669         else
20670           state.buffer.push(chunk);
20671         if (state.needReadable)
20672           emitReadable(stream);
20673       }
20674       maybeReadMore(stream, state);
20675     }
20676     function chunkInvalid(state, chunk) {
20677       var er;
20678       if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) {
20679         er = new TypeError("Invalid non-string/buffer chunk");
20680       }
20681       return er;
20682     }
20683     function needMoreData(state) {
20684       return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
20685     }
20686     Readable2.prototype.isPaused = function() {
20687       return this._readableState.flowing === false;
20688     };
20689     Readable2.prototype.setEncoding = function(enc) {
20690       if (!StringDecoder)
20691         StringDecoder = require("string_decoder/").StringDecoder;
20692       this._readableState.decoder = new StringDecoder(enc);
20693       this._readableState.encoding = enc;
20694       return this;
20695     };
20696     var MAX_HWM = 8388608;
20697     function computeNewHighWaterMark(n) {
20698       if (n >= MAX_HWM) {
20699         n = MAX_HWM;
20700       } else {
20701         n--;
20702         n |= n >>> 1;
20703         n |= n >>> 2;
20704         n |= n >>> 4;
20705         n |= n >>> 8;
20706         n |= n >>> 16;
20707         n++;
20708       }
20709       return n;
20710     }
20711     function howMuchToRead(n, state) {
20712       if (n <= 0 || state.length === 0 && state.ended)
20713         return 0;
20714       if (state.objectMode)
20715         return 1;
20716       if (n !== n) {
20717         if (state.flowing && state.length)
20718           return state.buffer.head.data.length;
20719         else
20720           return state.length;
20721       }
20722       if (n > state.highWaterMark)
20723         state.highWaterMark = computeNewHighWaterMark(n);
20724       if (n <= state.length)
20725         return n;
20726       if (!state.ended) {
20727         state.needReadable = true;
20728         return 0;
20729       }
20730       return state.length;
20731     }
20732     Readable2.prototype.read = function(n) {
20733       debug("read", n);
20734       n = parseInt(n, 10);
20735       var state = this._readableState;
20736       var nOrig = n;
20737       if (n !== 0)
20738         state.emittedReadable = false;
20739       if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
20740         debug("read: emitReadable", state.length, state.ended);
20741         if (state.length === 0 && state.ended)
20742           endReadable(this);
20743         else
20744           emitReadable(this);
20745         return null;
20746       }
20747       n = howMuchToRead(n, state);
20748       if (n === 0 && state.ended) {
20749         if (state.length === 0)
20750           endReadable(this);
20751         return null;
20752       }
20753       var doRead = state.needReadable;
20754       debug("need readable", doRead);
20755       if (state.length === 0 || state.length - n < state.highWaterMark) {
20756         doRead = true;
20757         debug("length less than watermark", doRead);
20758       }
20759       if (state.ended || state.reading) {
20760         doRead = false;
20761         debug("reading or ended", doRead);
20762       } else if (doRead) {
20763         debug("do read");
20764         state.reading = true;
20765         state.sync = true;
20766         if (state.length === 0)
20767           state.needReadable = true;
20768         this._read(state.highWaterMark);
20769         state.sync = false;
20770         if (!state.reading)
20771           n = howMuchToRead(nOrig, state);
20772       }
20773       var ret2;
20774       if (n > 0)
20775         ret2 = fromList(n, state);
20776       else
20777         ret2 = null;
20778       if (ret2 === null) {
20779         state.needReadable = true;
20780         n = 0;
20781       } else {
20782         state.length -= n;
20783       }
20784       if (state.length === 0) {
20785         if (!state.ended)
20786           state.needReadable = true;
20787         if (nOrig !== n && state.ended)
20788           endReadable(this);
20789       }
20790       if (ret2 !== null)
20791         this.emit("data", ret2);
20792       return ret2;
20793     };
20794     function onEofChunk(stream, state) {
20795       if (state.ended)
20796         return;
20797       if (state.decoder) {
20798         var chunk = state.decoder.end();
20799         if (chunk && chunk.length) {
20800           state.buffer.push(chunk);
20801           state.length += state.objectMode ? 1 : chunk.length;
20802         }
20803       }
20804       state.ended = true;
20805       emitReadable(stream);
20806     }
20807     function emitReadable(stream) {
20808       var state = stream._readableState;
20809       state.needReadable = false;
20810       if (!state.emittedReadable) {
20811         debug("emitReadable", state.flowing);
20812         state.emittedReadable = true;
20813         if (state.sync)
20814           pna.nextTick(emitReadable_, stream);
20815         else
20816           emitReadable_(stream);
20817       }
20818     }
20819     function emitReadable_(stream) {
20820       debug("emit readable");
20821       stream.emit("readable");
20822       flow(stream);
20823     }
20824     function maybeReadMore(stream, state) {
20825       if (!state.readingMore) {
20826         state.readingMore = true;
20827         pna.nextTick(maybeReadMore_, stream, state);
20828       }
20829     }
20830     function maybeReadMore_(stream, state) {
20831       var len = state.length;
20832       while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
20833         debug("maybeReadMore read 0");
20834         stream.read(0);
20835         if (len === state.length)
20836           break;
20837         else
20838           len = state.length;
20839       }
20840       state.readingMore = false;
20841     }
20842     Readable2.prototype._read = function(n) {
20843       this.emit("error", new Error("_read() is not implemented"));
20844     };
20845     Readable2.prototype.pipe = function(dest, pipeOpts) {
20846       var src = this;
20847       var state = this._readableState;
20848       switch (state.pipesCount) {
20849         case 0:
20850           state.pipes = dest;
20851           break;
20852         case 1:
20853           state.pipes = [state.pipes, dest];
20854           break;
20855         default:
20856           state.pipes.push(dest);
20857           break;
20858       }
20859       state.pipesCount += 1;
20860       debug("pipe count=%d opts=%j", state.pipesCount, pipeOpts);
20861       var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
20862       var endFn = doEnd ? onend : unpipe;
20863       if (state.endEmitted)
20864         pna.nextTick(endFn);
20865       else
20866         src.once("end", endFn);
20867       dest.on("unpipe", onunpipe);
20868       function onunpipe(readable, unpipeInfo) {
20869         debug("onunpipe");
20870         if (readable === src) {
20871           if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
20872             unpipeInfo.hasUnpiped = true;
20873             cleanup();
20874           }
20875         }
20876       }
20877       function onend() {
20878         debug("onend");
20879         dest.end();
20880       }
20881       var ondrain = pipeOnDrain(src);
20882       dest.on("drain", ondrain);
20883       var cleanedUp = false;
20884       function cleanup() {
20885         debug("cleanup");
20886         dest.removeListener("close", onclose);
20887         dest.removeListener("finish", onfinish);
20888         dest.removeListener("drain", ondrain);
20889         dest.removeListener("error", onerror);
20890         dest.removeListener("unpipe", onunpipe);
20891         src.removeListener("end", onend);
20892         src.removeListener("end", unpipe);
20893         src.removeListener("data", ondata);
20894         cleanedUp = true;
20895         if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain))
20896           ondrain();
20897       }
20898       var increasedAwaitDrain = false;
20899       src.on("data", ondata);
20900       function ondata(chunk) {
20901         debug("ondata");
20902         increasedAwaitDrain = false;
20903         var ret2 = dest.write(chunk);
20904         if (ret2 === false && !increasedAwaitDrain) {
20905           if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
20906             debug("false write response, pause", src._readableState.awaitDrain);
20907             src._readableState.awaitDrain++;
20908             increasedAwaitDrain = true;
20909           }
20910           src.pause();
20911         }
20912       }
20913       function onerror(er) {
20914         debug("onerror", er);
20915         unpipe();
20916         dest.removeListener("error", onerror);
20917         if (EElistenerCount(dest, "error") === 0)
20918           dest.emit("error", er);
20919       }
20920       prependListener(dest, "error", onerror);
20921       function onclose() {
20922         dest.removeListener("finish", onfinish);
20923         unpipe();
20924       }
20925       dest.once("close", onclose);
20926       function onfinish() {
20927         debug("onfinish");
20928         dest.removeListener("close", onclose);
20929         unpipe();
20930       }
20931       dest.once("finish", onfinish);
20932       function unpipe() {
20933         debug("unpipe");
20934         src.unpipe(dest);
20935       }
20936       dest.emit("pipe", src);
20937       if (!state.flowing) {
20938         debug("pipe resume");
20939         src.resume();
20940       }
20941       return dest;
20942     };
20943     function pipeOnDrain(src) {
20944       return function() {
20945         var state = src._readableState;
20946         debug("pipeOnDrain", state.awaitDrain);
20947         if (state.awaitDrain)
20948           state.awaitDrain--;
20949         if (state.awaitDrain === 0 && EElistenerCount(src, "data")) {
20950           state.flowing = true;
20951           flow(src);
20952         }
20953       };
20954     }
20955     Readable2.prototype.unpipe = function(dest) {
20956       var state = this._readableState;
20957       var unpipeInfo = { hasUnpiped: false };
20958       if (state.pipesCount === 0)
20959         return this;
20960       if (state.pipesCount === 1) {
20961         if (dest && dest !== state.pipes)
20962           return this;
20963         if (!dest)
20964           dest = state.pipes;
20965         state.pipes = null;
20966         state.pipesCount = 0;
20967         state.flowing = false;
20968         if (dest)
20969           dest.emit("unpipe", this, unpipeInfo);
20970         return this;
20971       }
20972       if (!dest) {
20973         var dests = state.pipes;
20974         var len = state.pipesCount;
20975         state.pipes = null;
20976         state.pipesCount = 0;
20977         state.flowing = false;
20978         for (var i = 0; i < len; i++) {
20979           dests[i].emit("unpipe", this, unpipeInfo);
20980         }
20981         return this;
20982       }
20983       var index = indexOf(state.pipes, dest);
20984       if (index === -1)
20985         return this;
20986       state.pipes.splice(index, 1);
20987       state.pipesCount -= 1;
20988       if (state.pipesCount === 1)
20989         state.pipes = state.pipes[0];
20990       dest.emit("unpipe", this, unpipeInfo);
20991       return this;
20992     };
20993     Readable2.prototype.on = function(ev, fn) {
20994       var res = Stream2.prototype.on.call(this, ev, fn);
20995       if (ev === "data") {
20996         if (this._readableState.flowing !== false)
20997           this.resume();
20998       } else if (ev === "readable") {
20999         var state = this._readableState;
21000         if (!state.endEmitted && !state.readableListening) {
21001           state.readableListening = state.needReadable = true;
21002           state.emittedReadable = false;
21003           if (!state.reading) {
21004             pna.nextTick(nReadingNextTick, this);
21005           } else if (state.length) {
21006             emitReadable(this);
21007           }
21008         }
21009       }
21010       return res;
21011     };
21012     Readable2.prototype.addListener = Readable2.prototype.on;
21013     function nReadingNextTick(self2) {
21014       debug("readable nexttick read 0");
21015       self2.read(0);
21016     }
21017     Readable2.prototype.resume = function() {
21018       var state = this._readableState;
21019       if (!state.flowing) {
21020         debug("resume");
21021         state.flowing = true;
21022         resume(this, state);
21023       }
21024       return this;
21025     };
21026     function resume(stream, state) {
21027       if (!state.resumeScheduled) {
21028         state.resumeScheduled = true;
21029         pna.nextTick(resume_, stream, state);
21030       }
21031     }
21032     function resume_(stream, state) {
21033       if (!state.reading) {
21034         debug("resume read 0");
21035         stream.read(0);
21036       }
21037       state.resumeScheduled = false;
21038       state.awaitDrain = 0;
21039       stream.emit("resume");
21040       flow(stream);
21041       if (state.flowing && !state.reading)
21042         stream.read(0);
21043     }
21044     Readable2.prototype.pause = function() {
21045       debug("call pause flowing=%j", this._readableState.flowing);
21046       if (this._readableState.flowing !== false) {
21047         debug("pause");
21048         this._readableState.flowing = false;
21049         this.emit("pause");
21050       }
21051       return this;
21052     };
21053     function flow(stream) {
21054       var state = stream._readableState;
21055       debug("flow", state.flowing);
21056       while (state.flowing && stream.read() !== null) {
21057       }
21058     }
21059     Readable2.prototype.wrap = function(stream) {
21060       var _this = this;
21061       var state = this._readableState;
21062       var paused = false;
21063       stream.on("end", function() {
21064         debug("wrapped end");
21065         if (state.decoder && !state.ended) {
21066           var chunk = state.decoder.end();
21067           if (chunk && chunk.length)
21068             _this.push(chunk);
21069         }
21070         _this.push(null);
21071       });
21072       stream.on("data", function(chunk) {
21073         debug("wrapped data");
21074         if (state.decoder)
21075           chunk = state.decoder.write(chunk);
21076         if (state.objectMode && (chunk === null || chunk === void 0))
21077           return;
21078         else if (!state.objectMode && (!chunk || !chunk.length))
21079           return;
21080         var ret2 = _this.push(chunk);
21081         if (!ret2) {
21082           paused = true;
21083           stream.pause();
21084         }
21085       });
21086       for (var i in stream) {
21087         if (this[i] === void 0 && typeof stream[i] === "function") {
21088           this[i] = function(method) {
21089             return function() {
21090               return stream[method].apply(stream, arguments);
21091             };
21092           }(i);
21093         }
21094       }
21095       for (var n = 0; n < kProxyEvents.length; n++) {
21096         stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
21097       }
21098       this._read = function(n2) {
21099         debug("wrapped _read", n2);
21100         if (paused) {
21101           paused = false;
21102           stream.resume();
21103         }
21104       };
21105       return this;
21106     };
21107     Object.defineProperty(Readable2.prototype, "readableHighWaterMark", {
21108       enumerable: false,
21109       get: function() {
21110         return this._readableState.highWaterMark;
21111       }
21112     });
21113     Readable2._fromList = fromList;
21114     function fromList(n, state) {
21115       if (state.length === 0)
21116         return null;
21117       var ret2;
21118       if (state.objectMode)
21119         ret2 = state.buffer.shift();
21120       else if (!n || n >= state.length) {
21121         if (state.decoder)
21122           ret2 = state.buffer.join("");
21123         else if (state.buffer.length === 1)
21124           ret2 = state.buffer.head.data;
21125         else
21126           ret2 = state.buffer.concat(state.length);
21127         state.buffer.clear();
21128       } else {
21129         ret2 = fromListPartial(n, state.buffer, state.decoder);
21130       }
21131       return ret2;
21132     }
21133     function fromListPartial(n, list, hasStrings) {
21134       var ret2;
21135       if (n < list.head.data.length) {
21136         ret2 = list.head.data.slice(0, n);
21137         list.head.data = list.head.data.slice(n);
21138       } else if (n === list.head.data.length) {
21139         ret2 = list.shift();
21140       } else {
21141         ret2 = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
21142       }
21143       return ret2;
21144     }
21145     function copyFromBufferString(n, list) {
21146       var p = list.head;
21147       var c = 1;
21148       var ret2 = p.data;
21149       n -= ret2.length;
21150       while (p = p.next) {
21151         var str = p.data;
21152         var nb = n > str.length ? str.length : n;
21153         if (nb === str.length)
21154           ret2 += str;
21155         else
21156           ret2 += str.slice(0, n);
21157         n -= nb;
21158         if (n === 0) {
21159           if (nb === str.length) {
21160             ++c;
21161             if (p.next)
21162               list.head = p.next;
21163             else
21164               list.head = list.tail = null;
21165           } else {
21166             list.head = p;
21167             p.data = str.slice(nb);
21168           }
21169           break;
21170         }
21171         ++c;
21172       }
21173       list.length -= c;
21174       return ret2;
21175     }
21176     function copyFromBuffer(n, list) {
21177       var ret2 = Buffer2.allocUnsafe(n);
21178       var p = list.head;
21179       var c = 1;
21180       p.data.copy(ret2);
21181       n -= p.data.length;
21182       while (p = p.next) {
21183         var buf = p.data;
21184         var nb = n > buf.length ? buf.length : n;
21185         buf.copy(ret2, ret2.length - n, 0, nb);
21186         n -= nb;
21187         if (n === 0) {
21188           if (nb === buf.length) {
21189             ++c;
21190             if (p.next)
21191               list.head = p.next;
21192             else
21193               list.head = list.tail = null;
21194           } else {
21195             list.head = p;
21196             p.data = buf.slice(nb);
21197           }
21198           break;
21199         }
21200         ++c;
21201       }
21202       list.length -= c;
21203       return ret2;
21204     }
21205     function endReadable(stream) {
21206       var state = stream._readableState;
21207       if (state.length > 0)
21208         throw new Error('"endReadable()" called on non-empty stream');
21209       if (!state.endEmitted) {
21210         state.ended = true;
21211         pna.nextTick(endReadableNT, state, stream);
21212       }
21213     }
21214     function endReadableNT(state, stream) {
21215       if (!state.endEmitted && state.length === 0) {
21216         state.endEmitted = true;
21217         stream.readable = false;
21218         stream.emit("end");
21219       }
21220     }
21221     function indexOf(xs, x) {
21222       for (var i = 0, l2 = xs.length; i < l2; i++) {
21223         if (xs[i] === x)
21224           return i;
21225       }
21226       return -1;
21227     }
21228   }
21229 });
21230
21231 // node_modules/readable-stream/lib/_stream_transform.js
21232 var require_stream_transform = __commonJS({
21233   "node_modules/readable-stream/lib/_stream_transform.js"(exports2, module2) {
21234     "use strict";
21235     module2.exports = Transform;
21236     var Duplex = require_stream_duplex();
21237     var util = Object.create(require_util2());
21238     util.inherits = require_inherits();
21239     util.inherits(Transform, Duplex);
21240     function afterTransform(er, data) {
21241       var ts = this._transformState;
21242       ts.transforming = false;
21243       var cb = ts.writecb;
21244       if (!cb) {
21245         return this.emit("error", new Error("write callback called multiple times"));
21246       }
21247       ts.writechunk = null;
21248       ts.writecb = null;
21249       if (data != null)
21250         this.push(data);
21251       cb(er);
21252       var rs = this._readableState;
21253       rs.reading = false;
21254       if (rs.needReadable || rs.length < rs.highWaterMark) {
21255         this._read(rs.highWaterMark);
21256       }
21257     }
21258     function Transform(options) {
21259       if (!(this instanceof Transform))
21260         return new Transform(options);
21261       Duplex.call(this, options);
21262       this._transformState = {
21263         afterTransform: afterTransform.bind(this),
21264         needTransform: false,
21265         transforming: false,
21266         writecb: null,
21267         writechunk: null,
21268         writeencoding: null
21269       };
21270       this._readableState.needReadable = true;
21271       this._readableState.sync = false;
21272       if (options) {
21273         if (typeof options.transform === "function")
21274           this._transform = options.transform;
21275         if (typeof options.flush === "function")
21276           this._flush = options.flush;
21277       }
21278       this.on("prefinish", prefinish);
21279     }
21280     function prefinish() {
21281       var _this = this;
21282       if (typeof this._flush === "function") {
21283         this._flush(function(er, data) {
21284           done(_this, er, data);
21285         });
21286       } else {
21287         done(this, null, null);
21288       }
21289     }
21290     Transform.prototype.push = function(chunk, encoding) {
21291       this._transformState.needTransform = false;
21292       return Duplex.prototype.push.call(this, chunk, encoding);
21293     };
21294     Transform.prototype._transform = function(chunk, encoding, cb) {
21295       throw new Error("_transform() is not implemented");
21296     };
21297     Transform.prototype._write = function(chunk, encoding, cb) {
21298       var ts = this._transformState;
21299       ts.writecb = cb;
21300       ts.writechunk = chunk;
21301       ts.writeencoding = encoding;
21302       if (!ts.transforming) {
21303         var rs = this._readableState;
21304         if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark)
21305           this._read(rs.highWaterMark);
21306       }
21307     };
21308     Transform.prototype._read = function(n) {
21309       var ts = this._transformState;
21310       if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
21311         ts.transforming = true;
21312         this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
21313       } else {
21314         ts.needTransform = true;
21315       }
21316     };
21317     Transform.prototype._destroy = function(err, cb) {
21318       var _this2 = this;
21319       Duplex.prototype._destroy.call(this, err, function(err2) {
21320         cb(err2);
21321         _this2.emit("close");
21322       });
21323     };
21324     function done(stream, er, data) {
21325       if (er)
21326         return stream.emit("error", er);
21327       if (data != null)
21328         stream.push(data);
21329       if (stream._writableState.length)
21330         throw new Error("Calling transform done when ws.length != 0");
21331       if (stream._transformState.transforming)
21332         throw new Error("Calling transform done when still transforming");
21333       return stream.push(null);
21334     }
21335   }
21336 });
21337
21338 // node_modules/readable-stream/lib/_stream_passthrough.js
21339 var require_stream_passthrough = __commonJS({
21340   "node_modules/readable-stream/lib/_stream_passthrough.js"(exports2, module2) {
21341     "use strict";
21342     module2.exports = PassThrough2;
21343     var Transform = require_stream_transform();
21344     var util = Object.create(require_util2());
21345     util.inherits = require_inherits();
21346     util.inherits(PassThrough2, Transform);
21347     function PassThrough2(options) {
21348       if (!(this instanceof PassThrough2))
21349         return new PassThrough2(options);
21350       Transform.call(this, options);
21351     }
21352     PassThrough2.prototype._transform = function(chunk, encoding, cb) {
21353       cb(null, chunk);
21354     };
21355   }
21356 });
21357
21358 // node_modules/readable-stream/readable.js
21359 var require_readable = __commonJS({
21360   "node_modules/readable-stream/readable.js"(exports2, module2) {
21361     var Stream2 = require("stream");
21362     if (process.env.READABLE_STREAM === "disable" && Stream2) {
21363       module2.exports = Stream2;
21364       exports2 = module2.exports = Stream2.Readable;
21365       exports2.Readable = Stream2.Readable;
21366       exports2.Writable = Stream2.Writable;
21367       exports2.Duplex = Stream2.Duplex;
21368       exports2.Transform = Stream2.Transform;
21369       exports2.PassThrough = Stream2.PassThrough;
21370       exports2.Stream = Stream2;
21371     } else {
21372       exports2 = module2.exports = require_stream_readable();
21373       exports2.Stream = Stream2 || exports2;
21374       exports2.Readable = exports2;
21375       exports2.Writable = require_stream_writable();
21376       exports2.Duplex = require_stream_duplex();
21377       exports2.Transform = require_stream_transform();
21378       exports2.PassThrough = require_stream_passthrough();
21379     }
21380   }
21381 });
21382
21383 // node_modules/unzipper/lib/PullStream.js
21384 var require_PullStream = __commonJS({
21385   "node_modules/unzipper/lib/PullStream.js"(exports2, module2) {
21386     var Stream2 = require("stream");
21387     var Promise2 = require_bluebird();
21388     var util = require("util");
21389     var Buffer2 = require_Buffer();
21390     var strFunction = "function";
21391     if (!Stream2.Writable || !Stream2.Writable.prototype.destroy)
21392       Stream2 = require_readable();
21393     function PullStream() {
21394       if (!(this instanceof PullStream))
21395         return new PullStream();
21396       Stream2.Duplex.call(this, { decodeStrings: false, objectMode: true });
21397       this.buffer = Buffer2.from("");
21398       var self2 = this;
21399       self2.on("finish", function() {
21400         self2.finished = true;
21401         self2.emit("chunk", false);
21402       });
21403     }
21404     util.inherits(PullStream, Stream2.Duplex);
21405     PullStream.prototype._write = function(chunk, e, cb) {
21406       this.buffer = Buffer2.concat([this.buffer, chunk]);
21407       this.cb = cb;
21408       this.emit("chunk");
21409     };
21410     PullStream.prototype.stream = function(eof, includeEof) {
21411       var p = Stream2.PassThrough();
21412       var done, self2 = this;
21413       function cb() {
21414         if (typeof self2.cb === strFunction) {
21415           var callback = self2.cb;
21416           self2.cb = void 0;
21417           return callback();
21418         }
21419       }
21420       function pull() {
21421         var packet;
21422         if (self2.buffer && self2.buffer.length) {
21423           if (typeof eof === "number") {
21424             packet = self2.buffer.slice(0, eof);
21425             self2.buffer = self2.buffer.slice(eof);
21426             eof -= packet.length;
21427             done = !eof;
21428           } else {
21429             var match = self2.buffer.indexOf(eof);
21430             if (match !== -1) {
21431               self2.match = match;
21432               if (includeEof)
21433                 match = match + eof.length;
21434               packet = self2.buffer.slice(0, match);
21435               self2.buffer = self2.buffer.slice(match);
21436               done = true;
21437             } else {
21438               var len = self2.buffer.length - eof.length;
21439               if (len <= 0) {
21440                 cb();
21441               } else {
21442                 packet = self2.buffer.slice(0, len);
21443                 self2.buffer = self2.buffer.slice(len);
21444               }
21445             }
21446           }
21447           if (packet)
21448             p.write(packet, function() {
21449               if (self2.buffer.length === 0 || eof.length && self2.buffer.length <= eof.length)
21450                 cb();
21451             });
21452         }
21453         if (!done) {
21454           if (self2.finished && !this.__ended) {
21455             self2.removeListener("chunk", pull);
21456             self2.emit("error", new Error("FILE_ENDED"));
21457             this.__ended = true;
21458             return;
21459           }
21460         } else {
21461           self2.removeListener("chunk", pull);
21462           p.end();
21463         }
21464       }
21465       self2.on("chunk", pull);
21466       pull();
21467       return p;
21468     };
21469     PullStream.prototype.pull = function(eof, includeEof) {
21470       if (eof === 0)
21471         return Promise2.resolve("");
21472       if (!isNaN(eof) && this.buffer.length > eof) {
21473         var data = this.buffer.slice(0, eof);
21474         this.buffer = this.buffer.slice(eof);
21475         return Promise2.resolve(data);
21476       }
21477       var buffer = Buffer2.from(""), self2 = this;
21478       var concatStream = Stream2.Transform();
21479       concatStream._transform = function(d, e, cb) {
21480         buffer = Buffer2.concat([buffer, d]);
21481         cb();
21482       };
21483       var rejectHandler;
21484       var pullStreamRejectHandler;
21485       return new Promise2(function(resolve, reject) {
21486         rejectHandler = reject;
21487         pullStreamRejectHandler = function(e) {
21488           self2.__emittedError = e;
21489           reject(e);
21490         };
21491         if (self2.finished)
21492           return reject(new Error("FILE_ENDED"));
21493         self2.once("error", pullStreamRejectHandler);
21494         self2.stream(eof, includeEof).on("error", reject).pipe(concatStream).on("finish", function() {
21495           resolve(buffer);
21496         }).on("error", reject);
21497       }).finally(function() {
21498         self2.removeListener("error", rejectHandler);
21499         self2.removeListener("error", pullStreamRejectHandler);
21500       });
21501     };
21502     PullStream.prototype._read = function() {
21503     };
21504     module2.exports = PullStream;
21505   }
21506 });
21507
21508 // node_modules/unzipper/lib/NoopStream.js
21509 var require_NoopStream = __commonJS({
21510   "node_modules/unzipper/lib/NoopStream.js"(exports2, module2) {
21511     var Stream2 = require("stream");
21512     var util = require("util");
21513     if (!Stream2.Writable || !Stream2.Writable.prototype.destroy)
21514       Stream2 = require_readable();
21515     function NoopStream() {
21516       if (!(this instanceof NoopStream)) {
21517         return new NoopStream();
21518       }
21519       Stream2.Transform.call(this);
21520     }
21521     util.inherits(NoopStream, Stream2.Transform);
21522     NoopStream.prototype._transform = function(d, e, cb) {
21523       cb();
21524     };
21525     module2.exports = NoopStream;
21526   }
21527 });
21528
21529 // node_modules/unzipper/lib/BufferStream.js
21530 var require_BufferStream = __commonJS({
21531   "node_modules/unzipper/lib/BufferStream.js"(exports2, module2) {
21532     var Promise2 = require_bluebird();
21533     var Stream2 = require("stream");
21534     var Buffer2 = require_Buffer();
21535     if (!Stream2.Writable || !Stream2.Writable.prototype.destroy)
21536       Stream2 = require_readable();
21537     module2.exports = function(entry) {
21538       return new Promise2(function(resolve, reject) {
21539         var chunks = [];
21540         var bufferStream = Stream2.Transform().on("finish", function() {
21541           resolve(Buffer2.concat(chunks));
21542         }).on("error", reject);
21543         bufferStream._transform = function(d, e, cb) {
21544           chunks.push(d);
21545           cb();
21546         };
21547         entry.on("error", reject).pipe(bufferStream);
21548       });
21549     };
21550   }
21551 });
21552
21553 // node_modules/unzipper/lib/parseExtraField.js
21554 var require_parseExtraField = __commonJS({
21555   "node_modules/unzipper/lib/parseExtraField.js"(exports2, module2) {
21556     var binary = require_binary();
21557     module2.exports = function(extraField, vars) {
21558       var extra;
21559       while (!extra && extraField && extraField.length) {
21560         var candidateExtra = binary.parse(extraField).word16lu("signature").word16lu("partsize").word64lu("uncompressedSize").word64lu("compressedSize").word64lu("offset").word64lu("disknum").vars;
21561         if (candidateExtra.signature === 1) {
21562           extra = candidateExtra;
21563         } else {
21564           extraField = extraField.slice(candidateExtra.partsize + 4);
21565         }
21566       }
21567       extra = extra || {};
21568       if (vars.compressedSize === 4294967295)
21569         vars.compressedSize = extra.compressedSize;
21570       if (vars.uncompressedSize === 4294967295)
21571         vars.uncompressedSize = extra.uncompressedSize;
21572       if (vars.offsetToLocalFileHeader === 4294967295)
21573         vars.offsetToLocalFileHeader = extra.offset;
21574       return extra;
21575     };
21576   }
21577 });
21578
21579 // node_modules/unzipper/lib/parseDateTime.js
21580 var require_parseDateTime = __commonJS({
21581   "node_modules/unzipper/lib/parseDateTime.js"(exports2, module2) {
21582     module2.exports = function parseDateTime(date, time) {
21583       const day = date & 31;
21584       const month = date >> 5 & 15;
21585       const year = (date >> 9 & 127) + 1980;
21586       const seconds = time ? (time & 31) * 2 : 0;
21587       const minutes = time ? time >> 5 & 63 : 0;
21588       const hours = time ? time >> 11 : 0;
21589       return new Date(Date.UTC(year, month - 1, day, hours, minutes, seconds));
21590     };
21591   }
21592 });
21593
21594 // node_modules/unzipper/lib/parse.js
21595 var require_parse3 = __commonJS({
21596   "node_modules/unzipper/lib/parse.js"(exports2, module2) {
21597     var util = require("util");
21598     var zlib2 = require("zlib");
21599     var Stream2 = require("stream");
21600     var binary = require_binary();
21601     var Promise2 = require_bluebird();
21602     var PullStream = require_PullStream();
21603     var NoopStream = require_NoopStream();
21604     var BufferStream = require_BufferStream();
21605     var parseExtraField = require_parseExtraField();
21606     var Buffer2 = require_Buffer();
21607     var parseDateTime = require_parseDateTime();
21608     if (!Stream2.Writable || !Stream2.Writable.prototype.destroy)
21609       Stream2 = require_readable();
21610     var endDirectorySignature = Buffer2.alloc(4);
21611     endDirectorySignature.writeUInt32LE(101010256, 0);
21612     function Parse(opts) {
21613       if (!(this instanceof Parse)) {
21614         return new Parse(opts);
21615       }
21616       var self2 = this;
21617       self2._opts = opts || { verbose: false };
21618       PullStream.call(self2, self2._opts);
21619       self2.on("finish", function() {
21620         self2.emit("close");
21621       });
21622       self2._readRecord().catch(function(e) {
21623         if (!self2.__emittedError || self2.__emittedError !== e)
21624           self2.emit("error", e);
21625       });
21626     }
21627     util.inherits(Parse, PullStream);
21628     Parse.prototype._readRecord = function() {
21629       var self2 = this;
21630       return self2.pull(4).then(function(data) {
21631         if (data.length === 0)
21632           return;
21633         var signature = data.readUInt32LE(0);
21634         if (signature === 875721283) {
21635           return self2._readCrxHeader();
21636         }
21637         if (signature === 67324752) {
21638           return self2._readFile();
21639         } else if (signature === 33639248) {
21640           self2.__ended = true;
21641           return self2._readCentralDirectoryFileHeader();
21642         } else if (signature === 101010256) {
21643           return self2._readEndOfCentralDirectoryRecord();
21644         } else if (self2.__ended) {
21645           return self2.pull(endDirectorySignature).then(function() {
21646             return self2._readEndOfCentralDirectoryRecord();
21647           });
21648         } else
21649           self2.emit("error", new Error("invalid signature: 0x" + signature.toString(16)));
21650       });
21651     };
21652     Parse.prototype._readCrxHeader = function() {
21653       var self2 = this;
21654       return self2.pull(12).then(function(data) {
21655         self2.crxHeader = binary.parse(data).word32lu("version").word32lu("pubKeyLength").word32lu("signatureLength").vars;
21656         return self2.pull(self2.crxHeader.pubKeyLength + self2.crxHeader.signatureLength);
21657       }).then(function(data) {
21658         self2.crxHeader.publicKey = data.slice(0, self2.crxHeader.pubKeyLength);
21659         self2.crxHeader.signature = data.slice(self2.crxHeader.pubKeyLength);
21660         self2.emit("crx-header", self2.crxHeader);
21661         return self2._readRecord();
21662       });
21663     };
21664     Parse.prototype._readFile = function() {
21665       var self2 = this;
21666       return self2.pull(26).then(function(data) {
21667         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;
21668         vars.lastModifiedDateTime = parseDateTime(vars.lastModifiedDate, vars.lastModifiedTime);
21669         if (self2.crxHeader)
21670           vars.crxHeader = self2.crxHeader;
21671         return self2.pull(vars.fileNameLength).then(function(fileNameBuffer) {
21672           var fileName = fileNameBuffer.toString("utf8");
21673           var entry = Stream2.PassThrough();
21674           var __autodraining = false;
21675           entry.autodrain = function() {
21676             __autodraining = true;
21677             var draining = entry.pipe(NoopStream());
21678             draining.promise = function() {
21679               return new Promise2(function(resolve, reject) {
21680                 draining.on("finish", resolve);
21681                 draining.on("error", reject);
21682               });
21683             };
21684             return draining;
21685           };
21686           entry.buffer = function() {
21687             return BufferStream(entry);
21688           };
21689           entry.path = fileName;
21690           entry.props = {};
21691           entry.props.path = fileName;
21692           entry.props.pathBuffer = fileNameBuffer;
21693           entry.props.flags = {
21694             "isUnicode": vars.flags & 17
21695           };
21696           entry.type = vars.uncompressedSize === 0 && /[\/\\]$/.test(fileName) ? "Directory" : "File";
21697           if (self2._opts.verbose) {
21698             if (entry.type === "Directory") {
21699               console.log("   creating:", fileName);
21700             } else if (entry.type === "File") {
21701               if (vars.compressionMethod === 0) {
21702                 console.log(" extracting:", fileName);
21703               } else {
21704                 console.log("  inflating:", fileName);
21705               }
21706             }
21707           }
21708           return self2.pull(vars.extraFieldLength).then(function(extraField) {
21709             var extra = parseExtraField(extraField, vars);
21710             entry.vars = vars;
21711             entry.extra = extra;
21712             if (self2._opts.forceStream) {
21713               self2.push(entry);
21714             } else {
21715               self2.emit("entry", entry);
21716               if (self2._readableState.pipesCount || self2._readableState.pipes && self2._readableState.pipes.length)
21717                 self2.push(entry);
21718             }
21719             if (self2._opts.verbose)
21720               console.log({
21721                 filename: fileName,
21722                 vars,
21723                 extra
21724               });
21725             var fileSizeKnown = !(vars.flags & 8) || vars.compressedSize > 0, eof;
21726             entry.__autodraining = __autodraining;
21727             var inflater = vars.compressionMethod && !__autodraining ? zlib2.createInflateRaw() : Stream2.PassThrough();
21728             if (fileSizeKnown) {
21729               entry.size = vars.uncompressedSize;
21730               eof = vars.compressedSize;
21731             } else {
21732               eof = Buffer2.alloc(4);
21733               eof.writeUInt32LE(134695760, 0);
21734             }
21735             return new Promise2(function(resolve, reject) {
21736               self2.stream(eof).pipe(inflater).on("error", function(err) {
21737                 self2.emit("error", err);
21738               }).pipe(entry).on("finish", function() {
21739                 return fileSizeKnown ? self2._readRecord().then(resolve).catch(reject) : self2._processDataDescriptor(entry).then(resolve).catch(reject);
21740               });
21741             });
21742           });
21743         });
21744       });
21745     };
21746     Parse.prototype._processDataDescriptor = function(entry) {
21747       var self2 = this;
21748       return self2.pull(16).then(function(data) {
21749         var vars = binary.parse(data).word32lu("dataDescriptorSignature").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").vars;
21750         entry.size = vars.uncompressedSize;
21751         return self2._readRecord();
21752       });
21753     };
21754     Parse.prototype._readCentralDirectoryFileHeader = function() {
21755       var self2 = this;
21756       return self2.pull(42).then(function(data) {
21757         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;
21758         return self2.pull(vars.fileNameLength).then(function(fileName) {
21759           vars.fileName = fileName.toString("utf8");
21760           return self2.pull(vars.extraFieldLength);
21761         }).then(function(extraField) {
21762           return self2.pull(vars.fileCommentLength);
21763         }).then(function(fileComment) {
21764           return self2._readRecord();
21765         });
21766       });
21767     };
21768     Parse.prototype._readEndOfCentralDirectoryRecord = function() {
21769       var self2 = this;
21770       return self2.pull(18).then(function(data) {
21771         var vars = binary.parse(data).word16lu("diskNumber").word16lu("diskStart").word16lu("numberOfRecordsOnDisk").word16lu("numberOfRecords").word32lu("sizeOfCentralDirectory").word32lu("offsetToStartOfCentralDirectory").word16lu("commentLength").vars;
21772         return self2.pull(vars.commentLength).then(function(comment) {
21773           comment = comment.toString("utf8");
21774           self2.end();
21775           self2.push(null);
21776         });
21777       });
21778     };
21779     Parse.prototype.promise = function() {
21780       var self2 = this;
21781       return new Promise2(function(resolve, reject) {
21782         self2.on("finish", resolve);
21783         self2.on("error", reject);
21784       });
21785     };
21786     module2.exports = Parse;
21787   }
21788 });
21789
21790 // node_modules/duplexer2/index.js
21791 var require_duplexer2 = __commonJS({
21792   "node_modules/duplexer2/index.js"(exports2, module2) {
21793     "use strict";
21794     var stream = require_readable();
21795     function DuplexWrapper(options, writable, readable) {
21796       if (typeof readable === "undefined") {
21797         readable = writable;
21798         writable = options;
21799         options = null;
21800       }
21801       stream.Duplex.call(this, options);
21802       if (typeof readable.read !== "function") {
21803         readable = new stream.Readable(options).wrap(readable);
21804       }
21805       this._writable = writable;
21806       this._readable = readable;
21807       this._waiting = false;
21808       var self2 = this;
21809       writable.once("finish", function() {
21810         self2.end();
21811       });
21812       this.once("finish", function() {
21813         writable.end();
21814       });
21815       readable.on("readable", function() {
21816         if (self2._waiting) {
21817           self2._waiting = false;
21818           self2._read();
21819         }
21820       });
21821       readable.once("end", function() {
21822         self2.push(null);
21823       });
21824       if (!options || typeof options.bubbleErrors === "undefined" || options.bubbleErrors) {
21825         writable.on("error", function(err) {
21826           self2.emit("error", err);
21827         });
21828         readable.on("error", function(err) {
21829           self2.emit("error", err);
21830         });
21831       }
21832     }
21833     DuplexWrapper.prototype = Object.create(stream.Duplex.prototype, { constructor: { value: DuplexWrapper } });
21834     DuplexWrapper.prototype._write = function _write(input, encoding, done) {
21835       this._writable.write(input, encoding, done);
21836     };
21837     DuplexWrapper.prototype._read = function _read() {
21838       var buf;
21839       var reads = 0;
21840       while ((buf = this._readable.read()) !== null) {
21841         this.push(buf);
21842         reads++;
21843       }
21844       if (reads === 0) {
21845         this._waiting = true;
21846       }
21847     };
21848     module2.exports = function duplex2(options, writable, readable) {
21849       return new DuplexWrapper(options, writable, readable);
21850     };
21851     module2.exports.DuplexWrapper = DuplexWrapper;
21852   }
21853 });
21854
21855 // node_modules/unzipper/lib/parseOne.js
21856 var require_parseOne = __commonJS({
21857   "node_modules/unzipper/lib/parseOne.js"(exports2, module2) {
21858     var Stream2 = require("stream");
21859     var Parse = require_parse3();
21860     var duplexer2 = require_duplexer2();
21861     var BufferStream = require_BufferStream();
21862     if (!Stream2.Writable || !Stream2.Writable.prototype.destroy)
21863       Stream2 = require_readable();
21864     function parseOne(match, opts) {
21865       var inStream = Stream2.PassThrough({ objectMode: true });
21866       var outStream = Stream2.PassThrough();
21867       var transform = Stream2.Transform({ objectMode: true });
21868       var re = match instanceof RegExp ? match : match && new RegExp(match);
21869       var found;
21870       transform._transform = function(entry, e, cb) {
21871         if (found || re && !re.exec(entry.path)) {
21872           entry.autodrain();
21873           return cb();
21874         } else {
21875           found = true;
21876           out.emit("entry", entry);
21877           entry.on("error", function(e2) {
21878             outStream.emit("error", e2);
21879           });
21880           entry.pipe(outStream).on("error", function(err) {
21881             cb(err);
21882           }).on("finish", function(d) {
21883             cb(null, d);
21884           });
21885         }
21886       };
21887       inStream.pipe(Parse(opts)).on("error", function(err) {
21888         outStream.emit("error", err);
21889       }).pipe(transform).on("error", Object).on("finish", function() {
21890         if (!found)
21891           outStream.emit("error", new Error("PATTERN_NOT_FOUND"));
21892         else
21893           outStream.end();
21894       });
21895       var out = duplexer2(inStream, outStream);
21896       out.buffer = function() {
21897         return BufferStream(outStream);
21898       };
21899       return out;
21900     }
21901     module2.exports = parseOne;
21902   }
21903 });
21904
21905 // node_modules/fstream/lib/abstract.js
21906 var require_abstract = __commonJS({
21907   "node_modules/fstream/lib/abstract.js"(exports2, module2) {
21908     module2.exports = Abstract;
21909     var Stream2 = require("stream").Stream;
21910     var inherits2 = require_inherits();
21911     function Abstract() {
21912       Stream2.call(this);
21913     }
21914     inherits2(Abstract, Stream2);
21915     Abstract.prototype.on = function(ev, fn) {
21916       if (ev === "ready" && this.ready) {
21917         process.nextTick(fn.bind(this));
21918       } else {
21919         Stream2.prototype.on.call(this, ev, fn);
21920       }
21921       return this;
21922     };
21923     Abstract.prototype.abort = function() {
21924       this._aborted = true;
21925       this.emit("abort");
21926     };
21927     Abstract.prototype.destroy = function() {
21928     };
21929     Abstract.prototype.warn = function(msg, code) {
21930       var self2 = this;
21931       var er = decorate(msg, code, self2);
21932       if (!self2.listeners("warn")) {
21933         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"));
21934       } else {
21935         self2.emit("warn", er);
21936       }
21937     };
21938     Abstract.prototype.info = function(msg, code) {
21939       this.emit("info", msg, code);
21940     };
21941     Abstract.prototype.error = function(msg, code, th) {
21942       var er = decorate(msg, code, this);
21943       if (th)
21944         throw er;
21945       else
21946         this.emit("error", er);
21947     };
21948     function decorate(er, code, self2) {
21949       if (!(er instanceof Error))
21950         er = new Error(er);
21951       er.code = er.code || code;
21952       er.path = er.path || self2.path;
21953       er.fstream_type = er.fstream_type || self2.type;
21954       er.fstream_path = er.fstream_path || self2.path;
21955       if (self2._path !== self2.path) {
21956         er.fstream_unc_path = er.fstream_unc_path || self2._path;
21957       }
21958       if (self2.linkpath) {
21959         er.fstream_linkpath = er.fstream_linkpath || self2.linkpath;
21960       }
21961       er.fstream_class = er.fstream_class || self2.constructor.name;
21962       er.fstream_stack = er.fstream_stack || new Error().stack.split(/\n/).slice(3).map(function(s) {
21963         return s.replace(/^ {4}at /, "");
21964       });
21965       return er;
21966     }
21967   }
21968 });
21969
21970 // node_modules/graceful-fs/polyfills.js
21971 var require_polyfills = __commonJS({
21972   "node_modules/graceful-fs/polyfills.js"(exports2, module2) {
21973     var constants = require("constants");
21974     var origCwd = process.cwd;
21975     var cwd = null;
21976     var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
21977     process.cwd = function() {
21978       if (!cwd)
21979         cwd = origCwd.call(process);
21980       return cwd;
21981     };
21982     try {
21983       process.cwd();
21984     } catch (er) {
21985     }
21986     var chdir = process.chdir;
21987     process.chdir = function(d) {
21988       cwd = null;
21989       chdir.call(process, d);
21990     };
21991     module2.exports = patch;
21992     function patch(fs2) {
21993       if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
21994         patchLchmod(fs2);
21995       }
21996       if (!fs2.lutimes) {
21997         patchLutimes(fs2);
21998       }
21999       fs2.chown = chownFix(fs2.chown);
22000       fs2.fchown = chownFix(fs2.fchown);
22001       fs2.lchown = chownFix(fs2.lchown);
22002       fs2.chmod = chmodFix(fs2.chmod);
22003       fs2.fchmod = chmodFix(fs2.fchmod);
22004       fs2.lchmod = chmodFix(fs2.lchmod);
22005       fs2.chownSync = chownFixSync(fs2.chownSync);
22006       fs2.fchownSync = chownFixSync(fs2.fchownSync);
22007       fs2.lchownSync = chownFixSync(fs2.lchownSync);
22008       fs2.chmodSync = chmodFixSync(fs2.chmodSync);
22009       fs2.fchmodSync = chmodFixSync(fs2.fchmodSync);
22010       fs2.lchmodSync = chmodFixSync(fs2.lchmodSync);
22011       fs2.stat = statFix(fs2.stat);
22012       fs2.fstat = statFix(fs2.fstat);
22013       fs2.lstat = statFix(fs2.lstat);
22014       fs2.statSync = statFixSync(fs2.statSync);
22015       fs2.fstatSync = statFixSync(fs2.fstatSync);
22016       fs2.lstatSync = statFixSync(fs2.lstatSync);
22017       if (!fs2.lchmod) {
22018         fs2.lchmod = function(path2, mode, cb) {
22019           if (cb)
22020             process.nextTick(cb);
22021         };
22022         fs2.lchmodSync = function() {
22023         };
22024       }
22025       if (!fs2.lchown) {
22026         fs2.lchown = function(path2, uid, gid, cb) {
22027           if (cb)
22028             process.nextTick(cb);
22029         };
22030         fs2.lchownSync = function() {
22031         };
22032       }
22033       if (platform === "win32") {
22034         fs2.rename = function(fs$rename) {
22035           return function(from, to, cb) {
22036             var start = Date.now();
22037             var backoff = 0;
22038             fs$rename(from, to, function CB(er) {
22039               if (er && (er.code === "EACCES" || er.code === "EPERM") && Date.now() - start < 6e4) {
22040                 setTimeout(function() {
22041                   fs2.stat(to, function(stater, st) {
22042                     if (stater && stater.code === "ENOENT")
22043                       fs$rename(from, to, CB);
22044                     else
22045                       cb(er);
22046                   });
22047                 }, backoff);
22048                 if (backoff < 100)
22049                   backoff += 10;
22050                 return;
22051               }
22052               if (cb)
22053                 cb(er);
22054             });
22055           };
22056         }(fs2.rename);
22057       }
22058       fs2.read = function(fs$read) {
22059         function read(fd, buffer, offset, length, position, callback_) {
22060           var callback;
22061           if (callback_ && typeof callback_ === "function") {
22062             var eagCounter = 0;
22063             callback = function(er, _, __) {
22064               if (er && er.code === "EAGAIN" && eagCounter < 10) {
22065                 eagCounter++;
22066                 return fs$read.call(fs2, fd, buffer, offset, length, position, callback);
22067               }
22068               callback_.apply(this, arguments);
22069             };
22070           }
22071           return fs$read.call(fs2, fd, buffer, offset, length, position, callback);
22072         }
22073         read.__proto__ = fs$read;
22074         return read;
22075       }(fs2.read);
22076       fs2.readSync = function(fs$readSync) {
22077         return function(fd, buffer, offset, length, position) {
22078           var eagCounter = 0;
22079           while (true) {
22080             try {
22081               return fs$readSync.call(fs2, fd, buffer, offset, length, position);
22082             } catch (er) {
22083               if (er.code === "EAGAIN" && eagCounter < 10) {
22084                 eagCounter++;
22085                 continue;
22086               }
22087               throw er;
22088             }
22089           }
22090         };
22091       }(fs2.readSync);
22092       function patchLchmod(fs3) {
22093         fs3.lchmod = function(path2, mode, callback) {
22094           fs3.open(path2, constants.O_WRONLY | constants.O_SYMLINK, mode, function(err, fd) {
22095             if (err) {
22096               if (callback)
22097                 callback(err);
22098               return;
22099             }
22100             fs3.fchmod(fd, mode, function(err2) {
22101               fs3.close(fd, function(err22) {
22102                 if (callback)
22103                   callback(err2 || err22);
22104               });
22105             });
22106           });
22107         };
22108         fs3.lchmodSync = function(path2, mode) {
22109           var fd = fs3.openSync(path2, constants.O_WRONLY | constants.O_SYMLINK, mode);
22110           var threw = true;
22111           var ret2;
22112           try {
22113             ret2 = fs3.fchmodSync(fd, mode);
22114             threw = false;
22115           } finally {
22116             if (threw) {
22117               try {
22118                 fs3.closeSync(fd);
22119               } catch (er) {
22120               }
22121             } else {
22122               fs3.closeSync(fd);
22123             }
22124           }
22125           return ret2;
22126         };
22127       }
22128       function patchLutimes(fs3) {
22129         if (constants.hasOwnProperty("O_SYMLINK")) {
22130           fs3.lutimes = function(path2, at, mt, cb) {
22131             fs3.open(path2, constants.O_SYMLINK, function(er, fd) {
22132               if (er) {
22133                 if (cb)
22134                   cb(er);
22135                 return;
22136               }
22137               fs3.futimes(fd, at, mt, function(er2) {
22138                 fs3.close(fd, function(er22) {
22139                   if (cb)
22140                     cb(er2 || er22);
22141                 });
22142               });
22143             });
22144           };
22145           fs3.lutimesSync = function(path2, at, mt) {
22146             var fd = fs3.openSync(path2, constants.O_SYMLINK);
22147             var ret2;
22148             var threw = true;
22149             try {
22150               ret2 = fs3.futimesSync(fd, at, mt);
22151               threw = false;
22152             } finally {
22153               if (threw) {
22154                 try {
22155                   fs3.closeSync(fd);
22156                 } catch (er) {
22157                 }
22158               } else {
22159                 fs3.closeSync(fd);
22160               }
22161             }
22162             return ret2;
22163           };
22164         } else {
22165           fs3.lutimes = function(_a, _b, _c, cb) {
22166             if (cb)
22167               process.nextTick(cb);
22168           };
22169           fs3.lutimesSync = function() {
22170           };
22171         }
22172       }
22173       function chmodFix(orig) {
22174         if (!orig)
22175           return orig;
22176         return function(target, mode, cb) {
22177           return orig.call(fs2, target, mode, function(er) {
22178             if (chownErOk(er))
22179               er = null;
22180             if (cb)
22181               cb.apply(this, arguments);
22182           });
22183         };
22184       }
22185       function chmodFixSync(orig) {
22186         if (!orig)
22187           return orig;
22188         return function(target, mode) {
22189           try {
22190             return orig.call(fs2, target, mode);
22191           } catch (er) {
22192             if (!chownErOk(er))
22193               throw er;
22194           }
22195         };
22196       }
22197       function chownFix(orig) {
22198         if (!orig)
22199           return orig;
22200         return function(target, uid, gid, cb) {
22201           return orig.call(fs2, target, uid, gid, function(er) {
22202             if (chownErOk(er))
22203               er = null;
22204             if (cb)
22205               cb.apply(this, arguments);
22206           });
22207         };
22208       }
22209       function chownFixSync(orig) {
22210         if (!orig)
22211           return orig;
22212         return function(target, uid, gid) {
22213           try {
22214             return orig.call(fs2, target, uid, gid);
22215           } catch (er) {
22216             if (!chownErOk(er))
22217               throw er;
22218           }
22219         };
22220       }
22221       function statFix(orig) {
22222         if (!orig)
22223           return orig;
22224         return function(target, options, cb) {
22225           if (typeof options === "function") {
22226             cb = options;
22227             options = null;
22228           }
22229           function callback(er, stats) {
22230             if (stats) {
22231               if (stats.uid < 0)
22232                 stats.uid += 4294967296;
22233               if (stats.gid < 0)
22234                 stats.gid += 4294967296;
22235             }
22236             if (cb)
22237               cb.apply(this, arguments);
22238           }
22239           return options ? orig.call(fs2, target, options, callback) : orig.call(fs2, target, callback);
22240         };
22241       }
22242       function statFixSync(orig) {
22243         if (!orig)
22244           return orig;
22245         return function(target, options) {
22246           var stats = options ? orig.call(fs2, target, options) : orig.call(fs2, target);
22247           if (stats.uid < 0)
22248             stats.uid += 4294967296;
22249           if (stats.gid < 0)
22250             stats.gid += 4294967296;
22251           return stats;
22252         };
22253       }
22254       function chownErOk(er) {
22255         if (!er)
22256           return true;
22257         if (er.code === "ENOSYS")
22258           return true;
22259         var nonroot = !process.getuid || process.getuid() !== 0;
22260         if (nonroot) {
22261           if (er.code === "EINVAL" || er.code === "EPERM")
22262             return true;
22263         }
22264         return false;
22265       }
22266     }
22267   }
22268 });
22269
22270 // node_modules/graceful-fs/legacy-streams.js
22271 var require_legacy_streams = __commonJS({
22272   "node_modules/graceful-fs/legacy-streams.js"(exports2, module2) {
22273     var Stream2 = require("stream").Stream;
22274     module2.exports = legacy;
22275     function legacy(fs2) {
22276       return {
22277         ReadStream,
22278         WriteStream
22279       };
22280       function ReadStream(path2, options) {
22281         if (!(this instanceof ReadStream))
22282           return new ReadStream(path2, options);
22283         Stream2.call(this);
22284         var self2 = this;
22285         this.path = path2;
22286         this.fd = null;
22287         this.readable = true;
22288         this.paused = false;
22289         this.flags = "r";
22290         this.mode = 438;
22291         this.bufferSize = 64 * 1024;
22292         options = options || {};
22293         var keys = Object.keys(options);
22294         for (var index = 0, length = keys.length; index < length; index++) {
22295           var key = keys[index];
22296           this[key] = options[key];
22297         }
22298         if (this.encoding)
22299           this.setEncoding(this.encoding);
22300         if (this.start !== void 0) {
22301           if (typeof this.start !== "number") {
22302             throw TypeError("start must be a Number");
22303           }
22304           if (this.end === void 0) {
22305             this.end = Infinity;
22306           } else if (typeof this.end !== "number") {
22307             throw TypeError("end must be a Number");
22308           }
22309           if (this.start > this.end) {
22310             throw new Error("start must be <= end");
22311           }
22312           this.pos = this.start;
22313         }
22314         if (this.fd !== null) {
22315           process.nextTick(function() {
22316             self2._read();
22317           });
22318           return;
22319         }
22320         fs2.open(this.path, this.flags, this.mode, function(err, fd) {
22321           if (err) {
22322             self2.emit("error", err);
22323             self2.readable = false;
22324             return;
22325           }
22326           self2.fd = fd;
22327           self2.emit("open", fd);
22328           self2._read();
22329         });
22330       }
22331       function WriteStream(path2, options) {
22332         if (!(this instanceof WriteStream))
22333           return new WriteStream(path2, options);
22334         Stream2.call(this);
22335         this.path = path2;
22336         this.fd = null;
22337         this.writable = true;
22338         this.flags = "w";
22339         this.encoding = "binary";
22340         this.mode = 438;
22341         this.bytesWritten = 0;
22342         options = options || {};
22343         var keys = Object.keys(options);
22344         for (var index = 0, length = keys.length; index < length; index++) {
22345           var key = keys[index];
22346           this[key] = options[key];
22347         }
22348         if (this.start !== void 0) {
22349           if (typeof this.start !== "number") {
22350             throw TypeError("start must be a Number");
22351           }
22352           if (this.start < 0) {
22353             throw new Error("start must be >= zero");
22354           }
22355           this.pos = this.start;
22356         }
22357         this.busy = false;
22358         this._queue = [];
22359         if (this.fd === null) {
22360           this._open = fs2.open;
22361           this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
22362           this.flush();
22363         }
22364       }
22365     }
22366   }
22367 });
22368
22369 // node_modules/graceful-fs/clone.js
22370 var require_clone = __commonJS({
22371   "node_modules/graceful-fs/clone.js"(exports2, module2) {
22372     "use strict";
22373     module2.exports = clone2;
22374     function clone2(obj2) {
22375       if (obj2 === null || typeof obj2 !== "object")
22376         return obj2;
22377       if (obj2 instanceof Object)
22378         var copy = { __proto__: obj2.__proto__ };
22379       else
22380         var copy = Object.create(null);
22381       Object.getOwnPropertyNames(obj2).forEach(function(key) {
22382         Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj2, key));
22383       });
22384       return copy;
22385     }
22386   }
22387 });
22388
22389 // node_modules/graceful-fs/graceful-fs.js
22390 var require_graceful_fs = __commonJS({
22391   "node_modules/graceful-fs/graceful-fs.js"(exports2, module2) {
22392     var fs2 = require("fs");
22393     var polyfills = require_polyfills();
22394     var legacy = require_legacy_streams();
22395     var clone2 = require_clone();
22396     var util = require("util");
22397     var gracefulQueue;
22398     var previousSymbol;
22399     if (typeof Symbol === "function" && typeof Symbol.for === "function") {
22400       gracefulQueue = Symbol.for("graceful-fs.queue");
22401       previousSymbol = Symbol.for("graceful-fs.previous");
22402     } else {
22403       gracefulQueue = "___graceful-fs.queue";
22404       previousSymbol = "___graceful-fs.previous";
22405     }
22406     function noop() {
22407     }
22408     function publishQueue(context, queue2) {
22409       Object.defineProperty(context, gracefulQueue, {
22410         get: function() {
22411           return queue2;
22412         }
22413       });
22414     }
22415     var debug = noop;
22416     if (util.debuglog)
22417       debug = util.debuglog("gfs4");
22418     else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ""))
22419       debug = function() {
22420         var m = util.format.apply(util, arguments);
22421         m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
22422         console.error(m);
22423       };
22424     if (!fs2[gracefulQueue]) {
22425       queue = global[gracefulQueue] || [];
22426       publishQueue(fs2, queue);
22427       fs2.close = function(fs$close) {
22428         function close(fd, cb) {
22429           return fs$close.call(fs2, fd, function(err) {
22430             if (!err) {
22431               retry();
22432             }
22433             if (typeof cb === "function")
22434               cb.apply(this, arguments);
22435           });
22436         }
22437         Object.defineProperty(close, previousSymbol, {
22438           value: fs$close
22439         });
22440         return close;
22441       }(fs2.close);
22442       fs2.closeSync = function(fs$closeSync) {
22443         function closeSync(fd) {
22444           fs$closeSync.apply(fs2, arguments);
22445           retry();
22446         }
22447         Object.defineProperty(closeSync, previousSymbol, {
22448           value: fs$closeSync
22449         });
22450         return closeSync;
22451       }(fs2.closeSync);
22452       if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
22453         process.on("exit", function() {
22454           debug(fs2[gracefulQueue]);
22455           require("assert").equal(fs2[gracefulQueue].length, 0);
22456         });
22457       }
22458     }
22459     var queue;
22460     if (!global[gracefulQueue]) {
22461       publishQueue(global, fs2[gracefulQueue]);
22462     }
22463     module2.exports = patch(clone2(fs2));
22464     if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs2.__patched) {
22465       module2.exports = patch(fs2);
22466       fs2.__patched = true;
22467     }
22468     function patch(fs3) {
22469       polyfills(fs3);
22470       fs3.gracefulify = patch;
22471       fs3.createReadStream = createReadStream;
22472       fs3.createWriteStream = createWriteStream;
22473       var fs$readFile = fs3.readFile;
22474       fs3.readFile = readFile;
22475       function readFile(path2, options, cb) {
22476         if (typeof options === "function")
22477           cb = options, options = null;
22478         return go$readFile(path2, options, cb);
22479         function go$readFile(path3, options2, cb2) {
22480           return fs$readFile(path3, options2, function(err) {
22481             if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
22482               enqueue([go$readFile, [path3, options2, cb2]]);
22483             else {
22484               if (typeof cb2 === "function")
22485                 cb2.apply(this, arguments);
22486               retry();
22487             }
22488           });
22489         }
22490       }
22491       var fs$writeFile = fs3.writeFile;
22492       fs3.writeFile = writeFile;
22493       function writeFile(path2, data, options, cb) {
22494         if (typeof options === "function")
22495           cb = options, options = null;
22496         return go$writeFile(path2, data, options, cb);
22497         function go$writeFile(path3, data2, options2, cb2) {
22498           return fs$writeFile(path3, data2, options2, function(err) {
22499             if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
22500               enqueue([go$writeFile, [path3, data2, options2, cb2]]);
22501             else {
22502               if (typeof cb2 === "function")
22503                 cb2.apply(this, arguments);
22504               retry();
22505             }
22506           });
22507         }
22508       }
22509       var fs$appendFile = fs3.appendFile;
22510       if (fs$appendFile)
22511         fs3.appendFile = appendFile;
22512       function appendFile(path2, data, options, cb) {
22513         if (typeof options === "function")
22514           cb = options, options = null;
22515         return go$appendFile(path2, data, options, cb);
22516         function go$appendFile(path3, data2, options2, cb2) {
22517           return fs$appendFile(path3, data2, options2, function(err) {
22518             if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
22519               enqueue([go$appendFile, [path3, data2, options2, cb2]]);
22520             else {
22521               if (typeof cb2 === "function")
22522                 cb2.apply(this, arguments);
22523               retry();
22524             }
22525           });
22526         }
22527       }
22528       var fs$readdir = fs3.readdir;
22529       fs3.readdir = readdir;
22530       function readdir(path2, options, cb) {
22531         var args = [path2];
22532         if (typeof options !== "function") {
22533           args.push(options);
22534         } else {
22535           cb = options;
22536         }
22537         args.push(go$readdir$cb);
22538         return go$readdir(args);
22539         function go$readdir$cb(err, files) {
22540           if (files && files.sort)
22541             files.sort();
22542           if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
22543             enqueue([go$readdir, [args]]);
22544           else {
22545             if (typeof cb === "function")
22546               cb.apply(this, arguments);
22547             retry();
22548           }
22549         }
22550       }
22551       function go$readdir(args) {
22552         return fs$readdir.apply(fs3, args);
22553       }
22554       if (process.version.substr(0, 4) === "v0.8") {
22555         var legStreams = legacy(fs3);
22556         ReadStream = legStreams.ReadStream;
22557         WriteStream = legStreams.WriteStream;
22558       }
22559       var fs$ReadStream = fs3.ReadStream;
22560       if (fs$ReadStream) {
22561         ReadStream.prototype = Object.create(fs$ReadStream.prototype);
22562         ReadStream.prototype.open = ReadStream$open;
22563       }
22564       var fs$WriteStream = fs3.WriteStream;
22565       if (fs$WriteStream) {
22566         WriteStream.prototype = Object.create(fs$WriteStream.prototype);
22567         WriteStream.prototype.open = WriteStream$open;
22568       }
22569       Object.defineProperty(fs3, "ReadStream", {
22570         get: function() {
22571           return ReadStream;
22572         },
22573         set: function(val) {
22574           ReadStream = val;
22575         },
22576         enumerable: true,
22577         configurable: true
22578       });
22579       Object.defineProperty(fs3, "WriteStream", {
22580         get: function() {
22581           return WriteStream;
22582         },
22583         set: function(val) {
22584           WriteStream = val;
22585         },
22586         enumerable: true,
22587         configurable: true
22588       });
22589       var FileReadStream = ReadStream;
22590       Object.defineProperty(fs3, "FileReadStream", {
22591         get: function() {
22592           return FileReadStream;
22593         },
22594         set: function(val) {
22595           FileReadStream = val;
22596         },
22597         enumerable: true,
22598         configurable: true
22599       });
22600       var FileWriteStream = WriteStream;
22601       Object.defineProperty(fs3, "FileWriteStream", {
22602         get: function() {
22603           return FileWriteStream;
22604         },
22605         set: function(val) {
22606           FileWriteStream = val;
22607         },
22608         enumerable: true,
22609         configurable: true
22610       });
22611       function ReadStream(path2, options) {
22612         if (this instanceof ReadStream)
22613           return fs$ReadStream.apply(this, arguments), this;
22614         else
22615           return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
22616       }
22617       function ReadStream$open() {
22618         var that = this;
22619         open(that.path, that.flags, that.mode, function(err, fd) {
22620           if (err) {
22621             if (that.autoClose)
22622               that.destroy();
22623             that.emit("error", err);
22624           } else {
22625             that.fd = fd;
22626             that.emit("open", fd);
22627             that.read();
22628           }
22629         });
22630       }
22631       function WriteStream(path2, options) {
22632         if (this instanceof WriteStream)
22633           return fs$WriteStream.apply(this, arguments), this;
22634         else
22635           return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
22636       }
22637       function WriteStream$open() {
22638         var that = this;
22639         open(that.path, that.flags, that.mode, function(err, fd) {
22640           if (err) {
22641             that.destroy();
22642             that.emit("error", err);
22643           } else {
22644             that.fd = fd;
22645             that.emit("open", fd);
22646           }
22647         });
22648       }
22649       function createReadStream(path2, options) {
22650         return new fs3.ReadStream(path2, options);
22651       }
22652       function createWriteStream(path2, options) {
22653         return new fs3.WriteStream(path2, options);
22654       }
22655       var fs$open = fs3.open;
22656       fs3.open = open;
22657       function open(path2, flags, mode, cb) {
22658         if (typeof mode === "function")
22659           cb = mode, mode = null;
22660         return go$open(path2, flags, mode, cb);
22661         function go$open(path3, flags2, mode2, cb2) {
22662           return fs$open(path3, flags2, mode2, function(err, fd) {
22663             if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
22664               enqueue([go$open, [path3, flags2, mode2, cb2]]);
22665             else {
22666               if (typeof cb2 === "function")
22667                 cb2.apply(this, arguments);
22668               retry();
22669             }
22670           });
22671         }
22672       }
22673       return fs3;
22674     }
22675     function enqueue(elem) {
22676       debug("ENQUEUE", elem[0].name, elem[1]);
22677       fs2[gracefulQueue].push(elem);
22678     }
22679     function retry() {
22680       var elem = fs2[gracefulQueue].shift();
22681       if (elem) {
22682         debug("RETRY", elem[0].name, elem[1]);
22683         elem[0].apply(null, elem[1]);
22684       }
22685     }
22686   }
22687 });
22688
22689 // node_modules/fstream/lib/get-type.js
22690 var require_get_type = __commonJS({
22691   "node_modules/fstream/lib/get-type.js"(exports2, module2) {
22692     module2.exports = getType;
22693     function getType(st) {
22694       var types = [
22695         "Directory",
22696         "File",
22697         "SymbolicLink",
22698         "Link",
22699         "BlockDevice",
22700         "CharacterDevice",
22701         "FIFO",
22702         "Socket"
22703       ];
22704       var type;
22705       if (st.type && types.indexOf(st.type) !== -1) {
22706         st[st.type] = true;
22707         return st.type;
22708       }
22709       for (var i = 0, l2 = types.length; i < l2; i++) {
22710         type = types[i];
22711         var is = st[type] || st["is" + type];
22712         if (typeof is === "function")
22713           is = is.call(st);
22714         if (is) {
22715           st[type] = true;
22716           st.type = type;
22717           return type;
22718         }
22719       }
22720       return null;
22721     }
22722   }
22723 });
22724
22725 // node_modules/fstream/lib/link-reader.js
22726 var require_link_reader = __commonJS({
22727   "node_modules/fstream/lib/link-reader.js"(exports2, module2) {
22728     module2.exports = LinkReader;
22729     var fs2 = require_graceful_fs();
22730     var inherits2 = require_inherits();
22731     var Reader = require_reader();
22732     inherits2(LinkReader, Reader);
22733     function LinkReader(props) {
22734       var self2 = this;
22735       if (!(self2 instanceof LinkReader)) {
22736         throw new Error("LinkReader must be called as constructor.");
22737       }
22738       if (!(props.type === "Link" && props.Link || props.type === "SymbolicLink" && props.SymbolicLink)) {
22739         throw new Error("Non-link type " + props.type);
22740       }
22741       Reader.call(self2, props);
22742     }
22743     LinkReader.prototype._stat = function(currentStat) {
22744       var self2 = this;
22745       fs2.readlink(self2._path, function(er, linkpath) {
22746         if (er)
22747           return self2.error(er);
22748         self2.linkpath = self2.props.linkpath = linkpath;
22749         self2.emit("linkpath", linkpath);
22750         Reader.prototype._stat.call(self2, currentStat);
22751       });
22752     };
22753     LinkReader.prototype._read = function() {
22754       var self2 = this;
22755       if (self2._paused)
22756         return;
22757       if (!self2._ended) {
22758         self2.emit("end");
22759         self2.emit("close");
22760         self2._ended = true;
22761       }
22762     };
22763   }
22764 });
22765
22766 // node_modules/fstream/lib/dir-reader.js
22767 var require_dir_reader = __commonJS({
22768   "node_modules/fstream/lib/dir-reader.js"(exports2, module2) {
22769     module2.exports = DirReader;
22770     var fs2 = require_graceful_fs();
22771     var inherits2 = require_inherits();
22772     var path2 = require("path");
22773     var Reader = require_reader();
22774     var assert = require("assert").ok;
22775     inherits2(DirReader, Reader);
22776     function DirReader(props) {
22777       var self2 = this;
22778       if (!(self2 instanceof DirReader)) {
22779         throw new Error("DirReader must be called as constructor.");
22780       }
22781       if (props.type !== "Directory" || !props.Directory) {
22782         throw new Error("Non-directory type " + props.type);
22783       }
22784       self2.entries = null;
22785       self2._index = -1;
22786       self2._paused = false;
22787       self2._length = -1;
22788       if (props.sort) {
22789         this.sort = props.sort;
22790       }
22791       Reader.call(this, props);
22792     }
22793     DirReader.prototype._getEntries = function() {
22794       var self2 = this;
22795       if (self2._gotEntries)
22796         return;
22797       self2._gotEntries = true;
22798       fs2.readdir(self2._path, function(er, entries) {
22799         if (er)
22800           return self2.error(er);
22801         self2.entries = entries;
22802         self2.emit("entries", entries);
22803         if (self2._paused)
22804           self2.once("resume", processEntries);
22805         else
22806           processEntries();
22807         function processEntries() {
22808           self2._length = self2.entries.length;
22809           if (typeof self2.sort === "function") {
22810             self2.entries = self2.entries.sort(self2.sort.bind(self2));
22811           }
22812           self2._read();
22813         }
22814       });
22815     };
22816     DirReader.prototype._read = function() {
22817       var self2 = this;
22818       if (!self2.entries)
22819         return self2._getEntries();
22820       if (self2._paused || self2._currentEntry || self2._aborted) {
22821         return;
22822       }
22823       self2._index++;
22824       if (self2._index >= self2.entries.length) {
22825         if (!self2._ended) {
22826           self2._ended = true;
22827           self2.emit("end");
22828           self2.emit("close");
22829         }
22830         return;
22831       }
22832       var p = path2.resolve(self2._path, self2.entries[self2._index]);
22833       assert(p !== self2._path);
22834       assert(self2.entries[self2._index]);
22835       self2._currentEntry = p;
22836       fs2[self2.props.follow ? "stat" : "lstat"](p, function(er, stat) {
22837         if (er)
22838           return self2.error(er);
22839         var who = self2._proxy || self2;
22840         stat.path = p;
22841         stat.basename = path2.basename(p);
22842         stat.dirname = path2.dirname(p);
22843         var childProps = self2.getChildProps.call(who, stat);
22844         childProps.path = p;
22845         childProps.basename = path2.basename(p);
22846         childProps.dirname = path2.dirname(p);
22847         var entry = Reader(childProps, stat);
22848         self2._currentEntry = entry;
22849         entry.on("pause", function(who2) {
22850           if (!self2._paused && !entry._disowned) {
22851             self2.pause(who2);
22852           }
22853         });
22854         entry.on("resume", function(who2) {
22855           if (self2._paused && !entry._disowned) {
22856             self2.resume(who2);
22857           }
22858         });
22859         entry.on("stat", function(props) {
22860           self2.emit("_entryStat", entry, props);
22861           if (entry._aborted)
22862             return;
22863           if (entry._paused) {
22864             entry.once("resume", function() {
22865               self2.emit("entryStat", entry, props);
22866             });
22867           } else
22868             self2.emit("entryStat", entry, props);
22869         });
22870         entry.on("ready", function EMITCHILD() {
22871           if (self2._paused) {
22872             entry.pause(self2);
22873             return self2.once("resume", EMITCHILD);
22874           }
22875           if (entry.type === "Socket") {
22876             self2.emit("socket", entry);
22877           } else {
22878             self2.emitEntry(entry);
22879           }
22880         });
22881         var ended = false;
22882         entry.on("close", onend);
22883         entry.on("disown", onend);
22884         function onend() {
22885           if (ended)
22886             return;
22887           ended = true;
22888           self2.emit("childEnd", entry);
22889           self2.emit("entryEnd", entry);
22890           self2._currentEntry = null;
22891           if (!self2._paused) {
22892             self2._read();
22893           }
22894         }
22895         entry.on("error", function(er2) {
22896           if (entry._swallowErrors) {
22897             self2.warn(er2);
22898             entry.emit("end");
22899             entry.emit("close");
22900           } else {
22901             self2.emit("error", er2);
22902           }
22903         });
22904         [
22905           "child",
22906           "childEnd",
22907           "warn"
22908         ].forEach(function(ev) {
22909           entry.on(ev, self2.emit.bind(self2, ev));
22910         });
22911       });
22912     };
22913     DirReader.prototype.disown = function(entry) {
22914       entry.emit("beforeDisown");
22915       entry._disowned = true;
22916       entry.parent = entry.root = null;
22917       if (entry === this._currentEntry) {
22918         this._currentEntry = null;
22919       }
22920       entry.emit("disown");
22921     };
22922     DirReader.prototype.getChildProps = function() {
22923       return {
22924         depth: this.depth + 1,
22925         root: this.root || this,
22926         parent: this,
22927         follow: this.follow,
22928         filter: this.filter,
22929         sort: this.props.sort,
22930         hardlinks: this.props.hardlinks
22931       };
22932     };
22933     DirReader.prototype.pause = function(who) {
22934       var self2 = this;
22935       if (self2._paused)
22936         return;
22937       who = who || self2;
22938       self2._paused = true;
22939       if (self2._currentEntry && self2._currentEntry.pause) {
22940         self2._currentEntry.pause(who);
22941       }
22942       self2.emit("pause", who);
22943     };
22944     DirReader.prototype.resume = function(who) {
22945       var self2 = this;
22946       if (!self2._paused)
22947         return;
22948       who = who || self2;
22949       self2._paused = false;
22950       self2.emit("resume", who);
22951       if (self2._paused) {
22952         return;
22953       }
22954       if (self2._currentEntry) {
22955         if (self2._currentEntry.resume)
22956           self2._currentEntry.resume(who);
22957       } else
22958         self2._read();
22959     };
22960     DirReader.prototype.emitEntry = function(entry) {
22961       this.emit("entry", entry);
22962       this.emit("child", entry);
22963     };
22964   }
22965 });
22966
22967 // node_modules/fstream/lib/file-reader.js
22968 var require_file_reader = __commonJS({
22969   "node_modules/fstream/lib/file-reader.js"(exports2, module2) {
22970     module2.exports = FileReader;
22971     var fs2 = require_graceful_fs();
22972     var inherits2 = require_inherits();
22973     var Reader = require_reader();
22974     var EOF = { EOF: true };
22975     var CLOSE = { CLOSE: true };
22976     inherits2(FileReader, Reader);
22977     function FileReader(props) {
22978       var self2 = this;
22979       if (!(self2 instanceof FileReader)) {
22980         throw new Error("FileReader must be called as constructor.");
22981       }
22982       if (!(props.type === "Link" && props.Link || props.type === "File" && props.File)) {
22983         throw new Error("Non-file type " + props.type);
22984       }
22985       self2._buffer = [];
22986       self2._bytesEmitted = 0;
22987       Reader.call(self2, props);
22988     }
22989     FileReader.prototype._getStream = function() {
22990       var self2 = this;
22991       var stream = self2._stream = fs2.createReadStream(self2._path, self2.props);
22992       if (self2.props.blksize) {
22993         stream.bufferSize = self2.props.blksize;
22994       }
22995       stream.on("open", self2.emit.bind(self2, "open"));
22996       stream.on("data", function(c) {
22997         self2._bytesEmitted += c.length;
22998         if (!c.length) {
22999           return;
23000         } else if (self2._paused || self2._buffer.length) {
23001           self2._buffer.push(c);
23002           self2._read();
23003         } else
23004           self2.emit("data", c);
23005       });
23006       stream.on("end", function() {
23007         if (self2._paused || self2._buffer.length) {
23008           self2._buffer.push(EOF);
23009           self2._read();
23010         } else {
23011           self2.emit("end");
23012         }
23013         if (self2._bytesEmitted !== self2.props.size) {
23014           self2.error("Didn't get expected byte count\nexpect: " + self2.props.size + "\nactual: " + self2._bytesEmitted);
23015         }
23016       });
23017       stream.on("close", function() {
23018         if (self2._paused || self2._buffer.length) {
23019           self2._buffer.push(CLOSE);
23020           self2._read();
23021         } else {
23022           self2.emit("close");
23023         }
23024       });
23025       stream.on("error", function(e) {
23026         self2.emit("error", e);
23027       });
23028       self2._read();
23029     };
23030     FileReader.prototype._read = function() {
23031       var self2 = this;
23032       if (self2._paused) {
23033         return;
23034       }
23035       if (!self2._stream) {
23036         return self2._getStream();
23037       }
23038       if (self2._buffer.length) {
23039         var buf = self2._buffer;
23040         for (var i = 0, l2 = buf.length; i < l2; i++) {
23041           var c = buf[i];
23042           if (c === EOF) {
23043             self2.emit("end");
23044           } else if (c === CLOSE) {
23045             self2.emit("close");
23046           } else {
23047             self2.emit("data", c);
23048           }
23049           if (self2._paused) {
23050             self2._buffer = buf.slice(i);
23051             return;
23052           }
23053         }
23054         self2._buffer.length = 0;
23055       }
23056     };
23057     FileReader.prototype.pause = function(who) {
23058       var self2 = this;
23059       if (self2._paused)
23060         return;
23061       who = who || self2;
23062       self2._paused = true;
23063       if (self2._stream)
23064         self2._stream.pause();
23065       self2.emit("pause", who);
23066     };
23067     FileReader.prototype.resume = function(who) {
23068       var self2 = this;
23069       if (!self2._paused)
23070         return;
23071       who = who || self2;
23072       self2.emit("resume", who);
23073       self2._paused = false;
23074       if (self2._stream)
23075         self2._stream.resume();
23076       self2._read();
23077     };
23078   }
23079 });
23080
23081 // node_modules/fstream/lib/socket-reader.js
23082 var require_socket_reader = __commonJS({
23083   "node_modules/fstream/lib/socket-reader.js"(exports2, module2) {
23084     module2.exports = SocketReader;
23085     var inherits2 = require_inherits();
23086     var Reader = require_reader();
23087     inherits2(SocketReader, Reader);
23088     function SocketReader(props) {
23089       var self2 = this;
23090       if (!(self2 instanceof SocketReader)) {
23091         throw new Error("SocketReader must be called as constructor.");
23092       }
23093       if (!(props.type === "Socket" && props.Socket)) {
23094         throw new Error("Non-socket type " + props.type);
23095       }
23096       Reader.call(self2, props);
23097     }
23098     SocketReader.prototype._read = function() {
23099       var self2 = this;
23100       if (self2._paused)
23101         return;
23102       if (!self2._ended) {
23103         self2.emit("end");
23104         self2.emit("close");
23105         self2._ended = true;
23106       }
23107     };
23108   }
23109 });
23110
23111 // node_modules/fstream/lib/proxy-reader.js
23112 var require_proxy_reader = __commonJS({
23113   "node_modules/fstream/lib/proxy-reader.js"(exports2, module2) {
23114     module2.exports = ProxyReader;
23115     var Reader = require_reader();
23116     var getType = require_get_type();
23117     var inherits2 = require_inherits();
23118     var fs2 = require_graceful_fs();
23119     inherits2(ProxyReader, Reader);
23120     function ProxyReader(props) {
23121       var self2 = this;
23122       if (!(self2 instanceof ProxyReader)) {
23123         throw new Error("ProxyReader must be called as constructor.");
23124       }
23125       self2.props = props;
23126       self2._buffer = [];
23127       self2.ready = false;
23128       Reader.call(self2, props);
23129     }
23130     ProxyReader.prototype._stat = function() {
23131       var self2 = this;
23132       var props = self2.props;
23133       var stat = props.follow ? "stat" : "lstat";
23134       fs2[stat](props.path, function(er, current) {
23135         var type;
23136         if (er || !current) {
23137           type = "File";
23138         } else {
23139           type = getType(current);
23140         }
23141         props[type] = true;
23142         props.type = self2.type = type;
23143         self2._old = current;
23144         self2._addProxy(Reader(props, current));
23145       });
23146     };
23147     ProxyReader.prototype._addProxy = function(proxy) {
23148       var self2 = this;
23149       if (self2._proxyTarget) {
23150         return self2.error("proxy already set");
23151       }
23152       self2._proxyTarget = proxy;
23153       proxy._proxy = self2;
23154       [
23155         "error",
23156         "data",
23157         "end",
23158         "close",
23159         "linkpath",
23160         "entry",
23161         "entryEnd",
23162         "child",
23163         "childEnd",
23164         "warn",
23165         "stat"
23166       ].forEach(function(ev) {
23167         proxy.on(ev, self2.emit.bind(self2, ev));
23168       });
23169       self2.emit("proxy", proxy);
23170       proxy.on("ready", function() {
23171         self2.ready = true;
23172         self2.emit("ready");
23173       });
23174       var calls = self2._buffer;
23175       self2._buffer.length = 0;
23176       calls.forEach(function(c) {
23177         proxy[c[0]].apply(proxy, c[1]);
23178       });
23179     };
23180     ProxyReader.prototype.pause = function() {
23181       return this._proxyTarget ? this._proxyTarget.pause() : false;
23182     };
23183     ProxyReader.prototype.resume = function() {
23184       return this._proxyTarget ? this._proxyTarget.resume() : false;
23185     };
23186   }
23187 });
23188
23189 // node_modules/fstream/lib/reader.js
23190 var require_reader = __commonJS({
23191   "node_modules/fstream/lib/reader.js"(exports2, module2) {
23192     module2.exports = Reader;
23193     var fs2 = require_graceful_fs();
23194     var Stream2 = require("stream").Stream;
23195     var inherits2 = require_inherits();
23196     var path2 = require("path");
23197     var getType = require_get_type();
23198     var hardLinks = Reader.hardLinks = {};
23199     var Abstract = require_abstract();
23200     inherits2(Reader, Abstract);
23201     var LinkReader = require_link_reader();
23202     function Reader(props, currentStat) {
23203       var self2 = this;
23204       if (!(self2 instanceof Reader))
23205         return new Reader(props, currentStat);
23206       if (typeof props === "string") {
23207         props = { path: props };
23208       }
23209       var type;
23210       var ClassType;
23211       if (props.type && typeof props.type === "function") {
23212         type = props.type;
23213         ClassType = type;
23214       } else {
23215         type = getType(props);
23216         ClassType = Reader;
23217       }
23218       if (currentStat && !type) {
23219         type = getType(currentStat);
23220         props[type] = true;
23221         props.type = type;
23222       }
23223       switch (type) {
23224         case "Directory":
23225           ClassType = require_dir_reader();
23226           break;
23227         case "Link":
23228         case "File":
23229           ClassType = require_file_reader();
23230           break;
23231         case "SymbolicLink":
23232           ClassType = LinkReader;
23233           break;
23234         case "Socket":
23235           ClassType = require_socket_reader();
23236           break;
23237         case null:
23238           ClassType = require_proxy_reader();
23239           break;
23240       }
23241       if (!(self2 instanceof ClassType)) {
23242         return new ClassType(props);
23243       }
23244       Abstract.call(self2);
23245       if (!props.path) {
23246         self2.error("Must provide a path", null, true);
23247       }
23248       self2.readable = true;
23249       self2.writable = false;
23250       self2.type = type;
23251       self2.props = props;
23252       self2.depth = props.depth = props.depth || 0;
23253       self2.parent = props.parent || null;
23254       self2.root = props.root || props.parent && props.parent.root || self2;
23255       self2._path = self2.path = path2.resolve(props.path);
23256       if (process.platform === "win32") {
23257         self2.path = self2._path = self2.path.replace(/\?/g, "_");
23258         if (self2._path.length >= 260) {
23259           self2._swallowErrors = true;
23260           self2._path = "\\\\?\\" + self2.path.replace(/\//g, "\\");
23261         }
23262       }
23263       self2.basename = props.basename = path2.basename(self2.path);
23264       self2.dirname = props.dirname = path2.dirname(self2.path);
23265       props.parent = props.root = null;
23266       self2.size = props.size;
23267       self2.filter = typeof props.filter === "function" ? props.filter : null;
23268       if (props.sort === "alpha")
23269         props.sort = alphasort;
23270       self2._stat(currentStat);
23271     }
23272     function alphasort(a, b) {
23273       return a === b ? 0 : a.toLowerCase() > b.toLowerCase() ? 1 : a.toLowerCase() < b.toLowerCase() ? -1 : a > b ? 1 : -1;
23274     }
23275     Reader.prototype._stat = function(currentStat) {
23276       var self2 = this;
23277       var props = self2.props;
23278       var stat = props.follow ? "stat" : "lstat";
23279       if (currentStat)
23280         process.nextTick(statCb.bind(null, null, currentStat));
23281       else
23282         fs2[stat](self2._path, statCb);
23283       function statCb(er, props_) {
23284         if (er)
23285           return self2.error(er);
23286         Object.keys(props_).forEach(function(k2) {
23287           props[k2] = props_[k2];
23288         });
23289         if (self2.size !== void 0 && props.size !== self2.size) {
23290           return self2.error("incorrect size");
23291         }
23292         self2.size = props.size;
23293         var type = getType(props);
23294         var handleHardlinks = props.hardlinks !== false;
23295         if (handleHardlinks && type !== "Directory" && props.nlink && props.nlink > 1) {
23296           var k = props.dev + ":" + props.ino;
23297           if (hardLinks[k] === self2._path || !hardLinks[k]) {
23298             hardLinks[k] = self2._path;
23299           } else {
23300             type = self2.type = self2.props.type = "Link";
23301             self2.Link = self2.props.Link = true;
23302             self2.linkpath = self2.props.linkpath = hardLinks[k];
23303             self2._stat = self2._read = LinkReader.prototype._read;
23304           }
23305         }
23306         if (self2.type && self2.type !== type) {
23307           self2.error("Unexpected type: " + type);
23308         }
23309         if (self2.filter) {
23310           var who = self2._proxy || self2;
23311           if (!self2.filter.call(who, who, props)) {
23312             if (!self2._disowned) {
23313               self2.abort();
23314               self2.emit("end");
23315               self2.emit("close");
23316             }
23317             return;
23318           }
23319         }
23320         var events = ["_stat", "stat", "ready"];
23321         var e = 0;
23322         (function go() {
23323           if (self2._aborted) {
23324             self2.emit("end");
23325             self2.emit("close");
23326             return;
23327           }
23328           if (self2._paused && self2.type !== "Directory") {
23329             self2.once("resume", go);
23330             return;
23331           }
23332           var ev = events[e++];
23333           if (!ev) {
23334             return self2._read();
23335           }
23336           self2.emit(ev, props);
23337           go();
23338         })();
23339       }
23340     };
23341     Reader.prototype.pipe = function(dest) {
23342       var self2 = this;
23343       if (typeof dest.add === "function") {
23344         self2.on("entry", function(entry) {
23345           var ret2 = dest.add(entry);
23346           if (ret2 === false) {
23347             self2.pause();
23348           }
23349         });
23350       }
23351       return Stream2.prototype.pipe.apply(this, arguments);
23352     };
23353     Reader.prototype.pause = function(who) {
23354       this._paused = true;
23355       who = who || this;
23356       this.emit("pause", who);
23357       if (this._stream)
23358         this._stream.pause(who);
23359     };
23360     Reader.prototype.resume = function(who) {
23361       this._paused = false;
23362       who = who || this;
23363       this.emit("resume", who);
23364       if (this._stream)
23365         this._stream.resume(who);
23366       this._read();
23367     };
23368     Reader.prototype._read = function() {
23369       this.error("Cannot read unknown type: " + this.type);
23370     };
23371   }
23372 });
23373
23374 // node_modules/fstream/node_modules/rimraf/rimraf.js
23375 var require_rimraf2 = __commonJS({
23376   "node_modules/fstream/node_modules/rimraf/rimraf.js"(exports2, module2) {
23377     module2.exports = rimraf;
23378     rimraf.sync = rimrafSync;
23379     var assert = require("assert");
23380     var path2 = require("path");
23381     var fs2 = require("fs");
23382     var glob = void 0;
23383     try {
23384       glob = require_glob();
23385     } catch (_err) {
23386     }
23387     var _0666 = parseInt("666", 8);
23388     var defaultGlobOpts = {
23389       nosort: true,
23390       silent: true
23391     };
23392     var timeout = 0;
23393     var isWindows = process.platform === "win32";
23394     function defaults(options) {
23395       var methods = [
23396         "unlink",
23397         "chmod",
23398         "stat",
23399         "lstat",
23400         "rmdir",
23401         "readdir"
23402       ];
23403       methods.forEach(function(m) {
23404         options[m] = options[m] || fs2[m];
23405         m = m + "Sync";
23406         options[m] = options[m] || fs2[m];
23407       });
23408       options.maxBusyTries = options.maxBusyTries || 3;
23409       options.emfileWait = options.emfileWait || 1e3;
23410       if (options.glob === false) {
23411         options.disableGlob = true;
23412       }
23413       if (options.disableGlob !== true && glob === void 0) {
23414         throw Error("glob dependency not found, set `options.disableGlob = true` if intentional");
23415       }
23416       options.disableGlob = options.disableGlob || false;
23417       options.glob = options.glob || defaultGlobOpts;
23418     }
23419     function rimraf(p, options, cb) {
23420       if (typeof options === "function") {
23421         cb = options;
23422         options = {};
23423       }
23424       assert(p, "rimraf: missing path");
23425       assert.equal(typeof p, "string", "rimraf: path should be a string");
23426       assert.equal(typeof cb, "function", "rimraf: callback function required");
23427       assert(options, "rimraf: invalid options argument provided");
23428       assert.equal(typeof options, "object", "rimraf: options should be object");
23429       defaults(options);
23430       var busyTries = 0;
23431       var errState = null;
23432       var n = 0;
23433       if (options.disableGlob || !glob.hasMagic(p))
23434         return afterGlob(null, [p]);
23435       options.lstat(p, function(er, stat) {
23436         if (!er)
23437           return afterGlob(null, [p]);
23438         glob(p, options.glob, afterGlob);
23439       });
23440       function next(er) {
23441         errState = errState || er;
23442         if (--n === 0)
23443           cb(errState);
23444       }
23445       function afterGlob(er, results2) {
23446         if (er)
23447           return cb(er);
23448         n = results2.length;
23449         if (n === 0)
23450           return cb();
23451         results2.forEach(function(p2) {
23452           rimraf_(p2, options, function CB(er2) {
23453             if (er2) {
23454               if ((er2.code === "EBUSY" || er2.code === "ENOTEMPTY" || er2.code === "EPERM") && busyTries < options.maxBusyTries) {
23455                 busyTries++;
23456                 var time = busyTries * 100;
23457                 return setTimeout(function() {
23458                   rimraf_(p2, options, CB);
23459                 }, time);
23460               }
23461               if (er2.code === "EMFILE" && timeout < options.emfileWait) {
23462                 return setTimeout(function() {
23463                   rimraf_(p2, options, CB);
23464                 }, timeout++);
23465               }
23466               if (er2.code === "ENOENT")
23467                 er2 = null;
23468             }
23469             timeout = 0;
23470             next(er2);
23471           });
23472         });
23473       }
23474     }
23475     function rimraf_(p, options, cb) {
23476       assert(p);
23477       assert(options);
23478       assert(typeof cb === "function");
23479       options.lstat(p, function(er, st) {
23480         if (er && er.code === "ENOENT")
23481           return cb(null);
23482         if (er && er.code === "EPERM" && isWindows)
23483           fixWinEPERM(p, options, er, cb);
23484         if (st && st.isDirectory())
23485           return rmdir(p, options, er, cb);
23486         options.unlink(p, function(er2) {
23487           if (er2) {
23488             if (er2.code === "ENOENT")
23489               return cb(null);
23490             if (er2.code === "EPERM")
23491               return isWindows ? fixWinEPERM(p, options, er2, cb) : rmdir(p, options, er2, cb);
23492             if (er2.code === "EISDIR")
23493               return rmdir(p, options, er2, cb);
23494           }
23495           return cb(er2);
23496         });
23497       });
23498     }
23499     function fixWinEPERM(p, options, er, cb) {
23500       assert(p);
23501       assert(options);
23502       assert(typeof cb === "function");
23503       if (er)
23504         assert(er instanceof Error);
23505       options.chmod(p, _0666, function(er2) {
23506         if (er2)
23507           cb(er2.code === "ENOENT" ? null : er);
23508         else
23509           options.stat(p, function(er3, stats) {
23510             if (er3)
23511               cb(er3.code === "ENOENT" ? null : er);
23512             else if (stats.isDirectory())
23513               rmdir(p, options, er, cb);
23514             else
23515               options.unlink(p, cb);
23516           });
23517       });
23518     }
23519     function fixWinEPERMSync(p, options, er) {
23520       assert(p);
23521       assert(options);
23522       if (er)
23523         assert(er instanceof Error);
23524       try {
23525         options.chmodSync(p, _0666);
23526       } catch (er2) {
23527         if (er2.code === "ENOENT")
23528           return;
23529         else
23530           throw er;
23531       }
23532       try {
23533         var stats = options.statSync(p);
23534       } catch (er3) {
23535         if (er3.code === "ENOENT")
23536           return;
23537         else
23538           throw er;
23539       }
23540       if (stats.isDirectory())
23541         rmdirSync(p, options, er);
23542       else
23543         options.unlinkSync(p);
23544     }
23545     function rmdir(p, options, originalEr, cb) {
23546       assert(p);
23547       assert(options);
23548       if (originalEr)
23549         assert(originalEr instanceof Error);
23550       assert(typeof cb === "function");
23551       options.rmdir(p, function(er) {
23552         if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM"))
23553           rmkids(p, options, cb);
23554         else if (er && er.code === "ENOTDIR")
23555           cb(originalEr);
23556         else
23557           cb(er);
23558       });
23559     }
23560     function rmkids(p, options, cb) {
23561       assert(p);
23562       assert(options);
23563       assert(typeof cb === "function");
23564       options.readdir(p, function(er, files) {
23565         if (er)
23566           return cb(er);
23567         var n = files.length;
23568         if (n === 0)
23569           return options.rmdir(p, cb);
23570         var errState;
23571         files.forEach(function(f) {
23572           rimraf(path2.join(p, f), options, function(er2) {
23573             if (errState)
23574               return;
23575             if (er2)
23576               return cb(errState = er2);
23577             if (--n === 0)
23578               options.rmdir(p, cb);
23579           });
23580         });
23581       });
23582     }
23583     function rimrafSync(p, options) {
23584       options = options || {};
23585       defaults(options);
23586       assert(p, "rimraf: missing path");
23587       assert.equal(typeof p, "string", "rimraf: path should be a string");
23588       assert(options, "rimraf: missing options");
23589       assert.equal(typeof options, "object", "rimraf: options should be object");
23590       var results2;
23591       if (options.disableGlob || !glob.hasMagic(p)) {
23592         results2 = [p];
23593       } else {
23594         try {
23595           options.lstatSync(p);
23596           results2 = [p];
23597         } catch (er) {
23598           results2 = glob.sync(p, options.glob);
23599         }
23600       }
23601       if (!results2.length)
23602         return;
23603       for (var i = 0; i < results2.length; i++) {
23604         var p = results2[i];
23605         try {
23606           var st = options.lstatSync(p);
23607         } catch (er) {
23608           if (er.code === "ENOENT")
23609             return;
23610           if (er.code === "EPERM" && isWindows)
23611             fixWinEPERMSync(p, options, er);
23612         }
23613         try {
23614           if (st && st.isDirectory())
23615             rmdirSync(p, options, null);
23616           else
23617             options.unlinkSync(p);
23618         } catch (er) {
23619           if (er.code === "ENOENT")
23620             return;
23621           if (er.code === "EPERM")
23622             return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er);
23623           if (er.code !== "EISDIR")
23624             throw er;
23625           rmdirSync(p, options, er);
23626         }
23627       }
23628     }
23629     function rmdirSync(p, options, originalEr) {
23630       assert(p);
23631       assert(options);
23632       if (originalEr)
23633         assert(originalEr instanceof Error);
23634       try {
23635         options.rmdirSync(p);
23636       } catch (er) {
23637         if (er.code === "ENOENT")
23638           return;
23639         if (er.code === "ENOTDIR")
23640           throw originalEr;
23641         if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")
23642           rmkidsSync(p, options);
23643       }
23644     }
23645     function rmkidsSync(p, options) {
23646       assert(p);
23647       assert(options);
23648       options.readdirSync(p).forEach(function(f) {
23649         rimrafSync(path2.join(p, f), options);
23650       });
23651       var retries = isWindows ? 100 : 1;
23652       var i = 0;
23653       do {
23654         var threw = true;
23655         try {
23656           var ret2 = options.rmdirSync(p, options);
23657           threw = false;
23658           return ret2;
23659         } finally {
23660           if (++i < retries && threw)
23661             continue;
23662         }
23663       } while (true);
23664     }
23665   }
23666 });
23667
23668 // node_modules/mkdirp/index.js
23669 var require_mkdirp = __commonJS({
23670   "node_modules/mkdirp/index.js"(exports2, module2) {
23671     var path2 = require("path");
23672     var fs2 = require("fs");
23673     var _0777 = parseInt("0777", 8);
23674     module2.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;
23675     function mkdirP(p, opts, f, made) {
23676       if (typeof opts === "function") {
23677         f = opts;
23678         opts = {};
23679       } else if (!opts || typeof opts !== "object") {
23680         opts = { mode: opts };
23681       }
23682       var mode = opts.mode;
23683       var xfs = opts.fs || fs2;
23684       if (mode === void 0) {
23685         mode = _0777;
23686       }
23687       if (!made)
23688         made = null;
23689       var cb = f || function() {
23690       };
23691       p = path2.resolve(p);
23692       xfs.mkdir(p, mode, function(er) {
23693         if (!er) {
23694           made = made || p;
23695           return cb(null, made);
23696         }
23697         switch (er.code) {
23698           case "ENOENT":
23699             if (path2.dirname(p) === p)
23700               return cb(er);
23701             mkdirP(path2.dirname(p), opts, function(er2, made2) {
23702               if (er2)
23703                 cb(er2, made2);
23704               else
23705                 mkdirP(p, opts, cb, made2);
23706             });
23707             break;
23708           default:
23709             xfs.stat(p, function(er2, stat) {
23710               if (er2 || !stat.isDirectory())
23711                 cb(er, made);
23712               else
23713                 cb(null, made);
23714             });
23715             break;
23716         }
23717       });
23718     }
23719     mkdirP.sync = function sync(p, opts, made) {
23720       if (!opts || typeof opts !== "object") {
23721         opts = { mode: opts };
23722       }
23723       var mode = opts.mode;
23724       var xfs = opts.fs || fs2;
23725       if (mode === void 0) {
23726         mode = _0777;
23727       }
23728       if (!made)
23729         made = null;
23730       p = path2.resolve(p);
23731       try {
23732         xfs.mkdirSync(p, mode);
23733         made = made || p;
23734       } catch (err0) {
23735         switch (err0.code) {
23736           case "ENOENT":
23737             made = sync(path2.dirname(p), opts, made);
23738             sync(p, opts, made);
23739             break;
23740           default:
23741             var stat;
23742             try {
23743               stat = xfs.statSync(p);
23744             } catch (err1) {
23745               throw err0;
23746             }
23747             if (!stat.isDirectory())
23748               throw err0;
23749             break;
23750         }
23751       }
23752       return made;
23753     };
23754   }
23755 });
23756
23757 // node_modules/fstream/lib/collect.js
23758 var require_collect = __commonJS({
23759   "node_modules/fstream/lib/collect.js"(exports2, module2) {
23760     module2.exports = collect;
23761     function collect(stream) {
23762       if (stream._collected)
23763         return;
23764       if (stream._paused)
23765         return stream.on("resume", collect.bind(null, stream));
23766       stream._collected = true;
23767       stream.pause();
23768       stream.on("data", save);
23769       stream.on("end", save);
23770       var buf = [];
23771       function save(b) {
23772         if (typeof b === "string")
23773           b = new Buffer(b);
23774         if (Buffer.isBuffer(b) && !b.length)
23775           return;
23776         buf.push(b);
23777       }
23778       stream.on("entry", saveEntry);
23779       var entryBuffer = [];
23780       function saveEntry(e) {
23781         collect(e);
23782         entryBuffer.push(e);
23783       }
23784       stream.on("proxy", proxyPause);
23785       function proxyPause(p) {
23786         p.pause();
23787       }
23788       stream.pipe = function(orig) {
23789         return function(dest) {
23790           var e = 0;
23791           (function unblockEntry() {
23792             var entry = entryBuffer[e++];
23793             if (!entry)
23794               return resume();
23795             entry.on("end", unblockEntry);
23796             if (dest)
23797               dest.add(entry);
23798             else
23799               stream.emit("entry", entry);
23800           })();
23801           function resume() {
23802             stream.removeListener("entry", saveEntry);
23803             stream.removeListener("data", save);
23804             stream.removeListener("end", save);
23805             stream.pipe = orig;
23806             if (dest)
23807               stream.pipe(dest);
23808             buf.forEach(function(b) {
23809               if (b)
23810                 stream.emit("data", b);
23811               else
23812                 stream.emit("end");
23813             });
23814             stream.resume();
23815           }
23816           return dest;
23817         };
23818       }(stream.pipe);
23819     }
23820   }
23821 });
23822
23823 // node_modules/fstream/lib/dir-writer.js
23824 var require_dir_writer = __commonJS({
23825   "node_modules/fstream/lib/dir-writer.js"(exports2, module2) {
23826     module2.exports = DirWriter;
23827     var Writer = require_writer();
23828     var inherits2 = require_inherits();
23829     var mkdir = require_mkdirp();
23830     var path2 = require("path");
23831     var collect = require_collect();
23832     inherits2(DirWriter, Writer);
23833     function DirWriter(props) {
23834       var self2 = this;
23835       if (!(self2 instanceof DirWriter)) {
23836         self2.error("DirWriter must be called as constructor.", null, true);
23837       }
23838       if (props.type !== "Directory" || !props.Directory) {
23839         self2.error("Non-directory type " + props.type + " " + JSON.stringify(props), null, true);
23840       }
23841       Writer.call(this, props);
23842     }
23843     DirWriter.prototype._create = function() {
23844       var self2 = this;
23845       mkdir(self2._path, Writer.dirmode, function(er) {
23846         if (er)
23847           return self2.error(er);
23848         self2.ready = true;
23849         self2.emit("ready");
23850         self2._process();
23851       });
23852     };
23853     DirWriter.prototype.write = function() {
23854       return true;
23855     };
23856     DirWriter.prototype.end = function() {
23857       this._ended = true;
23858       this._process();
23859     };
23860     DirWriter.prototype.add = function(entry) {
23861       var self2 = this;
23862       collect(entry);
23863       if (!self2.ready || self2._currentEntry) {
23864         self2._buffer.push(entry);
23865         return false;
23866       }
23867       if (self2._ended) {
23868         return self2.error("add after end");
23869       }
23870       self2._buffer.push(entry);
23871       self2._process();
23872       return this._buffer.length === 0;
23873     };
23874     DirWriter.prototype._process = function() {
23875       var self2 = this;
23876       if (self2._processing)
23877         return;
23878       var entry = self2._buffer.shift();
23879       if (!entry) {
23880         self2.emit("drain");
23881         if (self2._ended)
23882           self2._finish();
23883         return;
23884       }
23885       self2._processing = true;
23886       self2.emit("entry", entry);
23887       var p = entry;
23888       var pp;
23889       do {
23890         pp = p._path || p.path;
23891         if (pp === self2.root._path || pp === self2._path || pp && pp.indexOf(self2._path) === 0) {
23892           self2._processing = false;
23893           if (entry._collected)
23894             entry.pipe();
23895           return self2._process();
23896         }
23897         p = p.parent;
23898       } while (p);
23899       var props = {
23900         parent: self2,
23901         root: self2.root || self2,
23902         type: entry.type,
23903         depth: self2.depth + 1
23904       };
23905       pp = entry._path || entry.path || entry.props.path;
23906       if (entry.parent) {
23907         pp = pp.substr(entry.parent._path.length + 1);
23908       }
23909       props.path = path2.join(self2.path, path2.join("/", pp));
23910       props.filter = self2.filter;
23911       Object.keys(entry.props).forEach(function(k) {
23912         if (!props.hasOwnProperty(k)) {
23913           props[k] = entry.props[k];
23914         }
23915       });
23916       var child = self2._currentChild = new Writer(props);
23917       child.on("ready", function() {
23918         entry.pipe(child);
23919         entry.resume();
23920       });
23921       child.on("error", function(er) {
23922         if (child._swallowErrors) {
23923           self2.warn(er);
23924           child.emit("end");
23925           child.emit("close");
23926         } else {
23927           self2.emit("error", er);
23928         }
23929       });
23930       child.on("close", onend);
23931       var ended = false;
23932       function onend() {
23933         if (ended)
23934           return;
23935         ended = true;
23936         self2._currentChild = null;
23937         self2._processing = false;
23938         self2._process();
23939       }
23940     };
23941   }
23942 });
23943
23944 // node_modules/fstream/lib/link-writer.js
23945 var require_link_writer = __commonJS({
23946   "node_modules/fstream/lib/link-writer.js"(exports2, module2) {
23947     module2.exports = LinkWriter;
23948     var fs2 = require_graceful_fs();
23949     var Writer = require_writer();
23950     var inherits2 = require_inherits();
23951     var path2 = require("path");
23952     var rimraf = require_rimraf2();
23953     inherits2(LinkWriter, Writer);
23954     function LinkWriter(props) {
23955       var self2 = this;
23956       if (!(self2 instanceof LinkWriter)) {
23957         throw new Error("LinkWriter must be called as constructor.");
23958       }
23959       if (!(props.type === "Link" && props.Link || props.type === "SymbolicLink" && props.SymbolicLink)) {
23960         throw new Error("Non-link type " + props.type);
23961       }
23962       if (props.linkpath === "")
23963         props.linkpath = ".";
23964       if (!props.linkpath) {
23965         self2.error("Need linkpath property to create " + props.type);
23966       }
23967       Writer.call(this, props);
23968     }
23969     LinkWriter.prototype._create = function() {
23970       var self2 = this;
23971       var hard = self2.type === "Link" || process.platform === "win32";
23972       var link = hard ? "link" : "symlink";
23973       var lp = hard ? path2.resolve(self2.dirname, self2.linkpath) : self2.linkpath;
23974       if (hard)
23975         return clobber(self2, lp, link);
23976       fs2.readlink(self2._path, function(er, p) {
23977         if (p && p === lp)
23978           return finish(self2);
23979         clobber(self2, lp, link);
23980       });
23981     };
23982     function clobber(self2, lp, link) {
23983       rimraf(self2._path, function(er) {
23984         if (er)
23985           return self2.error(er);
23986         create(self2, lp, link);
23987       });
23988     }
23989     function create(self2, lp, link) {
23990       fs2[link](lp, self2._path, function(er) {
23991         if (er) {
23992           if ((er.code === "ENOENT" || er.code === "EACCES" || er.code === "EPERM") && process.platform === "win32") {
23993             self2.ready = true;
23994             self2.emit("ready");
23995             self2.emit("end");
23996             self2.emit("close");
23997             self2.end = self2._finish = function() {
23998             };
23999           } else
24000             return self2.error(er);
24001         }
24002         finish(self2);
24003       });
24004     }
24005     function finish(self2) {
24006       self2.ready = true;
24007       self2.emit("ready");
24008       if (self2._ended && !self2._finished)
24009         self2._finish();
24010     }
24011     LinkWriter.prototype.end = function() {
24012       this._ended = true;
24013       if (this.ready) {
24014         this._finished = true;
24015         this._finish();
24016       }
24017     };
24018   }
24019 });
24020
24021 // node_modules/fstream/lib/file-writer.js
24022 var require_file_writer = __commonJS({
24023   "node_modules/fstream/lib/file-writer.js"(exports2, module2) {
24024     module2.exports = FileWriter;
24025     var fs2 = require_graceful_fs();
24026     var Writer = require_writer();
24027     var inherits2 = require_inherits();
24028     var EOF = {};
24029     inherits2(FileWriter, Writer);
24030     function FileWriter(props) {
24031       var self2 = this;
24032       if (!(self2 instanceof FileWriter)) {
24033         throw new Error("FileWriter must be called as constructor.");
24034       }
24035       if (props.type !== "File" || !props.File) {
24036         throw new Error("Non-file type " + props.type);
24037       }
24038       self2._buffer = [];
24039       self2._bytesWritten = 0;
24040       Writer.call(this, props);
24041     }
24042     FileWriter.prototype._create = function() {
24043       var self2 = this;
24044       if (self2._stream)
24045         return;
24046       var so = {};
24047       if (self2.props.flags)
24048         so.flags = self2.props.flags;
24049       so.mode = Writer.filemode;
24050       if (self2._old && self2._old.blksize)
24051         so.bufferSize = self2._old.blksize;
24052       self2._stream = fs2.createWriteStream(self2._path, so);
24053       self2._stream.on("open", function() {
24054         self2.ready = true;
24055         self2._buffer.forEach(function(c) {
24056           if (c === EOF)
24057             self2._stream.end();
24058           else
24059             self2._stream.write(c);
24060         });
24061         self2.emit("ready");
24062         self2.emit("drain");
24063       });
24064       self2._stream.on("error", function(er) {
24065         self2.emit("error", er);
24066       });
24067       self2._stream.on("drain", function() {
24068         self2.emit("drain");
24069       });
24070       self2._stream.on("close", function() {
24071         self2._finish();
24072       });
24073     };
24074     FileWriter.prototype.write = function(c) {
24075       var self2 = this;
24076       self2._bytesWritten += c.length;
24077       if (!self2.ready) {
24078         if (!Buffer.isBuffer(c) && typeof c !== "string") {
24079           throw new Error("invalid write data");
24080         }
24081         self2._buffer.push(c);
24082         return false;
24083       }
24084       var ret2 = self2._stream.write(c);
24085       if (ret2 === false && self2._stream._queue) {
24086         return self2._stream._queue.length <= 2;
24087       } else {
24088         return ret2;
24089       }
24090     };
24091     FileWriter.prototype.end = function(c) {
24092       var self2 = this;
24093       if (c)
24094         self2.write(c);
24095       if (!self2.ready) {
24096         self2._buffer.push(EOF);
24097         return false;
24098       }
24099       return self2._stream.end();
24100     };
24101     FileWriter.prototype._finish = function() {
24102       var self2 = this;
24103       if (typeof self2.size === "number" && self2._bytesWritten !== self2.size) {
24104         self2.error("Did not get expected byte count.\nexpect: " + self2.size + "\nactual: " + self2._bytesWritten);
24105       }
24106       Writer.prototype._finish.call(self2);
24107     };
24108   }
24109 });
24110
24111 // node_modules/fstream/lib/proxy-writer.js
24112 var require_proxy_writer = __commonJS({
24113   "node_modules/fstream/lib/proxy-writer.js"(exports2, module2) {
24114     module2.exports = ProxyWriter;
24115     var Writer = require_writer();
24116     var getType = require_get_type();
24117     var inherits2 = require_inherits();
24118     var collect = require_collect();
24119     var fs2 = require("fs");
24120     inherits2(ProxyWriter, Writer);
24121     function ProxyWriter(props) {
24122       var self2 = this;
24123       if (!(self2 instanceof ProxyWriter)) {
24124         throw new Error("ProxyWriter must be called as constructor.");
24125       }
24126       self2.props = props;
24127       self2._needDrain = false;
24128       Writer.call(self2, props);
24129     }
24130     ProxyWriter.prototype._stat = function() {
24131       var self2 = this;
24132       var props = self2.props;
24133       var stat = props.follow ? "stat" : "lstat";
24134       fs2[stat](props.path, function(er, current) {
24135         var type;
24136         if (er || !current) {
24137           type = "File";
24138         } else {
24139           type = getType(current);
24140         }
24141         props[type] = true;
24142         props.type = self2.type = type;
24143         self2._old = current;
24144         self2._addProxy(Writer(props, current));
24145       });
24146     };
24147     ProxyWriter.prototype._addProxy = function(proxy) {
24148       var self2 = this;
24149       if (self2._proxy) {
24150         return self2.error("proxy already set");
24151       }
24152       self2._proxy = proxy;
24153       [
24154         "ready",
24155         "error",
24156         "close",
24157         "pipe",
24158         "drain",
24159         "warn"
24160       ].forEach(function(ev) {
24161         proxy.on(ev, self2.emit.bind(self2, ev));
24162       });
24163       self2.emit("proxy", proxy);
24164       var calls = self2._buffer;
24165       calls.forEach(function(c) {
24166         proxy[c[0]].apply(proxy, c[1]);
24167       });
24168       self2._buffer.length = 0;
24169       if (self2._needsDrain)
24170         self2.emit("drain");
24171     };
24172     ProxyWriter.prototype.add = function(entry) {
24173       collect(entry);
24174       if (!this._proxy) {
24175         this._buffer.push(["add", [entry]]);
24176         this._needDrain = true;
24177         return false;
24178       }
24179       return this._proxy.add(entry);
24180     };
24181     ProxyWriter.prototype.write = function(c) {
24182       if (!this._proxy) {
24183         this._buffer.push(["write", [c]]);
24184         this._needDrain = true;
24185         return false;
24186       }
24187       return this._proxy.write(c);
24188     };
24189     ProxyWriter.prototype.end = function(c) {
24190       if (!this._proxy) {
24191         this._buffer.push(["end", [c]]);
24192         return false;
24193       }
24194       return this._proxy.end(c);
24195     };
24196   }
24197 });
24198
24199 // node_modules/fstream/lib/writer.js
24200 var require_writer = __commonJS({
24201   "node_modules/fstream/lib/writer.js"(exports2, module2) {
24202     module2.exports = Writer;
24203     var fs2 = require_graceful_fs();
24204     var inherits2 = require_inherits();
24205     var rimraf = require_rimraf2();
24206     var mkdir = require_mkdirp();
24207     var path2 = require("path");
24208     var umask = process.platform === "win32" ? 0 : process.umask();
24209     var getType = require_get_type();
24210     var Abstract = require_abstract();
24211     inherits2(Writer, Abstract);
24212     Writer.dirmode = parseInt("0777", 8) & ~umask;
24213     Writer.filemode = parseInt("0666", 8) & ~umask;
24214     var DirWriter = require_dir_writer();
24215     var LinkWriter = require_link_writer();
24216     var FileWriter = require_file_writer();
24217     var ProxyWriter = require_proxy_writer();
24218     function Writer(props, current) {
24219       var self2 = this;
24220       if (typeof props === "string") {
24221         props = { path: props };
24222       }
24223       var type = getType(props);
24224       var ClassType = Writer;
24225       switch (type) {
24226         case "Directory":
24227           ClassType = DirWriter;
24228           break;
24229         case "File":
24230           ClassType = FileWriter;
24231           break;
24232         case "Link":
24233         case "SymbolicLink":
24234           ClassType = LinkWriter;
24235           break;
24236         case null:
24237         default:
24238           ClassType = ProxyWriter;
24239           break;
24240       }
24241       if (!(self2 instanceof ClassType))
24242         return new ClassType(props);
24243       Abstract.call(self2);
24244       if (!props.path)
24245         self2.error("Must provide a path", null, true);
24246       self2.type = props.type;
24247       self2.props = props;
24248       self2.depth = props.depth || 0;
24249       self2.clobber = props.clobber === false ? props.clobber : true;
24250       self2.parent = props.parent || null;
24251       self2.root = props.root || props.parent && props.parent.root || self2;
24252       self2._path = self2.path = path2.resolve(props.path);
24253       if (process.platform === "win32") {
24254         self2.path = self2._path = self2.path.replace(/\?/g, "_");
24255         if (self2._path.length >= 260) {
24256           self2._swallowErrors = true;
24257           self2._path = "\\\\?\\" + self2.path.replace(/\//g, "\\");
24258         }
24259       }
24260       self2.basename = path2.basename(props.path);
24261       self2.dirname = path2.dirname(props.path);
24262       self2.linkpath = props.linkpath || null;
24263       props.parent = props.root = null;
24264       self2.size = props.size;
24265       if (typeof props.mode === "string") {
24266         props.mode = parseInt(props.mode, 8);
24267       }
24268       self2.readable = false;
24269       self2.writable = true;
24270       self2._buffer = [];
24271       self2.ready = false;
24272       self2.filter = typeof props.filter === "function" ? props.filter : null;
24273       self2._stat(current);
24274     }
24275     Writer.prototype._create = function() {
24276       var self2 = this;
24277       fs2[self2.props.follow ? "stat" : "lstat"](self2._path, function(er) {
24278         if (er) {
24279           return self2.warn("Cannot create " + self2._path + "\nUnsupported type: " + self2.type, "ENOTSUP");
24280         }
24281         self2._finish();
24282       });
24283     };
24284     Writer.prototype._stat = function(current) {
24285       var self2 = this;
24286       var props = self2.props;
24287       var stat = props.follow ? "stat" : "lstat";
24288       var who = self2._proxy || self2;
24289       if (current)
24290         statCb(null, current);
24291       else
24292         fs2[stat](self2._path, statCb);
24293       function statCb(er, current2) {
24294         if (self2.filter && !self2.filter.call(who, who, current2)) {
24295           self2._aborted = true;
24296           self2.emit("end");
24297           self2.emit("close");
24298           return;
24299         }
24300         if (er || !current2) {
24301           return create(self2);
24302         }
24303         self2._old = current2;
24304         var currentType = getType(current2);
24305         if (currentType !== self2.type || self2.type === "File" && current2.nlink > 1) {
24306           return rimraf(self2._path, function(er2) {
24307             if (er2)
24308               return self2.error(er2);
24309             self2._old = null;
24310             create(self2);
24311           });
24312         }
24313         create(self2);
24314       }
24315     };
24316     function create(self2) {
24317       mkdir(path2.dirname(self2._path), Writer.dirmode, function(er, made) {
24318         if (er)
24319           return self2.error(er);
24320         self2._madeDir = made;
24321         return self2._create();
24322       });
24323     }
24324     function endChmod(self2, want, current, path3, cb) {
24325       var wantMode = want.mode;
24326       var chmod = want.follow || self2.type !== "SymbolicLink" ? "chmod" : "lchmod";
24327       if (!fs2[chmod])
24328         return cb();
24329       if (typeof wantMode !== "number")
24330         return cb();
24331       var curMode = current.mode & parseInt("0777", 8);
24332       wantMode = wantMode & parseInt("0777", 8);
24333       if (wantMode === curMode)
24334         return cb();
24335       fs2[chmod](path3, wantMode, cb);
24336     }
24337     function endChown(self2, want, current, path3, cb) {
24338       if (process.platform === "win32")
24339         return cb();
24340       if (!process.getuid || process.getuid() !== 0)
24341         return cb();
24342       if (typeof want.uid !== "number" && typeof want.gid !== "number")
24343         return cb();
24344       if (current.uid === want.uid && current.gid === want.gid)
24345         return cb();
24346       var chown = self2.props.follow || self2.type !== "SymbolicLink" ? "chown" : "lchown";
24347       if (!fs2[chown])
24348         return cb();
24349       if (typeof want.uid !== "number")
24350         want.uid = current.uid;
24351       if (typeof want.gid !== "number")
24352         want.gid = current.gid;
24353       fs2[chown](path3, want.uid, want.gid, cb);
24354     }
24355     function endUtimes(self2, want, current, path3, cb) {
24356       if (!fs2.utimes || process.platform === "win32")
24357         return cb();
24358       var utimes = want.follow || self2.type !== "SymbolicLink" ? "utimes" : "lutimes";
24359       if (utimes === "lutimes" && !fs2[utimes]) {
24360         utimes = "utimes";
24361       }
24362       if (!fs2[utimes])
24363         return cb();
24364       var curA = current.atime;
24365       var curM = current.mtime;
24366       var meA = want.atime;
24367       var meM = want.mtime;
24368       if (meA === void 0)
24369         meA = curA;
24370       if (meM === void 0)
24371         meM = curM;
24372       if (!isDate(meA))
24373         meA = new Date(meA);
24374       if (!isDate(meM))
24375         meA = new Date(meM);
24376       if (meA.getTime() === curA.getTime() && meM.getTime() === curM.getTime())
24377         return cb();
24378       fs2[utimes](path3, meA, meM, cb);
24379     }
24380     Writer.prototype._finish = function() {
24381       var self2 = this;
24382       if (self2._finishing)
24383         return;
24384       self2._finishing = true;
24385       var todo = 0;
24386       var errState = null;
24387       var done = false;
24388       if (self2._old) {
24389         self2._old.atime = new Date(0);
24390         self2._old.mtime = new Date(0);
24391         setProps(self2._old);
24392       } else {
24393         var stat = self2.props.follow ? "stat" : "lstat";
24394         fs2[stat](self2._path, function(er, current) {
24395           if (er) {
24396             if (er.code === "ENOENT" && (self2.type === "Link" || self2.type === "SymbolicLink") && process.platform === "win32") {
24397               self2.ready = true;
24398               self2.emit("ready");
24399               self2.emit("end");
24400               self2.emit("close");
24401               self2.end = self2._finish = function() {
24402               };
24403               return;
24404             } else
24405               return self2.error(er);
24406           }
24407           setProps(self2._old = current);
24408         });
24409       }
24410       return;
24411       function setProps(current) {
24412         todo += 3;
24413         endChmod(self2, self2.props, current, self2._path, next("chmod"));
24414         endChown(self2, self2.props, current, self2._path, next("chown"));
24415         endUtimes(self2, self2.props, current, self2._path, next("utimes"));
24416       }
24417       function next(what) {
24418         return function(er) {
24419           if (errState)
24420             return;
24421           if (er) {
24422             er.fstream_finish_call = what;
24423             return self2.error(errState = er);
24424           }
24425           if (--todo > 0)
24426             return;
24427           if (done)
24428             return;
24429           done = true;
24430           if (!self2._madeDir)
24431             return end();
24432           else
24433             endMadeDir(self2, self2._path, end);
24434           function end(er2) {
24435             if (er2) {
24436               er2.fstream_finish_call = "setupMadeDir";
24437               return self2.error(er2);
24438             }
24439             self2.emit("end");
24440             self2.emit("close");
24441           }
24442         };
24443       }
24444     };
24445     function endMadeDir(self2, p, cb) {
24446       var made = self2._madeDir;
24447       var d = path2.dirname(p);
24448       endMadeDir_(self2, d, function(er) {
24449         if (er)
24450           return cb(er);
24451         if (d === made) {
24452           return cb();
24453         }
24454         endMadeDir(self2, d, cb);
24455       });
24456     }
24457     function endMadeDir_(self2, p, cb) {
24458       var dirProps = {};
24459       Object.keys(self2.props).forEach(function(k) {
24460         dirProps[k] = self2.props[k];
24461         if (k === "mode" && self2.type !== "Directory") {
24462           dirProps[k] = dirProps[k] | parseInt("0111", 8);
24463         }
24464       });
24465       var todo = 3;
24466       var errState = null;
24467       fs2.stat(p, function(er, current) {
24468         if (er)
24469           return cb(errState = er);
24470         endChmod(self2, dirProps, current, p, next);
24471         endChown(self2, dirProps, current, p, next);
24472         endUtimes(self2, dirProps, current, p, next);
24473       });
24474       function next(er) {
24475         if (errState)
24476           return;
24477         if (er)
24478           return cb(errState = er);
24479         if (--todo === 0)
24480           return cb();
24481       }
24482     }
24483     Writer.prototype.pipe = function() {
24484       this.error("Can't pipe from writable stream");
24485     };
24486     Writer.prototype.add = function() {
24487       this.error("Can't add to non-Directory type");
24488     };
24489     Writer.prototype.write = function() {
24490       return true;
24491     };
24492     function objectToString(d) {
24493       return Object.prototype.toString.call(d);
24494     }
24495     function isDate(d) {
24496       return typeof d === "object" && objectToString(d) === "[object Date]";
24497     }
24498   }
24499 });
24500
24501 // node_modules/fstream/fstream.js
24502 var require_fstream = __commonJS({
24503   "node_modules/fstream/fstream.js"(exports2) {
24504     exports2.Abstract = require_abstract();
24505     exports2.Reader = require_reader();
24506     exports2.Writer = require_writer();
24507     exports2.File = {
24508       Reader: require_file_reader(),
24509       Writer: require_file_writer()
24510     };
24511     exports2.Dir = {
24512       Reader: require_dir_reader(),
24513       Writer: require_dir_writer()
24514     };
24515     exports2.Link = {
24516       Reader: require_link_reader(),
24517       Writer: require_link_writer()
24518     };
24519     exports2.Proxy = {
24520       Reader: require_proxy_reader(),
24521       Writer: require_proxy_writer()
24522     };
24523     exports2.Reader.Dir = exports2.DirReader = exports2.Dir.Reader;
24524     exports2.Reader.File = exports2.FileReader = exports2.File.Reader;
24525     exports2.Reader.Link = exports2.LinkReader = exports2.Link.Reader;
24526     exports2.Reader.Proxy = exports2.ProxyReader = exports2.Proxy.Reader;
24527     exports2.Writer.Dir = exports2.DirWriter = exports2.Dir.Writer;
24528     exports2.Writer.File = exports2.FileWriter = exports2.File.Writer;
24529     exports2.Writer.Link = exports2.LinkWriter = exports2.Link.Writer;
24530     exports2.Writer.Proxy = exports2.ProxyWriter = exports2.Proxy.Writer;
24531     exports2.collect = require_collect();
24532   }
24533 });
24534
24535 // node_modules/unzipper/lib/extract.js
24536 var require_extract = __commonJS({
24537   "node_modules/unzipper/lib/extract.js"(exports2, module2) {
24538     module2.exports = Extract;
24539     var Parse = require_parse3();
24540     var Writer = require_fstream().Writer;
24541     var path2 = require("path");
24542     var stream = require("stream");
24543     var duplexer2 = require_duplexer2();
24544     var Promise2 = require_bluebird();
24545     function Extract(opts) {
24546       opts.path = path2.resolve(path2.normalize(opts.path));
24547       var parser = new Parse(opts);
24548       var outStream = new stream.Writable({ objectMode: true });
24549       outStream._write = function(entry, encoding, cb) {
24550         if (entry.type == "Directory")
24551           return cb();
24552         var extractPath = path2.join(opts.path, entry.path);
24553         if (extractPath.indexOf(opts.path) != 0) {
24554           return cb();
24555         }
24556         const writer = opts.getWriter ? opts.getWriter({ path: extractPath }) : Writer({ path: extractPath });
24557         entry.pipe(writer).on("error", cb).on("close", cb);
24558       };
24559       var extract = duplexer2(parser, outStream);
24560       parser.once("crx-header", function(crxHeader) {
24561         extract.crxHeader = crxHeader;
24562       });
24563       parser.pipe(outStream).on("finish", function() {
24564         extract.emit("close");
24565       });
24566       extract.promise = function() {
24567         return new Promise2(function(resolve, reject) {
24568           extract.on("close", resolve);
24569           extract.on("error", reject);
24570         });
24571       };
24572       return extract;
24573     }
24574   }
24575 });
24576
24577 // node_modules/big-integer/BigInteger.js
24578 var require_BigInteger = __commonJS({
24579   "node_modules/big-integer/BigInteger.js"(exports2, module2) {
24580     var bigInt = function(undefined2) {
24581       "use strict";
24582       var BASE = 1e7, LOG_BASE = 7, MAX_INT = 9007199254740992, MAX_INT_ARR = smallToArray(MAX_INT), DEFAULT_ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz";
24583       var supportsNativeBigInt = typeof BigInt === "function";
24584       function Integer(v, radix, alphabet, caseSensitive) {
24585         if (typeof v === "undefined")
24586           return Integer[0];
24587         if (typeof radix !== "undefined")
24588           return +radix === 10 && !alphabet ? parseValue(v) : parseBase(v, radix, alphabet, caseSensitive);
24589         return parseValue(v);
24590       }
24591       function BigInteger(value, sign) {
24592         this.value = value;
24593         this.sign = sign;
24594         this.isSmall = false;
24595       }
24596       BigInteger.prototype = Object.create(Integer.prototype);
24597       function SmallInteger(value) {
24598         this.value = value;
24599         this.sign = value < 0;
24600         this.isSmall = true;
24601       }
24602       SmallInteger.prototype = Object.create(Integer.prototype);
24603       function NativeBigInt(value) {
24604         this.value = value;
24605       }
24606       NativeBigInt.prototype = Object.create(Integer.prototype);
24607       function isPrecise(n) {
24608         return -MAX_INT < n && n < MAX_INT;
24609       }
24610       function smallToArray(n) {
24611         if (n < 1e7)
24612           return [n];
24613         if (n < 1e14)
24614           return [n % 1e7, Math.floor(n / 1e7)];
24615         return [n % 1e7, Math.floor(n / 1e7) % 1e7, Math.floor(n / 1e14)];
24616       }
24617       function arrayToSmall(arr) {
24618         trim(arr);
24619         var length = arr.length;
24620         if (length < 4 && compareAbs(arr, MAX_INT_ARR) < 0) {
24621           switch (length) {
24622             case 0:
24623               return 0;
24624             case 1:
24625               return arr[0];
24626             case 2:
24627               return arr[0] + arr[1] * BASE;
24628             default:
24629               return arr[0] + (arr[1] + arr[2] * BASE) * BASE;
24630           }
24631         }
24632         return arr;
24633       }
24634       function trim(v) {
24635         var i2 = v.length;
24636         while (v[--i2] === 0)
24637           ;
24638         v.length = i2 + 1;
24639       }
24640       function createArray(length) {
24641         var x = new Array(length);
24642         var i2 = -1;
24643         while (++i2 < length) {
24644           x[i2] = 0;
24645         }
24646         return x;
24647       }
24648       function truncate(n) {
24649         if (n > 0)
24650           return Math.floor(n);
24651         return Math.ceil(n);
24652       }
24653       function add(a, b) {
24654         var l_a = a.length, l_b = b.length, r = new Array(l_a), carry = 0, base = BASE, sum, i2;
24655         for (i2 = 0; i2 < l_b; i2++) {
24656           sum = a[i2] + b[i2] + carry;
24657           carry = sum >= base ? 1 : 0;
24658           r[i2] = sum - carry * base;
24659         }
24660         while (i2 < l_a) {
24661           sum = a[i2] + carry;
24662           carry = sum === base ? 1 : 0;
24663           r[i2++] = sum - carry * base;
24664         }
24665         if (carry > 0)
24666           r.push(carry);
24667         return r;
24668       }
24669       function addAny(a, b) {
24670         if (a.length >= b.length)
24671           return add(a, b);
24672         return add(b, a);
24673       }
24674       function addSmall(a, carry) {
24675         var l2 = a.length, r = new Array(l2), base = BASE, sum, i2;
24676         for (i2 = 0; i2 < l2; i2++) {
24677           sum = a[i2] - base + carry;
24678           carry = Math.floor(sum / base);
24679           r[i2] = sum - carry * base;
24680           carry += 1;
24681         }
24682         while (carry > 0) {
24683           r[i2++] = carry % base;
24684           carry = Math.floor(carry / base);
24685         }
24686         return r;
24687       }
24688       BigInteger.prototype.add = function(v) {
24689         var n = parseValue(v);
24690         if (this.sign !== n.sign) {
24691           return this.subtract(n.negate());
24692         }
24693         var a = this.value, b = n.value;
24694         if (n.isSmall) {
24695           return new BigInteger(addSmall(a, Math.abs(b)), this.sign);
24696         }
24697         return new BigInteger(addAny(a, b), this.sign);
24698       };
24699       BigInteger.prototype.plus = BigInteger.prototype.add;
24700       SmallInteger.prototype.add = function(v) {
24701         var n = parseValue(v);
24702         var a = this.value;
24703         if (a < 0 !== n.sign) {
24704           return this.subtract(n.negate());
24705         }
24706         var b = n.value;
24707         if (n.isSmall) {
24708           if (isPrecise(a + b))
24709             return new SmallInteger(a + b);
24710           b = smallToArray(Math.abs(b));
24711         }
24712         return new BigInteger(addSmall(b, Math.abs(a)), a < 0);
24713       };
24714       SmallInteger.prototype.plus = SmallInteger.prototype.add;
24715       NativeBigInt.prototype.add = function(v) {
24716         return new NativeBigInt(this.value + parseValue(v).value);
24717       };
24718       NativeBigInt.prototype.plus = NativeBigInt.prototype.add;
24719       function subtract(a, b) {
24720         var a_l = a.length, b_l = b.length, r = new Array(a_l), borrow = 0, base = BASE, i2, difference;
24721         for (i2 = 0; i2 < b_l; i2++) {
24722           difference = a[i2] - borrow - b[i2];
24723           if (difference < 0) {
24724             difference += base;
24725             borrow = 1;
24726           } else
24727             borrow = 0;
24728           r[i2] = difference;
24729         }
24730         for (i2 = b_l; i2 < a_l; i2++) {
24731           difference = a[i2] - borrow;
24732           if (difference < 0)
24733             difference += base;
24734           else {
24735             r[i2++] = difference;
24736             break;
24737           }
24738           r[i2] = difference;
24739         }
24740         for (; i2 < a_l; i2++) {
24741           r[i2] = a[i2];
24742         }
24743         trim(r);
24744         return r;
24745       }
24746       function subtractAny(a, b, sign) {
24747         var value;
24748         if (compareAbs(a, b) >= 0) {
24749           value = subtract(a, b);
24750         } else {
24751           value = subtract(b, a);
24752           sign = !sign;
24753         }
24754         value = arrayToSmall(value);
24755         if (typeof value === "number") {
24756           if (sign)
24757             value = -value;
24758           return new SmallInteger(value);
24759         }
24760         return new BigInteger(value, sign);
24761       }
24762       function subtractSmall(a, b, sign) {
24763         var l2 = a.length, r = new Array(l2), carry = -b, base = BASE, i2, difference;
24764         for (i2 = 0; i2 < l2; i2++) {
24765           difference = a[i2] + carry;
24766           carry = Math.floor(difference / base);
24767           difference %= base;
24768           r[i2] = difference < 0 ? difference + base : difference;
24769         }
24770         r = arrayToSmall(r);
24771         if (typeof r === "number") {
24772           if (sign)
24773             r = -r;
24774           return new SmallInteger(r);
24775         }
24776         return new BigInteger(r, sign);
24777       }
24778       BigInteger.prototype.subtract = function(v) {
24779         var n = parseValue(v);
24780         if (this.sign !== n.sign) {
24781           return this.add(n.negate());
24782         }
24783         var a = this.value, b = n.value;
24784         if (n.isSmall)
24785           return subtractSmall(a, Math.abs(b), this.sign);
24786         return subtractAny(a, b, this.sign);
24787       };
24788       BigInteger.prototype.minus = BigInteger.prototype.subtract;
24789       SmallInteger.prototype.subtract = function(v) {
24790         var n = parseValue(v);
24791         var a = this.value;
24792         if (a < 0 !== n.sign) {
24793           return this.add(n.negate());
24794         }
24795         var b = n.value;
24796         if (n.isSmall) {
24797           return new SmallInteger(a - b);
24798         }
24799         return subtractSmall(b, Math.abs(a), a >= 0);
24800       };
24801       SmallInteger.prototype.minus = SmallInteger.prototype.subtract;
24802       NativeBigInt.prototype.subtract = function(v) {
24803         return new NativeBigInt(this.value - parseValue(v).value);
24804       };
24805       NativeBigInt.prototype.minus = NativeBigInt.prototype.subtract;
24806       BigInteger.prototype.negate = function() {
24807         return new BigInteger(this.value, !this.sign);
24808       };
24809       SmallInteger.prototype.negate = function() {
24810         var sign = this.sign;
24811         var small = new SmallInteger(-this.value);
24812         small.sign = !sign;
24813         return small;
24814       };
24815       NativeBigInt.prototype.negate = function() {
24816         return new NativeBigInt(-this.value);
24817       };
24818       BigInteger.prototype.abs = function() {
24819         return new BigInteger(this.value, false);
24820       };
24821       SmallInteger.prototype.abs = function() {
24822         return new SmallInteger(Math.abs(this.value));
24823       };
24824       NativeBigInt.prototype.abs = function() {
24825         return new NativeBigInt(this.value >= 0 ? this.value : -this.value);
24826       };
24827       function multiplyLong(a, b) {
24828         var a_l = a.length, b_l = b.length, l2 = a_l + b_l, r = createArray(l2), base = BASE, product, carry, i2, a_i, b_j;
24829         for (i2 = 0; i2 < a_l; ++i2) {
24830           a_i = a[i2];
24831           for (var j = 0; j < b_l; ++j) {
24832             b_j = b[j];
24833             product = a_i * b_j + r[i2 + j];
24834             carry = Math.floor(product / base);
24835             r[i2 + j] = product - carry * base;
24836             r[i2 + j + 1] += carry;
24837           }
24838         }
24839         trim(r);
24840         return r;
24841       }
24842       function multiplySmall(a, b) {
24843         var l2 = a.length, r = new Array(l2), base = BASE, carry = 0, product, i2;
24844         for (i2 = 0; i2 < l2; i2++) {
24845           product = a[i2] * b + carry;
24846           carry = Math.floor(product / base);
24847           r[i2] = product - carry * base;
24848         }
24849         while (carry > 0) {
24850           r[i2++] = carry % base;
24851           carry = Math.floor(carry / base);
24852         }
24853         return r;
24854       }
24855       function shiftLeft(x, n) {
24856         var r = [];
24857         while (n-- > 0)
24858           r.push(0);
24859         return r.concat(x);
24860       }
24861       function multiplyKaratsuba(x, y) {
24862         var n = Math.max(x.length, y.length);
24863         if (n <= 30)
24864           return multiplyLong(x, y);
24865         n = Math.ceil(n / 2);
24866         var b = x.slice(n), a = x.slice(0, n), d = y.slice(n), c = y.slice(0, n);
24867         var ac = multiplyKaratsuba(a, c), bd = multiplyKaratsuba(b, d), abcd = multiplyKaratsuba(addAny(a, b), addAny(c, d));
24868         var product = addAny(addAny(ac, shiftLeft(subtract(subtract(abcd, ac), bd), n)), shiftLeft(bd, 2 * n));
24869         trim(product);
24870         return product;
24871       }
24872       function useKaratsuba(l1, l2) {
24873         return -0.012 * l1 - 0.012 * l2 + 15e-6 * l1 * l2 > 0;
24874       }
24875       BigInteger.prototype.multiply = function(v) {
24876         var n = parseValue(v), a = this.value, b = n.value, sign = this.sign !== n.sign, abs;
24877         if (n.isSmall) {
24878           if (b === 0)
24879             return Integer[0];
24880           if (b === 1)
24881             return this;
24882           if (b === -1)
24883             return this.negate();
24884           abs = Math.abs(b);
24885           if (abs < BASE) {
24886             return new BigInteger(multiplySmall(a, abs), sign);
24887           }
24888           b = smallToArray(abs);
24889         }
24890         if (useKaratsuba(a.length, b.length))
24891           return new BigInteger(multiplyKaratsuba(a, b), sign);
24892         return new BigInteger(multiplyLong(a, b), sign);
24893       };
24894       BigInteger.prototype.times = BigInteger.prototype.multiply;
24895       function multiplySmallAndArray(a, b, sign) {
24896         if (a < BASE) {
24897           return new BigInteger(multiplySmall(b, a), sign);
24898         }
24899         return new BigInteger(multiplyLong(b, smallToArray(a)), sign);
24900       }
24901       SmallInteger.prototype._multiplyBySmall = function(a) {
24902         if (isPrecise(a.value * this.value)) {
24903           return new SmallInteger(a.value * this.value);
24904         }
24905         return multiplySmallAndArray(Math.abs(a.value), smallToArray(Math.abs(this.value)), this.sign !== a.sign);
24906       };
24907       BigInteger.prototype._multiplyBySmall = function(a) {
24908         if (a.value === 0)
24909           return Integer[0];
24910         if (a.value === 1)
24911           return this;
24912         if (a.value === -1)
24913           return this.negate();
24914         return multiplySmallAndArray(Math.abs(a.value), this.value, this.sign !== a.sign);
24915       };
24916       SmallInteger.prototype.multiply = function(v) {
24917         return parseValue(v)._multiplyBySmall(this);
24918       };
24919       SmallInteger.prototype.times = SmallInteger.prototype.multiply;
24920       NativeBigInt.prototype.multiply = function(v) {
24921         return new NativeBigInt(this.value * parseValue(v).value);
24922       };
24923       NativeBigInt.prototype.times = NativeBigInt.prototype.multiply;
24924       function square(a) {
24925         var l2 = a.length, r = createArray(l2 + l2), base = BASE, product, carry, i2, a_i, a_j;
24926         for (i2 = 0; i2 < l2; i2++) {
24927           a_i = a[i2];
24928           carry = 0 - a_i * a_i;
24929           for (var j = i2; j < l2; j++) {
24930             a_j = a[j];
24931             product = 2 * (a_i * a_j) + r[i2 + j] + carry;
24932             carry = Math.floor(product / base);
24933             r[i2 + j] = product - carry * base;
24934           }
24935           r[i2 + l2] = carry;
24936         }
24937         trim(r);
24938         return r;
24939       }
24940       BigInteger.prototype.square = function() {
24941         return new BigInteger(square(this.value), false);
24942       };
24943       SmallInteger.prototype.square = function() {
24944         var value = this.value * this.value;
24945         if (isPrecise(value))
24946           return new SmallInteger(value);
24947         return new BigInteger(square(smallToArray(Math.abs(this.value))), false);
24948       };
24949       NativeBigInt.prototype.square = function(v) {
24950         return new NativeBigInt(this.value * this.value);
24951       };
24952       function divMod1(a, b) {
24953         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, l2, q;
24954         if (remainder.length <= a_l)
24955           remainder.push(0);
24956         divisor.push(0);
24957         divisorMostSignificantDigit = divisor[b_l - 1];
24958         for (shift = a_l - b_l; shift >= 0; shift--) {
24959           quotientDigit = base - 1;
24960           if (remainder[shift + b_l] !== divisorMostSignificantDigit) {
24961             quotientDigit = Math.floor((remainder[shift + b_l] * base + remainder[shift + b_l - 1]) / divisorMostSignificantDigit);
24962           }
24963           carry = 0;
24964           borrow = 0;
24965           l2 = divisor.length;
24966           for (i2 = 0; i2 < l2; i2++) {
24967             carry += quotientDigit * divisor[i2];
24968             q = Math.floor(carry / base);
24969             borrow += remainder[shift + i2] - (carry - q * base);
24970             carry = q;
24971             if (borrow < 0) {
24972               remainder[shift + i2] = borrow + base;
24973               borrow = -1;
24974             } else {
24975               remainder[shift + i2] = borrow;
24976               borrow = 0;
24977             }
24978           }
24979           while (borrow !== 0) {
24980             quotientDigit -= 1;
24981             carry = 0;
24982             for (i2 = 0; i2 < l2; i2++) {
24983               carry += remainder[shift + i2] - base + divisor[i2];
24984               if (carry < 0) {
24985                 remainder[shift + i2] = carry + base;
24986                 carry = 0;
24987               } else {
24988                 remainder[shift + i2] = carry;
24989                 carry = 1;
24990               }
24991             }
24992             borrow += carry;
24993           }
24994           result[shift] = quotientDigit;
24995         }
24996         remainder = divModSmall(remainder, lambda)[0];
24997         return [arrayToSmall(result), arrayToSmall(remainder)];
24998       }
24999       function divMod2(a, b) {
25000         var a_l = a.length, b_l = b.length, result = [], part = [], base = BASE, guess, xlen, highx, highy, check;
25001         while (a_l) {
25002           part.unshift(a[--a_l]);
25003           trim(part);
25004           if (compareAbs(part, b) < 0) {
25005             result.push(0);
25006             continue;
25007           }
25008           xlen = part.length;
25009           highx = part[xlen - 1] * base + part[xlen - 2];
25010           highy = b[b_l - 1] * base + b[b_l - 2];
25011           if (xlen > b_l) {
25012             highx = (highx + 1) * base;
25013           }
25014           guess = Math.ceil(highx / highy);
25015           do {
25016             check = multiplySmall(b, guess);
25017             if (compareAbs(check, part) <= 0)
25018               break;
25019             guess--;
25020           } while (guess);
25021           result.push(guess);
25022           part = subtract(part, check);
25023         }
25024         result.reverse();
25025         return [arrayToSmall(result), arrayToSmall(part)];
25026       }
25027       function divModSmall(value, lambda) {
25028         var length = value.length, quotient = createArray(length), base = BASE, i2, q, remainder, divisor;
25029         remainder = 0;
25030         for (i2 = length - 1; i2 >= 0; --i2) {
25031           divisor = remainder * base + value[i2];
25032           q = truncate(divisor / lambda);
25033           remainder = divisor - q * lambda;
25034           quotient[i2] = q | 0;
25035         }
25036         return [quotient, remainder | 0];
25037       }
25038       function divModAny(self2, v) {
25039         var value, n = parseValue(v);
25040         if (supportsNativeBigInt) {
25041           return [new NativeBigInt(self2.value / n.value), new NativeBigInt(self2.value % n.value)];
25042         }
25043         var a = self2.value, b = n.value;
25044         var quotient;
25045         if (b === 0)
25046           throw new Error("Cannot divide by zero");
25047         if (self2.isSmall) {
25048           if (n.isSmall) {
25049             return [new SmallInteger(truncate(a / b)), new SmallInteger(a % b)];
25050           }
25051           return [Integer[0], self2];
25052         }
25053         if (n.isSmall) {
25054           if (b === 1)
25055             return [self2, Integer[0]];
25056           if (b == -1)
25057             return [self2.negate(), Integer[0]];
25058           var abs = Math.abs(b);
25059           if (abs < BASE) {
25060             value = divModSmall(a, abs);
25061             quotient = arrayToSmall(value[0]);
25062             var remainder = value[1];
25063             if (self2.sign)
25064               remainder = -remainder;
25065             if (typeof quotient === "number") {
25066               if (self2.sign !== n.sign)
25067                 quotient = -quotient;
25068               return [new SmallInteger(quotient), new SmallInteger(remainder)];
25069             }
25070             return [new BigInteger(quotient, self2.sign !== n.sign), new SmallInteger(remainder)];
25071           }
25072           b = smallToArray(abs);
25073         }
25074         var comparison = compareAbs(a, b);
25075         if (comparison === -1)
25076           return [Integer[0], self2];
25077         if (comparison === 0)
25078           return [Integer[self2.sign === n.sign ? 1 : -1], Integer[0]];
25079         if (a.length + b.length <= 200)
25080           value = divMod1(a, b);
25081         else
25082           value = divMod2(a, b);
25083         quotient = value[0];
25084         var qSign = self2.sign !== n.sign, mod = value[1], mSign = self2.sign;
25085         if (typeof quotient === "number") {
25086           if (qSign)
25087             quotient = -quotient;
25088           quotient = new SmallInteger(quotient);
25089         } else
25090           quotient = new BigInteger(quotient, qSign);
25091         if (typeof mod === "number") {
25092           if (mSign)
25093             mod = -mod;
25094           mod = new SmallInteger(mod);
25095         } else
25096           mod = new BigInteger(mod, mSign);
25097         return [quotient, mod];
25098       }
25099       BigInteger.prototype.divmod = function(v) {
25100         var result = divModAny(this, v);
25101         return {
25102           quotient: result[0],
25103           remainder: result[1]
25104         };
25105       };
25106       NativeBigInt.prototype.divmod = SmallInteger.prototype.divmod = BigInteger.prototype.divmod;
25107       BigInteger.prototype.divide = function(v) {
25108         return divModAny(this, v)[0];
25109       };
25110       NativeBigInt.prototype.over = NativeBigInt.prototype.divide = function(v) {
25111         return new NativeBigInt(this.value / parseValue(v).value);
25112       };
25113       SmallInteger.prototype.over = SmallInteger.prototype.divide = BigInteger.prototype.over = BigInteger.prototype.divide;
25114       BigInteger.prototype.mod = function(v) {
25115         return divModAny(this, v)[1];
25116       };
25117       NativeBigInt.prototype.mod = NativeBigInt.prototype.remainder = function(v) {
25118         return new NativeBigInt(this.value % parseValue(v).value);
25119       };
25120       SmallInteger.prototype.remainder = SmallInteger.prototype.mod = BigInteger.prototype.remainder = BigInteger.prototype.mod;
25121       BigInteger.prototype.pow = function(v) {
25122         var n = parseValue(v), a = this.value, b = n.value, value, x, y;
25123         if (b === 0)
25124           return Integer[1];
25125         if (a === 0)
25126           return Integer[0];
25127         if (a === 1)
25128           return Integer[1];
25129         if (a === -1)
25130           return n.isEven() ? Integer[1] : Integer[-1];
25131         if (n.sign) {
25132           return Integer[0];
25133         }
25134         if (!n.isSmall)
25135           throw new Error("The exponent " + n.toString() + " is too large.");
25136         if (this.isSmall) {
25137           if (isPrecise(value = Math.pow(a, b)))
25138             return new SmallInteger(truncate(value));
25139         }
25140         x = this;
25141         y = Integer[1];
25142         while (true) {
25143           if (b & true) {
25144             y = y.times(x);
25145             --b;
25146           }
25147           if (b === 0)
25148             break;
25149           b /= 2;
25150           x = x.square();
25151         }
25152         return y;
25153       };
25154       SmallInteger.prototype.pow = BigInteger.prototype.pow;
25155       NativeBigInt.prototype.pow = function(v) {
25156         var n = parseValue(v);
25157         var a = this.value, b = n.value;
25158         var _0 = BigInt(0), _1 = BigInt(1), _2 = BigInt(2);
25159         if (b === _0)
25160           return Integer[1];
25161         if (a === _0)
25162           return Integer[0];
25163         if (a === _1)
25164           return Integer[1];
25165         if (a === BigInt(-1))
25166           return n.isEven() ? Integer[1] : Integer[-1];
25167         if (n.isNegative())
25168           return new NativeBigInt(_0);
25169         var x = this;
25170         var y = Integer[1];
25171         while (true) {
25172           if ((b & _1) === _1) {
25173             y = y.times(x);
25174             --b;
25175           }
25176           if (b === _0)
25177             break;
25178           b /= _2;
25179           x = x.square();
25180         }
25181         return y;
25182       };
25183       BigInteger.prototype.modPow = function(exp, mod) {
25184         exp = parseValue(exp);
25185         mod = parseValue(mod);
25186         if (mod.isZero())
25187           throw new Error("Cannot take modPow with modulus 0");
25188         var r = Integer[1], base = this.mod(mod);
25189         if (exp.isNegative()) {
25190           exp = exp.multiply(Integer[-1]);
25191           base = base.modInv(mod);
25192         }
25193         while (exp.isPositive()) {
25194           if (base.isZero())
25195             return Integer[0];
25196           if (exp.isOdd())
25197             r = r.multiply(base).mod(mod);
25198           exp = exp.divide(2);
25199           base = base.square().mod(mod);
25200         }
25201         return r;
25202       };
25203       NativeBigInt.prototype.modPow = SmallInteger.prototype.modPow = BigInteger.prototype.modPow;
25204       function compareAbs(a, b) {
25205         if (a.length !== b.length) {
25206           return a.length > b.length ? 1 : -1;
25207         }
25208         for (var i2 = a.length - 1; i2 >= 0; i2--) {
25209           if (a[i2] !== b[i2])
25210             return a[i2] > b[i2] ? 1 : -1;
25211         }
25212         return 0;
25213       }
25214       BigInteger.prototype.compareAbs = function(v) {
25215         var n = parseValue(v), a = this.value, b = n.value;
25216         if (n.isSmall)
25217           return 1;
25218         return compareAbs(a, b);
25219       };
25220       SmallInteger.prototype.compareAbs = function(v) {
25221         var n = parseValue(v), a = Math.abs(this.value), b = n.value;
25222         if (n.isSmall) {
25223           b = Math.abs(b);
25224           return a === b ? 0 : a > b ? 1 : -1;
25225         }
25226         return -1;
25227       };
25228       NativeBigInt.prototype.compareAbs = function(v) {
25229         var a = this.value;
25230         var b = parseValue(v).value;
25231         a = a >= 0 ? a : -a;
25232         b = b >= 0 ? b : -b;
25233         return a === b ? 0 : a > b ? 1 : -1;
25234       };
25235       BigInteger.prototype.compare = function(v) {
25236         if (v === Infinity) {
25237           return -1;
25238         }
25239         if (v === -Infinity) {
25240           return 1;
25241         }
25242         var n = parseValue(v), a = this.value, b = n.value;
25243         if (this.sign !== n.sign) {
25244           return n.sign ? 1 : -1;
25245         }
25246         if (n.isSmall) {
25247           return this.sign ? -1 : 1;
25248         }
25249         return compareAbs(a, b) * (this.sign ? -1 : 1);
25250       };
25251       BigInteger.prototype.compareTo = BigInteger.prototype.compare;
25252       SmallInteger.prototype.compare = function(v) {
25253         if (v === Infinity) {
25254           return -1;
25255         }
25256         if (v === -Infinity) {
25257           return 1;
25258         }
25259         var n = parseValue(v), a = this.value, b = n.value;
25260         if (n.isSmall) {
25261           return a == b ? 0 : a > b ? 1 : -1;
25262         }
25263         if (a < 0 !== n.sign) {
25264           return a < 0 ? -1 : 1;
25265         }
25266         return a < 0 ? 1 : -1;
25267       };
25268       SmallInteger.prototype.compareTo = SmallInteger.prototype.compare;
25269       NativeBigInt.prototype.compare = function(v) {
25270         if (v === Infinity) {
25271           return -1;
25272         }
25273         if (v === -Infinity) {
25274           return 1;
25275         }
25276         var a = this.value;
25277         var b = parseValue(v).value;
25278         return a === b ? 0 : a > b ? 1 : -1;
25279       };
25280       NativeBigInt.prototype.compareTo = NativeBigInt.prototype.compare;
25281       BigInteger.prototype.equals = function(v) {
25282         return this.compare(v) === 0;
25283       };
25284       NativeBigInt.prototype.eq = NativeBigInt.prototype.equals = SmallInteger.prototype.eq = SmallInteger.prototype.equals = BigInteger.prototype.eq = BigInteger.prototype.equals;
25285       BigInteger.prototype.notEquals = function(v) {
25286         return this.compare(v) !== 0;
25287       };
25288       NativeBigInt.prototype.neq = NativeBigInt.prototype.notEquals = SmallInteger.prototype.neq = SmallInteger.prototype.notEquals = BigInteger.prototype.neq = BigInteger.prototype.notEquals;
25289       BigInteger.prototype.greater = function(v) {
25290         return this.compare(v) > 0;
25291       };
25292       NativeBigInt.prototype.gt = NativeBigInt.prototype.greater = SmallInteger.prototype.gt = SmallInteger.prototype.greater = BigInteger.prototype.gt = BigInteger.prototype.greater;
25293       BigInteger.prototype.lesser = function(v) {
25294         return this.compare(v) < 0;
25295       };
25296       NativeBigInt.prototype.lt = NativeBigInt.prototype.lesser = SmallInteger.prototype.lt = SmallInteger.prototype.lesser = BigInteger.prototype.lt = BigInteger.prototype.lesser;
25297       BigInteger.prototype.greaterOrEquals = function(v) {
25298         return this.compare(v) >= 0;
25299       };
25300       NativeBigInt.prototype.geq = NativeBigInt.prototype.greaterOrEquals = SmallInteger.prototype.geq = SmallInteger.prototype.greaterOrEquals = BigInteger.prototype.geq = BigInteger.prototype.greaterOrEquals;
25301       BigInteger.prototype.lesserOrEquals = function(v) {
25302         return this.compare(v) <= 0;
25303       };
25304       NativeBigInt.prototype.leq = NativeBigInt.prototype.lesserOrEquals = SmallInteger.prototype.leq = SmallInteger.prototype.lesserOrEquals = BigInteger.prototype.leq = BigInteger.prototype.lesserOrEquals;
25305       BigInteger.prototype.isEven = function() {
25306         return (this.value[0] & 1) === 0;
25307       };
25308       SmallInteger.prototype.isEven = function() {
25309         return (this.value & 1) === 0;
25310       };
25311       NativeBigInt.prototype.isEven = function() {
25312         return (this.value & BigInt(1)) === BigInt(0);
25313       };
25314       BigInteger.prototype.isOdd = function() {
25315         return (this.value[0] & 1) === 1;
25316       };
25317       SmallInteger.prototype.isOdd = function() {
25318         return (this.value & 1) === 1;
25319       };
25320       NativeBigInt.prototype.isOdd = function() {
25321         return (this.value & BigInt(1)) === BigInt(1);
25322       };
25323       BigInteger.prototype.isPositive = function() {
25324         return !this.sign;
25325       };
25326       SmallInteger.prototype.isPositive = function() {
25327         return this.value > 0;
25328       };
25329       NativeBigInt.prototype.isPositive = SmallInteger.prototype.isPositive;
25330       BigInteger.prototype.isNegative = function() {
25331         return this.sign;
25332       };
25333       SmallInteger.prototype.isNegative = function() {
25334         return this.value < 0;
25335       };
25336       NativeBigInt.prototype.isNegative = SmallInteger.prototype.isNegative;
25337       BigInteger.prototype.isUnit = function() {
25338         return false;
25339       };
25340       SmallInteger.prototype.isUnit = function() {
25341         return Math.abs(this.value) === 1;
25342       };
25343       NativeBigInt.prototype.isUnit = function() {
25344         return this.abs().value === BigInt(1);
25345       };
25346       BigInteger.prototype.isZero = function() {
25347         return false;
25348       };
25349       SmallInteger.prototype.isZero = function() {
25350         return this.value === 0;
25351       };
25352       NativeBigInt.prototype.isZero = function() {
25353         return this.value === BigInt(0);
25354       };
25355       BigInteger.prototype.isDivisibleBy = function(v) {
25356         var n = parseValue(v);
25357         if (n.isZero())
25358           return false;
25359         if (n.isUnit())
25360           return true;
25361         if (n.compareAbs(2) === 0)
25362           return this.isEven();
25363         return this.mod(n).isZero();
25364       };
25365       NativeBigInt.prototype.isDivisibleBy = SmallInteger.prototype.isDivisibleBy = BigInteger.prototype.isDivisibleBy;
25366       function isBasicPrime(v) {
25367         var n = v.abs();
25368         if (n.isUnit())
25369           return false;
25370         if (n.equals(2) || n.equals(3) || n.equals(5))
25371           return true;
25372         if (n.isEven() || n.isDivisibleBy(3) || n.isDivisibleBy(5))
25373           return false;
25374         if (n.lesser(49))
25375           return true;
25376       }
25377       function millerRabinTest(n, a) {
25378         var nPrev = n.prev(), b = nPrev, r = 0, d, t, i2, x;
25379         while (b.isEven())
25380           b = b.divide(2), r++;
25381         next:
25382           for (i2 = 0; i2 < a.length; i2++) {
25383             if (n.lesser(a[i2]))
25384               continue;
25385             x = bigInt(a[i2]).modPow(b, n);
25386             if (x.isUnit() || x.equals(nPrev))
25387               continue;
25388             for (d = r - 1; d != 0; d--) {
25389               x = x.square().mod(n);
25390               if (x.isUnit())
25391                 return false;
25392               if (x.equals(nPrev))
25393                 continue next;
25394             }
25395             return false;
25396           }
25397         return true;
25398       }
25399       BigInteger.prototype.isPrime = function(strict) {
25400         var isPrime = isBasicPrime(this);
25401         if (isPrime !== undefined2)
25402           return isPrime;
25403         var n = this.abs();
25404         var bits = n.bitLength();
25405         if (bits <= 64)
25406           return millerRabinTest(n, [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]);
25407         var logN = Math.log(2) * bits.toJSNumber();
25408         var t = Math.ceil(strict === true ? 2 * Math.pow(logN, 2) : logN);
25409         for (var a = [], i2 = 0; i2 < t; i2++) {
25410           a.push(bigInt(i2 + 2));
25411         }
25412         return millerRabinTest(n, a);
25413       };
25414       NativeBigInt.prototype.isPrime = SmallInteger.prototype.isPrime = BigInteger.prototype.isPrime;
25415       BigInteger.prototype.isProbablePrime = function(iterations, rng) {
25416         var isPrime = isBasicPrime(this);
25417         if (isPrime !== undefined2)
25418           return isPrime;
25419         var n = this.abs();
25420         var t = iterations === undefined2 ? 5 : iterations;
25421         for (var a = [], i2 = 0; i2 < t; i2++) {
25422           a.push(bigInt.randBetween(2, n.minus(2), rng));
25423         }
25424         return millerRabinTest(n, a);
25425       };
25426       NativeBigInt.prototype.isProbablePrime = SmallInteger.prototype.isProbablePrime = BigInteger.prototype.isProbablePrime;
25427       BigInteger.prototype.modInv = function(n) {
25428         var t = bigInt.zero, newT = bigInt.one, r = parseValue(n), newR = this.abs(), q, lastT, lastR;
25429         while (!newR.isZero()) {
25430           q = r.divide(newR);
25431           lastT = t;
25432           lastR = r;
25433           t = newT;
25434           r = newR;
25435           newT = lastT.subtract(q.multiply(newT));
25436           newR = lastR.subtract(q.multiply(newR));
25437         }
25438         if (!r.isUnit())
25439           throw new Error(this.toString() + " and " + n.toString() + " are not co-prime");
25440         if (t.compare(0) === -1) {
25441           t = t.add(n);
25442         }
25443         if (this.isNegative()) {
25444           return t.negate();
25445         }
25446         return t;
25447       };
25448       NativeBigInt.prototype.modInv = SmallInteger.prototype.modInv = BigInteger.prototype.modInv;
25449       BigInteger.prototype.next = function() {
25450         var value = this.value;
25451         if (this.sign) {
25452           return subtractSmall(value, 1, this.sign);
25453         }
25454         return new BigInteger(addSmall(value, 1), this.sign);
25455       };
25456       SmallInteger.prototype.next = function() {
25457         var value = this.value;
25458         if (value + 1 < MAX_INT)
25459           return new SmallInteger(value + 1);
25460         return new BigInteger(MAX_INT_ARR, false);
25461       };
25462       NativeBigInt.prototype.next = function() {
25463         return new NativeBigInt(this.value + BigInt(1));
25464       };
25465       BigInteger.prototype.prev = function() {
25466         var value = this.value;
25467         if (this.sign) {
25468           return new BigInteger(addSmall(value, 1), true);
25469         }
25470         return subtractSmall(value, 1, this.sign);
25471       };
25472       SmallInteger.prototype.prev = function() {
25473         var value = this.value;
25474         if (value - 1 > -MAX_INT)
25475           return new SmallInteger(value - 1);
25476         return new BigInteger(MAX_INT_ARR, true);
25477       };
25478       NativeBigInt.prototype.prev = function() {
25479         return new NativeBigInt(this.value - BigInt(1));
25480       };
25481       var powersOfTwo = [1];
25482       while (2 * powersOfTwo[powersOfTwo.length - 1] <= BASE)
25483         powersOfTwo.push(2 * powersOfTwo[powersOfTwo.length - 1]);
25484       var powers2Length = powersOfTwo.length, highestPower2 = powersOfTwo[powers2Length - 1];
25485       function shift_isSmall(n) {
25486         return Math.abs(n) <= BASE;
25487       }
25488       BigInteger.prototype.shiftLeft = function(v) {
25489         var n = parseValue(v).toJSNumber();
25490         if (!shift_isSmall(n)) {
25491           throw new Error(String(n) + " is too large for shifting.");
25492         }
25493         if (n < 0)
25494           return this.shiftRight(-n);
25495         var result = this;
25496         if (result.isZero())
25497           return result;
25498         while (n >= powers2Length) {
25499           result = result.multiply(highestPower2);
25500           n -= powers2Length - 1;
25501         }
25502         return result.multiply(powersOfTwo[n]);
25503       };
25504       NativeBigInt.prototype.shiftLeft = SmallInteger.prototype.shiftLeft = BigInteger.prototype.shiftLeft;
25505       BigInteger.prototype.shiftRight = function(v) {
25506         var remQuo;
25507         var n = parseValue(v).toJSNumber();
25508         if (!shift_isSmall(n)) {
25509           throw new Error(String(n) + " is too large for shifting.");
25510         }
25511         if (n < 0)
25512           return this.shiftLeft(-n);
25513         var result = this;
25514         while (n >= powers2Length) {
25515           if (result.isZero() || result.isNegative() && result.isUnit())
25516             return result;
25517           remQuo = divModAny(result, highestPower2);
25518           result = remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0];
25519           n -= powers2Length - 1;
25520         }
25521         remQuo = divModAny(result, powersOfTwo[n]);
25522         return remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0];
25523       };
25524       NativeBigInt.prototype.shiftRight = SmallInteger.prototype.shiftRight = BigInteger.prototype.shiftRight;
25525       function bitwise(x, y, fn) {
25526         y = parseValue(y);
25527         var xSign = x.isNegative(), ySign = y.isNegative();
25528         var xRem = xSign ? x.not() : x, yRem = ySign ? y.not() : y;
25529         var xDigit = 0, yDigit = 0;
25530         var xDivMod = null, yDivMod = null;
25531         var result = [];
25532         while (!xRem.isZero() || !yRem.isZero()) {
25533           xDivMod = divModAny(xRem, highestPower2);
25534           xDigit = xDivMod[1].toJSNumber();
25535           if (xSign) {
25536             xDigit = highestPower2 - 1 - xDigit;
25537           }
25538           yDivMod = divModAny(yRem, highestPower2);
25539           yDigit = yDivMod[1].toJSNumber();
25540           if (ySign) {
25541             yDigit = highestPower2 - 1 - yDigit;
25542           }
25543           xRem = xDivMod[0];
25544           yRem = yDivMod[0];
25545           result.push(fn(xDigit, yDigit));
25546         }
25547         var sum = fn(xSign ? 1 : 0, ySign ? 1 : 0) !== 0 ? bigInt(-1) : bigInt(0);
25548         for (var i2 = result.length - 1; i2 >= 0; i2 -= 1) {
25549           sum = sum.multiply(highestPower2).add(bigInt(result[i2]));
25550         }
25551         return sum;
25552       }
25553       BigInteger.prototype.not = function() {
25554         return this.negate().prev();
25555       };
25556       NativeBigInt.prototype.not = SmallInteger.prototype.not = BigInteger.prototype.not;
25557       BigInteger.prototype.and = function(n) {
25558         return bitwise(this, n, function(a, b) {
25559           return a & b;
25560         });
25561       };
25562       NativeBigInt.prototype.and = SmallInteger.prototype.and = BigInteger.prototype.and;
25563       BigInteger.prototype.or = function(n) {
25564         return bitwise(this, n, function(a, b) {
25565           return a | b;
25566         });
25567       };
25568       NativeBigInt.prototype.or = SmallInteger.prototype.or = BigInteger.prototype.or;
25569       BigInteger.prototype.xor = function(n) {
25570         return bitwise(this, n, function(a, b) {
25571           return a ^ b;
25572         });
25573       };
25574       NativeBigInt.prototype.xor = SmallInteger.prototype.xor = BigInteger.prototype.xor;
25575       var LOBMASK_I = 1 << 30, LOBMASK_BI = (BASE & -BASE) * (BASE & -BASE) | LOBMASK_I;
25576       function roughLOB(n) {
25577         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;
25578         return x & -x;
25579       }
25580       function integerLogarithm(value, base) {
25581         if (base.compareTo(value) <= 0) {
25582           var tmp = integerLogarithm(value, base.square(base));
25583           var p = tmp.p;
25584           var e = tmp.e;
25585           var t = p.multiply(base);
25586           return t.compareTo(value) <= 0 ? { p: t, e: e * 2 + 1 } : { p, e: e * 2 };
25587         }
25588         return { p: bigInt(1), e: 0 };
25589       }
25590       BigInteger.prototype.bitLength = function() {
25591         var n = this;
25592         if (n.compareTo(bigInt(0)) < 0) {
25593           n = n.negate().subtract(bigInt(1));
25594         }
25595         if (n.compareTo(bigInt(0)) === 0) {
25596           return bigInt(0);
25597         }
25598         return bigInt(integerLogarithm(n, bigInt(2)).e).add(bigInt(1));
25599       };
25600       NativeBigInt.prototype.bitLength = SmallInteger.prototype.bitLength = BigInteger.prototype.bitLength;
25601       function max(a, b) {
25602         a = parseValue(a);
25603         b = parseValue(b);
25604         return a.greater(b) ? a : b;
25605       }
25606       function min(a, b) {
25607         a = parseValue(a);
25608         b = parseValue(b);
25609         return a.lesser(b) ? a : b;
25610       }
25611       function gcd(a, b) {
25612         a = parseValue(a).abs();
25613         b = parseValue(b).abs();
25614         if (a.equals(b))
25615           return a;
25616         if (a.isZero())
25617           return b;
25618         if (b.isZero())
25619           return a;
25620         var c = Integer[1], d, t;
25621         while (a.isEven() && b.isEven()) {
25622           d = min(roughLOB(a), roughLOB(b));
25623           a = a.divide(d);
25624           b = b.divide(d);
25625           c = c.multiply(d);
25626         }
25627         while (a.isEven()) {
25628           a = a.divide(roughLOB(a));
25629         }
25630         do {
25631           while (b.isEven()) {
25632             b = b.divide(roughLOB(b));
25633           }
25634           if (a.greater(b)) {
25635             t = b;
25636             b = a;
25637             a = t;
25638           }
25639           b = b.subtract(a);
25640         } while (!b.isZero());
25641         return c.isUnit() ? a : a.multiply(c);
25642       }
25643       function lcm(a, b) {
25644         a = parseValue(a).abs();
25645         b = parseValue(b).abs();
25646         return a.divide(gcd(a, b)).multiply(b);
25647       }
25648       function randBetween(a, b, rng) {
25649         a = parseValue(a);
25650         b = parseValue(b);
25651         var usedRNG = rng || Math.random;
25652         var low = min(a, b), high = max(a, b);
25653         var range = high.subtract(low).add(1);
25654         if (range.isSmall)
25655           return low.add(Math.floor(usedRNG() * range));
25656         var digits = toBase(range, BASE).value;
25657         var result = [], restricted = true;
25658         for (var i2 = 0; i2 < digits.length; i2++) {
25659           var top = restricted ? digits[i2] : BASE;
25660           var digit = truncate(usedRNG() * top);
25661           result.push(digit);
25662           if (digit < top)
25663             restricted = false;
25664         }
25665         return low.add(Integer.fromArray(result, BASE, false));
25666       }
25667       var parseBase = function(text, base, alphabet, caseSensitive) {
25668         alphabet = alphabet || DEFAULT_ALPHABET;
25669         text = String(text);
25670         if (!caseSensitive) {
25671           text = text.toLowerCase();
25672           alphabet = alphabet.toLowerCase();
25673         }
25674         var length = text.length;
25675         var i2;
25676         var absBase = Math.abs(base);
25677         var alphabetValues = {};
25678         for (i2 = 0; i2 < alphabet.length; i2++) {
25679           alphabetValues[alphabet[i2]] = i2;
25680         }
25681         for (i2 = 0; i2 < length; i2++) {
25682           var c = text[i2];
25683           if (c === "-")
25684             continue;
25685           if (c in alphabetValues) {
25686             if (alphabetValues[c] >= absBase) {
25687               if (c === "1" && absBase === 1)
25688                 continue;
25689               throw new Error(c + " is not a valid digit in base " + base + ".");
25690             }
25691           }
25692         }
25693         base = parseValue(base);
25694         var digits = [];
25695         var isNegative = text[0] === "-";
25696         for (i2 = isNegative ? 1 : 0; i2 < text.length; i2++) {
25697           var c = text[i2];
25698           if (c in alphabetValues)
25699             digits.push(parseValue(alphabetValues[c]));
25700           else if (c === "<") {
25701             var start = i2;
25702             do {
25703               i2++;
25704             } while (text[i2] !== ">" && i2 < text.length);
25705             digits.push(parseValue(text.slice(start + 1, i2)));
25706           } else
25707             throw new Error(c + " is not a valid character");
25708         }
25709         return parseBaseFromArray(digits, base, isNegative);
25710       };
25711       function parseBaseFromArray(digits, base, isNegative) {
25712         var val = Integer[0], pow = Integer[1], i2;
25713         for (i2 = digits.length - 1; i2 >= 0; i2--) {
25714           val = val.add(digits[i2].times(pow));
25715           pow = pow.times(base);
25716         }
25717         return isNegative ? val.negate() : val;
25718       }
25719       function stringify(digit, alphabet) {
25720         alphabet = alphabet || DEFAULT_ALPHABET;
25721         if (digit < alphabet.length) {
25722           return alphabet[digit];
25723         }
25724         return "<" + digit + ">";
25725       }
25726       function toBase(n, base) {
25727         base = bigInt(base);
25728         if (base.isZero()) {
25729           if (n.isZero())
25730             return { value: [0], isNegative: false };
25731           throw new Error("Cannot convert nonzero numbers to base 0.");
25732         }
25733         if (base.equals(-1)) {
25734           if (n.isZero())
25735             return { value: [0], isNegative: false };
25736           if (n.isNegative())
25737             return {
25738               value: [].concat.apply([], Array.apply(null, Array(-n.toJSNumber())).map(Array.prototype.valueOf, [1, 0])),
25739               isNegative: false
25740             };
25741           var arr = Array.apply(null, Array(n.toJSNumber() - 1)).map(Array.prototype.valueOf, [0, 1]);
25742           arr.unshift([1]);
25743           return {
25744             value: [].concat.apply([], arr),
25745             isNegative: false
25746           };
25747         }
25748         var neg = false;
25749         if (n.isNegative() && base.isPositive()) {
25750           neg = true;
25751           n = n.abs();
25752         }
25753         if (base.isUnit()) {
25754           if (n.isZero())
25755             return { value: [0], isNegative: false };
25756           return {
25757             value: Array.apply(null, Array(n.toJSNumber())).map(Number.prototype.valueOf, 1),
25758             isNegative: neg
25759           };
25760         }
25761         var out = [];
25762         var left = n, divmod;
25763         while (left.isNegative() || left.compareAbs(base) >= 0) {
25764           divmod = left.divmod(base);
25765           left = divmod.quotient;
25766           var digit = divmod.remainder;
25767           if (digit.isNegative()) {
25768             digit = base.minus(digit).abs();
25769             left = left.next();
25770           }
25771           out.push(digit.toJSNumber());
25772         }
25773         out.push(left.toJSNumber());
25774         return { value: out.reverse(), isNegative: neg };
25775       }
25776       function toBaseString(n, base, alphabet) {
25777         var arr = toBase(n, base);
25778         return (arr.isNegative ? "-" : "") + arr.value.map(function(x) {
25779           return stringify(x, alphabet);
25780         }).join("");
25781       }
25782       BigInteger.prototype.toArray = function(radix) {
25783         return toBase(this, radix);
25784       };
25785       SmallInteger.prototype.toArray = function(radix) {
25786         return toBase(this, radix);
25787       };
25788       NativeBigInt.prototype.toArray = function(radix) {
25789         return toBase(this, radix);
25790       };
25791       BigInteger.prototype.toString = function(radix, alphabet) {
25792         if (radix === undefined2)
25793           radix = 10;
25794         if (radix !== 10)
25795           return toBaseString(this, radix, alphabet);
25796         var v = this.value, l2 = v.length, str = String(v[--l2]), zeros = "0000000", digit;
25797         while (--l2 >= 0) {
25798           digit = String(v[l2]);
25799           str += zeros.slice(digit.length) + digit;
25800         }
25801         var sign = this.sign ? "-" : "";
25802         return sign + str;
25803       };
25804       SmallInteger.prototype.toString = function(radix, alphabet) {
25805         if (radix === undefined2)
25806           radix = 10;
25807         if (radix != 10)
25808           return toBaseString(this, radix, alphabet);
25809         return String(this.value);
25810       };
25811       NativeBigInt.prototype.toString = SmallInteger.prototype.toString;
25812       NativeBigInt.prototype.toJSON = BigInteger.prototype.toJSON = SmallInteger.prototype.toJSON = function() {
25813         return this.toString();
25814       };
25815       BigInteger.prototype.valueOf = function() {
25816         return parseInt(this.toString(), 10);
25817       };
25818       BigInteger.prototype.toJSNumber = BigInteger.prototype.valueOf;
25819       SmallInteger.prototype.valueOf = function() {
25820         return this.value;
25821       };
25822       SmallInteger.prototype.toJSNumber = SmallInteger.prototype.valueOf;
25823       NativeBigInt.prototype.valueOf = NativeBigInt.prototype.toJSNumber = function() {
25824         return parseInt(this.toString(), 10);
25825       };
25826       function parseStringValue(v) {
25827         if (isPrecise(+v)) {
25828           var x = +v;
25829           if (x === truncate(x))
25830             return supportsNativeBigInt ? new NativeBigInt(BigInt(x)) : new SmallInteger(x);
25831           throw new Error("Invalid integer: " + v);
25832         }
25833         var sign = v[0] === "-";
25834         if (sign)
25835           v = v.slice(1);
25836         var split = v.split(/e/i);
25837         if (split.length > 2)
25838           throw new Error("Invalid integer: " + split.join("e"));
25839         if (split.length === 2) {
25840           var exp = split[1];
25841           if (exp[0] === "+")
25842             exp = exp.slice(1);
25843           exp = +exp;
25844           if (exp !== truncate(exp) || !isPrecise(exp))
25845             throw new Error("Invalid integer: " + exp + " is not a valid exponent.");
25846           var text = split[0];
25847           var decimalPlace = text.indexOf(".");
25848           if (decimalPlace >= 0) {
25849             exp -= text.length - decimalPlace - 1;
25850             text = text.slice(0, decimalPlace) + text.slice(decimalPlace + 1);
25851           }
25852           if (exp < 0)
25853             throw new Error("Cannot include negative exponent part for integers");
25854           text += new Array(exp + 1).join("0");
25855           v = text;
25856         }
25857         var isValid = /^([0-9][0-9]*)$/.test(v);
25858         if (!isValid)
25859           throw new Error("Invalid integer: " + v);
25860         if (supportsNativeBigInt) {
25861           return new NativeBigInt(BigInt(sign ? "-" + v : v));
25862         }
25863         var r = [], max2 = v.length, l2 = LOG_BASE, min2 = max2 - l2;
25864         while (max2 > 0) {
25865           r.push(+v.slice(min2, max2));
25866           min2 -= l2;
25867           if (min2 < 0)
25868             min2 = 0;
25869           max2 -= l2;
25870         }
25871         trim(r);
25872         return new BigInteger(r, sign);
25873       }
25874       function parseNumberValue(v) {
25875         if (supportsNativeBigInt) {
25876           return new NativeBigInt(BigInt(v));
25877         }
25878         if (isPrecise(v)) {
25879           if (v !== truncate(v))
25880             throw new Error(v + " is not an integer.");
25881           return new SmallInteger(v);
25882         }
25883         return parseStringValue(v.toString());
25884       }
25885       function parseValue(v) {
25886         if (typeof v === "number") {
25887           return parseNumberValue(v);
25888         }
25889         if (typeof v === "string") {
25890           return parseStringValue(v);
25891         }
25892         if (typeof v === "bigint") {
25893           return new NativeBigInt(v);
25894         }
25895         return v;
25896       }
25897       for (var i = 0; i < 1e3; i++) {
25898         Integer[i] = parseValue(i);
25899         if (i > 0)
25900           Integer[-i] = parseValue(-i);
25901       }
25902       Integer.one = Integer[1];
25903       Integer.zero = Integer[0];
25904       Integer.minusOne = Integer[-1];
25905       Integer.max = max;
25906       Integer.min = min;
25907       Integer.gcd = gcd;
25908       Integer.lcm = lcm;
25909       Integer.isInstance = function(x) {
25910         return x instanceof BigInteger || x instanceof SmallInteger || x instanceof NativeBigInt;
25911       };
25912       Integer.randBetween = randBetween;
25913       Integer.fromArray = function(digits, base, isNegative) {
25914         return parseBaseFromArray(digits.map(parseValue), parseValue(base || 10), isNegative);
25915       };
25916       return Integer;
25917     }();
25918     if (typeof module2 !== "undefined" && module2.hasOwnProperty("exports")) {
25919       module2.exports = bigInt;
25920     }
25921     if (typeof define === "function" && define.amd) {
25922       define(function() {
25923         return bigInt;
25924       });
25925     }
25926   }
25927 });
25928
25929 // node_modules/unzipper/lib/Decrypt.js
25930 var require_Decrypt = __commonJS({
25931   "node_modules/unzipper/lib/Decrypt.js"(exports2, module2) {
25932     var bigInt = require_BigInteger();
25933     var Stream2 = require("stream");
25934     if (!Stream2.Writable || !Stream2.Writable.prototype.destroy)
25935       Stream2 = require_readable();
25936     var table;
25937     function generateTable() {
25938       var poly = 3988292384, c, n, k;
25939       table = [];
25940       for (n = 0; n < 256; n++) {
25941         c = n;
25942         for (k = 0; k < 8; k++)
25943           c = c & 1 ? poly ^ c >>> 1 : c = c >>> 1;
25944         table[n] = c >>> 0;
25945       }
25946     }
25947     function crc(ch, crc2) {
25948       if (!table)
25949         generateTable();
25950       if (ch.charCodeAt)
25951         ch = ch.charCodeAt(0);
25952       return bigInt(crc2).shiftRight(8).and(16777215).xor(table[bigInt(crc2).xor(ch).and(255)]).value;
25953     }
25954     function Decrypt() {
25955       if (!(this instanceof Decrypt))
25956         return new Decrypt();
25957       this.key0 = 305419896;
25958       this.key1 = 591751049;
25959       this.key2 = 878082192;
25960     }
25961     Decrypt.prototype.update = function(h) {
25962       this.key0 = crc(h, this.key0);
25963       this.key1 = bigInt(this.key0).and(255).and(4294967295).add(this.key1);
25964       this.key1 = bigInt(this.key1).multiply(134775813).add(1).and(4294967295).value;
25965       this.key2 = crc(bigInt(this.key1).shiftRight(24).and(255), this.key2);
25966     };
25967     Decrypt.prototype.decryptByte = function(c) {
25968       var k = bigInt(this.key2).or(2);
25969       c = c ^ bigInt(k).multiply(bigInt(k ^ 1)).shiftRight(8).and(255);
25970       this.update(c);
25971       return c;
25972     };
25973     Decrypt.prototype.stream = function() {
25974       var stream = Stream2.Transform(), self2 = this;
25975       stream._transform = function(d, e, cb) {
25976         for (var i = 0; i < d.length; i++) {
25977           d[i] = self2.decryptByte(d[i]);
25978         }
25979         this.push(d);
25980         cb();
25981       };
25982       return stream;
25983     };
25984     module2.exports = Decrypt;
25985   }
25986 });
25987
25988 // node_modules/unzipper/lib/Open/unzip.js
25989 var require_unzip = __commonJS({
25990   "node_modules/unzipper/lib/Open/unzip.js"(exports2, module2) {
25991     var Promise2 = require_bluebird();
25992     var Decrypt = require_Decrypt();
25993     var PullStream = require_PullStream();
25994     var Stream2 = require("stream");
25995     var binary = require_binary();
25996     var zlib2 = require("zlib");
25997     var parseExtraField = require_parseExtraField();
25998     var Buffer2 = require_Buffer();
25999     var parseDateTime = require_parseDateTime();
26000     if (!Stream2.Writable || !Stream2.Writable.prototype.destroy)
26001       Stream2 = require_readable();
26002     module2.exports = function unzip(source, offset, _password, directoryVars) {
26003       var file = PullStream(), entry = Stream2.PassThrough();
26004       var req = source.stream(offset);
26005       req.pipe(file).on("error", function(e) {
26006         entry.emit("error", e);
26007       });
26008       entry.vars = file.pull(30).then(function(data) {
26009         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;
26010         vars.lastModifiedDateTime = parseDateTime(vars.lastModifiedDate, vars.lastModifiedTime);
26011         return file.pull(vars.fileNameLength).then(function(fileName) {
26012           vars.fileName = fileName.toString("utf8");
26013           return file.pull(vars.extraFieldLength);
26014         }).then(function(extraField) {
26015           var checkEncryption;
26016           vars.extra = parseExtraField(extraField, vars);
26017           if (directoryVars && directoryVars.compressedSize)
26018             vars = directoryVars;
26019           if (vars.flags & 1)
26020             checkEncryption = file.pull(12).then(function(header) {
26021               if (!_password)
26022                 throw new Error("MISSING_PASSWORD");
26023               var decrypt = Decrypt();
26024               String(_password).split("").forEach(function(d) {
26025                 decrypt.update(d);
26026               });
26027               for (var i = 0; i < header.length; i++)
26028                 header[i] = decrypt.decryptByte(header[i]);
26029               vars.decrypt = decrypt;
26030               vars.compressedSize -= 12;
26031               var check = vars.flags & 8 ? vars.lastModifiedTime >> 8 & 255 : vars.crc32 >> 24 & 255;
26032               if (header[11] !== check)
26033                 throw new Error("BAD_PASSWORD");
26034               return vars;
26035             });
26036           return Promise2.resolve(checkEncryption).then(function() {
26037             entry.emit("vars", vars);
26038             return vars;
26039           });
26040         });
26041       });
26042       entry.vars.then(function(vars) {
26043         var fileSizeKnown = !(vars.flags & 8) || vars.compressedSize > 0, eof;
26044         var inflater = vars.compressionMethod ? zlib2.createInflateRaw() : Stream2.PassThrough();
26045         if (fileSizeKnown) {
26046           entry.size = vars.uncompressedSize;
26047           eof = vars.compressedSize;
26048         } else {
26049           eof = Buffer2.alloc(4);
26050           eof.writeUInt32LE(134695760, 0);
26051         }
26052         var stream = file.stream(eof);
26053         if (vars.decrypt)
26054           stream = stream.pipe(vars.decrypt.stream());
26055         stream.pipe(inflater).on("error", function(err) {
26056           entry.emit("error", err);
26057         }).pipe(entry).on("finish", function() {
26058           if (req.abort)
26059             req.abort();
26060           else if (req.close)
26061             req.close();
26062           else if (req.push)
26063             req.push();
26064           else
26065             console.log("warning - unable to close stream");
26066         });
26067       }).catch(function(e) {
26068         entry.emit("error", e);
26069       });
26070       return entry;
26071     };
26072   }
26073 });
26074
26075 // node_modules/unzipper/lib/Open/directory.js
26076 var require_directory = __commonJS({
26077   "node_modules/unzipper/lib/Open/directory.js"(exports2, module2) {
26078     var binary = require_binary();
26079     var PullStream = require_PullStream();
26080     var unzip = require_unzip();
26081     var Promise2 = require_bluebird();
26082     var BufferStream = require_BufferStream();
26083     var parseExtraField = require_parseExtraField();
26084     var Buffer2 = require_Buffer();
26085     var path2 = require("path");
26086     var Writer = require_fstream().Writer;
26087     var parseDateTime = require_parseDateTime();
26088     var signature = Buffer2.alloc(4);
26089     signature.writeUInt32LE(101010256, 0);
26090     function getCrxHeader(source) {
26091       var sourceStream = source.stream(0).pipe(PullStream());
26092       return sourceStream.pull(4).then(function(data) {
26093         var signature2 = data.readUInt32LE(0);
26094         if (signature2 === 875721283) {
26095           var crxHeader;
26096           return sourceStream.pull(12).then(function(data2) {
26097             crxHeader = binary.parse(data2).word32lu("version").word32lu("pubKeyLength").word32lu("signatureLength").vars;
26098           }).then(function() {
26099             return sourceStream.pull(crxHeader.pubKeyLength + crxHeader.signatureLength);
26100           }).then(function(data2) {
26101             crxHeader.publicKey = data2.slice(0, crxHeader.pubKeyLength);
26102             crxHeader.signature = data2.slice(crxHeader.pubKeyLength);
26103             crxHeader.size = 16 + crxHeader.pubKeyLength + crxHeader.signatureLength;
26104             return crxHeader;
26105           });
26106         }
26107       });
26108     }
26109     function getZip64CentralDirectory(source, zip64CDL) {
26110       var d64loc = binary.parse(zip64CDL).word32lu("signature").word32lu("diskNumber").word64lu("offsetToStartOfCentralDirectory").word32lu("numberOfDisks").vars;
26111       if (d64loc.signature != 117853008) {
26112         throw new Error("invalid zip64 end of central dir locator signature (0x07064b50): 0x" + d64loc.signature.toString(16));
26113       }
26114       var dir64 = PullStream();
26115       source.stream(d64loc.offsetToStartOfCentralDirectory).pipe(dir64);
26116       return dir64.pull(56);
26117     }
26118     function parseZip64DirRecord(dir64record) {
26119       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;
26120       if (vars.signature != 101075792) {
26121         throw new Error("invalid zip64 end of central dir locator signature (0x06064b50): 0x0" + vars.signature.toString(16));
26122       }
26123       return vars;
26124     }
26125     module2.exports = function centralDirectory(source, options) {
26126       var endDir = PullStream(), records = PullStream(), tailSize = options && options.tailSize || 80, sourceSize, crxHeader, startOffset, vars;
26127       if (options && options.crx)
26128         crxHeader = getCrxHeader(source);
26129       return source.size().then(function(size) {
26130         sourceSize = size;
26131         source.stream(Math.max(0, size - tailSize)).on("error", function(error) {
26132           endDir.emit("error", error);
26133         }).pipe(endDir);
26134         return endDir.pull(signature);
26135       }).then(function() {
26136         return Promise2.props({ directory: endDir.pull(22), crxHeader });
26137       }).then(function(d) {
26138         var data = d.directory;
26139         startOffset = d.crxHeader && d.crxHeader.size || 0;
26140         vars = binary.parse(data).word32lu("signature").word16lu("diskNumber").word16lu("diskStart").word16lu("numberOfRecordsOnDisk").word16lu("numberOfRecords").word32lu("sizeOfCentralDirectory").word32lu("offsetToStartOfCentralDirectory").word16lu("commentLength").vars;
26141         if (vars.numberOfRecords == 65535 || vars.numberOfRecords == 65535 || vars.offsetToStartOfCentralDirectory == 4294967295) {
26142           const zip64CDLSize = 20;
26143           const zip64CDLOffset = sourceSize - (tailSize - endDir.match + zip64CDLSize);
26144           const zip64CDLStream = PullStream();
26145           source.stream(zip64CDLOffset).pipe(zip64CDLStream);
26146           return zip64CDLStream.pull(zip64CDLSize).then(function(d2) {
26147             return getZip64CentralDirectory(source, d2);
26148           }).then(function(dir64record) {
26149             vars = parseZip64DirRecord(dir64record);
26150           });
26151         } else {
26152           vars.offsetToStartOfCentralDirectory += startOffset;
26153         }
26154       }).then(function() {
26155         source.stream(vars.offsetToStartOfCentralDirectory).pipe(records);
26156         vars.extract = function(opts) {
26157           if (!opts || !opts.path)
26158             throw new Error("PATH_MISSING");
26159           return vars.files.then(function(files) {
26160             return Promise2.map(files, function(entry) {
26161               if (entry.type == "Directory")
26162                 return;
26163               var extractPath = path2.join(opts.path, entry.path);
26164               if (extractPath.indexOf(opts.path) != 0) {
26165                 return;
26166               }
26167               var writer = opts.getWriter ? opts.getWriter({ path: extractPath }) : Writer({ path: extractPath });
26168               return new Promise2(function(resolve, reject) {
26169                 entry.stream(opts.password).on("error", reject).pipe(writer).on("close", resolve).on("error", reject);
26170               });
26171             }, opts.concurrency > 1 ? { concurrency: opts.concurrency || void 0 } : void 0);
26172           });
26173         };
26174         vars.files = Promise2.mapSeries(Array(vars.numberOfRecords), function() {
26175           return records.pull(46).then(function(data) {
26176             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;
26177             vars2.offsetToLocalFileHeader += startOffset;
26178             vars2.lastModifiedDateTime = parseDateTime(vars2.lastModifiedDate, vars2.lastModifiedTime);
26179             return records.pull(vars2.fileNameLength).then(function(fileNameBuffer) {
26180               vars2.pathBuffer = fileNameBuffer;
26181               vars2.path = fileNameBuffer.toString("utf8");
26182               vars2.isUnicode = vars2.flags & 17;
26183               return records.pull(vars2.extraFieldLength);
26184             }).then(function(extraField) {
26185               vars2.extra = parseExtraField(extraField, vars2);
26186               return records.pull(vars2.fileCommentLength);
26187             }).then(function(comment) {
26188               vars2.comment = comment;
26189               vars2.type = vars2.uncompressedSize === 0 && /[\/\\]$/.test(vars2.path) ? "Directory" : "File";
26190               vars2.stream = function(_password) {
26191                 return unzip(source, vars2.offsetToLocalFileHeader, _password, vars2);
26192               };
26193               vars2.buffer = function(_password) {
26194                 return BufferStream(vars2.stream(_password));
26195               };
26196               return vars2;
26197             });
26198           });
26199         });
26200         return Promise2.props(vars);
26201       });
26202     };
26203   }
26204 });
26205
26206 // node_modules/unzipper/lib/Open/index.js
26207 var require_Open = __commonJS({
26208   "node_modules/unzipper/lib/Open/index.js"(exports2, module2) {
26209     var fs2 = require_graceful_fs();
26210     var Promise2 = require_bluebird();
26211     var directory = require_directory();
26212     var Stream2 = require("stream");
26213     if (!Stream2.Writable || !Stream2.Writable.prototype.destroy)
26214       Stream2 = require_readable();
26215     module2.exports = {
26216       buffer: function(buffer, options) {
26217         var source = {
26218           stream: function(offset, length) {
26219             var stream = Stream2.PassThrough();
26220             stream.end(buffer.slice(offset, length));
26221             return stream;
26222           },
26223           size: function() {
26224             return Promise2.resolve(buffer.length);
26225           }
26226         };
26227         return directory(source, options);
26228       },
26229       file: function(filename, options) {
26230         var source = {
26231           stream: function(offset, length) {
26232             return fs2.createReadStream(filename, { start: offset, end: length && offset + length });
26233           },
26234           size: function() {
26235             return new Promise2(function(resolve, reject) {
26236               fs2.stat(filename, function(err, d) {
26237                 if (err)
26238                   reject(err);
26239                 else
26240                   resolve(d.size);
26241               });
26242             });
26243           }
26244         };
26245         return directory(source, options);
26246       },
26247       url: function(request, params, options) {
26248         if (typeof params === "string")
26249           params = { url: params };
26250         if (!params.url)
26251           throw "URL missing";
26252         params.headers = params.headers || {};
26253         var source = {
26254           stream: function(offset, length) {
26255             var options2 = Object.create(params);
26256             options2.headers = Object.create(params.headers);
26257             options2.headers.range = "bytes=" + offset + "-" + (length ? length : "");
26258             return request(options2);
26259           },
26260           size: function() {
26261             return new Promise2(function(resolve, reject) {
26262               var req = request(params);
26263               req.on("response", function(d) {
26264                 req.abort();
26265                 if (!d.headers["content-length"])
26266                   reject(new Error("Missing content length header"));
26267                 else
26268                   resolve(d.headers["content-length"]);
26269               }).on("error", reject);
26270             });
26271           }
26272         };
26273         return directory(source, options);
26274       },
26275       s3: function(client, params, options) {
26276         var source = {
26277           size: function() {
26278             return new Promise2(function(resolve, reject) {
26279               client.headObject(params, function(err, d) {
26280                 if (err)
26281                   reject(err);
26282                 else
26283                   resolve(d.ContentLength);
26284               });
26285             });
26286           },
26287           stream: function(offset, length) {
26288             var d = {};
26289             for (var key in params)
26290               d[key] = params[key];
26291             d.Range = "bytes=" + offset + "-" + (length ? length : "");
26292             return client.getObject(d).createReadStream();
26293           }
26294         };
26295         return directory(source, options);
26296       }
26297     };
26298   }
26299 });
26300
26301 // node_modules/unzipper/unzip.js
26302 var require_unzip2 = __commonJS({
26303   "node_modules/unzipper/unzip.js"(exports2) {
26304     "use strict";
26305     require_listenercount();
26306     require_buffer_indexof_polyfill();
26307     require_setImmediate();
26308     exports2.Parse = require_parse3();
26309     exports2.ParseOne = require_parseOne();
26310     exports2.Extract = require_extract();
26311     exports2.Open = require_Open();
26312   }
26313 });
26314
26315 // node_modules/isexe/windows.js
26316 var require_windows = __commonJS({
26317   "node_modules/isexe/windows.js"(exports2, module2) {
26318     module2.exports = isexe;
26319     isexe.sync = sync;
26320     var fs2 = require("fs");
26321     function checkPathExt(path2, options) {
26322       var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
26323       if (!pathext) {
26324         return true;
26325       }
26326       pathext = pathext.split(";");
26327       if (pathext.indexOf("") !== -1) {
26328         return true;
26329       }
26330       for (var i = 0; i < pathext.length; i++) {
26331         var p = pathext[i].toLowerCase();
26332         if (p && path2.substr(-p.length).toLowerCase() === p) {
26333           return true;
26334         }
26335       }
26336       return false;
26337     }
26338     function checkStat(stat, path2, options) {
26339       if (!stat.isSymbolicLink() && !stat.isFile()) {
26340         return false;
26341       }
26342       return checkPathExt(path2, options);
26343     }
26344     function isexe(path2, options, cb) {
26345       fs2.stat(path2, function(er, stat) {
26346         cb(er, er ? false : checkStat(stat, path2, options));
26347       });
26348     }
26349     function sync(path2, options) {
26350       return checkStat(fs2.statSync(path2), path2, options);
26351     }
26352   }
26353 });
26354
26355 // node_modules/isexe/mode.js
26356 var require_mode = __commonJS({
26357   "node_modules/isexe/mode.js"(exports2, module2) {
26358     module2.exports = isexe;
26359     isexe.sync = sync;
26360     var fs2 = require("fs");
26361     function isexe(path2, options, cb) {
26362       fs2.stat(path2, function(er, stat) {
26363         cb(er, er ? false : checkStat(stat, options));
26364       });
26365     }
26366     function sync(path2, options) {
26367       return checkStat(fs2.statSync(path2), options);
26368     }
26369     function checkStat(stat, options) {
26370       return stat.isFile() && checkMode(stat, options);
26371     }
26372     function checkMode(stat, options) {
26373       var mod = stat.mode;
26374       var uid = stat.uid;
26375       var gid = stat.gid;
26376       var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid();
26377       var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid();
26378       var u = parseInt("100", 8);
26379       var g = parseInt("010", 8);
26380       var o = parseInt("001", 8);
26381       var ug = u | g;
26382       var ret2 = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0;
26383       return ret2;
26384     }
26385   }
26386 });
26387
26388 // node_modules/isexe/index.js
26389 var require_isexe = __commonJS({
26390   "node_modules/isexe/index.js"(exports2, module2) {
26391     var fs2 = require("fs");
26392     var core;
26393     if (process.platform === "win32" || global.TESTING_WINDOWS) {
26394       core = require_windows();
26395     } else {
26396       core = require_mode();
26397     }
26398     module2.exports = isexe;
26399     isexe.sync = sync;
26400     function isexe(path2, options, cb) {
26401       if (typeof options === "function") {
26402         cb = options;
26403         options = {};
26404       }
26405       if (!cb) {
26406         if (typeof Promise !== "function") {
26407           throw new TypeError("callback not provided");
26408         }
26409         return new Promise(function(resolve, reject) {
26410           isexe(path2, options || {}, function(er, is) {
26411             if (er) {
26412               reject(er);
26413             } else {
26414               resolve(is);
26415             }
26416           });
26417         });
26418       }
26419       core(path2, options || {}, function(er, is) {
26420         if (er) {
26421           if (er.code === "EACCES" || options && options.ignoreErrors) {
26422             er = null;
26423             is = false;
26424           }
26425         }
26426         cb(er, is);
26427       });
26428     }
26429     function sync(path2, options) {
26430       try {
26431         return core.sync(path2, options || {});
26432       } catch (er) {
26433         if (options && options.ignoreErrors || er.code === "EACCES") {
26434           return false;
26435         } else {
26436           throw er;
26437         }
26438       }
26439     }
26440   }
26441 });
26442
26443 // node_modules/which/which.js
26444 var require_which = __commonJS({
26445   "node_modules/which/which.js"(exports2, module2) {
26446     var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
26447     var path2 = require("path");
26448     var COLON = isWindows ? ";" : ":";
26449     var isexe = require_isexe();
26450     var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
26451     var getPathInfo = (cmd, opt) => {
26452       const colon = opt.colon || COLON;
26453       const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [
26454         ...isWindows ? [process.cwd()] : [],
26455         ...(opt.path || process.env.PATH || "").split(colon)
26456       ];
26457       const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
26458       const pathExt = isWindows ? pathExtExe.split(colon) : [""];
26459       if (isWindows) {
26460         if (cmd.indexOf(".") !== -1 && pathExt[0] !== "")
26461           pathExt.unshift("");
26462       }
26463       return {
26464         pathEnv,
26465         pathExt,
26466         pathExtExe
26467       };
26468     };
26469     var which = (cmd, opt, cb) => {
26470       if (typeof opt === "function") {
26471         cb = opt;
26472         opt = {};
26473       }
26474       if (!opt)
26475         opt = {};
26476       const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
26477       const found = [];
26478       const step = (i) => new Promise((resolve, reject) => {
26479         if (i === pathEnv.length)
26480           return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
26481         const ppRaw = pathEnv[i];
26482         const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
26483         const pCmd = path2.join(pathPart, cmd);
26484         const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
26485         resolve(subStep(p, i, 0));
26486       });
26487       const subStep = (p, i, ii) => new Promise((resolve, reject) => {
26488         if (ii === pathExt.length)
26489           return resolve(step(i + 1));
26490         const ext = pathExt[ii];
26491         isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
26492           if (!er && is) {
26493             if (opt.all)
26494               found.push(p + ext);
26495             else
26496               return resolve(p + ext);
26497           }
26498           return resolve(subStep(p, i, ii + 1));
26499         });
26500       });
26501       return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
26502     };
26503     var whichSync = (cmd, opt) => {
26504       opt = opt || {};
26505       const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
26506       const found = [];
26507       for (let i = 0; i < pathEnv.length; i++) {
26508         const ppRaw = pathEnv[i];
26509         const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
26510         const pCmd = path2.join(pathPart, cmd);
26511         const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
26512         for (let j = 0; j < pathExt.length; j++) {
26513           const cur = p + pathExt[j];
26514           try {
26515             const is = isexe.sync(cur, { pathExt: pathExtExe });
26516             if (is) {
26517               if (opt.all)
26518                 found.push(cur);
26519               else
26520                 return cur;
26521             }
26522           } catch (ex) {
26523           }
26524         }
26525       }
26526       if (opt.all && found.length)
26527         return found;
26528       if (opt.nothrow)
26529         return null;
26530       throw getNotFoundError(cmd);
26531     };
26532     module2.exports = which;
26533     which.sync = whichSync;
26534   }
26535 });
26536
26537 // node_modules/@clangd/install/out/src/index.js
26538 var require_src = __commonJS({
26539   "node_modules/@clangd/install/out/src/index.js"(exports2) {
26540     "use strict";
26541     var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) {
26542       function adopt(value) {
26543         return value instanceof P ? value : new P(function(resolve) {
26544           resolve(value);
26545         });
26546       }
26547       return new (P || (P = Promise))(function(resolve, reject) {
26548         function fulfilled(value) {
26549           try {
26550             step(generator.next(value));
26551           } catch (e) {
26552             reject(e);
26553           }
26554         }
26555         function rejected(value) {
26556           try {
26557             step(generator["throw"](value));
26558           } catch (e) {
26559             reject(e);
26560           }
26561         }
26562         function step(result) {
26563           result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
26564         }
26565         step((generator = generator.apply(thisArg, _arguments || [])).next());
26566       });
26567     };
26568     var __asyncValues = exports2 && exports2.__asyncValues || function(o) {
26569       if (!Symbol.asyncIterator)
26570         throw new TypeError("Symbol.asyncIterator is not defined.");
26571       var m = o[Symbol.asyncIterator], i;
26572       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() {
26573         return this;
26574       }, i);
26575       function verb(n) {
26576         i[n] = o[n] && function(v) {
26577           return new Promise(function(resolve, reject) {
26578             v = o[n](v), settle(resolve, reject, v.done, v.value);
26579           });
26580         };
26581       }
26582       function settle(resolve, reject, d, v) {
26583         Promise.resolve(v).then(function(v2) {
26584           resolve({ value: v2, done: d });
26585         }, reject);
26586       }
26587     };
26588     Object.defineProperty(exports2, "__esModule", { value: true });
26589     var abort_controller_1 = require_abort_controller();
26590     var child_process = require("child_process");
26591     var fs2 = require("fs");
26592     var node_fetch_1 = (init_lib(), lib_exports);
26593     var os = require("os");
26594     var path2 = require("path");
26595     var readdirp = require_readdirp();
26596     var rimraf = require_rimraf();
26597     var semver = require_semver2();
26598     var stream = require("stream");
26599     var unzipper = require_unzip2();
26600     var util_1 = require("util");
26601     var which = require_which();
26602     function prepare2(ui, checkUpdate) {
26603       return __awaiter(this, void 0, void 0, function* () {
26604         try {
26605           var absPath = yield util_1.promisify(which)(ui.clangdPath);
26606         } catch (e) {
26607           return { clangdPath: null, background: recover(ui) };
26608         }
26609         return {
26610           clangdPath: absPath,
26611           background: checkUpdate ? checkUpdates2(false, ui) : Promise.resolve()
26612         };
26613       });
26614     }
26615     exports2.prepare = prepare2;
26616     function installLatest2(ui) {
26617       return __awaiter(this, void 0, void 0, function* () {
26618         const abort = new abort_controller_1.AbortController();
26619         try {
26620           const release = yield Github.latestRelease();
26621           const asset = yield Github.chooseAsset(release);
26622           ui.clangdPath = yield Install.install(release, asset, abort, ui);
26623           ui.promptReload(`clangd ${release.name} is now installed.`);
26624         } catch (e) {
26625           if (!abort.signal.aborted) {
26626             console.error("Failed to install clangd: ", e);
26627             const message = `Failed to install clangd language server: ${e}
26628 You may want to install it manually.`;
26629             ui.showHelp(message, installURL);
26630           }
26631         }
26632       });
26633     }
26634     exports2.installLatest = installLatest2;
26635     function checkUpdates2(requested, ui) {
26636       return __awaiter(this, void 0, void 0, function* () {
26637         try {
26638           var release = yield Github.latestRelease();
26639           yield Github.chooseAsset(release);
26640           var upgrade = yield Version.upgrade(release, ui.clangdPath);
26641         } catch (e) {
26642           console.log("Failed to check for clangd update: ", e);
26643           if (requested)
26644             ui.error(`Failed to check for clangd update: ${e}`);
26645           return;
26646         }
26647         console.log("Checking for clangd update: available=", upgrade.new, " installed=", upgrade.old);
26648         if (!upgrade.upgrade) {
26649           if (requested)
26650             ui.info(`clangd is up-to-date (you have ${upgrade.old}, latest is ${upgrade.new})`);
26651           return;
26652         }
26653         ui.promptUpdate(upgrade.old, upgrade.new);
26654       });
26655     }
26656     exports2.checkUpdates = checkUpdates2;
26657     function recover(ui) {
26658       return __awaiter(this, void 0, void 0, function* () {
26659         try {
26660           const release = yield Github.latestRelease();
26661           yield Github.chooseAsset(release);
26662           ui.promptInstall(release.name);
26663         } catch (e) {
26664           console.error("Auto-install failed: ", e);
26665           ui.showHelp("The clangd language server is not installed.", installURL);
26666         }
26667       });
26668     }
26669     var installURL = "https://clangd.llvm.org/installation.html";
26670     var githubReleaseURL = "https://api.github.com/repos/clangd/clangd/releases/latest";
26671     function fakeGitHubReleaseURL(u) {
26672       githubReleaseURL = u;
26673     }
26674     exports2.fakeGitHubReleaseURL = fakeGitHubReleaseURL;
26675     var lddCommand = "ldd";
26676     function fakeLddCommand(l2) {
26677       lddCommand = l2;
26678     }
26679     exports2.fakeLddCommand = fakeLddCommand;
26680     var Github;
26681     (function(Github2) {
26682       function latestRelease() {
26683         return __awaiter(this, void 0, void 0, function* () {
26684           const response = yield node_fetch_1.default(githubReleaseURL);
26685           if (!response.ok) {
26686             console.log(response.url, response.status, response.statusText);
26687             throw new Error(`Can't fetch release: ${response.statusText}`);
26688           }
26689           return yield response.json();
26690         });
26691       }
26692       Github2.latestRelease = latestRelease;
26693       function chooseAsset(release) {
26694         return __awaiter(this, void 0, void 0, function* () {
26695           const variants = {
26696             "win32": "windows",
26697             "linux": "linux",
26698             "darwin": "mac"
26699           };
26700           const variant = variants[os.platform()];
26701           if (variant == "linux") {
26702             const minGlibc = new semver.Range("2.18");
26703             const oldGlibc = yield Version.oldGlibc(minGlibc);
26704             if (oldGlibc) {
26705               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.`);
26706             }
26707           }
26708           if (variant && (os.arch() == "x64" || variant == "windows" || os.arch() == "arm64" && variant == "mac")) {
26709             const asset = release.assets.find((a) => a.name.indexOf(variant) >= 0);
26710             if (asset)
26711               return asset;
26712           }
26713           throw new Error(`No clangd ${release.name} binary available for ${os.platform()}/${os.arch()}`);
26714         });
26715       }
26716       Github2.chooseAsset = chooseAsset;
26717     })(Github || (Github = {}));
26718     var Install;
26719     (function(Install2) {
26720       function install2(release, asset, abort, ui) {
26721         return __awaiter(this, void 0, void 0, function* () {
26722           const dirs = yield createDirs(ui);
26723           const extractRoot = path2.join(dirs.install, release.tag_name);
26724           if (yield util_1.promisify(fs2.exists)(extractRoot)) {
26725             const reuse = yield ui.shouldReuse(release.name);
26726             if (reuse === void 0) {
26727               abort.abort();
26728               throw new Error(`clangd ${release.name} already installed!`);
26729             }
26730             if (reuse) {
26731               let files = (yield readdirp.promise(extractRoot)).map((e) => e.fullPath);
26732               return findExecutable(files);
26733             } else {
26734               yield util_1.promisify(rimraf)(extractRoot);
26735             }
26736           }
26737           const zipFile = path2.join(dirs.download, asset.name);
26738           yield download(asset.browser_download_url, zipFile, abort, ui);
26739           const archive = yield unzipper.Open.file(zipFile);
26740           const executable = findExecutable(archive.files.map((f) => f.path));
26741           yield ui.slow(`Extracting ${asset.name}`, archive.extract({ path: extractRoot }));
26742           const clangdPath = path2.join(extractRoot, executable);
26743           yield fs2.promises.chmod(clangdPath, 493);
26744           yield fs2.promises.unlink(zipFile);
26745           return clangdPath;
26746         });
26747       }
26748       Install2.install = install2;
26749       function createDirs(ui) {
26750         return __awaiter(this, void 0, void 0, function* () {
26751           const install3 = path2.join(ui.storagePath, "install");
26752           const download2 = path2.join(ui.storagePath, "download");
26753           for (const dir of [install3, download2])
26754             yield fs2.promises.mkdir(dir, { "recursive": true });
26755           return { install: install3, download: download2 };
26756         });
26757       }
26758       function findExecutable(paths) {
26759         const filename = os.platform() == "win32" ? "clangd.exe" : "clangd";
26760         const entry = paths.find((f) => path2.posix.basename(f) == filename || path2.win32.basename(f) == filename);
26761         if (entry == null)
26762           throw new Error("Didn't find a clangd executable!");
26763         return entry;
26764       }
26765       function download(url, dest, abort, ui) {
26766         return __awaiter(this, void 0, void 0, function* () {
26767           console.log("Downloading ", url, " to ", dest);
26768           return ui.progress(`Downloading ${path2.basename(dest)}`, abort, (progress) => __awaiter(this, void 0, void 0, function* () {
26769             const response = yield node_fetch_1.default(url, { signal: abort.signal });
26770             if (!response.ok)
26771               throw new Error(`Failed to download $url`);
26772             const size = Number(response.headers.get("content-length"));
26773             let read = 0;
26774             response.body.on("data", (chunk) => {
26775               read += chunk.length;
26776               progress(read / size);
26777             });
26778             const out = fs2.createWriteStream(dest);
26779             yield util_1.promisify(stream.pipeline)(response.body, out).catch((e) => {
26780               fs2.unlink(dest, (_) => null);
26781               throw e;
26782             });
26783           }));
26784         });
26785       }
26786     })(Install || (Install = {}));
26787     var Version;
26788     (function(Version2) {
26789       function upgrade(release, clangdPath) {
26790         return __awaiter(this, void 0, void 0, function* () {
26791           const releasedVer = released(release);
26792           const installedVer = yield installed(clangdPath);
26793           return {
26794             old: installedVer.raw,
26795             new: releasedVer.raw,
26796             upgrade: rangeGreater(releasedVer, installedVer)
26797           };
26798         });
26799       }
26800       Version2.upgrade = upgrade;
26801       const loose = {
26802         "loose": true
26803       };
26804       function installed(clangdPath) {
26805         return __awaiter(this, void 0, void 0, function* () {
26806           const output = yield run(clangdPath, ["--version"]);
26807           console.log(clangdPath, " --version output: ", output);
26808           const prefix = "clangd version ";
26809           if (!output.startsWith(prefix))
26810             throw new Error(`Couldn't parse clangd --version output: ${output}`);
26811           const rawVersion = output.substr(prefix.length).split(" ", 1)[0];
26812           return new semver.Range(rawVersion, loose);
26813         });
26814       }
26815       function released(release) {
26816         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);
26817       }
26818       function oldGlibc(min) {
26819         return __awaiter(this, void 0, void 0, function* () {
26820           const output = yield run(lddCommand, ["--version"]);
26821           const line = output.split("\n", 1)[0];
26822           const match = line.match(/^ldd .*glibc.* (\d+(?:\.\d+)+)[^ ]*$/i);
26823           if (!match || !semver.validRange(match[1], loose)) {
26824             console.error(`Can't glibc version from ldd --version output: ${line}`);
26825             return null;
26826           }
26827           const version = new semver.Range(match[1], loose);
26828           console.log("glibc is", version.raw, "min is", min.raw);
26829           return rangeGreater(min, version) ? version : null;
26830         });
26831       }
26832       Version2.oldGlibc = oldGlibc;
26833       function run(command, flags) {
26834         var e_1, _a;
26835         return __awaiter(this, void 0, void 0, function* () {
26836           const child = child_process.spawn(command, flags, { stdio: ["ignore", "pipe", "ignore"] });
26837           let output = "";
26838           try {
26839             for (var _b = __asyncValues(child.stdout), _c; _c = yield _b.next(), !_c.done; ) {
26840               const chunk = _c.value;
26841               output += chunk;
26842             }
26843           } catch (e_1_1) {
26844             e_1 = { error: e_1_1 };
26845           } finally {
26846             try {
26847               if (_c && !_c.done && (_a = _b.return))
26848                 yield _a.call(_b);
26849             } finally {
26850               if (e_1)
26851                 throw e_1.error;
26852             }
26853           }
26854           return output;
26855         });
26856       }
26857       function rangeGreater(newVer, oldVer) {
26858         return semver.gtr(semver.minVersion(newVer), oldVer);
26859       }
26860     })(Version || (Version = {}));
26861   }
26862 });
26863
26864 // src/index.ts
26865 __export(exports, {
26866   activate: () => activate2
26867 });
26868 var import_coc9 = __toModule(require("coc.nvim"));
26869
26870 // src/cmds.ts
26871 var import_coc = __toModule(require("coc.nvim"));
26872 var fs = __toModule(require("fs"));
26873 var path = __toModule(require("path"));
26874 var SwitchSourceHeaderRequest;
26875 (function(SwitchSourceHeaderRequest2) {
26876   SwitchSourceHeaderRequest2.type = new import_coc.RequestType("textDocument/switchSourceHeader");
26877 })(SwitchSourceHeaderRequest || (SwitchSourceHeaderRequest = {}));
26878 var SymbolInfoRequest;
26879 (function(SymbolInfoRequest2) {
26880   SymbolInfoRequest2.type = new import_coc.RequestType("textDocument/symbolInfo");
26881 })(SymbolInfoRequest || (SymbolInfoRequest = {}));
26882 function switchSourceHeader(ctx) {
26883   return async (openCommand) => {
26884     if (!ctx.client) {
26885       return;
26886     }
26887     const doc = await import_coc.workspace.document;
26888     if (!doc) {
26889       return;
26890     }
26891     const params = {
26892       uri: doc.uri
26893     };
26894     const dest = await ctx.client.sendRequest(SwitchSourceHeaderRequest.type.method, params);
26895     if (!dest) {
26896       import_coc.window.showMessage(`Didn't find a corresponding file.`);
26897       return;
26898     }
26899     await import_coc.workspace.jumpTo(dest, null, openCommand);
26900   };
26901 }
26902 function symbolInfo(ctx) {
26903   return async () => {
26904     if (!ctx.client) {
26905       return;
26906     }
26907     const doc = await import_coc.workspace.document;
26908     if (!doc) {
26909       return;
26910     }
26911     const position = await import_coc.window.getCursorPosition();
26912     const params = {
26913       textDocument: { uri: doc.uri },
26914       position
26915     };
26916     const details = await ctx.client.sendRequest(SymbolInfoRequest.type.method, params);
26917     if (!details.length) {
26918       return;
26919     }
26920     const detail = details[0];
26921     import_coc.window.showMessage(`name: ${detail.name}, containerName: ${detail.containerName}, usr: ${detail.usr}`);
26922   };
26923 }
26924 function getUserConfigFile() {
26925   let dir;
26926   switch (process.platform) {
26927     case "win32":
26928       dir = process.env.LOCALAPPDATA;
26929       break;
26930     case "darwin":
26931       dir = path.join(process.env.HOME, "Library", "Preferences");
26932       break;
26933     default:
26934       dir = process.env.XDG_CONFIG_HOME || path.join(process.env.HOME, ".config");
26935       break;
26936   }
26937   if (!dir)
26938     return "";
26939   return path.join(dir, "clangd", "config.yaml");
26940 }
26941 async function openConfigFile(p) {
26942   if (!fs.existsSync(p)) {
26943     await import_coc.workspace.createFile(p);
26944   }
26945   await import_coc.workspace.openResource(p);
26946 }
26947 function userConfig() {
26948   const file = getUserConfigFile();
26949   if (file) {
26950     openConfigFile(file);
26951   } else {
26952     import_coc.window.showMessage("Couldn't get global configuration directory", "warning");
26953   }
26954 }
26955 function projectConfig() {
26956   if (import_coc.workspace.workspaceFolders.length > 0) {
26957     const folder = import_coc.workspace.workspaceFolders[0];
26958     openConfigFile(path.join(import_coc.Uri.parse(folder.uri).fsPath, ".clangd"));
26959   } else {
26960     import_coc.window.showMessage("No project is open", "warning");
26961   }
26962 }
26963
26964 // src/ctx.ts
26965 var import_coc4 = __toModule(require("coc.nvim"));
26966
26967 // src/config.ts
26968 var import_coc2 = __toModule(require("coc.nvim"));
26969 var Config = class {
26970   constructor() {
26971     this.cfg = import_coc2.workspace.getConfiguration("clangd");
26972   }
26973   get enabled() {
26974     return this.cfg.get("enabled");
26975   }
26976   get disableDiagnostics() {
26977     return this.cfg.get("disableDiagnostics");
26978   }
26979   get disableSnippetCompletion() {
26980     return this.cfg.get("disableSnippetCompletion");
26981   }
26982   get disableCompletion() {
26983     return this.cfg.get("disableCompletion");
26984   }
26985   get arguments() {
26986     return this.cfg.get("arguments", []).map((arg) => import_coc2.workspace.expand(arg));
26987   }
26988   get trace() {
26989     return this.cfg.get("trace", { file: "", server: "off" });
26990   }
26991   get fallbackFlags() {
26992     return this.cfg.get("fallbackFlags", []);
26993   }
26994   get semanticHighlighting() {
26995     return this.cfg.get("semanticHighlighting");
26996   }
26997   get showDBChangedNotification() {
26998     return this.cfg.get("showDBChangedNotification");
26999   }
27000   get compilationDatabasePath() {
27001     return this.cfg.get("compilationDatabasePath");
27002   }
27003   get serverCompletionRanking() {
27004     return this.cfg.get("serverCompletionRanking");
27005   }
27006 };
27007
27008 // src/semantic-highlighting.ts
27009 var import_coc3 = __toModule(require("coc.nvim"));
27010 var import_vscode_languageserver_protocol = __toModule(require_main2());
27011 var SemanticHighlightingFeature = class {
27012   constructor(client, context) {
27013     this.scopeTable = [];
27014     this.bufTokens = {};
27015     context.subscriptions.push(client.onDidChangeState(({ newState }) => {
27016       if (newState === import_coc3.State.Running) {
27017         const notification = new import_vscode_languageserver_protocol.NotificationType("textDocument/semanticHighlighting");
27018         client.onNotification(notification.method, this.handleNotification.bind(this));
27019       }
27020     }));
27021   }
27022   dispose() {
27023   }
27024   initialize(capabilities) {
27025     const serverCapabilities = capabilities;
27026     if (!serverCapabilities.semanticHighlighting)
27027       return;
27028     this.scopeTable = serverCapabilities.semanticHighlighting.scopes;
27029   }
27030   fillClientCapabilities(capabilities) {
27031     const textDocumentCapabilities = capabilities.textDocument;
27032     textDocumentCapabilities.semanticHighlightingCapabilities = {
27033       semanticHighlighting: true
27034     };
27035   }
27036   async handleNotification(params) {
27037     const doc = import_coc3.workspace.getDocument(params.textDocument.uri);
27038     if (!(doc.bufnr in this.bufTokens))
27039       this.bufTokens[doc.bufnr] = [];
27040     const lines = this.bufTokens[doc.bufnr];
27041     for (const line of params.lines) {
27042       while (line.line >= lines.length)
27043         lines.push([]);
27044       lines[line.line] = this.decodeTokens(line.tokens);
27045     }
27046     const symbols = [];
27047     const skipped = [];
27048     for (const [line, tokens] of lines.entries()) {
27049       for (const token of tokens) {
27050         if (token.kind === "InactiveCode") {
27051           skipped.push(import_vscode_languageserver_protocol.Range.create(line, token.character, line, token.character + token.length));
27052         } else {
27053           symbols.push({
27054             id: 0,
27055             kind: token.kind,
27056             ranges: [import_vscode_languageserver_protocol.Range.create(line, token.character, line, token.character + token.length)],
27057             parentKind: "Unknown",
27058             storage: "None"
27059           });
27060         }
27061       }
27062     }
27063     await import_coc3.workspace.nvim.call("lsp_cxx_hl#hl#notify_symbols", [doc.bufnr, symbols]);
27064     if (skipped.length) {
27065       await import_coc3.workspace.nvim.call("lsp_cxx_hl#hl#notify_skipped", [doc.bufnr, skipped]);
27066     }
27067   }
27068   decodeTokens(tokens) {
27069     const scopeMask = 65535;
27070     const lenShift = 16;
27071     const uint32Size = 4;
27072     const buf = Buffer.from(tokens, "base64");
27073     const retTokens = [];
27074     for (let i = 0, end = buf.length / uint32Size; i < end; i += 2) {
27075       const start = buf.readUInt32BE(i * uint32Size);
27076       const lenKind = buf.readUInt32BE((i + 1) * uint32Size);
27077       const scopeIndex = lenKind & scopeMask;
27078       const len = lenKind >>> lenShift;
27079       const kind = this.scopeTable[scopeIndex][0];
27080       retTokens.push({ character: start, scopeIndex, length: len, kind: this.decodeKind(kind) });
27081     }
27082     return retTokens;
27083   }
27084   decodeKind(kind) {
27085     switch (kind) {
27086       case "entity.name.function.cpp":
27087         return "Function";
27088       case "entity.name.function.method.cpp":
27089         return "Method";
27090       case "entity.name.function.method.static.cpp":
27091         return "StaticMethod";
27092       case "variable.other.cpp":
27093         return "Variable";
27094       case "variable.other.local.cpp":
27095         return "LocalVariable";
27096       case "variable.parameter.cpp":
27097         return "Parameter";
27098       case "variable.other.field.cpp":
27099         return "Field";
27100       case "variable.other.field.static.cpp":
27101         return "StaticField";
27102       case "entity.name.type.class.cpp":
27103         return "Class";
27104       case "entity.name.type.enum.cpp":
27105         return "Enum";
27106       case "variable.other.enummember.cpp":
27107         return "EnumConstant";
27108       case "entity.name.type.typedef.cpp":
27109         return "Typedef";
27110       case "entity.name.type.dependent.cpp":
27111         return "DependentType";
27112       case "entity.name.other.dependent.cpp":
27113         return "DependentName";
27114       case "entity.name.namespace.cpp":
27115         return "Namespace";
27116       case "entity.name.type.template.cpp":
27117         return "TemplateParameter";
27118       case "entity.name.type.concept.cpp":
27119         return "Concept";
27120       case "storage.type.primitive.cpp":
27121         return "Primitive";
27122       case "entity.name.function.preprocessor.cpp":
27123         return "Macro";
27124       case "meta.disabled":
27125         return "InactiveCode";
27126       default:
27127         return "Unknown";
27128     }
27129   }
27130 };
27131
27132 // src/ctx.ts
27133 var ClangdExtensionFeature = class {
27134   constructor() {
27135   }
27136   dispose() {
27137   }
27138   initialize() {
27139   }
27140   fillClientCapabilities(capabilities) {
27141     const extendedCompletionCapabilities = capabilities.textDocument.completion;
27142     if (extendedCompletionCapabilities) {
27143       extendedCompletionCapabilities.editsNearCursor = true;
27144     }
27145   }
27146 };
27147 var Ctx = class {
27148   constructor(context) {
27149     this.context = context;
27150     this.client = null;
27151     this.config = new Config();
27152   }
27153   async startServer(bin, ...features) {
27154     const old = this.client;
27155     if (old) {
27156       await old.stop();
27157     }
27158     const exec = {
27159       command: bin,
27160       args: this.config.arguments
27161     };
27162     if (this.config.trace.file) {
27163       exec.options = { env: { CLANGD_TRACE: this.config.trace.file } };
27164     }
27165     const serverOptions = exec;
27166     const initializationOptions = { clangdFileStatus: true, fallbackFlags: this.config.fallbackFlags };
27167     if (this.config.compilationDatabasePath) {
27168       initializationOptions.compilationDatabasePath = this.config.compilationDatabasePath;
27169     }
27170     const clientOptions = {
27171       documentSelector: [
27172         { scheme: "file", language: "c" },
27173         { scheme: "file", language: "cpp" },
27174         { scheme: "file", language: "objc" },
27175         { scheme: "file", language: "objcpp" },
27176         { scheme: "file", language: "objective-c" },
27177         { scheme: "file", language: "objective-cpp" },
27178         { scheme: "file", language: "opencl" },
27179         { scheme: "file", language: "cuda" }
27180       ],
27181       initializationOptions,
27182       disableDiagnostics: this.config.disableDiagnostics,
27183       disableSnippetCompletion: this.config.disableSnippetCompletion,
27184       disableCompletion: this.config.disableCompletion,
27185       middleware: {
27186         provideOnTypeFormattingEdits: (document2, position, ch, options, token, next) => {
27187           const line = document2.getText(import_coc4.Range.create(position.line, 0, position.line, position.character));
27188           if (!line.trim().length)
27189             return;
27190           if (ch === "\n")
27191             ch = "";
27192           return next(document2, position, ch, options, token);
27193         },
27194         provideCompletionItem: async (document2, position, context, token, next) => {
27195           var _a;
27196           const list = await next(document2, position, context, token);
27197           if (!list)
27198             return [];
27199           if (!this.config.serverCompletionRanking)
27200             return list;
27201           const tail = await import_coc4.workspace.nvim.eval(`strpart(getline('.'), col('.') - 1)`);
27202           const semicolon = /^\s*$/.test(tail);
27203           const items = Array.isArray(list) ? list : list.items;
27204           for (const item of items) {
27205             if (this.config.serverCompletionRanking) {
27206               const start = (_a = item.textEdit) == null ? void 0 : _a.range.start;
27207               if (start) {
27208                 const prefix = document2.getText(import_coc4.Range.create(start, position));
27209                 if (prefix)
27210                   item.filterText = prefix + "_" + item.filterText;
27211               }
27212             }
27213             if (semicolon && item.insertTextFormat === import_coc4.InsertTextFormat.Snippet && item.textEdit) {
27214               const { textEdit } = item;
27215               const { newText } = textEdit;
27216               if (item.kind === import_coc4.CompletionItemKind.Function || item.kind === import_coc4.CompletionItemKind.Text && newText.slice(-1) === ")") {
27217                 item.textEdit = { range: textEdit.range, newText: newText + ";" };
27218               }
27219             }
27220           }
27221           return Array.isArray(list) ? items : { items, isIncomplete: list.isIncomplete };
27222         },
27223         provideWorkspaceSymbols: async (query, token, next) => {
27224           const symbols = await next(query, token);
27225           if (!symbols)
27226             return;
27227           return symbols.map((symbol) => {
27228             if (query.includes("::")) {
27229               if (symbol.containerName) {
27230                 symbol.name = `${symbol.containerName}::${symbol.name}`;
27231               }
27232               symbol.containerName = "";
27233             }
27234             return symbol;
27235           });
27236         }
27237       }
27238     };
27239     const client = new import_coc4.LanguageClient("clangd", serverOptions, clientOptions);
27240     if (this.config.semanticHighlighting) {
27241       const lspCxx = await import_coc4.workspace.nvim.call("exists", "g:lsp_cxx_hl_loaded");
27242       if (lspCxx === 1) {
27243         client.registerFeature(new SemanticHighlightingFeature(client, this.context));
27244       }
27245     }
27246     for (const feature of features)
27247       client.registerFeature(feature);
27248     this.context.subscriptions.push(import_coc4.services.registLanguageClient(client));
27249     await client.onReady();
27250     this.client = client;
27251   }
27252   get subscriptions() {
27253     return this.context.subscriptions;
27254   }
27255 };
27256
27257 // src/file_status.ts
27258 var import_coc5 = __toModule(require("coc.nvim"));
27259 var FileStatus = class {
27260   constructor() {
27261     this.statuses = new Map();
27262     this.statusBarItem = import_coc5.window.createStatusBarItem(0);
27263   }
27264   onFileUpdated(status) {
27265     this.statuses.set(status.uri, status);
27266     this.updateStatus();
27267   }
27268   async updateStatus() {
27269     const doc = await import_coc5.workspace.document;
27270     if (!doc) {
27271       return;
27272     }
27273     const status = this.statuses.get(doc.uri);
27274     if (!status || status.state === "idle") {
27275       this.statusBarItem.hide();
27276       return;
27277     }
27278     this.statusBarItem.text = `clangd: ` + status.state;
27279     this.statusBarItem.show();
27280   }
27281   clear() {
27282     this.statuses.clear();
27283     this.statusBarItem.hide();
27284   }
27285   dispose() {
27286     this.statusBarItem.dispose();
27287   }
27288 };
27289
27290 // src/install.ts
27291 var common = __toModule(require_src());
27292 var coc = __toModule(require("coc.nvim"));
27293 var import_os = __toModule(require("os"));
27294 var UI = class {
27295   constructor(context, config) {
27296     this.context = context;
27297     this.config = config;
27298   }
27299   get storagePath() {
27300     return this.context.storagePath;
27301   }
27302   slow(title, result) {
27303     coc.window.showMessage(title + "...");
27304     return result;
27305   }
27306   error(s) {
27307     coc.window.showMessage(s, "error");
27308   }
27309   info(s) {
27310     coc.window.showMessage(s);
27311   }
27312   progress(title, _cancel, body) {
27313     return this.slow(title, body(() => {
27314     }));
27315   }
27316   async shouldReuse(release) {
27317     coc.window.showMessage(`Reusing existing ${release} installation in ${this.storagePath}`);
27318     return true;
27319   }
27320   async promptReload() {
27321     await coc.commands.executeCommand("editor.action.restart");
27322   }
27323   showHelp(message, url) {
27324     message += ` See ${url}.`;
27325     coc.window.showMessage(message);
27326   }
27327   async promptUpdate(oldVersion, newVersion) {
27328     const message = `clangd ${newVersion} is available (you have ${oldVersion}). :CocCommand clangd.install, or :CocSettings to disable clangd.checkUpdates.`;
27329     coc.window.showMessage(message);
27330   }
27331   async promptInstall(version) {
27332     const message = `clangd was not found on your PATH. :CocCommand clangd.install will install ${version}.`;
27333     coc.window.showMessage(message);
27334   }
27335   get clangdPath() {
27336     return coc.workspace.expand(this.config.get("path", ""));
27337   }
27338   set clangdPath(p) {
27339     this.config.update("path", p.replace((0, import_os.homedir)(), "~"), true);
27340   }
27341 };
27342 async function activate(context) {
27343   const cfg = coc.workspace.getConfiguration("clangd");
27344   const ui = new UI(context, cfg);
27345   context.subscriptions.push(coc.commands.registerCommand("clangd.install", async () => common.installLatest(ui)));
27346   context.subscriptions.push(coc.commands.registerCommand("clangd.update", async () => common.checkUpdates(true, ui)));
27347   const status = await common.prepare(ui, cfg.get("checkUpdates", false));
27348   return status.clangdPath;
27349 }
27350
27351 // src/reload.ts
27352 var import_coc6 = __toModule(require("coc.nvim"));
27353 var import_path = __toModule(require("path"));
27354 var ReloadFeature = class {
27355   constructor(ctx, activate3) {
27356     this.ctx = ctx;
27357     this.activate = activate3;
27358   }
27359   dispose() {
27360   }
27361   initialize(caps) {
27362     var _a;
27363     if ((_a = caps.compilationDatabase) == null ? void 0 : _a.automaticReload) {
27364       return;
27365     }
27366     const fileWatcher = import_coc6.workspace.createFileSystemWatcher("**/{compile_commands.json,compile_flags.txt}");
27367     this.ctx.subscriptions.push(fileWatcher, fileWatcher.onDidChange((e) => this.reload(e.fsPath)), fileWatcher.onDidCreate((e) => this.reload(e.fsPath)));
27368   }
27369   fillClientCapabilities() {
27370   }
27371   async reload(url) {
27372     const notification = this.ctx.config.showDBChangedNotification;
27373     if (notification) {
27374       const msg = `${(0, import_path.basename)(url)} has changed, clangd is reloading...`;
27375       import_coc6.window.showMessage(msg);
27376     }
27377     for (const sub of this.ctx.subscriptions) {
27378       try {
27379         sub.dispose();
27380       } catch (e) {
27381         console.error(e);
27382       }
27383     }
27384     this.activate();
27385     if (notification)
27386       import_coc6.window.showMessage(`clangd has reloaded`);
27387   }
27388 };
27389
27390 // src/memory-usage.ts
27391 var import_coc7 = __toModule(require("coc.nvim"));
27392 var MemoryUsageRequest = new import_coc7.RequestType0("$/memoryUsage");
27393 function convert2(m, title) {
27394   const slash = Math.max(title.lastIndexOf("/"), title.lastIndexOf("\\"));
27395   return {
27396     title,
27397     isFile: slash >= 0,
27398     total: m._total,
27399     self: m._self,
27400     children: Object.keys(m).sort().filter((x) => !x.startsWith("_")).map((e) => convert2(m[e], e)).sort((x, y) => y.total - x.total)
27401   };
27402 }
27403 var results = [];
27404 function format(c) {
27405   const msg = `${c.title} ${(c.total / 1024 / 1024).toFixed(2)} MB`;
27406   if (c.title === "clangd_server") {
27407     results.push(msg);
27408   }
27409   if (["background_index", "tuscheduler", "dynamic_index"].includes(c.title)) {
27410     results.push(" \u2514 " + msg);
27411   }
27412   for (const child of c.children) {
27413     format(child);
27414   }
27415 }
27416 var MemoryUsageFeature = class {
27417   constructor(ctx) {
27418     this.memoryUsageProvider = false;
27419     ctx.subscriptions.push(import_coc7.commands.registerCommand("clangd.memoryUsage", async () => {
27420       if (this.memoryUsageProvider) {
27421         const usage = await ctx.client.sendRequest(MemoryUsageRequest.method, {});
27422         results.length = 0;
27423         format(convert2(usage, "<root>"));
27424         import_coc7.window.echoLines(results);
27425       } else {
27426         import_coc7.window.showMessage(`Your clangd doesn't support memory usage report, clangd 12+ is needed`, "warning");
27427       }
27428     }));
27429   }
27430   fillClientCapabilities() {
27431   }
27432   fillInitializeParams() {
27433   }
27434   initialize(capabilities) {
27435     this.memoryUsageProvider = "memoryUsageProvider" in capabilities;
27436   }
27437   dispose() {
27438   }
27439 };
27440
27441 // src/ast.ts
27442 var import_coc8 = __toModule(require("coc.nvim"));
27443 var ASTRequestType = new import_coc8.RequestType("textDocument/ast");
27444 var ASTFeature = class {
27445   constructor(ctx) {
27446     this.ctx = ctx;
27447   }
27448   fillClientCapabilities() {
27449   }
27450   initialize(capabilities) {
27451     if ("astProvider" in capabilities) {
27452       const adapter = new TreeAdapter();
27453       const tree = import_coc8.window.createTreeView("clangd.AST", { treeDataProvider: adapter });
27454       this.ctx.subscriptions.push(tree, adapter.onDidChangeTreeData((_) => {
27455         if (adapter.hasRoot()) {
27456           tree.reveal(null);
27457         }
27458       }), import_coc8.commands.registerCommand("clangd.ast", async () => {
27459         if (!this.ctx.client)
27460           return;
27461         let range = null;
27462         const { document: document2, position } = await import_coc8.workspace.getCurrentState();
27463         const mode = await import_coc8.workspace.nvim.call("visualmode");
27464         if (mode)
27465           range = await import_coc8.workspace.getSelectedRange(mode, import_coc8.workspace.getDocument(document2.uri));
27466         if (!range)
27467           range = import_coc8.Range.create(position, position);
27468         const params = {
27469           textDocument: { uri: document2.uri },
27470           range
27471         };
27472         const item = await this.ctx.client.sendRequest(ASTRequestType, params);
27473         if (!item) {
27474           import_coc8.window.showInformationMessage("No AST node at selection");
27475           return;
27476         }
27477         const winid = await import_coc8.workspace.nvim.eval("win_getid()");
27478         adapter.setRoot(item, import_coc8.Uri.parse(document2.uri), winid);
27479         tree.show();
27480       }));
27481     }
27482   }
27483   dispose() {
27484   }
27485 };
27486 function describe(role, kind) {
27487   if (role === "expression" || role === "statement" || role === "declaration" || role === "template name") {
27488     return kind;
27489   }
27490   return kind + " " + role;
27491 }
27492 var TreeAdapter = class {
27493   constructor() {
27494     this._onDidChangeTreeData = new import_coc8.Emitter();
27495     this.onDidChangeTreeData = this._onDidChangeTreeData.event;
27496   }
27497   hasRoot() {
27498     return this.root !== void 0;
27499   }
27500   setRoot(newRoot, newDoc, winid) {
27501     this.root = newRoot;
27502     this.doc = newDoc;
27503     this.winid = winid;
27504     this._onDidChangeTreeData.fire(null);
27505   }
27506   getTreeItem(node) {
27507     const item = new import_coc8.TreeItem(describe(node.role, node.kind));
27508     if (node.children && node.children.length > 0) {
27509       item.collapsibleState = import_coc8.TreeItemCollapsibleState.Expanded;
27510     }
27511     item.description = node.detail;
27512     item.tooltip = node.arcana;
27513     if (node.range && this.winid) {
27514       item.command = {
27515         title: "Jump to",
27516         command: "workspace.openLocation",
27517         arguments: [this.winid, { uri: this.doc, range: node.range }]
27518       };
27519     }
27520     return item;
27521   }
27522   getChildren(element) {
27523     return element ? element.children || [] : this.root ? [this.root] : [];
27524   }
27525   getParent(node) {
27526     if (node === this.root)
27527       return void 0;
27528     function findUnder(parent) {
27529       var _a;
27530       for (const child of (_a = parent == null ? void 0 : parent.children) != null ? _a : []) {
27531         const result = node === child ? parent : findUnder(child);
27532         if (result)
27533           return result;
27534       }
27535       return void 0;
27536     }
27537     return findUnder(this.root);
27538   }
27539 };
27540
27541 // src/index.ts
27542 async function activate2(context) {
27543   var _a;
27544   const ctx = new Ctx(context);
27545   if (!ctx.config.enabled) {
27546     return;
27547   }
27548   const service = import_coc9.services.getService("clangd");
27549   if (service) {
27550     import_coc9.window.showMessage(`Looks like you've configured clangd in coc-settings.json, you should remove it to use coc-clangd`, "warning");
27551     return;
27552   }
27553   const clangdPath = await activate(context);
27554   if (!clangdPath) {
27555     return;
27556   }
27557   try {
27558     const astFeature = new ASTFeature(ctx);
27559     const extFeature = new ClangdExtensionFeature();
27560     const reloadFeature = new ReloadFeature(ctx, () => activate2(context));
27561     const memoryUsageFeature = new MemoryUsageFeature(ctx);
27562     await ctx.startServer(clangdPath, ...[astFeature, extFeature, reloadFeature, memoryUsageFeature]);
27563   } catch (e) {
27564     return;
27565   }
27566   const fileStatus = new FileStatus();
27567   context.subscriptions.push(fileStatus, import_coc9.commands.registerCommand("clangd.switchSourceHeader", switchSourceHeader(ctx)), import_coc9.commands.registerCommand("clangd.symbolInfo", symbolInfo(ctx)), import_coc9.commands.registerCommand("clangd.userConfig", userConfig), import_coc9.commands.registerCommand("clangd.projectConfig", projectConfig), ctx.client.onDidChangeState((e) => {
27568     var _a2;
27569     if (e.newState === import_coc9.State.Running) {
27570       (_a2 = ctx.client) == null ? void 0 : _a2.onNotification("textDocument/clangd.fileStatus", (status) => {
27571         fileStatus.onFileUpdated(status);
27572       });
27573     } else if (e.newState === import_coc9.State.Stopped) {
27574       fileStatus.clear();
27575     }
27576   }), import_coc9.workspace.onDidOpenTextDocument(() => {
27577     fileStatus.updateStatus();
27578   }));
27579   (_a = ctx.client) == null ? void 0 : _a.onNotification("textDocument/clangd.fileStatus", (status) => {
27580     fileStatus.onFileUpdated(status);
27581   });
27582 }
27583 // Annotate the CommonJS export names for ESM import in node:
27584 0 && (module.exports = {
27585   activate
27586 });