massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / prettier / bin-prettier.js
1 #!/usr/bin/env node
2 'use strict';
3
4 var require$$0$2 = require('path');
5 var require$$0$5 = require('fs');
6 var require$$0$1 = require('os');
7 var require$$1 = require('tty');
8 var require$$0$3 = require('util');
9 var require$$0$4 = require('stream');
10 var require$$0$6 = require('events');
11 var require$$0$7 = require('readline');
12
13 function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
14
15 var require$$0__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$0$2);
16 var require$$0__default$4 = /*#__PURE__*/_interopDefaultLegacy(require$$0$5);
17 var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0$1);
18 var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1);
19 var require$$0__default$2 = /*#__PURE__*/_interopDefaultLegacy(require$$0$3);
20 var require$$0__default$3 = /*#__PURE__*/_interopDefaultLegacy(require$$0$4);
21 var require$$0__default$5 = /*#__PURE__*/_interopDefaultLegacy(require$$0$6);
22 var require$$0__default$6 = /*#__PURE__*/_interopDefaultLegacy(require$$0$7);
23
24 var require$$0 = require("./package.json");
25
26 var semverCompare$1 = function cmp(a, b) {
27   var pa = a.split('.');
28   var pb = b.split('.');
29
30   for (var i = 0; i < 3; i++) {
31     var na = Number(pa[i]);
32     var nb = Number(pb[i]);
33     if (na > nb) return 1;
34     if (nb > na) return -1;
35     if (!isNaN(na) && isNaN(nb)) return 1;
36     if (isNaN(na) && !isNaN(nb)) return -1;
37   }
38
39   return 0;
40 };
41
42 var semverCompare = semverCompare$1;
43
44 var pleaseUpgradeNode = function pleaseUpgradeNode(pkg, opts) {
45   var opts = opts || {};
46   var requiredVersion = pkg.engines.node.replace('>=', '');
47   var currentVersion = process.version.replace('v', '');
48
49   if (semverCompare(currentVersion, requiredVersion) === -1) {
50     if (opts.message) {
51       console.error(opts.message(requiredVersion));
52     } else {
53       console.error(pkg.name + ' requires at least version ' + requiredVersion + ' of Node, please upgrade');
54     }
55
56     if (opts.hasOwnProperty('exitCode')) {
57       process.exit(opts.exitCode);
58     } else {
59       process.exit(1);
60     }
61   }
62 };
63
64 var check = function (it) {
65   return it && it.Math == Math && it;
66 };
67
68 // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
69 var global$r =
70   // eslint-disable-next-line es/no-global-this -- safe
71   check(typeof globalThis == 'object' && globalThis) ||
72   check(typeof window == 'object' && window) ||
73   // eslint-disable-next-line no-restricted-globals -- safe
74   check(typeof self == 'object' && self) ||
75   check(typeof global$r == 'object' && global$r) ||
76   // eslint-disable-next-line no-new-func -- fallback
77   (function () { return this; })() || Function('return this')();
78
79 var objectGetOwnPropertyDescriptor = {};
80
81 var fails$8 = function (exec) {
82   try {
83     return !!exec();
84   } catch (error) {
85     return true;
86   }
87 };
88
89 var fails$7 = fails$8;
90
91 // Detect IE8's incomplete defineProperty implementation
92 var descriptors = !fails$7(function () {
93   // eslint-disable-next-line es/no-object-defineproperty -- required for testing
94   return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
95 });
96
97 var call$7 = Function.prototype.call;
98
99 var functionCall = call$7.bind ? call$7.bind(call$7) : function () {
100   return call$7.apply(call$7, arguments);
101 };
102
103 var objectPropertyIsEnumerable = {};
104
105 var $propertyIsEnumerable = {}.propertyIsEnumerable;
106 // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
107 var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
108
109 // Nashorn ~ JDK8 bug
110 var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
111
112 // `Object.prototype.propertyIsEnumerable` method implementation
113 // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
114 objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
115   var descriptor = getOwnPropertyDescriptor$1(this, V);
116   return !!descriptor && descriptor.enumerable;
117 } : $propertyIsEnumerable;
118
119 var createPropertyDescriptor$3 = function (bitmap, value) {
120   return {
121     enumerable: !(bitmap & 1),
122     configurable: !(bitmap & 2),
123     writable: !(bitmap & 4),
124     value: value
125   };
126 };
127
128 var FunctionPrototype$1 = Function.prototype;
129 var bind$3 = FunctionPrototype$1.bind;
130 var call$6 = FunctionPrototype$1.call;
131 var callBind = bind$3 && bind$3.bind(call$6);
132
133 var functionUncurryThis = bind$3 ? function (fn) {
134   return fn && callBind(call$6, fn);
135 } : function (fn) {
136   return fn && function () {
137     return call$6.apply(fn, arguments);
138   };
139 };
140
141 var uncurryThis$c = functionUncurryThis;
142
143 var toString$5 = uncurryThis$c({}.toString);
144 var stringSlice = uncurryThis$c(''.slice);
145
146 var classofRaw$1 = function (it) {
147   return stringSlice(toString$5(it), 8, -1);
148 };
149
150 var global$q = global$r;
151 var uncurryThis$b = functionUncurryThis;
152 var fails$6 = fails$8;
153 var classof$5 = classofRaw$1;
154
155 var Object$4 = global$q.Object;
156 var split = uncurryThis$b(''.split);
157
158 // fallback for non-array-like ES3 and non-enumerable old V8 strings
159 var indexedObject = fails$6(function () {
160   // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
161   // eslint-disable-next-line no-prototype-builtins -- safe
162   return !Object$4('z').propertyIsEnumerable(0);
163 }) ? function (it) {
164   return classof$5(it) == 'String' ? split(it, '') : Object$4(it);
165 } : Object$4;
166
167 var global$p = global$r;
168
169 var TypeError$a = global$p.TypeError;
170
171 // `RequireObjectCoercible` abstract operation
172 // https://tc39.es/ecma262/#sec-requireobjectcoercible
173 var requireObjectCoercible$2 = function (it) {
174   if (it == undefined) throw TypeError$a("Can't call method on " + it);
175   return it;
176 };
177
178 // toObject with fallback for non-array-like ES3 strings
179 var IndexedObject = indexedObject;
180 var requireObjectCoercible$1 = requireObjectCoercible$2;
181
182 var toIndexedObject$4 = function (it) {
183   return IndexedObject(requireObjectCoercible$1(it));
184 };
185
186 // `IsCallable` abstract operation
187 // https://tc39.es/ecma262/#sec-iscallable
188 var isCallable$b = function (argument) {
189   return typeof argument == 'function';
190 };
191
192 var isCallable$a = isCallable$b;
193
194 var isObject$d = function (it) {
195   return typeof it == 'object' ? it !== null : isCallable$a(it);
196 };
197
198 var global$o = global$r;
199 var isCallable$9 = isCallable$b;
200
201 var aFunction = function (argument) {
202   return isCallable$9(argument) ? argument : undefined;
203 };
204
205 var getBuiltIn$5 = function (namespace, method) {
206   return arguments.length < 2 ? aFunction(global$o[namespace]) : global$o[namespace] && global$o[namespace][method];
207 };
208
209 var uncurryThis$a = functionUncurryThis;
210
211 var objectIsPrototypeOf = uncurryThis$a({}.isPrototypeOf);
212
213 var getBuiltIn$4 = getBuiltIn$5;
214
215 var engineUserAgent = getBuiltIn$4('navigator', 'userAgent') || '';
216
217 var global$n = global$r;
218 var userAgent$2 = engineUserAgent;
219
220 var process$1 = global$n.process;
221 var Deno = global$n.Deno;
222 var versions = process$1 && process$1.versions || Deno && Deno.version;
223 var v8 = versions && versions.v8;
224 var match, version;
225
226 if (v8) {
227   match = v8.split('.');
228   // in old Chrome, versions of V8 isn't V8 = Chrome / 10
229   // but their correct versions are not interesting for us
230   version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
231 }
232
233 // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
234 // so check `userAgent` even if `.v8` exists, but 0
235 if (!version && userAgent$2) {
236   match = userAgent$2.match(/Edge\/(\d+)/);
237   if (!match || match[1] >= 74) {
238     match = userAgent$2.match(/Chrome\/(\d+)/);
239     if (match) version = +match[1];
240   }
241 }
242
243 var engineV8Version = version;
244
245 /* eslint-disable es/no-symbol -- required for testing */
246
247 var V8_VERSION = engineV8Version;
248 var fails$5 = fails$8;
249
250 // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
251 var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$5(function () {
252   var symbol = Symbol();
253   // Chrome 38 Symbol has incorrect toString conversion
254   // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
255   return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
256     // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
257     !Symbol.sham && V8_VERSION && V8_VERSION < 41;
258 });
259
260 /* eslint-disable es/no-symbol -- required for testing */
261
262 var NATIVE_SYMBOL$1 = nativeSymbol;
263
264 var useSymbolAsUid = NATIVE_SYMBOL$1
265   && !Symbol.sham
266   && typeof Symbol.iterator == 'symbol';
267
268 var global$m = global$r;
269 var getBuiltIn$3 = getBuiltIn$5;
270 var isCallable$8 = isCallable$b;
271 var isPrototypeOf$1 = objectIsPrototypeOf;
272 var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
273
274 var Object$3 = global$m.Object;
275
276 var isSymbol$6 = USE_SYMBOL_AS_UID$1 ? function (it) {
277   return typeof it == 'symbol';
278 } : function (it) {
279   var $Symbol = getBuiltIn$3('Symbol');
280   return isCallable$8($Symbol) && isPrototypeOf$1($Symbol.prototype, Object$3(it));
281 };
282
283 var global$l = global$r;
284
285 var String$3 = global$l.String;
286
287 var tryToString$3 = function (argument) {
288   try {
289     return String$3(argument);
290   } catch (error) {
291     return 'Object';
292   }
293 };
294
295 var global$k = global$r;
296 var isCallable$7 = isCallable$b;
297 var tryToString$2 = tryToString$3;
298
299 var TypeError$9 = global$k.TypeError;
300
301 // `Assert: IsCallable(argument) is true`
302 var aCallable$5 = function (argument) {
303   if (isCallable$7(argument)) return argument;
304   throw TypeError$9(tryToString$2(argument) + ' is not a function');
305 };
306
307 var aCallable$4 = aCallable$5;
308
309 // `GetMethod` abstract operation
310 // https://tc39.es/ecma262/#sec-getmethod
311 var getMethod$3 = function (V, P) {
312   var func = V[P];
313   return func == null ? undefined : aCallable$4(func);
314 };
315
316 var global$j = global$r;
317 var call$5 = functionCall;
318 var isCallable$6 = isCallable$b;
319 var isObject$c = isObject$d;
320
321 var TypeError$8 = global$j.TypeError;
322
323 // `OrdinaryToPrimitive` abstract operation
324 // https://tc39.es/ecma262/#sec-ordinarytoprimitive
325 var ordinaryToPrimitive$1 = function (input, pref) {
326   var fn, val;
327   if (pref === 'string' && isCallable$6(fn = input.toString) && !isObject$c(val = call$5(fn, input))) return val;
328   if (isCallable$6(fn = input.valueOf) && !isObject$c(val = call$5(fn, input))) return val;
329   if (pref !== 'string' && isCallable$6(fn = input.toString) && !isObject$c(val = call$5(fn, input))) return val;
330   throw TypeError$8("Can't convert object to primitive value");
331 };
332
333 var shared$3 = {exports: {}};
334
335 var global$i = global$r;
336
337 // eslint-disable-next-line es/no-object-defineproperty -- safe
338 var defineProperty$3 = Object.defineProperty;
339
340 var setGlobal$3 = function (key, value) {
341   try {
342     defineProperty$3(global$i, key, { value: value, configurable: true, writable: true });
343   } catch (error) {
344     global$i[key] = value;
345   } return value;
346 };
347
348 var global$h = global$r;
349 var setGlobal$2 = setGlobal$3;
350
351 var SHARED = '__core-js_shared__';
352 var store$3 = global$h[SHARED] || setGlobal$2(SHARED, {});
353
354 var sharedStore = store$3;
355
356 var store$2 = sharedStore;
357
358 (shared$3.exports = function (key, value) {
359   return store$2[key] || (store$2[key] = value !== undefined ? value : {});
360 })('versions', []).push({
361   version: '3.19.1',
362   mode: 'global',
363   copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
364 });
365
366 var global$g = global$r;
367 var requireObjectCoercible = requireObjectCoercible$2;
368
369 var Object$2 = global$g.Object;
370
371 // `ToObject` abstract operation
372 // https://tc39.es/ecma262/#sec-toobject
373 var toObject$4 = function (argument) {
374   return Object$2(requireObjectCoercible(argument));
375 };
376
377 var uncurryThis$9 = functionUncurryThis;
378 var toObject$3 = toObject$4;
379
380 var hasOwnProperty$b = uncurryThis$9({}.hasOwnProperty);
381
382 // `HasOwnProperty` abstract operation
383 // https://tc39.es/ecma262/#sec-hasownproperty
384 var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
385   return hasOwnProperty$b(toObject$3(it), key);
386 };
387
388 var uncurryThis$8 = functionUncurryThis;
389
390 var id = 0;
391 var postfix = Math.random();
392 var toString$4 = uncurryThis$8(1.0.toString);
393
394 var uid$2 = function (key) {
395   return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$4(++id + postfix, 36);
396 };
397
398 var global$f = global$r;
399 var shared$2 = shared$3.exports;
400 var hasOwn$6 = hasOwnProperty_1;
401 var uid$1 = uid$2;
402 var NATIVE_SYMBOL = nativeSymbol;
403 var USE_SYMBOL_AS_UID = useSymbolAsUid;
404
405 var WellKnownSymbolsStore = shared$2('wks');
406 var Symbol$7 = global$f.Symbol;
407 var symbolFor = Symbol$7 && Symbol$7['for'];
408 var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$7 : Symbol$7 && Symbol$7.withoutSetter || uid$1;
409
410 var wellKnownSymbol$7 = function (name) {
411   if (!hasOwn$6(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
412     var description = 'Symbol.' + name;
413     if (NATIVE_SYMBOL && hasOwn$6(Symbol$7, name)) {
414       WellKnownSymbolsStore[name] = Symbol$7[name];
415     } else if (USE_SYMBOL_AS_UID && symbolFor) {
416       WellKnownSymbolsStore[name] = symbolFor(description);
417     } else {
418       WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
419     }
420   } return WellKnownSymbolsStore[name];
421 };
422
423 var global$e = global$r;
424 var call$4 = functionCall;
425 var isObject$b = isObject$d;
426 var isSymbol$5 = isSymbol$6;
427 var getMethod$2 = getMethod$3;
428 var ordinaryToPrimitive = ordinaryToPrimitive$1;
429 var wellKnownSymbol$6 = wellKnownSymbol$7;
430
431 var TypeError$7 = global$e.TypeError;
432 var TO_PRIMITIVE = wellKnownSymbol$6('toPrimitive');
433
434 // `ToPrimitive` abstract operation
435 // https://tc39.es/ecma262/#sec-toprimitive
436 var toPrimitive$1 = function (input, pref) {
437   if (!isObject$b(input) || isSymbol$5(input)) return input;
438   var exoticToPrim = getMethod$2(input, TO_PRIMITIVE);
439   var result;
440   if (exoticToPrim) {
441     if (pref === undefined) pref = 'default';
442     result = call$4(exoticToPrim, input, pref);
443     if (!isObject$b(result) || isSymbol$5(result)) return result;
444     throw TypeError$7("Can't convert object to primitive value");
445   }
446   if (pref === undefined) pref = 'number';
447   return ordinaryToPrimitive(input, pref);
448 };
449
450 var toPrimitive = toPrimitive$1;
451 var isSymbol$4 = isSymbol$6;
452
453 // `ToPropertyKey` abstract operation
454 // https://tc39.es/ecma262/#sec-topropertykey
455 var toPropertyKey$3 = function (argument) {
456   var key = toPrimitive(argument, 'string');
457   return isSymbol$4(key) ? key : key + '';
458 };
459
460 var global$d = global$r;
461 var isObject$a = isObject$d;
462
463 var document$1 = global$d.document;
464 // typeof document.createElement is 'object' in old IE
465 var EXISTS$1 = isObject$a(document$1) && isObject$a(document$1.createElement);
466
467 var documentCreateElement$1 = function (it) {
468   return EXISTS$1 ? document$1.createElement(it) : {};
469 };
470
471 var DESCRIPTORS$5 = descriptors;
472 var fails$4 = fails$8;
473 var createElement = documentCreateElement$1;
474
475 // Thank's IE8 for his funny defineProperty
476 var ie8DomDefine = !DESCRIPTORS$5 && !fails$4(function () {
477   // eslint-disable-next-line es/no-object-defineproperty -- requied for testing
478   return Object.defineProperty(createElement('div'), 'a', {
479     get: function () { return 7; }
480   }).a != 7;
481 });
482
483 var DESCRIPTORS$4 = descriptors;
484 var call$3 = functionCall;
485 var propertyIsEnumerableModule = objectPropertyIsEnumerable;
486 var createPropertyDescriptor$2 = createPropertyDescriptor$3;
487 var toIndexedObject$3 = toIndexedObject$4;
488 var toPropertyKey$2 = toPropertyKey$3;
489 var hasOwn$5 = hasOwnProperty_1;
490 var IE8_DOM_DEFINE$1 = ie8DomDefine;
491
492 // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
493 var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
494
495 // `Object.getOwnPropertyDescriptor` method
496 // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
497 objectGetOwnPropertyDescriptor.f = DESCRIPTORS$4 ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
498   O = toIndexedObject$3(O);
499   P = toPropertyKey$2(P);
500   if (IE8_DOM_DEFINE$1) try {
501     return $getOwnPropertyDescriptor(O, P);
502   } catch (error) { /* empty */ }
503   if (hasOwn$5(O, P)) return createPropertyDescriptor$2(!call$3(propertyIsEnumerableModule.f, O, P), O[P]);
504 };
505
506 var objectDefineProperty = {};
507
508 var global$c = global$r;
509 var isObject$9 = isObject$d;
510
511 var String$2 = global$c.String;
512 var TypeError$6 = global$c.TypeError;
513
514 // `Assert: Type(argument) is Object`
515 var anObject$7 = function (argument) {
516   if (isObject$9(argument)) return argument;
517   throw TypeError$6(String$2(argument) + ' is not an object');
518 };
519
520 var global$b = global$r;
521 var DESCRIPTORS$3 = descriptors;
522 var IE8_DOM_DEFINE = ie8DomDefine;
523 var anObject$6 = anObject$7;
524 var toPropertyKey$1 = toPropertyKey$3;
525
526 var TypeError$5 = global$b.TypeError;
527 // eslint-disable-next-line es/no-object-defineproperty -- safe
528 var $defineProperty = Object.defineProperty;
529
530 // `Object.defineProperty` method
531 // https://tc39.es/ecma262/#sec-object.defineproperty
532 objectDefineProperty.f = DESCRIPTORS$3 ? $defineProperty : function defineProperty(O, P, Attributes) {
533   anObject$6(O);
534   P = toPropertyKey$1(P);
535   anObject$6(Attributes);
536   if (IE8_DOM_DEFINE) try {
537     return $defineProperty(O, P, Attributes);
538   } catch (error) { /* empty */ }
539   if ('get' in Attributes || 'set' in Attributes) throw TypeError$5('Accessors not supported');
540   if ('value' in Attributes) O[P] = Attributes.value;
541   return O;
542 };
543
544 var DESCRIPTORS$2 = descriptors;
545 var definePropertyModule$4 = objectDefineProperty;
546 var createPropertyDescriptor$1 = createPropertyDescriptor$3;
547
548 var createNonEnumerableProperty$3 = DESCRIPTORS$2 ? function (object, key, value) {
549   return definePropertyModule$4.f(object, key, createPropertyDescriptor$1(1, value));
550 } : function (object, key, value) {
551   object[key] = value;
552   return object;
553 };
554
555 var redefine$1 = {exports: {}};
556
557 var uncurryThis$7 = functionUncurryThis;
558 var isCallable$5 = isCallable$b;
559 var store$1 = sharedStore;
560
561 var functionToString = uncurryThis$7(Function.toString);
562
563 // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
564 if (!isCallable$5(store$1.inspectSource)) {
565   store$1.inspectSource = function (it) {
566     return functionToString(it);
567   };
568 }
569
570 var inspectSource$3 = store$1.inspectSource;
571
572 var global$a = global$r;
573 var isCallable$4 = isCallable$b;
574 var inspectSource$2 = inspectSource$3;
575
576 var WeakMap$4 = global$a.WeakMap;
577
578 var nativeWeakMap = isCallable$4(WeakMap$4) && /native code/.test(inspectSource$2(WeakMap$4));
579
580 var shared$1 = shared$3.exports;
581 var uid = uid$2;
582
583 var keys$4 = shared$1('keys');
584
585 var sharedKey$2 = function (key) {
586   return keys$4[key] || (keys$4[key] = uid(key));
587 };
588
589 var hiddenKeys$4 = {};
590
591 var NATIVE_WEAK_MAP = nativeWeakMap;
592 var global$9 = global$r;
593 var uncurryThis$6 = functionUncurryThis;
594 var isObject$8 = isObject$d;
595 var createNonEnumerableProperty$2 = createNonEnumerableProperty$3;
596 var hasOwn$4 = hasOwnProperty_1;
597 var shared = sharedStore;
598 var sharedKey$1 = sharedKey$2;
599 var hiddenKeys$3 = hiddenKeys$4;
600
601 var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
602 var TypeError$4 = global$9.TypeError;
603 var WeakMap$3 = global$9.WeakMap;
604 var set, get$2, has;
605
606 var enforce = function (it) {
607   return has(it) ? get$2(it) : set(it, {});
608 };
609
610 var getterFor = function (TYPE) {
611   return function (it) {
612     var state;
613     if (!isObject$8(it) || (state = get$2(it)).type !== TYPE) {
614       throw TypeError$4('Incompatible receiver, ' + TYPE + ' required');
615     } return state;
616   };
617 };
618
619 if (NATIVE_WEAK_MAP || shared.state) {
620   var store = shared.state || (shared.state = new WeakMap$3());
621   var wmget = uncurryThis$6(store.get);
622   var wmhas = uncurryThis$6(store.has);
623   var wmset = uncurryThis$6(store.set);
624   set = function (it, metadata) {
625     if (wmhas(store, it)) throw new TypeError$4(OBJECT_ALREADY_INITIALIZED);
626     metadata.facade = it;
627     wmset(store, it, metadata);
628     return metadata;
629   };
630   get$2 = function (it) {
631     return wmget(store, it) || {};
632   };
633   has = function (it) {
634     return wmhas(store, it);
635   };
636 } else {
637   var STATE = sharedKey$1('state');
638   hiddenKeys$3[STATE] = true;
639   set = function (it, metadata) {
640     if (hasOwn$4(it, STATE)) throw new TypeError$4(OBJECT_ALREADY_INITIALIZED);
641     metadata.facade = it;
642     createNonEnumerableProperty$2(it, STATE, metadata);
643     return metadata;
644   };
645   get$2 = function (it) {
646     return hasOwn$4(it, STATE) ? it[STATE] : {};
647   };
648   has = function (it) {
649     return hasOwn$4(it, STATE);
650   };
651 }
652
653 var internalState = {
654   set: set,
655   get: get$2,
656   has: has,
657   enforce: enforce,
658   getterFor: getterFor
659 };
660
661 var DESCRIPTORS$1 = descriptors;
662 var hasOwn$3 = hasOwnProperty_1;
663
664 var FunctionPrototype = Function.prototype;
665 // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
666 var getDescriptor = DESCRIPTORS$1 && Object.getOwnPropertyDescriptor;
667
668 var EXISTS = hasOwn$3(FunctionPrototype, 'name');
669 // additional protection from minified / mangled / dropped function names
670 var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
671 var CONFIGURABLE = EXISTS && (!DESCRIPTORS$1 || (DESCRIPTORS$1 && getDescriptor(FunctionPrototype, 'name').configurable));
672
673 var functionName = {
674   EXISTS: EXISTS,
675   PROPER: PROPER,
676   CONFIGURABLE: CONFIGURABLE
677 };
678
679 var global$8 = global$r;
680 var isCallable$3 = isCallable$b;
681 var hasOwn$2 = hasOwnProperty_1;
682 var createNonEnumerableProperty$1 = createNonEnumerableProperty$3;
683 var setGlobal$1 = setGlobal$3;
684 var inspectSource$1 = inspectSource$3;
685 var InternalStateModule = internalState;
686 var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
687
688 var getInternalState = InternalStateModule.get;
689 var enforceInternalState = InternalStateModule.enforce;
690 var TEMPLATE = String(String).split('String');
691
692 (redefine$1.exports = function (O, key, value, options) {
693   var unsafe = options ? !!options.unsafe : false;
694   var simple = options ? !!options.enumerable : false;
695   var noTargetGet = options ? !!options.noTargetGet : false;
696   var name = options && options.name !== undefined ? options.name : key;
697   var state;
698   if (isCallable$3(value)) {
699     if (String(name).slice(0, 7) === 'Symbol(') {
700       name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
701     }
702     if (!hasOwn$2(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
703       createNonEnumerableProperty$1(value, 'name', name);
704     }
705     state = enforceInternalState(value);
706     if (!state.source) {
707       state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
708     }
709   }
710   if (O === global$8) {
711     if (simple) O[key] = value;
712     else setGlobal$1(key, value);
713     return;
714   } else if (!unsafe) {
715     delete O[key];
716   } else if (!noTargetGet && O[key]) {
717     simple = true;
718   }
719   if (simple) O[key] = value;
720   else createNonEnumerableProperty$1(O, key, value);
721 // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
722 })(Function.prototype, 'toString', function toString() {
723   return isCallable$3(this) && getInternalState(this).source || inspectSource$1(this);
724 });
725
726 var objectGetOwnPropertyNames = {};
727
728 var ceil = Math.ceil;
729 var floor$1 = Math.floor;
730
731 // `ToIntegerOrInfinity` abstract operation
732 // https://tc39.es/ecma262/#sec-tointegerorinfinity
733 var toIntegerOrInfinity$3 = function (argument) {
734   var number = +argument;
735   // eslint-disable-next-line no-self-compare -- safe
736   return number !== number || number === 0 ? 0 : (number > 0 ? floor$1 : ceil)(number);
737 };
738
739 var toIntegerOrInfinity$2 = toIntegerOrInfinity$3;
740
741 var max = Math.max;
742 var min$1 = Math.min;
743
744 // Helper for a popular repeating case of the spec:
745 // Let integer be ? ToInteger(index).
746 // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
747 var toAbsoluteIndex$1 = function (index, length) {
748   var integer = toIntegerOrInfinity$2(index);
749   return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
750 };
751
752 var toIntegerOrInfinity$1 = toIntegerOrInfinity$3;
753
754 var min = Math.min;
755
756 // `ToLength` abstract operation
757 // https://tc39.es/ecma262/#sec-tolength
758 var toLength$1 = function (argument) {
759   return argument > 0 ? min(toIntegerOrInfinity$1(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
760 };
761
762 var toLength = toLength$1;
763
764 // `LengthOfArrayLike` abstract operation
765 // https://tc39.es/ecma262/#sec-lengthofarraylike
766 var lengthOfArrayLike$6 = function (obj) {
767   return toLength(obj.length);
768 };
769
770 var toIndexedObject$2 = toIndexedObject$4;
771 var toAbsoluteIndex = toAbsoluteIndex$1;
772 var lengthOfArrayLike$5 = lengthOfArrayLike$6;
773
774 // `Array.prototype.{ indexOf, includes }` methods implementation
775 var createMethod = function (IS_INCLUDES) {
776   return function ($this, el, fromIndex) {
777     var O = toIndexedObject$2($this);
778     var length = lengthOfArrayLike$5(O);
779     var index = toAbsoluteIndex(fromIndex, length);
780     var value;
781     // Array#includes uses SameValueZero equality algorithm
782     // eslint-disable-next-line no-self-compare -- NaN check
783     if (IS_INCLUDES && el != el) while (length > index) {
784       value = O[index++];
785       // eslint-disable-next-line no-self-compare -- NaN check
786       if (value != value) return true;
787     // Array#indexOf ignores holes, Array#includes - not
788     } else for (;length > index; index++) {
789       if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
790     } return !IS_INCLUDES && -1;
791   };
792 };
793
794 var arrayIncludes = {
795   // `Array.prototype.includes` method
796   // https://tc39.es/ecma262/#sec-array.prototype.includes
797   includes: createMethod(true),
798   // `Array.prototype.indexOf` method
799   // https://tc39.es/ecma262/#sec-array.prototype.indexof
800   indexOf: createMethod(false)
801 };
802
803 var uncurryThis$5 = functionUncurryThis;
804 var hasOwn$1 = hasOwnProperty_1;
805 var toIndexedObject$1 = toIndexedObject$4;
806 var indexOf = arrayIncludes.indexOf;
807 var hiddenKeys$2 = hiddenKeys$4;
808
809 var push$1 = uncurryThis$5([].push);
810
811 var objectKeysInternal = function (object, names) {
812   var O = toIndexedObject$1(object);
813   var i = 0;
814   var result = [];
815   var key;
816   for (key in O) !hasOwn$1(hiddenKeys$2, key) && hasOwn$1(O, key) && push$1(result, key);
817   // Don't enum bug & hidden keys
818   while (names.length > i) if (hasOwn$1(O, key = names[i++])) {
819     ~indexOf(result, key) || push$1(result, key);
820   }
821   return result;
822 };
823
824 // IE8- don't enum bug keys
825 var enumBugKeys$3 = [
826   'constructor',
827   'hasOwnProperty',
828   'isPrototypeOf',
829   'propertyIsEnumerable',
830   'toLocaleString',
831   'toString',
832   'valueOf'
833 ];
834
835 var internalObjectKeys$1 = objectKeysInternal;
836 var enumBugKeys$2 = enumBugKeys$3;
837
838 var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
839
840 // `Object.getOwnPropertyNames` method
841 // https://tc39.es/ecma262/#sec-object.getownpropertynames
842 // eslint-disable-next-line es/no-object-getownpropertynames -- safe
843 objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
844   return internalObjectKeys$1(O, hiddenKeys$1);
845 };
846
847 var objectGetOwnPropertySymbols = {};
848
849 // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
850 objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
851
852 var getBuiltIn$2 = getBuiltIn$5;
853 var uncurryThis$4 = functionUncurryThis;
854 var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
855 var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
856 var anObject$5 = anObject$7;
857
858 var concat = uncurryThis$4([].concat);
859
860 // all object keys, includes non-enumerable and symbols
861 var ownKeys$1 = getBuiltIn$2('Reflect', 'ownKeys') || function ownKeys(it) {
862   var keys = getOwnPropertyNamesModule.f(anObject$5(it));
863   var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
864   return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
865 };
866
867 var hasOwn = hasOwnProperty_1;
868 var ownKeys = ownKeys$1;
869 var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
870 var definePropertyModule$3 = objectDefineProperty;
871
872 var copyConstructorProperties$1 = function (target, source) {
873   var keys = ownKeys(source);
874   var defineProperty = definePropertyModule$3.f;
875   var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
876   for (var i = 0; i < keys.length; i++) {
877     var key = keys[i];
878     if (!hasOwn(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
879   }
880 };
881
882 var fails$3 = fails$8;
883 var isCallable$2 = isCallable$b;
884
885 var replacement = /#|\.prototype\./;
886
887 var isForced$1 = function (feature, detection) {
888   var value = data[normalize(feature)];
889   return value == POLYFILL ? true
890     : value == NATIVE ? false
891     : isCallable$2(detection) ? fails$3(detection)
892     : !!detection;
893 };
894
895 var normalize = isForced$1.normalize = function (string) {
896   return String(string).replace(replacement, '.').toLowerCase();
897 };
898
899 var data = isForced$1.data = {};
900 var NATIVE = isForced$1.NATIVE = 'N';
901 var POLYFILL = isForced$1.POLYFILL = 'P';
902
903 var isForced_1 = isForced$1;
904
905 var global$7 = global$r;
906 var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
907 var createNonEnumerableProperty = createNonEnumerableProperty$3;
908 var redefine = redefine$1.exports;
909 var setGlobal = setGlobal$3;
910 var copyConstructorProperties = copyConstructorProperties$1;
911 var isForced = isForced_1;
912
913 /*
914   options.target      - name of the target object
915   options.global      - target is the global object
916   options.stat        - export as static methods of target
917   options.proto       - export as prototype methods of target
918   options.real        - real prototype method for the `pure` version
919   options.forced      - export even if the native feature is available
920   options.bind        - bind methods to the target, required for the `pure` version
921   options.wrap        - wrap constructors to preventing global pollution, required for the `pure` version
922   options.unsafe      - use the simple assignment of property instead of delete + defineProperty
923   options.sham        - add a flag to not completely full polyfills
924   options.enumerable  - export as enumerable property
925   options.noTargetGet - prevent calling a getter on target
926   options.name        - the .name of the function if it does not match the key
927 */
928 var _export = function (options, source) {
929   var TARGET = options.target;
930   var GLOBAL = options.global;
931   var STATIC = options.stat;
932   var FORCED, target, key, targetProperty, sourceProperty, descriptor;
933   if (GLOBAL) {
934     target = global$7;
935   } else if (STATIC) {
936     target = global$7[TARGET] || setGlobal(TARGET, {});
937   } else {
938     target = (global$7[TARGET] || {}).prototype;
939   }
940   if (target) for (key in source) {
941     sourceProperty = source[key];
942     if (options.noTargetGet) {
943       descriptor = getOwnPropertyDescriptor(target, key);
944       targetProperty = descriptor && descriptor.value;
945     } else targetProperty = target[key];
946     FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
947     // contained in target
948     if (!FORCED && targetProperty !== undefined) {
949       if (typeof sourceProperty == typeof targetProperty) continue;
950       copyConstructorProperties(sourceProperty, targetProperty);
951     }
952     // add a flag to not completely full polyfills
953     if (options.sham || (targetProperty && targetProperty.sham)) {
954       createNonEnumerableProperty(sourceProperty, 'sham', true);
955     }
956     // extend global
957     redefine(target, key, sourceProperty, options);
958   }
959 };
960
961 var wellKnownSymbol$5 = wellKnownSymbol$7;
962
963 var TO_STRING_TAG$1 = wellKnownSymbol$5('toStringTag');
964 var test$1 = {};
965
966 test$1[TO_STRING_TAG$1] = 'z';
967
968 var toStringTagSupport = String(test$1) === '[object z]';
969
970 var global$6 = global$r;
971 var TO_STRING_TAG_SUPPORT = toStringTagSupport;
972 var isCallable$1 = isCallable$b;
973 var classofRaw = classofRaw$1;
974 var wellKnownSymbol$4 = wellKnownSymbol$7;
975
976 var TO_STRING_TAG = wellKnownSymbol$4('toStringTag');
977 var Object$1 = global$6.Object;
978
979 // ES3 wrong here
980 var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
981
982 // fallback for IE11 Script Access Denied error
983 var tryGet = function (it, key) {
984   try {
985     return it[key];
986   } catch (error) { /* empty */ }
987 };
988
989 // getting tag from ES6+ `Object.prototype.toString`
990 var classof$4 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
991   var O, tag, result;
992   return it === undefined ? 'Undefined' : it === null ? 'Null'
993     // @@toStringTag case
994     : typeof (tag = tryGet(O = Object$1(it), TO_STRING_TAG)) == 'string' ? tag
995     // builtinTag case
996     : CORRECT_ARGUMENTS ? classofRaw(O)
997     // ES3 arguments fallback
998     : (result = classofRaw(O)) == 'Object' && isCallable$1(O.callee) ? 'Arguments' : result;
999 };
1000
1001 var global$5 = global$r;
1002 var classof$3 = classof$4;
1003
1004 var String$1 = global$5.String;
1005
1006 var toString$3 = function (argument) {
1007   if (classof$3(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
1008   return String$1(argument);
1009 };
1010
1011 var uncurryThis$3 = functionUncurryThis;
1012
1013 var arraySlice$1 = uncurryThis$3([].slice);
1014
1015 var arraySlice = arraySlice$1;
1016
1017 var floor = Math.floor;
1018
1019 var mergeSort = function (array, comparefn) {
1020   var length = array.length;
1021   var middle = floor(length / 2);
1022   return length < 8 ? insertionSort(array, comparefn) : merge$3(
1023     array,
1024     mergeSort(arraySlice(array, 0, middle), comparefn),
1025     mergeSort(arraySlice(array, middle), comparefn),
1026     comparefn
1027   );
1028 };
1029
1030 var insertionSort = function (array, comparefn) {
1031   var length = array.length;
1032   var i = 1;
1033   var element, j;
1034
1035   while (i < length) {
1036     j = i;
1037     element = array[i];
1038     while (j && comparefn(array[j - 1], element) > 0) {
1039       array[j] = array[--j];
1040     }
1041     if (j !== i++) array[j] = element;
1042   } return array;
1043 };
1044
1045 var merge$3 = function (array, left, right, comparefn) {
1046   var llength = left.length;
1047   var rlength = right.length;
1048   var lindex = 0;
1049   var rindex = 0;
1050
1051   while (lindex < llength || rindex < rlength) {
1052     array[lindex + rindex] = (lindex < llength && rindex < rlength)
1053       ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]
1054       : lindex < llength ? left[lindex++] : right[rindex++];
1055   } return array;
1056 };
1057
1058 var arraySort = mergeSort;
1059
1060 var fails$2 = fails$8;
1061
1062 var arrayMethodIsStrict$1 = function (METHOD_NAME, argument) {
1063   var method = [][METHOD_NAME];
1064   return !!method && fails$2(function () {
1065     // eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing
1066     method.call(null, argument || function () { throw 1; }, 1);
1067   });
1068 };
1069
1070 var userAgent$1 = engineUserAgent;
1071
1072 var firefox = userAgent$1.match(/firefox\/(\d+)/i);
1073
1074 var engineFfVersion = !!firefox && +firefox[1];
1075
1076 var UA = engineUserAgent;
1077
1078 var engineIsIeOrEdge = /MSIE|Trident/.test(UA);
1079
1080 var userAgent = engineUserAgent;
1081
1082 var webkit = userAgent.match(/AppleWebKit\/(\d+)\./);
1083
1084 var engineWebkitVersion = !!webkit && +webkit[1];
1085
1086 var $$3 = _export;
1087 var uncurryThis$2 = functionUncurryThis;
1088 var aCallable$3 = aCallable$5;
1089 var toObject$2 = toObject$4;
1090 var lengthOfArrayLike$4 = lengthOfArrayLike$6;
1091 var toString$2 = toString$3;
1092 var fails$1 = fails$8;
1093 var internalSort = arraySort;
1094 var arrayMethodIsStrict = arrayMethodIsStrict$1;
1095 var FF = engineFfVersion;
1096 var IE_OR_EDGE = engineIsIeOrEdge;
1097 var V8 = engineV8Version;
1098 var WEBKIT = engineWebkitVersion;
1099
1100 var test = [];
1101 var un$Sort = uncurryThis$2(test.sort);
1102 var push = uncurryThis$2(test.push);
1103
1104 // IE8-
1105 var FAILS_ON_UNDEFINED = fails$1(function () {
1106   test.sort(undefined);
1107 });
1108 // V8 bug
1109 var FAILS_ON_NULL = fails$1(function () {
1110   test.sort(null);
1111 });
1112 // Old WebKit
1113 var STRICT_METHOD = arrayMethodIsStrict('sort');
1114
1115 var STABLE_SORT = !fails$1(function () {
1116   // feature detection can be too slow, so check engines versions
1117   if (V8) return V8 < 70;
1118   if (FF && FF > 3) return;
1119   if (IE_OR_EDGE) return true;
1120   if (WEBKIT) return WEBKIT < 603;
1121
1122   var result = '';
1123   var code, chr, value, index;
1124
1125   // generate an array with more 512 elements (Chakra and old V8 fails only in this case)
1126   for (code = 65; code < 76; code++) {
1127     chr = String.fromCharCode(code);
1128
1129     switch (code) {
1130       case 66: case 69: case 70: case 72: value = 3; break;
1131       case 68: case 71: value = 4; break;
1132       default: value = 2;
1133     }
1134
1135     for (index = 0; index < 47; index++) {
1136       test.push({ k: chr + index, v: value });
1137     }
1138   }
1139
1140   test.sort(function (a, b) { return b.v - a.v; });
1141
1142   for (index = 0; index < test.length; index++) {
1143     chr = test[index].k.charAt(0);
1144     if (result.charAt(result.length - 1) !== chr) result += chr;
1145   }
1146
1147   return result !== 'DGBEFHACIJK';
1148 });
1149
1150 var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT;
1151
1152 var getSortCompare = function (comparefn) {
1153   return function (x, y) {
1154     if (y === undefined) return -1;
1155     if (x === undefined) return 1;
1156     if (comparefn !== undefined) return +comparefn(x, y) || 0;
1157     return toString$2(x) > toString$2(y) ? 1 : -1;
1158   };
1159 };
1160
1161 // `Array.prototype.sort` method
1162 // https://tc39.es/ecma262/#sec-array.prototype.sort
1163 $$3({ target: 'Array', proto: true, forced: FORCED }, {
1164   sort: function sort(comparefn) {
1165     if (comparefn !== undefined) aCallable$3(comparefn);
1166
1167     var array = toObject$2(this);
1168
1169     if (STABLE_SORT) return comparefn === undefined ? un$Sort(array) : un$Sort(array, comparefn);
1170
1171     var items = [];
1172     var arrayLength = lengthOfArrayLike$4(array);
1173     var itemsLength, index;
1174
1175     for (index = 0; index < arrayLength; index++) {
1176       if (index in array) push(items, array[index]);
1177     }
1178
1179     internalSort(items, getSortCompare(comparefn));
1180
1181     itemsLength = items.length;
1182     index = 0;
1183
1184     while (index < itemsLength) array[index] = items[index++];
1185     while (index < arrayLength) delete array[index++];
1186
1187     return array;
1188   }
1189 });
1190
1191 var fastJsonStableStringify = function (data, opts) {
1192   if (!opts) opts = {};
1193   if (typeof opts === 'function') opts = {
1194     cmp: opts
1195   };
1196   var cycles = typeof opts.cycles === 'boolean' ? opts.cycles : false;
1197
1198   var cmp = opts.cmp && function (f) {
1199     return function (node) {
1200       return function (a, b) {
1201         var aobj = {
1202           key: a,
1203           value: node[a]
1204         };
1205         var bobj = {
1206           key: b,
1207           value: node[b]
1208         };
1209         return f(aobj, bobj);
1210       };
1211     };
1212   }(opts.cmp);
1213
1214   var seen = [];
1215   return function stringify(node) {
1216     if (node && node.toJSON && typeof node.toJSON === 'function') {
1217       node = node.toJSON();
1218     }
1219
1220     if (node === undefined) return;
1221     if (typeof node == 'number') return isFinite(node) ? '' + node : 'null';
1222     if (typeof node !== 'object') return JSON.stringify(node);
1223     var i, out;
1224
1225     if (Array.isArray(node)) {
1226       out = '[';
1227
1228       for (i = 0; i < node.length; i++) {
1229         if (i) out += ',';
1230         out += stringify(node[i]) || 'null';
1231       }
1232
1233       return out + ']';
1234     }
1235
1236     if (node === null) return 'null';
1237
1238     if (seen.indexOf(node) !== -1) {
1239       if (cycles) return JSON.stringify('__cycle__');
1240       throw new TypeError('Converting circular structure to JSON');
1241     }
1242
1243     var seenIndex = seen.push(node) - 1;
1244     var keys = Object.keys(node).sort(cmp && cmp(node));
1245     out = '';
1246
1247     for (i = 0; i < keys.length; i++) {
1248       var key = keys[i];
1249       var value = stringify(node[key]);
1250       if (!value) continue;
1251       if (out) out += ',';
1252       out += JSON.stringify(key) + ':' + value;
1253     }
1254
1255     seen.splice(seenIndex, 1);
1256     return '{' + out + '}';
1257   }(data);
1258 };
1259
1260 var require$$3 = require("./index.js");
1261
1262 var ansiStyles$1 = {exports: {}};
1263
1264 var colorName = {
1265   "aliceblue": [240, 248, 255],
1266   "antiquewhite": [250, 235, 215],
1267   "aqua": [0, 255, 255],
1268   "aquamarine": [127, 255, 212],
1269   "azure": [240, 255, 255],
1270   "beige": [245, 245, 220],
1271   "bisque": [255, 228, 196],
1272   "black": [0, 0, 0],
1273   "blanchedalmond": [255, 235, 205],
1274   "blue": [0, 0, 255],
1275   "blueviolet": [138, 43, 226],
1276   "brown": [165, 42, 42],
1277   "burlywood": [222, 184, 135],
1278   "cadetblue": [95, 158, 160],
1279   "chartreuse": [127, 255, 0],
1280   "chocolate": [210, 105, 30],
1281   "coral": [255, 127, 80],
1282   "cornflowerblue": [100, 149, 237],
1283   "cornsilk": [255, 248, 220],
1284   "crimson": [220, 20, 60],
1285   "cyan": [0, 255, 255],
1286   "darkblue": [0, 0, 139],
1287   "darkcyan": [0, 139, 139],
1288   "darkgoldenrod": [184, 134, 11],
1289   "darkgray": [169, 169, 169],
1290   "darkgreen": [0, 100, 0],
1291   "darkgrey": [169, 169, 169],
1292   "darkkhaki": [189, 183, 107],
1293   "darkmagenta": [139, 0, 139],
1294   "darkolivegreen": [85, 107, 47],
1295   "darkorange": [255, 140, 0],
1296   "darkorchid": [153, 50, 204],
1297   "darkred": [139, 0, 0],
1298   "darksalmon": [233, 150, 122],
1299   "darkseagreen": [143, 188, 143],
1300   "darkslateblue": [72, 61, 139],
1301   "darkslategray": [47, 79, 79],
1302   "darkslategrey": [47, 79, 79],
1303   "darkturquoise": [0, 206, 209],
1304   "darkviolet": [148, 0, 211],
1305   "deeppink": [255, 20, 147],
1306   "deepskyblue": [0, 191, 255],
1307   "dimgray": [105, 105, 105],
1308   "dimgrey": [105, 105, 105],
1309   "dodgerblue": [30, 144, 255],
1310   "firebrick": [178, 34, 34],
1311   "floralwhite": [255, 250, 240],
1312   "forestgreen": [34, 139, 34],
1313   "fuchsia": [255, 0, 255],
1314   "gainsboro": [220, 220, 220],
1315   "ghostwhite": [248, 248, 255],
1316   "gold": [255, 215, 0],
1317   "goldenrod": [218, 165, 32],
1318   "gray": [128, 128, 128],
1319   "green": [0, 128, 0],
1320   "greenyellow": [173, 255, 47],
1321   "grey": [128, 128, 128],
1322   "honeydew": [240, 255, 240],
1323   "hotpink": [255, 105, 180],
1324   "indianred": [205, 92, 92],
1325   "indigo": [75, 0, 130],
1326   "ivory": [255, 255, 240],
1327   "khaki": [240, 230, 140],
1328   "lavender": [230, 230, 250],
1329   "lavenderblush": [255, 240, 245],
1330   "lawngreen": [124, 252, 0],
1331   "lemonchiffon": [255, 250, 205],
1332   "lightblue": [173, 216, 230],
1333   "lightcoral": [240, 128, 128],
1334   "lightcyan": [224, 255, 255],
1335   "lightgoldenrodyellow": [250, 250, 210],
1336   "lightgray": [211, 211, 211],
1337   "lightgreen": [144, 238, 144],
1338   "lightgrey": [211, 211, 211],
1339   "lightpink": [255, 182, 193],
1340   "lightsalmon": [255, 160, 122],
1341   "lightseagreen": [32, 178, 170],
1342   "lightskyblue": [135, 206, 250],
1343   "lightslategray": [119, 136, 153],
1344   "lightslategrey": [119, 136, 153],
1345   "lightsteelblue": [176, 196, 222],
1346   "lightyellow": [255, 255, 224],
1347   "lime": [0, 255, 0],
1348   "limegreen": [50, 205, 50],
1349   "linen": [250, 240, 230],
1350   "magenta": [255, 0, 255],
1351   "maroon": [128, 0, 0],
1352   "mediumaquamarine": [102, 205, 170],
1353   "mediumblue": [0, 0, 205],
1354   "mediumorchid": [186, 85, 211],
1355   "mediumpurple": [147, 112, 219],
1356   "mediumseagreen": [60, 179, 113],
1357   "mediumslateblue": [123, 104, 238],
1358   "mediumspringgreen": [0, 250, 154],
1359   "mediumturquoise": [72, 209, 204],
1360   "mediumvioletred": [199, 21, 133],
1361   "midnightblue": [25, 25, 112],
1362   "mintcream": [245, 255, 250],
1363   "mistyrose": [255, 228, 225],
1364   "moccasin": [255, 228, 181],
1365   "navajowhite": [255, 222, 173],
1366   "navy": [0, 0, 128],
1367   "oldlace": [253, 245, 230],
1368   "olive": [128, 128, 0],
1369   "olivedrab": [107, 142, 35],
1370   "orange": [255, 165, 0],
1371   "orangered": [255, 69, 0],
1372   "orchid": [218, 112, 214],
1373   "palegoldenrod": [238, 232, 170],
1374   "palegreen": [152, 251, 152],
1375   "paleturquoise": [175, 238, 238],
1376   "palevioletred": [219, 112, 147],
1377   "papayawhip": [255, 239, 213],
1378   "peachpuff": [255, 218, 185],
1379   "peru": [205, 133, 63],
1380   "pink": [255, 192, 203],
1381   "plum": [221, 160, 221],
1382   "powderblue": [176, 224, 230],
1383   "purple": [128, 0, 128],
1384   "rebeccapurple": [102, 51, 153],
1385   "red": [255, 0, 0],
1386   "rosybrown": [188, 143, 143],
1387   "royalblue": [65, 105, 225],
1388   "saddlebrown": [139, 69, 19],
1389   "salmon": [250, 128, 114],
1390   "sandybrown": [244, 164, 96],
1391   "seagreen": [46, 139, 87],
1392   "seashell": [255, 245, 238],
1393   "sienna": [160, 82, 45],
1394   "silver": [192, 192, 192],
1395   "skyblue": [135, 206, 235],
1396   "slateblue": [106, 90, 205],
1397   "slategray": [112, 128, 144],
1398   "slategrey": [112, 128, 144],
1399   "snow": [255, 250, 250],
1400   "springgreen": [0, 255, 127],
1401   "steelblue": [70, 130, 180],
1402   "tan": [210, 180, 140],
1403   "teal": [0, 128, 128],
1404   "thistle": [216, 191, 216],
1405   "tomato": [255, 99, 71],
1406   "turquoise": [64, 224, 208],
1407   "violet": [238, 130, 238],
1408   "wheat": [245, 222, 179],
1409   "white": [255, 255, 255],
1410   "whitesmoke": [245, 245, 245],
1411   "yellow": [255, 255, 0],
1412   "yellowgreen": [154, 205, 50]
1413 };
1414
1415 /* MIT license */
1416 /* eslint-disable no-mixed-operators */
1417
1418 const cssKeywords = colorName; // NOTE: conversions should only return primitive values (i.e. arrays, or
1419 //       values that give correct `typeof` results).
1420 //       do not use box values types (i.e. Number(), String(), etc.)
1421
1422 const reverseKeywords = {};
1423
1424 for (const key of Object.keys(cssKeywords)) {
1425   reverseKeywords[cssKeywords[key]] = key;
1426 }
1427
1428 const convert$1 = {
1429   rgb: {
1430     channels: 3,
1431     labels: 'rgb'
1432   },
1433   hsl: {
1434     channels: 3,
1435     labels: 'hsl'
1436   },
1437   hsv: {
1438     channels: 3,
1439     labels: 'hsv'
1440   },
1441   hwb: {
1442     channels: 3,
1443     labels: 'hwb'
1444   },
1445   cmyk: {
1446     channels: 4,
1447     labels: 'cmyk'
1448   },
1449   xyz: {
1450     channels: 3,
1451     labels: 'xyz'
1452   },
1453   lab: {
1454     channels: 3,
1455     labels: 'lab'
1456   },
1457   lch: {
1458     channels: 3,
1459     labels: 'lch'
1460   },
1461   hex: {
1462     channels: 1,
1463     labels: ['hex']
1464   },
1465   keyword: {
1466     channels: 1,
1467     labels: ['keyword']
1468   },
1469   ansi16: {
1470     channels: 1,
1471     labels: ['ansi16']
1472   },
1473   ansi256: {
1474     channels: 1,
1475     labels: ['ansi256']
1476   },
1477   hcg: {
1478     channels: 3,
1479     labels: ['h', 'c', 'g']
1480   },
1481   apple: {
1482     channels: 3,
1483     labels: ['r16', 'g16', 'b16']
1484   },
1485   gray: {
1486     channels: 1,
1487     labels: ['gray']
1488   }
1489 };
1490 var conversions$2 = convert$1; // Hide .channels and .labels properties
1491
1492 for (const model of Object.keys(convert$1)) {
1493   if (!('channels' in convert$1[model])) {
1494     throw new Error('missing channels property: ' + model);
1495   }
1496
1497   if (!('labels' in convert$1[model])) {
1498     throw new Error('missing channel labels property: ' + model);
1499   }
1500
1501   if (convert$1[model].labels.length !== convert$1[model].channels) {
1502     throw new Error('channel and label counts mismatch: ' + model);
1503   }
1504
1505   const {
1506     channels,
1507     labels
1508   } = convert$1[model];
1509   delete convert$1[model].channels;
1510   delete convert$1[model].labels;
1511   Object.defineProperty(convert$1[model], 'channels', {
1512     value: channels
1513   });
1514   Object.defineProperty(convert$1[model], 'labels', {
1515     value: labels
1516   });
1517 }
1518
1519 convert$1.rgb.hsl = function (rgb) {
1520   const r = rgb[0] / 255;
1521   const g = rgb[1] / 255;
1522   const b = rgb[2] / 255;
1523   const min = Math.min(r, g, b);
1524   const max = Math.max(r, g, b);
1525   const delta = max - min;
1526   let h;
1527   let s;
1528
1529   if (max === min) {
1530     h = 0;
1531   } else if (r === max) {
1532     h = (g - b) / delta;
1533   } else if (g === max) {
1534     h = 2 + (b - r) / delta;
1535   } else if (b === max) {
1536     h = 4 + (r - g) / delta;
1537   }
1538
1539   h = Math.min(h * 60, 360);
1540
1541   if (h < 0) {
1542     h += 360;
1543   }
1544
1545   const l = (min + max) / 2;
1546
1547   if (max === min) {
1548     s = 0;
1549   } else if (l <= 0.5) {
1550     s = delta / (max + min);
1551   } else {
1552     s = delta / (2 - max - min);
1553   }
1554
1555   return [h, s * 100, l * 100];
1556 };
1557
1558 convert$1.rgb.hsv = function (rgb) {
1559   let rdif;
1560   let gdif;
1561   let bdif;
1562   let h;
1563   let s;
1564   const r = rgb[0] / 255;
1565   const g = rgb[1] / 255;
1566   const b = rgb[2] / 255;
1567   const v = Math.max(r, g, b);
1568   const diff = v - Math.min(r, g, b);
1569
1570   const diffc = function (c) {
1571     return (v - c) / 6 / diff + 1 / 2;
1572   };
1573
1574   if (diff === 0) {
1575     h = 0;
1576     s = 0;
1577   } else {
1578     s = diff / v;
1579     rdif = diffc(r);
1580     gdif = diffc(g);
1581     bdif = diffc(b);
1582
1583     if (r === v) {
1584       h = bdif - gdif;
1585     } else if (g === v) {
1586       h = 1 / 3 + rdif - bdif;
1587     } else if (b === v) {
1588       h = 2 / 3 + gdif - rdif;
1589     }
1590
1591     if (h < 0) {
1592       h += 1;
1593     } else if (h > 1) {
1594       h -= 1;
1595     }
1596   }
1597
1598   return [h * 360, s * 100, v * 100];
1599 };
1600
1601 convert$1.rgb.hwb = function (rgb) {
1602   const r = rgb[0];
1603   const g = rgb[1];
1604   let b = rgb[2];
1605   const h = convert$1.rgb.hsl(rgb)[0];
1606   const w = 1 / 255 * Math.min(r, Math.min(g, b));
1607   b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
1608   return [h, w * 100, b * 100];
1609 };
1610
1611 convert$1.rgb.cmyk = function (rgb) {
1612   const r = rgb[0] / 255;
1613   const g = rgb[1] / 255;
1614   const b = rgb[2] / 255;
1615   const k = Math.min(1 - r, 1 - g, 1 - b);
1616   const c = (1 - r - k) / (1 - k) || 0;
1617   const m = (1 - g - k) / (1 - k) || 0;
1618   const y = (1 - b - k) / (1 - k) || 0;
1619   return [c * 100, m * 100, y * 100, k * 100];
1620 };
1621
1622 function comparativeDistance(x, y) {
1623   /*
1624         See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance
1625   */
1626   return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
1627 }
1628
1629 convert$1.rgb.keyword = function (rgb) {
1630   const reversed = reverseKeywords[rgb];
1631
1632   if (reversed) {
1633     return reversed;
1634   }
1635
1636   let currentClosestDistance = Infinity;
1637   let currentClosestKeyword;
1638
1639   for (const keyword of Object.keys(cssKeywords)) {
1640     const value = cssKeywords[keyword]; // Compute comparative distance
1641
1642     const distance = comparativeDistance(rgb, value); // Check if its less, if so set as closest
1643
1644     if (distance < currentClosestDistance) {
1645       currentClosestDistance = distance;
1646       currentClosestKeyword = keyword;
1647     }
1648   }
1649
1650   return currentClosestKeyword;
1651 };
1652
1653 convert$1.keyword.rgb = function (keyword) {
1654   return cssKeywords[keyword];
1655 };
1656
1657 convert$1.rgb.xyz = function (rgb) {
1658   let r = rgb[0] / 255;
1659   let g = rgb[1] / 255;
1660   let b = rgb[2] / 255; // Assume sRGB
1661
1662   r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92;
1663   g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92;
1664   b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92;
1665   const x = r * 0.4124 + g * 0.3576 + b * 0.1805;
1666   const y = r * 0.2126 + g * 0.7152 + b * 0.0722;
1667   const z = r * 0.0193 + g * 0.1192 + b * 0.9505;
1668   return [x * 100, y * 100, z * 100];
1669 };
1670
1671 convert$1.rgb.lab = function (rgb) {
1672   const xyz = convert$1.rgb.xyz(rgb);
1673   let x = xyz[0];
1674   let y = xyz[1];
1675   let z = xyz[2];
1676   x /= 95.047;
1677   y /= 100;
1678   z /= 108.883;
1679   x = x > 0.008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
1680   y = y > 0.008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
1681   z = z > 0.008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
1682   const l = 116 * y - 16;
1683   const a = 500 * (x - y);
1684   const b = 200 * (y - z);
1685   return [l, a, b];
1686 };
1687
1688 convert$1.hsl.rgb = function (hsl) {
1689   const h = hsl[0] / 360;
1690   const s = hsl[1] / 100;
1691   const l = hsl[2] / 100;
1692   let t2;
1693   let t3;
1694   let val;
1695
1696   if (s === 0) {
1697     val = l * 255;
1698     return [val, val, val];
1699   }
1700
1701   if (l < 0.5) {
1702     t2 = l * (1 + s);
1703   } else {
1704     t2 = l + s - l * s;
1705   }
1706
1707   const t1 = 2 * l - t2;
1708   const rgb = [0, 0, 0];
1709
1710   for (let i = 0; i < 3; i++) {
1711     t3 = h + 1 / 3 * -(i - 1);
1712
1713     if (t3 < 0) {
1714       t3++;
1715     }
1716
1717     if (t3 > 1) {
1718       t3--;
1719     }
1720
1721     if (6 * t3 < 1) {
1722       val = t1 + (t2 - t1) * 6 * t3;
1723     } else if (2 * t3 < 1) {
1724       val = t2;
1725     } else if (3 * t3 < 2) {
1726       val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
1727     } else {
1728       val = t1;
1729     }
1730
1731     rgb[i] = val * 255;
1732   }
1733
1734   return rgb;
1735 };
1736
1737 convert$1.hsl.hsv = function (hsl) {
1738   const h = hsl[0];
1739   let s = hsl[1] / 100;
1740   let l = hsl[2] / 100;
1741   let smin = s;
1742   const lmin = Math.max(l, 0.01);
1743   l *= 2;
1744   s *= l <= 1 ? l : 2 - l;
1745   smin *= lmin <= 1 ? lmin : 2 - lmin;
1746   const v = (l + s) / 2;
1747   const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
1748   return [h, sv * 100, v * 100];
1749 };
1750
1751 convert$1.hsv.rgb = function (hsv) {
1752   const h = hsv[0] / 60;
1753   const s = hsv[1] / 100;
1754   let v = hsv[2] / 100;
1755   const hi = Math.floor(h) % 6;
1756   const f = h - Math.floor(h);
1757   const p = 255 * v * (1 - s);
1758   const q = 255 * v * (1 - s * f);
1759   const t = 255 * v * (1 - s * (1 - f));
1760   v *= 255;
1761
1762   switch (hi) {
1763     case 0:
1764       return [v, t, p];
1765
1766     case 1:
1767       return [q, v, p];
1768
1769     case 2:
1770       return [p, v, t];
1771
1772     case 3:
1773       return [p, q, v];
1774
1775     case 4:
1776       return [t, p, v];
1777
1778     case 5:
1779       return [v, p, q];
1780   }
1781 };
1782
1783 convert$1.hsv.hsl = function (hsv) {
1784   const h = hsv[0];
1785   const s = hsv[1] / 100;
1786   const v = hsv[2] / 100;
1787   const vmin = Math.max(v, 0.01);
1788   let sl;
1789   let l;
1790   l = (2 - s) * v;
1791   const lmin = (2 - s) * vmin;
1792   sl = s * vmin;
1793   sl /= lmin <= 1 ? lmin : 2 - lmin;
1794   sl = sl || 0;
1795   l /= 2;
1796   return [h, sl * 100, l * 100];
1797 }; // http://dev.w3.org/csswg/css-color/#hwb-to-rgb
1798
1799
1800 convert$1.hwb.rgb = function (hwb) {
1801   const h = hwb[0] / 360;
1802   let wh = hwb[1] / 100;
1803   let bl = hwb[2] / 100;
1804   const ratio = wh + bl;
1805   let f; // Wh + bl cant be > 1
1806
1807   if (ratio > 1) {
1808     wh /= ratio;
1809     bl /= ratio;
1810   }
1811
1812   const i = Math.floor(6 * h);
1813   const v = 1 - bl;
1814   f = 6 * h - i;
1815
1816   if ((i & 0x01) !== 0) {
1817     f = 1 - f;
1818   }
1819
1820   const n = wh + f * (v - wh); // Linear interpolation
1821
1822   let r;
1823   let g;
1824   let b;
1825   /* eslint-disable max-statements-per-line,no-multi-spaces */
1826
1827   switch (i) {
1828     default:
1829     case 6:
1830     case 0:
1831       r = v;
1832       g = n;
1833       b = wh;
1834       break;
1835
1836     case 1:
1837       r = n;
1838       g = v;
1839       b = wh;
1840       break;
1841
1842     case 2:
1843       r = wh;
1844       g = v;
1845       b = n;
1846       break;
1847
1848     case 3:
1849       r = wh;
1850       g = n;
1851       b = v;
1852       break;
1853
1854     case 4:
1855       r = n;
1856       g = wh;
1857       b = v;
1858       break;
1859
1860     case 5:
1861       r = v;
1862       g = wh;
1863       b = n;
1864       break;
1865   }
1866   /* eslint-enable max-statements-per-line,no-multi-spaces */
1867
1868
1869   return [r * 255, g * 255, b * 255];
1870 };
1871
1872 convert$1.cmyk.rgb = function (cmyk) {
1873   const c = cmyk[0] / 100;
1874   const m = cmyk[1] / 100;
1875   const y = cmyk[2] / 100;
1876   const k = cmyk[3] / 100;
1877   const r = 1 - Math.min(1, c * (1 - k) + k);
1878   const g = 1 - Math.min(1, m * (1 - k) + k);
1879   const b = 1 - Math.min(1, y * (1 - k) + k);
1880   return [r * 255, g * 255, b * 255];
1881 };
1882
1883 convert$1.xyz.rgb = function (xyz) {
1884   const x = xyz[0] / 100;
1885   const y = xyz[1] / 100;
1886   const z = xyz[2] / 100;
1887   let r;
1888   let g;
1889   let b;
1890   r = x * 3.2406 + y * -1.5372 + z * -0.4986;
1891   g = x * -0.9689 + y * 1.8758 + z * 0.0415;
1892   b = x * 0.0557 + y * -0.2040 + z * 1.0570; // Assume sRGB
1893
1894   r = r > 0.0031308 ? 1.055 * r ** (1.0 / 2.4) - 0.055 : r * 12.92;
1895   g = g > 0.0031308 ? 1.055 * g ** (1.0 / 2.4) - 0.055 : g * 12.92;
1896   b = b > 0.0031308 ? 1.055 * b ** (1.0 / 2.4) - 0.055 : b * 12.92;
1897   r = Math.min(Math.max(0, r), 1);
1898   g = Math.min(Math.max(0, g), 1);
1899   b = Math.min(Math.max(0, b), 1);
1900   return [r * 255, g * 255, b * 255];
1901 };
1902
1903 convert$1.xyz.lab = function (xyz) {
1904   let x = xyz[0];
1905   let y = xyz[1];
1906   let z = xyz[2];
1907   x /= 95.047;
1908   y /= 100;
1909   z /= 108.883;
1910   x = x > 0.008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
1911   y = y > 0.008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
1912   z = z > 0.008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
1913   const l = 116 * y - 16;
1914   const a = 500 * (x - y);
1915   const b = 200 * (y - z);
1916   return [l, a, b];
1917 };
1918
1919 convert$1.lab.xyz = function (lab) {
1920   const l = lab[0];
1921   const a = lab[1];
1922   const b = lab[2];
1923   let x;
1924   let y;
1925   let z;
1926   y = (l + 16) / 116;
1927   x = a / 500 + y;
1928   z = y - b / 200;
1929   const y2 = y ** 3;
1930   const x2 = x ** 3;
1931   const z2 = z ** 3;
1932   y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
1933   x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
1934   z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;
1935   x *= 95.047;
1936   y *= 100;
1937   z *= 108.883;
1938   return [x, y, z];
1939 };
1940
1941 convert$1.lab.lch = function (lab) {
1942   const l = lab[0];
1943   const a = lab[1];
1944   const b = lab[2];
1945   let h;
1946   const hr = Math.atan2(b, a);
1947   h = hr * 360 / 2 / Math.PI;
1948
1949   if (h < 0) {
1950     h += 360;
1951   }
1952
1953   const c = Math.sqrt(a * a + b * b);
1954   return [l, c, h];
1955 };
1956
1957 convert$1.lch.lab = function (lch) {
1958   const l = lch[0];
1959   const c = lch[1];
1960   const h = lch[2];
1961   const hr = h / 360 * 2 * Math.PI;
1962   const a = c * Math.cos(hr);
1963   const b = c * Math.sin(hr);
1964   return [l, a, b];
1965 };
1966
1967 convert$1.rgb.ansi16 = function (args, saturation = null) {
1968   const [r, g, b] = args;
1969   let value = saturation === null ? convert$1.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization
1970
1971   value = Math.round(value / 50);
1972
1973   if (value === 0) {
1974     return 30;
1975   }
1976
1977   let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
1978
1979   if (value === 2) {
1980     ansi += 60;
1981   }
1982
1983   return ansi;
1984 };
1985
1986 convert$1.hsv.ansi16 = function (args) {
1987   // Optimization here; we already know the value and don't need to get
1988   // it converted for us.
1989   return convert$1.rgb.ansi16(convert$1.hsv.rgb(args), args[2]);
1990 };
1991
1992 convert$1.rgb.ansi256 = function (args) {
1993   const r = args[0];
1994   const g = args[1];
1995   const b = args[2]; // We use the extended greyscale palette here, with the exception of
1996   // black and white. normal palette only has 4 greyscale shades.
1997
1998   if (r === g && g === b) {
1999     if (r < 8) {
2000       return 16;
2001     }
2002
2003     if (r > 248) {
2004       return 231;
2005     }
2006
2007     return Math.round((r - 8) / 247 * 24) + 232;
2008   }
2009
2010   const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
2011   return ansi;
2012 };
2013
2014 convert$1.ansi16.rgb = function (args) {
2015   let color = args % 10; // Handle greyscale
2016
2017   if (color === 0 || color === 7) {
2018     if (args > 50) {
2019       color += 3.5;
2020     }
2021
2022     color = color / 10.5 * 255;
2023     return [color, color, color];
2024   }
2025
2026   const mult = (~~(args > 50) + 1) * 0.5;
2027   const r = (color & 1) * mult * 255;
2028   const g = (color >> 1 & 1) * mult * 255;
2029   const b = (color >> 2 & 1) * mult * 255;
2030   return [r, g, b];
2031 };
2032
2033 convert$1.ansi256.rgb = function (args) {
2034   // Handle greyscale
2035   if (args >= 232) {
2036     const c = (args - 232) * 10 + 8;
2037     return [c, c, c];
2038   }
2039
2040   args -= 16;
2041   let rem;
2042   const r = Math.floor(args / 36) / 5 * 255;
2043   const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
2044   const b = rem % 6 / 5 * 255;
2045   return [r, g, b];
2046 };
2047
2048 convert$1.rgb.hex = function (args) {
2049   const integer = ((Math.round(args[0]) & 0xFF) << 16) + ((Math.round(args[1]) & 0xFF) << 8) + (Math.round(args[2]) & 0xFF);
2050   const string = integer.toString(16).toUpperCase();
2051   return '000000'.substring(string.length) + string;
2052 };
2053
2054 convert$1.hex.rgb = function (args) {
2055   const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
2056
2057   if (!match) {
2058     return [0, 0, 0];
2059   }
2060
2061   let colorString = match[0];
2062
2063   if (match[0].length === 3) {
2064     colorString = colorString.split('').map(char => {
2065       return char + char;
2066     }).join('');
2067   }
2068
2069   const integer = parseInt(colorString, 16);
2070   const r = integer >> 16 & 0xFF;
2071   const g = integer >> 8 & 0xFF;
2072   const b = integer & 0xFF;
2073   return [r, g, b];
2074 };
2075
2076 convert$1.rgb.hcg = function (rgb) {
2077   const r = rgb[0] / 255;
2078   const g = rgb[1] / 255;
2079   const b = rgb[2] / 255;
2080   const max = Math.max(Math.max(r, g), b);
2081   const min = Math.min(Math.min(r, g), b);
2082   const chroma = max - min;
2083   let grayscale;
2084   let hue;
2085
2086   if (chroma < 1) {
2087     grayscale = min / (1 - chroma);
2088   } else {
2089     grayscale = 0;
2090   }
2091
2092   if (chroma <= 0) {
2093     hue = 0;
2094   } else if (max === r) {
2095     hue = (g - b) / chroma % 6;
2096   } else if (max === g) {
2097     hue = 2 + (b - r) / chroma;
2098   } else {
2099     hue = 4 + (r - g) / chroma;
2100   }
2101
2102   hue /= 6;
2103   hue %= 1;
2104   return [hue * 360, chroma * 100, grayscale * 100];
2105 };
2106
2107 convert$1.hsl.hcg = function (hsl) {
2108   const s = hsl[1] / 100;
2109   const l = hsl[2] / 100;
2110   const c = l < 0.5 ? 2.0 * s * l : 2.0 * s * (1.0 - l);
2111   let f = 0;
2112
2113   if (c < 1.0) {
2114     f = (l - 0.5 * c) / (1.0 - c);
2115   }
2116
2117   return [hsl[0], c * 100, f * 100];
2118 };
2119
2120 convert$1.hsv.hcg = function (hsv) {
2121   const s = hsv[1] / 100;
2122   const v = hsv[2] / 100;
2123   const c = s * v;
2124   let f = 0;
2125
2126   if (c < 1.0) {
2127     f = (v - c) / (1 - c);
2128   }
2129
2130   return [hsv[0], c * 100, f * 100];
2131 };
2132
2133 convert$1.hcg.rgb = function (hcg) {
2134   const h = hcg[0] / 360;
2135   const c = hcg[1] / 100;
2136   const g = hcg[2] / 100;
2137
2138   if (c === 0.0) {
2139     return [g * 255, g * 255, g * 255];
2140   }
2141
2142   const pure = [0, 0, 0];
2143   const hi = h % 1 * 6;
2144   const v = hi % 1;
2145   const w = 1 - v;
2146   let mg = 0;
2147   /* eslint-disable max-statements-per-line */
2148
2149   switch (Math.floor(hi)) {
2150     case 0:
2151       pure[0] = 1;
2152       pure[1] = v;
2153       pure[2] = 0;
2154       break;
2155
2156     case 1:
2157       pure[0] = w;
2158       pure[1] = 1;
2159       pure[2] = 0;
2160       break;
2161
2162     case 2:
2163       pure[0] = 0;
2164       pure[1] = 1;
2165       pure[2] = v;
2166       break;
2167
2168     case 3:
2169       pure[0] = 0;
2170       pure[1] = w;
2171       pure[2] = 1;
2172       break;
2173
2174     case 4:
2175       pure[0] = v;
2176       pure[1] = 0;
2177       pure[2] = 1;
2178       break;
2179
2180     default:
2181       pure[0] = 1;
2182       pure[1] = 0;
2183       pure[2] = w;
2184   }
2185   /* eslint-enable max-statements-per-line */
2186
2187
2188   mg = (1.0 - c) * g;
2189   return [(c * pure[0] + mg) * 255, (c * pure[1] + mg) * 255, (c * pure[2] + mg) * 255];
2190 };
2191
2192 convert$1.hcg.hsv = function (hcg) {
2193   const c = hcg[1] / 100;
2194   const g = hcg[2] / 100;
2195   const v = c + g * (1.0 - c);
2196   let f = 0;
2197
2198   if (v > 0.0) {
2199     f = c / v;
2200   }
2201
2202   return [hcg[0], f * 100, v * 100];
2203 };
2204
2205 convert$1.hcg.hsl = function (hcg) {
2206   const c = hcg[1] / 100;
2207   const g = hcg[2] / 100;
2208   const l = g * (1.0 - c) + 0.5 * c;
2209   let s = 0;
2210
2211   if (l > 0.0 && l < 0.5) {
2212     s = c / (2 * l);
2213   } else if (l >= 0.5 && l < 1.0) {
2214     s = c / (2 * (1 - l));
2215   }
2216
2217   return [hcg[0], s * 100, l * 100];
2218 };
2219
2220 convert$1.hcg.hwb = function (hcg) {
2221   const c = hcg[1] / 100;
2222   const g = hcg[2] / 100;
2223   const v = c + g * (1.0 - c);
2224   return [hcg[0], (v - c) * 100, (1 - v) * 100];
2225 };
2226
2227 convert$1.hwb.hcg = function (hwb) {
2228   const w = hwb[1] / 100;
2229   const b = hwb[2] / 100;
2230   const v = 1 - b;
2231   const c = v - w;
2232   let g = 0;
2233
2234   if (c < 1) {
2235     g = (v - c) / (1 - c);
2236   }
2237
2238   return [hwb[0], c * 100, g * 100];
2239 };
2240
2241 convert$1.apple.rgb = function (apple) {
2242   return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
2243 };
2244
2245 convert$1.rgb.apple = function (rgb) {
2246   return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
2247 };
2248
2249 convert$1.gray.rgb = function (args) {
2250   return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
2251 };
2252
2253 convert$1.gray.hsl = function (args) {
2254   return [0, 0, args[0]];
2255 };
2256
2257 convert$1.gray.hsv = convert$1.gray.hsl;
2258
2259 convert$1.gray.hwb = function (gray) {
2260   return [0, 100, gray[0]];
2261 };
2262
2263 convert$1.gray.cmyk = function (gray) {
2264   return [0, 0, 0, gray[0]];
2265 };
2266
2267 convert$1.gray.lab = function (gray) {
2268   return [gray[0], 0, 0];
2269 };
2270
2271 convert$1.gray.hex = function (gray) {
2272   const val = Math.round(gray[0] / 100 * 255) & 0xFF;
2273   const integer = (val << 16) + (val << 8) + val;
2274   const string = integer.toString(16).toUpperCase();
2275   return '000000'.substring(string.length) + string;
2276 };
2277
2278 convert$1.rgb.gray = function (rgb) {
2279   const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
2280   return [val / 255 * 100];
2281 };
2282
2283 const conversions$1 = conversions$2;
2284 /*
2285         This function routes a model to all other models.
2286
2287         all functions that are routed have a property `.conversion` attached
2288         to the returned synthetic function. This property is an array
2289         of strings, each with the steps in between the 'from' and 'to'
2290         color models (inclusive).
2291
2292         conversions that are not possible simply are not included.
2293 */
2294
2295 function buildGraph() {
2296   const graph = {}; // https://jsperf.com/object-keys-vs-for-in-with-closure/3
2297
2298   const models = Object.keys(conversions$1);
2299
2300   for (let len = models.length, i = 0; i < len; i++) {
2301     graph[models[i]] = {
2302       // http://jsperf.com/1-vs-infinity
2303       // micro-opt, but this is simple.
2304       distance: -1,
2305       parent: null
2306     };
2307   }
2308
2309   return graph;
2310 } // https://en.wikipedia.org/wiki/Breadth-first_search
2311
2312
2313 function deriveBFS(fromModel) {
2314   const graph = buildGraph();
2315   const queue = [fromModel]; // Unshift -> queue -> pop
2316
2317   graph[fromModel].distance = 0;
2318
2319   while (queue.length) {
2320     const current = queue.pop();
2321     const adjacents = Object.keys(conversions$1[current]);
2322
2323     for (let len = adjacents.length, i = 0; i < len; i++) {
2324       const adjacent = adjacents[i];
2325       const node = graph[adjacent];
2326
2327       if (node.distance === -1) {
2328         node.distance = graph[current].distance + 1;
2329         node.parent = current;
2330         queue.unshift(adjacent);
2331       }
2332     }
2333   }
2334
2335   return graph;
2336 }
2337
2338 function link(from, to) {
2339   return function (args) {
2340     return to(from(args));
2341   };
2342 }
2343
2344 function wrapConversion(toModel, graph) {
2345   const path = [graph[toModel].parent, toModel];
2346   let fn = conversions$1[graph[toModel].parent][toModel];
2347   let cur = graph[toModel].parent;
2348
2349   while (graph[cur].parent) {
2350     path.unshift(graph[cur].parent);
2351     fn = link(conversions$1[graph[cur].parent][cur], fn);
2352     cur = graph[cur].parent;
2353   }
2354
2355   fn.conversion = path;
2356   return fn;
2357 }
2358
2359 var route$1 = function (fromModel) {
2360   const graph = deriveBFS(fromModel);
2361   const conversion = {};
2362   const models = Object.keys(graph);
2363
2364   for (let len = models.length, i = 0; i < len; i++) {
2365     const toModel = models[i];
2366     const node = graph[toModel];
2367
2368     if (node.parent === null) {
2369       // No possible conversion, or this node is the source model.
2370       continue;
2371     }
2372
2373     conversion[toModel] = wrapConversion(toModel, graph);
2374   }
2375
2376   return conversion;
2377 };
2378
2379 const conversions = conversions$2;
2380 const route = route$1;
2381 const convert = {};
2382 const models = Object.keys(conversions);
2383
2384 function wrapRaw(fn) {
2385   const wrappedFn = function (...args) {
2386     const arg0 = args[0];
2387
2388     if (arg0 === undefined || arg0 === null) {
2389       return arg0;
2390     }
2391
2392     if (arg0.length > 1) {
2393       args = arg0;
2394     }
2395
2396     return fn(args);
2397   }; // Preserve .conversion property if there is one
2398
2399
2400   if ('conversion' in fn) {
2401     wrappedFn.conversion = fn.conversion;
2402   }
2403
2404   return wrappedFn;
2405 }
2406
2407 function wrapRounded(fn) {
2408   const wrappedFn = function (...args) {
2409     const arg0 = args[0];
2410
2411     if (arg0 === undefined || arg0 === null) {
2412       return arg0;
2413     }
2414
2415     if (arg0.length > 1) {
2416       args = arg0;
2417     }
2418
2419     const result = fn(args); // We're assuming the result is an array here.
2420     // see notice in conversions.js; don't use box types
2421     // in conversion functions.
2422
2423     if (typeof result === 'object') {
2424       for (let len = result.length, i = 0; i < len; i++) {
2425         result[i] = Math.round(result[i]);
2426       }
2427     }
2428
2429     return result;
2430   }; // Preserve .conversion property if there is one
2431
2432
2433   if ('conversion' in fn) {
2434     wrappedFn.conversion = fn.conversion;
2435   }
2436
2437   return wrappedFn;
2438 }
2439
2440 models.forEach(fromModel => {
2441   convert[fromModel] = {};
2442   Object.defineProperty(convert[fromModel], 'channels', {
2443     value: conversions[fromModel].channels
2444   });
2445   Object.defineProperty(convert[fromModel], 'labels', {
2446     value: conversions[fromModel].labels
2447   });
2448   const routes = route(fromModel);
2449   const routeModels = Object.keys(routes);
2450   routeModels.forEach(toModel => {
2451     const fn = routes[toModel];
2452     convert[fromModel][toModel] = wrapRounded(fn);
2453     convert[fromModel][toModel].raw = wrapRaw(fn);
2454   });
2455 });
2456 var colorConvert = convert;
2457
2458 (function (module) {
2459
2460   const wrapAnsi16 = (fn, offset) => (...args) => {
2461     const code = fn(...args);
2462     return `\u001B[${code + offset}m`;
2463   };
2464
2465   const wrapAnsi256 = (fn, offset) => (...args) => {
2466     const code = fn(...args);
2467     return `\u001B[${38 + offset};5;${code}m`;
2468   };
2469
2470   const wrapAnsi16m = (fn, offset) => (...args) => {
2471     const rgb = fn(...args);
2472     return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
2473   };
2474
2475   const ansi2ansi = n => n;
2476
2477   const rgb2rgb = (r, g, b) => [r, g, b];
2478
2479   const setLazyProperty = (object, property, get) => {
2480     Object.defineProperty(object, property, {
2481       get: () => {
2482         const value = get();
2483         Object.defineProperty(object, property, {
2484           value,
2485           enumerable: true,
2486           configurable: true
2487         });
2488         return value;
2489       },
2490       enumerable: true,
2491       configurable: true
2492     });
2493   };
2494   /** @type {typeof import('color-convert')} */
2495
2496
2497   let colorConvert$1;
2498
2499   const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
2500     if (colorConvert$1 === undefined) {
2501       colorConvert$1 = colorConvert;
2502     }
2503
2504     const offset = isBackground ? 10 : 0;
2505     const styles = {};
2506
2507     for (const [sourceSpace, suite] of Object.entries(colorConvert$1)) {
2508       const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace;
2509
2510       if (sourceSpace === targetSpace) {
2511         styles[name] = wrap(identity, offset);
2512       } else if (typeof suite === 'object') {
2513         styles[name] = wrap(suite[targetSpace], offset);
2514       }
2515     }
2516
2517     return styles;
2518   };
2519
2520   function assembleStyles() {
2521     const codes = new Map();
2522     const styles = {
2523       modifier: {
2524         reset: [0, 0],
2525         // 21 isn't widely supported and 22 does the same thing
2526         bold: [1, 22],
2527         dim: [2, 22],
2528         italic: [3, 23],
2529         underline: [4, 24],
2530         inverse: [7, 27],
2531         hidden: [8, 28],
2532         strikethrough: [9, 29]
2533       },
2534       color: {
2535         black: [30, 39],
2536         red: [31, 39],
2537         green: [32, 39],
2538         yellow: [33, 39],
2539         blue: [34, 39],
2540         magenta: [35, 39],
2541         cyan: [36, 39],
2542         white: [37, 39],
2543         // Bright color
2544         blackBright: [90, 39],
2545         redBright: [91, 39],
2546         greenBright: [92, 39],
2547         yellowBright: [93, 39],
2548         blueBright: [94, 39],
2549         magentaBright: [95, 39],
2550         cyanBright: [96, 39],
2551         whiteBright: [97, 39]
2552       },
2553       bgColor: {
2554         bgBlack: [40, 49],
2555         bgRed: [41, 49],
2556         bgGreen: [42, 49],
2557         bgYellow: [43, 49],
2558         bgBlue: [44, 49],
2559         bgMagenta: [45, 49],
2560         bgCyan: [46, 49],
2561         bgWhite: [47, 49],
2562         // Bright color
2563         bgBlackBright: [100, 49],
2564         bgRedBright: [101, 49],
2565         bgGreenBright: [102, 49],
2566         bgYellowBright: [103, 49],
2567         bgBlueBright: [104, 49],
2568         bgMagentaBright: [105, 49],
2569         bgCyanBright: [106, 49],
2570         bgWhiteBright: [107, 49]
2571       }
2572     }; // Alias bright black as gray (and grey)
2573
2574     styles.color.gray = styles.color.blackBright;
2575     styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
2576     styles.color.grey = styles.color.blackBright;
2577     styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
2578
2579     for (const [groupName, group] of Object.entries(styles)) {
2580       for (const [styleName, style] of Object.entries(group)) {
2581         styles[styleName] = {
2582           open: `\u001B[${style[0]}m`,
2583           close: `\u001B[${style[1]}m`
2584         };
2585         group[styleName] = styles[styleName];
2586         codes.set(style[0], style[1]);
2587       }
2588
2589       Object.defineProperty(styles, groupName, {
2590         value: group,
2591         enumerable: false
2592       });
2593     }
2594
2595     Object.defineProperty(styles, 'codes', {
2596       value: codes,
2597       enumerable: false
2598     });
2599     styles.color.close = '\u001B[39m';
2600     styles.bgColor.close = '\u001B[49m';
2601     setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false));
2602     setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false));
2603     setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false));
2604     setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true));
2605     setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true));
2606     setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true));
2607     return styles;
2608   } // Make the export immutable
2609
2610
2611   Object.defineProperty(module, 'exports', {
2612     enumerable: true,
2613     get: assembleStyles
2614   });
2615 })(ansiStyles$1);
2616
2617 var hasFlag$1 = (flag, argv = process.argv) => {
2618   const prefix = flag.startsWith('-') ? '' : flag.length === 1 ? '-' : '--';
2619   const position = argv.indexOf(prefix + flag);
2620   const terminatorPosition = argv.indexOf('--');
2621   return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
2622 };
2623
2624 const os = require$$0__default["default"];
2625 const tty = require$$1__default["default"];
2626 const hasFlag = hasFlag$1;
2627 const {
2628   env
2629 } = process;
2630 let forceColor;
2631
2632 if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false') || hasFlag('color=never')) {
2633   forceColor = 0;
2634 } else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') || hasFlag('color=always')) {
2635   forceColor = 1;
2636 }
2637
2638 if ('FORCE_COLOR' in env) {
2639   if (env.FORCE_COLOR === 'true') {
2640     forceColor = 1;
2641   } else if (env.FORCE_COLOR === 'false') {
2642     forceColor = 0;
2643   } else {
2644     forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
2645   }
2646 }
2647
2648 function translateLevel(level) {
2649   if (level === 0) {
2650     return false;
2651   }
2652
2653   return {
2654     level,
2655     hasBasic: true,
2656     has256: level >= 2,
2657     has16m: level >= 3
2658   };
2659 }
2660
2661 function supportsColor(haveStream, streamIsTTY) {
2662   if (forceColor === 0) {
2663     return 0;
2664   }
2665
2666   if (hasFlag('color=16m') || hasFlag('color=full') || hasFlag('color=truecolor')) {
2667     return 3;
2668   }
2669
2670   if (hasFlag('color=256')) {
2671     return 2;
2672   }
2673
2674   if (haveStream && !streamIsTTY && forceColor === undefined) {
2675     return 0;
2676   }
2677
2678   const min = forceColor || 0;
2679
2680   if (env.TERM === 'dumb') {
2681     return min;
2682   }
2683
2684   if (process.platform === 'win32') {
2685     // Windows 10 build 10586 is the first Windows release that supports 256 colors.
2686     // Windows 10 build 14931 is the first release that supports 16m/TrueColor.
2687     const osRelease = os.release().split('.');
2688
2689     if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
2690       return Number(osRelease[2]) >= 14931 ? 3 : 2;
2691     }
2692
2693     return 1;
2694   }
2695
2696   if ('CI' in env) {
2697     if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
2698       return 1;
2699     }
2700
2701     return min;
2702   }
2703
2704   if ('TEAMCITY_VERSION' in env) {
2705     return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
2706   }
2707
2708   if (env.COLORTERM === 'truecolor') {
2709     return 3;
2710   }
2711
2712   if ('TERM_PROGRAM' in env) {
2713     const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
2714
2715     switch (env.TERM_PROGRAM) {
2716       case 'iTerm.app':
2717         return version >= 3 ? 3 : 2;
2718
2719       case 'Apple_Terminal':
2720         return 2;
2721       // No default
2722     }
2723   }
2724
2725   if (/-256(color)?$/i.test(env.TERM)) {
2726     return 2;
2727   }
2728
2729   if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
2730     return 1;
2731   }
2732
2733   if ('COLORTERM' in env) {
2734     return 1;
2735   }
2736
2737   return min;
2738 }
2739
2740 function getSupportLevel(stream) {
2741   const level = supportsColor(stream, stream && stream.isTTY);
2742   return translateLevel(level);
2743 }
2744
2745 var supportsColor_1 = {
2746   supportsColor: getSupportLevel,
2747   stdout: translateLevel(supportsColor(true, tty.isatty(1))),
2748   stderr: translateLevel(supportsColor(true, tty.isatty(2)))
2749 };
2750
2751 const stringReplaceAll$1 = (string, substring, replacer) => {
2752   let index = string.indexOf(substring);
2753
2754   if (index === -1) {
2755     return string;
2756   }
2757
2758   const substringLength = substring.length;
2759   let endIndex = 0;
2760   let returnValue = '';
2761
2762   do {
2763     returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
2764     endIndex = index + substringLength;
2765     index = string.indexOf(substring, endIndex);
2766   } while (index !== -1);
2767
2768   returnValue += string.substr(endIndex);
2769   return returnValue;
2770 };
2771
2772 const stringEncaseCRLFWithFirstIndex$1 = (string, prefix, postfix, index) => {
2773   let endIndex = 0;
2774   let returnValue = '';
2775
2776   do {
2777     const gotCR = string[index - 1] === '\r';
2778     returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? '\r\n' : '\n') + postfix;
2779     endIndex = index + 1;
2780     index = string.indexOf('\n', endIndex);
2781   } while (index !== -1);
2782
2783   returnValue += string.substr(endIndex);
2784   return returnValue;
2785 };
2786
2787 var util$2 = {
2788   stringReplaceAll: stringReplaceAll$1,
2789   stringEncaseCRLFWithFirstIndex: stringEncaseCRLFWithFirstIndex$1
2790 };
2791
2792 const TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
2793 const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
2794 const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
2795 const ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
2796 const ESCAPES = new Map([['n', '\n'], ['r', '\r'], ['t', '\t'], ['b', '\b'], ['f', '\f'], ['v', '\v'], ['0', '\0'], ['\\', '\\'], ['e', '\u001B'], ['a', '\u0007']]);
2797
2798 function unescape(c) {
2799   const u = c[0] === 'u';
2800   const bracket = c[1] === '{';
2801
2802   if (u && !bracket && c.length === 5 || c[0] === 'x' && c.length === 3) {
2803     return String.fromCharCode(parseInt(c.slice(1), 16));
2804   }
2805
2806   if (u && bracket) {
2807     return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
2808   }
2809
2810   return ESCAPES.get(c) || c;
2811 }
2812
2813 function parseArguments(name, arguments_) {
2814   const results = [];
2815   const chunks = arguments_.trim().split(/\s*,\s*/g);
2816   let matches;
2817
2818   for (const chunk of chunks) {
2819     const number = Number(chunk);
2820
2821     if (!Number.isNaN(number)) {
2822       results.push(number);
2823     } else if (matches = chunk.match(STRING_REGEX)) {
2824       results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
2825     } else {
2826       throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
2827     }
2828   }
2829
2830   return results;
2831 }
2832
2833 function parseStyle(style) {
2834   STYLE_REGEX.lastIndex = 0;
2835   const results = [];
2836   let matches;
2837
2838   while ((matches = STYLE_REGEX.exec(style)) !== null) {
2839     const name = matches[1];
2840
2841     if (matches[2]) {
2842       const args = parseArguments(name, matches[2]);
2843       results.push([name].concat(args));
2844     } else {
2845       results.push([name]);
2846     }
2847   }
2848
2849   return results;
2850 }
2851
2852 function buildStyle(chalk, styles) {
2853   const enabled = {};
2854
2855   for (const layer of styles) {
2856     for (const style of layer.styles) {
2857       enabled[style[0]] = layer.inverse ? null : style.slice(1);
2858     }
2859   }
2860
2861   let current = chalk;
2862
2863   for (const [styleName, styles] of Object.entries(enabled)) {
2864     if (!Array.isArray(styles)) {
2865       continue;
2866     }
2867
2868     if (!(styleName in current)) {
2869       throw new Error(`Unknown Chalk style: ${styleName}`);
2870     }
2871
2872     current = styles.length > 0 ? current[styleName](...styles) : current[styleName];
2873   }
2874
2875   return current;
2876 }
2877
2878 var templates = (chalk, temporary) => {
2879   const styles = [];
2880   const chunks = [];
2881   let chunk = []; // eslint-disable-next-line max-params
2882
2883   temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
2884     if (escapeCharacter) {
2885       chunk.push(unescape(escapeCharacter));
2886     } else if (style) {
2887       const string = chunk.join('');
2888       chunk = [];
2889       chunks.push(styles.length === 0 ? string : buildStyle(chalk, styles)(string));
2890       styles.push({
2891         inverse,
2892         styles: parseStyle(style)
2893       });
2894     } else if (close) {
2895       if (styles.length === 0) {
2896         throw new Error('Found extraneous } in Chalk template literal');
2897       }
2898
2899       chunks.push(buildStyle(chalk, styles)(chunk.join('')));
2900       chunk = [];
2901       styles.pop();
2902     } else {
2903       chunk.push(character);
2904     }
2905   });
2906   chunks.push(chunk.join(''));
2907
2908   if (styles.length > 0) {
2909     const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\`}\`)`;
2910     throw new Error(errMessage);
2911   }
2912
2913   return chunks.join('');
2914 };
2915
2916 const ansiStyles = ansiStyles$1.exports;
2917 const {
2918   stdout: stdoutColor,
2919   stderr: stderrColor
2920 } = supportsColor_1;
2921 const {
2922   stringReplaceAll,
2923   stringEncaseCRLFWithFirstIndex
2924 } = util$2;
2925 const {
2926   isArray: isArray$e
2927 } = Array; // `supportsColor.level` → `ansiStyles.color[name]` mapping
2928
2929 const levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m'];
2930 const styles = Object.create(null);
2931
2932 const applyOptions = (object, options = {}) => {
2933   if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
2934     throw new Error('The `level` option should be an integer from 0 to 3');
2935   } // Detect level if not set manually
2936
2937
2938   const colorLevel = stdoutColor ? stdoutColor.level : 0;
2939   object.level = options.level === undefined ? colorLevel : options.level;
2940 };
2941
2942 class ChalkClass {
2943   constructor(options) {
2944     // eslint-disable-next-line no-constructor-return
2945     return chalkFactory(options);
2946   }
2947
2948 }
2949
2950 const chalkFactory = options => {
2951   const chalk = {};
2952   applyOptions(chalk, options);
2953
2954   chalk.template = (...arguments_) => chalkTag(chalk.template, ...arguments_);
2955
2956   Object.setPrototypeOf(chalk, Chalk.prototype);
2957   Object.setPrototypeOf(chalk.template, chalk);
2958
2959   chalk.template.constructor = () => {
2960     throw new Error('`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.');
2961   };
2962
2963   chalk.template.Instance = ChalkClass;
2964   return chalk.template;
2965 };
2966
2967 function Chalk(options) {
2968   return chalkFactory(options);
2969 }
2970
2971 for (const [styleName, style] of Object.entries(ansiStyles)) {
2972   styles[styleName] = {
2973     get() {
2974       const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
2975       Object.defineProperty(this, styleName, {
2976         value: builder
2977       });
2978       return builder;
2979     }
2980
2981   };
2982 }
2983
2984 styles.visible = {
2985   get() {
2986     const builder = createBuilder(this, this._styler, true);
2987     Object.defineProperty(this, 'visible', {
2988       value: builder
2989     });
2990     return builder;
2991   }
2992
2993 };
2994 const usedModels = ['rgb', 'hex', 'keyword', 'hsl', 'hsv', 'hwb', 'ansi', 'ansi256'];
2995
2996 for (const model of usedModels) {
2997   styles[model] = {
2998     get() {
2999       const {
3000         level
3001       } = this;
3002       return function (...arguments_) {
3003         const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
3004         return createBuilder(this, styler, this._isEmpty);
3005       };
3006     }
3007
3008   };
3009 }
3010
3011 for (const model of usedModels) {
3012   const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);
3013   styles[bgModel] = {
3014     get() {
3015       const {
3016         level
3017       } = this;
3018       return function (...arguments_) {
3019         const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
3020         return createBuilder(this, styler, this._isEmpty);
3021       };
3022     }
3023
3024   };
3025 }
3026
3027 const proto = Object.defineProperties(() => {}, Object.assign(Object.assign({}, styles), {}, {
3028   level: {
3029     enumerable: true,
3030
3031     get() {
3032       return this._generator.level;
3033     },
3034
3035     set(level) {
3036       this._generator.level = level;
3037     }
3038
3039   }
3040 }));
3041
3042 const createStyler = (open, close, parent) => {
3043   let openAll;
3044   let closeAll;
3045
3046   if (parent === undefined) {
3047     openAll = open;
3048     closeAll = close;
3049   } else {
3050     openAll = parent.openAll + open;
3051     closeAll = close + parent.closeAll;
3052   }
3053
3054   return {
3055     open,
3056     close,
3057     openAll,
3058     closeAll,
3059     parent
3060   };
3061 };
3062
3063 const createBuilder = (self, _styler, _isEmpty) => {
3064   const builder = (...arguments_) => {
3065     if (isArray$e(arguments_[0]) && isArray$e(arguments_[0].raw)) {
3066       // Called as a template literal, for example: chalk.red`2 + 3 = {bold ${2+3}}`
3067       return applyStyle(builder, chalkTag(builder, ...arguments_));
3068     } // Single argument is hot path, implicit coercion is faster than anything
3069     // eslint-disable-next-line no-implicit-coercion
3070
3071
3072     return applyStyle(builder, arguments_.length === 1 ? '' + arguments_[0] : arguments_.join(' '));
3073   }; // We alter the prototype because we must return a function, but there is
3074   // no way to create a function with a different prototype
3075
3076
3077   Object.setPrototypeOf(builder, proto);
3078   builder._generator = self;
3079   builder._styler = _styler;
3080   builder._isEmpty = _isEmpty;
3081   return builder;
3082 };
3083
3084 const applyStyle = (self, string) => {
3085   if (self.level <= 0 || !string) {
3086     return self._isEmpty ? '' : string;
3087   }
3088
3089   let styler = self._styler;
3090
3091   if (styler === undefined) {
3092     return string;
3093   }
3094
3095   const {
3096     openAll,
3097     closeAll
3098   } = styler;
3099
3100   if (string.indexOf('\u001B') !== -1) {
3101     while (styler !== undefined) {
3102       // Replace any instances already present with a re-opening code
3103       // otherwise only the part of the string until said closing code
3104       // will be colored, and the rest will simply be 'plain'.
3105       string = stringReplaceAll(string, styler.close, styler.open);
3106       styler = styler.parent;
3107     }
3108   } // We can move both next actions out of loop, because remaining actions in loop won't have
3109   // any/visible effect on parts we add here. Close the styling before a linebreak and reopen
3110   // after next line to fix a bleed issue on macOS: https://github.com/chalk/chalk/pull/92
3111
3112
3113   const lfIndex = string.indexOf('\n');
3114
3115   if (lfIndex !== -1) {
3116     string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
3117   }
3118
3119   return openAll + string + closeAll;
3120 };
3121
3122 let template;
3123
3124 const chalkTag = (chalk, ...strings) => {
3125   const [firstString] = strings;
3126
3127   if (!isArray$e(firstString) || !isArray$e(firstString.raw)) {
3128     // If chalk() was called by itself or with a string,
3129     // return the string itself as a string.
3130     return strings.join(' ');
3131   }
3132
3133   const arguments_ = strings.slice(1);
3134   const parts = [firstString.raw[0]];
3135
3136   for (let i = 1; i < firstString.length; i++) {
3137     parts.push(String(arguments_[i - 1]).replace(/[{}\\]/g, '\\$&'), String(firstString.raw[i]));
3138   }
3139
3140   if (template === undefined) {
3141     template = templates;
3142   }
3143
3144   return template(chalk, parts.join(''));
3145 };
3146
3147 Object.defineProperties(Chalk.prototype, styles);
3148 const chalk$2 = Chalk(); // eslint-disable-line new-cap
3149
3150 chalk$2.supportsColor = stdoutColor;
3151 chalk$2.stderr = Chalk({
3152   level: stderrColor ? stderrColor.level : 0
3153 }); // eslint-disable-line new-cap
3154
3155 chalk$2.stderr.supportsColor = stderrColor;
3156 var source = chalk$2;
3157
3158 var require$$4 = require("./third-party.js");
3159
3160 var prettierInternal = require$$3.__internal;
3161
3162 var classof$2 = classofRaw$1;
3163
3164 // `IsArray` abstract operation
3165 // https://tc39.es/ecma262/#sec-isarray
3166 // eslint-disable-next-line es/no-array-isarray -- safe
3167 var isArray$d = Array.isArray || function isArray(argument) {
3168   return classof$2(argument) == 'Array';
3169 };
3170
3171 var uncurryThis$1 = functionUncurryThis;
3172 var aCallable$2 = aCallable$5;
3173
3174 var bind$2 = uncurryThis$1(uncurryThis$1.bind);
3175
3176 // optional / simple context binding
3177 var functionBindContext = function (fn, that) {
3178   aCallable$2(fn);
3179   return that === undefined ? fn : bind$2 ? bind$2(fn, that) : function (/* ...args */) {
3180     return fn.apply(that, arguments);
3181   };
3182 };
3183
3184 var global$4 = global$r;
3185 var isArray$c = isArray$d;
3186 var lengthOfArrayLike$3 = lengthOfArrayLike$6;
3187 var bind$1 = functionBindContext;
3188
3189 var TypeError$3 = global$4.TypeError;
3190
3191 // `FlattenIntoArray` abstract operation
3192 // https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray
3193 var flattenIntoArray$2 = function (target, original, source, sourceLen, start, depth, mapper, thisArg) {
3194   var targetIndex = start;
3195   var sourceIndex = 0;
3196   var mapFn = mapper ? bind$1(mapper, thisArg) : false;
3197   var element, elementLen;
3198
3199   while (sourceIndex < sourceLen) {
3200     if (sourceIndex in source) {
3201       element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
3202
3203       if (depth > 0 && isArray$c(element)) {
3204         elementLen = lengthOfArrayLike$3(element);
3205         targetIndex = flattenIntoArray$2(target, original, element, elementLen, targetIndex, depth - 1) - 1;
3206       } else {
3207         if (targetIndex >= 0x1FFFFFFFFFFFFF) throw TypeError$3('Exceed the acceptable array length');
3208         target[targetIndex] = element;
3209       }
3210
3211       targetIndex++;
3212     }
3213     sourceIndex++;
3214   }
3215   return targetIndex;
3216 };
3217
3218 var flattenIntoArray_1 = flattenIntoArray$2;
3219
3220 var uncurryThis = functionUncurryThis;
3221 var fails = fails$8;
3222 var isCallable = isCallable$b;
3223 var classof$1 = classof$4;
3224 var getBuiltIn$1 = getBuiltIn$5;
3225 var inspectSource = inspectSource$3;
3226
3227 var noop$1 = function () { /* empty */ };
3228 var empty = [];
3229 var construct = getBuiltIn$1('Reflect', 'construct');
3230 var constructorRegExp = /^\s*(?:class|function)\b/;
3231 var exec = uncurryThis(constructorRegExp.exec);
3232 var INCORRECT_TO_STRING = !constructorRegExp.exec(noop$1);
3233
3234 var isConstructorModern = function (argument) {
3235   if (!isCallable(argument)) return false;
3236   try {
3237     construct(noop$1, empty, argument);
3238     return true;
3239   } catch (error) {
3240     return false;
3241   }
3242 };
3243
3244 var isConstructorLegacy = function (argument) {
3245   if (!isCallable(argument)) return false;
3246   switch (classof$1(argument)) {
3247     case 'AsyncFunction':
3248     case 'GeneratorFunction':
3249     case 'AsyncGeneratorFunction': return false;
3250     // we can't check .prototype since constructors produced by .bind haven't it
3251   } return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
3252 };
3253
3254 // `IsConstructor` abstract operation
3255 // https://tc39.es/ecma262/#sec-isconstructor
3256 var isConstructor$1 = !construct || fails(function () {
3257   var called;
3258   return isConstructorModern(isConstructorModern.call)
3259     || !isConstructorModern(Object)
3260     || !isConstructorModern(function () { called = true; })
3261     || called;
3262 }) ? isConstructorLegacy : isConstructorModern;
3263
3264 var global$3 = global$r;
3265 var isArray$b = isArray$d;
3266 var isConstructor = isConstructor$1;
3267 var isObject$7 = isObject$d;
3268 var wellKnownSymbol$3 = wellKnownSymbol$7;
3269
3270 var SPECIES = wellKnownSymbol$3('species');
3271 var Array$1 = global$3.Array;
3272
3273 // a part of `ArraySpeciesCreate` abstract operation
3274 // https://tc39.es/ecma262/#sec-arrayspeciescreate
3275 var arraySpeciesConstructor$1 = function (originalArray) {
3276   var C;
3277   if (isArray$b(originalArray)) {
3278     C = originalArray.constructor;
3279     // cross-realm fallback
3280     if (isConstructor(C) && (C === Array$1 || isArray$b(C.prototype))) C = undefined;
3281     else if (isObject$7(C)) {
3282       C = C[SPECIES];
3283       if (C === null) C = undefined;
3284     }
3285   } return C === undefined ? Array$1 : C;
3286 };
3287
3288 var arraySpeciesConstructor = arraySpeciesConstructor$1;
3289
3290 // `ArraySpeciesCreate` abstract operation
3291 // https://tc39.es/ecma262/#sec-arrayspeciescreate
3292 var arraySpeciesCreate$2 = function (originalArray, length) {
3293   return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
3294 };
3295
3296 var $$2 = _export;
3297 var flattenIntoArray$1 = flattenIntoArray_1;
3298 var aCallable$1 = aCallable$5;
3299 var toObject$1 = toObject$4;
3300 var lengthOfArrayLike$2 = lengthOfArrayLike$6;
3301 var arraySpeciesCreate$1 = arraySpeciesCreate$2;
3302
3303 // `Array.prototype.flatMap` method
3304 // https://tc39.es/ecma262/#sec-array.prototype.flatmap
3305 $$2({ target: 'Array', proto: true }, {
3306   flatMap: function flatMap(callbackfn /* , thisArg */) {
3307     var O = toObject$1(this);
3308     var sourceLen = lengthOfArrayLike$2(O);
3309     var A;
3310     aCallable$1(callbackfn);
3311     A = arraySpeciesCreate$1(O, 0);
3312     A.length = flattenIntoArray$1(A, O, O, sourceLen, 0, 1, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
3313     return A;
3314   }
3315 });
3316
3317 var tasks = {};
3318
3319 var utils$k = {};
3320
3321 var array$3 = {};
3322
3323 Object.defineProperty(array$3, "__esModule", {
3324   value: true
3325 });
3326 array$3.splitWhen = array$3.flatten = void 0;
3327
3328 function flatten$2(items) {
3329   return items.reduce((collection, item) => [].concat(collection, item), []);
3330 }
3331
3332 array$3.flatten = flatten$2;
3333
3334 function splitWhen(items, predicate) {
3335   const result = [[]];
3336   let groupIndex = 0;
3337
3338   for (const item of items) {
3339     if (predicate(item)) {
3340       groupIndex++;
3341       result[groupIndex] = [];
3342     } else {
3343       result[groupIndex].push(item);
3344     }
3345   }
3346
3347   return result;
3348 }
3349
3350 array$3.splitWhen = splitWhen;
3351
3352 var errno$1 = {};
3353
3354 Object.defineProperty(errno$1, "__esModule", {
3355   value: true
3356 });
3357 errno$1.isEnoentCodeError = void 0;
3358
3359 function isEnoentCodeError(error) {
3360   return error.code === 'ENOENT';
3361 }
3362
3363 errno$1.isEnoentCodeError = isEnoentCodeError;
3364
3365 var fs$9 = {};
3366
3367 Object.defineProperty(fs$9, "__esModule", {
3368   value: true
3369 });
3370 fs$9.createDirentFromStats = void 0;
3371
3372 class DirentFromStats$1 {
3373   constructor(name, stats) {
3374     this.name = name;
3375     this.isBlockDevice = stats.isBlockDevice.bind(stats);
3376     this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
3377     this.isDirectory = stats.isDirectory.bind(stats);
3378     this.isFIFO = stats.isFIFO.bind(stats);
3379     this.isFile = stats.isFile.bind(stats);
3380     this.isSocket = stats.isSocket.bind(stats);
3381     this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
3382   }
3383
3384 }
3385
3386 function createDirentFromStats$1(name, stats) {
3387   return new DirentFromStats$1(name, stats);
3388 }
3389
3390 fs$9.createDirentFromStats = createDirentFromStats$1;
3391
3392 var path$c = {};
3393
3394 Object.defineProperty(path$c, "__esModule", {
3395   value: true
3396 });
3397 path$c.removeLeadingDotSegment = path$c.escape = path$c.makeAbsolute = path$c.unixify = void 0;
3398 const path$b = require$$0__default$1["default"];
3399 const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; // ./ or .\\
3400
3401 const UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g;
3402 /**
3403  * Designed to work only with simple paths: `dir\\file`.
3404  */
3405
3406 function unixify(filepath) {
3407   return filepath.replace(/\\/g, '/');
3408 }
3409
3410 path$c.unixify = unixify;
3411
3412 function makeAbsolute(cwd, filepath) {
3413   return path$b.resolve(cwd, filepath);
3414 }
3415
3416 path$c.makeAbsolute = makeAbsolute;
3417
3418 function escape(pattern) {
3419   return pattern.replace(UNESCAPED_GLOB_SYMBOLS_RE, '\\$2');
3420 }
3421
3422 path$c.escape = escape;
3423
3424 function removeLeadingDotSegment(entry) {
3425   // We do not use `startsWith` because this is 10x slower than current implementation for some cases.
3426   // eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with
3427   if (entry.charAt(0) === '.') {
3428     const secondCharactery = entry.charAt(1);
3429
3430     if (secondCharactery === '/' || secondCharactery === '\\') {
3431       return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT);
3432     }
3433   }
3434
3435   return entry;
3436 }
3437
3438 path$c.removeLeadingDotSegment = removeLeadingDotSegment;
3439
3440 var pattern$1 = {};
3441
3442 /*!
3443  * is-extglob <https://github.com/jonschlinkert/is-extglob>
3444  *
3445  * Copyright (c) 2014-2016, Jon Schlinkert.
3446  * Licensed under the MIT License.
3447  */
3448
3449 var isExtglob$1 = function isExtglob(str) {
3450   if (typeof str !== 'string' || str === '') {
3451     return false;
3452   }
3453
3454   var match;
3455
3456   while (match = /(\\).|([@?!+*]\(.*\))/g.exec(str)) {
3457     if (match[2]) return true;
3458     str = str.slice(match.index + match[0].length);
3459   }
3460
3461   return false;
3462 };
3463
3464 /*!
3465  * is-glob <https://github.com/jonschlinkert/is-glob>
3466  *
3467  * Copyright (c) 2014-2017, Jon Schlinkert.
3468  * Released under the MIT License.
3469  */
3470 var isExtglob = isExtglob$1;
3471 var chars = {
3472   '{': '}',
3473   '(': ')',
3474   '[': ']'
3475 };
3476
3477 var strictCheck = function (str) {
3478   if (str[0] === '!') {
3479     return true;
3480   }
3481
3482   var index = 0;
3483   var pipeIndex = -2;
3484   var closeSquareIndex = -2;
3485   var closeCurlyIndex = -2;
3486   var closeParenIndex = -2;
3487   var backSlashIndex = -2;
3488
3489   while (index < str.length) {
3490     if (str[index] === '*') {
3491       return true;
3492     }
3493
3494     if (str[index + 1] === '?' && /[\].+)]/.test(str[index])) {
3495       return true;
3496     }
3497
3498     if (closeSquareIndex !== -1 && str[index] === '[' && str[index + 1] !== ']') {
3499       if (closeSquareIndex < index) {
3500         closeSquareIndex = str.indexOf(']', index);
3501       }
3502
3503       if (closeSquareIndex > index) {
3504         if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
3505           return true;
3506         }
3507
3508         backSlashIndex = str.indexOf('\\', index);
3509
3510         if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
3511           return true;
3512         }
3513       }
3514     }
3515
3516     if (closeCurlyIndex !== -1 && str[index] === '{' && str[index + 1] !== '}') {
3517       closeCurlyIndex = str.indexOf('}', index);
3518
3519       if (closeCurlyIndex > index) {
3520         backSlashIndex = str.indexOf('\\', index);
3521
3522         if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) {
3523           return true;
3524         }
3525       }
3526     }
3527
3528     if (closeParenIndex !== -1 && str[index] === '(' && str[index + 1] === '?' && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ')') {
3529       closeParenIndex = str.indexOf(')', index);
3530
3531       if (closeParenIndex > index) {
3532         backSlashIndex = str.indexOf('\\', index);
3533
3534         if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
3535           return true;
3536         }
3537       }
3538     }
3539
3540     if (pipeIndex !== -1 && str[index] === '(' && str[index + 1] !== '|') {
3541       if (pipeIndex < index) {
3542         pipeIndex = str.indexOf('|', index);
3543       }
3544
3545       if (pipeIndex !== -1 && str[pipeIndex + 1] !== ')') {
3546         closeParenIndex = str.indexOf(')', pipeIndex);
3547
3548         if (closeParenIndex > pipeIndex) {
3549           backSlashIndex = str.indexOf('\\', pipeIndex);
3550
3551           if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
3552             return true;
3553           }
3554         }
3555       }
3556     }
3557
3558     if (str[index] === '\\') {
3559       var open = str[index + 1];
3560       index += 2;
3561       var close = chars[open];
3562
3563       if (close) {
3564         var n = str.indexOf(close, index);
3565
3566         if (n !== -1) {
3567           index = n + 1;
3568         }
3569       }
3570
3571       if (str[index] === '!') {
3572         return true;
3573       }
3574     } else {
3575       index++;
3576     }
3577   }
3578
3579   return false;
3580 };
3581
3582 var relaxedCheck = function (str) {
3583   if (str[0] === '!') {
3584     return true;
3585   }
3586
3587   var index = 0;
3588
3589   while (index < str.length) {
3590     if (/[*?{}()[\]]/.test(str[index])) {
3591       return true;
3592     }
3593
3594     if (str[index] === '\\') {
3595       var open = str[index + 1];
3596       index += 2;
3597       var close = chars[open];
3598
3599       if (close) {
3600         var n = str.indexOf(close, index);
3601
3602         if (n !== -1) {
3603           index = n + 1;
3604         }
3605       }
3606
3607       if (str[index] === '!') {
3608         return true;
3609       }
3610     } else {
3611       index++;
3612     }
3613   }
3614
3615   return false;
3616 };
3617
3618 var isGlob$1 = function isGlob(str, options) {
3619   if (typeof str !== 'string' || str === '') {
3620     return false;
3621   }
3622
3623   if (isExtglob(str)) {
3624     return true;
3625   }
3626
3627   var check = strictCheck; // optionally relax check
3628
3629   if (options && options.strict === false) {
3630     check = relaxedCheck;
3631   }
3632
3633   return check(str);
3634 };
3635
3636 var isGlob = isGlob$1;
3637 var pathPosixDirname = require$$0__default$1["default"].posix.dirname;
3638 var isWin32 = require$$0__default["default"].platform() === 'win32';
3639 var slash = '/';
3640 var backslash = /\\/g;
3641 var enclosure = /[\{\[].*[\}\]]$/;
3642 var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/;
3643 var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g;
3644 /**
3645  * @param {string} str
3646  * @param {Object} opts
3647  * @param {boolean} [opts.flipBackslashes=true]
3648  * @returns {string}
3649  */
3650
3651 var globParent$1 = function globParent(str, opts) {
3652   var options = Object.assign({
3653     flipBackslashes: true
3654   }, opts); // flip windows path separators
3655
3656   if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) {
3657     str = str.replace(backslash, slash);
3658   } // special case for strings ending in enclosure containing path separator
3659
3660
3661   if (enclosure.test(str)) {
3662     str += slash;
3663   } // preserves full path in case of trailing path separator
3664
3665
3666   str += 'a'; // remove path parts that are globby
3667
3668   do {
3669     str = pathPosixDirname(str);
3670   } while (isGlob(str) || globby.test(str)); // remove escape chars and return result
3671
3672
3673   return str.replace(escaped, '$1');
3674 };
3675
3676 var utils$j = {};
3677
3678 (function (exports) {
3679
3680   exports.isInteger = num => {
3681     if (typeof num === 'number') {
3682       return Number.isInteger(num);
3683     }
3684
3685     if (typeof num === 'string' && num.trim() !== '') {
3686       return Number.isInteger(Number(num));
3687     }
3688
3689     return false;
3690   };
3691   /**
3692    * Find a node of the given type
3693    */
3694
3695
3696   exports.find = (node, type) => node.nodes.find(node => node.type === type);
3697   /**
3698    * Find a node of the given type
3699    */
3700
3701
3702   exports.exceedsLimit = (min, max, step = 1, limit) => {
3703     if (limit === false) return false;
3704     if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
3705     return (Number(max) - Number(min)) / Number(step) >= limit;
3706   };
3707   /**
3708    * Escape the given node with '\\' before node.value
3709    */
3710
3711
3712   exports.escapeNode = (block, n = 0, type) => {
3713     let node = block.nodes[n];
3714     if (!node) return;
3715
3716     if (type && node.type === type || node.type === 'open' || node.type === 'close') {
3717       if (node.escaped !== true) {
3718         node.value = '\\' + node.value;
3719         node.escaped = true;
3720       }
3721     }
3722   };
3723   /**
3724    * Returns true if the given brace node should be enclosed in literal braces
3725    */
3726
3727
3728   exports.encloseBrace = node => {
3729     if (node.type !== 'brace') return false;
3730
3731     if (node.commas >> 0 + node.ranges >> 0 === 0) {
3732       node.invalid = true;
3733       return true;
3734     }
3735
3736     return false;
3737   };
3738   /**
3739    * Returns true if a brace node is invalid.
3740    */
3741
3742
3743   exports.isInvalidBrace = block => {
3744     if (block.type !== 'brace') return false;
3745     if (block.invalid === true || block.dollar) return true;
3746
3747     if (block.commas >> 0 + block.ranges >> 0 === 0) {
3748       block.invalid = true;
3749       return true;
3750     }
3751
3752     if (block.open !== true || block.close !== true) {
3753       block.invalid = true;
3754       return true;
3755     }
3756
3757     return false;
3758   };
3759   /**
3760    * Returns true if a node is an open or close node
3761    */
3762
3763
3764   exports.isOpenOrClose = node => {
3765     if (node.type === 'open' || node.type === 'close') {
3766       return true;
3767     }
3768
3769     return node.open === true || node.close === true;
3770   };
3771   /**
3772    * Reduce an array of text nodes.
3773    */
3774
3775
3776   exports.reduce = nodes => nodes.reduce((acc, node) => {
3777     if (node.type === 'text') acc.push(node.value);
3778     if (node.type === 'range') node.type = 'text';
3779     return acc;
3780   }, []);
3781   /**
3782    * Flatten an array
3783    */
3784
3785
3786   exports.flatten = (...args) => {
3787     const result = [];
3788
3789     const flat = arr => {
3790       for (let i = 0; i < arr.length; i++) {
3791         let ele = arr[i];
3792         Array.isArray(ele) ? flat(ele) : ele !== void 0 && result.push(ele);
3793       }
3794
3795       return result;
3796     };
3797
3798     flat(args);
3799     return result;
3800   };
3801 })(utils$j);
3802
3803 const utils$i = utils$j;
3804
3805 var stringify$6 = (ast, options = {}) => {
3806   let stringify = (node, parent = {}) => {
3807     let invalidBlock = options.escapeInvalid && utils$i.isInvalidBrace(parent);
3808     let invalidNode = node.invalid === true && options.escapeInvalid === true;
3809     let output = '';
3810
3811     if (node.value) {
3812       if ((invalidBlock || invalidNode) && utils$i.isOpenOrClose(node)) {
3813         return '\\' + node.value;
3814       }
3815
3816       return node.value;
3817     }
3818
3819     if (node.value) {
3820       return node.value;
3821     }
3822
3823     if (node.nodes) {
3824       for (let child of node.nodes) {
3825         output += stringify(child);
3826       }
3827     }
3828
3829     return output;
3830   };
3831
3832   return stringify(ast);
3833 };
3834
3835 /*!
3836  * is-number <https://github.com/jonschlinkert/is-number>
3837  *
3838  * Copyright (c) 2014-present, Jon Schlinkert.
3839  * Released under the MIT License.
3840  */
3841
3842 var isNumber$3 = function (num) {
3843   if (typeof num === 'number') {
3844     return num - num === 0;
3845   }
3846
3847   if (typeof num === 'string' && num.trim() !== '') {
3848     return Number.isFinite ? Number.isFinite(+num) : isFinite(+num);
3849   }
3850
3851   return false;
3852 };
3853
3854 const isNumber$2 = isNumber$3;
3855
3856 const toRegexRange$1 = (min, max, options) => {
3857   if (isNumber$2(min) === false) {
3858     throw new TypeError('toRegexRange: expected the first argument to be a number');
3859   }
3860
3861   if (max === void 0 || min === max) {
3862     return String(min);
3863   }
3864
3865   if (isNumber$2(max) === false) {
3866     throw new TypeError('toRegexRange: expected the second argument to be a number.');
3867   }
3868
3869   let opts = Object.assign({
3870     relaxZeros: true
3871   }, options);
3872
3873   if (typeof opts.strictZeros === 'boolean') {
3874     opts.relaxZeros = opts.strictZeros === false;
3875   }
3876
3877   let relax = String(opts.relaxZeros);
3878   let shorthand = String(opts.shorthand);
3879   let capture = String(opts.capture);
3880   let wrap = String(opts.wrap);
3881   let cacheKey = min + ':' + max + '=' + relax + shorthand + capture + wrap;
3882
3883   if (toRegexRange$1.cache.hasOwnProperty(cacheKey)) {
3884     return toRegexRange$1.cache[cacheKey].result;
3885   }
3886
3887   let a = Math.min(min, max);
3888   let b = Math.max(min, max);
3889
3890   if (Math.abs(a - b) === 1) {
3891     let result = min + '|' + max;
3892
3893     if (opts.capture) {
3894       return `(${result})`;
3895     }
3896
3897     if (opts.wrap === false) {
3898       return result;
3899     }
3900
3901     return `(?:${result})`;
3902   }
3903
3904   let isPadded = hasPadding(min) || hasPadding(max);
3905   let state = {
3906     min,
3907     max,
3908     a,
3909     b
3910   };
3911   let positives = [];
3912   let negatives = [];
3913
3914   if (isPadded) {
3915     state.isPadded = isPadded;
3916     state.maxLen = String(state.max).length;
3917   }
3918
3919   if (a < 0) {
3920     let newMin = b < 0 ? Math.abs(b) : 1;
3921     negatives = splitToPatterns(newMin, Math.abs(a), state, opts);
3922     a = state.a = 0;
3923   }
3924
3925   if (b >= 0) {
3926     positives = splitToPatterns(a, b, state, opts);
3927   }
3928
3929   state.negatives = negatives;
3930   state.positives = positives;
3931   state.result = collatePatterns(negatives, positives);
3932
3933   if (opts.capture === true) {
3934     state.result = `(${state.result})`;
3935   } else if (opts.wrap !== false && positives.length + negatives.length > 1) {
3936     state.result = `(?:${state.result})`;
3937   }
3938
3939   toRegexRange$1.cache[cacheKey] = state;
3940   return state.result;
3941 };
3942
3943 function collatePatterns(neg, pos, options) {
3944   let onlyNegative = filterPatterns(neg, pos, '-', false) || [];
3945   let onlyPositive = filterPatterns(pos, neg, '', false) || [];
3946   let intersected = filterPatterns(neg, pos, '-?', true) || [];
3947   let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive);
3948   return subpatterns.join('|');
3949 }
3950
3951 function splitToRanges(min, max) {
3952   let nines = 1;
3953   let zeros = 1;
3954   let stop = countNines(min, nines);
3955   let stops = new Set([max]);
3956
3957   while (min <= stop && stop <= max) {
3958     stops.add(stop);
3959     nines += 1;
3960     stop = countNines(min, nines);
3961   }
3962
3963   stop = countZeros(max + 1, zeros) - 1;
3964
3965   while (min < stop && stop <= max) {
3966     stops.add(stop);
3967     zeros += 1;
3968     stop = countZeros(max + 1, zeros) - 1;
3969   }
3970
3971   stops = [...stops];
3972   stops.sort(compare);
3973   return stops;
3974 }
3975 /**
3976  * Convert a range to a regex pattern
3977  * @param {Number} `start`
3978  * @param {Number} `stop`
3979  * @return {String}
3980  */
3981
3982
3983 function rangeToPattern(start, stop, options) {
3984   if (start === stop) {
3985     return {
3986       pattern: start,
3987       count: [],
3988       digits: 0
3989     };
3990   }
3991
3992   let zipped = zip(start, stop);
3993   let digits = zipped.length;
3994   let pattern = '';
3995   let count = 0;
3996
3997   for (let i = 0; i < digits; i++) {
3998     let [startDigit, stopDigit] = zipped[i];
3999
4000     if (startDigit === stopDigit) {
4001       pattern += startDigit;
4002     } else if (startDigit !== '0' || stopDigit !== '9') {
4003       pattern += toCharacterClass(startDigit, stopDigit);
4004     } else {
4005       count++;
4006     }
4007   }
4008
4009   if (count) {
4010     pattern += options.shorthand === true ? '\\d' : '[0-9]';
4011   }
4012
4013   return {
4014     pattern,
4015     count: [count],
4016     digits
4017   };
4018 }
4019
4020 function splitToPatterns(min, max, tok, options) {
4021   let ranges = splitToRanges(min, max);
4022   let tokens = [];
4023   let start = min;
4024   let prev;
4025
4026   for (let i = 0; i < ranges.length; i++) {
4027     let max = ranges[i];
4028     let obj = rangeToPattern(String(start), String(max), options);
4029     let zeros = '';
4030
4031     if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
4032       if (prev.count.length > 1) {
4033         prev.count.pop();
4034       }
4035
4036       prev.count.push(obj.count[0]);
4037       prev.string = prev.pattern + toQuantifier(prev.count);
4038       start = max + 1;
4039       continue;
4040     }
4041
4042     if (tok.isPadded) {
4043       zeros = padZeros(max, tok, options);
4044     }
4045
4046     obj.string = zeros + obj.pattern + toQuantifier(obj.count);
4047     tokens.push(obj);
4048     start = max + 1;
4049     prev = obj;
4050   }
4051
4052   return tokens;
4053 }
4054
4055 function filterPatterns(arr, comparison, prefix, intersection, options) {
4056   let result = [];
4057
4058   for (let ele of arr) {
4059     let {
4060       string
4061     } = ele; // only push if _both_ are negative...
4062
4063     if (!intersection && !contains(comparison, 'string', string)) {
4064       result.push(prefix + string);
4065     } // or _both_ are positive
4066
4067
4068     if (intersection && contains(comparison, 'string', string)) {
4069       result.push(prefix + string);
4070     }
4071   }
4072
4073   return result;
4074 }
4075 /**
4076  * Zip strings
4077  */
4078
4079
4080 function zip(a, b) {
4081   let arr = [];
4082
4083   for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]);
4084
4085   return arr;
4086 }
4087
4088 function compare(a, b) {
4089   return a > b ? 1 : b > a ? -1 : 0;
4090 }
4091
4092 function contains(arr, key, val) {
4093   return arr.some(ele => ele[key] === val);
4094 }
4095
4096 function countNines(min, len) {
4097   return Number(String(min).slice(0, -len) + '9'.repeat(len));
4098 }
4099
4100 function countZeros(integer, zeros) {
4101   return integer - integer % Math.pow(10, zeros);
4102 }
4103
4104 function toQuantifier(digits) {
4105   let [start = 0, stop = ''] = digits;
4106
4107   if (stop || start > 1) {
4108     return `{${start + (stop ? ',' + stop : '')}}`;
4109   }
4110
4111   return '';
4112 }
4113
4114 function toCharacterClass(a, b, options) {
4115   return `[${a}${b - a === 1 ? '' : '-'}${b}]`;
4116 }
4117
4118 function hasPadding(str) {
4119   return /^-?(0+)\d/.test(str);
4120 }
4121
4122 function padZeros(value, tok, options) {
4123   if (!tok.isPadded) {
4124     return value;
4125   }
4126
4127   let diff = Math.abs(tok.maxLen - String(value).length);
4128   let relax = options.relaxZeros !== false;
4129
4130   switch (diff) {
4131     case 0:
4132       return '';
4133
4134     case 1:
4135       return relax ? '0?' : '0';
4136
4137     case 2:
4138       return relax ? '0{0,2}' : '00';
4139
4140     default:
4141       {
4142         return relax ? `0{0,${diff}}` : `0{${diff}}`;
4143       }
4144   }
4145 }
4146 /**
4147  * Cache
4148  */
4149
4150
4151 toRegexRange$1.cache = {};
4152
4153 toRegexRange$1.clearCache = () => toRegexRange$1.cache = {};
4154 /**
4155  * Expose `toRegexRange`
4156  */
4157
4158
4159 var toRegexRange_1 = toRegexRange$1;
4160
4161 const util$1 = require$$0__default$2["default"];
4162 const toRegexRange = toRegexRange_1;
4163
4164 const isObject$6 = val => val !== null && typeof val === 'object' && !Array.isArray(val);
4165
4166 const transform = toNumber => {
4167   return value => toNumber === true ? Number(value) : String(value);
4168 };
4169
4170 const isValidValue = value => {
4171   return typeof value === 'number' || typeof value === 'string' && value !== '';
4172 };
4173
4174 const isNumber$1 = num => Number.isInteger(+num);
4175
4176 const zeros = input => {
4177   let value = `${input}`;
4178   let index = -1;
4179   if (value[0] === '-') value = value.slice(1);
4180   if (value === '0') return false;
4181
4182   while (value[++index] === '0');
4183
4184   return index > 0;
4185 };
4186
4187 const stringify$5 = (start, end, options) => {
4188   if (typeof start === 'string' || typeof end === 'string') {
4189     return true;
4190   }
4191
4192   return options.stringify === true;
4193 };
4194
4195 const pad = (input, maxLength, toNumber) => {
4196   if (maxLength > 0) {
4197     let dash = input[0] === '-' ? '-' : '';
4198     if (dash) input = input.slice(1);
4199     input = dash + input.padStart(dash ? maxLength - 1 : maxLength, '0');
4200   }
4201
4202   if (toNumber === false) {
4203     return String(input);
4204   }
4205
4206   return input;
4207 };
4208
4209 const toMaxLen = (input, maxLength) => {
4210   let negative = input[0] === '-' ? '-' : '';
4211
4212   if (negative) {
4213     input = input.slice(1);
4214     maxLength--;
4215   }
4216
4217   while (input.length < maxLength) input = '0' + input;
4218
4219   return negative ? '-' + input : input;
4220 };
4221
4222 const toSequence = (parts, options) => {
4223   parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
4224   parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
4225   let prefix = options.capture ? '' : '?:';
4226   let positives = '';
4227   let negatives = '';
4228   let result;
4229
4230   if (parts.positives.length) {
4231     positives = parts.positives.join('|');
4232   }
4233
4234   if (parts.negatives.length) {
4235     negatives = `-(${prefix}${parts.negatives.join('|')})`;
4236   }
4237
4238   if (positives && negatives) {
4239     result = `${positives}|${negatives}`;
4240   } else {
4241     result = positives || negatives;
4242   }
4243
4244   if (options.wrap) {
4245     return `(${prefix}${result})`;
4246   }
4247
4248   return result;
4249 };
4250
4251 const toRange = (a, b, isNumbers, options) => {
4252   if (isNumbers) {
4253     return toRegexRange(a, b, Object.assign({
4254       wrap: false
4255     }, options));
4256   }
4257
4258   let start = String.fromCharCode(a);
4259   if (a === b) return start;
4260   let stop = String.fromCharCode(b);
4261   return `[${start}-${stop}]`;
4262 };
4263
4264 const toRegex = (start, end, options) => {
4265   if (Array.isArray(start)) {
4266     let wrap = options.wrap === true;
4267     let prefix = options.capture ? '' : '?:';
4268     return wrap ? `(${prefix}${start.join('|')})` : start.join('|');
4269   }
4270
4271   return toRegexRange(start, end, options);
4272 };
4273
4274 const rangeError = (...args) => {
4275   return new RangeError('Invalid range arguments: ' + util$1.inspect(...args));
4276 };
4277
4278 const invalidRange = (start, end, options) => {
4279   if (options.strictRanges === true) throw rangeError([start, end]);
4280   return [];
4281 };
4282
4283 const invalidStep = (step, options) => {
4284   if (options.strictRanges === true) {
4285     throw new TypeError(`Expected step "${step}" to be a number`);
4286   }
4287
4288   return [];
4289 };
4290
4291 const fillNumbers = (start, end, step = 1, options = {}) => {
4292   let a = Number(start);
4293   let b = Number(end);
4294
4295   if (!Number.isInteger(a) || !Number.isInteger(b)) {
4296     if (options.strictRanges === true) throw rangeError([start, end]);
4297     return [];
4298   } // fix negative zero
4299
4300
4301   if (a === 0) a = 0;
4302   if (b === 0) b = 0;
4303   let descending = a > b;
4304   let startString = String(start);
4305   let endString = String(end);
4306   let stepString = String(step);
4307   step = Math.max(Math.abs(step), 1);
4308   let padded = zeros(startString) || zeros(endString) || zeros(stepString);
4309   let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
4310   let toNumber = padded === false && stringify$5(start, end, options) === false;
4311   let format = options.transform || transform(toNumber);
4312
4313   if (options.toRegex && step === 1) {
4314     return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options);
4315   }
4316
4317   let parts = {
4318     negatives: [],
4319     positives: []
4320   };
4321
4322   let push = num => parts[num < 0 ? 'negatives' : 'positives'].push(Math.abs(num));
4323
4324   let range = [];
4325   let index = 0;
4326
4327   while (descending ? a >= b : a <= b) {
4328     if (options.toRegex === true && step > 1) {
4329       push(a);
4330     } else {
4331       range.push(pad(format(a, index), maxLen, toNumber));
4332     }
4333
4334     a = descending ? a - step : a + step;
4335     index++;
4336   }
4337
4338   if (options.toRegex === true) {
4339     return step > 1 ? toSequence(parts, options) : toRegex(range, null, Object.assign({
4340       wrap: false
4341     }, options));
4342   }
4343
4344   return range;
4345 };
4346
4347 const fillLetters = (start, end, step = 1, options = {}) => {
4348   if (!isNumber$1(start) && start.length > 1 || !isNumber$1(end) && end.length > 1) {
4349     return invalidRange(start, end, options);
4350   }
4351
4352   let format = options.transform || (val => String.fromCharCode(val));
4353
4354   let a = `${start}`.charCodeAt(0);
4355   let b = `${end}`.charCodeAt(0);
4356   let descending = a > b;
4357   let min = Math.min(a, b);
4358   let max = Math.max(a, b);
4359
4360   if (options.toRegex && step === 1) {
4361     return toRange(min, max, false, options);
4362   }
4363
4364   let range = [];
4365   let index = 0;
4366
4367   while (descending ? a >= b : a <= b) {
4368     range.push(format(a, index));
4369     a = descending ? a - step : a + step;
4370     index++;
4371   }
4372
4373   if (options.toRegex === true) {
4374     return toRegex(range, null, {
4375       wrap: false,
4376       options
4377     });
4378   }
4379
4380   return range;
4381 };
4382
4383 const fill$2 = (start, end, step, options = {}) => {
4384   if (end == null && isValidValue(start)) {
4385     return [start];
4386   }
4387
4388   if (!isValidValue(start) || !isValidValue(end)) {
4389     return invalidRange(start, end, options);
4390   }
4391
4392   if (typeof step === 'function') {
4393     return fill$2(start, end, 1, {
4394       transform: step
4395     });
4396   }
4397
4398   if (isObject$6(step)) {
4399     return fill$2(start, end, 0, step);
4400   }
4401
4402   let opts = Object.assign({}, options);
4403   if (opts.capture === true) opts.wrap = true;
4404   step = step || opts.step || 1;
4405
4406   if (!isNumber$1(step)) {
4407     if (step != null && !isObject$6(step)) return invalidStep(step, opts);
4408     return fill$2(start, end, 1, step);
4409   }
4410
4411   if (isNumber$1(start) && isNumber$1(end)) {
4412     return fillNumbers(start, end, step, opts);
4413   }
4414
4415   return fillLetters(start, end, Math.max(Math.abs(step), 1), opts);
4416 };
4417
4418 var fillRange = fill$2;
4419
4420 const fill$1 = fillRange;
4421 const utils$h = utils$j;
4422
4423 const compile$1 = (ast, options = {}) => {
4424   let walk = (node, parent = {}) => {
4425     let invalidBlock = utils$h.isInvalidBrace(parent);
4426     let invalidNode = node.invalid === true && options.escapeInvalid === true;
4427     let invalid = invalidBlock === true || invalidNode === true;
4428     let prefix = options.escapeInvalid === true ? '\\' : '';
4429     let output = '';
4430
4431     if (node.isOpen === true) {
4432       return prefix + node.value;
4433     }
4434
4435     if (node.isClose === true) {
4436       return prefix + node.value;
4437     }
4438
4439     if (node.type === 'open') {
4440       return invalid ? prefix + node.value : '(';
4441     }
4442
4443     if (node.type === 'close') {
4444       return invalid ? prefix + node.value : ')';
4445     }
4446
4447     if (node.type === 'comma') {
4448       return node.prev.type === 'comma' ? '' : invalid ? node.value : '|';
4449     }
4450
4451     if (node.value) {
4452       return node.value;
4453     }
4454
4455     if (node.nodes && node.ranges > 0) {
4456       let args = utils$h.reduce(node.nodes);
4457       let range = fill$1(...args, Object.assign(Object.assign({}, options), {}, {
4458         wrap: false,
4459         toRegex: true
4460       }));
4461
4462       if (range.length !== 0) {
4463         return args.length > 1 && range.length > 1 ? `(${range})` : range;
4464       }
4465     }
4466
4467     if (node.nodes) {
4468       for (let child of node.nodes) {
4469         output += walk(child, node);
4470       }
4471     }
4472
4473     return output;
4474   };
4475
4476   return walk(ast);
4477 };
4478
4479 var compile_1 = compile$1;
4480
4481 const fill = fillRange;
4482 const stringify$4 = stringify$6;
4483 const utils$g = utils$j;
4484
4485 const append = (queue = '', stash = '', enclose = false) => {
4486   let result = [];
4487   queue = [].concat(queue);
4488   stash = [].concat(stash);
4489   if (!stash.length) return queue;
4490
4491   if (!queue.length) {
4492     return enclose ? utils$g.flatten(stash).map(ele => `{${ele}}`) : stash;
4493   }
4494
4495   for (let item of queue) {
4496     if (Array.isArray(item)) {
4497       for (let value of item) {
4498         result.push(append(value, stash, enclose));
4499       }
4500     } else {
4501       for (let ele of stash) {
4502         if (enclose === true && typeof ele === 'string') ele = `{${ele}}`;
4503         result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
4504       }
4505     }
4506   }
4507
4508   return utils$g.flatten(result);
4509 };
4510
4511 const expand$1 = (ast, options = {}) => {
4512   let rangeLimit = options.rangeLimit === void 0 ? 1000 : options.rangeLimit;
4513
4514   let walk = (node, parent = {}) => {
4515     node.queue = [];
4516     let p = parent;
4517     let q = parent.queue;
4518
4519     while (p.type !== 'brace' && p.type !== 'root' && p.parent) {
4520       p = p.parent;
4521       q = p.queue;
4522     }
4523
4524     if (node.invalid || node.dollar) {
4525       q.push(append(q.pop(), stringify$4(node, options)));
4526       return;
4527     }
4528
4529     if (node.type === 'brace' && node.invalid !== true && node.nodes.length === 2) {
4530       q.push(append(q.pop(), ['{}']));
4531       return;
4532     }
4533
4534     if (node.nodes && node.ranges > 0) {
4535       let args = utils$g.reduce(node.nodes);
4536
4537       if (utils$g.exceedsLimit(...args, options.step, rangeLimit)) {
4538         throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.');
4539       }
4540
4541       let range = fill(...args, options);
4542
4543       if (range.length === 0) {
4544         range = stringify$4(node, options);
4545       }
4546
4547       q.push(append(q.pop(), range));
4548       node.nodes = [];
4549       return;
4550     }
4551
4552     let enclose = utils$g.encloseBrace(node);
4553     let queue = node.queue;
4554     let block = node;
4555
4556     while (block.type !== 'brace' && block.type !== 'root' && block.parent) {
4557       block = block.parent;
4558       queue = block.queue;
4559     }
4560
4561     for (let i = 0; i < node.nodes.length; i++) {
4562       let child = node.nodes[i];
4563
4564       if (child.type === 'comma' && node.type === 'brace') {
4565         if (i === 1) queue.push('');
4566         queue.push('');
4567         continue;
4568       }
4569
4570       if (child.type === 'close') {
4571         q.push(append(q.pop(), queue, enclose));
4572         continue;
4573       }
4574
4575       if (child.value && child.type !== 'open') {
4576         queue.push(append(queue.pop(), child.value));
4577         continue;
4578       }
4579
4580       if (child.nodes) {
4581         walk(child, node);
4582       }
4583     }
4584
4585     return queue;
4586   };
4587
4588   return utils$g.flatten(walk(ast));
4589 };
4590
4591 var expand_1 = expand$1;
4592
4593 var constants$4 = {
4594   MAX_LENGTH: 1024 * 64,
4595   // Digits
4596   CHAR_0: '0',
4597
4598   /* 0 */
4599   CHAR_9: '9',
4600
4601   /* 9 */
4602   // Alphabet chars.
4603   CHAR_UPPERCASE_A: 'A',
4604
4605   /* A */
4606   CHAR_LOWERCASE_A: 'a',
4607
4608   /* a */
4609   CHAR_UPPERCASE_Z: 'Z',
4610
4611   /* Z */
4612   CHAR_LOWERCASE_Z: 'z',
4613
4614   /* z */
4615   CHAR_LEFT_PARENTHESES: '(',
4616
4617   /* ( */
4618   CHAR_RIGHT_PARENTHESES: ')',
4619
4620   /* ) */
4621   CHAR_ASTERISK: '*',
4622
4623   /* * */
4624   // Non-alphabetic chars.
4625   CHAR_AMPERSAND: '&',
4626
4627   /* & */
4628   CHAR_AT: '@',
4629
4630   /* @ */
4631   CHAR_BACKSLASH: '\\',
4632
4633   /* \ */
4634   CHAR_BACKTICK: '`',
4635
4636   /* ` */
4637   CHAR_CARRIAGE_RETURN: '\r',
4638
4639   /* \r */
4640   CHAR_CIRCUMFLEX_ACCENT: '^',
4641
4642   /* ^ */
4643   CHAR_COLON: ':',
4644
4645   /* : */
4646   CHAR_COMMA: ',',
4647
4648   /* , */
4649   CHAR_DOLLAR: '$',
4650
4651   /* . */
4652   CHAR_DOT: '.',
4653
4654   /* . */
4655   CHAR_DOUBLE_QUOTE: '"',
4656
4657   /* " */
4658   CHAR_EQUAL: '=',
4659
4660   /* = */
4661   CHAR_EXCLAMATION_MARK: '!',
4662
4663   /* ! */
4664   CHAR_FORM_FEED: '\f',
4665
4666   /* \f */
4667   CHAR_FORWARD_SLASH: '/',
4668
4669   /* / */
4670   CHAR_HASH: '#',
4671
4672   /* # */
4673   CHAR_HYPHEN_MINUS: '-',
4674
4675   /* - */
4676   CHAR_LEFT_ANGLE_BRACKET: '<',
4677
4678   /* < */
4679   CHAR_LEFT_CURLY_BRACE: '{',
4680
4681   /* { */
4682   CHAR_LEFT_SQUARE_BRACKET: '[',
4683
4684   /* [ */
4685   CHAR_LINE_FEED: '\n',
4686
4687   /* \n */
4688   CHAR_NO_BREAK_SPACE: '\u00A0',
4689
4690   /* \u00A0 */
4691   CHAR_PERCENT: '%',
4692
4693   /* % */
4694   CHAR_PLUS: '+',
4695
4696   /* + */
4697   CHAR_QUESTION_MARK: '?',
4698
4699   /* ? */
4700   CHAR_RIGHT_ANGLE_BRACKET: '>',
4701
4702   /* > */
4703   CHAR_RIGHT_CURLY_BRACE: '}',
4704
4705   /* } */
4706   CHAR_RIGHT_SQUARE_BRACKET: ']',
4707
4708   /* ] */
4709   CHAR_SEMICOLON: ';',
4710
4711   /* ; */
4712   CHAR_SINGLE_QUOTE: '\'',
4713
4714   /* ' */
4715   CHAR_SPACE: ' ',
4716
4717   /*   */
4718   CHAR_TAB: '\t',
4719
4720   /* \t */
4721   CHAR_UNDERSCORE: '_',
4722
4723   /* _ */
4724   CHAR_VERTICAL_LINE: '|',
4725
4726   /* | */
4727   CHAR_ZERO_WIDTH_NOBREAK_SPACE: '\uFEFF'
4728   /* \uFEFF */
4729
4730 };
4731
4732 const stringify$3 = stringify$6;
4733 /**
4734  * Constants
4735  */
4736
4737 const {
4738   MAX_LENGTH: MAX_LENGTH$1,
4739   CHAR_BACKSLASH,
4740
4741   /* \ */
4742   CHAR_BACKTICK,
4743
4744   /* ` */
4745   CHAR_COMMA: CHAR_COMMA$1,
4746
4747   /* , */
4748   CHAR_DOT: CHAR_DOT$1,
4749
4750   /* . */
4751   CHAR_LEFT_PARENTHESES: CHAR_LEFT_PARENTHESES$1,
4752
4753   /* ( */
4754   CHAR_RIGHT_PARENTHESES: CHAR_RIGHT_PARENTHESES$1,
4755
4756   /* ) */
4757   CHAR_LEFT_CURLY_BRACE: CHAR_LEFT_CURLY_BRACE$1,
4758
4759   /* { */
4760   CHAR_RIGHT_CURLY_BRACE: CHAR_RIGHT_CURLY_BRACE$1,
4761
4762   /* } */
4763   CHAR_LEFT_SQUARE_BRACKET: CHAR_LEFT_SQUARE_BRACKET$1,
4764
4765   /* [ */
4766   CHAR_RIGHT_SQUARE_BRACKET: CHAR_RIGHT_SQUARE_BRACKET$1,
4767
4768   /* ] */
4769   CHAR_DOUBLE_QUOTE,
4770
4771   /* " */
4772   CHAR_SINGLE_QUOTE,
4773
4774   /* ' */
4775   CHAR_NO_BREAK_SPACE,
4776   CHAR_ZERO_WIDTH_NOBREAK_SPACE
4777 } = constants$4;
4778 /**
4779  * parse
4780  */
4781
4782 const parse$4 = (input, options = {}) => {
4783   if (typeof input !== 'string') {
4784     throw new TypeError('Expected a string');
4785   }
4786
4787   let opts = options || {};
4788   let max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH$1, opts.maxLength) : MAX_LENGTH$1;
4789
4790   if (input.length > max) {
4791     throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
4792   }
4793
4794   let ast = {
4795     type: 'root',
4796     input,
4797     nodes: []
4798   };
4799   let stack = [ast];
4800   let block = ast;
4801   let prev = ast;
4802   let brackets = 0;
4803   let length = input.length;
4804   let index = 0;
4805   let depth = 0;
4806   let value;
4807   /**
4808    * Helpers
4809    */
4810
4811   const advance = () => input[index++];
4812
4813   const push = node => {
4814     if (node.type === 'text' && prev.type === 'dot') {
4815       prev.type = 'text';
4816     }
4817
4818     if (prev && prev.type === 'text' && node.type === 'text') {
4819       prev.value += node.value;
4820       return;
4821     }
4822
4823     block.nodes.push(node);
4824     node.parent = block;
4825     node.prev = prev;
4826     prev = node;
4827     return node;
4828   };
4829
4830   push({
4831     type: 'bos'
4832   });
4833
4834   while (index < length) {
4835     block = stack[stack.length - 1];
4836     value = advance();
4837     /**
4838      * Invalid chars
4839      */
4840
4841     if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
4842       continue;
4843     }
4844     /**
4845      * Escaped chars
4846      */
4847
4848
4849     if (value === CHAR_BACKSLASH) {
4850       push({
4851         type: 'text',
4852         value: (options.keepEscaping ? value : '') + advance()
4853       });
4854       continue;
4855     }
4856     /**
4857      * Right square bracket (literal): ']'
4858      */
4859
4860
4861     if (value === CHAR_RIGHT_SQUARE_BRACKET$1) {
4862       push({
4863         type: 'text',
4864         value: '\\' + value
4865       });
4866       continue;
4867     }
4868     /**
4869      * Left square bracket: '['
4870      */
4871
4872
4873     if (value === CHAR_LEFT_SQUARE_BRACKET$1) {
4874       brackets++;
4875       let next;
4876
4877       while (index < length && (next = advance())) {
4878         value += next;
4879
4880         if (next === CHAR_LEFT_SQUARE_BRACKET$1) {
4881           brackets++;
4882           continue;
4883         }
4884
4885         if (next === CHAR_BACKSLASH) {
4886           value += advance();
4887           continue;
4888         }
4889
4890         if (next === CHAR_RIGHT_SQUARE_BRACKET$1) {
4891           brackets--;
4892
4893           if (brackets === 0) {
4894             break;
4895           }
4896         }
4897       }
4898
4899       push({
4900         type: 'text',
4901         value
4902       });
4903       continue;
4904     }
4905     /**
4906      * Parentheses
4907      */
4908
4909
4910     if (value === CHAR_LEFT_PARENTHESES$1) {
4911       block = push({
4912         type: 'paren',
4913         nodes: []
4914       });
4915       stack.push(block);
4916       push({
4917         type: 'text',
4918         value
4919       });
4920       continue;
4921     }
4922
4923     if (value === CHAR_RIGHT_PARENTHESES$1) {
4924       if (block.type !== 'paren') {
4925         push({
4926           type: 'text',
4927           value
4928         });
4929         continue;
4930       }
4931
4932       block = stack.pop();
4933       push({
4934         type: 'text',
4935         value
4936       });
4937       block = stack[stack.length - 1];
4938       continue;
4939     }
4940     /**
4941      * Quotes: '|"|`
4942      */
4943
4944
4945     if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
4946       let open = value;
4947       let next;
4948
4949       if (options.keepQuotes !== true) {
4950         value = '';
4951       }
4952
4953       while (index < length && (next = advance())) {
4954         if (next === CHAR_BACKSLASH) {
4955           value += next + advance();
4956           continue;
4957         }
4958
4959         if (next === open) {
4960           if (options.keepQuotes === true) value += next;
4961           break;
4962         }
4963
4964         value += next;
4965       }
4966
4967       push({
4968         type: 'text',
4969         value
4970       });
4971       continue;
4972     }
4973     /**
4974      * Left curly brace: '{'
4975      */
4976
4977
4978     if (value === CHAR_LEFT_CURLY_BRACE$1) {
4979       depth++;
4980       let dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true;
4981       let brace = {
4982         type: 'brace',
4983         open: true,
4984         close: false,
4985         dollar,
4986         depth,
4987         commas: 0,
4988         ranges: 0,
4989         nodes: []
4990       };
4991       block = push(brace);
4992       stack.push(block);
4993       push({
4994         type: 'open',
4995         value
4996       });
4997       continue;
4998     }
4999     /**
5000      * Right curly brace: '}'
5001      */
5002
5003
5004     if (value === CHAR_RIGHT_CURLY_BRACE$1) {
5005       if (block.type !== 'brace') {
5006         push({
5007           type: 'text',
5008           value
5009         });
5010         continue;
5011       }
5012
5013       let type = 'close';
5014       block = stack.pop();
5015       block.close = true;
5016       push({
5017         type,
5018         value
5019       });
5020       depth--;
5021       block = stack[stack.length - 1];
5022       continue;
5023     }
5024     /**
5025      * Comma: ','
5026      */
5027
5028
5029     if (value === CHAR_COMMA$1 && depth > 0) {
5030       if (block.ranges > 0) {
5031         block.ranges = 0;
5032         let open = block.nodes.shift();
5033         block.nodes = [open, {
5034           type: 'text',
5035           value: stringify$3(block)
5036         }];
5037       }
5038
5039       push({
5040         type: 'comma',
5041         value
5042       });
5043       block.commas++;
5044       continue;
5045     }
5046     /**
5047      * Dot: '.'
5048      */
5049
5050
5051     if (value === CHAR_DOT$1 && depth > 0 && block.commas === 0) {
5052       let siblings = block.nodes;
5053
5054       if (depth === 0 || siblings.length === 0) {
5055         push({
5056           type: 'text',
5057           value
5058         });
5059         continue;
5060       }
5061
5062       if (prev.type === 'dot') {
5063         block.range = [];
5064         prev.value += value;
5065         prev.type = 'range';
5066
5067         if (block.nodes.length !== 3 && block.nodes.length !== 5) {
5068           block.invalid = true;
5069           block.ranges = 0;
5070           prev.type = 'text';
5071           continue;
5072         }
5073
5074         block.ranges++;
5075         block.args = [];
5076         continue;
5077       }
5078
5079       if (prev.type === 'range') {
5080         siblings.pop();
5081         let before = siblings[siblings.length - 1];
5082         before.value += prev.value + value;
5083         prev = before;
5084         block.ranges--;
5085         continue;
5086       }
5087
5088       push({
5089         type: 'dot',
5090         value
5091       });
5092       continue;
5093     }
5094     /**
5095      * Text
5096      */
5097
5098
5099     push({
5100       type: 'text',
5101       value
5102     });
5103   } // Mark imbalanced braces and brackets as invalid
5104
5105
5106   do {
5107     block = stack.pop();
5108
5109     if (block.type !== 'root') {
5110       block.nodes.forEach(node => {
5111         if (!node.nodes) {
5112           if (node.type === 'open') node.isOpen = true;
5113           if (node.type === 'close') node.isClose = true;
5114           if (!node.nodes) node.type = 'text';
5115           node.invalid = true;
5116         }
5117       }); // get the location of the block on parent.nodes (block's siblings)
5118
5119       let parent = stack[stack.length - 1];
5120       let index = parent.nodes.indexOf(block); // replace the (invalid) block with it's nodes
5121
5122       parent.nodes.splice(index, 1, ...block.nodes);
5123     }
5124   } while (stack.length > 0);
5125
5126   push({
5127     type: 'eos'
5128   });
5129   return ast;
5130 };
5131
5132 var parse_1$1 = parse$4;
5133
5134 const stringify$2 = stringify$6;
5135 const compile = compile_1;
5136 const expand = expand_1;
5137 const parse$3 = parse_1$1;
5138 /**
5139  * Expand the given pattern or create a regex-compatible string.
5140  *
5141  * ```js
5142  * const braces = require('braces');
5143  * console.log(braces('{a,b,c}', { compile: true })); //=> ['(a|b|c)']
5144  * console.log(braces('{a,b,c}')); //=> ['a', 'b', 'c']
5145  * ```
5146  * @param {String} `str`
5147  * @param {Object} `options`
5148  * @return {String}
5149  * @api public
5150  */
5151
5152 const braces$1 = (input, options = {}) => {
5153   let output = [];
5154
5155   if (Array.isArray(input)) {
5156     for (let pattern of input) {
5157       let result = braces$1.create(pattern, options);
5158
5159       if (Array.isArray(result)) {
5160         output.push(...result);
5161       } else {
5162         output.push(result);
5163       }
5164     }
5165   } else {
5166     output = [].concat(braces$1.create(input, options));
5167   }
5168
5169   if (options && options.expand === true && options.nodupes === true) {
5170     output = [...new Set(output)];
5171   }
5172
5173   return output;
5174 };
5175 /**
5176  * Parse the given `str` with the given `options`.
5177  *
5178  * ```js
5179  * // braces.parse(pattern, [, options]);
5180  * const ast = braces.parse('a/{b,c}/d');
5181  * console.log(ast);
5182  * ```
5183  * @param {String} pattern Brace pattern to parse
5184  * @param {Object} options
5185  * @return {Object} Returns an AST
5186  * @api public
5187  */
5188
5189
5190 braces$1.parse = (input, options = {}) => parse$3(input, options);
5191 /**
5192  * Creates a braces string from an AST, or an AST node.
5193  *
5194  * ```js
5195  * const braces = require('braces');
5196  * let ast = braces.parse('foo/{a,b}/bar');
5197  * console.log(stringify(ast.nodes[2])); //=> '{a,b}'
5198  * ```
5199  * @param {String} `input` Brace pattern or AST.
5200  * @param {Object} `options`
5201  * @return {Array} Returns an array of expanded values.
5202  * @api public
5203  */
5204
5205
5206 braces$1.stringify = (input, options = {}) => {
5207   if (typeof input === 'string') {
5208     return stringify$2(braces$1.parse(input, options), options);
5209   }
5210
5211   return stringify$2(input, options);
5212 };
5213 /**
5214  * Compiles a brace pattern into a regex-compatible, optimized string.
5215  * This method is called by the main [braces](#braces) function by default.
5216  *
5217  * ```js
5218  * const braces = require('braces');
5219  * console.log(braces.compile('a/{b,c}/d'));
5220  * //=> ['a/(b|c)/d']
5221  * ```
5222  * @param {String} `input` Brace pattern or AST.
5223  * @param {Object} `options`
5224  * @return {Array} Returns an array of expanded values.
5225  * @api public
5226  */
5227
5228
5229 braces$1.compile = (input, options = {}) => {
5230   if (typeof input === 'string') {
5231     input = braces$1.parse(input, options);
5232   }
5233
5234   return compile(input, options);
5235 };
5236 /**
5237  * Expands a brace pattern into an array. This method is called by the
5238  * main [braces](#braces) function when `options.expand` is true. Before
5239  * using this method it's recommended that you read the [performance notes](#performance))
5240  * and advantages of using [.compile](#compile) instead.
5241  *
5242  * ```js
5243  * const braces = require('braces');
5244  * console.log(braces.expand('a/{b,c}/d'));
5245  * //=> ['a/b/d', 'a/c/d'];
5246  * ```
5247  * @param {String} `pattern` Brace pattern
5248  * @param {Object} `options`
5249  * @return {Array} Returns an array of expanded values.
5250  * @api public
5251  */
5252
5253
5254 braces$1.expand = (input, options = {}) => {
5255   if (typeof input === 'string') {
5256     input = braces$1.parse(input, options);
5257   }
5258
5259   let result = expand(input, options); // filter out empty strings if specified
5260
5261   if (options.noempty === true) {
5262     result = result.filter(Boolean);
5263   } // filter out duplicates if specified
5264
5265
5266   if (options.nodupes === true) {
5267     result = [...new Set(result)];
5268   }
5269
5270   return result;
5271 };
5272 /**
5273  * Processes a brace pattern and returns either an expanded array
5274  * (if `options.expand` is true), a highly optimized regex-compatible string.
5275  * This method is called by the main [braces](#braces) function.
5276  *
5277  * ```js
5278  * const braces = require('braces');
5279  * console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}'))
5280  * //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)'
5281  * ```
5282  * @param {String} `pattern` Brace pattern
5283  * @param {Object} `options`
5284  * @return {Array} Returns an array of expanded values.
5285  * @api public
5286  */
5287
5288
5289 braces$1.create = (input, options = {}) => {
5290   if (input === '' || input.length < 3) {
5291     return [input];
5292   }
5293
5294   return options.expand !== true ? braces$1.compile(input, options) : braces$1.expand(input, options);
5295 };
5296 /**
5297  * Expose "braces"
5298  */
5299
5300
5301 var braces_1 = braces$1;
5302
5303 var utils$f = {};
5304
5305 const path$a = require$$0__default$1["default"];
5306 const WIN_SLASH = '\\\\/';
5307 const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
5308 /**
5309  * Posix glob regex
5310  */
5311
5312 const DOT_LITERAL = '\\.';
5313 const PLUS_LITERAL = '\\+';
5314 const QMARK_LITERAL = '\\?';
5315 const SLASH_LITERAL = '\\/';
5316 const ONE_CHAR = '(?=.)';
5317 const QMARK = '[^/]';
5318 const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
5319 const START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
5320 const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
5321 const NO_DOT = `(?!${DOT_LITERAL})`;
5322 const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
5323 const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
5324 const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
5325 const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
5326 const STAR = `${QMARK}*?`;
5327 const POSIX_CHARS = {
5328   DOT_LITERAL,
5329   PLUS_LITERAL,
5330   QMARK_LITERAL,
5331   SLASH_LITERAL,
5332   ONE_CHAR,
5333   QMARK,
5334   END_ANCHOR,
5335   DOTS_SLASH,
5336   NO_DOT,
5337   NO_DOTS,
5338   NO_DOT_SLASH,
5339   NO_DOTS_SLASH,
5340   QMARK_NO_DOT,
5341   STAR,
5342   START_ANCHOR
5343 };
5344 /**
5345  * Windows glob regex
5346  */
5347
5348 const WINDOWS_CHARS = Object.assign(Object.assign({}, POSIX_CHARS), {}, {
5349   SLASH_LITERAL: `[${WIN_SLASH}]`,
5350   QMARK: WIN_NO_SLASH,
5351   STAR: `${WIN_NO_SLASH}*?`,
5352   DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
5353   NO_DOT: `(?!${DOT_LITERAL})`,
5354   NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
5355   NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
5356   NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
5357   QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
5358   START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
5359   END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
5360 });
5361 /**
5362  * POSIX Bracket Regex
5363  */
5364
5365 const POSIX_REGEX_SOURCE$1 = {
5366   alnum: 'a-zA-Z0-9',
5367   alpha: 'a-zA-Z',
5368   ascii: '\\x00-\\x7F',
5369   blank: ' \\t',
5370   cntrl: '\\x00-\\x1F\\x7F',
5371   digit: '0-9',
5372   graph: '\\x21-\\x7E',
5373   lower: 'a-z',
5374   print: '\\x20-\\x7E ',
5375   punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~',
5376   space: ' \\t\\r\\n\\v\\f',
5377   upper: 'A-Z',
5378   word: 'A-Za-z0-9_',
5379   xdigit: 'A-Fa-f0-9'
5380 };
5381 var constants$3 = {
5382   MAX_LENGTH: 1024 * 64,
5383   POSIX_REGEX_SOURCE: POSIX_REGEX_SOURCE$1,
5384   // regular expressions
5385   REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
5386   REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
5387   REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
5388   REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
5389   REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
5390   REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
5391   // Replace globs with equivalent patterns to reduce parsing time.
5392   REPLACEMENTS: {
5393     '***': '*',
5394     '**/**': '**',
5395     '**/**/**': '**'
5396   },
5397   // Digits
5398   CHAR_0: 48,
5399
5400   /* 0 */
5401   CHAR_9: 57,
5402
5403   /* 9 */
5404   // Alphabet chars.
5405   CHAR_UPPERCASE_A: 65,
5406
5407   /* A */
5408   CHAR_LOWERCASE_A: 97,
5409
5410   /* a */
5411   CHAR_UPPERCASE_Z: 90,
5412
5413   /* Z */
5414   CHAR_LOWERCASE_Z: 122,
5415
5416   /* z */
5417   CHAR_LEFT_PARENTHESES: 40,
5418
5419   /* ( */
5420   CHAR_RIGHT_PARENTHESES: 41,
5421
5422   /* ) */
5423   CHAR_ASTERISK: 42,
5424
5425   /* * */
5426   // Non-alphabetic chars.
5427   CHAR_AMPERSAND: 38,
5428
5429   /* & */
5430   CHAR_AT: 64,
5431
5432   /* @ */
5433   CHAR_BACKWARD_SLASH: 92,
5434
5435   /* \ */
5436   CHAR_CARRIAGE_RETURN: 13,
5437
5438   /* \r */
5439   CHAR_CIRCUMFLEX_ACCENT: 94,
5440
5441   /* ^ */
5442   CHAR_COLON: 58,
5443
5444   /* : */
5445   CHAR_COMMA: 44,
5446
5447   /* , */
5448   CHAR_DOT: 46,
5449
5450   /* . */
5451   CHAR_DOUBLE_QUOTE: 34,
5452
5453   /* " */
5454   CHAR_EQUAL: 61,
5455
5456   /* = */
5457   CHAR_EXCLAMATION_MARK: 33,
5458
5459   /* ! */
5460   CHAR_FORM_FEED: 12,
5461
5462   /* \f */
5463   CHAR_FORWARD_SLASH: 47,
5464
5465   /* / */
5466   CHAR_GRAVE_ACCENT: 96,
5467
5468   /* ` */
5469   CHAR_HASH: 35,
5470
5471   /* # */
5472   CHAR_HYPHEN_MINUS: 45,
5473
5474   /* - */
5475   CHAR_LEFT_ANGLE_BRACKET: 60,
5476
5477   /* < */
5478   CHAR_LEFT_CURLY_BRACE: 123,
5479
5480   /* { */
5481   CHAR_LEFT_SQUARE_BRACKET: 91,
5482
5483   /* [ */
5484   CHAR_LINE_FEED: 10,
5485
5486   /* \n */
5487   CHAR_NO_BREAK_SPACE: 160,
5488
5489   /* \u00A0 */
5490   CHAR_PERCENT: 37,
5491
5492   /* % */
5493   CHAR_PLUS: 43,
5494
5495   /* + */
5496   CHAR_QUESTION_MARK: 63,
5497
5498   /* ? */
5499   CHAR_RIGHT_ANGLE_BRACKET: 62,
5500
5501   /* > */
5502   CHAR_RIGHT_CURLY_BRACE: 125,
5503
5504   /* } */
5505   CHAR_RIGHT_SQUARE_BRACKET: 93,
5506
5507   /* ] */
5508   CHAR_SEMICOLON: 59,
5509
5510   /* ; */
5511   CHAR_SINGLE_QUOTE: 39,
5512
5513   /* ' */
5514   CHAR_SPACE: 32,
5515
5516   /*   */
5517   CHAR_TAB: 9,
5518
5519   /* \t */
5520   CHAR_UNDERSCORE: 95,
5521
5522   /* _ */
5523   CHAR_VERTICAL_LINE: 124,
5524
5525   /* | */
5526   CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
5527
5528   /* \uFEFF */
5529   SEP: path$a.sep,
5530
5531   /**
5532    * Create EXTGLOB_CHARS
5533    */
5534   extglobChars(chars) {
5535     return {
5536       '!': {
5537         type: 'negate',
5538         open: '(?:(?!(?:',
5539         close: `))${chars.STAR})`
5540       },
5541       '?': {
5542         type: 'qmark',
5543         open: '(?:',
5544         close: ')?'
5545       },
5546       '+': {
5547         type: 'plus',
5548         open: '(?:',
5549         close: ')+'
5550       },
5551       '*': {
5552         type: 'star',
5553         open: '(?:',
5554         close: ')*'
5555       },
5556       '@': {
5557         type: 'at',
5558         open: '(?:',
5559         close: ')'
5560       }
5561     };
5562   },
5563
5564   /**
5565    * Create GLOB_CHARS
5566    */
5567   globChars(win32) {
5568     return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
5569   }
5570
5571 };
5572
5573 (function (exports) {
5574
5575   const path = require$$0__default$1["default"];
5576   const win32 = process.platform === 'win32';
5577   const {
5578     REGEX_BACKSLASH,
5579     REGEX_REMOVE_BACKSLASH,
5580     REGEX_SPECIAL_CHARS,
5581     REGEX_SPECIAL_CHARS_GLOBAL
5582   } = constants$3;
5583
5584   exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
5585
5586   exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str);
5587
5588   exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str);
5589
5590   exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1');
5591
5592   exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/');
5593
5594   exports.removeBackslashes = str => {
5595     return str.replace(REGEX_REMOVE_BACKSLASH, match => {
5596       return match === '\\' ? '' : match;
5597     });
5598   };
5599
5600   exports.supportsLookbehinds = () => {
5601     const segs = process.version.slice(1).split('.').map(Number);
5602
5603     if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) {
5604       return true;
5605     }
5606
5607     return false;
5608   };
5609
5610   exports.isWindows = options => {
5611     if (options && typeof options.windows === 'boolean') {
5612       return options.windows;
5613     }
5614
5615     return win32 === true || path.sep === '\\';
5616   };
5617
5618   exports.escapeLast = (input, char, lastIdx) => {
5619     const idx = input.lastIndexOf(char, lastIdx);
5620     if (idx === -1) return input;
5621     if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1);
5622     return `${input.slice(0, idx)}\\${input.slice(idx)}`;
5623   };
5624
5625   exports.removePrefix = (input, state = {}) => {
5626     let output = input;
5627
5628     if (output.startsWith('./')) {
5629       output = output.slice(2);
5630       state.prefix = './';
5631     }
5632
5633     return output;
5634   };
5635
5636   exports.wrapOutput = (input, state = {}, options = {}) => {
5637     const prepend = options.contains ? '' : '^';
5638     const append = options.contains ? '' : '$';
5639     let output = `${prepend}(?:${input})${append}`;
5640
5641     if (state.negated === true) {
5642       output = `(?:^(?!${output}).*$)`;
5643     }
5644
5645     return output;
5646   };
5647 })(utils$f);
5648
5649 const utils$e = utils$f;
5650 const {
5651   CHAR_ASTERISK,
5652
5653   /* * */
5654   CHAR_AT,
5655
5656   /* @ */
5657   CHAR_BACKWARD_SLASH,
5658
5659   /* \ */
5660   CHAR_COMMA,
5661
5662   /* , */
5663   CHAR_DOT,
5664
5665   /* . */
5666   CHAR_EXCLAMATION_MARK,
5667
5668   /* ! */
5669   CHAR_FORWARD_SLASH,
5670
5671   /* / */
5672   CHAR_LEFT_CURLY_BRACE,
5673
5674   /* { */
5675   CHAR_LEFT_PARENTHESES,
5676
5677   /* ( */
5678   CHAR_LEFT_SQUARE_BRACKET,
5679
5680   /* [ */
5681   CHAR_PLUS,
5682
5683   /* + */
5684   CHAR_QUESTION_MARK,
5685
5686   /* ? */
5687   CHAR_RIGHT_CURLY_BRACE,
5688
5689   /* } */
5690   CHAR_RIGHT_PARENTHESES,
5691
5692   /* ) */
5693   CHAR_RIGHT_SQUARE_BRACKET
5694   /* ] */
5695
5696 } = constants$3;
5697
5698 const isPathSeparator = code => {
5699   return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
5700 };
5701
5702 const depth = token => {
5703   if (token.isPrefix !== true) {
5704     token.depth = token.isGlobstar ? Infinity : 1;
5705   }
5706 };
5707 /**
5708  * Quickly scans a glob pattern and returns an object with a handful of
5709  * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),
5710  * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not
5711  * with `!(`) and `negatedExtglob` (true if the path starts with `!(`).
5712  *
5713  * ```js
5714  * const pm = require('picomatch');
5715  * console.log(pm.scan('foo/bar/*.js'));
5716  * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }
5717  * ```
5718  * @param {String} `str`
5719  * @param {Object} `options`
5720  * @return {Object} Returns an object with tokens and regex source string.
5721  * @api public
5722  */
5723
5724
5725 const scan$1 = (input, options) => {
5726   const opts = options || {};
5727   const length = input.length - 1;
5728   const scanToEnd = opts.parts === true || opts.scanToEnd === true;
5729   const slashes = [];
5730   const tokens = [];
5731   const parts = [];
5732   let str = input;
5733   let index = -1;
5734   let start = 0;
5735   let lastIndex = 0;
5736   let isBrace = false;
5737   let isBracket = false;
5738   let isGlob = false;
5739   let isExtglob = false;
5740   let isGlobstar = false;
5741   let braceEscaped = false;
5742   let backslashes = false;
5743   let negated = false;
5744   let negatedExtglob = false;
5745   let finished = false;
5746   let braces = 0;
5747   let prev;
5748   let code;
5749   let token = {
5750     value: '',
5751     depth: 0,
5752     isGlob: false
5753   };
5754
5755   const eos = () => index >= length;
5756
5757   const peek = () => str.charCodeAt(index + 1);
5758
5759   const advance = () => {
5760     prev = code;
5761     return str.charCodeAt(++index);
5762   };
5763
5764   while (index < length) {
5765     code = advance();
5766     let next;
5767
5768     if (code === CHAR_BACKWARD_SLASH) {
5769       backslashes = token.backslashes = true;
5770       code = advance();
5771
5772       if (code === CHAR_LEFT_CURLY_BRACE) {
5773         braceEscaped = true;
5774       }
5775
5776       continue;
5777     }
5778
5779     if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
5780       braces++;
5781
5782       while (eos() !== true && (code = advance())) {
5783         if (code === CHAR_BACKWARD_SLASH) {
5784           backslashes = token.backslashes = true;
5785           advance();
5786           continue;
5787         }
5788
5789         if (code === CHAR_LEFT_CURLY_BRACE) {
5790           braces++;
5791           continue;
5792         }
5793
5794         if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
5795           isBrace = token.isBrace = true;
5796           isGlob = token.isGlob = true;
5797           finished = true;
5798
5799           if (scanToEnd === true) {
5800             continue;
5801           }
5802
5803           break;
5804         }
5805
5806         if (braceEscaped !== true && code === CHAR_COMMA) {
5807           isBrace = token.isBrace = true;
5808           isGlob = token.isGlob = true;
5809           finished = true;
5810
5811           if (scanToEnd === true) {
5812             continue;
5813           }
5814
5815           break;
5816         }
5817
5818         if (code === CHAR_RIGHT_CURLY_BRACE) {
5819           braces--;
5820
5821           if (braces === 0) {
5822             braceEscaped = false;
5823             isBrace = token.isBrace = true;
5824             finished = true;
5825             break;
5826           }
5827         }
5828       }
5829
5830       if (scanToEnd === true) {
5831         continue;
5832       }
5833
5834       break;
5835     }
5836
5837     if (code === CHAR_FORWARD_SLASH) {
5838       slashes.push(index);
5839       tokens.push(token);
5840       token = {
5841         value: '',
5842         depth: 0,
5843         isGlob: false
5844       };
5845       if (finished === true) continue;
5846
5847       if (prev === CHAR_DOT && index === start + 1) {
5848         start += 2;
5849         continue;
5850       }
5851
5852       lastIndex = index + 1;
5853       continue;
5854     }
5855
5856     if (opts.noext !== true) {
5857       const isExtglobChar = code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK;
5858
5859       if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
5860         isGlob = token.isGlob = true;
5861         isExtglob = token.isExtglob = true;
5862         finished = true;
5863
5864         if (code === CHAR_EXCLAMATION_MARK && index === start) {
5865           negatedExtglob = true;
5866         }
5867
5868         if (scanToEnd === true) {
5869           while (eos() !== true && (code = advance())) {
5870             if (code === CHAR_BACKWARD_SLASH) {
5871               backslashes = token.backslashes = true;
5872               code = advance();
5873               continue;
5874             }
5875
5876             if (code === CHAR_RIGHT_PARENTHESES) {
5877               isGlob = token.isGlob = true;
5878               finished = true;
5879               break;
5880             }
5881           }
5882
5883           continue;
5884         }
5885
5886         break;
5887       }
5888     }
5889
5890     if (code === CHAR_ASTERISK) {
5891       if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
5892       isGlob = token.isGlob = true;
5893       finished = true;
5894
5895       if (scanToEnd === true) {
5896         continue;
5897       }
5898
5899       break;
5900     }
5901
5902     if (code === CHAR_QUESTION_MARK) {
5903       isGlob = token.isGlob = true;
5904       finished = true;
5905
5906       if (scanToEnd === true) {
5907         continue;
5908       }
5909
5910       break;
5911     }
5912
5913     if (code === CHAR_LEFT_SQUARE_BRACKET) {
5914       while (eos() !== true && (next = advance())) {
5915         if (next === CHAR_BACKWARD_SLASH) {
5916           backslashes = token.backslashes = true;
5917           advance();
5918           continue;
5919         }
5920
5921         if (next === CHAR_RIGHT_SQUARE_BRACKET) {
5922           isBracket = token.isBracket = true;
5923           isGlob = token.isGlob = true;
5924           finished = true;
5925           break;
5926         }
5927       }
5928
5929       if (scanToEnd === true) {
5930         continue;
5931       }
5932
5933       break;
5934     }
5935
5936     if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
5937       negated = token.negated = true;
5938       start++;
5939       continue;
5940     }
5941
5942     if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
5943       isGlob = token.isGlob = true;
5944
5945       if (scanToEnd === true) {
5946         while (eos() !== true && (code = advance())) {
5947           if (code === CHAR_LEFT_PARENTHESES) {
5948             backslashes = token.backslashes = true;
5949             code = advance();
5950             continue;
5951           }
5952
5953           if (code === CHAR_RIGHT_PARENTHESES) {
5954             finished = true;
5955             break;
5956           }
5957         }
5958
5959         continue;
5960       }
5961
5962       break;
5963     }
5964
5965     if (isGlob === true) {
5966       finished = true;
5967
5968       if (scanToEnd === true) {
5969         continue;
5970       }
5971
5972       break;
5973     }
5974   }
5975
5976   if (opts.noext === true) {
5977     isExtglob = false;
5978     isGlob = false;
5979   }
5980
5981   let base = str;
5982   let prefix = '';
5983   let glob = '';
5984
5985   if (start > 0) {
5986     prefix = str.slice(0, start);
5987     str = str.slice(start);
5988     lastIndex -= start;
5989   }
5990
5991   if (base && isGlob === true && lastIndex > 0) {
5992     base = str.slice(0, lastIndex);
5993     glob = str.slice(lastIndex);
5994   } else if (isGlob === true) {
5995     base = '';
5996     glob = str;
5997   } else {
5998     base = str;
5999   }
6000
6001   if (base && base !== '' && base !== '/' && base !== str) {
6002     if (isPathSeparator(base.charCodeAt(base.length - 1))) {
6003       base = base.slice(0, -1);
6004     }
6005   }
6006
6007   if (opts.unescape === true) {
6008     if (glob) glob = utils$e.removeBackslashes(glob);
6009
6010     if (base && backslashes === true) {
6011       base = utils$e.removeBackslashes(base);
6012     }
6013   }
6014
6015   const state = {
6016     prefix,
6017     input,
6018     start,
6019     base,
6020     glob,
6021     isBrace,
6022     isBracket,
6023     isGlob,
6024     isExtglob,
6025     isGlobstar,
6026     negated,
6027     negatedExtglob
6028   };
6029
6030   if (opts.tokens === true) {
6031     state.maxDepth = 0;
6032
6033     if (!isPathSeparator(code)) {
6034       tokens.push(token);
6035     }
6036
6037     state.tokens = tokens;
6038   }
6039
6040   if (opts.parts === true || opts.tokens === true) {
6041     let prevIndex;
6042
6043     for (let idx = 0; idx < slashes.length; idx++) {
6044       const n = prevIndex ? prevIndex + 1 : start;
6045       const i = slashes[idx];
6046       const value = input.slice(n, i);
6047
6048       if (opts.tokens) {
6049         if (idx === 0 && start !== 0) {
6050           tokens[idx].isPrefix = true;
6051           tokens[idx].value = prefix;
6052         } else {
6053           tokens[idx].value = value;
6054         }
6055
6056         depth(tokens[idx]);
6057         state.maxDepth += tokens[idx].depth;
6058       }
6059
6060       if (idx !== 0 || value !== '') {
6061         parts.push(value);
6062       }
6063
6064       prevIndex = i;
6065     }
6066
6067     if (prevIndex && prevIndex + 1 < input.length) {
6068       const value = input.slice(prevIndex + 1);
6069       parts.push(value);
6070
6071       if (opts.tokens) {
6072         tokens[tokens.length - 1].value = value;
6073         depth(tokens[tokens.length - 1]);
6074         state.maxDepth += tokens[tokens.length - 1].depth;
6075       }
6076     }
6077
6078     state.slashes = slashes;
6079     state.parts = parts;
6080   }
6081
6082   return state;
6083 };
6084
6085 var scan_1 = scan$1;
6086
6087 const constants$2 = constants$3;
6088 const utils$d = utils$f;
6089 /**
6090  * Constants
6091  */
6092
6093 const {
6094   MAX_LENGTH,
6095   POSIX_REGEX_SOURCE,
6096   REGEX_NON_SPECIAL_CHARS,
6097   REGEX_SPECIAL_CHARS_BACKREF,
6098   REPLACEMENTS
6099 } = constants$2;
6100 /**
6101  * Helpers
6102  */
6103
6104 const expandRange = (args, options) => {
6105   if (typeof options.expandRange === 'function') {
6106     return options.expandRange(...args, options);
6107   }
6108
6109   args.sort();
6110   const value = `[${args.join('-')}]`;
6111
6112   try {
6113     /* eslint-disable-next-line no-new */
6114     new RegExp(value);
6115   } catch (ex) {
6116     return args.map(v => utils$d.escapeRegex(v)).join('..');
6117   }
6118
6119   return value;
6120 };
6121 /**
6122  * Create the message for a syntax error
6123  */
6124
6125
6126 const syntaxError = (type, char) => {
6127   return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
6128 };
6129 /**
6130  * Parse the given input string.
6131  * @param {String} input
6132  * @param {Object} options
6133  * @return {Object}
6134  */
6135
6136
6137 const parse$2 = (input, options) => {
6138   if (typeof input !== 'string') {
6139     throw new TypeError('Expected a string');
6140   }
6141
6142   input = REPLACEMENTS[input] || input;
6143   const opts = Object.assign({}, options);
6144   const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
6145   let len = input.length;
6146
6147   if (len > max) {
6148     throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
6149   }
6150
6151   const bos = {
6152     type: 'bos',
6153     value: '',
6154     output: opts.prepend || ''
6155   };
6156   const tokens = [bos];
6157   const capture = opts.capture ? '' : '?:';
6158   const win32 = utils$d.isWindows(options); // create constants based on platform, for windows or posix
6159
6160   const PLATFORM_CHARS = constants$2.globChars(win32);
6161   const EXTGLOB_CHARS = constants$2.extglobChars(PLATFORM_CHARS);
6162   const {
6163     DOT_LITERAL,
6164     PLUS_LITERAL,
6165     SLASH_LITERAL,
6166     ONE_CHAR,
6167     DOTS_SLASH,
6168     NO_DOT,
6169     NO_DOT_SLASH,
6170     NO_DOTS_SLASH,
6171     QMARK,
6172     QMARK_NO_DOT,
6173     STAR,
6174     START_ANCHOR
6175   } = PLATFORM_CHARS;
6176
6177   const globstar = opts => {
6178     return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
6179   };
6180
6181   const nodot = opts.dot ? '' : NO_DOT;
6182   const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
6183   let star = opts.bash === true ? globstar(opts) : STAR;
6184
6185   if (opts.capture) {
6186     star = `(${star})`;
6187   } // minimatch options support
6188
6189
6190   if (typeof opts.noext === 'boolean') {
6191     opts.noextglob = opts.noext;
6192   }
6193
6194   const state = {
6195     input,
6196     index: -1,
6197     start: 0,
6198     dot: opts.dot === true,
6199     consumed: '',
6200     output: '',
6201     prefix: '',
6202     backtrack: false,
6203     negated: false,
6204     brackets: 0,
6205     braces: 0,
6206     parens: 0,
6207     quotes: 0,
6208     globstar: false,
6209     tokens
6210   };
6211   input = utils$d.removePrefix(input, state);
6212   len = input.length;
6213   const extglobs = [];
6214   const braces = [];
6215   const stack = [];
6216   let prev = bos;
6217   let value;
6218   /**
6219    * Tokenizing helpers
6220    */
6221
6222   const eos = () => state.index === len - 1;
6223
6224   const peek = state.peek = (n = 1) => input[state.index + n];
6225
6226   const advance = state.advance = () => input[++state.index] || '';
6227
6228   const remaining = () => input.slice(state.index + 1);
6229
6230   const consume = (value = '', num = 0) => {
6231     state.consumed += value;
6232     state.index += num;
6233   };
6234
6235   const append = token => {
6236     state.output += token.output != null ? token.output : token.value;
6237     consume(token.value);
6238   };
6239
6240   const negate = () => {
6241     let count = 1;
6242
6243     while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) {
6244       advance();
6245       state.start++;
6246       count++;
6247     }
6248
6249     if (count % 2 === 0) {
6250       return false;
6251     }
6252
6253     state.negated = true;
6254     state.start++;
6255     return true;
6256   };
6257
6258   const increment = type => {
6259     state[type]++;
6260     stack.push(type);
6261   };
6262
6263   const decrement = type => {
6264     state[type]--;
6265     stack.pop();
6266   };
6267   /**
6268    * Push tokens onto the tokens array. This helper speeds up
6269    * tokenizing by 1) helping us avoid backtracking as much as possible,
6270    * and 2) helping us avoid creating extra tokens when consecutive
6271    * characters are plain text. This improves performance and simplifies
6272    * lookbehinds.
6273    */
6274
6275
6276   const push = tok => {
6277     if (prev.type === 'globstar') {
6278       const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace');
6279       const isExtglob = tok.extglob === true || extglobs.length && (tok.type === 'pipe' || tok.type === 'paren');
6280
6281       if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) {
6282         state.output = state.output.slice(0, -prev.output.length);
6283         prev.type = 'star';
6284         prev.value = '*';
6285         prev.output = star;
6286         state.output += prev.output;
6287       }
6288     }
6289
6290     if (extglobs.length && tok.type !== 'paren') {
6291       extglobs[extglobs.length - 1].inner += tok.value;
6292     }
6293
6294     if (tok.value || tok.output) append(tok);
6295
6296     if (prev && prev.type === 'text' && tok.type === 'text') {
6297       prev.value += tok.value;
6298       prev.output = (prev.output || '') + tok.value;
6299       return;
6300     }
6301
6302     tok.prev = prev;
6303     tokens.push(tok);
6304     prev = tok;
6305   };
6306
6307   const extglobOpen = (type, value) => {
6308     const token = Object.assign(Object.assign({}, EXTGLOB_CHARS[value]), {}, {
6309       conditions: 1,
6310       inner: ''
6311     });
6312     token.prev = prev;
6313     token.parens = state.parens;
6314     token.output = state.output;
6315     const output = (opts.capture ? '(' : '') + token.open;
6316     increment('parens');
6317     push({
6318       type,
6319       value,
6320       output: state.output ? '' : ONE_CHAR
6321     });
6322     push({
6323       type: 'paren',
6324       extglob: true,
6325       value: advance(),
6326       output
6327     });
6328     extglobs.push(token);
6329   };
6330
6331   const extglobClose = token => {
6332     let output = token.close + (opts.capture ? ')' : '');
6333     let rest;
6334
6335     if (token.type === 'negate') {
6336       let extglobStar = star;
6337
6338       if (token.inner && token.inner.length > 1 && token.inner.includes('/')) {
6339         extglobStar = globstar(opts);
6340       }
6341
6342       if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
6343         output = token.close = `)$))${extglobStar}`;
6344       }
6345
6346       if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
6347         output = token.close = `)${rest})${extglobStar})`;
6348       }
6349
6350       if (token.prev.type === 'bos') {
6351         state.negatedExtglob = true;
6352       }
6353     }
6354
6355     push({
6356       type: 'paren',
6357       extglob: true,
6358       value,
6359       output
6360     });
6361     decrement('parens');
6362   };
6363   /**
6364    * Fast paths
6365    */
6366
6367
6368   if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
6369     let backslashes = false;
6370     let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
6371       if (first === '\\') {
6372         backslashes = true;
6373         return m;
6374       }
6375
6376       if (first === '?') {
6377         if (esc) {
6378           return esc + first + (rest ? QMARK.repeat(rest.length) : '');
6379         }
6380
6381         if (index === 0) {
6382           return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : '');
6383         }
6384
6385         return QMARK.repeat(chars.length);
6386       }
6387
6388       if (first === '.') {
6389         return DOT_LITERAL.repeat(chars.length);
6390       }
6391
6392       if (first === '*') {
6393         if (esc) {
6394           return esc + first + (rest ? star : '');
6395         }
6396
6397         return star;
6398       }
6399
6400       return esc ? m : `\\${m}`;
6401     });
6402
6403     if (backslashes === true) {
6404       if (opts.unescape === true) {
6405         output = output.replace(/\\/g, '');
6406       } else {
6407         output = output.replace(/\\+/g, m => {
6408           return m.length % 2 === 0 ? '\\\\' : m ? '\\' : '';
6409         });
6410       }
6411     }
6412
6413     if (output === input && opts.contains === true) {
6414       state.output = input;
6415       return state;
6416     }
6417
6418     state.output = utils$d.wrapOutput(output, state, options);
6419     return state;
6420   }
6421   /**
6422    * Tokenize input until we reach end-of-string
6423    */
6424
6425
6426   while (!eos()) {
6427     value = advance();
6428
6429     if (value === '\u0000') {
6430       continue;
6431     }
6432     /**
6433      * Escaped characters
6434      */
6435
6436
6437     if (value === '\\') {
6438       const next = peek();
6439
6440       if (next === '/' && opts.bash !== true) {
6441         continue;
6442       }
6443
6444       if (next === '.' || next === ';') {
6445         continue;
6446       }
6447
6448       if (!next) {
6449         value += '\\';
6450         push({
6451           type: 'text',
6452           value
6453         });
6454         continue;
6455       } // collapse slashes to reduce potential for exploits
6456
6457
6458       const match = /^\\+/.exec(remaining());
6459       let slashes = 0;
6460
6461       if (match && match[0].length > 2) {
6462         slashes = match[0].length;
6463         state.index += slashes;
6464
6465         if (slashes % 2 !== 0) {
6466           value += '\\';
6467         }
6468       }
6469
6470       if (opts.unescape === true) {
6471         value = advance();
6472       } else {
6473         value += advance();
6474       }
6475
6476       if (state.brackets === 0) {
6477         push({
6478           type: 'text',
6479           value
6480         });
6481         continue;
6482       }
6483     }
6484     /**
6485      * If we're inside a regex character class, continue
6486      * until we reach the closing bracket.
6487      */
6488
6489
6490     if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) {
6491       if (opts.posix !== false && value === ':') {
6492         const inner = prev.value.slice(1);
6493
6494         if (inner.includes('[')) {
6495           prev.posix = true;
6496
6497           if (inner.includes(':')) {
6498             const idx = prev.value.lastIndexOf('[');
6499             const pre = prev.value.slice(0, idx);
6500             const rest = prev.value.slice(idx + 2);
6501             const posix = POSIX_REGEX_SOURCE[rest];
6502
6503             if (posix) {
6504               prev.value = pre + posix;
6505               state.backtrack = true;
6506               advance();
6507
6508               if (!bos.output && tokens.indexOf(prev) === 1) {
6509                 bos.output = ONE_CHAR;
6510               }
6511
6512               continue;
6513             }
6514           }
6515         }
6516       }
6517
6518       if (value === '[' && peek() !== ':' || value === '-' && peek() === ']') {
6519         value = `\\${value}`;
6520       }
6521
6522       if (value === ']' && (prev.value === '[' || prev.value === '[^')) {
6523         value = `\\${value}`;
6524       }
6525
6526       if (opts.posix === true && value === '!' && prev.value === '[') {
6527         value = '^';
6528       }
6529
6530       prev.value += value;
6531       append({
6532         value
6533       });
6534       continue;
6535     }
6536     /**
6537      * If we're inside a quoted string, continue
6538      * until we reach the closing double quote.
6539      */
6540
6541
6542     if (state.quotes === 1 && value !== '"') {
6543       value = utils$d.escapeRegex(value);
6544       prev.value += value;
6545       append({
6546         value
6547       });
6548       continue;
6549     }
6550     /**
6551      * Double quotes
6552      */
6553
6554
6555     if (value === '"') {
6556       state.quotes = state.quotes === 1 ? 0 : 1;
6557
6558       if (opts.keepQuotes === true) {
6559         push({
6560           type: 'text',
6561           value
6562         });
6563       }
6564
6565       continue;
6566     }
6567     /**
6568      * Parentheses
6569      */
6570
6571
6572     if (value === '(') {
6573       increment('parens');
6574       push({
6575         type: 'paren',
6576         value
6577       });
6578       continue;
6579     }
6580
6581     if (value === ')') {
6582       if (state.parens === 0 && opts.strictBrackets === true) {
6583         throw new SyntaxError(syntaxError('opening', '('));
6584       }
6585
6586       const extglob = extglobs[extglobs.length - 1];
6587
6588       if (extglob && state.parens === extglob.parens + 1) {
6589         extglobClose(extglobs.pop());
6590         continue;
6591       }
6592
6593       push({
6594         type: 'paren',
6595         value,
6596         output: state.parens ? ')' : '\\)'
6597       });
6598       decrement('parens');
6599       continue;
6600     }
6601     /**
6602      * Square brackets
6603      */
6604
6605
6606     if (value === '[') {
6607       if (opts.nobracket === true || !remaining().includes(']')) {
6608         if (opts.nobracket !== true && opts.strictBrackets === true) {
6609           throw new SyntaxError(syntaxError('closing', ']'));
6610         }
6611
6612         value = `\\${value}`;
6613       } else {
6614         increment('brackets');
6615       }
6616
6617       push({
6618         type: 'bracket',
6619         value
6620       });
6621       continue;
6622     }
6623
6624     if (value === ']') {
6625       if (opts.nobracket === true || prev && prev.type === 'bracket' && prev.value.length === 1) {
6626         push({
6627           type: 'text',
6628           value,
6629           output: `\\${value}`
6630         });
6631         continue;
6632       }
6633
6634       if (state.brackets === 0) {
6635         if (opts.strictBrackets === true) {
6636           throw new SyntaxError(syntaxError('opening', '['));
6637         }
6638
6639         push({
6640           type: 'text',
6641           value,
6642           output: `\\${value}`
6643         });
6644         continue;
6645       }
6646
6647       decrement('brackets');
6648       const prevValue = prev.value.slice(1);
6649
6650       if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) {
6651         value = `/${value}`;
6652       }
6653
6654       prev.value += value;
6655       append({
6656         value
6657       }); // when literal brackets are explicitly disabled
6658       // assume we should match with a regex character class
6659
6660       if (opts.literalBrackets === false || utils$d.hasRegexChars(prevValue)) {
6661         continue;
6662       }
6663
6664       const escaped = utils$d.escapeRegex(prev.value);
6665       state.output = state.output.slice(0, -prev.value.length); // when literal brackets are explicitly enabled
6666       // assume we should escape the brackets to match literal characters
6667
6668       if (opts.literalBrackets === true) {
6669         state.output += escaped;
6670         prev.value = escaped;
6671         continue;
6672       } // when the user specifies nothing, try to match both
6673
6674
6675       prev.value = `(${capture}${escaped}|${prev.value})`;
6676       state.output += prev.value;
6677       continue;
6678     }
6679     /**
6680      * Braces
6681      */
6682
6683
6684     if (value === '{' && opts.nobrace !== true) {
6685       increment('braces');
6686       const open = {
6687         type: 'brace',
6688         value,
6689         output: '(',
6690         outputIndex: state.output.length,
6691         tokensIndex: state.tokens.length
6692       };
6693       braces.push(open);
6694       push(open);
6695       continue;
6696     }
6697
6698     if (value === '}') {
6699       const brace = braces[braces.length - 1];
6700
6701       if (opts.nobrace === true || !brace) {
6702         push({
6703           type: 'text',
6704           value,
6705           output: value
6706         });
6707         continue;
6708       }
6709
6710       let output = ')';
6711
6712       if (brace.dots === true) {
6713         const arr = tokens.slice();
6714         const range = [];
6715
6716         for (let i = arr.length - 1; i >= 0; i--) {
6717           tokens.pop();
6718
6719           if (arr[i].type === 'brace') {
6720             break;
6721           }
6722
6723           if (arr[i].type !== 'dots') {
6724             range.unshift(arr[i].value);
6725           }
6726         }
6727
6728         output = expandRange(range, opts);
6729         state.backtrack = true;
6730       }
6731
6732       if (brace.comma !== true && brace.dots !== true) {
6733         const out = state.output.slice(0, brace.outputIndex);
6734         const toks = state.tokens.slice(brace.tokensIndex);
6735         brace.value = brace.output = '\\{';
6736         value = output = '\\}';
6737         state.output = out;
6738
6739         for (const t of toks) {
6740           state.output += t.output || t.value;
6741         }
6742       }
6743
6744       push({
6745         type: 'brace',
6746         value,
6747         output
6748       });
6749       decrement('braces');
6750       braces.pop();
6751       continue;
6752     }
6753     /**
6754      * Pipes
6755      */
6756
6757
6758     if (value === '|') {
6759       if (extglobs.length > 0) {
6760         extglobs[extglobs.length - 1].conditions++;
6761       }
6762
6763       push({
6764         type: 'text',
6765         value
6766       });
6767       continue;
6768     }
6769     /**
6770      * Commas
6771      */
6772
6773
6774     if (value === ',') {
6775       let output = value;
6776       const brace = braces[braces.length - 1];
6777
6778       if (brace && stack[stack.length - 1] === 'braces') {
6779         brace.comma = true;
6780         output = '|';
6781       }
6782
6783       push({
6784         type: 'comma',
6785         value,
6786         output
6787       });
6788       continue;
6789     }
6790     /**
6791      * Slashes
6792      */
6793
6794
6795     if (value === '/') {
6796       // if the beginning of the glob is "./", advance the start
6797       // to the current index, and don't add the "./" characters
6798       // to the state. This greatly simplifies lookbehinds when
6799       // checking for BOS characters like "!" and "." (not "./")
6800       if (prev.type === 'dot' && state.index === state.start + 1) {
6801         state.start = state.index + 1;
6802         state.consumed = '';
6803         state.output = '';
6804         tokens.pop();
6805         prev = bos; // reset "prev" to the first token
6806
6807         continue;
6808       }
6809
6810       push({
6811         type: 'slash',
6812         value,
6813         output: SLASH_LITERAL
6814       });
6815       continue;
6816     }
6817     /**
6818      * Dots
6819      */
6820
6821
6822     if (value === '.') {
6823       if (state.braces > 0 && prev.type === 'dot') {
6824         if (prev.value === '.') prev.output = DOT_LITERAL;
6825         const brace = braces[braces.length - 1];
6826         prev.type = 'dots';
6827         prev.output += value;
6828         prev.value += value;
6829         brace.dots = true;
6830         continue;
6831       }
6832
6833       if (state.braces + state.parens === 0 && prev.type !== 'bos' && prev.type !== 'slash') {
6834         push({
6835           type: 'text',
6836           value,
6837           output: DOT_LITERAL
6838         });
6839         continue;
6840       }
6841
6842       push({
6843         type: 'dot',
6844         value,
6845         output: DOT_LITERAL
6846       });
6847       continue;
6848     }
6849     /**
6850      * Question marks
6851      */
6852
6853
6854     if (value === '?') {
6855       const isGroup = prev && prev.value === '(';
6856
6857       if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
6858         extglobOpen('qmark', value);
6859         continue;
6860       }
6861
6862       if (prev && prev.type === 'paren') {
6863         const next = peek();
6864         let output = value;
6865
6866         if (next === '<' && !utils$d.supportsLookbehinds()) {
6867           throw new Error('Node.js v10 or higher is required for regex lookbehinds');
6868         }
6869
6870         if (prev.value === '(' && !/[!=<:]/.test(next) || next === '<' && !/<([!=]|\w+>)/.test(remaining())) {
6871           output = `\\${value}`;
6872         }
6873
6874         push({
6875           type: 'text',
6876           value,
6877           output
6878         });
6879         continue;
6880       }
6881
6882       if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) {
6883         push({
6884           type: 'qmark',
6885           value,
6886           output: QMARK_NO_DOT
6887         });
6888         continue;
6889       }
6890
6891       push({
6892         type: 'qmark',
6893         value,
6894         output: QMARK
6895       });
6896       continue;
6897     }
6898     /**
6899      * Exclamation
6900      */
6901
6902
6903     if (value === '!') {
6904       if (opts.noextglob !== true && peek() === '(') {
6905         if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) {
6906           extglobOpen('negate', value);
6907           continue;
6908         }
6909       }
6910
6911       if (opts.nonegate !== true && state.index === 0) {
6912         negate();
6913         continue;
6914       }
6915     }
6916     /**
6917      * Plus
6918      */
6919
6920
6921     if (value === '+') {
6922       if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
6923         extglobOpen('plus', value);
6924         continue;
6925       }
6926
6927       if (prev && prev.value === '(' || opts.regex === false) {
6928         push({
6929           type: 'plus',
6930           value,
6931           output: PLUS_LITERAL
6932         });
6933         continue;
6934       }
6935
6936       if (prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace') || state.parens > 0) {
6937         push({
6938           type: 'plus',
6939           value
6940         });
6941         continue;
6942       }
6943
6944       push({
6945         type: 'plus',
6946         value: PLUS_LITERAL
6947       });
6948       continue;
6949     }
6950     /**
6951      * Plain text
6952      */
6953
6954
6955     if (value === '@') {
6956       if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
6957         push({
6958           type: 'at',
6959           extglob: true,
6960           value,
6961           output: ''
6962         });
6963         continue;
6964       }
6965
6966       push({
6967         type: 'text',
6968         value
6969       });
6970       continue;
6971     }
6972     /**
6973      * Plain text
6974      */
6975
6976
6977     if (value !== '*') {
6978       if (value === '$' || value === '^') {
6979         value = `\\${value}`;
6980       }
6981
6982       const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
6983
6984       if (match) {
6985         value += match[0];
6986         state.index += match[0].length;
6987       }
6988
6989       push({
6990         type: 'text',
6991         value
6992       });
6993       continue;
6994     }
6995     /**
6996      * Stars
6997      */
6998
6999
7000     if (prev && (prev.type === 'globstar' || prev.star === true)) {
7001       prev.type = 'star';
7002       prev.star = true;
7003       prev.value += value;
7004       prev.output = star;
7005       state.backtrack = true;
7006       state.globstar = true;
7007       consume(value);
7008       continue;
7009     }
7010
7011     let rest = remaining();
7012
7013     if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
7014       extglobOpen('star', value);
7015       continue;
7016     }
7017
7018     if (prev.type === 'star') {
7019       if (opts.noglobstar === true) {
7020         consume(value);
7021         continue;
7022       }
7023
7024       const prior = prev.prev;
7025       const before = prior.prev;
7026       const isStart = prior.type === 'slash' || prior.type === 'bos';
7027       const afterStar = before && (before.type === 'star' || before.type === 'globstar');
7028
7029       if (opts.bash === true && (!isStart || rest[0] && rest[0] !== '/')) {
7030         push({
7031           type: 'star',
7032           value,
7033           output: ''
7034         });
7035         continue;
7036       }
7037
7038       const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace');
7039       const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren');
7040
7041       if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) {
7042         push({
7043           type: 'star',
7044           value,
7045           output: ''
7046         });
7047         continue;
7048       } // strip consecutive `/**/`
7049
7050
7051       while (rest.slice(0, 3) === '/**') {
7052         const after = input[state.index + 4];
7053
7054         if (after && after !== '/') {
7055           break;
7056         }
7057
7058         rest = rest.slice(3);
7059         consume('/**', 3);
7060       }
7061
7062       if (prior.type === 'bos' && eos()) {
7063         prev.type = 'globstar';
7064         prev.value += value;
7065         prev.output = globstar(opts);
7066         state.output = prev.output;
7067         state.globstar = true;
7068         consume(value);
7069         continue;
7070       }
7071
7072       if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) {
7073         state.output = state.output.slice(0, -(prior.output + prev.output).length);
7074         prior.output = `(?:${prior.output}`;
7075         prev.type = 'globstar';
7076         prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)');
7077         prev.value += value;
7078         state.globstar = true;
7079         state.output += prior.output + prev.output;
7080         consume(value);
7081         continue;
7082       }
7083
7084       if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') {
7085         const end = rest[1] !== void 0 ? '|$' : '';
7086         state.output = state.output.slice(0, -(prior.output + prev.output).length);
7087         prior.output = `(?:${prior.output}`;
7088         prev.type = 'globstar';
7089         prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
7090         prev.value += value;
7091         state.output += prior.output + prev.output;
7092         state.globstar = true;
7093         consume(value + advance());
7094         push({
7095           type: 'slash',
7096           value: '/',
7097           output: ''
7098         });
7099         continue;
7100       }
7101
7102       if (prior.type === 'bos' && rest[0] === '/') {
7103         prev.type = 'globstar';
7104         prev.value += value;
7105         prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
7106         state.output = prev.output;
7107         state.globstar = true;
7108         consume(value + advance());
7109         push({
7110           type: 'slash',
7111           value: '/',
7112           output: ''
7113         });
7114         continue;
7115       } // remove single star from output
7116
7117
7118       state.output = state.output.slice(0, -prev.output.length); // reset previous token to globstar
7119
7120       prev.type = 'globstar';
7121       prev.output = globstar(opts);
7122       prev.value += value; // reset output with globstar
7123
7124       state.output += prev.output;
7125       state.globstar = true;
7126       consume(value);
7127       continue;
7128     }
7129
7130     const token = {
7131       type: 'star',
7132       value,
7133       output: star
7134     };
7135
7136     if (opts.bash === true) {
7137       token.output = '.*?';
7138
7139       if (prev.type === 'bos' || prev.type === 'slash') {
7140         token.output = nodot + token.output;
7141       }
7142
7143       push(token);
7144       continue;
7145     }
7146
7147     if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) {
7148       token.output = value;
7149       push(token);
7150       continue;
7151     }
7152
7153     if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') {
7154       if (prev.type === 'dot') {
7155         state.output += NO_DOT_SLASH;
7156         prev.output += NO_DOT_SLASH;
7157       } else if (opts.dot === true) {
7158         state.output += NO_DOTS_SLASH;
7159         prev.output += NO_DOTS_SLASH;
7160       } else {
7161         state.output += nodot;
7162         prev.output += nodot;
7163       }
7164
7165       if (peek() !== '*') {
7166         state.output += ONE_CHAR;
7167         prev.output += ONE_CHAR;
7168       }
7169     }
7170
7171     push(token);
7172   }
7173
7174   while (state.brackets > 0) {
7175     if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']'));
7176     state.output = utils$d.escapeLast(state.output, '[');
7177     decrement('brackets');
7178   }
7179
7180   while (state.parens > 0) {
7181     if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')'));
7182     state.output = utils$d.escapeLast(state.output, '(');
7183     decrement('parens');
7184   }
7185
7186   while (state.braces > 0) {
7187     if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}'));
7188     state.output = utils$d.escapeLast(state.output, '{');
7189     decrement('braces');
7190   }
7191
7192   if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) {
7193     push({
7194       type: 'maybe_slash',
7195       value: '',
7196       output: `${SLASH_LITERAL}?`
7197     });
7198   } // rebuild the output if we had to backtrack at any point
7199
7200
7201   if (state.backtrack === true) {
7202     state.output = '';
7203
7204     for (const token of state.tokens) {
7205       state.output += token.output != null ? token.output : token.value;
7206
7207       if (token.suffix) {
7208         state.output += token.suffix;
7209       }
7210     }
7211   }
7212
7213   return state;
7214 };
7215 /**
7216  * Fast paths for creating regular expressions for common glob patterns.
7217  * This can significantly speed up processing and has very little downside
7218  * impact when none of the fast paths match.
7219  */
7220
7221
7222 parse$2.fastpaths = (input, options) => {
7223   const opts = Object.assign({}, options);
7224   const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
7225   const len = input.length;
7226
7227   if (len > max) {
7228     throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
7229   }
7230
7231   input = REPLACEMENTS[input] || input;
7232   const win32 = utils$d.isWindows(options); // create constants based on platform, for windows or posix
7233
7234   const {
7235     DOT_LITERAL,
7236     SLASH_LITERAL,
7237     ONE_CHAR,
7238     DOTS_SLASH,
7239     NO_DOT,
7240     NO_DOTS,
7241     NO_DOTS_SLASH,
7242     STAR,
7243     START_ANCHOR
7244   } = constants$2.globChars(win32);
7245   const nodot = opts.dot ? NO_DOTS : NO_DOT;
7246   const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
7247   const capture = opts.capture ? '' : '?:';
7248   const state = {
7249     negated: false,
7250     prefix: ''
7251   };
7252   let star = opts.bash === true ? '.*?' : STAR;
7253
7254   if (opts.capture) {
7255     star = `(${star})`;
7256   }
7257
7258   const globstar = opts => {
7259     if (opts.noglobstar === true) return star;
7260     return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
7261   };
7262
7263   const create = str => {
7264     switch (str) {
7265       case '*':
7266         return `${nodot}${ONE_CHAR}${star}`;
7267
7268       case '.*':
7269         return `${DOT_LITERAL}${ONE_CHAR}${star}`;
7270
7271       case '*.*':
7272         return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
7273
7274       case '*/*':
7275         return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
7276
7277       case '**':
7278         return nodot + globstar(opts);
7279
7280       case '**/*':
7281         return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
7282
7283       case '**/*.*':
7284         return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
7285
7286       case '**/.*':
7287         return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
7288
7289       default:
7290         {
7291           const match = /^(.*?)\.(\w+)$/.exec(str);
7292           if (!match) return;
7293           const source = create(match[1]);
7294           if (!source) return;
7295           return source + DOT_LITERAL + match[2];
7296         }
7297     }
7298   };
7299
7300   const output = utils$d.removePrefix(input, state);
7301   let source = create(output);
7302
7303   if (source && opts.strictSlashes !== true) {
7304     source += `${SLASH_LITERAL}?`;
7305   }
7306
7307   return source;
7308 };
7309
7310 var parse_1 = parse$2;
7311
7312 const path$9 = require$$0__default$1["default"];
7313 const scan = scan_1;
7314 const parse$1 = parse_1;
7315 const utils$c = utils$f;
7316 const constants$1 = constants$3;
7317
7318 const isObject$5 = val => val && typeof val === 'object' && !Array.isArray(val);
7319 /**
7320  * Creates a matcher function from one or more glob patterns. The
7321  * returned function takes a string to match as its first argument,
7322  * and returns true if the string is a match. The returned matcher
7323  * function also takes a boolean as the second argument that, when true,
7324  * returns an object with additional information.
7325  *
7326  * ```js
7327  * const picomatch = require('picomatch');
7328  * // picomatch(glob[, options]);
7329  *
7330  * const isMatch = picomatch('*.!(*a)');
7331  * console.log(isMatch('a.a')); //=> false
7332  * console.log(isMatch('a.b')); //=> true
7333  * ```
7334  * @name picomatch
7335  * @param {String|Array} `globs` One or more glob patterns.
7336  * @param {Object=} `options`
7337  * @return {Function=} Returns a matcher function.
7338  * @api public
7339  */
7340
7341
7342 const picomatch$2 = (glob, options, returnState = false) => {
7343   if (Array.isArray(glob)) {
7344     const fns = glob.map(input => picomatch$2(input, options, returnState));
7345
7346     const arrayMatcher = str => {
7347       for (const isMatch of fns) {
7348         const state = isMatch(str);
7349         if (state) return state;
7350       }
7351
7352       return false;
7353     };
7354
7355     return arrayMatcher;
7356   }
7357
7358   const isState = isObject$5(glob) && glob.tokens && glob.input;
7359
7360   if (glob === '' || typeof glob !== 'string' && !isState) {
7361     throw new TypeError('Expected pattern to be a non-empty string');
7362   }
7363
7364   const opts = options || {};
7365   const posix = utils$c.isWindows(options);
7366   const regex = isState ? picomatch$2.compileRe(glob, options) : picomatch$2.makeRe(glob, options, false, true);
7367   const state = regex.state;
7368   delete regex.state;
7369
7370   let isIgnored = () => false;
7371
7372   if (opts.ignore) {
7373     const ignoreOpts = Object.assign(Object.assign({}, options), {}, {
7374       ignore: null,
7375       onMatch: null,
7376       onResult: null
7377     });
7378     isIgnored = picomatch$2(opts.ignore, ignoreOpts, returnState);
7379   }
7380
7381   const matcher = (input, returnObject = false) => {
7382     const {
7383       isMatch,
7384       match,
7385       output
7386     } = picomatch$2.test(input, regex, options, {
7387       glob,
7388       posix
7389     });
7390     const result = {
7391       glob,
7392       state,
7393       regex,
7394       posix,
7395       input,
7396       output,
7397       match,
7398       isMatch
7399     };
7400
7401     if (typeof opts.onResult === 'function') {
7402       opts.onResult(result);
7403     }
7404
7405     if (isMatch === false) {
7406       result.isMatch = false;
7407       return returnObject ? result : false;
7408     }
7409
7410     if (isIgnored(input)) {
7411       if (typeof opts.onIgnore === 'function') {
7412         opts.onIgnore(result);
7413       }
7414
7415       result.isMatch = false;
7416       return returnObject ? result : false;
7417     }
7418
7419     if (typeof opts.onMatch === 'function') {
7420       opts.onMatch(result);
7421     }
7422
7423     return returnObject ? result : true;
7424   };
7425
7426   if (returnState) {
7427     matcher.state = state;
7428   }
7429
7430   return matcher;
7431 };
7432 /**
7433  * Test `input` with the given `regex`. This is used by the main
7434  * `picomatch()` function to test the input string.
7435  *
7436  * ```js
7437  * const picomatch = require('picomatch');
7438  * // picomatch.test(input, regex[, options]);
7439  *
7440  * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
7441  * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
7442  * ```
7443  * @param {String} `input` String to test.
7444  * @param {RegExp} `regex`
7445  * @return {Object} Returns an object with matching info.
7446  * @api public
7447  */
7448
7449
7450 picomatch$2.test = (input, regex, options, {
7451   glob,
7452   posix
7453 } = {}) => {
7454   if (typeof input !== 'string') {
7455     throw new TypeError('Expected input to be a string');
7456   }
7457
7458   if (input === '') {
7459     return {
7460       isMatch: false,
7461       output: ''
7462     };
7463   }
7464
7465   const opts = options || {};
7466   const format = opts.format || (posix ? utils$c.toPosixSlashes : null);
7467   let match = input === glob;
7468   let output = match && format ? format(input) : input;
7469
7470   if (match === false) {
7471     output = format ? format(input) : input;
7472     match = output === glob;
7473   }
7474
7475   if (match === false || opts.capture === true) {
7476     if (opts.matchBase === true || opts.basename === true) {
7477       match = picomatch$2.matchBase(input, regex, options, posix);
7478     } else {
7479       match = regex.exec(output);
7480     }
7481   }
7482
7483   return {
7484     isMatch: Boolean(match),
7485     match,
7486     output
7487   };
7488 };
7489 /**
7490  * Match the basename of a filepath.
7491  *
7492  * ```js
7493  * const picomatch = require('picomatch');
7494  * // picomatch.matchBase(input, glob[, options]);
7495  * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
7496  * ```
7497  * @param {String} `input` String to test.
7498  * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).
7499  * @return {Boolean}
7500  * @api public
7501  */
7502
7503
7504 picomatch$2.matchBase = (input, glob, options, posix = utils$c.isWindows(options)) => {
7505   const regex = glob instanceof RegExp ? glob : picomatch$2.makeRe(glob, options);
7506   return regex.test(path$9.basename(input));
7507 };
7508 /**
7509  * Returns true if **any** of the given glob `patterns` match the specified `string`.
7510  *
7511  * ```js
7512  * const picomatch = require('picomatch');
7513  * // picomatch.isMatch(string, patterns[, options]);
7514  *
7515  * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
7516  * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
7517  * ```
7518  * @param {String|Array} str The string to test.
7519  * @param {String|Array} patterns One or more glob patterns to use for matching.
7520  * @param {Object} [options] See available [options](#options).
7521  * @return {Boolean} Returns true if any patterns match `str`
7522  * @api public
7523  */
7524
7525
7526 picomatch$2.isMatch = (str, patterns, options) => picomatch$2(patterns, options)(str);
7527 /**
7528  * Parse a glob pattern to create the source string for a regular
7529  * expression.
7530  *
7531  * ```js
7532  * const picomatch = require('picomatch');
7533  * const result = picomatch.parse(pattern[, options]);
7534  * ```
7535  * @param {String} `pattern`
7536  * @param {Object} `options`
7537  * @return {Object} Returns an object with useful properties and output to be used as a regex source string.
7538  * @api public
7539  */
7540
7541
7542 picomatch$2.parse = (pattern, options) => {
7543   if (Array.isArray(pattern)) return pattern.map(p => picomatch$2.parse(p, options));
7544   return parse$1(pattern, Object.assign(Object.assign({}, options), {}, {
7545     fastpaths: false
7546   }));
7547 };
7548 /**
7549  * Scan a glob pattern to separate the pattern into segments.
7550  *
7551  * ```js
7552  * const picomatch = require('picomatch');
7553  * // picomatch.scan(input[, options]);
7554  *
7555  * const result = picomatch.scan('!./foo/*.js');
7556  * console.log(result);
7557  * { prefix: '!./',
7558  *   input: '!./foo/*.js',
7559  *   start: 3,
7560  *   base: 'foo',
7561  *   glob: '*.js',
7562  *   isBrace: false,
7563  *   isBracket: false,
7564  *   isGlob: true,
7565  *   isExtglob: false,
7566  *   isGlobstar: false,
7567  *   negated: true }
7568  * ```
7569  * @param {String} `input` Glob pattern to scan.
7570  * @param {Object} `options`
7571  * @return {Object} Returns an object with
7572  * @api public
7573  */
7574
7575
7576 picomatch$2.scan = (input, options) => scan(input, options);
7577 /**
7578  * Compile a regular expression from the `state` object returned by the
7579  * [parse()](#parse) method.
7580  *
7581  * @param {Object} `state`
7582  * @param {Object} `options`
7583  * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.
7584  * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.
7585  * @return {RegExp}
7586  * @api public
7587  */
7588
7589
7590 picomatch$2.compileRe = (state, options, returnOutput = false, returnState = false) => {
7591   if (returnOutput === true) {
7592     return state.output;
7593   }
7594
7595   const opts = options || {};
7596   const prepend = opts.contains ? '' : '^';
7597   const append = opts.contains ? '' : '$';
7598   let source = `${prepend}(?:${state.output})${append}`;
7599
7600   if (state && state.negated === true) {
7601     source = `^(?!${source}).*$`;
7602   }
7603
7604   const regex = picomatch$2.toRegex(source, options);
7605
7606   if (returnState === true) {
7607     regex.state = state;
7608   }
7609
7610   return regex;
7611 };
7612 /**
7613  * Create a regular expression from a parsed glob pattern.
7614  *
7615  * ```js
7616  * const picomatch = require('picomatch');
7617  * const state = picomatch.parse('*.js');
7618  * // picomatch.compileRe(state[, options]);
7619  *
7620  * console.log(picomatch.compileRe(state));
7621  * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
7622  * ```
7623  * @param {String} `state` The object returned from the `.parse` method.
7624  * @param {Object} `options`
7625  * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.
7626  * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression.
7627  * @return {RegExp} Returns a regex created from the given pattern.
7628  * @api public
7629  */
7630
7631
7632 picomatch$2.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
7633   if (!input || typeof input !== 'string') {
7634     throw new TypeError('Expected a non-empty string');
7635   }
7636
7637   let parsed = {
7638     negated: false,
7639     fastpaths: true
7640   };
7641
7642   if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) {
7643     parsed.output = parse$1.fastpaths(input, options);
7644   }
7645
7646   if (!parsed.output) {
7647     parsed = parse$1(input, options);
7648   }
7649
7650   return picomatch$2.compileRe(parsed, options, returnOutput, returnState);
7651 };
7652 /**
7653  * Create a regular expression from the given regex source string.
7654  *
7655  * ```js
7656  * const picomatch = require('picomatch');
7657  * // picomatch.toRegex(source[, options]);
7658  *
7659  * const { output } = picomatch.parse('*.js');
7660  * console.log(picomatch.toRegex(output));
7661  * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
7662  * ```
7663  * @param {String} `source` Regular expression source string.
7664  * @param {Object} `options`
7665  * @return {RegExp}
7666  * @api public
7667  */
7668
7669
7670 picomatch$2.toRegex = (source, options) => {
7671   try {
7672     const opts = options || {};
7673     return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));
7674   } catch (err) {
7675     if (options && options.debug === true) throw err;
7676     return /$^/;
7677   }
7678 };
7679 /**
7680  * Picomatch constants.
7681  * @return {Object}
7682  */
7683
7684
7685 picomatch$2.constants = constants$1;
7686 /**
7687  * Expose "picomatch"
7688  */
7689
7690 var picomatch_1 = picomatch$2;
7691
7692 var picomatch$1 = picomatch_1;
7693
7694 const util = require$$0__default$2["default"];
7695 const braces = braces_1;
7696 const picomatch = picomatch$1;
7697 const utils$b = utils$f;
7698
7699 const isEmptyString = val => val === '' || val === './';
7700 /**
7701  * Returns an array of strings that match one or more glob patterns.
7702  *
7703  * ```js
7704  * const mm = require('micromatch');
7705  * // mm(list, patterns[, options]);
7706  *
7707  * console.log(mm(['a.js', 'a.txt'], ['*.js']));
7708  * //=> [ 'a.js' ]
7709  * ```
7710  * @param {String|Array<string>} `list` List of strings to match.
7711  * @param {String|Array<string>} `patterns` One or more glob patterns to use for matching.
7712  * @param {Object} `options` See available [options](#options)
7713  * @return {Array} Returns an array of matches
7714  * @summary false
7715  * @api public
7716  */
7717
7718
7719 const micromatch$1 = (list, patterns, options) => {
7720   patterns = [].concat(patterns);
7721   list = [].concat(list);
7722   let omit = new Set();
7723   let keep = new Set();
7724   let items = new Set();
7725   let negatives = 0;
7726
7727   let onResult = state => {
7728     items.add(state.output);
7729
7730     if (options && options.onResult) {
7731       options.onResult(state);
7732     }
7733   };
7734
7735   for (let i = 0; i < patterns.length; i++) {
7736     let isMatch = picomatch(String(patterns[i]), Object.assign(Object.assign({}, options), {}, {
7737       onResult
7738     }), true);
7739     let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
7740     if (negated) negatives++;
7741
7742     for (let item of list) {
7743       let matched = isMatch(item, true);
7744       let match = negated ? !matched.isMatch : matched.isMatch;
7745       if (!match) continue;
7746
7747       if (negated) {
7748         omit.add(matched.output);
7749       } else {
7750         omit.delete(matched.output);
7751         keep.add(matched.output);
7752       }
7753     }
7754   }
7755
7756   let result = negatives === patterns.length ? [...items] : [...keep];
7757   let matches = result.filter(item => !omit.has(item));
7758
7759   if (options && matches.length === 0) {
7760     if (options.failglob === true) {
7761       throw new Error(`No matches found for "${patterns.join(', ')}"`);
7762     }
7763
7764     if (options.nonull === true || options.nullglob === true) {
7765       return options.unescape ? patterns.map(p => p.replace(/\\/g, '')) : patterns;
7766     }
7767   }
7768
7769   return matches;
7770 };
7771 /**
7772  * Backwards compatibility
7773  */
7774
7775
7776 micromatch$1.match = micromatch$1;
7777 /**
7778  * Returns a matcher function from the given glob `pattern` and `options`.
7779  * The returned function takes a string to match as its only argument and returns
7780  * true if the string is a match.
7781  *
7782  * ```js
7783  * const mm = require('micromatch');
7784  * // mm.matcher(pattern[, options]);
7785  *
7786  * const isMatch = mm.matcher('*.!(*a)');
7787  * console.log(isMatch('a.a')); //=> false
7788  * console.log(isMatch('a.b')); //=> true
7789  * ```
7790  * @param {String} `pattern` Glob pattern
7791  * @param {Object} `options`
7792  * @return {Function} Returns a matcher function.
7793  * @api public
7794  */
7795
7796 micromatch$1.matcher = (pattern, options) => picomatch(pattern, options);
7797 /**
7798  * Returns true if **any** of the given glob `patterns` match the specified `string`.
7799  *
7800  * ```js
7801  * const mm = require('micromatch');
7802  * // mm.isMatch(string, patterns[, options]);
7803  *
7804  * console.log(mm.isMatch('a.a', ['b.*', '*.a'])); //=> true
7805  * console.log(mm.isMatch('a.a', 'b.*')); //=> false
7806  * ```
7807  * @param {String} `str` The string to test.
7808  * @param {String|Array} `patterns` One or more glob patterns to use for matching.
7809  * @param {Object} `[options]` See available [options](#options).
7810  * @return {Boolean} Returns true if any patterns match `str`
7811  * @api public
7812  */
7813
7814
7815 micromatch$1.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
7816 /**
7817  * Backwards compatibility
7818  */
7819
7820
7821 micromatch$1.any = micromatch$1.isMatch;
7822 /**
7823  * Returns a list of strings that _**do not match any**_ of the given `patterns`.
7824  *
7825  * ```js
7826  * const mm = require('micromatch');
7827  * // mm.not(list, patterns[, options]);
7828  *
7829  * console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a'));
7830  * //=> ['b.b', 'c.c']
7831  * ```
7832  * @param {Array} `list` Array of strings to match.
7833  * @param {String|Array} `patterns` One or more glob pattern to use for matching.
7834  * @param {Object} `options` See available [options](#options) for changing how matches are performed
7835  * @return {Array} Returns an array of strings that **do not match** the given patterns.
7836  * @api public
7837  */
7838
7839 micromatch$1.not = (list, patterns, options = {}) => {
7840   patterns = [].concat(patterns).map(String);
7841   let result = new Set();
7842   let items = [];
7843
7844   let onResult = state => {
7845     if (options.onResult) options.onResult(state);
7846     items.push(state.output);
7847   };
7848
7849   let matches = micromatch$1(list, patterns, Object.assign(Object.assign({}, options), {}, {
7850     onResult
7851   }));
7852
7853   for (let item of items) {
7854     if (!matches.includes(item)) {
7855       result.add(item);
7856     }
7857   }
7858
7859   return [...result];
7860 };
7861 /**
7862  * Returns true if the given `string` contains the given pattern. Similar
7863  * to [.isMatch](#isMatch) but the pattern can match any part of the string.
7864  *
7865  * ```js
7866  * var mm = require('micromatch');
7867  * // mm.contains(string, pattern[, options]);
7868  *
7869  * console.log(mm.contains('aa/bb/cc', '*b'));
7870  * //=> true
7871  * console.log(mm.contains('aa/bb/cc', '*d'));
7872  * //=> false
7873  * ```
7874  * @param {String} `str` The string to match.
7875  * @param {String|Array} `patterns` Glob pattern to use for matching.
7876  * @param {Object} `options` See available [options](#options) for changing how matches are performed
7877  * @return {Boolean} Returns true if any of the patterns matches any part of `str`.
7878  * @api public
7879  */
7880
7881
7882 micromatch$1.contains = (str, pattern, options) => {
7883   if (typeof str !== 'string') {
7884     throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
7885   }
7886
7887   if (Array.isArray(pattern)) {
7888     return pattern.some(p => micromatch$1.contains(str, p, options));
7889   }
7890
7891   if (typeof pattern === 'string') {
7892     if (isEmptyString(str) || isEmptyString(pattern)) {
7893       return false;
7894     }
7895
7896     if (str.includes(pattern) || str.startsWith('./') && str.slice(2).includes(pattern)) {
7897       return true;
7898     }
7899   }
7900
7901   return micromatch$1.isMatch(str, pattern, Object.assign(Object.assign({}, options), {}, {
7902     contains: true
7903   }));
7904 };
7905 /**
7906  * Filter the keys of the given object with the given `glob` pattern
7907  * and `options`. Does not attempt to match nested keys. If you need this feature,
7908  * use [glob-object][] instead.
7909  *
7910  * ```js
7911  * const mm = require('micromatch');
7912  * // mm.matchKeys(object, patterns[, options]);
7913  *
7914  * const obj = { aa: 'a', ab: 'b', ac: 'c' };
7915  * console.log(mm.matchKeys(obj, '*b'));
7916  * //=> { ab: 'b' }
7917  * ```
7918  * @param {Object} `object` The object with keys to filter.
7919  * @param {String|Array} `patterns` One or more glob patterns to use for matching.
7920  * @param {Object} `options` See available [options](#options) for changing how matches are performed
7921  * @return {Object} Returns an object with only keys that match the given patterns.
7922  * @api public
7923  */
7924
7925
7926 micromatch$1.matchKeys = (obj, patterns, options) => {
7927   if (!utils$b.isObject(obj)) {
7928     throw new TypeError('Expected the first argument to be an object');
7929   }
7930
7931   let keys = micromatch$1(Object.keys(obj), patterns, options);
7932   let res = {};
7933
7934   for (let key of keys) res[key] = obj[key];
7935
7936   return res;
7937 };
7938 /**
7939  * Returns true if some of the strings in the given `list` match any of the given glob `patterns`.
7940  *
7941  * ```js
7942  * const mm = require('micromatch');
7943  * // mm.some(list, patterns[, options]);
7944  *
7945  * console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js']));
7946  * // true
7947  * console.log(mm.some(['foo.js'], ['*.js', '!foo.js']));
7948  * // false
7949  * ```
7950  * @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found.
7951  * @param {String|Array} `patterns` One or more glob patterns to use for matching.
7952  * @param {Object} `options` See available [options](#options) for changing how matches are performed
7953  * @return {Boolean} Returns true if any `patterns` matches any of the strings in `list`
7954  * @api public
7955  */
7956
7957
7958 micromatch$1.some = (list, patterns, options) => {
7959   let items = [].concat(list);
7960
7961   for (let pattern of [].concat(patterns)) {
7962     let isMatch = picomatch(String(pattern), options);
7963
7964     if (items.some(item => isMatch(item))) {
7965       return true;
7966     }
7967   }
7968
7969   return false;
7970 };
7971 /**
7972  * Returns true if every string in the given `list` matches
7973  * any of the given glob `patterns`.
7974  *
7975  * ```js
7976  * const mm = require('micromatch');
7977  * // mm.every(list, patterns[, options]);
7978  *
7979  * console.log(mm.every('foo.js', ['foo.js']));
7980  * // true
7981  * console.log(mm.every(['foo.js', 'bar.js'], ['*.js']));
7982  * // true
7983  * console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js']));
7984  * // false
7985  * console.log(mm.every(['foo.js'], ['*.js', '!foo.js']));
7986  * // false
7987  * ```
7988  * @param {String|Array} `list` The string or array of strings to test.
7989  * @param {String|Array} `patterns` One or more glob patterns to use for matching.
7990  * @param {Object} `options` See available [options](#options) for changing how matches are performed
7991  * @return {Boolean} Returns true if all `patterns` matches all of the strings in `list`
7992  * @api public
7993  */
7994
7995
7996 micromatch$1.every = (list, patterns, options) => {
7997   let items = [].concat(list);
7998
7999   for (let pattern of [].concat(patterns)) {
8000     let isMatch = picomatch(String(pattern), options);
8001
8002     if (!items.every(item => isMatch(item))) {
8003       return false;
8004     }
8005   }
8006
8007   return true;
8008 };
8009 /**
8010  * Returns true if **all** of the given `patterns` match
8011  * the specified string.
8012  *
8013  * ```js
8014  * const mm = require('micromatch');
8015  * // mm.all(string, patterns[, options]);
8016  *
8017  * console.log(mm.all('foo.js', ['foo.js']));
8018  * // true
8019  *
8020  * console.log(mm.all('foo.js', ['*.js', '!foo.js']));
8021  * // false
8022  *
8023  * console.log(mm.all('foo.js', ['*.js', 'foo.js']));
8024  * // true
8025  *
8026  * console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js']));
8027  * // true
8028  * ```
8029  * @param {String|Array} `str` The string to test.
8030  * @param {String|Array} `patterns` One or more glob patterns to use for matching.
8031  * @param {Object} `options` See available [options](#options) for changing how matches are performed
8032  * @return {Boolean} Returns true if any patterns match `str`
8033  * @api public
8034  */
8035
8036
8037 micromatch$1.all = (str, patterns, options) => {
8038   if (typeof str !== 'string') {
8039     throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
8040   }
8041
8042   return [].concat(patterns).every(p => picomatch(p, options)(str));
8043 };
8044 /**
8045  * Returns an array of matches captured by `pattern` in `string, or `null` if the pattern did not match.
8046  *
8047  * ```js
8048  * const mm = require('micromatch');
8049  * // mm.capture(pattern, string[, options]);
8050  *
8051  * console.log(mm.capture('test/*.js', 'test/foo.js'));
8052  * //=> ['foo']
8053  * console.log(mm.capture('test/*.js', 'foo/bar.css'));
8054  * //=> null
8055  * ```
8056  * @param {String} `glob` Glob pattern to use for matching.
8057  * @param {String} `input` String to match
8058  * @param {Object} `options` See available [options](#options) for changing how matches are performed
8059  * @return {Array|null} Returns an array of captures if the input matches the glob pattern, otherwise `null`.
8060  * @api public
8061  */
8062
8063
8064 micromatch$1.capture = (glob, input, options) => {
8065   let posix = utils$b.isWindows(options);
8066   let regex = picomatch.makeRe(String(glob), Object.assign(Object.assign({}, options), {}, {
8067     capture: true
8068   }));
8069   let match = regex.exec(posix ? utils$b.toPosixSlashes(input) : input);
8070
8071   if (match) {
8072     return match.slice(1).map(v => v === void 0 ? '' : v);
8073   }
8074 };
8075 /**
8076  * Create a regular expression from the given glob `pattern`.
8077  *
8078  * ```js
8079  * const mm = require('micromatch');
8080  * // mm.makeRe(pattern[, options]);
8081  *
8082  * console.log(mm.makeRe('*.js'));
8083  * //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/
8084  * ```
8085  * @param {String} `pattern` A glob pattern to convert to regex.
8086  * @param {Object} `options`
8087  * @return {RegExp} Returns a regex created from the given pattern.
8088  * @api public
8089  */
8090
8091
8092 micromatch$1.makeRe = (...args) => picomatch.makeRe(...args);
8093 /**
8094  * Scan a glob pattern to separate the pattern into segments. Used
8095  * by the [split](#split) method.
8096  *
8097  * ```js
8098  * const mm = require('micromatch');
8099  * const state = mm.scan(pattern[, options]);
8100  * ```
8101  * @param {String} `pattern`
8102  * @param {Object} `options`
8103  * @return {Object} Returns an object with
8104  * @api public
8105  */
8106
8107
8108 micromatch$1.scan = (...args) => picomatch.scan(...args);
8109 /**
8110  * Parse a glob pattern to create the source string for a regular
8111  * expression.
8112  *
8113  * ```js
8114  * const mm = require('micromatch');
8115  * const state = mm(pattern[, options]);
8116  * ```
8117  * @param {String} `glob`
8118  * @param {Object} `options`
8119  * @return {Object} Returns an object with useful properties and output to be used as regex source string.
8120  * @api public
8121  */
8122
8123
8124 micromatch$1.parse = (patterns, options) => {
8125   let res = [];
8126
8127   for (let pattern of [].concat(patterns || [])) {
8128     for (let str of braces(String(pattern), options)) {
8129       res.push(picomatch.parse(str, options));
8130     }
8131   }
8132
8133   return res;
8134 };
8135 /**
8136  * Process the given brace `pattern`.
8137  *
8138  * ```js
8139  * const { braces } = require('micromatch');
8140  * console.log(braces('foo/{a,b,c}/bar'));
8141  * //=> [ 'foo/(a|b|c)/bar' ]
8142  *
8143  * console.log(braces('foo/{a,b,c}/bar', { expand: true }));
8144  * //=> [ 'foo/a/bar', 'foo/b/bar', 'foo/c/bar' ]
8145  * ```
8146  * @param {String} `pattern` String with brace pattern to process.
8147  * @param {Object} `options` Any [options](#options) to change how expansion is performed. See the [braces][] library for all available options.
8148  * @return {Array}
8149  * @api public
8150  */
8151
8152
8153 micromatch$1.braces = (pattern, options) => {
8154   if (typeof pattern !== 'string') throw new TypeError('Expected a string');
8155
8156   if (options && options.nobrace === true || !/\{.*\}/.test(pattern)) {
8157     return [pattern];
8158   }
8159
8160   return braces(pattern, options);
8161 };
8162 /**
8163  * Expand braces
8164  */
8165
8166
8167 micromatch$1.braceExpand = (pattern, options) => {
8168   if (typeof pattern !== 'string') throw new TypeError('Expected a string');
8169   return micromatch$1.braces(pattern, Object.assign(Object.assign({}, options), {}, {
8170     expand: true
8171   }));
8172 };
8173 /**
8174  * Expose micromatch
8175  */
8176
8177
8178 var micromatch_1 = micromatch$1;
8179
8180 Object.defineProperty(pattern$1, "__esModule", {
8181   value: true
8182 });
8183 pattern$1.matchAny = pattern$1.convertPatternsToRe = pattern$1.makeRe = pattern$1.getPatternParts = pattern$1.expandBraceExpansion = pattern$1.expandPatternsWithBraceExpansion = pattern$1.isAffectDepthOfReadingPattern = pattern$1.endsWithSlashGlobStar = pattern$1.hasGlobStar = pattern$1.getBaseDirectory = pattern$1.isPatternRelatedToParentDirectory = pattern$1.getPatternsOutsideCurrentDirectory = pattern$1.getPatternsInsideCurrentDirectory = pattern$1.getPositivePatterns = pattern$1.getNegativePatterns = pattern$1.isPositivePattern = pattern$1.isNegativePattern = pattern$1.convertToNegativePattern = pattern$1.convertToPositivePattern = pattern$1.isDynamicPattern = pattern$1.isStaticPattern = void 0;
8184 const path$8 = require$$0__default$1["default"];
8185 const globParent = globParent$1;
8186 const micromatch = micromatch_1;
8187 const GLOBSTAR = '**';
8188 const ESCAPE_SYMBOL = '\\';
8189 const COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/;
8190 const REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[.*]/;
8191 const REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\(.*\|.*\)/;
8192 const GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\(.*\)/;
8193 const BRACE_EXPANSIONS_SYMBOLS_RE = /{.*(?:,|\.\.).*}/;
8194
8195 function isStaticPattern(pattern, options = {}) {
8196   return !isDynamicPattern(pattern, options);
8197 }
8198
8199 pattern$1.isStaticPattern = isStaticPattern;
8200
8201 function isDynamicPattern(pattern, options = {}) {
8202   /**
8203    * A special case with an empty string is necessary for matching patterns that start with a forward slash.
8204    * An empty string cannot be a dynamic pattern.
8205    * For example, the pattern `/lib/*` will be spread into parts: '', 'lib', '*'.
8206    */
8207   if (pattern === '') {
8208     return false;
8209   }
8210   /**
8211    * When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
8212    * filepath directly (without read directory).
8213    */
8214
8215
8216   if (options.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) {
8217     return true;
8218   }
8219
8220   if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) {
8221     return true;
8222   }
8223
8224   if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) {
8225     return true;
8226   }
8227
8228   if (options.braceExpansion !== false && BRACE_EXPANSIONS_SYMBOLS_RE.test(pattern)) {
8229     return true;
8230   }
8231
8232   return false;
8233 }
8234
8235 pattern$1.isDynamicPattern = isDynamicPattern;
8236
8237 function convertToPositivePattern(pattern) {
8238   return isNegativePattern(pattern) ? pattern.slice(1) : pattern;
8239 }
8240
8241 pattern$1.convertToPositivePattern = convertToPositivePattern;
8242
8243 function convertToNegativePattern(pattern) {
8244   return '!' + pattern;
8245 }
8246
8247 pattern$1.convertToNegativePattern = convertToNegativePattern;
8248
8249 function isNegativePattern(pattern) {
8250   return pattern.startsWith('!') && pattern[1] !== '(';
8251 }
8252
8253 pattern$1.isNegativePattern = isNegativePattern;
8254
8255 function isPositivePattern(pattern) {
8256   return !isNegativePattern(pattern);
8257 }
8258
8259 pattern$1.isPositivePattern = isPositivePattern;
8260
8261 function getNegativePatterns(patterns) {
8262   return patterns.filter(isNegativePattern);
8263 }
8264
8265 pattern$1.getNegativePatterns = getNegativePatterns;
8266
8267 function getPositivePatterns$1(patterns) {
8268   return patterns.filter(isPositivePattern);
8269 }
8270
8271 pattern$1.getPositivePatterns = getPositivePatterns$1;
8272 /**
8273  * Returns patterns that can be applied inside the current directory.
8274  *
8275  * @example
8276  * // ['./*', '*', 'a/*']
8277  * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*'])
8278  */
8279
8280 function getPatternsInsideCurrentDirectory(patterns) {
8281   return patterns.filter(pattern => !isPatternRelatedToParentDirectory(pattern));
8282 }
8283
8284 pattern$1.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory;
8285 /**
8286  * Returns patterns to be expanded relative to (outside) the current directory.
8287  *
8288  * @example
8289  * // ['../*', './../*']
8290  * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*'])
8291  */
8292
8293 function getPatternsOutsideCurrentDirectory(patterns) {
8294   return patterns.filter(isPatternRelatedToParentDirectory);
8295 }
8296
8297 pattern$1.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory;
8298
8299 function isPatternRelatedToParentDirectory(pattern) {
8300   return pattern.startsWith('..') || pattern.startsWith('./..');
8301 }
8302
8303 pattern$1.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory;
8304
8305 function getBaseDirectory(pattern) {
8306   return globParent(pattern, {
8307     flipBackslashes: false
8308   });
8309 }
8310
8311 pattern$1.getBaseDirectory = getBaseDirectory;
8312
8313 function hasGlobStar(pattern) {
8314   return pattern.includes(GLOBSTAR);
8315 }
8316
8317 pattern$1.hasGlobStar = hasGlobStar;
8318
8319 function endsWithSlashGlobStar(pattern) {
8320   return pattern.endsWith('/' + GLOBSTAR);
8321 }
8322
8323 pattern$1.endsWithSlashGlobStar = endsWithSlashGlobStar;
8324
8325 function isAffectDepthOfReadingPattern(pattern) {
8326   const basename = path$8.basename(pattern);
8327   return endsWithSlashGlobStar(pattern) || isStaticPattern(basename);
8328 }
8329
8330 pattern$1.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
8331
8332 function expandPatternsWithBraceExpansion(patterns) {
8333   return patterns.reduce((collection, pattern) => {
8334     return collection.concat(expandBraceExpansion(pattern));
8335   }, []);
8336 }
8337
8338 pattern$1.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
8339
8340 function expandBraceExpansion(pattern) {
8341   return micromatch.braces(pattern, {
8342     expand: true,
8343     nodupes: true
8344   });
8345 }
8346
8347 pattern$1.expandBraceExpansion = expandBraceExpansion;
8348
8349 function getPatternParts(pattern, options) {
8350   let {
8351     parts
8352   } = micromatch.scan(pattern, Object.assign(Object.assign({}, options), {
8353     parts: true
8354   }));
8355   /**
8356    * The scan method returns an empty array in some cases.
8357    * See micromatch/picomatch#58 for more details.
8358    */
8359
8360   if (parts.length === 0) {
8361     parts = [pattern];
8362   }
8363   /**
8364    * The scan method does not return an empty part for the pattern with a forward slash.
8365    * This is another part of micromatch/picomatch#58.
8366    */
8367
8368
8369   if (parts[0].startsWith('/')) {
8370     parts[0] = parts[0].slice(1);
8371     parts.unshift('');
8372   }
8373
8374   return parts;
8375 }
8376
8377 pattern$1.getPatternParts = getPatternParts;
8378
8379 function makeRe(pattern, options) {
8380   return micromatch.makeRe(pattern, options);
8381 }
8382
8383 pattern$1.makeRe = makeRe;
8384
8385 function convertPatternsToRe(patterns, options) {
8386   return patterns.map(pattern => makeRe(pattern, options));
8387 }
8388
8389 pattern$1.convertPatternsToRe = convertPatternsToRe;
8390
8391 function matchAny(entry, patternsRe) {
8392   return patternsRe.some(patternRe => patternRe.test(entry));
8393 }
8394
8395 pattern$1.matchAny = matchAny;
8396
8397 var stream$4 = {};
8398
8399 /*
8400  * merge2
8401  * https://github.com/teambition/merge2
8402  *
8403  * Copyright (c) 2014-2020 Teambition
8404  * Licensed under the MIT license.
8405  */
8406
8407
8408 const Stream = require$$0__default$3["default"];
8409 const PassThrough = Stream.PassThrough;
8410 const slice = Array.prototype.slice;
8411 var merge2_1 = merge2$1;
8412
8413 function merge2$1() {
8414   const streamsQueue = [];
8415   const args = slice.call(arguments);
8416   let merging = false;
8417   let options = args[args.length - 1];
8418
8419   if (options && !Array.isArray(options) && options.pipe == null) {
8420     args.pop();
8421   } else {
8422     options = {};
8423   }
8424
8425   const doEnd = options.end !== false;
8426   const doPipeError = options.pipeError === true;
8427
8428   if (options.objectMode == null) {
8429     options.objectMode = true;
8430   }
8431
8432   if (options.highWaterMark == null) {
8433     options.highWaterMark = 64 * 1024;
8434   }
8435
8436   const mergedStream = PassThrough(options);
8437
8438   function addStream() {
8439     for (let i = 0, len = arguments.length; i < len; i++) {
8440       streamsQueue.push(pauseStreams(arguments[i], options));
8441     }
8442
8443     mergeStream();
8444     return this;
8445   }
8446
8447   function mergeStream() {
8448     if (merging) {
8449       return;
8450     }
8451
8452     merging = true;
8453     let streams = streamsQueue.shift();
8454
8455     if (!streams) {
8456       process.nextTick(endStream);
8457       return;
8458     }
8459
8460     if (!Array.isArray(streams)) {
8461       streams = [streams];
8462     }
8463
8464     let pipesCount = streams.length + 1;
8465
8466     function next() {
8467       if (--pipesCount > 0) {
8468         return;
8469       }
8470
8471       merging = false;
8472       mergeStream();
8473     }
8474
8475     function pipe(stream) {
8476       function onend() {
8477         stream.removeListener('merge2UnpipeEnd', onend);
8478         stream.removeListener('end', onend);
8479
8480         if (doPipeError) {
8481           stream.removeListener('error', onerror);
8482         }
8483
8484         next();
8485       }
8486
8487       function onerror(err) {
8488         mergedStream.emit('error', err);
8489       } // skip ended stream
8490
8491
8492       if (stream._readableState.endEmitted) {
8493         return next();
8494       }
8495
8496       stream.on('merge2UnpipeEnd', onend);
8497       stream.on('end', onend);
8498
8499       if (doPipeError) {
8500         stream.on('error', onerror);
8501       }
8502
8503       stream.pipe(mergedStream, {
8504         end: false
8505       }); // compatible for old stream
8506
8507       stream.resume();
8508     }
8509
8510     for (let i = 0; i < streams.length; i++) {
8511       pipe(streams[i]);
8512     }
8513
8514     next();
8515   }
8516
8517   function endStream() {
8518     merging = false; // emit 'queueDrain' when all streams merged.
8519
8520     mergedStream.emit('queueDrain');
8521
8522     if (doEnd) {
8523       mergedStream.end();
8524     }
8525   }
8526
8527   mergedStream.setMaxListeners(0);
8528   mergedStream.add = addStream;
8529   mergedStream.on('unpipe', function (stream) {
8530     stream.emit('merge2UnpipeEnd');
8531   });
8532
8533   if (args.length) {
8534     addStream.apply(null, args);
8535   }
8536
8537   return mergedStream;
8538 } // check and pause streams for pipe.
8539
8540
8541 function pauseStreams(streams, options) {
8542   if (!Array.isArray(streams)) {
8543     // Backwards-compat with old-style streams
8544     if (!streams._readableState && streams.pipe) {
8545       streams = streams.pipe(PassThrough(options));
8546     }
8547
8548     if (!streams._readableState || !streams.pause || !streams.pipe) {
8549       throw new Error('Only readable stream can be merged.');
8550     }
8551
8552     streams.pause();
8553   } else {
8554     for (let i = 0, len = streams.length; i < len; i++) {
8555       streams[i] = pauseStreams(streams[i], options);
8556     }
8557   }
8558
8559   return streams;
8560 }
8561
8562 Object.defineProperty(stream$4, "__esModule", {
8563   value: true
8564 });
8565 stream$4.merge = void 0;
8566 const merge2 = merge2_1;
8567
8568 function merge$2(streams) {
8569   const mergedStream = merge2(streams);
8570   streams.forEach(stream => {
8571     stream.once('error', error => mergedStream.emit('error', error));
8572   });
8573   mergedStream.once('close', () => propagateCloseEventToSources(streams));
8574   mergedStream.once('end', () => propagateCloseEventToSources(streams));
8575   return mergedStream;
8576 }
8577
8578 stream$4.merge = merge$2;
8579
8580 function propagateCloseEventToSources(streams) {
8581   streams.forEach(stream => stream.emit('close'));
8582 }
8583
8584 var string$1 = {};
8585
8586 Object.defineProperty(string$1, "__esModule", {
8587   value: true
8588 });
8589 string$1.isEmpty = string$1.isString = void 0;
8590
8591 function isString(input) {
8592   return typeof input === 'string';
8593 }
8594
8595 string$1.isString = isString;
8596
8597 function isEmpty(input) {
8598   return input === '';
8599 }
8600
8601 string$1.isEmpty = isEmpty;
8602
8603 Object.defineProperty(utils$k, "__esModule", {
8604   value: true
8605 });
8606 utils$k.string = utils$k.stream = utils$k.pattern = utils$k.path = utils$k.fs = utils$k.errno = utils$k.array = void 0;
8607 const array$2 = array$3;
8608 utils$k.array = array$2;
8609 const errno = errno$1;
8610 utils$k.errno = errno;
8611 const fs$8 = fs$9;
8612 utils$k.fs = fs$8;
8613 const path$7 = path$c;
8614 utils$k.path = path$7;
8615 const pattern = pattern$1;
8616 utils$k.pattern = pattern;
8617 const stream$3 = stream$4;
8618 utils$k.stream = stream$3;
8619 const string = string$1;
8620 utils$k.string = string;
8621
8622 Object.defineProperty(tasks, "__esModule", {
8623   value: true
8624 });
8625 tasks.convertPatternGroupToTask = tasks.convertPatternGroupsToTasks = tasks.groupPatternsByBaseDirectory = tasks.getNegativePatternsAsPositive = tasks.getPositivePatterns = tasks.convertPatternsToTasks = tasks.generate = void 0;
8626 const utils$a = utils$k;
8627
8628 function generate(patterns, settings) {
8629   const positivePatterns = getPositivePatterns(patterns);
8630   const negativePatterns = getNegativePatternsAsPositive(patterns, settings.ignore);
8631   const staticPatterns = positivePatterns.filter(pattern => utils$a.pattern.isStaticPattern(pattern, settings));
8632   const dynamicPatterns = positivePatterns.filter(pattern => utils$a.pattern.isDynamicPattern(pattern, settings));
8633   const staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns,
8634   /* dynamic */
8635   false);
8636   const dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns,
8637   /* dynamic */
8638   true);
8639   return staticTasks.concat(dynamicTasks);
8640 }
8641
8642 tasks.generate = generate;
8643 /**
8644  * Returns tasks grouped by basic pattern directories.
8645  *
8646  * Patterns that can be found inside (`./`) and outside (`../`) the current directory are handled separately.
8647  * This is necessary because directory traversal starts at the base directory and goes deeper.
8648  */
8649
8650 function convertPatternsToTasks(positive, negative, dynamic) {
8651   const tasks = [];
8652   const patternsOutsideCurrentDirectory = utils$a.pattern.getPatternsOutsideCurrentDirectory(positive);
8653   const patternsInsideCurrentDirectory = utils$a.pattern.getPatternsInsideCurrentDirectory(positive);
8654   const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory);
8655   const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory);
8656   tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic));
8657   /*
8658    * For the sake of reducing future accesses to the file system, we merge all tasks within the current directory
8659    * into a global task, if at least one pattern refers to the root (`.`). In this case, the global task covers the rest.
8660    */
8661
8662   if ('.' in insideCurrentDirectoryGroup) {
8663     tasks.push(convertPatternGroupToTask('.', patternsInsideCurrentDirectory, negative, dynamic));
8664   } else {
8665     tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic));
8666   }
8667
8668   return tasks;
8669 }
8670
8671 tasks.convertPatternsToTasks = convertPatternsToTasks;
8672
8673 function getPositivePatterns(patterns) {
8674   return utils$a.pattern.getPositivePatterns(patterns);
8675 }
8676
8677 tasks.getPositivePatterns = getPositivePatterns;
8678
8679 function getNegativePatternsAsPositive(patterns, ignore) {
8680   const negative = utils$a.pattern.getNegativePatterns(patterns).concat(ignore);
8681   const positive = negative.map(utils$a.pattern.convertToPositivePattern);
8682   return positive;
8683 }
8684
8685 tasks.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
8686
8687 function groupPatternsByBaseDirectory(patterns) {
8688   const group = {};
8689   return patterns.reduce((collection, pattern) => {
8690     const base = utils$a.pattern.getBaseDirectory(pattern);
8691
8692     if (base in collection) {
8693       collection[base].push(pattern);
8694     } else {
8695       collection[base] = [pattern];
8696     }
8697
8698     return collection;
8699   }, group);
8700 }
8701
8702 tasks.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
8703
8704 function convertPatternGroupsToTasks(positive, negative, dynamic) {
8705   return Object.keys(positive).map(base => {
8706     return convertPatternGroupToTask(base, positive[base], negative, dynamic);
8707   });
8708 }
8709
8710 tasks.convertPatternGroupsToTasks = convertPatternGroupsToTasks;
8711
8712 function convertPatternGroupToTask(base, positive, negative, dynamic) {
8713   return {
8714     dynamic,
8715     positive,
8716     negative,
8717     base,
8718     patterns: [].concat(positive, negative.map(utils$a.pattern.convertToNegativePattern))
8719   };
8720 }
8721
8722 tasks.convertPatternGroupToTask = convertPatternGroupToTask;
8723
8724 var async$6 = {};
8725
8726 var stream$2 = {};
8727
8728 var out$3 = {};
8729
8730 var async$5 = {};
8731
8732 Object.defineProperty(async$5, "__esModule", {
8733   value: true
8734 });
8735 async$5.read = void 0;
8736
8737 function read$3(path, settings, callback) {
8738   settings.fs.lstat(path, (lstatError, lstat) => {
8739     if (lstatError !== null) {
8740       callFailureCallback$2(callback, lstatError);
8741       return;
8742     }
8743
8744     if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
8745       callSuccessCallback$2(callback, lstat);
8746       return;
8747     }
8748
8749     settings.fs.stat(path, (statError, stat) => {
8750       if (statError !== null) {
8751         if (settings.throwErrorOnBrokenSymbolicLink) {
8752           callFailureCallback$2(callback, statError);
8753           return;
8754         }
8755
8756         callSuccessCallback$2(callback, lstat);
8757         return;
8758       }
8759
8760       if (settings.markSymbolicLink) {
8761         stat.isSymbolicLink = () => true;
8762       }
8763
8764       callSuccessCallback$2(callback, stat);
8765     });
8766   });
8767 }
8768
8769 async$5.read = read$3;
8770
8771 function callFailureCallback$2(callback, error) {
8772   callback(error);
8773 }
8774
8775 function callSuccessCallback$2(callback, result) {
8776   callback(null, result);
8777 }
8778
8779 var sync$7 = {};
8780
8781 Object.defineProperty(sync$7, "__esModule", {
8782   value: true
8783 });
8784 sync$7.read = void 0;
8785
8786 function read$2(path, settings) {
8787   const lstat = settings.fs.lstatSync(path);
8788
8789   if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
8790     return lstat;
8791   }
8792
8793   try {
8794     const stat = settings.fs.statSync(path);
8795
8796     if (settings.markSymbolicLink) {
8797       stat.isSymbolicLink = () => true;
8798     }
8799
8800     return stat;
8801   } catch (error) {
8802     if (!settings.throwErrorOnBrokenSymbolicLink) {
8803       return lstat;
8804     }
8805
8806     throw error;
8807   }
8808 }
8809
8810 sync$7.read = read$2;
8811
8812 var settings$3 = {};
8813
8814 var fs$7 = {};
8815
8816 (function (exports) {
8817
8818   Object.defineProperty(exports, "__esModule", {
8819     value: true
8820   });
8821   exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0;
8822   const fs = require$$0__default$4["default"];
8823   exports.FILE_SYSTEM_ADAPTER = {
8824     lstat: fs.lstat,
8825     stat: fs.stat,
8826     lstatSync: fs.lstatSync,
8827     statSync: fs.statSync
8828   };
8829
8830   function createFileSystemAdapter(fsMethods) {
8831     if (fsMethods === undefined) {
8832       return exports.FILE_SYSTEM_ADAPTER;
8833     }
8834
8835     return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
8836   }
8837
8838   exports.createFileSystemAdapter = createFileSystemAdapter;
8839 })(fs$7);
8840
8841 Object.defineProperty(settings$3, "__esModule", {
8842   value: true
8843 });
8844 const fs$6 = fs$7;
8845
8846 class Settings$2 {
8847   constructor(_options = {}) {
8848     this._options = _options;
8849     this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true);
8850     this.fs = fs$6.createFileSystemAdapter(this._options.fs);
8851     this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false);
8852     this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
8853   }
8854
8855   _getValue(option, value) {
8856     return option !== null && option !== void 0 ? option : value;
8857   }
8858
8859 }
8860
8861 settings$3.default = Settings$2;
8862
8863 Object.defineProperty(out$3, "__esModule", {
8864   value: true
8865 });
8866 out$3.statSync = out$3.stat = out$3.Settings = void 0;
8867 const async$4 = async$5;
8868 const sync$6 = sync$7;
8869 const settings_1$3 = settings$3;
8870 out$3.Settings = settings_1$3.default;
8871
8872 function stat(path, optionsOrSettingsOrCallback, callback) {
8873   if (typeof optionsOrSettingsOrCallback === 'function') {
8874     async$4.read(path, getSettings$2(), optionsOrSettingsOrCallback);
8875     return;
8876   }
8877
8878   async$4.read(path, getSettings$2(optionsOrSettingsOrCallback), callback);
8879 }
8880
8881 out$3.stat = stat;
8882
8883 function statSync(path, optionsOrSettings) {
8884   const settings = getSettings$2(optionsOrSettings);
8885   return sync$6.read(path, settings);
8886 }
8887
8888 out$3.statSync = statSync;
8889
8890 function getSettings$2(settingsOrOptions = {}) {
8891   if (settingsOrOptions instanceof settings_1$3.default) {
8892     return settingsOrOptions;
8893   }
8894
8895   return new settings_1$3.default(settingsOrOptions);
8896 }
8897
8898 var out$2 = {};
8899
8900 var async$3 = {};
8901
8902 var async$2 = {};
8903
8904 var out$1 = {};
8905
8906 var async$1 = {};
8907
8908 /*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
8909 let promise;
8910 var queueMicrotask_1 = typeof queueMicrotask === 'function' ? queueMicrotask.bind(typeof window !== 'undefined' ? window : global) // reuse resolved promise, and allocate it lazily
8911 : cb => (promise || (promise = Promise.resolve())).then(cb).catch(err => setTimeout(() => {
8912   throw err;
8913 }, 0));
8914
8915 /*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
8916 var runParallel_1 = runParallel;
8917 const queueMicrotask$1 = queueMicrotask_1;
8918
8919 function runParallel(tasks, cb) {
8920   let results, pending, keys;
8921   let isSync = true;
8922
8923   if (Array.isArray(tasks)) {
8924     results = [];
8925     pending = tasks.length;
8926   } else {
8927     keys = Object.keys(tasks);
8928     results = {};
8929     pending = keys.length;
8930   }
8931
8932   function done(err) {
8933     function end() {
8934       if (cb) cb(err, results);
8935       cb = null;
8936     }
8937
8938     if (isSync) queueMicrotask$1(end);else end();
8939   }
8940
8941   function each(i, err, result) {
8942     results[i] = result;
8943
8944     if (--pending === 0 || err) {
8945       done(err);
8946     }
8947   }
8948
8949   if (!pending) {
8950     // empty
8951     done(null);
8952   } else if (keys) {
8953     // object
8954     keys.forEach(function (key) {
8955       tasks[key](function (err, result) {
8956         each(key, err, result);
8957       });
8958     });
8959   } else {
8960     // array
8961     tasks.forEach(function (task, i) {
8962       task(function (err, result) {
8963         each(i, err, result);
8964       });
8965     });
8966   }
8967
8968   isSync = false;
8969 }
8970
8971 var constants = {};
8972
8973 Object.defineProperty(constants, "__esModule", {
8974   value: true
8975 });
8976 constants.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0;
8977 const NODE_PROCESS_VERSION_PARTS = process.versions.node.split('.');
8978
8979 if (NODE_PROCESS_VERSION_PARTS[0] === undefined || NODE_PROCESS_VERSION_PARTS[1] === undefined) {
8980   throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);
8981 }
8982
8983 const MAJOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[0], 10);
8984 const MINOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[1], 10);
8985 const SUPPORTED_MAJOR_VERSION = 10;
8986 const SUPPORTED_MINOR_VERSION = 10;
8987 const IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION;
8988 const IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION;
8989 /**
8990  * IS `true` for Node.js 10.10 and greater.
8991  */
8992
8993 constants.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR;
8994
8995 var utils$9 = {};
8996
8997 var fs$5 = {};
8998
8999 Object.defineProperty(fs$5, "__esModule", {
9000   value: true
9001 });
9002 fs$5.createDirentFromStats = void 0;
9003
9004 class DirentFromStats {
9005   constructor(name, stats) {
9006     this.name = name;
9007     this.isBlockDevice = stats.isBlockDevice.bind(stats);
9008     this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
9009     this.isDirectory = stats.isDirectory.bind(stats);
9010     this.isFIFO = stats.isFIFO.bind(stats);
9011     this.isFile = stats.isFile.bind(stats);
9012     this.isSocket = stats.isSocket.bind(stats);
9013     this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
9014   }
9015
9016 }
9017
9018 function createDirentFromStats(name, stats) {
9019   return new DirentFromStats(name, stats);
9020 }
9021
9022 fs$5.createDirentFromStats = createDirentFromStats;
9023
9024 Object.defineProperty(utils$9, "__esModule", {
9025   value: true
9026 });
9027 utils$9.fs = void 0;
9028 const fs$4 = fs$5;
9029 utils$9.fs = fs$4;
9030
9031 var common$6 = {};
9032
9033 Object.defineProperty(common$6, "__esModule", {
9034   value: true
9035 });
9036 common$6.joinPathSegments = void 0;
9037
9038 function joinPathSegments$1(a, b, separator) {
9039   /**
9040    * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`).
9041    */
9042   if (a.endsWith(separator)) {
9043     return a + b;
9044   }
9045
9046   return a + separator + b;
9047 }
9048
9049 common$6.joinPathSegments = joinPathSegments$1;
9050
9051 Object.defineProperty(async$1, "__esModule", {
9052   value: true
9053 });
9054 async$1.readdir = async$1.readdirWithFileTypes = async$1.read = void 0;
9055 const fsStat$5 = out$3;
9056 const rpl = runParallel_1;
9057 const constants_1$1 = constants;
9058 const utils$8 = utils$9;
9059 const common$5 = common$6;
9060
9061 function read$1(directory, settings, callback) {
9062   if (!settings.stats && constants_1$1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
9063     readdirWithFileTypes$1(directory, settings, callback);
9064     return;
9065   }
9066
9067   readdir$1(directory, settings, callback);
9068 }
9069
9070 async$1.read = read$1;
9071
9072 function readdirWithFileTypes$1(directory, settings, callback) {
9073   settings.fs.readdir(directory, {
9074     withFileTypes: true
9075   }, (readdirError, dirents) => {
9076     if (readdirError !== null) {
9077       callFailureCallback$1(callback, readdirError);
9078       return;
9079     }
9080
9081     const entries = dirents.map(dirent => ({
9082       dirent,
9083       name: dirent.name,
9084       path: common$5.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
9085     }));
9086
9087     if (!settings.followSymbolicLinks) {
9088       callSuccessCallback$1(callback, entries);
9089       return;
9090     }
9091
9092     const tasks = entries.map(entry => makeRplTaskEntry(entry, settings));
9093     rpl(tasks, (rplError, rplEntries) => {
9094       if (rplError !== null) {
9095         callFailureCallback$1(callback, rplError);
9096         return;
9097       }
9098
9099       callSuccessCallback$1(callback, rplEntries);
9100     });
9101   });
9102 }
9103
9104 async$1.readdirWithFileTypes = readdirWithFileTypes$1;
9105
9106 function makeRplTaskEntry(entry, settings) {
9107   return done => {
9108     if (!entry.dirent.isSymbolicLink()) {
9109       done(null, entry);
9110       return;
9111     }
9112
9113     settings.fs.stat(entry.path, (statError, stats) => {
9114       if (statError !== null) {
9115         if (settings.throwErrorOnBrokenSymbolicLink) {
9116           done(statError);
9117           return;
9118         }
9119
9120         done(null, entry);
9121         return;
9122       }
9123
9124       entry.dirent = utils$8.fs.createDirentFromStats(entry.name, stats);
9125       done(null, entry);
9126     });
9127   };
9128 }
9129
9130 function readdir$1(directory, settings, callback) {
9131   settings.fs.readdir(directory, (readdirError, names) => {
9132     if (readdirError !== null) {
9133       callFailureCallback$1(callback, readdirError);
9134       return;
9135     }
9136
9137     const tasks = names.map(name => {
9138       const path = common$5.joinPathSegments(directory, name, settings.pathSegmentSeparator);
9139       return done => {
9140         fsStat$5.stat(path, settings.fsStatSettings, (error, stats) => {
9141           if (error !== null) {
9142             done(error);
9143             return;
9144           }
9145
9146           const entry = {
9147             name,
9148             path,
9149             dirent: utils$8.fs.createDirentFromStats(name, stats)
9150           };
9151
9152           if (settings.stats) {
9153             entry.stats = stats;
9154           }
9155
9156           done(null, entry);
9157         });
9158       };
9159     });
9160     rpl(tasks, (rplError, entries) => {
9161       if (rplError !== null) {
9162         callFailureCallback$1(callback, rplError);
9163         return;
9164       }
9165
9166       callSuccessCallback$1(callback, entries);
9167     });
9168   });
9169 }
9170
9171 async$1.readdir = readdir$1;
9172
9173 function callFailureCallback$1(callback, error) {
9174   callback(error);
9175 }
9176
9177 function callSuccessCallback$1(callback, result) {
9178   callback(null, result);
9179 }
9180
9181 var sync$5 = {};
9182
9183 Object.defineProperty(sync$5, "__esModule", {
9184   value: true
9185 });
9186 sync$5.readdir = sync$5.readdirWithFileTypes = sync$5.read = void 0;
9187 const fsStat$4 = out$3;
9188 const constants_1 = constants;
9189 const utils$7 = utils$9;
9190 const common$4 = common$6;
9191
9192 function read(directory, settings) {
9193   if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
9194     return readdirWithFileTypes(directory, settings);
9195   }
9196
9197   return readdir(directory, settings);
9198 }
9199
9200 sync$5.read = read;
9201
9202 function readdirWithFileTypes(directory, settings) {
9203   const dirents = settings.fs.readdirSync(directory, {
9204     withFileTypes: true
9205   });
9206   return dirents.map(dirent => {
9207     const entry = {
9208       dirent,
9209       name: dirent.name,
9210       path: common$4.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
9211     };
9212
9213     if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) {
9214       try {
9215         const stats = settings.fs.statSync(entry.path);
9216         entry.dirent = utils$7.fs.createDirentFromStats(entry.name, stats);
9217       } catch (error) {
9218         if (settings.throwErrorOnBrokenSymbolicLink) {
9219           throw error;
9220         }
9221       }
9222     }
9223
9224     return entry;
9225   });
9226 }
9227
9228 sync$5.readdirWithFileTypes = readdirWithFileTypes;
9229
9230 function readdir(directory, settings) {
9231   const names = settings.fs.readdirSync(directory);
9232   return names.map(name => {
9233     const entryPath = common$4.joinPathSegments(directory, name, settings.pathSegmentSeparator);
9234     const stats = fsStat$4.statSync(entryPath, settings.fsStatSettings);
9235     const entry = {
9236       name,
9237       path: entryPath,
9238       dirent: utils$7.fs.createDirentFromStats(name, stats)
9239     };
9240
9241     if (settings.stats) {
9242       entry.stats = stats;
9243     }
9244
9245     return entry;
9246   });
9247 }
9248
9249 sync$5.readdir = readdir;
9250
9251 var settings$2 = {};
9252
9253 var fs$3 = {};
9254
9255 (function (exports) {
9256
9257   Object.defineProperty(exports, "__esModule", {
9258     value: true
9259   });
9260   exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0;
9261   const fs = require$$0__default$4["default"];
9262   exports.FILE_SYSTEM_ADAPTER = {
9263     lstat: fs.lstat,
9264     stat: fs.stat,
9265     lstatSync: fs.lstatSync,
9266     statSync: fs.statSync,
9267     readdir: fs.readdir,
9268     readdirSync: fs.readdirSync
9269   };
9270
9271   function createFileSystemAdapter(fsMethods) {
9272     if (fsMethods === undefined) {
9273       return exports.FILE_SYSTEM_ADAPTER;
9274     }
9275
9276     return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
9277   }
9278
9279   exports.createFileSystemAdapter = createFileSystemAdapter;
9280 })(fs$3);
9281
9282 Object.defineProperty(settings$2, "__esModule", {
9283   value: true
9284 });
9285 const path$6 = require$$0__default$1["default"];
9286 const fsStat$3 = out$3;
9287 const fs$2 = fs$3;
9288
9289 class Settings$1 {
9290   constructor(_options = {}) {
9291     this._options = _options;
9292     this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);
9293     this.fs = fs$2.createFileSystemAdapter(this._options.fs);
9294     this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path$6.sep);
9295     this.stats = this._getValue(this._options.stats, false);
9296     this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
9297     this.fsStatSettings = new fsStat$3.Settings({
9298       followSymbolicLink: this.followSymbolicLinks,
9299       fs: this.fs,
9300       throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink
9301     });
9302   }
9303
9304   _getValue(option, value) {
9305     return option !== null && option !== void 0 ? option : value;
9306   }
9307
9308 }
9309
9310 settings$2.default = Settings$1;
9311
9312 Object.defineProperty(out$1, "__esModule", {
9313   value: true
9314 });
9315 out$1.Settings = out$1.scandirSync = out$1.scandir = void 0;
9316 const async = async$1;
9317 const sync$4 = sync$5;
9318 const settings_1$2 = settings$2;
9319 out$1.Settings = settings_1$2.default;
9320
9321 function scandir(path, optionsOrSettingsOrCallback, callback) {
9322   if (typeof optionsOrSettingsOrCallback === 'function') {
9323     async.read(path, getSettings$1(), optionsOrSettingsOrCallback);
9324     return;
9325   }
9326
9327   async.read(path, getSettings$1(optionsOrSettingsOrCallback), callback);
9328 }
9329
9330 out$1.scandir = scandir;
9331
9332 function scandirSync(path, optionsOrSettings) {
9333   const settings = getSettings$1(optionsOrSettings);
9334   return sync$4.read(path, settings);
9335 }
9336
9337 out$1.scandirSync = scandirSync;
9338
9339 function getSettings$1(settingsOrOptions = {}) {
9340   if (settingsOrOptions instanceof settings_1$2.default) {
9341     return settingsOrOptions;
9342   }
9343
9344   return new settings_1$2.default(settingsOrOptions);
9345 }
9346
9347 var queue = {exports: {}};
9348
9349 function reusify$1(Constructor) {
9350   var head = new Constructor();
9351   var tail = head;
9352
9353   function get() {
9354     var current = head;
9355
9356     if (current.next) {
9357       head = current.next;
9358     } else {
9359       head = new Constructor();
9360       tail = head;
9361     }
9362
9363     current.next = null;
9364     return current;
9365   }
9366
9367   function release(obj) {
9368     tail.next = obj;
9369     tail = obj;
9370   }
9371
9372   return {
9373     get: get,
9374     release: release
9375   };
9376 }
9377
9378 var reusify_1 = reusify$1;
9379
9380 /* eslint-disable no-var */
9381
9382
9383 var reusify = reusify_1;
9384
9385 function fastqueue(context, worker, concurrency) {
9386   if (typeof context === 'function') {
9387     concurrency = worker;
9388     worker = context;
9389     context = null;
9390   }
9391
9392   if (concurrency < 1) {
9393     throw new Error('fastqueue concurrency must be greater than 1');
9394   }
9395
9396   var cache = reusify(Task);
9397   var queueHead = null;
9398   var queueTail = null;
9399   var _running = 0;
9400   var errorHandler = null;
9401   var self = {
9402     push: push,
9403     drain: noop,
9404     saturated: noop,
9405     pause: pause,
9406     paused: false,
9407     concurrency: concurrency,
9408     running: running,
9409     resume: resume,
9410     idle: idle,
9411     length: length,
9412     getQueue: getQueue,
9413     unshift: unshift,
9414     empty: noop,
9415     kill: kill,
9416     killAndDrain: killAndDrain,
9417     error: error
9418   };
9419   return self;
9420
9421   function running() {
9422     return _running;
9423   }
9424
9425   function pause() {
9426     self.paused = true;
9427   }
9428
9429   function length() {
9430     var current = queueHead;
9431     var counter = 0;
9432
9433     while (current) {
9434       current = current.next;
9435       counter++;
9436     }
9437
9438     return counter;
9439   }
9440
9441   function getQueue() {
9442     var current = queueHead;
9443     var tasks = [];
9444
9445     while (current) {
9446       tasks.push(current.value);
9447       current = current.next;
9448     }
9449
9450     return tasks;
9451   }
9452
9453   function resume() {
9454     if (!self.paused) return;
9455     self.paused = false;
9456
9457     for (var i = 0; i < self.concurrency; i++) {
9458       _running++;
9459       release();
9460     }
9461   }
9462
9463   function idle() {
9464     return _running === 0 && self.length() === 0;
9465   }
9466
9467   function push(value, done) {
9468     var current = cache.get();
9469     current.context = context;
9470     current.release = release;
9471     current.value = value;
9472     current.callback = done || noop;
9473     current.errorHandler = errorHandler;
9474
9475     if (_running === self.concurrency || self.paused) {
9476       if (queueTail) {
9477         queueTail.next = current;
9478         queueTail = current;
9479       } else {
9480         queueHead = current;
9481         queueTail = current;
9482         self.saturated();
9483       }
9484     } else {
9485       _running++;
9486       worker.call(context, current.value, current.worked);
9487     }
9488   }
9489
9490   function unshift(value, done) {
9491     var current = cache.get();
9492     current.context = context;
9493     current.release = release;
9494     current.value = value;
9495     current.callback = done || noop;
9496
9497     if (_running === self.concurrency || self.paused) {
9498       if (queueHead) {
9499         current.next = queueHead;
9500         queueHead = current;
9501       } else {
9502         queueHead = current;
9503         queueTail = current;
9504         self.saturated();
9505       }
9506     } else {
9507       _running++;
9508       worker.call(context, current.value, current.worked);
9509     }
9510   }
9511
9512   function release(holder) {
9513     if (holder) {
9514       cache.release(holder);
9515     }
9516
9517     var next = queueHead;
9518
9519     if (next) {
9520       if (!self.paused) {
9521         if (queueTail === queueHead) {
9522           queueTail = null;
9523         }
9524
9525         queueHead = next.next;
9526         next.next = null;
9527         worker.call(context, next.value, next.worked);
9528
9529         if (queueTail === null) {
9530           self.empty();
9531         }
9532       } else {
9533         _running--;
9534       }
9535     } else if (--_running === 0) {
9536       self.drain();
9537     }
9538   }
9539
9540   function kill() {
9541     queueHead = null;
9542     queueTail = null;
9543     self.drain = noop;
9544   }
9545
9546   function killAndDrain() {
9547     queueHead = null;
9548     queueTail = null;
9549     self.drain();
9550     self.drain = noop;
9551   }
9552
9553   function error(handler) {
9554     errorHandler = handler;
9555   }
9556 }
9557
9558 function noop() {}
9559
9560 function Task() {
9561   this.value = null;
9562   this.callback = noop;
9563   this.next = null;
9564   this.release = noop;
9565   this.context = null;
9566   this.errorHandler = null;
9567   var self = this;
9568
9569   this.worked = function worked(err, result) {
9570     var callback = self.callback;
9571     var errorHandler = self.errorHandler;
9572     var val = self.value;
9573     self.value = null;
9574     self.callback = noop;
9575
9576     if (self.errorHandler) {
9577       errorHandler(err, val);
9578     }
9579
9580     callback.call(self.context, err, result);
9581     self.release(self);
9582   };
9583 }
9584
9585 function queueAsPromised(context, worker, concurrency) {
9586   if (typeof context === 'function') {
9587     concurrency = worker;
9588     worker = context;
9589     context = null;
9590   }
9591
9592   function asyncWrapper(arg, cb) {
9593     worker.call(this, arg).then(function (res) {
9594       cb(null, res);
9595     }, cb);
9596   }
9597
9598   var queue = fastqueue(context, asyncWrapper, concurrency);
9599   var pushCb = queue.push;
9600   var unshiftCb = queue.unshift;
9601   queue.push = push;
9602   queue.unshift = unshift;
9603   queue.drained = drained;
9604   return queue;
9605
9606   function push(value) {
9607     var p = new Promise(function (resolve, reject) {
9608       pushCb(value, function (err, result) {
9609         if (err) {
9610           reject(err);
9611           return;
9612         }
9613
9614         resolve(result);
9615       });
9616     }); // Let's fork the promise chain to
9617     // make the error bubble up to the user but
9618     // not lead to a unhandledRejection
9619
9620     p.catch(noop);
9621     return p;
9622   }
9623
9624   function unshift(value) {
9625     var p = new Promise(function (resolve, reject) {
9626       unshiftCb(value, function (err, result) {
9627         if (err) {
9628           reject(err);
9629           return;
9630         }
9631
9632         resolve(result);
9633       });
9634     }); // Let's fork the promise chain to
9635     // make the error bubble up to the user but
9636     // not lead to a unhandledRejection
9637
9638     p.catch(noop);
9639     return p;
9640   }
9641
9642   function drained() {
9643     var previousDrain = queue.drain;
9644     var p = new Promise(function (resolve) {
9645       queue.drain = function () {
9646         previousDrain();
9647         resolve();
9648       };
9649     });
9650     return p;
9651   }
9652 }
9653
9654 queue.exports = fastqueue;
9655 queue.exports.promise = queueAsPromised;
9656
9657 var common$3 = {};
9658
9659 Object.defineProperty(common$3, "__esModule", {
9660   value: true
9661 });
9662 common$3.joinPathSegments = common$3.replacePathSegmentSeparator = common$3.isAppliedFilter = common$3.isFatalError = void 0;
9663
9664 function isFatalError(settings, error) {
9665   if (settings.errorFilter === null) {
9666     return true;
9667   }
9668
9669   return !settings.errorFilter(error);
9670 }
9671
9672 common$3.isFatalError = isFatalError;
9673
9674 function isAppliedFilter(filter, value) {
9675   return filter === null || filter(value);
9676 }
9677
9678 common$3.isAppliedFilter = isAppliedFilter;
9679
9680 function replacePathSegmentSeparator(filepath, separator) {
9681   return filepath.split(/[/\\]/).join(separator);
9682 }
9683
9684 common$3.replacePathSegmentSeparator = replacePathSegmentSeparator;
9685
9686 function joinPathSegments(a, b, separator) {
9687   if (a === '') {
9688     return b;
9689   }
9690   /**
9691    * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`).
9692    */
9693
9694
9695   if (a.endsWith(separator)) {
9696     return a + b;
9697   }
9698
9699   return a + separator + b;
9700 }
9701
9702 common$3.joinPathSegments = joinPathSegments;
9703
9704 var reader$1 = {};
9705
9706 Object.defineProperty(reader$1, "__esModule", {
9707   value: true
9708 });
9709 const common$2 = common$3;
9710
9711 class Reader$1 {
9712   constructor(_root, _settings) {
9713     this._root = _root;
9714     this._settings = _settings;
9715     this._root = common$2.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator);
9716   }
9717
9718 }
9719
9720 reader$1.default = Reader$1;
9721
9722 Object.defineProperty(async$2, "__esModule", {
9723   value: true
9724 });
9725 const events_1 = require$$0__default$5["default"];
9726 const fsScandir$2 = out$1;
9727 const fastq = queue.exports;
9728 const common$1 = common$3;
9729 const reader_1$3 = reader$1;
9730
9731 class AsyncReader extends reader_1$3.default {
9732   constructor(_root, _settings) {
9733     super(_root, _settings);
9734     this._settings = _settings;
9735     this._scandir = fsScandir$2.scandir;
9736     this._emitter = new events_1.EventEmitter();
9737     this._queue = fastq(this._worker.bind(this), this._settings.concurrency);
9738     this._isFatalError = false;
9739     this._isDestroyed = false;
9740
9741     this._queue.drain = () => {
9742       if (!this._isFatalError) {
9743         this._emitter.emit('end');
9744       }
9745     };
9746   }
9747
9748   read() {
9749     this._isFatalError = false;
9750     this._isDestroyed = false;
9751     setImmediate(() => {
9752       this._pushToQueue(this._root, this._settings.basePath);
9753     });
9754     return this._emitter;
9755   }
9756
9757   get isDestroyed() {
9758     return this._isDestroyed;
9759   }
9760
9761   destroy() {
9762     if (this._isDestroyed) {
9763       throw new Error('The reader is already destroyed');
9764     }
9765
9766     this._isDestroyed = true;
9767
9768     this._queue.killAndDrain();
9769   }
9770
9771   onEntry(callback) {
9772     this._emitter.on('entry', callback);
9773   }
9774
9775   onError(callback) {
9776     this._emitter.once('error', callback);
9777   }
9778
9779   onEnd(callback) {
9780     this._emitter.once('end', callback);
9781   }
9782
9783   _pushToQueue(directory, base) {
9784     const queueItem = {
9785       directory,
9786       base
9787     };
9788
9789     this._queue.push(queueItem, error => {
9790       if (error !== null) {
9791         this._handleError(error);
9792       }
9793     });
9794   }
9795
9796   _worker(item, done) {
9797     this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries) => {
9798       if (error !== null) {
9799         done(error, undefined);
9800         return;
9801       }
9802
9803       for (const entry of entries) {
9804         this._handleEntry(entry, item.base);
9805       }
9806
9807       done(null, undefined);
9808     });
9809   }
9810
9811   _handleError(error) {
9812     if (this._isDestroyed || !common$1.isFatalError(this._settings, error)) {
9813       return;
9814     }
9815
9816     this._isFatalError = true;
9817     this._isDestroyed = true;
9818
9819     this._emitter.emit('error', error);
9820   }
9821
9822   _handleEntry(entry, base) {
9823     if (this._isDestroyed || this._isFatalError) {
9824       return;
9825     }
9826
9827     const fullpath = entry.path;
9828
9829     if (base !== undefined) {
9830       entry.path = common$1.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
9831     }
9832
9833     if (common$1.isAppliedFilter(this._settings.entryFilter, entry)) {
9834       this._emitEntry(entry);
9835     }
9836
9837     if (entry.dirent.isDirectory() && common$1.isAppliedFilter(this._settings.deepFilter, entry)) {
9838       this._pushToQueue(fullpath, base === undefined ? undefined : entry.path);
9839     }
9840   }
9841
9842   _emitEntry(entry) {
9843     this._emitter.emit('entry', entry);
9844   }
9845
9846 }
9847
9848 async$2.default = AsyncReader;
9849
9850 Object.defineProperty(async$3, "__esModule", {
9851   value: true
9852 });
9853 const async_1$3 = async$2;
9854
9855 class AsyncProvider {
9856   constructor(_root, _settings) {
9857     this._root = _root;
9858     this._settings = _settings;
9859     this._reader = new async_1$3.default(this._root, this._settings);
9860     this._storage = [];
9861   }
9862
9863   read(callback) {
9864     this._reader.onError(error => {
9865       callFailureCallback(callback, error);
9866     });
9867
9868     this._reader.onEntry(entry => {
9869       this._storage.push(entry);
9870     });
9871
9872     this._reader.onEnd(() => {
9873       callSuccessCallback(callback, this._storage);
9874     });
9875
9876     this._reader.read();
9877   }
9878
9879 }
9880
9881 async$3.default = AsyncProvider;
9882
9883 function callFailureCallback(callback, error) {
9884   callback(error);
9885 }
9886
9887 function callSuccessCallback(callback, entries) {
9888   callback(null, entries);
9889 }
9890
9891 var stream$1 = {};
9892
9893 Object.defineProperty(stream$1, "__esModule", {
9894   value: true
9895 });
9896 const stream_1$5 = require$$0__default$3["default"];
9897 const async_1$2 = async$2;
9898
9899 class StreamProvider {
9900   constructor(_root, _settings) {
9901     this._root = _root;
9902     this._settings = _settings;
9903     this._reader = new async_1$2.default(this._root, this._settings);
9904     this._stream = new stream_1$5.Readable({
9905       objectMode: true,
9906       read: () => {},
9907       destroy: () => {
9908         if (!this._reader.isDestroyed) {
9909           this._reader.destroy();
9910         }
9911       }
9912     });
9913   }
9914
9915   read() {
9916     this._reader.onError(error => {
9917       this._stream.emit('error', error);
9918     });
9919
9920     this._reader.onEntry(entry => {
9921       this._stream.push(entry);
9922     });
9923
9924     this._reader.onEnd(() => {
9925       this._stream.push(null);
9926     });
9927
9928     this._reader.read();
9929
9930     return this._stream;
9931   }
9932
9933 }
9934
9935 stream$1.default = StreamProvider;
9936
9937 var sync$3 = {};
9938
9939 var sync$2 = {};
9940
9941 Object.defineProperty(sync$2, "__esModule", {
9942   value: true
9943 });
9944 const fsScandir$1 = out$1;
9945 const common = common$3;
9946 const reader_1$2 = reader$1;
9947
9948 class SyncReader extends reader_1$2.default {
9949   constructor() {
9950     super(...arguments);
9951     this._scandir = fsScandir$1.scandirSync;
9952     this._storage = [];
9953     this._queue = new Set();
9954   }
9955
9956   read() {
9957     this._pushToQueue(this._root, this._settings.basePath);
9958
9959     this._handleQueue();
9960
9961     return this._storage;
9962   }
9963
9964   _pushToQueue(directory, base) {
9965     this._queue.add({
9966       directory,
9967       base
9968     });
9969   }
9970
9971   _handleQueue() {
9972     for (const item of this._queue.values()) {
9973       this._handleDirectory(item.directory, item.base);
9974     }
9975   }
9976
9977   _handleDirectory(directory, base) {
9978     try {
9979       const entries = this._scandir(directory, this._settings.fsScandirSettings);
9980
9981       for (const entry of entries) {
9982         this._handleEntry(entry, base);
9983       }
9984     } catch (error) {
9985       this._handleError(error);
9986     }
9987   }
9988
9989   _handleError(error) {
9990     if (!common.isFatalError(this._settings, error)) {
9991       return;
9992     }
9993
9994     throw error;
9995   }
9996
9997   _handleEntry(entry, base) {
9998     const fullpath = entry.path;
9999
10000     if (base !== undefined) {
10001       entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
10002     }
10003
10004     if (common.isAppliedFilter(this._settings.entryFilter, entry)) {
10005       this._pushToStorage(entry);
10006     }
10007
10008     if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) {
10009       this._pushToQueue(fullpath, base === undefined ? undefined : entry.path);
10010     }
10011   }
10012
10013   _pushToStorage(entry) {
10014     this._storage.push(entry);
10015   }
10016
10017 }
10018
10019 sync$2.default = SyncReader;
10020
10021 Object.defineProperty(sync$3, "__esModule", {
10022   value: true
10023 });
10024 const sync_1$3 = sync$2;
10025
10026 class SyncProvider {
10027   constructor(_root, _settings) {
10028     this._root = _root;
10029     this._settings = _settings;
10030     this._reader = new sync_1$3.default(this._root, this._settings);
10031   }
10032
10033   read() {
10034     return this._reader.read();
10035   }
10036
10037 }
10038
10039 sync$3.default = SyncProvider;
10040
10041 var settings$1 = {};
10042
10043 Object.defineProperty(settings$1, "__esModule", {
10044   value: true
10045 });
10046 const path$5 = require$$0__default$1["default"];
10047 const fsScandir = out$1;
10048
10049 class Settings {
10050   constructor(_options = {}) {
10051     this._options = _options;
10052     this.basePath = this._getValue(this._options.basePath, undefined);
10053     this.concurrency = this._getValue(this._options.concurrency, Number.POSITIVE_INFINITY);
10054     this.deepFilter = this._getValue(this._options.deepFilter, null);
10055     this.entryFilter = this._getValue(this._options.entryFilter, null);
10056     this.errorFilter = this._getValue(this._options.errorFilter, null);
10057     this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path$5.sep);
10058     this.fsScandirSettings = new fsScandir.Settings({
10059       followSymbolicLinks: this._options.followSymbolicLinks,
10060       fs: this._options.fs,
10061       pathSegmentSeparator: this._options.pathSegmentSeparator,
10062       stats: this._options.stats,
10063       throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink
10064     });
10065   }
10066
10067   _getValue(option, value) {
10068     return option !== null && option !== void 0 ? option : value;
10069   }
10070
10071 }
10072
10073 settings$1.default = Settings;
10074
10075 Object.defineProperty(out$2, "__esModule", {
10076   value: true
10077 });
10078 out$2.Settings = out$2.walkStream = out$2.walkSync = out$2.walk = void 0;
10079 const async_1$1 = async$3;
10080 const stream_1$4 = stream$1;
10081 const sync_1$2 = sync$3;
10082 const settings_1$1 = settings$1;
10083 out$2.Settings = settings_1$1.default;
10084
10085 function walk(directory, optionsOrSettingsOrCallback, callback) {
10086   if (typeof optionsOrSettingsOrCallback === 'function') {
10087     new async_1$1.default(directory, getSettings()).read(optionsOrSettingsOrCallback);
10088     return;
10089   }
10090
10091   new async_1$1.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback);
10092 }
10093
10094 out$2.walk = walk;
10095
10096 function walkSync(directory, optionsOrSettings) {
10097   const settings = getSettings(optionsOrSettings);
10098   const provider = new sync_1$2.default(directory, settings);
10099   return provider.read();
10100 }
10101
10102 out$2.walkSync = walkSync;
10103
10104 function walkStream(directory, optionsOrSettings) {
10105   const settings = getSettings(optionsOrSettings);
10106   const provider = new stream_1$4.default(directory, settings);
10107   return provider.read();
10108 }
10109
10110 out$2.walkStream = walkStream;
10111
10112 function getSettings(settingsOrOptions = {}) {
10113   if (settingsOrOptions instanceof settings_1$1.default) {
10114     return settingsOrOptions;
10115   }
10116
10117   return new settings_1$1.default(settingsOrOptions);
10118 }
10119
10120 var reader = {};
10121
10122 Object.defineProperty(reader, "__esModule", {
10123   value: true
10124 });
10125 const path$4 = require$$0__default$1["default"];
10126 const fsStat$2 = out$3;
10127 const utils$6 = utils$k;
10128
10129 class Reader {
10130   constructor(_settings) {
10131     this._settings = _settings;
10132     this._fsStatSettings = new fsStat$2.Settings({
10133       followSymbolicLink: this._settings.followSymbolicLinks,
10134       fs: this._settings.fs,
10135       throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks
10136     });
10137   }
10138
10139   _getFullEntryPath(filepath) {
10140     return path$4.resolve(this._settings.cwd, filepath);
10141   }
10142
10143   _makeEntry(stats, pattern) {
10144     const entry = {
10145       name: pattern,
10146       path: pattern,
10147       dirent: utils$6.fs.createDirentFromStats(pattern, stats)
10148     };
10149
10150     if (this._settings.stats) {
10151       entry.stats = stats;
10152     }
10153
10154     return entry;
10155   }
10156
10157   _isFatalError(error) {
10158     return !utils$6.errno.isEnoentCodeError(error) && !this._settings.suppressErrors;
10159   }
10160
10161 }
10162
10163 reader.default = Reader;
10164
10165 Object.defineProperty(stream$2, "__esModule", {
10166   value: true
10167 });
10168 const stream_1$3 = require$$0__default$3["default"];
10169 const fsStat$1 = out$3;
10170 const fsWalk$1 = out$2;
10171 const reader_1$1 = reader;
10172
10173 class ReaderStream extends reader_1$1.default {
10174   constructor() {
10175     super(...arguments);
10176     this._walkStream = fsWalk$1.walkStream;
10177     this._stat = fsStat$1.stat;
10178   }
10179
10180   dynamic(root, options) {
10181     return this._walkStream(root, options);
10182   }
10183
10184   static(patterns, options) {
10185     const filepaths = patterns.map(this._getFullEntryPath, this);
10186     const stream = new stream_1$3.PassThrough({
10187       objectMode: true
10188     });
10189
10190     stream._write = (index, _enc, done) => {
10191       return this._getEntry(filepaths[index], patterns[index], options).then(entry => {
10192         if (entry !== null && options.entryFilter(entry)) {
10193           stream.push(entry);
10194         }
10195
10196         if (index === filepaths.length - 1) {
10197           stream.end();
10198         }
10199
10200         done();
10201       }).catch(done);
10202     };
10203
10204     for (let i = 0; i < filepaths.length; i++) {
10205       stream.write(i);
10206     }
10207
10208     return stream;
10209   }
10210
10211   _getEntry(filepath, pattern, options) {
10212     return this._getStat(filepath).then(stats => this._makeEntry(stats, pattern)).catch(error => {
10213       if (options.errorFilter(error)) {
10214         return null;
10215       }
10216
10217       throw error;
10218     });
10219   }
10220
10221   _getStat(filepath) {
10222     return new Promise((resolve, reject) => {
10223       this._stat(filepath, this._fsStatSettings, (error, stats) => {
10224         return error === null ? resolve(stats) : reject(error);
10225       });
10226     });
10227   }
10228
10229 }
10230
10231 stream$2.default = ReaderStream;
10232
10233 var provider = {};
10234
10235 var deep = {};
10236
10237 var partial = {};
10238
10239 var matcher = {};
10240
10241 Object.defineProperty(matcher, "__esModule", {
10242   value: true
10243 });
10244 const utils$5 = utils$k;
10245
10246 class Matcher {
10247   constructor(_patterns, _settings, _micromatchOptions) {
10248     this._patterns = _patterns;
10249     this._settings = _settings;
10250     this._micromatchOptions = _micromatchOptions;
10251     this._storage = [];
10252
10253     this._fillStorage();
10254   }
10255
10256   _fillStorage() {
10257     /**
10258      * The original pattern may include `{,*,**,a/*}`, which will lead to problems with matching (unresolved level).
10259      * So, before expand patterns with brace expansion into separated patterns.
10260      */
10261     const patterns = utils$5.pattern.expandPatternsWithBraceExpansion(this._patterns);
10262
10263     for (const pattern of patterns) {
10264       const segments = this._getPatternSegments(pattern);
10265
10266       const sections = this._splitSegmentsIntoSections(segments);
10267
10268       this._storage.push({
10269         complete: sections.length <= 1,
10270         pattern,
10271         segments,
10272         sections
10273       });
10274     }
10275   }
10276
10277   _getPatternSegments(pattern) {
10278     const parts = utils$5.pattern.getPatternParts(pattern, this._micromatchOptions);
10279     return parts.map(part => {
10280       const dynamic = utils$5.pattern.isDynamicPattern(part, this._settings);
10281
10282       if (!dynamic) {
10283         return {
10284           dynamic: false,
10285           pattern: part
10286         };
10287       }
10288
10289       return {
10290         dynamic: true,
10291         pattern: part,
10292         patternRe: utils$5.pattern.makeRe(part, this._micromatchOptions)
10293       };
10294     });
10295   }
10296
10297   _splitSegmentsIntoSections(segments) {
10298     return utils$5.array.splitWhen(segments, segment => segment.dynamic && utils$5.pattern.hasGlobStar(segment.pattern));
10299   }
10300
10301 }
10302
10303 matcher.default = Matcher;
10304
10305 Object.defineProperty(partial, "__esModule", {
10306   value: true
10307 });
10308 const matcher_1 = matcher;
10309
10310 class PartialMatcher extends matcher_1.default {
10311   match(filepath) {
10312     const parts = filepath.split('/');
10313     const levels = parts.length;
10314
10315     const patterns = this._storage.filter(info => !info.complete || info.segments.length > levels);
10316
10317     for (const pattern of patterns) {
10318       const section = pattern.sections[0];
10319       /**
10320        * In this case, the pattern has a globstar and we must read all directories unconditionally,
10321        * but only if the level has reached the end of the first group.
10322        *
10323        * fixtures/{a,b}/**
10324        *  ^ true/false  ^ always true
10325       */
10326
10327       if (!pattern.complete && levels > section.length) {
10328         return true;
10329       }
10330
10331       const match = parts.every((part, index) => {
10332         const segment = pattern.segments[index];
10333
10334         if (segment.dynamic && segment.patternRe.test(part)) {
10335           return true;
10336         }
10337
10338         if (!segment.dynamic && segment.pattern === part) {
10339           return true;
10340         }
10341
10342         return false;
10343       });
10344
10345       if (match) {
10346         return true;
10347       }
10348     }
10349
10350     return false;
10351   }
10352
10353 }
10354
10355 partial.default = PartialMatcher;
10356
10357 Object.defineProperty(deep, "__esModule", {
10358   value: true
10359 });
10360 const utils$4 = utils$k;
10361 const partial_1 = partial;
10362
10363 class DeepFilter {
10364   constructor(_settings, _micromatchOptions) {
10365     this._settings = _settings;
10366     this._micromatchOptions = _micromatchOptions;
10367   }
10368
10369   getFilter(basePath, positive, negative) {
10370     const matcher = this._getMatcher(positive);
10371
10372     const negativeRe = this._getNegativePatternsRe(negative);
10373
10374     return entry => this._filter(basePath, entry, matcher, negativeRe);
10375   }
10376
10377   _getMatcher(patterns) {
10378     return new partial_1.default(patterns, this._settings, this._micromatchOptions);
10379   }
10380
10381   _getNegativePatternsRe(patterns) {
10382     const affectDepthOfReadingPatterns = patterns.filter(utils$4.pattern.isAffectDepthOfReadingPattern);
10383     return utils$4.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions);
10384   }
10385
10386   _filter(basePath, entry, matcher, negativeRe) {
10387     if (this._isSkippedByDeep(basePath, entry.path)) {
10388       return false;
10389     }
10390
10391     if (this._isSkippedSymbolicLink(entry)) {
10392       return false;
10393     }
10394
10395     const filepath = utils$4.path.removeLeadingDotSegment(entry.path);
10396
10397     if (this._isSkippedByPositivePatterns(filepath, matcher)) {
10398       return false;
10399     }
10400
10401     return this._isSkippedByNegativePatterns(filepath, negativeRe);
10402   }
10403
10404   _isSkippedByDeep(basePath, entryPath) {
10405     /**
10406      * Avoid unnecessary depth calculations when it doesn't matter.
10407      */
10408     if (this._settings.deep === Infinity) {
10409       return false;
10410     }
10411
10412     return this._getEntryLevel(basePath, entryPath) >= this._settings.deep;
10413   }
10414
10415   _getEntryLevel(basePath, entryPath) {
10416     const entryPathDepth = entryPath.split('/').length;
10417
10418     if (basePath === '') {
10419       return entryPathDepth;
10420     }
10421
10422     const basePathDepth = basePath.split('/').length;
10423     return entryPathDepth - basePathDepth;
10424   }
10425
10426   _isSkippedSymbolicLink(entry) {
10427     return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink();
10428   }
10429
10430   _isSkippedByPositivePatterns(entryPath, matcher) {
10431     return !this._settings.baseNameMatch && !matcher.match(entryPath);
10432   }
10433
10434   _isSkippedByNegativePatterns(entryPath, patternsRe) {
10435     return !utils$4.pattern.matchAny(entryPath, patternsRe);
10436   }
10437
10438 }
10439
10440 deep.default = DeepFilter;
10441
10442 var entry$1 = {};
10443
10444 Object.defineProperty(entry$1, "__esModule", {
10445   value: true
10446 });
10447 const utils$3 = utils$k;
10448
10449 class EntryFilter {
10450   constructor(_settings, _micromatchOptions) {
10451     this._settings = _settings;
10452     this._micromatchOptions = _micromatchOptions;
10453     this.index = new Map();
10454   }
10455
10456   getFilter(positive, negative) {
10457     const positiveRe = utils$3.pattern.convertPatternsToRe(positive, this._micromatchOptions);
10458     const negativeRe = utils$3.pattern.convertPatternsToRe(negative, this._micromatchOptions);
10459     return entry => this._filter(entry, positiveRe, negativeRe);
10460   }
10461
10462   _filter(entry, positiveRe, negativeRe) {
10463     if (this._settings.unique && this._isDuplicateEntry(entry)) {
10464       return false;
10465     }
10466
10467     if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) {
10468       return false;
10469     }
10470
10471     if (this._isSkippedByAbsoluteNegativePatterns(entry.path, negativeRe)) {
10472       return false;
10473     }
10474
10475     const filepath = this._settings.baseNameMatch ? entry.name : entry.path;
10476     const isMatched = this._isMatchToPatterns(filepath, positiveRe) && !this._isMatchToPatterns(entry.path, negativeRe);
10477
10478     if (this._settings.unique && isMatched) {
10479       this._createIndexRecord(entry);
10480     }
10481
10482     return isMatched;
10483   }
10484
10485   _isDuplicateEntry(entry) {
10486     return this.index.has(entry.path);
10487   }
10488
10489   _createIndexRecord(entry) {
10490     this.index.set(entry.path, undefined);
10491   }
10492
10493   _onlyFileFilter(entry) {
10494     return this._settings.onlyFiles && !entry.dirent.isFile();
10495   }
10496
10497   _onlyDirectoryFilter(entry) {
10498     return this._settings.onlyDirectories && !entry.dirent.isDirectory();
10499   }
10500
10501   _isSkippedByAbsoluteNegativePatterns(entryPath, patternsRe) {
10502     if (!this._settings.absolute) {
10503       return false;
10504     }
10505
10506     const fullpath = utils$3.path.makeAbsolute(this._settings.cwd, entryPath);
10507     return utils$3.pattern.matchAny(fullpath, patternsRe);
10508   }
10509
10510   _isMatchToPatterns(entryPath, patternsRe) {
10511     const filepath = utils$3.path.removeLeadingDotSegment(entryPath);
10512     return utils$3.pattern.matchAny(filepath, patternsRe);
10513   }
10514
10515 }
10516
10517 entry$1.default = EntryFilter;
10518
10519 var error = {};
10520
10521 Object.defineProperty(error, "__esModule", {
10522   value: true
10523 });
10524 const utils$2 = utils$k;
10525
10526 class ErrorFilter {
10527   constructor(_settings) {
10528     this._settings = _settings;
10529   }
10530
10531   getFilter() {
10532     return error => this._isNonFatalError(error);
10533   }
10534
10535   _isNonFatalError(error) {
10536     return utils$2.errno.isEnoentCodeError(error) || this._settings.suppressErrors;
10537   }
10538
10539 }
10540
10541 error.default = ErrorFilter;
10542
10543 var entry = {};
10544
10545 Object.defineProperty(entry, "__esModule", {
10546   value: true
10547 });
10548 const utils$1 = utils$k;
10549
10550 class EntryTransformer {
10551   constructor(_settings) {
10552     this._settings = _settings;
10553   }
10554
10555   getTransformer() {
10556     return entry => this._transform(entry);
10557   }
10558
10559   _transform(entry) {
10560     let filepath = entry.path;
10561
10562     if (this._settings.absolute) {
10563       filepath = utils$1.path.makeAbsolute(this._settings.cwd, filepath);
10564       filepath = utils$1.path.unixify(filepath);
10565     }
10566
10567     if (this._settings.markDirectories && entry.dirent.isDirectory()) {
10568       filepath += '/';
10569     }
10570
10571     if (!this._settings.objectMode) {
10572       return filepath;
10573     }
10574
10575     return Object.assign(Object.assign({}, entry), {
10576       path: filepath
10577     });
10578   }
10579
10580 }
10581
10582 entry.default = EntryTransformer;
10583
10584 Object.defineProperty(provider, "__esModule", {
10585   value: true
10586 });
10587 const path$3 = require$$0__default$1["default"];
10588 const deep_1 = deep;
10589 const entry_1 = entry$1;
10590 const error_1 = error;
10591 const entry_2 = entry;
10592
10593 class Provider {
10594   constructor(_settings) {
10595     this._settings = _settings;
10596     this.errorFilter = new error_1.default(this._settings);
10597     this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions());
10598     this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions());
10599     this.entryTransformer = new entry_2.default(this._settings);
10600   }
10601
10602   _getRootDirectory(task) {
10603     return path$3.resolve(this._settings.cwd, task.base);
10604   }
10605
10606   _getReaderOptions(task) {
10607     const basePath = task.base === '.' ? '' : task.base;
10608     return {
10609       basePath,
10610       pathSegmentSeparator: '/',
10611       concurrency: this._settings.concurrency,
10612       deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative),
10613       entryFilter: this.entryFilter.getFilter(task.positive, task.negative),
10614       errorFilter: this.errorFilter.getFilter(),
10615       followSymbolicLinks: this._settings.followSymbolicLinks,
10616       fs: this._settings.fs,
10617       stats: this._settings.stats,
10618       throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink,
10619       transform: this.entryTransformer.getTransformer()
10620     };
10621   }
10622
10623   _getMicromatchOptions() {
10624     return {
10625       dot: this._settings.dot,
10626       matchBase: this._settings.baseNameMatch,
10627       nobrace: !this._settings.braceExpansion,
10628       nocase: !this._settings.caseSensitiveMatch,
10629       noext: !this._settings.extglob,
10630       noglobstar: !this._settings.globstar,
10631       posix: true,
10632       strictSlashes: false
10633     };
10634   }
10635
10636 }
10637
10638 provider.default = Provider;
10639
10640 Object.defineProperty(async$6, "__esModule", {
10641   value: true
10642 });
10643 const stream_1$2 = stream$2;
10644 const provider_1$2 = provider;
10645
10646 class ProviderAsync extends provider_1$2.default {
10647   constructor() {
10648     super(...arguments);
10649     this._reader = new stream_1$2.default(this._settings);
10650   }
10651
10652   read(task) {
10653     const root = this._getRootDirectory(task);
10654
10655     const options = this._getReaderOptions(task);
10656
10657     const entries = [];
10658     return new Promise((resolve, reject) => {
10659       const stream = this.api(root, task, options);
10660       stream.once('error', reject);
10661       stream.on('data', entry => entries.push(options.transform(entry)));
10662       stream.once('end', () => resolve(entries));
10663     });
10664   }
10665
10666   api(root, task, options) {
10667     if (task.dynamic) {
10668       return this._reader.dynamic(root, options);
10669     }
10670
10671     return this._reader.static(task.patterns, options);
10672   }
10673
10674 }
10675
10676 async$6.default = ProviderAsync;
10677
10678 var stream = {};
10679
10680 Object.defineProperty(stream, "__esModule", {
10681   value: true
10682 });
10683 const stream_1$1 = require$$0__default$3["default"];
10684 const stream_2 = stream$2;
10685 const provider_1$1 = provider;
10686
10687 class ProviderStream extends provider_1$1.default {
10688   constructor() {
10689     super(...arguments);
10690     this._reader = new stream_2.default(this._settings);
10691   }
10692
10693   read(task) {
10694     const root = this._getRootDirectory(task);
10695
10696     const options = this._getReaderOptions(task);
10697
10698     const source = this.api(root, task, options);
10699     const destination = new stream_1$1.Readable({
10700       objectMode: true,
10701       read: () => {}
10702     });
10703     source.once('error', error => destination.emit('error', error)).on('data', entry => destination.emit('data', options.transform(entry))).once('end', () => destination.emit('end'));
10704     destination.once('close', () => source.destroy());
10705     return destination;
10706   }
10707
10708   api(root, task, options) {
10709     if (task.dynamic) {
10710       return this._reader.dynamic(root, options);
10711     }
10712
10713     return this._reader.static(task.patterns, options);
10714   }
10715
10716 }
10717
10718 stream.default = ProviderStream;
10719
10720 var sync$1 = {};
10721
10722 var sync = {};
10723
10724 Object.defineProperty(sync, "__esModule", {
10725   value: true
10726 });
10727 const fsStat = out$3;
10728 const fsWalk = out$2;
10729 const reader_1 = reader;
10730
10731 class ReaderSync extends reader_1.default {
10732   constructor() {
10733     super(...arguments);
10734     this._walkSync = fsWalk.walkSync;
10735     this._statSync = fsStat.statSync;
10736   }
10737
10738   dynamic(root, options) {
10739     return this._walkSync(root, options);
10740   }
10741
10742   static(patterns, options) {
10743     const entries = [];
10744
10745     for (const pattern of patterns) {
10746       const filepath = this._getFullEntryPath(pattern);
10747
10748       const entry = this._getEntry(filepath, pattern, options);
10749
10750       if (entry === null || !options.entryFilter(entry)) {
10751         continue;
10752       }
10753
10754       entries.push(entry);
10755     }
10756
10757     return entries;
10758   }
10759
10760   _getEntry(filepath, pattern, options) {
10761     try {
10762       const stats = this._getStat(filepath);
10763
10764       return this._makeEntry(stats, pattern);
10765     } catch (error) {
10766       if (options.errorFilter(error)) {
10767         return null;
10768       }
10769
10770       throw error;
10771     }
10772   }
10773
10774   _getStat(filepath) {
10775     return this._statSync(filepath, this._fsStatSettings);
10776   }
10777
10778 }
10779
10780 sync.default = ReaderSync;
10781
10782 Object.defineProperty(sync$1, "__esModule", {
10783   value: true
10784 });
10785 const sync_1$1 = sync;
10786 const provider_1 = provider;
10787
10788 class ProviderSync extends provider_1.default {
10789   constructor() {
10790     super(...arguments);
10791     this._reader = new sync_1$1.default(this._settings);
10792   }
10793
10794   read(task) {
10795     const root = this._getRootDirectory(task);
10796
10797     const options = this._getReaderOptions(task);
10798
10799     const entries = this.api(root, task, options);
10800     return entries.map(options.transform);
10801   }
10802
10803   api(root, task, options) {
10804     if (task.dynamic) {
10805       return this._reader.dynamic(root, options);
10806     }
10807
10808     return this._reader.static(task.patterns, options);
10809   }
10810
10811 }
10812
10813 sync$1.default = ProviderSync;
10814
10815 var settings = {};
10816
10817 (function (exports) {
10818
10819   Object.defineProperty(exports, "__esModule", {
10820     value: true
10821   });
10822   exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
10823   const fs = require$$0__default$4["default"];
10824   const os = require$$0__default["default"];
10825   /**
10826    * The `os.cpus` method can return zero. We expect the number of cores to be greater than zero.
10827    * https://github.com/nodejs/node/blob/7faeddf23a98c53896f8b574a6e66589e8fb1eb8/lib/os.js#L106-L107
10828    */
10829
10830   const CPU_COUNT = Math.max(os.cpus().length, 1);
10831   exports.DEFAULT_FILE_SYSTEM_ADAPTER = {
10832     lstat: fs.lstat,
10833     lstatSync: fs.lstatSync,
10834     stat: fs.stat,
10835     statSync: fs.statSync,
10836     readdir: fs.readdir,
10837     readdirSync: fs.readdirSync
10838   };
10839
10840   class Settings {
10841     constructor(_options = {}) {
10842       this._options = _options;
10843       this.absolute = this._getValue(this._options.absolute, false);
10844       this.baseNameMatch = this._getValue(this._options.baseNameMatch, false);
10845       this.braceExpansion = this._getValue(this._options.braceExpansion, true);
10846       this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true);
10847       this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT);
10848       this.cwd = this._getValue(this._options.cwd, process.cwd());
10849       this.deep = this._getValue(this._options.deep, Infinity);
10850       this.dot = this._getValue(this._options.dot, false);
10851       this.extglob = this._getValue(this._options.extglob, true);
10852       this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true);
10853       this.fs = this._getFileSystemMethods(this._options.fs);
10854       this.globstar = this._getValue(this._options.globstar, true);
10855       this.ignore = this._getValue(this._options.ignore, []);
10856       this.markDirectories = this._getValue(this._options.markDirectories, false);
10857       this.objectMode = this._getValue(this._options.objectMode, false);
10858       this.onlyDirectories = this._getValue(this._options.onlyDirectories, false);
10859       this.onlyFiles = this._getValue(this._options.onlyFiles, true);
10860       this.stats = this._getValue(this._options.stats, false);
10861       this.suppressErrors = this._getValue(this._options.suppressErrors, false);
10862       this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false);
10863       this.unique = this._getValue(this._options.unique, true);
10864
10865       if (this.onlyDirectories) {
10866         this.onlyFiles = false;
10867       }
10868
10869       if (this.stats) {
10870         this.objectMode = true;
10871       }
10872     }
10873
10874     _getValue(option, value) {
10875       return option === undefined ? value : option;
10876     }
10877
10878     _getFileSystemMethods(methods = {}) {
10879       return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods);
10880     }
10881
10882   }
10883
10884   exports.default = Settings;
10885 })(settings);
10886
10887 const taskManager = tasks;
10888 const async_1 = async$6;
10889 const stream_1 = stream;
10890 const sync_1 = sync$1;
10891 const settings_1 = settings;
10892 const utils = utils$k;
10893
10894 async function FastGlob(source, options) {
10895   assertPatternsInput(source);
10896   const works = getWorks(source, async_1.default, options);
10897   const result = await Promise.all(works);
10898   return utils.array.flatten(result);
10899 } // https://github.com/typescript-eslint/typescript-eslint/issues/60
10900 // eslint-disable-next-line no-redeclare
10901
10902
10903 (function (FastGlob) {
10904   function sync(source, options) {
10905     assertPatternsInput(source);
10906     const works = getWorks(source, sync_1.default, options);
10907     return utils.array.flatten(works);
10908   }
10909
10910   FastGlob.sync = sync;
10911
10912   function stream(source, options) {
10913     assertPatternsInput(source);
10914     const works = getWorks(source, stream_1.default, options);
10915     /**
10916      * The stream returned by the provider cannot work with an asynchronous iterator.
10917      * To support asynchronous iterators, regardless of the number of tasks, we always multiplex streams.
10918      * This affects performance (+25%). I don't see best solution right now.
10919      */
10920
10921     return utils.stream.merge(works);
10922   }
10923
10924   FastGlob.stream = stream;
10925
10926   function generateTasks(source, options) {
10927     assertPatternsInput(source);
10928     const patterns = [].concat(source);
10929     const settings = new settings_1.default(options);
10930     return taskManager.generate(patterns, settings);
10931   }
10932
10933   FastGlob.generateTasks = generateTasks;
10934
10935   function isDynamicPattern(source, options) {
10936     assertPatternsInput(source);
10937     const settings = new settings_1.default(options);
10938     return utils.pattern.isDynamicPattern(source, settings);
10939   }
10940
10941   FastGlob.isDynamicPattern = isDynamicPattern;
10942
10943   function escapePath(source) {
10944     assertPatternsInput(source);
10945     return utils.path.escape(source);
10946   }
10947
10948   FastGlob.escapePath = escapePath;
10949 })(FastGlob || (FastGlob = {}));
10950
10951 function getWorks(source, _Provider, options) {
10952   const patterns = [].concat(source);
10953   const settings = new settings_1.default(options);
10954   const tasks = taskManager.generate(patterns, settings);
10955   const provider = new _Provider(settings);
10956   return tasks.map(provider.read, provider);
10957 }
10958
10959 function assertPatternsInput(input) {
10960   const source = [].concat(input);
10961   const isValidSource = source.every(item => utils.string.isString(item) && !utils.string.isEmpty(item));
10962
10963   if (!isValidSource) {
10964     throw new TypeError('Patterns must be a string (non empty) or an array of strings');
10965   }
10966 }
10967
10968 var out = FastGlob;
10969
10970 const path$2 = require$$0__default$1["default"];
10971 const {
10972   promises: fs$1
10973 } = require$$0__default$4["default"];
10974 const fastGlob = out;
10975 /** @typedef {import('./context').Context} Context */
10976
10977 /**
10978  * @param {Context} context
10979  */
10980
10981 async function* expandPatterns$1(context) {
10982   const cwd = process.cwd();
10983   const seen = new Set();
10984   let noResults = true;
10985
10986   for await (const pathOrError of expandPatternsInternal(context)) {
10987     noResults = false;
10988
10989     if (typeof pathOrError !== "string") {
10990       yield pathOrError;
10991       continue;
10992     }
10993
10994     const relativePath = path$2.relative(cwd, pathOrError); // filter out duplicates
10995
10996     if (seen.has(relativePath)) {
10997       continue;
10998     }
10999
11000     seen.add(relativePath);
11001     yield relativePath;
11002   }
11003
11004   if (noResults && context.argv["error-on-unmatched-pattern"] !== false) {
11005     // If there was no files and no other errors, let's yield a general error.
11006     yield {
11007       error: `No matching files. Patterns: ${context.filePatterns.join(" ")}`
11008     };
11009   }
11010 }
11011 /**
11012  * @param {Context} context
11013  */
11014
11015
11016 async function* expandPatternsInternal(context) {
11017   // Ignores files in version control systems directories and `node_modules`
11018   const silentlyIgnoredDirs = [".git", ".svn", ".hg"];
11019
11020   if (context.argv["with-node-modules"] !== true) {
11021     silentlyIgnoredDirs.push("node_modules");
11022   }
11023
11024   const globOptions = {
11025     dot: true,
11026     ignore: silentlyIgnoredDirs.map(dir => "**/" + dir)
11027   };
11028   let supportedFilesGlob;
11029   const cwd = process.cwd();
11030   /** @type {Array<{ type: 'file' | 'dir' | 'glob'; glob: string; input: string; }>} */
11031
11032   const entries = [];
11033
11034   for (const pattern of context.filePatterns) {
11035     const absolutePath = path$2.resolve(cwd, pattern);
11036
11037     if (containsIgnoredPathSegment(absolutePath, cwd, silentlyIgnoredDirs)) {
11038       continue;
11039     }
11040
11041     const stat = await statSafe(absolutePath);
11042
11043     if (stat) {
11044       if (stat.isFile()) {
11045         entries.push({
11046           type: "file",
11047           glob: escapePathForGlob(fixWindowsSlashes$1(pattern)),
11048           input: pattern
11049         });
11050       } else if (stat.isDirectory()) {
11051         /*
11052         1. Remove trailing `/`, `fast-glob` can't find files for `src//*.js` pattern
11053         2. Cleanup dirname, when glob `src/../*.js` pattern with `fast-glob`,
11054           it returns files like 'src/../index.js'
11055         */
11056         const relativePath = path$2.relative(cwd, absolutePath) || ".";
11057         entries.push({
11058           type: "dir",
11059           glob: escapePathForGlob(fixWindowsSlashes$1(relativePath)) + "/" + getSupportedFilesGlob(),
11060           input: pattern
11061         });
11062       }
11063     } else if (pattern[0] === "!") {
11064       // convert negative patterns to `ignore` entries
11065       globOptions.ignore.push(fixWindowsSlashes$1(pattern.slice(1)));
11066     } else {
11067       entries.push({
11068         type: "glob",
11069         glob: fixWindowsSlashes$1(pattern),
11070         input: pattern
11071       });
11072     }
11073   }
11074
11075   for (const {
11076     type,
11077     glob,
11078     input
11079   } of entries) {
11080     let result;
11081
11082     try {
11083       result = await fastGlob(glob, globOptions);
11084     } catch ({
11085       message
11086     }) {
11087       /* istanbul ignore next */
11088       yield {
11089         error: `${errorMessages.globError[type]}: ${input}\n${message}`
11090       };
11091       /* istanbul ignore next */
11092
11093       continue;
11094     }
11095
11096     if (result.length === 0) {
11097       if (context.argv["error-on-unmatched-pattern"] !== false) {
11098         yield {
11099           error: `${errorMessages.emptyResults[type]}: "${input}".`
11100         };
11101       }
11102     } else {
11103       yield* sortPaths(result);
11104     }
11105   }
11106
11107   function getSupportedFilesGlob() {
11108     if (!supportedFilesGlob) {
11109       const extensions = context.languages.flatMap(lang => lang.extensions || []);
11110       const filenames = context.languages.flatMap(lang => lang.filenames || []);
11111       supportedFilesGlob = `**/{${[...extensions.map(ext => "*" + (ext[0] === "." ? ext : "." + ext)), ...filenames]}}`;
11112     }
11113
11114     return supportedFilesGlob;
11115   }
11116 }
11117
11118 const errorMessages = {
11119   globError: {
11120     file: "Unable to resolve file",
11121     dir: "Unable to expand directory",
11122     glob: "Unable to expand glob pattern"
11123   },
11124   emptyResults: {
11125     file: "Explicitly specified file was ignored due to negative glob patterns",
11126     dir: "No supported files were found in the directory",
11127     glob: "No files matching the pattern were found"
11128   }
11129 };
11130 /**
11131  * @param {string} absolutePath
11132  * @param {string} cwd
11133  * @param {string[]} ignoredDirectories
11134  */
11135
11136 function containsIgnoredPathSegment(absolutePath, cwd, ignoredDirectories) {
11137   return path$2.relative(cwd, absolutePath).split(path$2.sep).some(dir => ignoredDirectories.includes(dir));
11138 }
11139 /**
11140  * @param {string[]} paths
11141  */
11142
11143
11144 function sortPaths(paths) {
11145   return paths.sort((a, b) => a.localeCompare(b));
11146 }
11147 /**
11148  * Get stats of a given path.
11149  * @param {string} filePath The path to target file.
11150  * @returns {Promise<import('fs').Stats | undefined>} The stats.
11151  */
11152
11153
11154 async function statSafe(filePath) {
11155   try {
11156     return await fs$1.stat(filePath);
11157   } catch (error) {
11158     /* istanbul ignore next */
11159     if (error.code !== "ENOENT") {
11160       throw error;
11161     }
11162   }
11163 }
11164 /**
11165  * This function should be replaced with `fastGlob.escapePath` when these issues are fixed:
11166  * - https://github.com/mrmlnc/fast-glob/issues/261
11167  * - https://github.com/mrmlnc/fast-glob/issues/262
11168  * @param {string} path
11169  */
11170
11171
11172 function escapePathForGlob(path) {
11173   return fastGlob.escapePath(path.replace(/\\/g, "\0") // Workaround for fast-glob#262 (part 1)
11174   ).replace(/\\!/g, "@(!)") // Workaround for fast-glob#261
11175   .replace(/\0/g, "@(\\\\)"); // Workaround for fast-glob#262 (part 2)
11176 }
11177
11178 const isWindows = path$2.sep === "\\";
11179 /**
11180  * Using backslashes in globs is probably not okay, but not accepting
11181  * backslashes as path separators on Windows is even more not okay.
11182  * https://github.com/prettier/prettier/pull/6776#discussion_r380723717
11183  * https://github.com/mrmlnc/fast-glob#how-to-write-patterns-on-windows
11184  * @param {string} pattern
11185  */
11186
11187 function fixWindowsSlashes$1(pattern) {
11188   return isWindows ? pattern.replace(/\\/g, "/") : pattern;
11189 }
11190
11191 var expandPatterns_1 = {
11192   expandPatterns: expandPatterns$1,
11193   fixWindowsSlashes: fixWindowsSlashes$1
11194 };
11195
11196 var iterators = {};
11197
11198 var wellKnownSymbol$2 = wellKnownSymbol$7;
11199 var Iterators$1 = iterators;
11200
11201 var ITERATOR$1 = wellKnownSymbol$2('iterator');
11202 var ArrayPrototype$1 = Array.prototype;
11203
11204 // check on default Array iterator
11205 var isArrayIteratorMethod$1 = function (it) {
11206   return it !== undefined && (Iterators$1.Array === it || ArrayPrototype$1[ITERATOR$1] === it);
11207 };
11208
11209 var classof = classof$4;
11210 var getMethod$1 = getMethod$3;
11211 var Iterators = iterators;
11212 var wellKnownSymbol$1 = wellKnownSymbol$7;
11213
11214 var ITERATOR = wellKnownSymbol$1('iterator');
11215
11216 var getIteratorMethod$2 = function (it) {
11217   if (it != undefined) return getMethod$1(it, ITERATOR)
11218     || getMethod$1(it, '@@iterator')
11219     || Iterators[classof(it)];
11220 };
11221
11222 var global$2 = global$r;
11223 var call$2 = functionCall;
11224 var aCallable = aCallable$5;
11225 var anObject$4 = anObject$7;
11226 var tryToString$1 = tryToString$3;
11227 var getIteratorMethod$1 = getIteratorMethod$2;
11228
11229 var TypeError$2 = global$2.TypeError;
11230
11231 var getIterator$1 = function (argument, usingIterator) {
11232   var iteratorMethod = arguments.length < 2 ? getIteratorMethod$1(argument) : usingIterator;
11233   if (aCallable(iteratorMethod)) return anObject$4(call$2(iteratorMethod, argument));
11234   throw TypeError$2(tryToString$1(argument) + ' is not iterable');
11235 };
11236
11237 var call$1 = functionCall;
11238 var anObject$3 = anObject$7;
11239 var getMethod = getMethod$3;
11240
11241 var iteratorClose$1 = function (iterator, kind, value) {
11242   var innerResult, innerError;
11243   anObject$3(iterator);
11244   try {
11245     innerResult = getMethod(iterator, 'return');
11246     if (!innerResult) {
11247       if (kind === 'throw') throw value;
11248       return value;
11249     }
11250     innerResult = call$1(innerResult, iterator);
11251   } catch (error) {
11252     innerError = true;
11253     innerResult = error;
11254   }
11255   if (kind === 'throw') throw value;
11256   if (innerError) throw innerResult;
11257   anObject$3(innerResult);
11258   return value;
11259 };
11260
11261 var global$1 = global$r;
11262 var bind = functionBindContext;
11263 var call = functionCall;
11264 var anObject$2 = anObject$7;
11265 var tryToString = tryToString$3;
11266 var isArrayIteratorMethod = isArrayIteratorMethod$1;
11267 var lengthOfArrayLike$1 = lengthOfArrayLike$6;
11268 var isPrototypeOf = objectIsPrototypeOf;
11269 var getIterator = getIterator$1;
11270 var getIteratorMethod = getIteratorMethod$2;
11271 var iteratorClose = iteratorClose$1;
11272
11273 var TypeError$1 = global$1.TypeError;
11274
11275 var Result = function (stopped, result) {
11276   this.stopped = stopped;
11277   this.result = result;
11278 };
11279
11280 var ResultPrototype = Result.prototype;
11281
11282 var iterate$1 = function (iterable, unboundFunction, options) {
11283   var that = options && options.that;
11284   var AS_ENTRIES = !!(options && options.AS_ENTRIES);
11285   var IS_ITERATOR = !!(options && options.IS_ITERATOR);
11286   var INTERRUPTED = !!(options && options.INTERRUPTED);
11287   var fn = bind(unboundFunction, that);
11288   var iterator, iterFn, index, length, result, next, step;
11289
11290   var stop = function (condition) {
11291     if (iterator) iteratorClose(iterator, 'normal', condition);
11292     return new Result(true, condition);
11293   };
11294
11295   var callFn = function (value) {
11296     if (AS_ENTRIES) {
11297       anObject$2(value);
11298       return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
11299     } return INTERRUPTED ? fn(value, stop) : fn(value);
11300   };
11301
11302   if (IS_ITERATOR) {
11303     iterator = iterable;
11304   } else {
11305     iterFn = getIteratorMethod(iterable);
11306     if (!iterFn) throw TypeError$1(tryToString(iterable) + ' is not iterable');
11307     // optimisation for array iterators
11308     if (isArrayIteratorMethod(iterFn)) {
11309       for (index = 0, length = lengthOfArrayLike$1(iterable); length > index; index++) {
11310         result = callFn(iterable[index]);
11311         if (result && isPrototypeOf(ResultPrototype, result)) return result;
11312       } return new Result(false);
11313     }
11314     iterator = getIterator(iterable, iterFn);
11315   }
11316
11317   next = iterator.next;
11318   while (!(step = call(next, iterator)).done) {
11319     try {
11320       result = callFn(step.value);
11321     } catch (error) {
11322       iteratorClose(iterator, 'throw', error);
11323     }
11324     if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
11325   } return new Result(false);
11326 };
11327
11328 var toPropertyKey = toPropertyKey$3;
11329 var definePropertyModule$2 = objectDefineProperty;
11330 var createPropertyDescriptor = createPropertyDescriptor$3;
11331
11332 var createProperty$1 = function (object, key, value) {
11333   var propertyKey = toPropertyKey(key);
11334   if (propertyKey in object) definePropertyModule$2.f(object, propertyKey, createPropertyDescriptor(0, value));
11335   else object[propertyKey] = value;
11336 };
11337
11338 var $$1 = _export;
11339 var iterate = iterate$1;
11340 var createProperty = createProperty$1;
11341
11342 // `Object.fromEntries` method
11343 // https://github.com/tc39/proposal-object-from-entries
11344 $$1({ target: 'Object', stat: true }, {
11345   fromEntries: function fromEntries(iterable) {
11346     var obj = {};
11347     iterate(iterable, function (k, v) {
11348       createProperty(obj, k, v);
11349     }, { AS_ENTRIES: true });
11350     return obj;
11351   }
11352 });
11353
11354 /*!
11355  * dashify <https://github.com/jonschlinkert/dashify>
11356  *
11357  * Copyright (c) 2015-2017, Jon Schlinkert.
11358  * Released under the MIT License.
11359  */
11360
11361 var dashify$2 = (str, options) => {
11362   if (typeof str !== 'string') throw new TypeError('expected a string');
11363   return str.trim().replace(/([a-z])([A-Z])/g, '$1-$2').replace(/\W/g, m => /[À-ž]/.test(m) ? m : '-').replace(/^-+|-+$/g, '').replace(/-{2,}/g, m => options && options.condense ? '-' : m).toLowerCase();
11364 };
11365
11366 var minimist$3 = function (args, opts) {
11367   if (!opts) opts = {};
11368   var flags = {
11369     bools: {},
11370     strings: {},
11371     unknownFn: null
11372   };
11373
11374   if (typeof opts['unknown'] === 'function') {
11375     flags.unknownFn = opts['unknown'];
11376   }
11377
11378   if (typeof opts['boolean'] === 'boolean' && opts['boolean']) {
11379     flags.allBools = true;
11380   } else {
11381     [].concat(opts['boolean']).filter(Boolean).forEach(function (key) {
11382       flags.bools[key] = true;
11383     });
11384   }
11385
11386   var aliases = {};
11387   Object.keys(opts.alias || {}).forEach(function (key) {
11388     aliases[key] = [].concat(opts.alias[key]);
11389     aliases[key].forEach(function (x) {
11390       aliases[x] = [key].concat(aliases[key].filter(function (y) {
11391         return x !== y;
11392       }));
11393     });
11394   });
11395   [].concat(opts.string).filter(Boolean).forEach(function (key) {
11396     flags.strings[key] = true;
11397
11398     if (aliases[key]) {
11399       flags.strings[aliases[key]] = true;
11400     }
11401   });
11402   var defaults = opts['default'] || {};
11403   var argv = {
11404     _: []
11405   };
11406   Object.keys(flags.bools).forEach(function (key) {
11407     setArg(key, defaults[key] === undefined ? false : defaults[key]);
11408   });
11409   var notFlags = [];
11410
11411   if (args.indexOf('--') !== -1) {
11412     notFlags = args.slice(args.indexOf('--') + 1);
11413     args = args.slice(0, args.indexOf('--'));
11414   }
11415
11416   function argDefined(key, arg) {
11417     return flags.allBools && /^--[^=]+$/.test(arg) || flags.strings[key] || flags.bools[key] || aliases[key];
11418   }
11419
11420   function setArg(key, val, arg) {
11421     if (arg && flags.unknownFn && !argDefined(key, arg)) {
11422       if (flags.unknownFn(arg) === false) return;
11423     }
11424
11425     var value = !flags.strings[key] && isNumber(val) ? Number(val) : val;
11426     setKey(argv, key.split('.'), value);
11427     (aliases[key] || []).forEach(function (x) {
11428       setKey(argv, x.split('.'), value);
11429     });
11430   }
11431
11432   function setKey(obj, keys, value) {
11433     var o = obj;
11434
11435     for (var i = 0; i < keys.length - 1; i++) {
11436       var key = keys[i];
11437       if (key === '__proto__') return;
11438       if (o[key] === undefined) o[key] = {};
11439       if (o[key] === Object.prototype || o[key] === Number.prototype || o[key] === String.prototype) o[key] = {};
11440       if (o[key] === Array.prototype) o[key] = [];
11441       o = o[key];
11442     }
11443
11444     var key = keys[keys.length - 1];
11445     if (key === '__proto__') return;
11446     if (o === Object.prototype || o === Number.prototype || o === String.prototype) o = {};
11447     if (o === Array.prototype) o = [];
11448
11449     if (o[key] === undefined || flags.bools[key] || typeof o[key] === 'boolean') {
11450       o[key] = value;
11451     } else if (Array.isArray(o[key])) {
11452       o[key].push(value);
11453     } else {
11454       o[key] = [o[key], value];
11455     }
11456   }
11457
11458   function aliasIsBoolean(key) {
11459     return aliases[key].some(function (x) {
11460       return flags.bools[x];
11461     });
11462   }
11463
11464   for (var i = 0; i < args.length; i++) {
11465     var arg = args[i];
11466
11467     if (/^--.+=/.test(arg)) {
11468       // Using [\s\S] instead of . because js doesn't support the
11469       // 'dotall' regex modifier. See:
11470       // http://stackoverflow.com/a/1068308/13216
11471       var m = arg.match(/^--([^=]+)=([\s\S]*)$/);
11472       var key = m[1];
11473       var value = m[2];
11474
11475       if (flags.bools[key]) {
11476         value = value !== 'false';
11477       }
11478
11479       setArg(key, value, arg);
11480     } else if (/^--no-.+/.test(arg)) {
11481       var key = arg.match(/^--no-(.+)/)[1];
11482       setArg(key, false, arg);
11483     } else if (/^--.+/.test(arg)) {
11484       var key = arg.match(/^--(.+)/)[1];
11485       var next = args[i + 1];
11486
11487       if (next !== undefined && !/^-/.test(next) && !flags.bools[key] && !flags.allBools && (aliases[key] ? !aliasIsBoolean(key) : true)) {
11488         setArg(key, next, arg);
11489         i++;
11490       } else if (/^(true|false)$/.test(next)) {
11491         setArg(key, next === 'true', arg);
11492         i++;
11493       } else {
11494         setArg(key, flags.strings[key] ? '' : true, arg);
11495       }
11496     } else if (/^-[^-]+/.test(arg)) {
11497       var letters = arg.slice(1, -1).split('');
11498       var broken = false;
11499
11500       for (var j = 0; j < letters.length; j++) {
11501         var next = arg.slice(j + 2);
11502
11503         if (next === '-') {
11504           setArg(letters[j], next, arg);
11505           continue;
11506         }
11507
11508         if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) {
11509           setArg(letters[j], next.split('=')[1], arg);
11510           broken = true;
11511           break;
11512         }
11513
11514         if (/[A-Za-z]/.test(letters[j]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
11515           setArg(letters[j], next, arg);
11516           broken = true;
11517           break;
11518         }
11519
11520         if (letters[j + 1] && letters[j + 1].match(/\W/)) {
11521           setArg(letters[j], arg.slice(j + 2), arg);
11522           broken = true;
11523           break;
11524         } else {
11525           setArg(letters[j], flags.strings[letters[j]] ? '' : true, arg);
11526         }
11527       }
11528
11529       var key = arg.slice(-1)[0];
11530
11531       if (!broken && key !== '-') {
11532         if (args[i + 1] && !/^(-|--)[^-]/.test(args[i + 1]) && !flags.bools[key] && (aliases[key] ? !aliasIsBoolean(key) : true)) {
11533           setArg(key, args[i + 1], arg);
11534           i++;
11535         } else if (args[i + 1] && /^(true|false)$/.test(args[i + 1])) {
11536           setArg(key, args[i + 1] === 'true', arg);
11537           i++;
11538         } else {
11539           setArg(key, flags.strings[key] ? '' : true, arg);
11540         }
11541       }
11542     } else {
11543       if (!flags.unknownFn || flags.unknownFn(arg) !== false) {
11544         argv._.push(flags.strings['_'] || !isNumber(arg) ? arg : Number(arg));
11545       }
11546
11547       if (opts.stopEarly) {
11548         argv._.push.apply(argv._, args.slice(i + 1));
11549
11550         break;
11551       }
11552     }
11553   }
11554
11555   Object.keys(defaults).forEach(function (key) {
11556     if (!hasKey(argv, key.split('.'))) {
11557       setKey(argv, key.split('.'), defaults[key]);
11558       (aliases[key] || []).forEach(function (x) {
11559         setKey(argv, x.split('.'), defaults[key]);
11560       });
11561     }
11562   });
11563
11564   if (opts['--']) {
11565     argv['--'] = new Array();
11566     notFlags.forEach(function (key) {
11567       argv['--'].push(key);
11568     });
11569   } else {
11570     notFlags.forEach(function (key) {
11571       argv._.push(key);
11572     });
11573   }
11574
11575   return argv;
11576 };
11577
11578 function hasKey(obj, keys) {
11579   var o = obj;
11580   keys.slice(0, -1).forEach(function (key) {
11581     o = o[key] || {};
11582   });
11583   var key = keys[keys.length - 1];
11584   return key in o;
11585 }
11586
11587 function isNumber(x) {
11588   if (typeof x === 'number') return true;
11589   if (/^0x[0-9a-f]+$/i.test(x)) return true;
11590   return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
11591 }
11592
11593 const minimist$2 = minimist$3;
11594 const PLACEHOLDER = null;
11595 /**
11596  * unspecified boolean flag without default value is parsed as `undefined` instead of `false`
11597  */
11598
11599 var minimist_1 = function (args, options) {
11600   const boolean = options.boolean || [];
11601   const defaults = options.default || {};
11602   const booleanWithoutDefault = boolean.filter(key => !(key in defaults));
11603   const newDefaults = Object.assign(Object.assign({}, defaults), Object.fromEntries(booleanWithoutDefault.map(key => [key, PLACEHOLDER])));
11604   const parsed = minimist$2(args, Object.assign(Object.assign({}, options), {}, {
11605     default: newDefaults
11606   }));
11607   return Object.fromEntries(Object.entries(parsed).filter(([, value]) => value !== PLACEHOLDER));
11608 };
11609
11610 /**
11611  * A specialized version of `baseAggregator` for arrays.
11612  *
11613  * @private
11614  * @param {Array} [array] The array to iterate over.
11615  * @param {Function} setter The function to set `accumulator` values.
11616  * @param {Function} iteratee The iteratee to transform keys.
11617  * @param {Object} accumulator The initial aggregated object.
11618  * @returns {Function} Returns `accumulator`.
11619  */
11620
11621 function arrayAggregator$1(array, setter, iteratee, accumulator) {
11622   var index = -1,
11623       length = array == null ? 0 : array.length;
11624
11625   while (++index < length) {
11626     var value = array[index];
11627     setter(accumulator, value, iteratee(value), array);
11628   }
11629
11630   return accumulator;
11631 }
11632
11633 var _arrayAggregator = arrayAggregator$1;
11634
11635 /**
11636  * Creates a base function for methods like `_.forIn` and `_.forOwn`.
11637  *
11638  * @private
11639  * @param {boolean} [fromRight] Specify iterating from right to left.
11640  * @returns {Function} Returns the new base function.
11641  */
11642
11643 function createBaseFor$1(fromRight) {
11644   return function (object, iteratee, keysFunc) {
11645     var index = -1,
11646         iterable = Object(object),
11647         props = keysFunc(object),
11648         length = props.length;
11649
11650     while (length--) {
11651       var key = props[fromRight ? length : ++index];
11652
11653       if (iteratee(iterable[key], key, iterable) === false) {
11654         break;
11655       }
11656     }
11657
11658     return object;
11659   };
11660 }
11661
11662 var _createBaseFor = createBaseFor$1;
11663
11664 var createBaseFor = _createBaseFor;
11665 /**
11666  * The base implementation of `baseForOwn` which iterates over `object`
11667  * properties returned by `keysFunc` and invokes `iteratee` for each property.
11668  * Iteratee functions may exit iteration early by explicitly returning `false`.
11669  *
11670  * @private
11671  * @param {Object} object The object to iterate over.
11672  * @param {Function} iteratee The function invoked per iteration.
11673  * @param {Function} keysFunc The function to get the keys of `object`.
11674  * @returns {Object} Returns `object`.
11675  */
11676
11677 var baseFor$1 = createBaseFor();
11678 var _baseFor = baseFor$1;
11679
11680 /**
11681  * The base implementation of `_.times` without support for iteratee shorthands
11682  * or max array length checks.
11683  *
11684  * @private
11685  * @param {number} n The number of times to invoke `iteratee`.
11686  * @param {Function} iteratee The function invoked per iteration.
11687  * @returns {Array} Returns the array of results.
11688  */
11689
11690 function baseTimes$1(n, iteratee) {
11691   var index = -1,
11692       result = Array(n);
11693
11694   while (++index < n) {
11695     result[index] = iteratee(index);
11696   }
11697
11698   return result;
11699 }
11700
11701 var _baseTimes = baseTimes$1;
11702
11703 /** Detect free variable `global` from Node.js. */
11704 var freeGlobal$1 = typeof global == 'object' && global && global.Object === Object && global;
11705 var _freeGlobal = freeGlobal$1;
11706
11707 var freeGlobal = _freeGlobal;
11708 /** Detect free variable `self`. */
11709
11710 var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
11711 /** Used as a reference to the global object. */
11712
11713 var root$8 = freeGlobal || freeSelf || Function('return this')();
11714 var _root = root$8;
11715
11716 var root$7 = _root;
11717 /** Built-in value references. */
11718
11719 var Symbol$6 = root$7.Symbol;
11720 var _Symbol = Symbol$6;
11721
11722 var Symbol$5 = _Symbol;
11723 /** Used for built-in method references. */
11724
11725 var objectProto$d = Object.prototype;
11726 /** Used to check objects for own properties. */
11727
11728 var hasOwnProperty$a = objectProto$d.hasOwnProperty;
11729 /**
11730  * Used to resolve the
11731  * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
11732  * of values.
11733  */
11734
11735 var nativeObjectToString$1 = objectProto$d.toString;
11736 /** Built-in value references. */
11737
11738 var symToStringTag$1 = Symbol$5 ? Symbol$5.toStringTag : undefined;
11739 /**
11740  * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
11741  *
11742  * @private
11743  * @param {*} value The value to query.
11744  * @returns {string} Returns the raw `toStringTag`.
11745  */
11746
11747 function getRawTag$1(value) {
11748   var isOwn = hasOwnProperty$a.call(value, symToStringTag$1),
11749       tag = value[symToStringTag$1];
11750
11751   try {
11752     value[symToStringTag$1] = undefined;
11753     var unmasked = true;
11754   } catch (e) {}
11755
11756   var result = nativeObjectToString$1.call(value);
11757
11758   if (unmasked) {
11759     if (isOwn) {
11760       value[symToStringTag$1] = tag;
11761     } else {
11762       delete value[symToStringTag$1];
11763     }
11764   }
11765
11766   return result;
11767 }
11768
11769 var _getRawTag = getRawTag$1;
11770
11771 /** Used for built-in method references. */
11772 var objectProto$c = Object.prototype;
11773 /**
11774  * Used to resolve the
11775  * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
11776  * of values.
11777  */
11778
11779 var nativeObjectToString = objectProto$c.toString;
11780 /**
11781  * Converts `value` to a string using `Object.prototype.toString`.
11782  *
11783  * @private
11784  * @param {*} value The value to convert.
11785  * @returns {string} Returns the converted string.
11786  */
11787
11788 function objectToString$1(value) {
11789   return nativeObjectToString.call(value);
11790 }
11791
11792 var _objectToString = objectToString$1;
11793
11794 var Symbol$4 = _Symbol,
11795     getRawTag = _getRawTag,
11796     objectToString = _objectToString;
11797 /** `Object#toString` result references. */
11798
11799 var nullTag = '[object Null]',
11800     undefinedTag = '[object Undefined]';
11801 /** Built-in value references. */
11802
11803 var symToStringTag = Symbol$4 ? Symbol$4.toStringTag : undefined;
11804 /**
11805  * The base implementation of `getTag` without fallbacks for buggy environments.
11806  *
11807  * @private
11808  * @param {*} value The value to query.
11809  * @returns {string} Returns the `toStringTag`.
11810  */
11811
11812 function baseGetTag$5(value) {
11813   if (value == null) {
11814     return value === undefined ? undefinedTag : nullTag;
11815   }
11816
11817   return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
11818 }
11819
11820 var _baseGetTag = baseGetTag$5;
11821
11822 /**
11823  * Checks if `value` is object-like. A value is object-like if it's not `null`
11824  * and has a `typeof` result of "object".
11825  *
11826  * @static
11827  * @memberOf _
11828  * @since 4.0.0
11829  * @category Lang
11830  * @param {*} value The value to check.
11831  * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
11832  * @example
11833  *
11834  * _.isObjectLike({});
11835  * // => true
11836  *
11837  * _.isObjectLike([1, 2, 3]);
11838  * // => true
11839  *
11840  * _.isObjectLike(_.noop);
11841  * // => false
11842  *
11843  * _.isObjectLike(null);
11844  * // => false
11845  */
11846
11847 function isObjectLike$5(value) {
11848   return value != null && typeof value == 'object';
11849 }
11850
11851 var isObjectLike_1 = isObjectLike$5;
11852
11853 var baseGetTag$4 = _baseGetTag,
11854     isObjectLike$4 = isObjectLike_1;
11855 /** `Object#toString` result references. */
11856
11857 var argsTag$2 = '[object Arguments]';
11858 /**
11859  * The base implementation of `_.isArguments`.
11860  *
11861  * @private
11862  * @param {*} value The value to check.
11863  * @returns {boolean} Returns `true` if `value` is an `arguments` object,
11864  */
11865
11866 function baseIsArguments$1(value) {
11867   return isObjectLike$4(value) && baseGetTag$4(value) == argsTag$2;
11868 }
11869
11870 var _baseIsArguments = baseIsArguments$1;
11871
11872 var baseIsArguments = _baseIsArguments,
11873     isObjectLike$3 = isObjectLike_1;
11874 /** Used for built-in method references. */
11875
11876 var objectProto$b = Object.prototype;
11877 /** Used to check objects for own properties. */
11878
11879 var hasOwnProperty$9 = objectProto$b.hasOwnProperty;
11880 /** Built-in value references. */
11881
11882 var propertyIsEnumerable$1 = objectProto$b.propertyIsEnumerable;
11883 /**
11884  * Checks if `value` is likely an `arguments` object.
11885  *
11886  * @static
11887  * @memberOf _
11888  * @since 0.1.0
11889  * @category Lang
11890  * @param {*} value The value to check.
11891  * @returns {boolean} Returns `true` if `value` is an `arguments` object,
11892  *  else `false`.
11893  * @example
11894  *
11895  * _.isArguments(function() { return arguments; }());
11896  * // => true
11897  *
11898  * _.isArguments([1, 2, 3]);
11899  * // => false
11900  */
11901
11902 var isArguments$3 = baseIsArguments(function () {
11903   return arguments;
11904 }()) ? baseIsArguments : function (value) {
11905   return isObjectLike$3(value) && hasOwnProperty$9.call(value, 'callee') && !propertyIsEnumerable$1.call(value, 'callee');
11906 };
11907 var isArguments_1 = isArguments$3;
11908
11909 /**
11910  * Checks if `value` is classified as an `Array` object.
11911  *
11912  * @static
11913  * @memberOf _
11914  * @since 0.1.0
11915  * @category Lang
11916  * @param {*} value The value to check.
11917  * @returns {boolean} Returns `true` if `value` is an array, else `false`.
11918  * @example
11919  *
11920  * _.isArray([1, 2, 3]);
11921  * // => true
11922  *
11923  * _.isArray(document.body.children);
11924  * // => false
11925  *
11926  * _.isArray('abc');
11927  * // => false
11928  *
11929  * _.isArray(_.noop);
11930  * // => false
11931  */
11932 var isArray$a = Array.isArray;
11933 var isArray_1 = isArray$a;
11934
11935 var isBuffer$2 = {exports: {}};
11936
11937 /**
11938  * This method returns `false`.
11939  *
11940  * @static
11941  * @memberOf _
11942  * @since 4.13.0
11943  * @category Util
11944  * @returns {boolean} Returns `false`.
11945  * @example
11946  *
11947  * _.times(2, _.stubFalse);
11948  * // => [false, false]
11949  */
11950
11951 function stubFalse() {
11952   return false;
11953 }
11954
11955 var stubFalse_1 = stubFalse;
11956
11957 (function (module, exports) {
11958   var root = _root,
11959       stubFalse = stubFalse_1;
11960   /** Detect free variable `exports`. */
11961
11962   var freeExports = exports && !exports.nodeType && exports;
11963   /** Detect free variable `module`. */
11964
11965   var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
11966   /** Detect the popular CommonJS extension `module.exports`. */
11967
11968   var moduleExports = freeModule && freeModule.exports === freeExports;
11969   /** Built-in value references. */
11970
11971   var Buffer = moduleExports ? root.Buffer : undefined;
11972   /* Built-in method references for those with the same name as other `lodash` methods. */
11973
11974   var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
11975   /**
11976    * Checks if `value` is a buffer.
11977    *
11978    * @static
11979    * @memberOf _
11980    * @since 4.3.0
11981    * @category Lang
11982    * @param {*} value The value to check.
11983    * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
11984    * @example
11985    *
11986    * _.isBuffer(new Buffer(2));
11987    * // => true
11988    *
11989    * _.isBuffer(new Uint8Array(2));
11990    * // => false
11991    */
11992
11993   var isBuffer = nativeIsBuffer || stubFalse;
11994   module.exports = isBuffer;
11995 })(isBuffer$2, isBuffer$2.exports);
11996
11997 /** Used as references for various `Number` constants. */
11998 var MAX_SAFE_INTEGER$1 = 9007199254740991;
11999 /** Used to detect unsigned integer values. */
12000
12001 var reIsUint = /^(?:0|[1-9]\d*)$/;
12002 /**
12003  * Checks if `value` is a valid array-like index.
12004  *
12005  * @private
12006  * @param {*} value The value to check.
12007  * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
12008  * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
12009  */
12010
12011 function isIndex$3(value, length) {
12012   var type = typeof value;
12013   length = length == null ? MAX_SAFE_INTEGER$1 : length;
12014   return !!length && (type == 'number' || type != 'symbol' && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
12015 }
12016
12017 var _isIndex = isIndex$3;
12018
12019 /** Used as references for various `Number` constants. */
12020 var MAX_SAFE_INTEGER = 9007199254740991;
12021 /**
12022  * Checks if `value` is a valid array-like length.
12023  *
12024  * **Note:** This method is loosely based on
12025  * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
12026  *
12027  * @static
12028  * @memberOf _
12029  * @since 4.0.0
12030  * @category Lang
12031  * @param {*} value The value to check.
12032  * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
12033  * @example
12034  *
12035  * _.isLength(3);
12036  * // => true
12037  *
12038  * _.isLength(Number.MIN_VALUE);
12039  * // => false
12040  *
12041  * _.isLength(Infinity);
12042  * // => false
12043  *
12044  * _.isLength('3');
12045  * // => false
12046  */
12047
12048 function isLength$3(value) {
12049   return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
12050 }
12051
12052 var isLength_1 = isLength$3;
12053
12054 var baseGetTag$3 = _baseGetTag,
12055     isLength$2 = isLength_1,
12056     isObjectLike$2 = isObjectLike_1;
12057 /** `Object#toString` result references. */
12058
12059 var argsTag$1 = '[object Arguments]',
12060     arrayTag$1 = '[object Array]',
12061     boolTag$1 = '[object Boolean]',
12062     dateTag$1 = '[object Date]',
12063     errorTag$1 = '[object Error]',
12064     funcTag$1 = '[object Function]',
12065     mapTag$2 = '[object Map]',
12066     numberTag$1 = '[object Number]',
12067     objectTag$2 = '[object Object]',
12068     regexpTag$1 = '[object RegExp]',
12069     setTag$2 = '[object Set]',
12070     stringTag$1 = '[object String]',
12071     weakMapTag$1 = '[object WeakMap]';
12072 var arrayBufferTag$1 = '[object ArrayBuffer]',
12073     dataViewTag$2 = '[object DataView]',
12074     float32Tag = '[object Float32Array]',
12075     float64Tag = '[object Float64Array]',
12076     int8Tag = '[object Int8Array]',
12077     int16Tag = '[object Int16Array]',
12078     int32Tag = '[object Int32Array]',
12079     uint8Tag = '[object Uint8Array]',
12080     uint8ClampedTag = '[object Uint8ClampedArray]',
12081     uint16Tag = '[object Uint16Array]',
12082     uint32Tag = '[object Uint32Array]';
12083 /** Used to identify `toStringTag` values of typed arrays. */
12084
12085 var typedArrayTags = {};
12086 typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
12087 typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] = typedArrayTags[arrayBufferTag$1] = typedArrayTags[boolTag$1] = typedArrayTags[dataViewTag$2] = typedArrayTags[dateTag$1] = typedArrayTags[errorTag$1] = typedArrayTags[funcTag$1] = typedArrayTags[mapTag$2] = typedArrayTags[numberTag$1] = typedArrayTags[objectTag$2] = typedArrayTags[regexpTag$1] = typedArrayTags[setTag$2] = typedArrayTags[stringTag$1] = typedArrayTags[weakMapTag$1] = false;
12088 /**
12089  * The base implementation of `_.isTypedArray` without Node.js optimizations.
12090  *
12091  * @private
12092  * @param {*} value The value to check.
12093  * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
12094  */
12095
12096 function baseIsTypedArray$1(value) {
12097   return isObjectLike$2(value) && isLength$2(value.length) && !!typedArrayTags[baseGetTag$3(value)];
12098 }
12099
12100 var _baseIsTypedArray = baseIsTypedArray$1;
12101
12102 /**
12103  * The base implementation of `_.unary` without support for storing metadata.
12104  *
12105  * @private
12106  * @param {Function} func The function to cap arguments for.
12107  * @returns {Function} Returns the new capped function.
12108  */
12109
12110 function baseUnary$1(func) {
12111   return function (value) {
12112     return func(value);
12113   };
12114 }
12115
12116 var _baseUnary = baseUnary$1;
12117
12118 var _nodeUtil = {exports: {}};
12119
12120 (function (module, exports) {
12121   var freeGlobal = _freeGlobal;
12122   /** Detect free variable `exports`. */
12123
12124   var freeExports = exports && !exports.nodeType && exports;
12125   /** Detect free variable `module`. */
12126
12127   var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
12128   /** Detect the popular CommonJS extension `module.exports`. */
12129
12130   var moduleExports = freeModule && freeModule.exports === freeExports;
12131   /** Detect free variable `process` from Node.js. */
12132
12133   var freeProcess = moduleExports && freeGlobal.process;
12134   /** Used to access faster Node.js helpers. */
12135
12136   var nodeUtil = function () {
12137     try {
12138       // Use `util.types` for Node.js 10+.
12139       var types = freeModule && freeModule.require && freeModule.require('util').types;
12140
12141       if (types) {
12142         return types;
12143       } // Legacy `process.binding('util')` for Node.js < 10.
12144
12145
12146       return freeProcess && freeProcess.binding && freeProcess.binding('util');
12147     } catch (e) {}
12148   }();
12149
12150   module.exports = nodeUtil;
12151 })(_nodeUtil, _nodeUtil.exports);
12152
12153 var baseIsTypedArray = _baseIsTypedArray,
12154     baseUnary = _baseUnary,
12155     nodeUtil = _nodeUtil.exports;
12156 /* Node.js helper references. */
12157
12158 var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
12159 /**
12160  * Checks if `value` is classified as a typed array.
12161  *
12162  * @static
12163  * @memberOf _
12164  * @since 3.0.0
12165  * @category Lang
12166  * @param {*} value The value to check.
12167  * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
12168  * @example
12169  *
12170  * _.isTypedArray(new Uint8Array);
12171  * // => true
12172  *
12173  * _.isTypedArray([]);
12174  * // => false
12175  */
12176
12177 var isTypedArray$2 = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
12178 var isTypedArray_1 = isTypedArray$2;
12179
12180 var baseTimes = _baseTimes,
12181     isArguments$2 = isArguments_1,
12182     isArray$9 = isArray_1,
12183     isBuffer$1 = isBuffer$2.exports,
12184     isIndex$2 = _isIndex,
12185     isTypedArray$1 = isTypedArray_1;
12186 /** Used for built-in method references. */
12187
12188 var objectProto$a = Object.prototype;
12189 /** Used to check objects for own properties. */
12190
12191 var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
12192 /**
12193  * Creates an array of the enumerable property names of the array-like `value`.
12194  *
12195  * @private
12196  * @param {*} value The value to query.
12197  * @param {boolean} inherited Specify returning inherited property names.
12198  * @returns {Array} Returns the array of property names.
12199  */
12200
12201 function arrayLikeKeys$1(value, inherited) {
12202   var isArr = isArray$9(value),
12203       isArg = !isArr && isArguments$2(value),
12204       isBuff = !isArr && !isArg && isBuffer$1(value),
12205       isType = !isArr && !isArg && !isBuff && isTypedArray$1(value),
12206       skipIndexes = isArr || isArg || isBuff || isType,
12207       result = skipIndexes ? baseTimes(value.length, String) : [],
12208       length = result.length;
12209
12210   for (var key in value) {
12211     if ((inherited || hasOwnProperty$8.call(value, key)) && !(skipIndexes && ( // Safari 9 has enumerable `arguments.length` in strict mode.
12212     key == 'length' || // Node.js 0.10 has enumerable non-index properties on buffers.
12213     isBuff && (key == 'offset' || key == 'parent') || // PhantomJS 2 has enumerable non-index properties on typed arrays.
12214     isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset') || // Skip index properties.
12215     isIndex$2(key, length)))) {
12216       result.push(key);
12217     }
12218   }
12219
12220   return result;
12221 }
12222
12223 var _arrayLikeKeys = arrayLikeKeys$1;
12224
12225 /** Used for built-in method references. */
12226 var objectProto$9 = Object.prototype;
12227 /**
12228  * Checks if `value` is likely a prototype object.
12229  *
12230  * @private
12231  * @param {*} value The value to check.
12232  * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
12233  */
12234
12235 function isPrototype$1(value) {
12236   var Ctor = value && value.constructor,
12237       proto = typeof Ctor == 'function' && Ctor.prototype || objectProto$9;
12238   return value === proto;
12239 }
12240
12241 var _isPrototype = isPrototype$1;
12242
12243 /**
12244  * Creates a unary function that invokes `func` with its argument transformed.
12245  *
12246  * @private
12247  * @param {Function} func The function to wrap.
12248  * @param {Function} transform The argument transform.
12249  * @returns {Function} Returns the new function.
12250  */
12251
12252 function overArg$1(func, transform) {
12253   return function (arg) {
12254     return func(transform(arg));
12255   };
12256 }
12257
12258 var _overArg = overArg$1;
12259
12260 var overArg = _overArg;
12261 /* Built-in method references for those with the same name as other `lodash` methods. */
12262
12263 var nativeKeys$1 = overArg(Object.keys, Object);
12264 var _nativeKeys = nativeKeys$1;
12265
12266 var isPrototype = _isPrototype,
12267     nativeKeys = _nativeKeys;
12268 /** Used for built-in method references. */
12269
12270 var objectProto$8 = Object.prototype;
12271 /** Used to check objects for own properties. */
12272
12273 var hasOwnProperty$7 = objectProto$8.hasOwnProperty;
12274 /**
12275  * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
12276  *
12277  * @private
12278  * @param {Object} object The object to query.
12279  * @returns {Array} Returns the array of property names.
12280  */
12281
12282 function baseKeys$1(object) {
12283   if (!isPrototype(object)) {
12284     return nativeKeys(object);
12285   }
12286
12287   var result = [];
12288
12289   for (var key in Object(object)) {
12290     if (hasOwnProperty$7.call(object, key) && key != 'constructor') {
12291       result.push(key);
12292     }
12293   }
12294
12295   return result;
12296 }
12297
12298 var _baseKeys = baseKeys$1;
12299
12300 /**
12301  * Checks if `value` is the
12302  * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
12303  * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
12304  *
12305  * @static
12306  * @memberOf _
12307  * @since 0.1.0
12308  * @category Lang
12309  * @param {*} value The value to check.
12310  * @returns {boolean} Returns `true` if `value` is an object, else `false`.
12311  * @example
12312  *
12313  * _.isObject({});
12314  * // => true
12315  *
12316  * _.isObject([1, 2, 3]);
12317  * // => true
12318  *
12319  * _.isObject(_.noop);
12320  * // => true
12321  *
12322  * _.isObject(null);
12323  * // => false
12324  */
12325
12326 function isObject$4(value) {
12327   var type = typeof value;
12328   return value != null && (type == 'object' || type == 'function');
12329 }
12330
12331 var isObject_1 = isObject$4;
12332
12333 var baseGetTag$2 = _baseGetTag,
12334     isObject$3 = isObject_1;
12335 /** `Object#toString` result references. */
12336
12337 var asyncTag = '[object AsyncFunction]',
12338     funcTag = '[object Function]',
12339     genTag = '[object GeneratorFunction]',
12340     proxyTag = '[object Proxy]';
12341 /**
12342  * Checks if `value` is classified as a `Function` object.
12343  *
12344  * @static
12345  * @memberOf _
12346  * @since 0.1.0
12347  * @category Lang
12348  * @param {*} value The value to check.
12349  * @returns {boolean} Returns `true` if `value` is a function, else `false`.
12350  * @example
12351  *
12352  * _.isFunction(_);
12353  * // => true
12354  *
12355  * _.isFunction(/abc/);
12356  * // => false
12357  */
12358
12359 function isFunction$2(value) {
12360   if (!isObject$3(value)) {
12361     return false;
12362   } // The use of `Object#toString` avoids issues with the `typeof` operator
12363   // in Safari 9 which returns 'object' for typed arrays and other constructors.
12364
12365
12366   var tag = baseGetTag$2(value);
12367   return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
12368 }
12369
12370 var isFunction_1 = isFunction$2;
12371
12372 var isFunction$1 = isFunction_1,
12373     isLength$1 = isLength_1;
12374 /**
12375  * Checks if `value` is array-like. A value is considered array-like if it's
12376  * not a function and has a `value.length` that's an integer greater than or
12377  * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
12378  *
12379  * @static
12380  * @memberOf _
12381  * @since 4.0.0
12382  * @category Lang
12383  * @param {*} value The value to check.
12384  * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
12385  * @example
12386  *
12387  * _.isArrayLike([1, 2, 3]);
12388  * // => true
12389  *
12390  * _.isArrayLike(document.body.children);
12391  * // => true
12392  *
12393  * _.isArrayLike('abc');
12394  * // => true
12395  *
12396  * _.isArrayLike(_.noop);
12397  * // => false
12398  */
12399
12400 function isArrayLike$2(value) {
12401   return value != null && isLength$1(value.length) && !isFunction$1(value);
12402 }
12403
12404 var isArrayLike_1 = isArrayLike$2;
12405
12406 var arrayLikeKeys = _arrayLikeKeys,
12407     baseKeys = _baseKeys,
12408     isArrayLike$1 = isArrayLike_1;
12409 /**
12410  * Creates an array of the own enumerable property names of `object`.
12411  *
12412  * **Note:** Non-object values are coerced to objects. See the
12413  * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
12414  * for more details.
12415  *
12416  * @static
12417  * @since 0.1.0
12418  * @memberOf _
12419  * @category Object
12420  * @param {Object} object The object to query.
12421  * @returns {Array} Returns the array of property names.
12422  * @example
12423  *
12424  * function Foo() {
12425  *   this.a = 1;
12426  *   this.b = 2;
12427  * }
12428  *
12429  * Foo.prototype.c = 3;
12430  *
12431  * _.keys(new Foo);
12432  * // => ['a', 'b'] (iteration order is not guaranteed)
12433  *
12434  * _.keys('hi');
12435  * // => ['0', '1']
12436  */
12437
12438 function keys$3(object) {
12439   return isArrayLike$1(object) ? arrayLikeKeys(object) : baseKeys(object);
12440 }
12441
12442 var keys_1 = keys$3;
12443
12444 var baseFor = _baseFor,
12445     keys$2 = keys_1;
12446 /**
12447  * The base implementation of `_.forOwn` without support for iteratee shorthands.
12448  *
12449  * @private
12450  * @param {Object} object The object to iterate over.
12451  * @param {Function} iteratee The function invoked per iteration.
12452  * @returns {Object} Returns `object`.
12453  */
12454
12455 function baseForOwn$1(object, iteratee) {
12456   return object && baseFor(object, iteratee, keys$2);
12457 }
12458
12459 var _baseForOwn = baseForOwn$1;
12460
12461 var isArrayLike = isArrayLike_1;
12462 /**
12463  * Creates a `baseEach` or `baseEachRight` function.
12464  *
12465  * @private
12466  * @param {Function} eachFunc The function to iterate over a collection.
12467  * @param {boolean} [fromRight] Specify iterating from right to left.
12468  * @returns {Function} Returns the new base function.
12469  */
12470
12471 function createBaseEach$1(eachFunc, fromRight) {
12472   return function (collection, iteratee) {
12473     if (collection == null) {
12474       return collection;
12475     }
12476
12477     if (!isArrayLike(collection)) {
12478       return eachFunc(collection, iteratee);
12479     }
12480
12481     var length = collection.length,
12482         index = fromRight ? length : -1,
12483         iterable = Object(collection);
12484
12485     while (fromRight ? index-- : ++index < length) {
12486       if (iteratee(iterable[index], index, iterable) === false) {
12487         break;
12488       }
12489     }
12490
12491     return collection;
12492   };
12493 }
12494
12495 var _createBaseEach = createBaseEach$1;
12496
12497 var baseForOwn = _baseForOwn,
12498     createBaseEach = _createBaseEach;
12499 /**
12500  * The base implementation of `_.forEach` without support for iteratee shorthands.
12501  *
12502  * @private
12503  * @param {Array|Object} collection The collection to iterate over.
12504  * @param {Function} iteratee The function invoked per iteration.
12505  * @returns {Array|Object} Returns `collection`.
12506  */
12507
12508 var baseEach$1 = createBaseEach(baseForOwn);
12509 var _baseEach = baseEach$1;
12510
12511 var baseEach = _baseEach;
12512 /**
12513  * Aggregates elements of `collection` on `accumulator` with keys transformed
12514  * by `iteratee` and values set by `setter`.
12515  *
12516  * @private
12517  * @param {Array|Object} collection The collection to iterate over.
12518  * @param {Function} setter The function to set `accumulator` values.
12519  * @param {Function} iteratee The iteratee to transform keys.
12520  * @param {Object} accumulator The initial aggregated object.
12521  * @returns {Function} Returns `accumulator`.
12522  */
12523
12524 function baseAggregator$1(collection, setter, iteratee, accumulator) {
12525   baseEach(collection, function (value, key, collection) {
12526     setter(accumulator, value, iteratee(value), collection);
12527   });
12528   return accumulator;
12529 }
12530
12531 var _baseAggregator = baseAggregator$1;
12532
12533 /**
12534  * Removes all key-value entries from the list cache.
12535  *
12536  * @private
12537  * @name clear
12538  * @memberOf ListCache
12539  */
12540
12541 function listCacheClear$1() {
12542   this.__data__ = [];
12543   this.size = 0;
12544 }
12545
12546 var _listCacheClear = listCacheClear$1;
12547
12548 /**
12549  * Performs a
12550  * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
12551  * comparison between two values to determine if they are equivalent.
12552  *
12553  * @static
12554  * @memberOf _
12555  * @since 4.0.0
12556  * @category Lang
12557  * @param {*} value The value to compare.
12558  * @param {*} other The other value to compare.
12559  * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
12560  * @example
12561  *
12562  * var object = { 'a': 1 };
12563  * var other = { 'a': 1 };
12564  *
12565  * _.eq(object, object);
12566  * // => true
12567  *
12568  * _.eq(object, other);
12569  * // => false
12570  *
12571  * _.eq('a', 'a');
12572  * // => true
12573  *
12574  * _.eq('a', Object('a'));
12575  * // => false
12576  *
12577  * _.eq(NaN, NaN);
12578  * // => true
12579  */
12580
12581 function eq$3(value, other) {
12582   return value === other || value !== value && other !== other;
12583 }
12584
12585 var eq_1 = eq$3;
12586
12587 var eq$2 = eq_1;
12588 /**
12589  * Gets the index at which the `key` is found in `array` of key-value pairs.
12590  *
12591  * @private
12592  * @param {Array} array The array to inspect.
12593  * @param {*} key The key to search for.
12594  * @returns {number} Returns the index of the matched value, else `-1`.
12595  */
12596
12597 function assocIndexOf$4(array, key) {
12598   var length = array.length;
12599
12600   while (length--) {
12601     if (eq$2(array[length][0], key)) {
12602       return length;
12603     }
12604   }
12605
12606   return -1;
12607 }
12608
12609 var _assocIndexOf = assocIndexOf$4;
12610
12611 var assocIndexOf$3 = _assocIndexOf;
12612 /** Used for built-in method references. */
12613
12614 var arrayProto = Array.prototype;
12615 /** Built-in value references. */
12616
12617 var splice = arrayProto.splice;
12618 /**
12619  * Removes `key` and its value from the list cache.
12620  *
12621  * @private
12622  * @name delete
12623  * @memberOf ListCache
12624  * @param {string} key The key of the value to remove.
12625  * @returns {boolean} Returns `true` if the entry was removed, else `false`.
12626  */
12627
12628 function listCacheDelete$1(key) {
12629   var data = this.__data__,
12630       index = assocIndexOf$3(data, key);
12631
12632   if (index < 0) {
12633     return false;
12634   }
12635
12636   var lastIndex = data.length - 1;
12637
12638   if (index == lastIndex) {
12639     data.pop();
12640   } else {
12641     splice.call(data, index, 1);
12642   }
12643
12644   --this.size;
12645   return true;
12646 }
12647
12648 var _listCacheDelete = listCacheDelete$1;
12649
12650 var assocIndexOf$2 = _assocIndexOf;
12651 /**
12652  * Gets the list cache value for `key`.
12653  *
12654  * @private
12655  * @name get
12656  * @memberOf ListCache
12657  * @param {string} key The key of the value to get.
12658  * @returns {*} Returns the entry value.
12659  */
12660
12661 function listCacheGet$1(key) {
12662   var data = this.__data__,
12663       index = assocIndexOf$2(data, key);
12664   return index < 0 ? undefined : data[index][1];
12665 }
12666
12667 var _listCacheGet = listCacheGet$1;
12668
12669 var assocIndexOf$1 = _assocIndexOf;
12670 /**
12671  * Checks if a list cache value for `key` exists.
12672  *
12673  * @private
12674  * @name has
12675  * @memberOf ListCache
12676  * @param {string} key The key of the entry to check.
12677  * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
12678  */
12679
12680 function listCacheHas$1(key) {
12681   return assocIndexOf$1(this.__data__, key) > -1;
12682 }
12683
12684 var _listCacheHas = listCacheHas$1;
12685
12686 var assocIndexOf = _assocIndexOf;
12687 /**
12688  * Sets the list cache `key` to `value`.
12689  *
12690  * @private
12691  * @name set
12692  * @memberOf ListCache
12693  * @param {string} key The key of the value to set.
12694  * @param {*} value The value to set.
12695  * @returns {Object} Returns the list cache instance.
12696  */
12697
12698 function listCacheSet$1(key, value) {
12699   var data = this.__data__,
12700       index = assocIndexOf(data, key);
12701
12702   if (index < 0) {
12703     ++this.size;
12704     data.push([key, value]);
12705   } else {
12706     data[index][1] = value;
12707   }
12708
12709   return this;
12710 }
12711
12712 var _listCacheSet = listCacheSet$1;
12713
12714 var listCacheClear = _listCacheClear,
12715     listCacheDelete = _listCacheDelete,
12716     listCacheGet = _listCacheGet,
12717     listCacheHas = _listCacheHas,
12718     listCacheSet = _listCacheSet;
12719 /**
12720  * Creates an list cache object.
12721  *
12722  * @private
12723  * @constructor
12724  * @param {Array} [entries] The key-value pairs to cache.
12725  */
12726
12727 function ListCache$4(entries) {
12728   var index = -1,
12729       length = entries == null ? 0 : entries.length;
12730   this.clear();
12731
12732   while (++index < length) {
12733     var entry = entries[index];
12734     this.set(entry[0], entry[1]);
12735   }
12736 } // Add methods to `ListCache`.
12737
12738
12739 ListCache$4.prototype.clear = listCacheClear;
12740 ListCache$4.prototype['delete'] = listCacheDelete;
12741 ListCache$4.prototype.get = listCacheGet;
12742 ListCache$4.prototype.has = listCacheHas;
12743 ListCache$4.prototype.set = listCacheSet;
12744 var _ListCache = ListCache$4;
12745
12746 var ListCache$3 = _ListCache;
12747 /**
12748  * Removes all key-value entries from the stack.
12749  *
12750  * @private
12751  * @name clear
12752  * @memberOf Stack
12753  */
12754
12755 function stackClear$1() {
12756   this.__data__ = new ListCache$3();
12757   this.size = 0;
12758 }
12759
12760 var _stackClear = stackClear$1;
12761
12762 /**
12763  * Removes `key` and its value from the stack.
12764  *
12765  * @private
12766  * @name delete
12767  * @memberOf Stack
12768  * @param {string} key The key of the value to remove.
12769  * @returns {boolean} Returns `true` if the entry was removed, else `false`.
12770  */
12771
12772 function stackDelete$1(key) {
12773   var data = this.__data__,
12774       result = data['delete'](key);
12775   this.size = data.size;
12776   return result;
12777 }
12778
12779 var _stackDelete = stackDelete$1;
12780
12781 /**
12782  * Gets the stack value for `key`.
12783  *
12784  * @private
12785  * @name get
12786  * @memberOf Stack
12787  * @param {string} key The key of the value to get.
12788  * @returns {*} Returns the entry value.
12789  */
12790
12791 function stackGet$1(key) {
12792   return this.__data__.get(key);
12793 }
12794
12795 var _stackGet = stackGet$1;
12796
12797 /**
12798  * Checks if a stack value for `key` exists.
12799  *
12800  * @private
12801  * @name has
12802  * @memberOf Stack
12803  * @param {string} key The key of the entry to check.
12804  * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
12805  */
12806
12807 function stackHas$1(key) {
12808   return this.__data__.has(key);
12809 }
12810
12811 var _stackHas = stackHas$1;
12812
12813 var root$6 = _root;
12814 /** Used to detect overreaching core-js shims. */
12815
12816 var coreJsData$1 = root$6['__core-js_shared__'];
12817 var _coreJsData = coreJsData$1;
12818
12819 var coreJsData = _coreJsData;
12820 /** Used to detect methods masquerading as native. */
12821
12822 var maskSrcKey = function () {
12823   var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
12824   return uid ? 'Symbol(src)_1.' + uid : '';
12825 }();
12826 /**
12827  * Checks if `func` has its source masked.
12828  *
12829  * @private
12830  * @param {Function} func The function to check.
12831  * @returns {boolean} Returns `true` if `func` is masked, else `false`.
12832  */
12833
12834
12835 function isMasked$1(func) {
12836   return !!maskSrcKey && maskSrcKey in func;
12837 }
12838
12839 var _isMasked = isMasked$1;
12840
12841 /** Used for built-in method references. */
12842 var funcProto$1 = Function.prototype;
12843 /** Used to resolve the decompiled source of functions. */
12844
12845 var funcToString$1 = funcProto$1.toString;
12846 /**
12847  * Converts `func` to its source code.
12848  *
12849  * @private
12850  * @param {Function} func The function to convert.
12851  * @returns {string} Returns the source code.
12852  */
12853
12854 function toSource$2(func) {
12855   if (func != null) {
12856     try {
12857       return funcToString$1.call(func);
12858     } catch (e) {}
12859
12860     try {
12861       return func + '';
12862     } catch (e) {}
12863   }
12864
12865   return '';
12866 }
12867
12868 var _toSource = toSource$2;
12869
12870 var isFunction = isFunction_1,
12871     isMasked = _isMasked,
12872     isObject$2 = isObject_1,
12873     toSource$1 = _toSource;
12874 /**
12875  * Used to match `RegExp`
12876  * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
12877  */
12878
12879 var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
12880 /** Used to detect host constructors (Safari). */
12881
12882 var reIsHostCtor = /^\[object .+?Constructor\]$/;
12883 /** Used for built-in method references. */
12884
12885 var funcProto = Function.prototype,
12886     objectProto$7 = Object.prototype;
12887 /** Used to resolve the decompiled source of functions. */
12888
12889 var funcToString = funcProto.toString;
12890 /** Used to check objects for own properties. */
12891
12892 var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
12893 /** Used to detect if a method is native. */
12894
12895 var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty$6).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
12896 /**
12897  * The base implementation of `_.isNative` without bad shim checks.
12898  *
12899  * @private
12900  * @param {*} value The value to check.
12901  * @returns {boolean} Returns `true` if `value` is a native function,
12902  *  else `false`.
12903  */
12904
12905 function baseIsNative$1(value) {
12906   if (!isObject$2(value) || isMasked(value)) {
12907     return false;
12908   }
12909
12910   var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
12911   return pattern.test(toSource$1(value));
12912 }
12913
12914 var _baseIsNative = baseIsNative$1;
12915
12916 /**
12917  * Gets the value at `key` of `object`.
12918  *
12919  * @private
12920  * @param {Object} [object] The object to query.
12921  * @param {string} key The key of the property to get.
12922  * @returns {*} Returns the property value.
12923  */
12924
12925 function getValue$1(object, key) {
12926   return object == null ? undefined : object[key];
12927 }
12928
12929 var _getValue = getValue$1;
12930
12931 var baseIsNative = _baseIsNative,
12932     getValue = _getValue;
12933 /**
12934  * Gets the native function at `key` of `object`.
12935  *
12936  * @private
12937  * @param {Object} object The object to query.
12938  * @param {string} key The key of the method to get.
12939  * @returns {*} Returns the function if it's native, else `undefined`.
12940  */
12941
12942 function getNative$7(object, key) {
12943   var value = getValue(object, key);
12944   return baseIsNative(value) ? value : undefined;
12945 }
12946
12947 var _getNative = getNative$7;
12948
12949 var getNative$6 = _getNative,
12950     root$5 = _root;
12951 /* Built-in method references that are verified to be native. */
12952
12953 var Map$4 = getNative$6(root$5, 'Map');
12954 var _Map = Map$4;
12955
12956 var getNative$5 = _getNative;
12957 /* Built-in method references that are verified to be native. */
12958
12959 var nativeCreate$4 = getNative$5(Object, 'create');
12960 var _nativeCreate = nativeCreate$4;
12961
12962 var nativeCreate$3 = _nativeCreate;
12963 /**
12964  * Removes all key-value entries from the hash.
12965  *
12966  * @private
12967  * @name clear
12968  * @memberOf Hash
12969  */
12970
12971 function hashClear$1() {
12972   this.__data__ = nativeCreate$3 ? nativeCreate$3(null) : {};
12973   this.size = 0;
12974 }
12975
12976 var _hashClear = hashClear$1;
12977
12978 /**
12979  * Removes `key` and its value from the hash.
12980  *
12981  * @private
12982  * @name delete
12983  * @memberOf Hash
12984  * @param {Object} hash The hash to modify.
12985  * @param {string} key The key of the value to remove.
12986  * @returns {boolean} Returns `true` if the entry was removed, else `false`.
12987  */
12988
12989 function hashDelete$1(key) {
12990   var result = this.has(key) && delete this.__data__[key];
12991   this.size -= result ? 1 : 0;
12992   return result;
12993 }
12994
12995 var _hashDelete = hashDelete$1;
12996
12997 var nativeCreate$2 = _nativeCreate;
12998 /** Used to stand-in for `undefined` hash values. */
12999
13000 var HASH_UNDEFINED$2 = '__lodash_hash_undefined__';
13001 /** Used for built-in method references. */
13002
13003 var objectProto$6 = Object.prototype;
13004 /** Used to check objects for own properties. */
13005
13006 var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
13007 /**
13008  * Gets the hash value for `key`.
13009  *
13010  * @private
13011  * @name get
13012  * @memberOf Hash
13013  * @param {string} key The key of the value to get.
13014  * @returns {*} Returns the entry value.
13015  */
13016
13017 function hashGet$1(key) {
13018   var data = this.__data__;
13019
13020   if (nativeCreate$2) {
13021     var result = data[key];
13022     return result === HASH_UNDEFINED$2 ? undefined : result;
13023   }
13024
13025   return hasOwnProperty$5.call(data, key) ? data[key] : undefined;
13026 }
13027
13028 var _hashGet = hashGet$1;
13029
13030 var nativeCreate$1 = _nativeCreate;
13031 /** Used for built-in method references. */
13032
13033 var objectProto$5 = Object.prototype;
13034 /** Used to check objects for own properties. */
13035
13036 var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
13037 /**
13038  * Checks if a hash value for `key` exists.
13039  *
13040  * @private
13041  * @name has
13042  * @memberOf Hash
13043  * @param {string} key The key of the entry to check.
13044  * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
13045  */
13046
13047 function hashHas$1(key) {
13048   var data = this.__data__;
13049   return nativeCreate$1 ? data[key] !== undefined : hasOwnProperty$4.call(data, key);
13050 }
13051
13052 var _hashHas = hashHas$1;
13053
13054 var nativeCreate = _nativeCreate;
13055 /** Used to stand-in for `undefined` hash values. */
13056
13057 var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
13058 /**
13059  * Sets the hash `key` to `value`.
13060  *
13061  * @private
13062  * @name set
13063  * @memberOf Hash
13064  * @param {string} key The key of the value to set.
13065  * @param {*} value The value to set.
13066  * @returns {Object} Returns the hash instance.
13067  */
13068
13069 function hashSet$1(key, value) {
13070   var data = this.__data__;
13071   this.size += this.has(key) ? 0 : 1;
13072   data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED$1 : value;
13073   return this;
13074 }
13075
13076 var _hashSet = hashSet$1;
13077
13078 var hashClear = _hashClear,
13079     hashDelete = _hashDelete,
13080     hashGet = _hashGet,
13081     hashHas = _hashHas,
13082     hashSet = _hashSet;
13083 /**
13084  * Creates a hash object.
13085  *
13086  * @private
13087  * @constructor
13088  * @param {Array} [entries] The key-value pairs to cache.
13089  */
13090
13091 function Hash$1(entries) {
13092   var index = -1,
13093       length = entries == null ? 0 : entries.length;
13094   this.clear();
13095
13096   while (++index < length) {
13097     var entry = entries[index];
13098     this.set(entry[0], entry[1]);
13099   }
13100 } // Add methods to `Hash`.
13101
13102
13103 Hash$1.prototype.clear = hashClear;
13104 Hash$1.prototype['delete'] = hashDelete;
13105 Hash$1.prototype.get = hashGet;
13106 Hash$1.prototype.has = hashHas;
13107 Hash$1.prototype.set = hashSet;
13108 var _Hash = Hash$1;
13109
13110 var Hash = _Hash,
13111     ListCache$2 = _ListCache,
13112     Map$3 = _Map;
13113 /**
13114  * Removes all key-value entries from the map.
13115  *
13116  * @private
13117  * @name clear
13118  * @memberOf MapCache
13119  */
13120
13121 function mapCacheClear$1() {
13122   this.size = 0;
13123   this.__data__ = {
13124     'hash': new Hash(),
13125     'map': new (Map$3 || ListCache$2)(),
13126     'string': new Hash()
13127   };
13128 }
13129
13130 var _mapCacheClear = mapCacheClear$1;
13131
13132 /**
13133  * Checks if `value` is suitable for use as unique object key.
13134  *
13135  * @private
13136  * @param {*} value The value to check.
13137  * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
13138  */
13139
13140 function isKeyable$1(value) {
13141   var type = typeof value;
13142   return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null;
13143 }
13144
13145 var _isKeyable = isKeyable$1;
13146
13147 var isKeyable = _isKeyable;
13148 /**
13149  * Gets the data for `map`.
13150  *
13151  * @private
13152  * @param {Object} map The map to query.
13153  * @param {string} key The reference key.
13154  * @returns {*} Returns the map data.
13155  */
13156
13157 function getMapData$4(map, key) {
13158   var data = map.__data__;
13159   return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map;
13160 }
13161
13162 var _getMapData = getMapData$4;
13163
13164 var getMapData$3 = _getMapData;
13165 /**
13166  * Removes `key` and its value from the map.
13167  *
13168  * @private
13169  * @name delete
13170  * @memberOf MapCache
13171  * @param {string} key The key of the value to remove.
13172  * @returns {boolean} Returns `true` if the entry was removed, else `false`.
13173  */
13174
13175 function mapCacheDelete$1(key) {
13176   var result = getMapData$3(this, key)['delete'](key);
13177   this.size -= result ? 1 : 0;
13178   return result;
13179 }
13180
13181 var _mapCacheDelete = mapCacheDelete$1;
13182
13183 var getMapData$2 = _getMapData;
13184 /**
13185  * Gets the map value for `key`.
13186  *
13187  * @private
13188  * @name get
13189  * @memberOf MapCache
13190  * @param {string} key The key of the value to get.
13191  * @returns {*} Returns the entry value.
13192  */
13193
13194 function mapCacheGet$1(key) {
13195   return getMapData$2(this, key).get(key);
13196 }
13197
13198 var _mapCacheGet = mapCacheGet$1;
13199
13200 var getMapData$1 = _getMapData;
13201 /**
13202  * Checks if a map value for `key` exists.
13203  *
13204  * @private
13205  * @name has
13206  * @memberOf MapCache
13207  * @param {string} key The key of the entry to check.
13208  * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
13209  */
13210
13211 function mapCacheHas$1(key) {
13212   return getMapData$1(this, key).has(key);
13213 }
13214
13215 var _mapCacheHas = mapCacheHas$1;
13216
13217 var getMapData = _getMapData;
13218 /**
13219  * Sets the map `key` to `value`.
13220  *
13221  * @private
13222  * @name set
13223  * @memberOf MapCache
13224  * @param {string} key The key of the value to set.
13225  * @param {*} value The value to set.
13226  * @returns {Object} Returns the map cache instance.
13227  */
13228
13229 function mapCacheSet$1(key, value) {
13230   var data = getMapData(this, key),
13231       size = data.size;
13232   data.set(key, value);
13233   this.size += data.size == size ? 0 : 1;
13234   return this;
13235 }
13236
13237 var _mapCacheSet = mapCacheSet$1;
13238
13239 var mapCacheClear = _mapCacheClear,
13240     mapCacheDelete = _mapCacheDelete,
13241     mapCacheGet = _mapCacheGet,
13242     mapCacheHas = _mapCacheHas,
13243     mapCacheSet = _mapCacheSet;
13244 /**
13245  * Creates a map cache object to store key-value pairs.
13246  *
13247  * @private
13248  * @constructor
13249  * @param {Array} [entries] The key-value pairs to cache.
13250  */
13251
13252 function MapCache$3(entries) {
13253   var index = -1,
13254       length = entries == null ? 0 : entries.length;
13255   this.clear();
13256
13257   while (++index < length) {
13258     var entry = entries[index];
13259     this.set(entry[0], entry[1]);
13260   }
13261 } // Add methods to `MapCache`.
13262
13263
13264 MapCache$3.prototype.clear = mapCacheClear;
13265 MapCache$3.prototype['delete'] = mapCacheDelete;
13266 MapCache$3.prototype.get = mapCacheGet;
13267 MapCache$3.prototype.has = mapCacheHas;
13268 MapCache$3.prototype.set = mapCacheSet;
13269 var _MapCache = MapCache$3;
13270
13271 var ListCache$1 = _ListCache,
13272     Map$2 = _Map,
13273     MapCache$2 = _MapCache;
13274 /** Used as the size to enable large array optimizations. */
13275
13276 var LARGE_ARRAY_SIZE = 200;
13277 /**
13278  * Sets the stack `key` to `value`.
13279  *
13280  * @private
13281  * @name set
13282  * @memberOf Stack
13283  * @param {string} key The key of the value to set.
13284  * @param {*} value The value to set.
13285  * @returns {Object} Returns the stack cache instance.
13286  */
13287
13288 function stackSet$1(key, value) {
13289   var data = this.__data__;
13290
13291   if (data instanceof ListCache$1) {
13292     var pairs = data.__data__;
13293
13294     if (!Map$2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
13295       pairs.push([key, value]);
13296       this.size = ++data.size;
13297       return this;
13298     }
13299
13300     data = this.__data__ = new MapCache$2(pairs);
13301   }
13302
13303   data.set(key, value);
13304   this.size = data.size;
13305   return this;
13306 }
13307
13308 var _stackSet = stackSet$1;
13309
13310 var ListCache = _ListCache,
13311     stackClear = _stackClear,
13312     stackDelete = _stackDelete,
13313     stackGet = _stackGet,
13314     stackHas = _stackHas,
13315     stackSet = _stackSet;
13316 /**
13317  * Creates a stack cache object to store key-value pairs.
13318  *
13319  * @private
13320  * @constructor
13321  * @param {Array} [entries] The key-value pairs to cache.
13322  */
13323
13324 function Stack$2(entries) {
13325   var data = this.__data__ = new ListCache(entries);
13326   this.size = data.size;
13327 } // Add methods to `Stack`.
13328
13329
13330 Stack$2.prototype.clear = stackClear;
13331 Stack$2.prototype['delete'] = stackDelete;
13332 Stack$2.prototype.get = stackGet;
13333 Stack$2.prototype.has = stackHas;
13334 Stack$2.prototype.set = stackSet;
13335 var _Stack = Stack$2;
13336
13337 /** Used to stand-in for `undefined` hash values. */
13338 var HASH_UNDEFINED = '__lodash_hash_undefined__';
13339 /**
13340  * Adds `value` to the array cache.
13341  *
13342  * @private
13343  * @name add
13344  * @memberOf SetCache
13345  * @alias push
13346  * @param {*} value The value to cache.
13347  * @returns {Object} Returns the cache instance.
13348  */
13349
13350 function setCacheAdd$1(value) {
13351   this.__data__.set(value, HASH_UNDEFINED);
13352
13353   return this;
13354 }
13355
13356 var _setCacheAdd = setCacheAdd$1;
13357
13358 /**
13359  * Checks if `value` is in the array cache.
13360  *
13361  * @private
13362  * @name has
13363  * @memberOf SetCache
13364  * @param {*} value The value to search for.
13365  * @returns {number} Returns `true` if `value` is found, else `false`.
13366  */
13367
13368 function setCacheHas$1(value) {
13369   return this.__data__.has(value);
13370 }
13371
13372 var _setCacheHas = setCacheHas$1;
13373
13374 var MapCache$1 = _MapCache,
13375     setCacheAdd = _setCacheAdd,
13376     setCacheHas = _setCacheHas;
13377 /**
13378  *
13379  * Creates an array cache object to store unique values.
13380  *
13381  * @private
13382  * @constructor
13383  * @param {Array} [values] The values to cache.
13384  */
13385
13386 function SetCache$1(values) {
13387   var index = -1,
13388       length = values == null ? 0 : values.length;
13389   this.__data__ = new MapCache$1();
13390
13391   while (++index < length) {
13392     this.add(values[index]);
13393   }
13394 } // Add methods to `SetCache`.
13395
13396
13397 SetCache$1.prototype.add = SetCache$1.prototype.push = setCacheAdd;
13398 SetCache$1.prototype.has = setCacheHas;
13399 var _SetCache = SetCache$1;
13400
13401 /**
13402  * A specialized version of `_.some` for arrays without support for iteratee
13403  * shorthands.
13404  *
13405  * @private
13406  * @param {Array} [array] The array to iterate over.
13407  * @param {Function} predicate The function invoked per iteration.
13408  * @returns {boolean} Returns `true` if any element passes the predicate check,
13409  *  else `false`.
13410  */
13411
13412 function arraySome$1(array, predicate) {
13413   var index = -1,
13414       length = array == null ? 0 : array.length;
13415
13416   while (++index < length) {
13417     if (predicate(array[index], index, array)) {
13418       return true;
13419     }
13420   }
13421
13422   return false;
13423 }
13424
13425 var _arraySome = arraySome$1;
13426
13427 /**
13428  * Checks if a `cache` value for `key` exists.
13429  *
13430  * @private
13431  * @param {Object} cache The cache to query.
13432  * @param {string} key The key of the entry to check.
13433  * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
13434  */
13435
13436 function cacheHas$1(cache, key) {
13437   return cache.has(key);
13438 }
13439
13440 var _cacheHas = cacheHas$1;
13441
13442 var SetCache = _SetCache,
13443     arraySome = _arraySome,
13444     cacheHas = _cacheHas;
13445 /** Used to compose bitmasks for value comparisons. */
13446
13447 var COMPARE_PARTIAL_FLAG$5 = 1,
13448     COMPARE_UNORDERED_FLAG$3 = 2;
13449 /**
13450  * A specialized version of `baseIsEqualDeep` for arrays with support for
13451  * partial deep comparisons.
13452  *
13453  * @private
13454  * @param {Array} array The array to compare.
13455  * @param {Array} other The other array to compare.
13456  * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
13457  * @param {Function} customizer The function to customize comparisons.
13458  * @param {Function} equalFunc The function to determine equivalents of values.
13459  * @param {Object} stack Tracks traversed `array` and `other` objects.
13460  * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
13461  */
13462
13463 function equalArrays$2(array, other, bitmask, customizer, equalFunc, stack) {
13464   var isPartial = bitmask & COMPARE_PARTIAL_FLAG$5,
13465       arrLength = array.length,
13466       othLength = other.length;
13467
13468   if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
13469     return false;
13470   } // Check that cyclic values are equal.
13471
13472
13473   var arrStacked = stack.get(array);
13474   var othStacked = stack.get(other);
13475
13476   if (arrStacked && othStacked) {
13477     return arrStacked == other && othStacked == array;
13478   }
13479
13480   var index = -1,
13481       result = true,
13482       seen = bitmask & COMPARE_UNORDERED_FLAG$3 ? new SetCache() : undefined;
13483   stack.set(array, other);
13484   stack.set(other, array); // Ignore non-index properties.
13485
13486   while (++index < arrLength) {
13487     var arrValue = array[index],
13488         othValue = other[index];
13489
13490     if (customizer) {
13491       var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
13492     }
13493
13494     if (compared !== undefined) {
13495       if (compared) {
13496         continue;
13497       }
13498
13499       result = false;
13500       break;
13501     } // Recursively compare arrays (susceptible to call stack limits).
13502
13503
13504     if (seen) {
13505       if (!arraySome(other, function (othValue, othIndex) {
13506         if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
13507           return seen.push(othIndex);
13508         }
13509       })) {
13510         result = false;
13511         break;
13512       }
13513     } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
13514       result = false;
13515       break;
13516     }
13517   }
13518
13519   stack['delete'](array);
13520   stack['delete'](other);
13521   return result;
13522 }
13523
13524 var _equalArrays = equalArrays$2;
13525
13526 var root$4 = _root;
13527 /** Built-in value references. */
13528
13529 var Uint8Array$1 = root$4.Uint8Array;
13530 var _Uint8Array = Uint8Array$1;
13531
13532 /**
13533  * Converts `map` to its key-value pairs.
13534  *
13535  * @private
13536  * @param {Object} map The map to convert.
13537  * @returns {Array} Returns the key-value pairs.
13538  */
13539
13540 function mapToArray$1(map) {
13541   var index = -1,
13542       result = Array(map.size);
13543   map.forEach(function (value, key) {
13544     result[++index] = [key, value];
13545   });
13546   return result;
13547 }
13548
13549 var _mapToArray = mapToArray$1;
13550
13551 /**
13552  * Converts `set` to an array of its values.
13553  *
13554  * @private
13555  * @param {Object} set The set to convert.
13556  * @returns {Array} Returns the values.
13557  */
13558
13559 function setToArray$1(set) {
13560   var index = -1,
13561       result = Array(set.size);
13562   set.forEach(function (value) {
13563     result[++index] = value;
13564   });
13565   return result;
13566 }
13567
13568 var _setToArray = setToArray$1;
13569
13570 var Symbol$3 = _Symbol,
13571     Uint8Array = _Uint8Array,
13572     eq$1 = eq_1,
13573     equalArrays$1 = _equalArrays,
13574     mapToArray = _mapToArray,
13575     setToArray = _setToArray;
13576 /** Used to compose bitmasks for value comparisons. */
13577
13578 var COMPARE_PARTIAL_FLAG$4 = 1,
13579     COMPARE_UNORDERED_FLAG$2 = 2;
13580 /** `Object#toString` result references. */
13581
13582 var boolTag = '[object Boolean]',
13583     dateTag = '[object Date]',
13584     errorTag = '[object Error]',
13585     mapTag$1 = '[object Map]',
13586     numberTag = '[object Number]',
13587     regexpTag = '[object RegExp]',
13588     setTag$1 = '[object Set]',
13589     stringTag = '[object String]',
13590     symbolTag$1 = '[object Symbol]';
13591 var arrayBufferTag = '[object ArrayBuffer]',
13592     dataViewTag$1 = '[object DataView]';
13593 /** Used to convert symbols to primitives and strings. */
13594
13595 var symbolProto$1 = Symbol$3 ? Symbol$3.prototype : undefined,
13596     symbolValueOf = symbolProto$1 ? symbolProto$1.valueOf : undefined;
13597 /**
13598  * A specialized version of `baseIsEqualDeep` for comparing objects of
13599  * the same `toStringTag`.
13600  *
13601  * **Note:** This function only supports comparing values with tags of
13602  * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
13603  *
13604  * @private
13605  * @param {Object} object The object to compare.
13606  * @param {Object} other The other object to compare.
13607  * @param {string} tag The `toStringTag` of the objects to compare.
13608  * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
13609  * @param {Function} customizer The function to customize comparisons.
13610  * @param {Function} equalFunc The function to determine equivalents of values.
13611  * @param {Object} stack Tracks traversed `object` and `other` objects.
13612  * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
13613  */
13614
13615 function equalByTag$1(object, other, tag, bitmask, customizer, equalFunc, stack) {
13616   switch (tag) {
13617     case dataViewTag$1:
13618       if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
13619         return false;
13620       }
13621
13622       object = object.buffer;
13623       other = other.buffer;
13624
13625     case arrayBufferTag:
13626       if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
13627         return false;
13628       }
13629
13630       return true;
13631
13632     case boolTag:
13633     case dateTag:
13634     case numberTag:
13635       // Coerce booleans to `1` or `0` and dates to milliseconds.
13636       // Invalid dates are coerced to `NaN`.
13637       return eq$1(+object, +other);
13638
13639     case errorTag:
13640       return object.name == other.name && object.message == other.message;
13641
13642     case regexpTag:
13643     case stringTag:
13644       // Coerce regexes to strings and treat strings, primitives and objects,
13645       // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
13646       // for more details.
13647       return object == other + '';
13648
13649     case mapTag$1:
13650       var convert = mapToArray;
13651
13652     case setTag$1:
13653       var isPartial = bitmask & COMPARE_PARTIAL_FLAG$4;
13654       convert || (convert = setToArray);
13655
13656       if (object.size != other.size && !isPartial) {
13657         return false;
13658       } // Assume cyclic values are equal.
13659
13660
13661       var stacked = stack.get(object);
13662
13663       if (stacked) {
13664         return stacked == other;
13665       }
13666
13667       bitmask |= COMPARE_UNORDERED_FLAG$2; // Recursively compare objects (susceptible to call stack limits).
13668
13669       stack.set(object, other);
13670       var result = equalArrays$1(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
13671       stack['delete'](object);
13672       return result;
13673
13674     case symbolTag$1:
13675       if (symbolValueOf) {
13676         return symbolValueOf.call(object) == symbolValueOf.call(other);
13677       }
13678
13679   }
13680
13681   return false;
13682 }
13683
13684 var _equalByTag = equalByTag$1;
13685
13686 /**
13687  * Appends the elements of `values` to `array`.
13688  *
13689  * @private
13690  * @param {Array} array The array to modify.
13691  * @param {Array} values The values to append.
13692  * @returns {Array} Returns `array`.
13693  */
13694
13695 function arrayPush$2(array, values) {
13696   var index = -1,
13697       length = values.length,
13698       offset = array.length;
13699
13700   while (++index < length) {
13701     array[offset + index] = values[index];
13702   }
13703
13704   return array;
13705 }
13706
13707 var _arrayPush = arrayPush$2;
13708
13709 var arrayPush$1 = _arrayPush,
13710     isArray$8 = isArray_1;
13711 /**
13712  * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
13713  * `keysFunc` and `symbolsFunc` to get the enumerable property names and
13714  * symbols of `object`.
13715  *
13716  * @private
13717  * @param {Object} object The object to query.
13718  * @param {Function} keysFunc The function to get the keys of `object`.
13719  * @param {Function} symbolsFunc The function to get the symbols of `object`.
13720  * @returns {Array} Returns the array of property names and symbols.
13721  */
13722
13723 function baseGetAllKeys$1(object, keysFunc, symbolsFunc) {
13724   var result = keysFunc(object);
13725   return isArray$8(object) ? result : arrayPush$1(result, symbolsFunc(object));
13726 }
13727
13728 var _baseGetAllKeys = baseGetAllKeys$1;
13729
13730 /**
13731  * A specialized version of `_.filter` for arrays without support for
13732  * iteratee shorthands.
13733  *
13734  * @private
13735  * @param {Array} [array] The array to iterate over.
13736  * @param {Function} predicate The function invoked per iteration.
13737  * @returns {Array} Returns the new filtered array.
13738  */
13739
13740 function arrayFilter$1(array, predicate) {
13741   var index = -1,
13742       length = array == null ? 0 : array.length,
13743       resIndex = 0,
13744       result = [];
13745
13746   while (++index < length) {
13747     var value = array[index];
13748
13749     if (predicate(value, index, array)) {
13750       result[resIndex++] = value;
13751     }
13752   }
13753
13754   return result;
13755 }
13756
13757 var _arrayFilter = arrayFilter$1;
13758
13759 /**
13760  * This method returns a new empty array.
13761  *
13762  * @static
13763  * @memberOf _
13764  * @since 4.13.0
13765  * @category Util
13766  * @returns {Array} Returns the new empty array.
13767  * @example
13768  *
13769  * var arrays = _.times(2, _.stubArray);
13770  *
13771  * console.log(arrays);
13772  * // => [[], []]
13773  *
13774  * console.log(arrays[0] === arrays[1]);
13775  * // => false
13776  */
13777
13778 function stubArray$1() {
13779   return [];
13780 }
13781
13782 var stubArray_1 = stubArray$1;
13783
13784 var arrayFilter = _arrayFilter,
13785     stubArray = stubArray_1;
13786 /** Used for built-in method references. */
13787
13788 var objectProto$4 = Object.prototype;
13789 /** Built-in value references. */
13790
13791 var propertyIsEnumerable = objectProto$4.propertyIsEnumerable;
13792 /* Built-in method references for those with the same name as other `lodash` methods. */
13793
13794 var nativeGetSymbols = Object.getOwnPropertySymbols;
13795 /**
13796  * Creates an array of the own enumerable symbols of `object`.
13797  *
13798  * @private
13799  * @param {Object} object The object to query.
13800  * @returns {Array} Returns the array of symbols.
13801  */
13802
13803 var getSymbols$1 = !nativeGetSymbols ? stubArray : function (object) {
13804   if (object == null) {
13805     return [];
13806   }
13807
13808   object = Object(object);
13809   return arrayFilter(nativeGetSymbols(object), function (symbol) {
13810     return propertyIsEnumerable.call(object, symbol);
13811   });
13812 };
13813 var _getSymbols = getSymbols$1;
13814
13815 var baseGetAllKeys = _baseGetAllKeys,
13816     getSymbols = _getSymbols,
13817     keys$1 = keys_1;
13818 /**
13819  * Creates an array of own enumerable property names and symbols of `object`.
13820  *
13821  * @private
13822  * @param {Object} object The object to query.
13823  * @returns {Array} Returns the array of property names and symbols.
13824  */
13825
13826 function getAllKeys$1(object) {
13827   return baseGetAllKeys(object, keys$1, getSymbols);
13828 }
13829
13830 var _getAllKeys = getAllKeys$1;
13831
13832 var getAllKeys = _getAllKeys;
13833 /** Used to compose bitmasks for value comparisons. */
13834
13835 var COMPARE_PARTIAL_FLAG$3 = 1;
13836 /** Used for built-in method references. */
13837
13838 var objectProto$3 = Object.prototype;
13839 /** Used to check objects for own properties. */
13840
13841 var hasOwnProperty$3 = objectProto$3.hasOwnProperty;
13842 /**
13843  * A specialized version of `baseIsEqualDeep` for objects with support for
13844  * partial deep comparisons.
13845  *
13846  * @private
13847  * @param {Object} object The object to compare.
13848  * @param {Object} other The other object to compare.
13849  * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
13850  * @param {Function} customizer The function to customize comparisons.
13851  * @param {Function} equalFunc The function to determine equivalents of values.
13852  * @param {Object} stack Tracks traversed `object` and `other` objects.
13853  * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
13854  */
13855
13856 function equalObjects$1(object, other, bitmask, customizer, equalFunc, stack) {
13857   var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3,
13858       objProps = getAllKeys(object),
13859       objLength = objProps.length,
13860       othProps = getAllKeys(other),
13861       othLength = othProps.length;
13862
13863   if (objLength != othLength && !isPartial) {
13864     return false;
13865   }
13866
13867   var index = objLength;
13868
13869   while (index--) {
13870     var key = objProps[index];
13871
13872     if (!(isPartial ? key in other : hasOwnProperty$3.call(other, key))) {
13873       return false;
13874     }
13875   } // Check that cyclic values are equal.
13876
13877
13878   var objStacked = stack.get(object);
13879   var othStacked = stack.get(other);
13880
13881   if (objStacked && othStacked) {
13882     return objStacked == other && othStacked == object;
13883   }
13884
13885   var result = true;
13886   stack.set(object, other);
13887   stack.set(other, object);
13888   var skipCtor = isPartial;
13889
13890   while (++index < objLength) {
13891     key = objProps[index];
13892     var objValue = object[key],
13893         othValue = other[key];
13894
13895     if (customizer) {
13896       var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
13897     } // Recursively compare objects (susceptible to call stack limits).
13898
13899
13900     if (!(compared === undefined ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
13901       result = false;
13902       break;
13903     }
13904
13905     skipCtor || (skipCtor = key == 'constructor');
13906   }
13907
13908   if (result && !skipCtor) {
13909     var objCtor = object.constructor,
13910         othCtor = other.constructor; // Non `Object` object instances with different constructors are not equal.
13911
13912     if (objCtor != othCtor && 'constructor' in object && 'constructor' in other && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) {
13913       result = false;
13914     }
13915   }
13916
13917   stack['delete'](object);
13918   stack['delete'](other);
13919   return result;
13920 }
13921
13922 var _equalObjects = equalObjects$1;
13923
13924 var getNative$4 = _getNative,
13925     root$3 = _root;
13926 /* Built-in method references that are verified to be native. */
13927
13928 var DataView$1 = getNative$4(root$3, 'DataView');
13929 var _DataView = DataView$1;
13930
13931 var getNative$3 = _getNative,
13932     root$2 = _root;
13933 /* Built-in method references that are verified to be native. */
13934
13935 var Promise$2 = getNative$3(root$2, 'Promise');
13936 var _Promise = Promise$2;
13937
13938 var getNative$2 = _getNative,
13939     root$1 = _root;
13940 /* Built-in method references that are verified to be native. */
13941
13942 var Set$2 = getNative$2(root$1, 'Set');
13943 var _Set = Set$2;
13944
13945 var getNative$1 = _getNative,
13946     root = _root;
13947 /* Built-in method references that are verified to be native. */
13948
13949 var WeakMap$2 = getNative$1(root, 'WeakMap');
13950 var _WeakMap = WeakMap$2;
13951
13952 var DataView = _DataView,
13953     Map$1 = _Map,
13954     Promise$1 = _Promise,
13955     Set$1 = _Set,
13956     WeakMap$1 = _WeakMap,
13957     baseGetTag$1 = _baseGetTag,
13958     toSource = _toSource;
13959 /** `Object#toString` result references. */
13960
13961 var mapTag = '[object Map]',
13962     objectTag$1 = '[object Object]',
13963     promiseTag = '[object Promise]',
13964     setTag = '[object Set]',
13965     weakMapTag = '[object WeakMap]';
13966 var dataViewTag = '[object DataView]';
13967 /** Used to detect maps, sets, and weakmaps. */
13968
13969 var dataViewCtorString = toSource(DataView),
13970     mapCtorString = toSource(Map$1),
13971     promiseCtorString = toSource(Promise$1),
13972     setCtorString = toSource(Set$1),
13973     weakMapCtorString = toSource(WeakMap$1);
13974 /**
13975  * Gets the `toStringTag` of `value`.
13976  *
13977  * @private
13978  * @param {*} value The value to query.
13979  * @returns {string} Returns the `toStringTag`.
13980  */
13981
13982 var getTag$1 = baseGetTag$1; // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
13983
13984 if (DataView && getTag$1(new DataView(new ArrayBuffer(1))) != dataViewTag || Map$1 && getTag$1(new Map$1()) != mapTag || Promise$1 && getTag$1(Promise$1.resolve()) != promiseTag || Set$1 && getTag$1(new Set$1()) != setTag || WeakMap$1 && getTag$1(new WeakMap$1()) != weakMapTag) {
13985   getTag$1 = function (value) {
13986     var result = baseGetTag$1(value),
13987         Ctor = result == objectTag$1 ? value.constructor : undefined,
13988         ctorString = Ctor ? toSource(Ctor) : '';
13989
13990     if (ctorString) {
13991       switch (ctorString) {
13992         case dataViewCtorString:
13993           return dataViewTag;
13994
13995         case mapCtorString:
13996           return mapTag;
13997
13998         case promiseCtorString:
13999           return promiseTag;
14000
14001         case setCtorString:
14002           return setTag;
14003
14004         case weakMapCtorString:
14005           return weakMapTag;
14006       }
14007     }
14008
14009     return result;
14010   };
14011 }
14012
14013 var _getTag = getTag$1;
14014
14015 var Stack$1 = _Stack,
14016     equalArrays = _equalArrays,
14017     equalByTag = _equalByTag,
14018     equalObjects = _equalObjects,
14019     getTag = _getTag,
14020     isArray$7 = isArray_1,
14021     isBuffer = isBuffer$2.exports,
14022     isTypedArray = isTypedArray_1;
14023 /** Used to compose bitmasks for value comparisons. */
14024
14025 var COMPARE_PARTIAL_FLAG$2 = 1;
14026 /** `Object#toString` result references. */
14027
14028 var argsTag = '[object Arguments]',
14029     arrayTag = '[object Array]',
14030     objectTag = '[object Object]';
14031 /** Used for built-in method references. */
14032
14033 var objectProto$2 = Object.prototype;
14034 /** Used to check objects for own properties. */
14035
14036 var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
14037 /**
14038  * A specialized version of `baseIsEqual` for arrays and objects which performs
14039  * deep comparisons and tracks traversed objects enabling objects with circular
14040  * references to be compared.
14041  *
14042  * @private
14043  * @param {Object} object The object to compare.
14044  * @param {Object} other The other object to compare.
14045  * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
14046  * @param {Function} customizer The function to customize comparisons.
14047  * @param {Function} equalFunc The function to determine equivalents of values.
14048  * @param {Object} [stack] Tracks traversed `object` and `other` objects.
14049  * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
14050  */
14051
14052 function baseIsEqualDeep$1(object, other, bitmask, customizer, equalFunc, stack) {
14053   var objIsArr = isArray$7(object),
14054       othIsArr = isArray$7(other),
14055       objTag = objIsArr ? arrayTag : getTag(object),
14056       othTag = othIsArr ? arrayTag : getTag(other);
14057   objTag = objTag == argsTag ? objectTag : objTag;
14058   othTag = othTag == argsTag ? objectTag : othTag;
14059   var objIsObj = objTag == objectTag,
14060       othIsObj = othTag == objectTag,
14061       isSameTag = objTag == othTag;
14062
14063   if (isSameTag && isBuffer(object)) {
14064     if (!isBuffer(other)) {
14065       return false;
14066     }
14067
14068     objIsArr = true;
14069     objIsObj = false;
14070   }
14071
14072   if (isSameTag && !objIsObj) {
14073     stack || (stack = new Stack$1());
14074     return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
14075   }
14076
14077   if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {
14078     var objIsWrapped = objIsObj && hasOwnProperty$2.call(object, '__wrapped__'),
14079         othIsWrapped = othIsObj && hasOwnProperty$2.call(other, '__wrapped__');
14080
14081     if (objIsWrapped || othIsWrapped) {
14082       var objUnwrapped = objIsWrapped ? object.value() : object,
14083           othUnwrapped = othIsWrapped ? other.value() : other;
14084       stack || (stack = new Stack$1());
14085       return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
14086     }
14087   }
14088
14089   if (!isSameTag) {
14090     return false;
14091   }
14092
14093   stack || (stack = new Stack$1());
14094   return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
14095 }
14096
14097 var _baseIsEqualDeep = baseIsEqualDeep$1;
14098
14099 var baseIsEqualDeep = _baseIsEqualDeep,
14100     isObjectLike$1 = isObjectLike_1;
14101 /**
14102  * The base implementation of `_.isEqual` which supports partial comparisons
14103  * and tracks traversed objects.
14104  *
14105  * @private
14106  * @param {*} value The value to compare.
14107  * @param {*} other The other value to compare.
14108  * @param {boolean} bitmask The bitmask flags.
14109  *  1 - Unordered comparison
14110  *  2 - Partial comparison
14111  * @param {Function} [customizer] The function to customize comparisons.
14112  * @param {Object} [stack] Tracks traversed `value` and `other` objects.
14113  * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
14114  */
14115
14116 function baseIsEqual$2(value, other, bitmask, customizer, stack) {
14117   if (value === other) {
14118     return true;
14119   }
14120
14121   if (value == null || other == null || !isObjectLike$1(value) && !isObjectLike$1(other)) {
14122     return value !== value && other !== other;
14123   }
14124
14125   return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual$2, stack);
14126 }
14127
14128 var _baseIsEqual = baseIsEqual$2;
14129
14130 var Stack = _Stack,
14131     baseIsEqual$1 = _baseIsEqual;
14132 /** Used to compose bitmasks for value comparisons. */
14133
14134 var COMPARE_PARTIAL_FLAG$1 = 1,
14135     COMPARE_UNORDERED_FLAG$1 = 2;
14136 /**
14137  * The base implementation of `_.isMatch` without support for iteratee shorthands.
14138  *
14139  * @private
14140  * @param {Object} object The object to inspect.
14141  * @param {Object} source The object of property values to match.
14142  * @param {Array} matchData The property names, values, and compare flags to match.
14143  * @param {Function} [customizer] The function to customize comparisons.
14144  * @returns {boolean} Returns `true` if `object` is a match, else `false`.
14145  */
14146
14147 function baseIsMatch$1(object, source, matchData, customizer) {
14148   var index = matchData.length,
14149       length = index,
14150       noCustomizer = !customizer;
14151
14152   if (object == null) {
14153     return !length;
14154   }
14155
14156   object = Object(object);
14157
14158   while (index--) {
14159     var data = matchData[index];
14160
14161     if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
14162       return false;
14163     }
14164   }
14165
14166   while (++index < length) {
14167     data = matchData[index];
14168     var key = data[0],
14169         objValue = object[key],
14170         srcValue = data[1];
14171
14172     if (noCustomizer && data[2]) {
14173       if (objValue === undefined && !(key in object)) {
14174         return false;
14175       }
14176     } else {
14177       var stack = new Stack();
14178
14179       if (customizer) {
14180         var result = customizer(objValue, srcValue, key, object, source, stack);
14181       }
14182
14183       if (!(result === undefined ? baseIsEqual$1(srcValue, objValue, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, customizer, stack) : result)) {
14184         return false;
14185       }
14186     }
14187   }
14188
14189   return true;
14190 }
14191
14192 var _baseIsMatch = baseIsMatch$1;
14193
14194 var isObject$1 = isObject_1;
14195 /**
14196  * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
14197  *
14198  * @private
14199  * @param {*} value The value to check.
14200  * @returns {boolean} Returns `true` if `value` if suitable for strict
14201  *  equality comparisons, else `false`.
14202  */
14203
14204 function isStrictComparable$2(value) {
14205   return value === value && !isObject$1(value);
14206 }
14207
14208 var _isStrictComparable = isStrictComparable$2;
14209
14210 var isStrictComparable$1 = _isStrictComparable,
14211     keys = keys_1;
14212 /**
14213  * Gets the property names, values, and compare flags of `object`.
14214  *
14215  * @private
14216  * @param {Object} object The object to query.
14217  * @returns {Array} Returns the match data of `object`.
14218  */
14219
14220 function getMatchData$1(object) {
14221   var result = keys(object),
14222       length = result.length;
14223
14224   while (length--) {
14225     var key = result[length],
14226         value = object[key];
14227     result[length] = [key, value, isStrictComparable$1(value)];
14228   }
14229
14230   return result;
14231 }
14232
14233 var _getMatchData = getMatchData$1;
14234
14235 /**
14236  * A specialized version of `matchesProperty` for source values suitable
14237  * for strict equality comparisons, i.e. `===`.
14238  *
14239  * @private
14240  * @param {string} key The key of the property to get.
14241  * @param {*} srcValue The value to match.
14242  * @returns {Function} Returns the new spec function.
14243  */
14244
14245 function matchesStrictComparable$2(key, srcValue) {
14246   return function (object) {
14247     if (object == null) {
14248       return false;
14249     }
14250
14251     return object[key] === srcValue && (srcValue !== undefined || key in Object(object));
14252   };
14253 }
14254
14255 var _matchesStrictComparable = matchesStrictComparable$2;
14256
14257 var baseIsMatch = _baseIsMatch,
14258     getMatchData = _getMatchData,
14259     matchesStrictComparable$1 = _matchesStrictComparable;
14260 /**
14261  * The base implementation of `_.matches` which doesn't clone `source`.
14262  *
14263  * @private
14264  * @param {Object} source The object of property values to match.
14265  * @returns {Function} Returns the new spec function.
14266  */
14267
14268 function baseMatches$1(source) {
14269   var matchData = getMatchData(source);
14270
14271   if (matchData.length == 1 && matchData[0][2]) {
14272     return matchesStrictComparable$1(matchData[0][0], matchData[0][1]);
14273   }
14274
14275   return function (object) {
14276     return object === source || baseIsMatch(object, source, matchData);
14277   };
14278 }
14279
14280 var _baseMatches = baseMatches$1;
14281
14282 var baseGetTag = _baseGetTag,
14283     isObjectLike = isObjectLike_1;
14284 /** `Object#toString` result references. */
14285
14286 var symbolTag = '[object Symbol]';
14287 /**
14288  * Checks if `value` is classified as a `Symbol` primitive or object.
14289  *
14290  * @static
14291  * @memberOf _
14292  * @since 4.0.0
14293  * @category Lang
14294  * @param {*} value The value to check.
14295  * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
14296  * @example
14297  *
14298  * _.isSymbol(Symbol.iterator);
14299  * // => true
14300  *
14301  * _.isSymbol('abc');
14302  * // => false
14303  */
14304
14305 function isSymbol$3(value) {
14306   return typeof value == 'symbol' || isObjectLike(value) && baseGetTag(value) == symbolTag;
14307 }
14308
14309 var isSymbol_1 = isSymbol$3;
14310
14311 var isArray$6 = isArray_1,
14312     isSymbol$2 = isSymbol_1;
14313 /** Used to match property names within property paths. */
14314
14315 var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
14316     reIsPlainProp = /^\w*$/;
14317 /**
14318  * Checks if `value` is a property name and not a property path.
14319  *
14320  * @private
14321  * @param {*} value The value to check.
14322  * @param {Object} [object] The object to query keys on.
14323  * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
14324  */
14325
14326 function isKey$3(value, object) {
14327   if (isArray$6(value)) {
14328     return false;
14329   }
14330
14331   var type = typeof value;
14332
14333   if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol$2(value)) {
14334     return true;
14335   }
14336
14337   return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
14338 }
14339
14340 var _isKey = isKey$3;
14341
14342 var MapCache = _MapCache;
14343 /** Error message constants. */
14344
14345 var FUNC_ERROR_TEXT = 'Expected a function';
14346 /**
14347  * Creates a function that memoizes the result of `func`. If `resolver` is
14348  * provided, it determines the cache key for storing the result based on the
14349  * arguments provided to the memoized function. By default, the first argument
14350  * provided to the memoized function is used as the map cache key. The `func`
14351  * is invoked with the `this` binding of the memoized function.
14352  *
14353  * **Note:** The cache is exposed as the `cache` property on the memoized
14354  * function. Its creation may be customized by replacing the `_.memoize.Cache`
14355  * constructor with one whose instances implement the
14356  * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
14357  * method interface of `clear`, `delete`, `get`, `has`, and `set`.
14358  *
14359  * @static
14360  * @memberOf _
14361  * @since 0.1.0
14362  * @category Function
14363  * @param {Function} func The function to have its output memoized.
14364  * @param {Function} [resolver] The function to resolve the cache key.
14365  * @returns {Function} Returns the new memoized function.
14366  * @example
14367  *
14368  * var object = { 'a': 1, 'b': 2 };
14369  * var other = { 'c': 3, 'd': 4 };
14370  *
14371  * var values = _.memoize(_.values);
14372  * values(object);
14373  * // => [1, 2]
14374  *
14375  * values(other);
14376  * // => [3, 4]
14377  *
14378  * object.a = 2;
14379  * values(object);
14380  * // => [1, 2]
14381  *
14382  * // Modify the result cache.
14383  * values.cache.set(object, ['a', 'b']);
14384  * values(object);
14385  * // => ['a', 'b']
14386  *
14387  * // Replace `_.memoize.Cache`.
14388  * _.memoize.Cache = WeakMap;
14389  */
14390
14391 function memoize$1(func, resolver) {
14392   if (typeof func != 'function' || resolver != null && typeof resolver != 'function') {
14393     throw new TypeError(FUNC_ERROR_TEXT);
14394   }
14395
14396   var memoized = function () {
14397     var args = arguments,
14398         key = resolver ? resolver.apply(this, args) : args[0],
14399         cache = memoized.cache;
14400
14401     if (cache.has(key)) {
14402       return cache.get(key);
14403     }
14404
14405     var result = func.apply(this, args);
14406     memoized.cache = cache.set(key, result) || cache;
14407     return result;
14408   };
14409
14410   memoized.cache = new (memoize$1.Cache || MapCache)();
14411   return memoized;
14412 } // Expose `MapCache`.
14413
14414
14415 memoize$1.Cache = MapCache;
14416 var memoize_1 = memoize$1;
14417
14418 var memoize = memoize_1;
14419 /** Used as the maximum memoize cache size. */
14420
14421 var MAX_MEMOIZE_SIZE = 500;
14422 /**
14423  * A specialized version of `_.memoize` which clears the memoized function's
14424  * cache when it exceeds `MAX_MEMOIZE_SIZE`.
14425  *
14426  * @private
14427  * @param {Function} func The function to have its output memoized.
14428  * @returns {Function} Returns the new memoized function.
14429  */
14430
14431 function memoizeCapped$1(func) {
14432   var result = memoize(func, function (key) {
14433     if (cache.size === MAX_MEMOIZE_SIZE) {
14434       cache.clear();
14435     }
14436
14437     return key;
14438   });
14439   var cache = result.cache;
14440   return result;
14441 }
14442
14443 var _memoizeCapped = memoizeCapped$1;
14444
14445 var memoizeCapped = _memoizeCapped;
14446 /** Used to match property names within property paths. */
14447
14448 var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
14449 /** Used to match backslashes in property paths. */
14450
14451 var reEscapeChar = /\\(\\)?/g;
14452 /**
14453  * Converts `string` to a property path array.
14454  *
14455  * @private
14456  * @param {string} string The string to convert.
14457  * @returns {Array} Returns the property path array.
14458  */
14459
14460 var stringToPath$1 = memoizeCapped(function (string) {
14461   var result = [];
14462
14463   if (string.charCodeAt(0) === 46
14464   /* . */
14465   ) {
14466     result.push('');
14467   }
14468
14469   string.replace(rePropName, function (match, number, quote, subString) {
14470     result.push(quote ? subString.replace(reEscapeChar, '$1') : number || match);
14471   });
14472   return result;
14473 });
14474 var _stringToPath = stringToPath$1;
14475
14476 /**
14477  * A specialized version of `_.map` for arrays without support for iteratee
14478  * shorthands.
14479  *
14480  * @private
14481  * @param {Array} [array] The array to iterate over.
14482  * @param {Function} iteratee The function invoked per iteration.
14483  * @returns {Array} Returns the new mapped array.
14484  */
14485
14486 function arrayMap$1(array, iteratee) {
14487   var index = -1,
14488       length = array == null ? 0 : array.length,
14489       result = Array(length);
14490
14491   while (++index < length) {
14492     result[index] = iteratee(array[index], index, array);
14493   }
14494
14495   return result;
14496 }
14497
14498 var _arrayMap = arrayMap$1;
14499
14500 var Symbol$2 = _Symbol,
14501     arrayMap = _arrayMap,
14502     isArray$5 = isArray_1,
14503     isSymbol$1 = isSymbol_1;
14504 /** Used as references for various `Number` constants. */
14505
14506 var INFINITY$1 = 1 / 0;
14507 /** Used to convert symbols to primitives and strings. */
14508
14509 var symbolProto = Symbol$2 ? Symbol$2.prototype : undefined,
14510     symbolToString = symbolProto ? symbolProto.toString : undefined;
14511 /**
14512  * The base implementation of `_.toString` which doesn't convert nullish
14513  * values to empty strings.
14514  *
14515  * @private
14516  * @param {*} value The value to process.
14517  * @returns {string} Returns the string.
14518  */
14519
14520 function baseToString$1(value) {
14521   // Exit early for strings to avoid a performance hit in some environments.
14522   if (typeof value == 'string') {
14523     return value;
14524   }
14525
14526   if (isArray$5(value)) {
14527     // Recursively convert values (susceptible to call stack limits).
14528     return arrayMap(value, baseToString$1) + '';
14529   }
14530
14531   if (isSymbol$1(value)) {
14532     return symbolToString ? symbolToString.call(value) : '';
14533   }
14534
14535   var result = value + '';
14536   return result == '0' && 1 / value == -INFINITY$1 ? '-0' : result;
14537 }
14538
14539 var _baseToString = baseToString$1;
14540
14541 var baseToString = _baseToString;
14542 /**
14543  * Converts `value` to a string. An empty string is returned for `null`
14544  * and `undefined` values. The sign of `-0` is preserved.
14545  *
14546  * @static
14547  * @memberOf _
14548  * @since 4.0.0
14549  * @category Lang
14550  * @param {*} value The value to convert.
14551  * @returns {string} Returns the converted string.
14552  * @example
14553  *
14554  * _.toString(null);
14555  * // => ''
14556  *
14557  * _.toString(-0);
14558  * // => '-0'
14559  *
14560  * _.toString([1, 2, 3]);
14561  * // => '1,2,3'
14562  */
14563
14564 function toString$1(value) {
14565   return value == null ? '' : baseToString(value);
14566 }
14567
14568 var toString_1 = toString$1;
14569
14570 var isArray$4 = isArray_1,
14571     isKey$2 = _isKey,
14572     stringToPath = _stringToPath,
14573     toString = toString_1;
14574 /**
14575  * Casts `value` to a path array if it's not one.
14576  *
14577  * @private
14578  * @param {*} value The value to inspect.
14579  * @param {Object} [object] The object to query keys on.
14580  * @returns {Array} Returns the cast property path array.
14581  */
14582
14583 function castPath$4(value, object) {
14584   if (isArray$4(value)) {
14585     return value;
14586   }
14587
14588   return isKey$2(value, object) ? [value] : stringToPath(toString(value));
14589 }
14590
14591 var _castPath = castPath$4;
14592
14593 var isSymbol = isSymbol_1;
14594 /** Used as references for various `Number` constants. */
14595
14596 var INFINITY = 1 / 0;
14597 /**
14598  * Converts `value` to a string key if it's not a string or symbol.
14599  *
14600  * @private
14601  * @param {*} value The value to inspect.
14602  * @returns {string|symbol} Returns the key.
14603  */
14604
14605 function toKey$5(value) {
14606   if (typeof value == 'string' || isSymbol(value)) {
14607     return value;
14608   }
14609
14610   var result = value + '';
14611   return result == '0' && 1 / value == -INFINITY ? '-0' : result;
14612 }
14613
14614 var _toKey = toKey$5;
14615
14616 var castPath$3 = _castPath,
14617     toKey$4 = _toKey;
14618 /**
14619  * The base implementation of `_.get` without support for default values.
14620  *
14621  * @private
14622  * @param {Object} object The object to query.
14623  * @param {Array|string} path The path of the property to get.
14624  * @returns {*} Returns the resolved value.
14625  */
14626
14627 function baseGet$3(object, path) {
14628   path = castPath$3(path, object);
14629   var index = 0,
14630       length = path.length;
14631
14632   while (object != null && index < length) {
14633     object = object[toKey$4(path[index++])];
14634   }
14635
14636   return index && index == length ? object : undefined;
14637 }
14638
14639 var _baseGet = baseGet$3;
14640
14641 var baseGet$2 = _baseGet;
14642 /**
14643  * Gets the value at `path` of `object`. If the resolved value is
14644  * `undefined`, the `defaultValue` is returned in its place.
14645  *
14646  * @static
14647  * @memberOf _
14648  * @since 3.7.0
14649  * @category Object
14650  * @param {Object} object The object to query.
14651  * @param {Array|string} path The path of the property to get.
14652  * @param {*} [defaultValue] The value returned for `undefined` resolved values.
14653  * @returns {*} Returns the resolved value.
14654  * @example
14655  *
14656  * var object = { 'a': [{ 'b': { 'c': 3 } }] };
14657  *
14658  * _.get(object, 'a[0].b.c');
14659  * // => 3
14660  *
14661  * _.get(object, ['a', '0', 'b', 'c']);
14662  * // => 3
14663  *
14664  * _.get(object, 'a.b.c', 'default');
14665  * // => 'default'
14666  */
14667
14668 function get$1(object, path, defaultValue) {
14669   var result = object == null ? undefined : baseGet$2(object, path);
14670   return result === undefined ? defaultValue : result;
14671 }
14672
14673 var get_1 = get$1;
14674
14675 /**
14676  * The base implementation of `_.hasIn` without support for deep paths.
14677  *
14678  * @private
14679  * @param {Object} [object] The object to query.
14680  * @param {Array|string} key The key to check.
14681  * @returns {boolean} Returns `true` if `key` exists, else `false`.
14682  */
14683
14684 function baseHasIn$1(object, key) {
14685   return object != null && key in Object(object);
14686 }
14687
14688 var _baseHasIn = baseHasIn$1;
14689
14690 var castPath$2 = _castPath,
14691     isArguments$1 = isArguments_1,
14692     isArray$3 = isArray_1,
14693     isIndex$1 = _isIndex,
14694     isLength = isLength_1,
14695     toKey$3 = _toKey;
14696 /**
14697  * Checks if `path` exists on `object`.
14698  *
14699  * @private
14700  * @param {Object} object The object to query.
14701  * @param {Array|string} path The path to check.
14702  * @param {Function} hasFunc The function to check properties.
14703  * @returns {boolean} Returns `true` if `path` exists, else `false`.
14704  */
14705
14706 function hasPath$1(object, path, hasFunc) {
14707   path = castPath$2(path, object);
14708   var index = -1,
14709       length = path.length,
14710       result = false;
14711
14712   while (++index < length) {
14713     var key = toKey$3(path[index]);
14714
14715     if (!(result = object != null && hasFunc(object, key))) {
14716       break;
14717     }
14718
14719     object = object[key];
14720   }
14721
14722   if (result || ++index != length) {
14723     return result;
14724   }
14725
14726   length = object == null ? 0 : object.length;
14727   return !!length && isLength(length) && isIndex$1(key, length) && (isArray$3(object) || isArguments$1(object));
14728 }
14729
14730 var _hasPath = hasPath$1;
14731
14732 var baseHasIn = _baseHasIn,
14733     hasPath = _hasPath;
14734 /**
14735  * Checks if `path` is a direct or inherited property of `object`.
14736  *
14737  * @static
14738  * @memberOf _
14739  * @since 4.0.0
14740  * @category Object
14741  * @param {Object} object The object to query.
14742  * @param {Array|string} path The path to check.
14743  * @returns {boolean} Returns `true` if `path` exists, else `false`.
14744  * @example
14745  *
14746  * var object = _.create({ 'a': _.create({ 'b': 2 }) });
14747  *
14748  * _.hasIn(object, 'a');
14749  * // => true
14750  *
14751  * _.hasIn(object, 'a.b');
14752  * // => true
14753  *
14754  * _.hasIn(object, ['a', 'b']);
14755  * // => true
14756  *
14757  * _.hasIn(object, 'b');
14758  * // => false
14759  */
14760
14761 function hasIn$2(object, path) {
14762   return object != null && hasPath(object, path, baseHasIn);
14763 }
14764
14765 var hasIn_1 = hasIn$2;
14766
14767 var baseIsEqual = _baseIsEqual,
14768     get = get_1,
14769     hasIn$1 = hasIn_1,
14770     isKey$1 = _isKey,
14771     isStrictComparable = _isStrictComparable,
14772     matchesStrictComparable = _matchesStrictComparable,
14773     toKey$2 = _toKey;
14774 /** Used to compose bitmasks for value comparisons. */
14775
14776 var COMPARE_PARTIAL_FLAG = 1,
14777     COMPARE_UNORDERED_FLAG = 2;
14778 /**
14779  * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
14780  *
14781  * @private
14782  * @param {string} path The path of the property to get.
14783  * @param {*} srcValue The value to match.
14784  * @returns {Function} Returns the new spec function.
14785  */
14786
14787 function baseMatchesProperty$1(path, srcValue) {
14788   if (isKey$1(path) && isStrictComparable(srcValue)) {
14789     return matchesStrictComparable(toKey$2(path), srcValue);
14790   }
14791
14792   return function (object) {
14793     var objValue = get(object, path);
14794     return objValue === undefined && objValue === srcValue ? hasIn$1(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
14795   };
14796 }
14797
14798 var _baseMatchesProperty = baseMatchesProperty$1;
14799
14800 /**
14801  * This method returns the first argument it receives.
14802  *
14803  * @static
14804  * @since 0.1.0
14805  * @memberOf _
14806  * @category Util
14807  * @param {*} value Any value.
14808  * @returns {*} Returns `value`.
14809  * @example
14810  *
14811  * var object = { 'a': 1 };
14812  *
14813  * console.log(_.identity(object) === object);
14814  * // => true
14815  */
14816
14817 function identity$2(value) {
14818   return value;
14819 }
14820
14821 var identity_1 = identity$2;
14822
14823 /**
14824  * The base implementation of `_.property` without support for deep paths.
14825  *
14826  * @private
14827  * @param {string} key The key of the property to get.
14828  * @returns {Function} Returns the new accessor function.
14829  */
14830
14831 function baseProperty$1(key) {
14832   return function (object) {
14833     return object == null ? undefined : object[key];
14834   };
14835 }
14836
14837 var _baseProperty = baseProperty$1;
14838
14839 var baseGet$1 = _baseGet;
14840 /**
14841  * A specialized version of `baseProperty` which supports deep paths.
14842  *
14843  * @private
14844  * @param {Array|string} path The path of the property to get.
14845  * @returns {Function} Returns the new accessor function.
14846  */
14847
14848 function basePropertyDeep$1(path) {
14849   return function (object) {
14850     return baseGet$1(object, path);
14851   };
14852 }
14853
14854 var _basePropertyDeep = basePropertyDeep$1;
14855
14856 var baseProperty = _baseProperty,
14857     basePropertyDeep = _basePropertyDeep,
14858     isKey = _isKey,
14859     toKey$1 = _toKey;
14860 /**
14861  * Creates a function that returns the value at `path` of a given object.
14862  *
14863  * @static
14864  * @memberOf _
14865  * @since 2.4.0
14866  * @category Util
14867  * @param {Array|string} path The path of the property to get.
14868  * @returns {Function} Returns the new accessor function.
14869  * @example
14870  *
14871  * var objects = [
14872  *   { 'a': { 'b': 2 } },
14873  *   { 'a': { 'b': 1 } }
14874  * ];
14875  *
14876  * _.map(objects, _.property('a.b'));
14877  * // => [2, 1]
14878  *
14879  * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
14880  * // => [1, 2]
14881  */
14882
14883 function property$1(path) {
14884   return isKey(path) ? baseProperty(toKey$1(path)) : basePropertyDeep(path);
14885 }
14886
14887 var property_1 = property$1;
14888
14889 var baseMatches = _baseMatches,
14890     baseMatchesProperty = _baseMatchesProperty,
14891     identity$1 = identity_1,
14892     isArray$2 = isArray_1,
14893     property = property_1;
14894 /**
14895  * The base implementation of `_.iteratee`.
14896  *
14897  * @private
14898  * @param {*} [value=_.identity] The value to convert to an iteratee.
14899  * @returns {Function} Returns the iteratee.
14900  */
14901
14902 function baseIteratee$1(value) {
14903   // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
14904   // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
14905   if (typeof value == 'function') {
14906     return value;
14907   }
14908
14909   if (value == null) {
14910     return identity$1;
14911   }
14912
14913   if (typeof value == 'object') {
14914     return isArray$2(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
14915   }
14916
14917   return property(value);
14918 }
14919
14920 var _baseIteratee = baseIteratee$1;
14921
14922 var arrayAggregator = _arrayAggregator,
14923     baseAggregator = _baseAggregator,
14924     baseIteratee = _baseIteratee,
14925     isArray$1 = isArray_1;
14926 /**
14927  * Creates a function like `_.groupBy`.
14928  *
14929  * @private
14930  * @param {Function} setter The function to set accumulator values.
14931  * @param {Function} [initializer] The accumulator object initializer.
14932  * @returns {Function} Returns the new aggregator function.
14933  */
14934
14935 function createAggregator$2(setter, initializer) {
14936   return function (collection, iteratee) {
14937     var func = isArray$1(collection) ? arrayAggregator : baseAggregator,
14938         accumulator = initializer ? initializer() : {};
14939     return func(collection, setter, baseIteratee(iteratee), accumulator);
14940   };
14941 }
14942
14943 var _createAggregator = createAggregator$2;
14944
14945 var createAggregator$1 = _createAggregator;
14946 /**
14947  * Creates an array of elements split into two groups, the first of which
14948  * contains elements `predicate` returns truthy for, the second of which
14949  * contains elements `predicate` returns falsey for. The predicate is
14950  * invoked with one argument: (value).
14951  *
14952  * @static
14953  * @memberOf _
14954  * @since 3.0.0
14955  * @category Collection
14956  * @param {Array|Object} collection The collection to iterate over.
14957  * @param {Function} [predicate=_.identity] The function invoked per iteration.
14958  * @returns {Array} Returns the array of grouped elements.
14959  * @example
14960  *
14961  * var users = [
14962  *   { 'user': 'barney',  'age': 36, 'active': false },
14963  *   { 'user': 'fred',    'age': 40, 'active': true },
14964  *   { 'user': 'pebbles', 'age': 1,  'active': false }
14965  * ];
14966  *
14967  * _.partition(users, function(o) { return o.active; });
14968  * // => objects for [['fred'], ['barney', 'pebbles']]
14969  *
14970  * // The `_.matches` iteratee shorthand.
14971  * _.partition(users, { 'age': 1, 'active': false });
14972  * // => objects for [['pebbles'], ['barney', 'fred']]
14973  *
14974  * // The `_.matchesProperty` iteratee shorthand.
14975  * _.partition(users, ['active', false]);
14976  * // => objects for [['barney', 'pebbles'], ['fred']]
14977  *
14978  * // The `_.property` iteratee shorthand.
14979  * _.partition(users, 'active');
14980  * // => objects for [['fred'], ['barney', 'pebbles']]
14981  */
14982
14983 var partition$1 = createAggregator$1(function (result, value, key) {
14984   result[key ? 0 : 1].push(value);
14985 }, function () {
14986   return [[], []];
14987 });
14988 var partition_1 = partition$1;
14989
14990 const partition = partition_1;
14991
14992 var createMinimistOptions$2 = function createMinimistOptions(detailedOptions) {
14993   const [boolean, string] = partition(detailedOptions, ({
14994     type
14995   }) => type === "boolean").map(detailedOptions => detailedOptions.flatMap(({
14996     name,
14997     alias
14998   }) => alias ? [name, alias] : [name]));
14999   const defaults = Object.fromEntries(detailedOptions.filter(option => !option.deprecated && (!option.forwardToApi || option.name === "plugin" || option.name === "plugin-search-dir") && option.default !== undefined).map(option => [option.name, option.default]));
15000   return {
15001     // we use vnopts' AliasSchema to handle aliases for better error messages
15002     alias: {},
15003     boolean,
15004     string,
15005     default: defaults
15006   };
15007 };
15008
15009 const dashify$1 = dashify$2; // eslint-disable-next-line no-restricted-modules
15010
15011 const prettier$5 = require$$3;
15012 const minimist$1 = minimist_1;
15013 const {
15014   optionsNormalizer
15015 } = prettierInternal;
15016 const createMinimistOptions$1 = createMinimistOptions$2;
15017
15018 function getOptions(argv, detailedOptions) {
15019   return Object.fromEntries(detailedOptions.filter(({
15020     forwardToApi
15021   }) => forwardToApi).map(({
15022     forwardToApi,
15023     name
15024   }) => [forwardToApi, argv[name]]));
15025 }
15026
15027 function cliifyOptions(object, apiDetailedOptionMap) {
15028   return Object.fromEntries(Object.entries(object || {}).map(([key, value]) => {
15029     const apiOption = apiDetailedOptionMap[key];
15030     const cliKey = apiOption ? apiOption.name : key;
15031     return [dashify$1(cliKey), value];
15032   }));
15033 }
15034
15035 function createApiDetailedOptionMap(detailedOptions) {
15036   return Object.fromEntries(detailedOptions.filter(option => option.forwardToApi && option.forwardToApi !== option.name).map(option => [option.forwardToApi, option]));
15037 }
15038
15039 function parseArgsToOptions(context, overrideDefaults) {
15040   const minimistOptions = createMinimistOptions$1(context.detailedOptions);
15041   const apiDetailedOptionMap = createApiDetailedOptionMap(context.detailedOptions);
15042   return getOptions(optionsNormalizer.normalizeCliOptions(minimist$1(context.rawArguments, {
15043     string: minimistOptions.string,
15044     boolean: minimistOptions.boolean,
15045     default: cliifyOptions(overrideDefaults, apiDetailedOptionMap)
15046   }), context.detailedOptions, {
15047     logger: false
15048   }), context.detailedOptions);
15049 }
15050
15051 async function getOptionsOrDie(context, filePath) {
15052   try {
15053     if (context.argv.config === false) {
15054       context.logger.debug("'--no-config' option found, skip loading config file.");
15055       return null;
15056     }
15057
15058     context.logger.debug(context.argv.config ? `load config file from '${context.argv.config}'` : `resolve config from '${filePath}'`);
15059     const options = await prettier$5.resolveConfig(filePath, {
15060       editorconfig: context.argv.editorconfig,
15061       config: context.argv.config
15062     });
15063     context.logger.debug("loaded options `" + JSON.stringify(options) + "`");
15064     return options;
15065   } catch (error) {
15066     context.logger.error(`Invalid configuration file \`${filePath}\`: ` + error.message);
15067     process.exit(2);
15068   }
15069 }
15070
15071 function applyConfigPrecedence(context, options) {
15072   try {
15073     switch (context.argv["config-precedence"]) {
15074       case "cli-override":
15075         return parseArgsToOptions(context, options);
15076
15077       case "file-override":
15078         return Object.assign(Object.assign({}, parseArgsToOptions(context)), options);
15079
15080       case "prefer-file":
15081         return options || parseArgsToOptions(context);
15082     }
15083   } catch (error) {
15084     /* istanbul ignore next */
15085     context.logger.error(error.toString());
15086     /* istanbul ignore next */
15087
15088     process.exit(2);
15089   }
15090 }
15091
15092 async function getOptionsForFile$1(context, filepath) {
15093   const options = await getOptionsOrDie(context, filepath);
15094   const hasPlugins = options && options.plugins;
15095
15096   if (hasPlugins) {
15097     context.pushContextPlugins(options.plugins);
15098   }
15099
15100   const appliedOptions = Object.assign({
15101     filepath
15102   }, applyConfigPrecedence(context, options && optionsNormalizer.normalizeApiOptions(options, context.supportOptions, {
15103     logger: context.logger
15104   })));
15105   context.logger.debug(`applied config-precedence (${context.argv["config-precedence"]}): ` + `${JSON.stringify(appliedOptions)}`);
15106
15107   if (hasPlugins) {
15108     context.popContextPlugins();
15109   }
15110
15111   return appliedOptions;
15112 }
15113
15114 var option = {
15115   getOptionsForFile: getOptionsForFile$1,
15116   createMinimistOptions: createMinimistOptions$1
15117 };
15118
15119 const {
15120   isCI
15121 } = require$$4; // Some CI pipelines incorrectly report process.stdout.isTTY status,
15122 // which causes unwanted lines in the output. An additional check for isCI() helps.
15123 // See https://github.com/prettier/prettier/issues/5801
15124
15125 var isTty = function isTTY() {
15126   return process.stdout.isTTY && !isCI();
15127 };
15128
15129 var lib$1 = {};
15130
15131 var base = {};
15132
15133 /*istanbul ignore start*/
15134
15135 (function (exports) {
15136
15137   Object.defineProperty(exports, "__esModule", {
15138     value: true
15139   });
15140   exports["default"] = Diff;
15141   /*istanbul ignore end*/
15142
15143   function Diff() {}
15144
15145   Diff.prototype = {
15146     /*istanbul ignore start*/
15147
15148     /*istanbul ignore end*/
15149     diff: function diff(oldString, newString) {
15150       /*istanbul ignore start*/
15151       var
15152       /*istanbul ignore end*/
15153       options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
15154       var callback = options.callback;
15155
15156       if (typeof options === 'function') {
15157         callback = options;
15158         options = {};
15159       }
15160
15161       this.options = options;
15162       var self = this;
15163
15164       function done(value) {
15165         if (callback) {
15166           setTimeout(function () {
15167             callback(undefined, value);
15168           }, 0);
15169           return true;
15170         } else {
15171           return value;
15172         }
15173       } // Allow subclasses to massage the input prior to running
15174
15175
15176       oldString = this.castInput(oldString);
15177       newString = this.castInput(newString);
15178       oldString = this.removeEmpty(this.tokenize(oldString));
15179       newString = this.removeEmpty(this.tokenize(newString));
15180       var newLen = newString.length,
15181           oldLen = oldString.length;
15182       var editLength = 1;
15183       var maxEditLength = newLen + oldLen;
15184       var bestPath = [{
15185         newPos: -1,
15186         components: []
15187       }]; // Seed editLength = 0, i.e. the content starts with the same values
15188
15189       var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0);
15190
15191       if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) {
15192         // Identity per the equality and tokenizer
15193         return done([{
15194           value: this.join(newString),
15195           count: newString.length
15196         }]);
15197       } // Main worker method. checks all permutations of a given edit length for acceptance.
15198
15199
15200       function execEditLength() {
15201         for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {
15202           var basePath =
15203           /*istanbul ignore start*/
15204           void 0
15205           /*istanbul ignore end*/
15206           ;
15207
15208           var addPath = bestPath[diagonalPath - 1],
15209               removePath = bestPath[diagonalPath + 1],
15210               _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;
15211
15212           if (addPath) {
15213             // No one else is going to attempt to use this value, clear it
15214             bestPath[diagonalPath - 1] = undefined;
15215           }
15216
15217           var canAdd = addPath && addPath.newPos + 1 < newLen,
15218               canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;
15219
15220           if (!canAdd && !canRemove) {
15221             // If this path is a terminal then prune
15222             bestPath[diagonalPath] = undefined;
15223             continue;
15224           } // Select the diagonal that we want to branch from. We select the prior
15225           // path whose position in the new string is the farthest from the origin
15226           // and does not pass the bounds of the diff graph
15227
15228
15229           if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {
15230             basePath = clonePath(removePath);
15231             self.pushComponent(basePath.components, undefined, true);
15232           } else {
15233             basePath = addPath; // No need to clone, we've pulled it from the list
15234
15235             basePath.newPos++;
15236             self.pushComponent(basePath.components, true, undefined);
15237           }
15238
15239           _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); // If we have hit the end of both strings, then we are done
15240
15241           if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {
15242             return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken));
15243           } else {
15244             // Otherwise track this path as a potential candidate and continue.
15245             bestPath[diagonalPath] = basePath;
15246           }
15247         }
15248
15249         editLength++;
15250       } // Performs the length of edit iteration. Is a bit fugly as this has to support the
15251       // sync and async mode which is never fun. Loops over execEditLength until a value
15252       // is produced.
15253
15254
15255       if (callback) {
15256         (function exec() {
15257           setTimeout(function () {
15258             // This should not happen, but we want to be safe.
15259
15260             /* istanbul ignore next */
15261             if (editLength > maxEditLength) {
15262               return callback();
15263             }
15264
15265             if (!execEditLength()) {
15266               exec();
15267             }
15268           }, 0);
15269         })();
15270       } else {
15271         while (editLength <= maxEditLength) {
15272           var ret = execEditLength();
15273
15274           if (ret) {
15275             return ret;
15276           }
15277         }
15278       }
15279     },
15280
15281     /*istanbul ignore start*/
15282
15283     /*istanbul ignore end*/
15284     pushComponent: function pushComponent(components, added, removed) {
15285       var last = components[components.length - 1];
15286
15287       if (last && last.added === added && last.removed === removed) {
15288         // We need to clone here as the component clone operation is just
15289         // as shallow array clone
15290         components[components.length - 1] = {
15291           count: last.count + 1,
15292           added: added,
15293           removed: removed
15294         };
15295       } else {
15296         components.push({
15297           count: 1,
15298           added: added,
15299           removed: removed
15300         });
15301       }
15302     },
15303
15304     /*istanbul ignore start*/
15305
15306     /*istanbul ignore end*/
15307     extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) {
15308       var newLen = newString.length,
15309           oldLen = oldString.length,
15310           newPos = basePath.newPos,
15311           oldPos = newPos - diagonalPath,
15312           commonCount = 0;
15313
15314       while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) {
15315         newPos++;
15316         oldPos++;
15317         commonCount++;
15318       }
15319
15320       if (commonCount) {
15321         basePath.components.push({
15322           count: commonCount
15323         });
15324       }
15325
15326       basePath.newPos = newPos;
15327       return oldPos;
15328     },
15329
15330     /*istanbul ignore start*/
15331
15332     /*istanbul ignore end*/
15333     equals: function equals(left, right) {
15334       if (this.options.comparator) {
15335         return this.options.comparator(left, right);
15336       } else {
15337         return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase();
15338       }
15339     },
15340
15341     /*istanbul ignore start*/
15342
15343     /*istanbul ignore end*/
15344     removeEmpty: function removeEmpty(array) {
15345       var ret = [];
15346
15347       for (var i = 0; i < array.length; i++) {
15348         if (array[i]) {
15349           ret.push(array[i]);
15350         }
15351       }
15352
15353       return ret;
15354     },
15355
15356     /*istanbul ignore start*/
15357
15358     /*istanbul ignore end*/
15359     castInput: function castInput(value) {
15360       return value;
15361     },
15362
15363     /*istanbul ignore start*/
15364
15365     /*istanbul ignore end*/
15366     tokenize: function tokenize(value) {
15367       return value.split('');
15368     },
15369
15370     /*istanbul ignore start*/
15371
15372     /*istanbul ignore end*/
15373     join: function join(chars) {
15374       return chars.join('');
15375     }
15376   };
15377
15378   function buildValues(diff, components, newString, oldString, useLongestToken) {
15379     var componentPos = 0,
15380         componentLen = components.length,
15381         newPos = 0,
15382         oldPos = 0;
15383
15384     for (; componentPos < componentLen; componentPos++) {
15385       var component = components[componentPos];
15386
15387       if (!component.removed) {
15388         if (!component.added && useLongestToken) {
15389           var value = newString.slice(newPos, newPos + component.count);
15390           value = value.map(function (value, i) {
15391             var oldValue = oldString[oldPos + i];
15392             return oldValue.length > value.length ? oldValue : value;
15393           });
15394           component.value = diff.join(value);
15395         } else {
15396           component.value = diff.join(newString.slice(newPos, newPos + component.count));
15397         }
15398
15399         newPos += component.count; // Common case
15400
15401         if (!component.added) {
15402           oldPos += component.count;
15403         }
15404       } else {
15405         component.value = diff.join(oldString.slice(oldPos, oldPos + component.count));
15406         oldPos += component.count; // Reverse add and remove so removes are output first to match common convention
15407         // The diffing algorithm is tied to add then remove output and this is the simplest
15408         // route to get the desired output with minimal overhead.
15409
15410         if (componentPos && components[componentPos - 1].added) {
15411           var tmp = components[componentPos - 1];
15412           components[componentPos - 1] = components[componentPos];
15413           components[componentPos] = tmp;
15414         }
15415       }
15416     } // Special case handle for when one terminal is ignored (i.e. whitespace).
15417     // For this case we merge the terminal into the prior string and drop the change.
15418     // This is only available for string mode.
15419
15420
15421     var lastComponent = components[componentLen - 1];
15422
15423     if (componentLen > 1 && typeof lastComponent.value === 'string' && (lastComponent.added || lastComponent.removed) && diff.equals('', lastComponent.value)) {
15424       components[componentLen - 2].value += lastComponent.value;
15425       components.pop();
15426     }
15427
15428     return components;
15429   }
15430
15431   function clonePath(path) {
15432     return {
15433       newPos: path.newPos,
15434       components: path.components.slice(0)
15435     };
15436   }
15437 })(base);
15438
15439 var character = {};
15440
15441 /*istanbul ignore start*/
15442
15443 Object.defineProperty(character, "__esModule", {
15444   value: true
15445 });
15446 character.diffChars = diffChars;
15447 character.characterDiff = void 0;
15448 /*istanbul ignore end*/
15449
15450 var
15451 /*istanbul ignore start*/
15452 _base$6 = _interopRequireDefault$7(base)
15453 /*istanbul ignore end*/
15454 ;
15455 /*istanbul ignore start*/
15456
15457
15458 function _interopRequireDefault$7(obj) {
15459   return obj && obj.__esModule ? obj : {
15460     "default": obj
15461   };
15462 }
15463 /*istanbul ignore end*/
15464
15465
15466 var characterDiff = new
15467 /*istanbul ignore start*/
15468 _base$6
15469 /*istanbul ignore end*/
15470 [
15471 /*istanbul ignore start*/
15472 "default"
15473 /*istanbul ignore end*/
15474 ]();
15475 /*istanbul ignore start*/
15476
15477 character.characterDiff = characterDiff;
15478 /*istanbul ignore end*/
15479
15480 function diffChars(oldStr, newStr, options) {
15481   return characterDiff.diff(oldStr, newStr, options);
15482 }
15483
15484 var word = {};
15485
15486 var params = {};
15487
15488 /*istanbul ignore start*/
15489
15490 Object.defineProperty(params, "__esModule", {
15491   value: true
15492 });
15493 params.generateOptions = generateOptions;
15494 /*istanbul ignore end*/
15495
15496 function generateOptions(options, defaults) {
15497   if (typeof options === 'function') {
15498     defaults.callback = options;
15499   } else if (options) {
15500     for (var name in options) {
15501       /* istanbul ignore else */
15502       if (options.hasOwnProperty(name)) {
15503         defaults[name] = options[name];
15504       }
15505     }
15506   }
15507
15508   return defaults;
15509 }
15510
15511 /*istanbul ignore start*/
15512
15513 Object.defineProperty(word, "__esModule", {
15514   value: true
15515 });
15516 word.diffWords = diffWords;
15517 word.diffWordsWithSpace = diffWordsWithSpace;
15518 word.wordDiff = void 0;
15519 /*istanbul ignore end*/
15520
15521 var
15522 /*istanbul ignore start*/
15523 _base$5 = _interopRequireDefault$6(base)
15524 /*istanbul ignore end*/
15525 ;
15526
15527 var
15528 /*istanbul ignore start*/
15529 _params$1 = params
15530 /*istanbul ignore end*/
15531 ;
15532 /*istanbul ignore start*/
15533
15534 function _interopRequireDefault$6(obj) {
15535   return obj && obj.__esModule ? obj : {
15536     "default": obj
15537   };
15538 }
15539 /*istanbul ignore end*/
15540 // Based on https://en.wikipedia.org/wiki/Latin_script_in_Unicode
15541 //
15542 // Ranges and exceptions:
15543 // Latin-1 Supplement, 0080–00FF
15544 //  - U+00D7  × Multiplication sign
15545 //  - U+00F7  ÷ Division sign
15546 // Latin Extended-A, 0100–017F
15547 // Latin Extended-B, 0180–024F
15548 // IPA Extensions, 0250–02AF
15549 // Spacing Modifier Letters, 02B0–02FF
15550 //  - U+02C7  ˇ &#711;  Caron
15551 //  - U+02D8  ˘ &#728;  Breve
15552 //  - U+02D9  ˙ &#729;  Dot Above
15553 //  - U+02DA  ˚ &#730;  Ring Above
15554 //  - U+02DB  ˛ &#731;  Ogonek
15555 //  - U+02DC  ˜ &#732;  Small Tilde
15556 //  - U+02DD  ˝ &#733;  Double Acute Accent
15557 // Latin Extended Additional, 1E00–1EFF
15558
15559
15560 var extendedWordChars = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/;
15561 var reWhitespace = /\S/;
15562 var wordDiff = new
15563 /*istanbul ignore start*/
15564 _base$5
15565 /*istanbul ignore end*/
15566 [
15567 /*istanbul ignore start*/
15568 "default"
15569 /*istanbul ignore end*/
15570 ]();
15571 /*istanbul ignore start*/
15572
15573 word.wordDiff = wordDiff;
15574 /*istanbul ignore end*/
15575
15576 wordDiff.equals = function (left, right) {
15577   if (this.options.ignoreCase) {
15578     left = left.toLowerCase();
15579     right = right.toLowerCase();
15580   }
15581
15582   return left === right || this.options.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right);
15583 };
15584
15585 wordDiff.tokenize = function (value) {
15586   // All whitespace symbols except newline group into one token, each newline - in separate token
15587   var tokens = value.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/); // Join the boundary splits that we do not consider to be boundaries. This is primarily the extended Latin character set.
15588
15589   for (var i = 0; i < tokens.length - 1; i++) {
15590     // If we have an empty string in the next field and we have only word chars before and after, merge
15591     if (!tokens[i + 1] && tokens[i + 2] && extendedWordChars.test(tokens[i]) && extendedWordChars.test(tokens[i + 2])) {
15592       tokens[i] += tokens[i + 2];
15593       tokens.splice(i + 1, 2);
15594       i--;
15595     }
15596   }
15597
15598   return tokens;
15599 };
15600
15601 function diffWords(oldStr, newStr, options) {
15602   options =
15603   /*istanbul ignore start*/
15604   (/*istanbul ignore end*/
15605
15606   /*istanbul ignore start*/
15607   0, _params$1
15608   /*istanbul ignore end*/
15609   .
15610   /*istanbul ignore start*/
15611   generateOptions
15612   /*istanbul ignore end*/
15613   )(options, {
15614     ignoreWhitespace: true
15615   });
15616   return wordDiff.diff(oldStr, newStr, options);
15617 }
15618
15619 function diffWordsWithSpace(oldStr, newStr, options) {
15620   return wordDiff.diff(oldStr, newStr, options);
15621 }
15622
15623 var line = {};
15624
15625 /*istanbul ignore start*/
15626
15627 Object.defineProperty(line, "__esModule", {
15628   value: true
15629 });
15630 line.diffLines = diffLines;
15631 line.diffTrimmedLines = diffTrimmedLines;
15632 line.lineDiff = void 0;
15633 /*istanbul ignore end*/
15634
15635 var
15636 /*istanbul ignore start*/
15637 _base$4 = _interopRequireDefault$5(base)
15638 /*istanbul ignore end*/
15639 ;
15640
15641 var
15642 /*istanbul ignore start*/
15643 _params = params
15644 /*istanbul ignore end*/
15645 ;
15646 /*istanbul ignore start*/
15647
15648 function _interopRequireDefault$5(obj) {
15649   return obj && obj.__esModule ? obj : {
15650     "default": obj
15651   };
15652 }
15653 /*istanbul ignore end*/
15654
15655
15656 var lineDiff = new
15657 /*istanbul ignore start*/
15658 _base$4
15659 /*istanbul ignore end*/
15660 [
15661 /*istanbul ignore start*/
15662 "default"
15663 /*istanbul ignore end*/
15664 ]();
15665 /*istanbul ignore start*/
15666
15667 line.lineDiff = lineDiff;
15668 /*istanbul ignore end*/
15669
15670 lineDiff.tokenize = function (value) {
15671   var retLines = [],
15672       linesAndNewlines = value.split(/(\n|\r\n)/); // Ignore the final empty token that occurs if the string ends with a new line
15673
15674   if (!linesAndNewlines[linesAndNewlines.length - 1]) {
15675     linesAndNewlines.pop();
15676   } // Merge the content and line separators into single tokens
15677
15678
15679   for (var i = 0; i < linesAndNewlines.length; i++) {
15680     var line = linesAndNewlines[i];
15681
15682     if (i % 2 && !this.options.newlineIsToken) {
15683       retLines[retLines.length - 1] += line;
15684     } else {
15685       if (this.options.ignoreWhitespace) {
15686         line = line.trim();
15687       }
15688
15689       retLines.push(line);
15690     }
15691   }
15692
15693   return retLines;
15694 };
15695
15696 function diffLines(oldStr, newStr, callback) {
15697   return lineDiff.diff(oldStr, newStr, callback);
15698 }
15699
15700 function diffTrimmedLines(oldStr, newStr, callback) {
15701   var options =
15702   /*istanbul ignore start*/
15703   (/*istanbul ignore end*/
15704
15705   /*istanbul ignore start*/
15706   0, _params
15707   /*istanbul ignore end*/
15708   .
15709   /*istanbul ignore start*/
15710   generateOptions
15711   /*istanbul ignore end*/
15712   )(callback, {
15713     ignoreWhitespace: true
15714   });
15715   return lineDiff.diff(oldStr, newStr, options);
15716 }
15717
15718 var sentence = {};
15719
15720 /*istanbul ignore start*/
15721
15722 Object.defineProperty(sentence, "__esModule", {
15723   value: true
15724 });
15725 sentence.diffSentences = diffSentences;
15726 sentence.sentenceDiff = void 0;
15727 /*istanbul ignore end*/
15728
15729 var
15730 /*istanbul ignore start*/
15731 _base$3 = _interopRequireDefault$4(base)
15732 /*istanbul ignore end*/
15733 ;
15734 /*istanbul ignore start*/
15735
15736
15737 function _interopRequireDefault$4(obj) {
15738   return obj && obj.__esModule ? obj : {
15739     "default": obj
15740   };
15741 }
15742 /*istanbul ignore end*/
15743
15744
15745 var sentenceDiff = new
15746 /*istanbul ignore start*/
15747 _base$3
15748 /*istanbul ignore end*/
15749 [
15750 /*istanbul ignore start*/
15751 "default"
15752 /*istanbul ignore end*/
15753 ]();
15754 /*istanbul ignore start*/
15755
15756 sentence.sentenceDiff = sentenceDiff;
15757 /*istanbul ignore end*/
15758
15759 sentenceDiff.tokenize = function (value) {
15760   return value.split(/(\S.+?[.!?])(?=\s+|$)/);
15761 };
15762
15763 function diffSentences(oldStr, newStr, callback) {
15764   return sentenceDiff.diff(oldStr, newStr, callback);
15765 }
15766
15767 var css = {};
15768
15769 /*istanbul ignore start*/
15770
15771 Object.defineProperty(css, "__esModule", {
15772   value: true
15773 });
15774 css.diffCss = diffCss;
15775 css.cssDiff = void 0;
15776 /*istanbul ignore end*/
15777
15778 var
15779 /*istanbul ignore start*/
15780 _base$2 = _interopRequireDefault$3(base)
15781 /*istanbul ignore end*/
15782 ;
15783 /*istanbul ignore start*/
15784
15785
15786 function _interopRequireDefault$3(obj) {
15787   return obj && obj.__esModule ? obj : {
15788     "default": obj
15789   };
15790 }
15791 /*istanbul ignore end*/
15792
15793
15794 var cssDiff = new
15795 /*istanbul ignore start*/
15796 _base$2
15797 /*istanbul ignore end*/
15798 [
15799 /*istanbul ignore start*/
15800 "default"
15801 /*istanbul ignore end*/
15802 ]();
15803 /*istanbul ignore start*/
15804
15805 css.cssDiff = cssDiff;
15806 /*istanbul ignore end*/
15807
15808 cssDiff.tokenize = function (value) {
15809   return value.split(/([{}:;,]|\s+)/);
15810 };
15811
15812 function diffCss(oldStr, newStr, callback) {
15813   return cssDiff.diff(oldStr, newStr, callback);
15814 }
15815
15816 var json = {};
15817
15818 Object.defineProperty(json, "__esModule", {
15819   value: true
15820 });
15821 json.diffJson = diffJson;
15822 json.canonicalize = canonicalize;
15823 json.jsonDiff = void 0;
15824 /*istanbul ignore end*/
15825
15826 var
15827 /*istanbul ignore start*/
15828 _base$1 = _interopRequireDefault$2(base)
15829 /*istanbul ignore end*/
15830 ;
15831
15832 var
15833 /*istanbul ignore start*/
15834 _line$1 = line
15835 /*istanbul ignore end*/
15836 ;
15837 /*istanbul ignore start*/
15838
15839 function _interopRequireDefault$2(obj) {
15840   return obj && obj.__esModule ? obj : {
15841     "default": obj
15842   };
15843 }
15844
15845 function _typeof(obj) {
15846   "@babel/helpers - typeof";
15847
15848   if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
15849     _typeof = function _typeof(obj) {
15850       return typeof obj;
15851     };
15852   } else {
15853     _typeof = function _typeof(obj) {
15854       return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
15855     };
15856   }
15857
15858   return _typeof(obj);
15859 }
15860 /*istanbul ignore end*/
15861
15862
15863 var objectPrototypeToString = Object.prototype.toString;
15864 var jsonDiff = new
15865 /*istanbul ignore start*/
15866 _base$1
15867 /*istanbul ignore end*/
15868 [
15869 /*istanbul ignore start*/
15870 "default"
15871 /*istanbul ignore end*/
15872 ](); // Discriminate between two lines of pretty-printed, serialized JSON where one of them has a
15873 // dangling comma and the other doesn't. Turns out including the dangling comma yields the nicest output:
15874
15875 /*istanbul ignore start*/
15876
15877 json.jsonDiff = jsonDiff;
15878 /*istanbul ignore end*/
15879
15880 jsonDiff.useLongestToken = true;
15881 jsonDiff.tokenize =
15882 /*istanbul ignore start*/
15883 _line$1
15884 /*istanbul ignore end*/
15885 .
15886 /*istanbul ignore start*/
15887 lineDiff
15888 /*istanbul ignore end*/
15889 .tokenize;
15890
15891 jsonDiff.castInput = function (value) {
15892   /*istanbul ignore start*/
15893   var _this$options =
15894   /*istanbul ignore end*/
15895   this.options,
15896       undefinedReplacement = _this$options.undefinedReplacement,
15897       _this$options$stringi = _this$options.stringifyReplacer,
15898       stringifyReplacer = _this$options$stringi === void 0 ? function (k, v)
15899   /*istanbul ignore start*/
15900   {
15901     return (
15902       /*istanbul ignore end*/
15903       typeof v === 'undefined' ? undefinedReplacement : v
15904     );
15905   } : _this$options$stringi;
15906   return typeof value === 'string' ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), stringifyReplacer, '  ');
15907 };
15908
15909 jsonDiff.equals = function (left, right) {
15910   return (
15911     /*istanbul ignore start*/
15912     _base$1
15913     /*istanbul ignore end*/
15914     [
15915     /*istanbul ignore start*/
15916     "default"
15917     /*istanbul ignore end*/
15918     ].prototype.equals.call(jsonDiff, left.replace(/,([\r\n])/g, '$1'), right.replace(/,([\r\n])/g, '$1'))
15919   );
15920 };
15921
15922 function diffJson(oldObj, newObj, options) {
15923   return jsonDiff.diff(oldObj, newObj, options);
15924 } // This function handles the presence of circular references by bailing out when encountering an
15925 // object that is already on the "stack" of items being processed. Accepts an optional replacer
15926
15927
15928 function canonicalize(obj, stack, replacementStack, replacer, key) {
15929   stack = stack || [];
15930   replacementStack = replacementStack || [];
15931
15932   if (replacer) {
15933     obj = replacer(key, obj);
15934   }
15935
15936   var i;
15937
15938   for (i = 0; i < stack.length; i += 1) {
15939     if (stack[i] === obj) {
15940       return replacementStack[i];
15941     }
15942   }
15943
15944   var canonicalizedObj;
15945
15946   if ('[object Array]' === objectPrototypeToString.call(obj)) {
15947     stack.push(obj);
15948     canonicalizedObj = new Array(obj.length);
15949     replacementStack.push(canonicalizedObj);
15950
15951     for (i = 0; i < obj.length; i += 1) {
15952       canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack, replacer, key);
15953     }
15954
15955     stack.pop();
15956     replacementStack.pop();
15957     return canonicalizedObj;
15958   }
15959
15960   if (obj && obj.toJSON) {
15961     obj = obj.toJSON();
15962   }
15963
15964   if (
15965   /*istanbul ignore start*/
15966   _typeof(
15967   /*istanbul ignore end*/
15968   obj) === 'object' && obj !== null) {
15969     stack.push(obj);
15970     canonicalizedObj = {};
15971     replacementStack.push(canonicalizedObj);
15972
15973     var sortedKeys = [],
15974         _key;
15975
15976     for (_key in obj) {
15977       /* istanbul ignore else */
15978       if (obj.hasOwnProperty(_key)) {
15979         sortedKeys.push(_key);
15980       }
15981     }
15982
15983     sortedKeys.sort();
15984
15985     for (i = 0; i < sortedKeys.length; i += 1) {
15986       _key = sortedKeys[i];
15987       canonicalizedObj[_key] = canonicalize(obj[_key], stack, replacementStack, replacer, _key);
15988     }
15989
15990     stack.pop();
15991     replacementStack.pop();
15992   } else {
15993     canonicalizedObj = obj;
15994   }
15995
15996   return canonicalizedObj;
15997 }
15998
15999 var array$1 = {};
16000
16001 /*istanbul ignore start*/
16002
16003 Object.defineProperty(array$1, "__esModule", {
16004   value: true
16005 });
16006 array$1.diffArrays = diffArrays;
16007 array$1.arrayDiff = void 0;
16008 /*istanbul ignore end*/
16009
16010 var
16011 /*istanbul ignore start*/
16012 _base = _interopRequireDefault$1(base)
16013 /*istanbul ignore end*/
16014 ;
16015 /*istanbul ignore start*/
16016
16017
16018 function _interopRequireDefault$1(obj) {
16019   return obj && obj.__esModule ? obj : {
16020     "default": obj
16021   };
16022 }
16023 /*istanbul ignore end*/
16024
16025
16026 var arrayDiff = new
16027 /*istanbul ignore start*/
16028 _base
16029 /*istanbul ignore end*/
16030 [
16031 /*istanbul ignore start*/
16032 "default"
16033 /*istanbul ignore end*/
16034 ]();
16035 /*istanbul ignore start*/
16036
16037 array$1.arrayDiff = arrayDiff;
16038 /*istanbul ignore end*/
16039
16040 arrayDiff.tokenize = function (value) {
16041   return value.slice();
16042 };
16043
16044 arrayDiff.join = arrayDiff.removeEmpty = function (value) {
16045   return value;
16046 };
16047
16048 function diffArrays(oldArr, newArr, callback) {
16049   return arrayDiff.diff(oldArr, newArr, callback);
16050 }
16051
16052 var apply$2 = {};
16053
16054 var parse = {};
16055
16056 /*istanbul ignore start*/
16057
16058 Object.defineProperty(parse, "__esModule", {
16059   value: true
16060 });
16061 parse.parsePatch = parsePatch;
16062 /*istanbul ignore end*/
16063
16064 function parsePatch(uniDiff) {
16065   /*istanbul ignore start*/
16066   var
16067   /*istanbul ignore end*/
16068   options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
16069   var diffstr = uniDiff.split(/\r\n|[\n\v\f\r\x85]/),
16070       delimiters = uniDiff.match(/\r\n|[\n\v\f\r\x85]/g) || [],
16071       list = [],
16072       i = 0;
16073
16074   function parseIndex() {
16075     var index = {};
16076     list.push(index); // Parse diff metadata
16077
16078     while (i < diffstr.length) {
16079       var line = diffstr[i]; // File header found, end parsing diff metadata
16080
16081       if (/^(\-\-\-|\+\+\+|@@)\s/.test(line)) {
16082         break;
16083       } // Diff index
16084
16085
16086       var header = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(line);
16087
16088       if (header) {
16089         index.index = header[1];
16090       }
16091
16092       i++;
16093     } // Parse file headers if they are defined. Unified diff requires them, but
16094     // there's no technical issues to have an isolated hunk without file header
16095
16096
16097     parseFileHeader(index);
16098     parseFileHeader(index); // Parse hunks
16099
16100     index.hunks = [];
16101
16102     while (i < diffstr.length) {
16103       var _line = diffstr[i];
16104
16105       if (/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(_line)) {
16106         break;
16107       } else if (/^@@/.test(_line)) {
16108         index.hunks.push(parseHunk());
16109       } else if (_line && options.strict) {
16110         // Ignore unexpected content unless in strict mode
16111         throw new Error('Unknown line ' + (i + 1) + ' ' + JSON.stringify(_line));
16112       } else {
16113         i++;
16114       }
16115     }
16116   } // Parses the --- and +++ headers, if none are found, no lines
16117   // are consumed.
16118
16119
16120   function parseFileHeader(index) {
16121     var fileHeader = /^(---|\+\+\+)\s+(.*)$/.exec(diffstr[i]);
16122
16123     if (fileHeader) {
16124       var keyPrefix = fileHeader[1] === '---' ? 'old' : 'new';
16125       var data = fileHeader[2].split('\t', 2);
16126       var fileName = data[0].replace(/\\\\/g, '\\');
16127
16128       if (/^".*"$/.test(fileName)) {
16129         fileName = fileName.substr(1, fileName.length - 2);
16130       }
16131
16132       index[keyPrefix + 'FileName'] = fileName;
16133       index[keyPrefix + 'Header'] = (data[1] || '').trim();
16134       i++;
16135     }
16136   } // Parses a hunk
16137   // This assumes that we are at the start of a hunk.
16138
16139
16140   function parseHunk() {
16141     var chunkHeaderIndex = i,
16142         chunkHeaderLine = diffstr[i++],
16143         chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/);
16144     var hunk = {
16145       oldStart: +chunkHeader[1],
16146       oldLines: typeof chunkHeader[2] === 'undefined' ? 1 : +chunkHeader[2],
16147       newStart: +chunkHeader[3],
16148       newLines: typeof chunkHeader[4] === 'undefined' ? 1 : +chunkHeader[4],
16149       lines: [],
16150       linedelimiters: []
16151     }; // Unified Diff Format quirk: If the chunk size is 0,
16152     // the first number is one lower than one would expect.
16153     // https://www.artima.com/weblogs/viewpost.jsp?thread=164293
16154
16155     if (hunk.oldLines === 0) {
16156       hunk.oldStart += 1;
16157     }
16158
16159     if (hunk.newLines === 0) {
16160       hunk.newStart += 1;
16161     }
16162
16163     var addCount = 0,
16164         removeCount = 0;
16165
16166     for (; i < diffstr.length; i++) {
16167       // Lines starting with '---' could be mistaken for the "remove line" operation
16168       // But they could be the header for the next file. Therefore prune such cases out.
16169       if (diffstr[i].indexOf('--- ') === 0 && i + 2 < diffstr.length && diffstr[i + 1].indexOf('+++ ') === 0 && diffstr[i + 2].indexOf('@@') === 0) {
16170         break;
16171       }
16172
16173       var operation = diffstr[i].length == 0 && i != diffstr.length - 1 ? ' ' : diffstr[i][0];
16174
16175       if (operation === '+' || operation === '-' || operation === ' ' || operation === '\\') {
16176         hunk.lines.push(diffstr[i]);
16177         hunk.linedelimiters.push(delimiters[i] || '\n');
16178
16179         if (operation === '+') {
16180           addCount++;
16181         } else if (operation === '-') {
16182           removeCount++;
16183         } else if (operation === ' ') {
16184           addCount++;
16185           removeCount++;
16186         }
16187       } else {
16188         break;
16189       }
16190     } // Handle the empty block count case
16191
16192
16193     if (!addCount && hunk.newLines === 1) {
16194       hunk.newLines = 0;
16195     }
16196
16197     if (!removeCount && hunk.oldLines === 1) {
16198       hunk.oldLines = 0;
16199     } // Perform optional sanity checking
16200
16201
16202     if (options.strict) {
16203       if (addCount !== hunk.newLines) {
16204         throw new Error('Added line count did not match for hunk at line ' + (chunkHeaderIndex + 1));
16205       }
16206
16207       if (removeCount !== hunk.oldLines) {
16208         throw new Error('Removed line count did not match for hunk at line ' + (chunkHeaderIndex + 1));
16209       }
16210     }
16211
16212     return hunk;
16213   }
16214
16215   while (i < diffstr.length) {
16216     parseIndex();
16217   }
16218
16219   return list;
16220 }
16221
16222 var distanceIterator = {};
16223
16224 /*istanbul ignore start*/
16225
16226 (function (exports) {
16227
16228   Object.defineProperty(exports, "__esModule", {
16229     value: true
16230   });
16231   exports["default"] = _default;
16232   /*istanbul ignore end*/
16233   // Iterator that traverses in the range of [min, max], stepping
16234   // by distance from a given start position. I.e. for [0, 4], with
16235   // start of 2, this will iterate 2, 3, 1, 4, 0.
16236
16237   function
16238   /*istanbul ignore start*/
16239   _default
16240   /*istanbul ignore end*/
16241   (start, minLine, maxLine) {
16242     var wantForward = true,
16243         backwardExhausted = false,
16244         forwardExhausted = false,
16245         localOffset = 1;
16246     return function iterator() {
16247       if (wantForward && !forwardExhausted) {
16248         if (backwardExhausted) {
16249           localOffset++;
16250         } else {
16251           wantForward = false;
16252         } // Check if trying to fit beyond text length, and if not, check it fits
16253         // after offset location (or desired location on first iteration)
16254
16255
16256         if (start + localOffset <= maxLine) {
16257           return localOffset;
16258         }
16259
16260         forwardExhausted = true;
16261       }
16262
16263       if (!backwardExhausted) {
16264         if (!forwardExhausted) {
16265           wantForward = true;
16266         } // Check if trying to fit before text beginning, and if not, check it fits
16267         // before offset location
16268
16269
16270         if (minLine <= start - localOffset) {
16271           return -localOffset++;
16272         }
16273
16274         backwardExhausted = true;
16275         return iterator();
16276       } // We tried to fit hunk before text beginning and beyond text length, then
16277       // hunk can't fit on the text. Return undefined
16278
16279     };
16280   }
16281 })(distanceIterator);
16282
16283 /*istanbul ignore start*/
16284
16285 Object.defineProperty(apply$2, "__esModule", {
16286   value: true
16287 });
16288 apply$2.applyPatch = applyPatch;
16289 apply$2.applyPatches = applyPatches;
16290 /*istanbul ignore end*/
16291
16292 var
16293 /*istanbul ignore start*/
16294 _parse$1 = parse
16295 /*istanbul ignore end*/
16296 ;
16297
16298 var
16299 /*istanbul ignore start*/
16300 _distanceIterator = _interopRequireDefault(distanceIterator)
16301 /*istanbul ignore end*/
16302 ;
16303 /*istanbul ignore start*/
16304
16305
16306 function _interopRequireDefault(obj) {
16307   return obj && obj.__esModule ? obj : {
16308     "default": obj
16309   };
16310 }
16311 /*istanbul ignore end*/
16312
16313
16314 function applyPatch(source, uniDiff) {
16315   /*istanbul ignore start*/
16316   var
16317   /*istanbul ignore end*/
16318   options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
16319
16320   if (typeof uniDiff === 'string') {
16321     uniDiff =
16322     /*istanbul ignore start*/
16323     (/*istanbul ignore end*/
16324
16325     /*istanbul ignore start*/
16326     0, _parse$1
16327     /*istanbul ignore end*/
16328     .
16329     /*istanbul ignore start*/
16330     parsePatch
16331     /*istanbul ignore end*/
16332     )(uniDiff);
16333   }
16334
16335   if (Array.isArray(uniDiff)) {
16336     if (uniDiff.length > 1) {
16337       throw new Error('applyPatch only works with a single input.');
16338     }
16339
16340     uniDiff = uniDiff[0];
16341   } // Apply the diff to the input
16342
16343
16344   var lines = source.split(/\r\n|[\n\v\f\r\x85]/),
16345       delimiters = source.match(/\r\n|[\n\v\f\r\x85]/g) || [],
16346       hunks = uniDiff.hunks,
16347       compareLine = options.compareLine || function (lineNumber, line, operation, patchContent)
16348   /*istanbul ignore start*/
16349   {
16350     return (
16351       /*istanbul ignore end*/
16352       line === patchContent
16353     );
16354   },
16355       errorCount = 0,
16356       fuzzFactor = options.fuzzFactor || 0,
16357       minLine = 0,
16358       offset = 0,
16359       removeEOFNL,
16360       addEOFNL;
16361   /**
16362    * Checks if the hunk exactly fits on the provided location
16363    */
16364
16365
16366   function hunkFits(hunk, toPos) {
16367     for (var j = 0; j < hunk.lines.length; j++) {
16368       var line = hunk.lines[j],
16369           operation = line.length > 0 ? line[0] : ' ',
16370           content = line.length > 0 ? line.substr(1) : line;
16371
16372       if (operation === ' ' || operation === '-') {
16373         // Context sanity check
16374         if (!compareLine(toPos + 1, lines[toPos], operation, content)) {
16375           errorCount++;
16376
16377           if (errorCount > fuzzFactor) {
16378             return false;
16379           }
16380         }
16381
16382         toPos++;
16383       }
16384     }
16385
16386     return true;
16387   } // Search best fit offsets for each hunk based on the previous ones
16388
16389
16390   for (var i = 0; i < hunks.length; i++) {
16391     var hunk = hunks[i],
16392         maxLine = lines.length - hunk.oldLines,
16393         localOffset = 0,
16394         toPos = offset + hunk.oldStart - 1;
16395     var iterator =
16396     /*istanbul ignore start*/
16397     (/*istanbul ignore end*/
16398
16399     /*istanbul ignore start*/
16400     0, _distanceIterator
16401     /*istanbul ignore end*/
16402     [
16403     /*istanbul ignore start*/
16404     "default"
16405     /*istanbul ignore end*/
16406     ])(toPos, minLine, maxLine);
16407
16408     for (; localOffset !== undefined; localOffset = iterator()) {
16409       if (hunkFits(hunk, toPos + localOffset)) {
16410         hunk.offset = offset += localOffset;
16411         break;
16412       }
16413     }
16414
16415     if (localOffset === undefined) {
16416       return false;
16417     } // Set lower text limit to end of the current hunk, so next ones don't try
16418     // to fit over already patched text
16419
16420
16421     minLine = hunk.offset + hunk.oldStart + hunk.oldLines;
16422   } // Apply patch hunks
16423
16424
16425   var diffOffset = 0;
16426
16427   for (var _i = 0; _i < hunks.length; _i++) {
16428     var _hunk = hunks[_i],
16429         _toPos = _hunk.oldStart + _hunk.offset + diffOffset - 1;
16430
16431     diffOffset += _hunk.newLines - _hunk.oldLines;
16432
16433     for (var j = 0; j < _hunk.lines.length; j++) {
16434       var line = _hunk.lines[j],
16435           operation = line.length > 0 ? line[0] : ' ',
16436           content = line.length > 0 ? line.substr(1) : line,
16437           delimiter = _hunk.linedelimiters[j];
16438
16439       if (operation === ' ') {
16440         _toPos++;
16441       } else if (operation === '-') {
16442         lines.splice(_toPos, 1);
16443         delimiters.splice(_toPos, 1);
16444         /* istanbul ignore else */
16445       } else if (operation === '+') {
16446         lines.splice(_toPos, 0, content);
16447         delimiters.splice(_toPos, 0, delimiter);
16448         _toPos++;
16449       } else if (operation === '\\') {
16450         var previousOperation = _hunk.lines[j - 1] ? _hunk.lines[j - 1][0] : null;
16451
16452         if (previousOperation === '+') {
16453           removeEOFNL = true;
16454         } else if (previousOperation === '-') {
16455           addEOFNL = true;
16456         }
16457       }
16458     }
16459   } // Handle EOFNL insertion/removal
16460
16461
16462   if (removeEOFNL) {
16463     while (!lines[lines.length - 1]) {
16464       lines.pop();
16465       delimiters.pop();
16466     }
16467   } else if (addEOFNL) {
16468     lines.push('');
16469     delimiters.push('\n');
16470   }
16471
16472   for (var _k = 0; _k < lines.length - 1; _k++) {
16473     lines[_k] = lines[_k] + delimiters[_k];
16474   }
16475
16476   return lines.join('');
16477 } // Wrapper that supports multiple file patches via callbacks.
16478
16479
16480 function applyPatches(uniDiff, options) {
16481   if (typeof uniDiff === 'string') {
16482     uniDiff =
16483     /*istanbul ignore start*/
16484     (/*istanbul ignore end*/
16485
16486     /*istanbul ignore start*/
16487     0, _parse$1
16488     /*istanbul ignore end*/
16489     .
16490     /*istanbul ignore start*/
16491     parsePatch
16492     /*istanbul ignore end*/
16493     )(uniDiff);
16494   }
16495
16496   var currentIndex = 0;
16497
16498   function processIndex() {
16499     var index = uniDiff[currentIndex++];
16500
16501     if (!index) {
16502       return options.complete();
16503     }
16504
16505     options.loadFile(index, function (err, data) {
16506       if (err) {
16507         return options.complete(err);
16508       }
16509
16510       var updatedContent = applyPatch(data, index, options);
16511       options.patched(index, updatedContent, function (err) {
16512         if (err) {
16513           return options.complete(err);
16514         }
16515
16516         processIndex();
16517       });
16518     });
16519   }
16520
16521   processIndex();
16522 }
16523
16524 var merge$1 = {};
16525
16526 var create$1 = {};
16527
16528 /*istanbul ignore start*/
16529
16530 Object.defineProperty(create$1, "__esModule", {
16531   value: true
16532 });
16533 create$1.structuredPatch = structuredPatch;
16534 create$1.formatPatch = formatPatch;
16535 create$1.createTwoFilesPatch = createTwoFilesPatch;
16536 create$1.createPatch = createPatch;
16537 /*istanbul ignore end*/
16538
16539 var
16540 /*istanbul ignore start*/
16541 _line = line
16542 /*istanbul ignore end*/
16543 ;
16544 /*istanbul ignore start*/
16545
16546 function _toConsumableArray$1(arr) {
16547   return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableSpread$1();
16548 }
16549
16550 function _nonIterableSpread$1() {
16551   throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
16552 }
16553
16554 function _unsupportedIterableToArray$1(o, minLen) {
16555   if (!o) return;
16556   if (typeof o === "string") return _arrayLikeToArray$1(o, minLen);
16557   var n = Object.prototype.toString.call(o).slice(8, -1);
16558   if (n === "Object" && o.constructor) n = o.constructor.name;
16559   if (n === "Map" || n === "Set") return Array.from(o);
16560   if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);
16561 }
16562
16563 function _iterableToArray$1(iter) {
16564   if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
16565 }
16566
16567 function _arrayWithoutHoles$1(arr) {
16568   if (Array.isArray(arr)) return _arrayLikeToArray$1(arr);
16569 }
16570
16571 function _arrayLikeToArray$1(arr, len) {
16572   if (len == null || len > arr.length) len = arr.length;
16573
16574   for (var i = 0, arr2 = new Array(len); i < len; i++) {
16575     arr2[i] = arr[i];
16576   }
16577
16578   return arr2;
16579 }
16580 /*istanbul ignore end*/
16581
16582
16583 function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
16584   if (!options) {
16585     options = {};
16586   }
16587
16588   if (typeof options.context === 'undefined') {
16589     options.context = 4;
16590   }
16591
16592   var diff =
16593   /*istanbul ignore start*/
16594   (/*istanbul ignore end*/
16595
16596   /*istanbul ignore start*/
16597   0, _line
16598   /*istanbul ignore end*/
16599   .
16600   /*istanbul ignore start*/
16601   diffLines
16602   /*istanbul ignore end*/
16603   )(oldStr, newStr, options);
16604   diff.push({
16605     value: '',
16606     lines: []
16607   }); // Append an empty value to make cleanup easier
16608
16609   function contextLines(lines) {
16610     return lines.map(function (entry) {
16611       return ' ' + entry;
16612     });
16613   }
16614
16615   var hunks = [];
16616   var oldRangeStart = 0,
16617       newRangeStart = 0,
16618       curRange = [],
16619       oldLine = 1,
16620       newLine = 1;
16621   /*istanbul ignore start*/
16622
16623   var _loop = function _loop(
16624   /*istanbul ignore end*/
16625   i) {
16626     var current = diff[i],
16627         lines = current.lines || current.value.replace(/\n$/, '').split('\n');
16628     current.lines = lines;
16629
16630     if (current.added || current.removed) {
16631       /*istanbul ignore start*/
16632       var _curRange;
16633       /*istanbul ignore end*/
16634       // If we have previous context, start with that
16635
16636
16637       if (!oldRangeStart) {
16638         var prev = diff[i - 1];
16639         oldRangeStart = oldLine;
16640         newRangeStart = newLine;
16641
16642         if (prev) {
16643           curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : [];
16644           oldRangeStart -= curRange.length;
16645           newRangeStart -= curRange.length;
16646         }
16647       } // Output our changes
16648
16649       /*istanbul ignore start*/
16650
16651       /*istanbul ignore end*/
16652
16653       /*istanbul ignore start*/
16654
16655
16656       (_curRange =
16657       /*istanbul ignore end*/
16658       curRange).push.apply(
16659       /*istanbul ignore start*/
16660       _curRange
16661       /*istanbul ignore end*/
16662       ,
16663       /*istanbul ignore start*/
16664       _toConsumableArray$1(
16665       /*istanbul ignore end*/
16666       lines.map(function (entry) {
16667         return (current.added ? '+' : '-') + entry;
16668       }))); // Track the updated file position
16669
16670
16671       if (current.added) {
16672         newLine += lines.length;
16673       } else {
16674         oldLine += lines.length;
16675       }
16676     } else {
16677       // Identical context lines. Track line changes
16678       if (oldRangeStart) {
16679         // Close out any changes that have been output (or join overlapping)
16680         if (lines.length <= options.context * 2 && i < diff.length - 2) {
16681           /*istanbul ignore start*/
16682           var _curRange2;
16683           /*istanbul ignore end*/
16684           // Overlapping
16685
16686           /*istanbul ignore start*/
16687
16688           /*istanbul ignore end*/
16689
16690           /*istanbul ignore start*/
16691
16692
16693           (_curRange2 =
16694           /*istanbul ignore end*/
16695           curRange).push.apply(
16696           /*istanbul ignore start*/
16697           _curRange2
16698           /*istanbul ignore end*/
16699           ,
16700           /*istanbul ignore start*/
16701           _toConsumableArray$1(
16702           /*istanbul ignore end*/
16703           contextLines(lines)));
16704         } else {
16705           /*istanbul ignore start*/
16706           var _curRange3;
16707           /*istanbul ignore end*/
16708           // end the range and output
16709
16710
16711           var contextSize = Math.min(lines.length, options.context);
16712           /*istanbul ignore start*/
16713
16714           /*istanbul ignore end*/
16715
16716           /*istanbul ignore start*/
16717
16718           (_curRange3 =
16719           /*istanbul ignore end*/
16720           curRange).push.apply(
16721           /*istanbul ignore start*/
16722           _curRange3
16723           /*istanbul ignore end*/
16724           ,
16725           /*istanbul ignore start*/
16726           _toConsumableArray$1(
16727           /*istanbul ignore end*/
16728           contextLines(lines.slice(0, contextSize))));
16729
16730           var hunk = {
16731             oldStart: oldRangeStart,
16732             oldLines: oldLine - oldRangeStart + contextSize,
16733             newStart: newRangeStart,
16734             newLines: newLine - newRangeStart + contextSize,
16735             lines: curRange
16736           };
16737
16738           if (i >= diff.length - 2 && lines.length <= options.context) {
16739             // EOF is inside this hunk
16740             var oldEOFNewline = /\n$/.test(oldStr);
16741             var newEOFNewline = /\n$/.test(newStr);
16742             var noNlBeforeAdds = lines.length == 0 && curRange.length > hunk.oldLines;
16743
16744             if (!oldEOFNewline && noNlBeforeAdds && oldStr.length > 0) {
16745               // special case: old has no eol and no trailing context; no-nl can end up before adds
16746               // however, if the old file is empty, do not output the no-nl line
16747               curRange.splice(hunk.oldLines, 0, '\\ No newline at end of file');
16748             }
16749
16750             if (!oldEOFNewline && !noNlBeforeAdds || !newEOFNewline) {
16751               curRange.push('\\ No newline at end of file');
16752             }
16753           }
16754
16755           hunks.push(hunk);
16756           oldRangeStart = 0;
16757           newRangeStart = 0;
16758           curRange = [];
16759         }
16760       }
16761
16762       oldLine += lines.length;
16763       newLine += lines.length;
16764     }
16765   };
16766
16767   for (var i = 0; i < diff.length; i++) {
16768     /*istanbul ignore start*/
16769     _loop(
16770     /*istanbul ignore end*/
16771     i);
16772   }
16773
16774   return {
16775     oldFileName: oldFileName,
16776     newFileName: newFileName,
16777     oldHeader: oldHeader,
16778     newHeader: newHeader,
16779     hunks: hunks
16780   };
16781 }
16782
16783 function formatPatch(diff) {
16784   var ret = [];
16785
16786   if (diff.oldFileName == diff.newFileName) {
16787     ret.push('Index: ' + diff.oldFileName);
16788   }
16789
16790   ret.push('===================================================================');
16791   ret.push('--- ' + diff.oldFileName + (typeof diff.oldHeader === 'undefined' ? '' : '\t' + diff.oldHeader));
16792   ret.push('+++ ' + diff.newFileName + (typeof diff.newHeader === 'undefined' ? '' : '\t' + diff.newHeader));
16793
16794   for (var i = 0; i < diff.hunks.length; i++) {
16795     var hunk = diff.hunks[i]; // Unified Diff Format quirk: If the chunk size is 0,
16796     // the first number is one lower than one would expect.
16797     // https://www.artima.com/weblogs/viewpost.jsp?thread=164293
16798
16799     if (hunk.oldLines === 0) {
16800       hunk.oldStart -= 1;
16801     }
16802
16803     if (hunk.newLines === 0) {
16804       hunk.newStart -= 1;
16805     }
16806
16807     ret.push('@@ -' + hunk.oldStart + ',' + hunk.oldLines + ' +' + hunk.newStart + ',' + hunk.newLines + ' @@');
16808     ret.push.apply(ret, hunk.lines);
16809   }
16810
16811   return ret.join('\n') + '\n';
16812 }
16813
16814 function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
16815   return formatPatch(structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options));
16816 }
16817
16818 function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) {
16819   return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options);
16820 }
16821
16822 var array = {};
16823
16824 /*istanbul ignore start*/
16825
16826 Object.defineProperty(array, "__esModule", {
16827   value: true
16828 });
16829 array.arrayEqual = arrayEqual;
16830 array.arrayStartsWith = arrayStartsWith;
16831 /*istanbul ignore end*/
16832
16833 function arrayEqual(a, b) {
16834   if (a.length !== b.length) {
16835     return false;
16836   }
16837
16838   return arrayStartsWith(a, b);
16839 }
16840
16841 function arrayStartsWith(array, start) {
16842   if (start.length > array.length) {
16843     return false;
16844   }
16845
16846   for (var i = 0; i < start.length; i++) {
16847     if (start[i] !== array[i]) {
16848       return false;
16849     }
16850   }
16851
16852   return true;
16853 }
16854
16855 /*istanbul ignore start*/
16856
16857 Object.defineProperty(merge$1, "__esModule", {
16858   value: true
16859 });
16860 merge$1.calcLineCount = calcLineCount;
16861 merge$1.merge = merge;
16862 /*istanbul ignore end*/
16863
16864 var
16865 /*istanbul ignore start*/
16866 _create = create$1
16867 /*istanbul ignore end*/
16868 ;
16869 var
16870 /*istanbul ignore start*/
16871 _parse = parse
16872 /*istanbul ignore end*/
16873 ;
16874 var
16875 /*istanbul ignore start*/
16876 _array = array
16877 /*istanbul ignore end*/
16878 ;
16879 /*istanbul ignore start*/
16880
16881 function _toConsumableArray(arr) {
16882   return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
16883 }
16884
16885 function _nonIterableSpread() {
16886   throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
16887 }
16888
16889 function _unsupportedIterableToArray(o, minLen) {
16890   if (!o) return;
16891   if (typeof o === "string") return _arrayLikeToArray(o, minLen);
16892   var n = Object.prototype.toString.call(o).slice(8, -1);
16893   if (n === "Object" && o.constructor) n = o.constructor.name;
16894   if (n === "Map" || n === "Set") return Array.from(o);
16895   if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
16896 }
16897
16898 function _iterableToArray(iter) {
16899   if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
16900 }
16901
16902 function _arrayWithoutHoles(arr) {
16903   if (Array.isArray(arr)) return _arrayLikeToArray(arr);
16904 }
16905
16906 function _arrayLikeToArray(arr, len) {
16907   if (len == null || len > arr.length) len = arr.length;
16908
16909   for (var i = 0, arr2 = new Array(len); i < len; i++) {
16910     arr2[i] = arr[i];
16911   }
16912
16913   return arr2;
16914 }
16915 /*istanbul ignore end*/
16916
16917
16918 function calcLineCount(hunk) {
16919   /*istanbul ignore start*/
16920   var _calcOldNewLineCount =
16921   /*istanbul ignore end*/
16922   calcOldNewLineCount(hunk.lines),
16923       oldLines = _calcOldNewLineCount.oldLines,
16924       newLines = _calcOldNewLineCount.newLines;
16925
16926   if (oldLines !== undefined) {
16927     hunk.oldLines = oldLines;
16928   } else {
16929     delete hunk.oldLines;
16930   }
16931
16932   if (newLines !== undefined) {
16933     hunk.newLines = newLines;
16934   } else {
16935     delete hunk.newLines;
16936   }
16937 }
16938
16939 function merge(mine, theirs, base) {
16940   mine = loadPatch(mine, base);
16941   theirs = loadPatch(theirs, base);
16942   var ret = {}; // For index we just let it pass through as it doesn't have any necessary meaning.
16943   // Leaving sanity checks on this to the API consumer that may know more about the
16944   // meaning in their own context.
16945
16946   if (mine.index || theirs.index) {
16947     ret.index = mine.index || theirs.index;
16948   }
16949
16950   if (mine.newFileName || theirs.newFileName) {
16951     if (!fileNameChanged(mine)) {
16952       // No header or no change in ours, use theirs (and ours if theirs does not exist)
16953       ret.oldFileName = theirs.oldFileName || mine.oldFileName;
16954       ret.newFileName = theirs.newFileName || mine.newFileName;
16955       ret.oldHeader = theirs.oldHeader || mine.oldHeader;
16956       ret.newHeader = theirs.newHeader || mine.newHeader;
16957     } else if (!fileNameChanged(theirs)) {
16958       // No header or no change in theirs, use ours
16959       ret.oldFileName = mine.oldFileName;
16960       ret.newFileName = mine.newFileName;
16961       ret.oldHeader = mine.oldHeader;
16962       ret.newHeader = mine.newHeader;
16963     } else {
16964       // Both changed... figure it out
16965       ret.oldFileName = selectField(ret, mine.oldFileName, theirs.oldFileName);
16966       ret.newFileName = selectField(ret, mine.newFileName, theirs.newFileName);
16967       ret.oldHeader = selectField(ret, mine.oldHeader, theirs.oldHeader);
16968       ret.newHeader = selectField(ret, mine.newHeader, theirs.newHeader);
16969     }
16970   }
16971
16972   ret.hunks = [];
16973   var mineIndex = 0,
16974       theirsIndex = 0,
16975       mineOffset = 0,
16976       theirsOffset = 0;
16977
16978   while (mineIndex < mine.hunks.length || theirsIndex < theirs.hunks.length) {
16979     var mineCurrent = mine.hunks[mineIndex] || {
16980       oldStart: Infinity
16981     },
16982         theirsCurrent = theirs.hunks[theirsIndex] || {
16983       oldStart: Infinity
16984     };
16985
16986     if (hunkBefore(mineCurrent, theirsCurrent)) {
16987       // This patch does not overlap with any of the others, yay.
16988       ret.hunks.push(cloneHunk(mineCurrent, mineOffset));
16989       mineIndex++;
16990       theirsOffset += mineCurrent.newLines - mineCurrent.oldLines;
16991     } else if (hunkBefore(theirsCurrent, mineCurrent)) {
16992       // This patch does not overlap with any of the others, yay.
16993       ret.hunks.push(cloneHunk(theirsCurrent, theirsOffset));
16994       theirsIndex++;
16995       mineOffset += theirsCurrent.newLines - theirsCurrent.oldLines;
16996     } else {
16997       // Overlap, merge as best we can
16998       var mergedHunk = {
16999         oldStart: Math.min(mineCurrent.oldStart, theirsCurrent.oldStart),
17000         oldLines: 0,
17001         newStart: Math.min(mineCurrent.newStart + mineOffset, theirsCurrent.oldStart + theirsOffset),
17002         newLines: 0,
17003         lines: []
17004       };
17005       mergeLines(mergedHunk, mineCurrent.oldStart, mineCurrent.lines, theirsCurrent.oldStart, theirsCurrent.lines);
17006       theirsIndex++;
17007       mineIndex++;
17008       ret.hunks.push(mergedHunk);
17009     }
17010   }
17011
17012   return ret;
17013 }
17014
17015 function loadPatch(param, base) {
17016   if (typeof param === 'string') {
17017     if (/^@@/m.test(param) || /^Index:/m.test(param)) {
17018       return (
17019         /*istanbul ignore start*/
17020         (/*istanbul ignore end*/
17021
17022         /*istanbul ignore start*/
17023         0, _parse
17024         /*istanbul ignore end*/
17025         .
17026         /*istanbul ignore start*/
17027         parsePatch
17028         /*istanbul ignore end*/
17029         )(param)[0]
17030       );
17031     }
17032
17033     if (!base) {
17034       throw new Error('Must provide a base reference or pass in a patch');
17035     }
17036
17037     return (
17038       /*istanbul ignore start*/
17039       (/*istanbul ignore end*/
17040
17041       /*istanbul ignore start*/
17042       0, _create
17043       /*istanbul ignore end*/
17044       .
17045       /*istanbul ignore start*/
17046       structuredPatch
17047       /*istanbul ignore end*/
17048       )(undefined, undefined, base, param)
17049     );
17050   }
17051
17052   return param;
17053 }
17054
17055 function fileNameChanged(patch) {
17056   return patch.newFileName && patch.newFileName !== patch.oldFileName;
17057 }
17058
17059 function selectField(index, mine, theirs) {
17060   if (mine === theirs) {
17061     return mine;
17062   } else {
17063     index.conflict = true;
17064     return {
17065       mine: mine,
17066       theirs: theirs
17067     };
17068   }
17069 }
17070
17071 function hunkBefore(test, check) {
17072   return test.oldStart < check.oldStart && test.oldStart + test.oldLines < check.oldStart;
17073 }
17074
17075 function cloneHunk(hunk, offset) {
17076   return {
17077     oldStart: hunk.oldStart,
17078     oldLines: hunk.oldLines,
17079     newStart: hunk.newStart + offset,
17080     newLines: hunk.newLines,
17081     lines: hunk.lines
17082   };
17083 }
17084
17085 function mergeLines(hunk, mineOffset, mineLines, theirOffset, theirLines) {
17086   // This will generally result in a conflicted hunk, but there are cases where the context
17087   // is the only overlap where we can successfully merge the content here.
17088   var mine = {
17089     offset: mineOffset,
17090     lines: mineLines,
17091     index: 0
17092   },
17093       their = {
17094     offset: theirOffset,
17095     lines: theirLines,
17096     index: 0
17097   }; // Handle any leading content
17098
17099   insertLeading(hunk, mine, their);
17100   insertLeading(hunk, their, mine); // Now in the overlap content. Scan through and select the best changes from each.
17101
17102   while (mine.index < mine.lines.length && their.index < their.lines.length) {
17103     var mineCurrent = mine.lines[mine.index],
17104         theirCurrent = their.lines[their.index];
17105
17106     if ((mineCurrent[0] === '-' || mineCurrent[0] === '+') && (theirCurrent[0] === '-' || theirCurrent[0] === '+')) {
17107       // Both modified ...
17108       mutualChange(hunk, mine, their);
17109     } else if (mineCurrent[0] === '+' && theirCurrent[0] === ' ') {
17110       /*istanbul ignore start*/
17111       var _hunk$lines;
17112       /*istanbul ignore end*/
17113       // Mine inserted
17114
17115       /*istanbul ignore start*/
17116
17117       /*istanbul ignore end*/
17118
17119       /*istanbul ignore start*/
17120
17121
17122       (_hunk$lines =
17123       /*istanbul ignore end*/
17124       hunk.lines).push.apply(
17125       /*istanbul ignore start*/
17126       _hunk$lines
17127       /*istanbul ignore end*/
17128       ,
17129       /*istanbul ignore start*/
17130       _toConsumableArray(
17131       /*istanbul ignore end*/
17132       collectChange(mine)));
17133     } else if (theirCurrent[0] === '+' && mineCurrent[0] === ' ') {
17134       /*istanbul ignore start*/
17135       var _hunk$lines2;
17136       /*istanbul ignore end*/
17137       // Theirs inserted
17138
17139       /*istanbul ignore start*/
17140
17141       /*istanbul ignore end*/
17142
17143       /*istanbul ignore start*/
17144
17145
17146       (_hunk$lines2 =
17147       /*istanbul ignore end*/
17148       hunk.lines).push.apply(
17149       /*istanbul ignore start*/
17150       _hunk$lines2
17151       /*istanbul ignore end*/
17152       ,
17153       /*istanbul ignore start*/
17154       _toConsumableArray(
17155       /*istanbul ignore end*/
17156       collectChange(their)));
17157     } else if (mineCurrent[0] === '-' && theirCurrent[0] === ' ') {
17158       // Mine removed or edited
17159       removal(hunk, mine, their);
17160     } else if (theirCurrent[0] === '-' && mineCurrent[0] === ' ') {
17161       // Their removed or edited
17162       removal(hunk, their, mine, true);
17163     } else if (mineCurrent === theirCurrent) {
17164       // Context identity
17165       hunk.lines.push(mineCurrent);
17166       mine.index++;
17167       their.index++;
17168     } else {
17169       // Context mismatch
17170       conflict(hunk, collectChange(mine), collectChange(their));
17171     }
17172   } // Now push anything that may be remaining
17173
17174
17175   insertTrailing(hunk, mine);
17176   insertTrailing(hunk, their);
17177   calcLineCount(hunk);
17178 }
17179
17180 function mutualChange(hunk, mine, their) {
17181   var myChanges = collectChange(mine),
17182       theirChanges = collectChange(their);
17183
17184   if (allRemoves(myChanges) && allRemoves(theirChanges)) {
17185     // Special case for remove changes that are supersets of one another
17186     if (
17187     /*istanbul ignore start*/
17188     (/*istanbul ignore end*/
17189
17190     /*istanbul ignore start*/
17191     0, _array
17192     /*istanbul ignore end*/
17193     .
17194     /*istanbul ignore start*/
17195     arrayStartsWith
17196     /*istanbul ignore end*/
17197     )(myChanges, theirChanges) && skipRemoveSuperset(their, myChanges, myChanges.length - theirChanges.length)) {
17198       /*istanbul ignore start*/
17199       var _hunk$lines3;
17200       /*istanbul ignore end*/
17201
17202       /*istanbul ignore start*/
17203
17204       /*istanbul ignore end*/
17205
17206       /*istanbul ignore start*/
17207
17208
17209       (_hunk$lines3 =
17210       /*istanbul ignore end*/
17211       hunk.lines).push.apply(
17212       /*istanbul ignore start*/
17213       _hunk$lines3
17214       /*istanbul ignore end*/
17215       ,
17216       /*istanbul ignore start*/
17217       _toConsumableArray(
17218       /*istanbul ignore end*/
17219       myChanges));
17220
17221       return;
17222     } else if (
17223     /*istanbul ignore start*/
17224     (/*istanbul ignore end*/
17225
17226     /*istanbul ignore start*/
17227     0, _array
17228     /*istanbul ignore end*/
17229     .
17230     /*istanbul ignore start*/
17231     arrayStartsWith
17232     /*istanbul ignore end*/
17233     )(theirChanges, myChanges) && skipRemoveSuperset(mine, theirChanges, theirChanges.length - myChanges.length)) {
17234       /*istanbul ignore start*/
17235       var _hunk$lines4;
17236       /*istanbul ignore end*/
17237
17238       /*istanbul ignore start*/
17239
17240       /*istanbul ignore end*/
17241
17242       /*istanbul ignore start*/
17243
17244
17245       (_hunk$lines4 =
17246       /*istanbul ignore end*/
17247       hunk.lines).push.apply(
17248       /*istanbul ignore start*/
17249       _hunk$lines4
17250       /*istanbul ignore end*/
17251       ,
17252       /*istanbul ignore start*/
17253       _toConsumableArray(
17254       /*istanbul ignore end*/
17255       theirChanges));
17256
17257       return;
17258     }
17259   } else if (
17260   /*istanbul ignore start*/
17261   (/*istanbul ignore end*/
17262
17263   /*istanbul ignore start*/
17264   0, _array
17265   /*istanbul ignore end*/
17266   .
17267   /*istanbul ignore start*/
17268   arrayEqual
17269   /*istanbul ignore end*/
17270   )(myChanges, theirChanges)) {
17271     /*istanbul ignore start*/
17272     var _hunk$lines5;
17273     /*istanbul ignore end*/
17274
17275     /*istanbul ignore start*/
17276
17277     /*istanbul ignore end*/
17278
17279     /*istanbul ignore start*/
17280
17281
17282     (_hunk$lines5 =
17283     /*istanbul ignore end*/
17284     hunk.lines).push.apply(
17285     /*istanbul ignore start*/
17286     _hunk$lines5
17287     /*istanbul ignore end*/
17288     ,
17289     /*istanbul ignore start*/
17290     _toConsumableArray(
17291     /*istanbul ignore end*/
17292     myChanges));
17293
17294     return;
17295   }
17296
17297   conflict(hunk, myChanges, theirChanges);
17298 }
17299
17300 function removal(hunk, mine, their, swap) {
17301   var myChanges = collectChange(mine),
17302       theirChanges = collectContext(their, myChanges);
17303
17304   if (theirChanges.merged) {
17305     /*istanbul ignore start*/
17306     var _hunk$lines6;
17307     /*istanbul ignore end*/
17308
17309     /*istanbul ignore start*/
17310
17311     /*istanbul ignore end*/
17312
17313     /*istanbul ignore start*/
17314
17315
17316     (_hunk$lines6 =
17317     /*istanbul ignore end*/
17318     hunk.lines).push.apply(
17319     /*istanbul ignore start*/
17320     _hunk$lines6
17321     /*istanbul ignore end*/
17322     ,
17323     /*istanbul ignore start*/
17324     _toConsumableArray(
17325     /*istanbul ignore end*/
17326     theirChanges.merged));
17327   } else {
17328     conflict(hunk, swap ? theirChanges : myChanges, swap ? myChanges : theirChanges);
17329   }
17330 }
17331
17332 function conflict(hunk, mine, their) {
17333   hunk.conflict = true;
17334   hunk.lines.push({
17335     conflict: true,
17336     mine: mine,
17337     theirs: their
17338   });
17339 }
17340
17341 function insertLeading(hunk, insert, their) {
17342   while (insert.offset < their.offset && insert.index < insert.lines.length) {
17343     var line = insert.lines[insert.index++];
17344     hunk.lines.push(line);
17345     insert.offset++;
17346   }
17347 }
17348
17349 function insertTrailing(hunk, insert) {
17350   while (insert.index < insert.lines.length) {
17351     var line = insert.lines[insert.index++];
17352     hunk.lines.push(line);
17353   }
17354 }
17355
17356 function collectChange(state) {
17357   var ret = [],
17358       operation = state.lines[state.index][0];
17359
17360   while (state.index < state.lines.length) {
17361     var line = state.lines[state.index]; // Group additions that are immediately after subtractions and treat them as one "atomic" modify change.
17362
17363     if (operation === '-' && line[0] === '+') {
17364       operation = '+';
17365     }
17366
17367     if (operation === line[0]) {
17368       ret.push(line);
17369       state.index++;
17370     } else {
17371       break;
17372     }
17373   }
17374
17375   return ret;
17376 }
17377
17378 function collectContext(state, matchChanges) {
17379   var changes = [],
17380       merged = [],
17381       matchIndex = 0,
17382       contextChanges = false,
17383       conflicted = false;
17384
17385   while (matchIndex < matchChanges.length && state.index < state.lines.length) {
17386     var change = state.lines[state.index],
17387         match = matchChanges[matchIndex]; // Once we've hit our add, then we are done
17388
17389     if (match[0] === '+') {
17390       break;
17391     }
17392
17393     contextChanges = contextChanges || change[0] !== ' ';
17394     merged.push(match);
17395     matchIndex++; // Consume any additions in the other block as a conflict to attempt
17396     // to pull in the remaining context after this
17397
17398     if (change[0] === '+') {
17399       conflicted = true;
17400
17401       while (change[0] === '+') {
17402         changes.push(change);
17403         change = state.lines[++state.index];
17404       }
17405     }
17406
17407     if (match.substr(1) === change.substr(1)) {
17408       changes.push(change);
17409       state.index++;
17410     } else {
17411       conflicted = true;
17412     }
17413   }
17414
17415   if ((matchChanges[matchIndex] || '')[0] === '+' && contextChanges) {
17416     conflicted = true;
17417   }
17418
17419   if (conflicted) {
17420     return changes;
17421   }
17422
17423   while (matchIndex < matchChanges.length) {
17424     merged.push(matchChanges[matchIndex++]);
17425   }
17426
17427   return {
17428     merged: merged,
17429     changes: changes
17430   };
17431 }
17432
17433 function allRemoves(changes) {
17434   return changes.reduce(function (prev, change) {
17435     return prev && change[0] === '-';
17436   }, true);
17437 }
17438
17439 function skipRemoveSuperset(state, removeChanges, delta) {
17440   for (var i = 0; i < delta; i++) {
17441     var changeContent = removeChanges[removeChanges.length - delta + i].substr(1);
17442
17443     if (state.lines[state.index + i] !== ' ' + changeContent) {
17444       return false;
17445     }
17446   }
17447
17448   state.index += delta;
17449   return true;
17450 }
17451
17452 function calcOldNewLineCount(lines) {
17453   var oldLines = 0;
17454   var newLines = 0;
17455   lines.forEach(function (line) {
17456     if (typeof line !== 'string') {
17457       var myCount = calcOldNewLineCount(line.mine);
17458       var theirCount = calcOldNewLineCount(line.theirs);
17459
17460       if (oldLines !== undefined) {
17461         if (myCount.oldLines === theirCount.oldLines) {
17462           oldLines += myCount.oldLines;
17463         } else {
17464           oldLines = undefined;
17465         }
17466       }
17467
17468       if (newLines !== undefined) {
17469         if (myCount.newLines === theirCount.newLines) {
17470           newLines += myCount.newLines;
17471         } else {
17472           newLines = undefined;
17473         }
17474       }
17475     } else {
17476       if (newLines !== undefined && (line[0] === '+' || line[0] === ' ')) {
17477         newLines++;
17478       }
17479
17480       if (oldLines !== undefined && (line[0] === '-' || line[0] === ' ')) {
17481         oldLines++;
17482       }
17483     }
17484   });
17485   return {
17486     oldLines: oldLines,
17487     newLines: newLines
17488   };
17489 }
17490
17491 var dmp = {};
17492
17493 /*istanbul ignore start*/
17494
17495 Object.defineProperty(dmp, "__esModule", {
17496   value: true
17497 });
17498 dmp.convertChangesToDMP = convertChangesToDMP;
17499 /*istanbul ignore end*/
17500 // See: http://code.google.com/p/google-diff-match-patch/wiki/API
17501
17502 function convertChangesToDMP(changes) {
17503   var ret = [],
17504       change,
17505       operation;
17506
17507   for (var i = 0; i < changes.length; i++) {
17508     change = changes[i];
17509
17510     if (change.added) {
17511       operation = 1;
17512     } else if (change.removed) {
17513       operation = -1;
17514     } else {
17515       operation = 0;
17516     }
17517
17518     ret.push([operation, change.value]);
17519   }
17520
17521   return ret;
17522 }
17523
17524 var xml = {};
17525
17526 /*istanbul ignore start*/
17527
17528 Object.defineProperty(xml, "__esModule", {
17529   value: true
17530 });
17531 xml.convertChangesToXML = convertChangesToXML;
17532 /*istanbul ignore end*/
17533
17534 function convertChangesToXML(changes) {
17535   var ret = [];
17536
17537   for (var i = 0; i < changes.length; i++) {
17538     var change = changes[i];
17539
17540     if (change.added) {
17541       ret.push('<ins>');
17542     } else if (change.removed) {
17543       ret.push('<del>');
17544     }
17545
17546     ret.push(escapeHTML(change.value));
17547
17548     if (change.added) {
17549       ret.push('</ins>');
17550     } else if (change.removed) {
17551       ret.push('</del>');
17552     }
17553   }
17554
17555   return ret.join('');
17556 }
17557
17558 function escapeHTML(s) {
17559   var n = s;
17560   n = n.replace(/&/g, '&amp;');
17561   n = n.replace(/</g, '&lt;');
17562   n = n.replace(/>/g, '&gt;');
17563   n = n.replace(/"/g, '&quot;');
17564   return n;
17565 }
17566
17567 /*istanbul ignore start*/
17568
17569 (function (exports) {
17570
17571   Object.defineProperty(exports, "__esModule", {
17572     value: true
17573   });
17574   Object.defineProperty(exports, "Diff", {
17575     enumerable: true,
17576     get: function get() {
17577       return _base["default"];
17578     }
17579   });
17580   Object.defineProperty(exports, "diffChars", {
17581     enumerable: true,
17582     get: function get() {
17583       return _character.diffChars;
17584     }
17585   });
17586   Object.defineProperty(exports, "diffWords", {
17587     enumerable: true,
17588     get: function get() {
17589       return _word.diffWords;
17590     }
17591   });
17592   Object.defineProperty(exports, "diffWordsWithSpace", {
17593     enumerable: true,
17594     get: function get() {
17595       return _word.diffWordsWithSpace;
17596     }
17597   });
17598   Object.defineProperty(exports, "diffLines", {
17599     enumerable: true,
17600     get: function get() {
17601       return _line.diffLines;
17602     }
17603   });
17604   Object.defineProperty(exports, "diffTrimmedLines", {
17605     enumerable: true,
17606     get: function get() {
17607       return _line.diffTrimmedLines;
17608     }
17609   });
17610   Object.defineProperty(exports, "diffSentences", {
17611     enumerable: true,
17612     get: function get() {
17613       return _sentence.diffSentences;
17614     }
17615   });
17616   Object.defineProperty(exports, "diffCss", {
17617     enumerable: true,
17618     get: function get() {
17619       return _css.diffCss;
17620     }
17621   });
17622   Object.defineProperty(exports, "diffJson", {
17623     enumerable: true,
17624     get: function get() {
17625       return _json.diffJson;
17626     }
17627   });
17628   Object.defineProperty(exports, "canonicalize", {
17629     enumerable: true,
17630     get: function get() {
17631       return _json.canonicalize;
17632     }
17633   });
17634   Object.defineProperty(exports, "diffArrays", {
17635     enumerable: true,
17636     get: function get() {
17637       return _array.diffArrays;
17638     }
17639   });
17640   Object.defineProperty(exports, "applyPatch", {
17641     enumerable: true,
17642     get: function get() {
17643       return _apply.applyPatch;
17644     }
17645   });
17646   Object.defineProperty(exports, "applyPatches", {
17647     enumerable: true,
17648     get: function get() {
17649       return _apply.applyPatches;
17650     }
17651   });
17652   Object.defineProperty(exports, "parsePatch", {
17653     enumerable: true,
17654     get: function get() {
17655       return _parse.parsePatch;
17656     }
17657   });
17658   Object.defineProperty(exports, "merge", {
17659     enumerable: true,
17660     get: function get() {
17661       return _merge.merge;
17662     }
17663   });
17664   Object.defineProperty(exports, "structuredPatch", {
17665     enumerable: true,
17666     get: function get() {
17667       return _create.structuredPatch;
17668     }
17669   });
17670   Object.defineProperty(exports, "createTwoFilesPatch", {
17671     enumerable: true,
17672     get: function get() {
17673       return _create.createTwoFilesPatch;
17674     }
17675   });
17676   Object.defineProperty(exports, "createPatch", {
17677     enumerable: true,
17678     get: function get() {
17679       return _create.createPatch;
17680     }
17681   });
17682   Object.defineProperty(exports, "convertChangesToDMP", {
17683     enumerable: true,
17684     get: function get() {
17685       return _dmp.convertChangesToDMP;
17686     }
17687   });
17688   Object.defineProperty(exports, "convertChangesToXML", {
17689     enumerable: true,
17690     get: function get() {
17691       return _xml.convertChangesToXML;
17692     }
17693   });
17694   /*istanbul ignore end*/
17695
17696   var
17697   /*istanbul ignore start*/
17698   _base = _interopRequireDefault(base)
17699   /*istanbul ignore end*/
17700   ;
17701
17702   var
17703   /*istanbul ignore start*/
17704   _character = character
17705   /*istanbul ignore end*/
17706   ;
17707   var
17708   /*istanbul ignore start*/
17709   _word = word
17710   /*istanbul ignore end*/
17711   ;
17712   var
17713   /*istanbul ignore start*/
17714   _line = line
17715   /*istanbul ignore end*/
17716   ;
17717   var
17718   /*istanbul ignore start*/
17719   _sentence = sentence
17720   /*istanbul ignore end*/
17721   ;
17722   var
17723   /*istanbul ignore start*/
17724   _css = css
17725   /*istanbul ignore end*/
17726   ;
17727   var
17728   /*istanbul ignore start*/
17729   _json = json
17730   /*istanbul ignore end*/
17731   ;
17732   var
17733   /*istanbul ignore start*/
17734   _array = array$1
17735   /*istanbul ignore end*/
17736   ;
17737   var
17738   /*istanbul ignore start*/
17739   _apply = apply$2
17740   /*istanbul ignore end*/
17741   ;
17742   var
17743   /*istanbul ignore start*/
17744   _parse = parse
17745   /*istanbul ignore end*/
17746   ;
17747   var
17748   /*istanbul ignore start*/
17749   _merge = merge$1
17750   /*istanbul ignore end*/
17751   ;
17752   var
17753   /*istanbul ignore start*/
17754   _create = create$1
17755   /*istanbul ignore end*/
17756   ;
17757   var
17758   /*istanbul ignore start*/
17759   _dmp = dmp
17760   /*istanbul ignore end*/
17761   ;
17762   var
17763   /*istanbul ignore start*/
17764   _xml = xml
17765   /*istanbul ignore end*/
17766   ;
17767   /*istanbul ignore start*/
17768
17769   function _interopRequireDefault(obj) {
17770     return obj && obj.__esModule ? obj : {
17771       "default": obj
17772     };
17773   }
17774   /*istanbul ignore end*/
17775
17776 })(lib$1);
17777
17778 const {
17779   promises: fs
17780 } = require$$0__default$4["default"];
17781 const path$1 = require$$0__default$1["default"];
17782 const chalk$1 = source; // eslint-disable-next-line no-restricted-modules
17783
17784 const prettier$4 = require$$3; // eslint-disable-next-line no-restricted-modules
17785
17786 const {
17787   getStdin
17788 } = require$$4;
17789 const {
17790   createIgnorer,
17791   errors
17792 } = prettierInternal;
17793 const {
17794   expandPatterns,
17795   fixWindowsSlashes
17796 } = expandPatterns_1;
17797 const {
17798   getOptionsForFile
17799 } = option;
17800 const isTTY = isTty;
17801
17802 function diff(a, b) {
17803   return lib$1.createTwoFilesPatch("", "", a, b, "", "", {
17804     context: 2
17805   });
17806 }
17807
17808 function handleError(context, filename, error, printedFilename) {
17809   if (error instanceof errors.UndefinedParserError) {
17810     // Can't test on CI, `isTTY()` is always false, see ./is-tty.js
17811
17812     /* istanbul ignore next */
17813     if ((context.argv.write || context.argv["ignore-unknown"]) && printedFilename) {
17814       printedFilename.clear();
17815     }
17816
17817     if (context.argv["ignore-unknown"]) {
17818       return;
17819     }
17820
17821     if (!context.argv.check && !context.argv["list-different"]) {
17822       process.exitCode = 2;
17823     }
17824
17825     context.logger.error(error.message);
17826     return;
17827   }
17828
17829   if (context.argv.write) {
17830     // Add newline to split errors from filename line.
17831     process.stdout.write("\n");
17832   }
17833
17834   const isParseError = Boolean(error && error.loc);
17835   const isValidationError = /^Invalid \S+ value\./.test(error && error.message);
17836
17837   if (isParseError) {
17838     // `invalid.js: SyntaxError: Unexpected token (1:1)`.
17839     context.logger.error(`${filename}: ${String(error)}`);
17840   } else if (isValidationError || error instanceof errors.ConfigError) {
17841     // `Invalid printWidth value. Expected an integer, but received 0.5.`
17842     context.logger.error(error.message); // If validation fails for one file, it will fail for all of them.
17843
17844     process.exit(1);
17845   } else if (error instanceof errors.DebugError) {
17846     // `invalid.js: Some debug error message`
17847     context.logger.error(`${filename}: ${error.message}`);
17848   } else {
17849     // `invalid.js: Error: Some unexpected error\n[stack trace]`
17850
17851     /* istanbul ignore next */
17852     context.logger.error(filename + ": " + (error.stack || error));
17853   } // Don't exit the process if one file failed
17854
17855
17856   process.exitCode = 2;
17857 }
17858
17859 function writeOutput(context, result, options) {
17860   // Don't use `console.log` here since it adds an extra newline at the end.
17861   process.stdout.write(context.argv["debug-check"] ? result.filepath : result.formatted);
17862
17863   if (options && options.cursorOffset >= 0) {
17864     process.stderr.write(result.cursorOffset + "\n");
17865   }
17866 }
17867
17868 function listDifferent(context, input, options, filename) {
17869   if (!context.argv.check && !context.argv["list-different"]) {
17870     return;
17871   }
17872
17873   try {
17874     if (!options.filepath && !options.parser) {
17875       throw new errors.UndefinedParserError("No parser and no file path given, couldn't infer a parser.");
17876     }
17877
17878     if (!prettier$4.check(input, options)) {
17879       if (!context.argv.write) {
17880         context.logger.log(filename);
17881         process.exitCode = 1;
17882       }
17883     }
17884   } catch (error) {
17885     context.logger.error(error.message);
17886   }
17887
17888   return true;
17889 }
17890
17891 function format$1(context, input, opt) {
17892   if (!opt.parser && !opt.filepath) {
17893     throw new errors.UndefinedParserError("No parser and no file path given, couldn't infer a parser.");
17894   }
17895
17896   if (context.argv["debug-print-doc"]) {
17897     const doc = prettier$4.__debug.printToDoc(input, opt);
17898
17899     return {
17900       formatted: prettier$4.__debug.formatDoc(doc) + "\n"
17901     };
17902   }
17903
17904   if (context.argv["debug-print-comments"]) {
17905     return {
17906       formatted: prettier$4.format(JSON.stringify(prettier$4.formatWithCursor(input, opt).comments || []), {
17907         parser: "json"
17908       })
17909     };
17910   }
17911
17912   if (context.argv["debug-print-ast"]) {
17913     const {
17914       ast
17915     } = prettier$4.__debug.parse(input, opt);
17916
17917     return {
17918       formatted: JSON.stringify(ast)
17919     };
17920   }
17921
17922   if (context.argv["debug-check"]) {
17923     const pp = prettier$4.format(input, opt);
17924     const pppp = prettier$4.format(pp, opt);
17925
17926     if (pp !== pppp) {
17927       throw new errors.DebugError("prettier(input) !== prettier(prettier(input))\n" + diff(pp, pppp));
17928     } else {
17929       const stringify = obj => JSON.stringify(obj, null, 2);
17930
17931       const ast = stringify(prettier$4.__debug.parse(input, opt,
17932       /* massage */
17933       true).ast);
17934       const past = stringify(prettier$4.__debug.parse(pp, opt,
17935       /* massage */
17936       true).ast);
17937       /* istanbul ignore next */
17938
17939       if (ast !== past) {
17940         const MAX_AST_SIZE = 2097152; // 2MB
17941
17942         const astDiff = ast.length > MAX_AST_SIZE || past.length > MAX_AST_SIZE ? "AST diff too large to render" : diff(ast, past);
17943         throw new errors.DebugError("ast(input) !== ast(prettier(input))\n" + astDiff + "\n" + diff(input, pp));
17944       }
17945     }
17946
17947     return {
17948       formatted: pp,
17949       filepath: opt.filepath || "(stdin)\n"
17950     };
17951   }
17952   /* istanbul ignore next */
17953
17954
17955   if (context.argv["debug-benchmark"]) {
17956     let benchmark;
17957
17958     try {
17959       // eslint-disable-next-line import/no-extraneous-dependencies
17960       benchmark = require("benchmark");
17961     } catch {
17962       context.logger.debug("'--debug-benchmark' requires the 'benchmark' package to be installed.");
17963       process.exit(2);
17964     }
17965
17966     context.logger.debug("'--debug-benchmark' option found, measuring formatWithCursor with 'benchmark' module.");
17967     const suite = new benchmark.Suite();
17968     suite.add("format", () => {
17969       prettier$4.formatWithCursor(input, opt);
17970     }).on("cycle", event => {
17971       const results = {
17972         benchmark: String(event.target),
17973         hz: event.target.hz,
17974         ms: event.target.times.cycle * 1000
17975       };
17976       context.logger.debug("'--debug-benchmark' measurements for formatWithCursor: " + JSON.stringify(results, null, 2));
17977     }).run({
17978       async: false
17979     });
17980   } else if (context.argv["debug-repeat"] > 0) {
17981     const repeat = context.argv["debug-repeat"];
17982     context.logger.debug("'--debug-repeat' option found, running formatWithCursor " + repeat + " times.");
17983     let totalMs = 0;
17984
17985     for (let i = 0; i < repeat; ++i) {
17986       // should be using `performance.now()`, but only `Date` is cross-platform enough
17987       const startMs = Date.now();
17988       prettier$4.formatWithCursor(input, opt);
17989       totalMs += Date.now() - startMs;
17990     }
17991
17992     const averageMs = totalMs / repeat;
17993     const results = {
17994       repeat,
17995       hz: 1000 / averageMs,
17996       ms: averageMs
17997     };
17998     context.logger.debug("'--debug-repeat' measurements for formatWithCursor: " + JSON.stringify(results, null, 2));
17999   }
18000
18001   return prettier$4.formatWithCursor(input, opt);
18002 }
18003
18004 async function createIgnorerFromContextOrDie(context) {
18005   try {
18006     return await createIgnorer(context.argv["ignore-path"], context.argv["with-node-modules"]);
18007   } catch (e) {
18008     context.logger.error(e.message);
18009     process.exit(2);
18010   }
18011 }
18012
18013 async function formatStdin$1(context) {
18014   const filepath = context.argv["stdin-filepath"] ? path$1.resolve(process.cwd(), context.argv["stdin-filepath"]) : process.cwd();
18015   const ignorer = await createIgnorerFromContextOrDie(context); // If there's an ignore-path set, the filename must be relative to the
18016   // ignore path, not the current working directory.
18017
18018   const relativeFilepath = context.argv["ignore-path"] ? path$1.relative(path$1.dirname(context.argv["ignore-path"]), filepath) : path$1.relative(process.cwd(), filepath);
18019
18020   try {
18021     const input = await getStdin();
18022
18023     if (relativeFilepath && ignorer.ignores(fixWindowsSlashes(relativeFilepath))) {
18024       writeOutput(context, {
18025         formatted: input
18026       });
18027       return;
18028     }
18029
18030     const options = await getOptionsForFile(context, filepath);
18031
18032     if (listDifferent(context, input, options, "(stdin)")) {
18033       return;
18034     }
18035
18036     writeOutput(context, format$1(context, input, options), options);
18037   } catch (error) {
18038     handleError(context, relativeFilepath || "stdin", error);
18039   }
18040 }
18041
18042 async function formatFiles$1(context) {
18043   // The ignorer will be used to filter file paths after the glob is checked,
18044   // before any files are actually written
18045   const ignorer = await createIgnorerFromContextOrDie(context);
18046   let numberOfUnformattedFilesFound = 0;
18047
18048   if (context.argv.check) {
18049     context.logger.log("Checking formatting...");
18050   }
18051
18052   for await (const pathOrError of expandPatterns(context)) {
18053     if (typeof pathOrError === "object") {
18054       context.logger.error(pathOrError.error); // Don't exit, but set the exit code to 2
18055
18056       process.exitCode = 2;
18057       continue;
18058     }
18059
18060     const filename = pathOrError; // If there's an ignore-path set, the filename must be relative to the
18061     // ignore path, not the current working directory.
18062
18063     const ignoreFilename = context.argv["ignore-path"] ? path$1.relative(path$1.dirname(context.argv["ignore-path"]), filename) : filename;
18064     const fileIgnored = ignorer.ignores(fixWindowsSlashes(ignoreFilename));
18065
18066     if (fileIgnored && (context.argv["debug-check"] || context.argv.write || context.argv.check || context.argv["list-different"])) {
18067       continue;
18068     }
18069
18070     const options = Object.assign(Object.assign({}, await getOptionsForFile(context, filename)), {}, {
18071       filepath: filename
18072     });
18073     let printedFilename;
18074
18075     if (isTTY()) {
18076       printedFilename = context.logger.log(filename, {
18077         newline: false,
18078         clearable: true
18079       });
18080     }
18081
18082     let input;
18083
18084     try {
18085       input = await fs.readFile(filename, "utf8");
18086     } catch (error) {
18087       // Add newline to split errors from filename line.
18088
18089       /* istanbul ignore next */
18090       context.logger.log("");
18091       /* istanbul ignore next */
18092
18093       context.logger.error(`Unable to read file: ${filename}\n${error.message}`); // Don't exit the process if one file failed
18094
18095       /* istanbul ignore next */
18096
18097       process.exitCode = 2;
18098       /* istanbul ignore next */
18099
18100       continue;
18101     }
18102
18103     if (fileIgnored) {
18104       writeOutput(context, {
18105         formatted: input
18106       }, options);
18107       continue;
18108     }
18109
18110     const start = Date.now();
18111     let result;
18112     let output;
18113
18114     try {
18115       result = format$1(context, input, options);
18116       output = result.formatted;
18117     } catch (error) {
18118       handleError(context, filename, error, printedFilename);
18119       continue;
18120     }
18121
18122     const isDifferent = output !== input;
18123
18124     if (printedFilename) {
18125       // Remove previously printed filename to log it with duration.
18126       printedFilename.clear();
18127     }
18128
18129     if (context.argv.write) {
18130       // Don't write the file if it won't change in order not to invalidate
18131       // mtime based caches.
18132       if (isDifferent) {
18133         if (!context.argv.check && !context.argv["list-different"]) {
18134           context.logger.log(`${filename} ${Date.now() - start}ms`);
18135         }
18136
18137         try {
18138           await fs.writeFile(filename, output, "utf8");
18139         } catch (error) {
18140           /* istanbul ignore next */
18141           context.logger.error(`Unable to write file: ${filename}\n${error.message}`); // Don't exit the process if one file failed
18142
18143           /* istanbul ignore next */
18144
18145           process.exitCode = 2;
18146         }
18147       } else if (!context.argv.check && !context.argv["list-different"]) {
18148         context.logger.log(`${chalk$1.grey(filename)} ${Date.now() - start}ms`);
18149       }
18150     } else if (context.argv["debug-check"]) {
18151       /* istanbul ignore else */
18152       if (result.filepath) {
18153         context.logger.log(result.filepath);
18154       } else {
18155         process.exitCode = 2;
18156       }
18157     } else if (!context.argv.check && !context.argv["list-different"]) {
18158       writeOutput(context, result, options);
18159     }
18160
18161     if (isDifferent) {
18162       if (context.argv.check) {
18163         context.logger.warn(filename);
18164       } else if (context.argv["list-different"]) {
18165         context.logger.log(filename);
18166       }
18167
18168       numberOfUnformattedFilesFound += 1;
18169     }
18170   } // Print check summary based on expected exit code
18171
18172
18173   if (context.argv.check) {
18174     if (numberOfUnformattedFilesFound === 0) {
18175       context.logger.log("All matched files use Prettier code style!");
18176     } else {
18177       context.logger.warn(context.argv.write ? "Code style issues fixed in the above file(s)." : "Code style issues found in the above file(s). Forgot to run Prettier?");
18178     }
18179   } // Ensure non-zero exitCode when using --check/list-different is not combined with --write
18180
18181
18182   if ((context.argv.check || context.argv["list-different"]) && numberOfUnformattedFilesFound > 0 && !process.exitCode && !context.argv.write) {
18183     process.exitCode = 1;
18184   }
18185 }
18186
18187 var format_1 = {
18188   format: format$1,
18189   formatStdin: formatStdin$1,
18190   formatFiles: formatFiles$1
18191 };
18192
18193 var getNative = _getNative;
18194
18195 var defineProperty$2 = function () {
18196   try {
18197     var func = getNative(Object, 'defineProperty');
18198     func({}, '', {});
18199     return func;
18200   } catch (e) {}
18201 }();
18202
18203 var _defineProperty = defineProperty$2;
18204
18205 var defineProperty$1 = _defineProperty;
18206 /**
18207  * The base implementation of `assignValue` and `assignMergeValue` without
18208  * value checks.
18209  *
18210  * @private
18211  * @param {Object} object The object to modify.
18212  * @param {string} key The key of the property to assign.
18213  * @param {*} value The value to assign.
18214  */
18215
18216 function baseAssignValue$2(object, key, value) {
18217   if (key == '__proto__' && defineProperty$1) {
18218     defineProperty$1(object, key, {
18219       'configurable': true,
18220       'enumerable': true,
18221       'value': value,
18222       'writable': true
18223     });
18224   } else {
18225     object[key] = value;
18226   }
18227 }
18228
18229 var _baseAssignValue = baseAssignValue$2;
18230
18231 var baseAssignValue$1 = _baseAssignValue,
18232     eq = eq_1;
18233 /** Used for built-in method references. */
18234
18235 var objectProto$1 = Object.prototype;
18236 /** Used to check objects for own properties. */
18237
18238 var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
18239 /**
18240  * Assigns `value` to `key` of `object` if the existing value is not equivalent
18241  * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
18242  * for equality comparisons.
18243  *
18244  * @private
18245  * @param {Object} object The object to modify.
18246  * @param {string} key The key of the property to assign.
18247  * @param {*} value The value to assign.
18248  */
18249
18250 function assignValue$1(object, key, value) {
18251   var objValue = object[key];
18252
18253   if (!(hasOwnProperty$1.call(object, key) && eq(objValue, value)) || value === undefined && !(key in object)) {
18254     baseAssignValue$1(object, key, value);
18255   }
18256 }
18257
18258 var _assignValue = assignValue$1;
18259
18260 var assignValue = _assignValue,
18261     castPath$1 = _castPath,
18262     isIndex = _isIndex,
18263     isObject = isObject_1,
18264     toKey = _toKey;
18265 /**
18266  * The base implementation of `_.set`.
18267  *
18268  * @private
18269  * @param {Object} object The object to modify.
18270  * @param {Array|string} path The path of the property to set.
18271  * @param {*} value The value to set.
18272  * @param {Function} [customizer] The function to customize path creation.
18273  * @returns {Object} Returns `object`.
18274  */
18275
18276 function baseSet$1(object, path, value, customizer) {
18277   if (!isObject(object)) {
18278     return object;
18279   }
18280
18281   path = castPath$1(path, object);
18282   var index = -1,
18283       length = path.length,
18284       lastIndex = length - 1,
18285       nested = object;
18286
18287   while (nested != null && ++index < length) {
18288     var key = toKey(path[index]),
18289         newValue = value;
18290
18291     if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
18292       return object;
18293     }
18294
18295     if (index != lastIndex) {
18296       var objValue = nested[key];
18297       newValue = customizer ? customizer(objValue, key, nested) : undefined;
18298
18299       if (newValue === undefined) {
18300         newValue = isObject(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {};
18301       }
18302     }
18303
18304     assignValue(nested, key, newValue);
18305     nested = nested[key];
18306   }
18307
18308   return object;
18309 }
18310
18311 var _baseSet = baseSet$1;
18312
18313 var baseGet = _baseGet,
18314     baseSet = _baseSet,
18315     castPath = _castPath;
18316 /**
18317  * The base implementation of  `_.pickBy` without support for iteratee shorthands.
18318  *
18319  * @private
18320  * @param {Object} object The source object.
18321  * @param {string[]} paths The property paths to pick.
18322  * @param {Function} predicate The function invoked per property.
18323  * @returns {Object} Returns the new object.
18324  */
18325
18326 function basePickBy$1(object, paths, predicate) {
18327   var index = -1,
18328       length = paths.length,
18329       result = {};
18330
18331   while (++index < length) {
18332     var path = paths[index],
18333         value = baseGet(object, path);
18334
18335     if (predicate(value, path)) {
18336       baseSet(result, castPath(path, object), value);
18337     }
18338   }
18339
18340   return result;
18341 }
18342
18343 var _basePickBy = basePickBy$1;
18344
18345 var basePickBy = _basePickBy,
18346     hasIn = hasIn_1;
18347 /**
18348  * The base implementation of `_.pick` without support for individual
18349  * property identifiers.
18350  *
18351  * @private
18352  * @param {Object} object The source object.
18353  * @param {string[]} paths The property paths to pick.
18354  * @returns {Object} Returns the new object.
18355  */
18356
18357 function basePick$1(object, paths) {
18358   return basePickBy(object, paths, function (value, path) {
18359     return hasIn(object, path);
18360   });
18361 }
18362
18363 var _basePick = basePick$1;
18364
18365 var Symbol$1 = _Symbol,
18366     isArguments = isArguments_1,
18367     isArray = isArray_1;
18368 /** Built-in value references. */
18369
18370 var spreadableSymbol = Symbol$1 ? Symbol$1.isConcatSpreadable : undefined;
18371 /**
18372  * Checks if `value` is a flattenable `arguments` object or array.
18373  *
18374  * @private
18375  * @param {*} value The value to check.
18376  * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
18377  */
18378
18379 function isFlattenable$1(value) {
18380   return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
18381 }
18382
18383 var _isFlattenable = isFlattenable$1;
18384
18385 var arrayPush = _arrayPush,
18386     isFlattenable = _isFlattenable;
18387 /**
18388  * The base implementation of `_.flatten` with support for restricting flattening.
18389  *
18390  * @private
18391  * @param {Array} array The array to flatten.
18392  * @param {number} depth The maximum recursion depth.
18393  * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
18394  * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
18395  * @param {Array} [result=[]] The initial result value.
18396  * @returns {Array} Returns the new flattened array.
18397  */
18398
18399 function baseFlatten$1(array, depth, predicate, isStrict, result) {
18400   var index = -1,
18401       length = array.length;
18402   predicate || (predicate = isFlattenable);
18403   result || (result = []);
18404
18405   while (++index < length) {
18406     var value = array[index];
18407
18408     if (depth > 0 && predicate(value)) {
18409       if (depth > 1) {
18410         // Recursively flatten arrays (susceptible to call stack limits).
18411         baseFlatten$1(value, depth - 1, predicate, isStrict, result);
18412       } else {
18413         arrayPush(result, value);
18414       }
18415     } else if (!isStrict) {
18416       result[result.length] = value;
18417     }
18418   }
18419
18420   return result;
18421 }
18422
18423 var _baseFlatten = baseFlatten$1;
18424
18425 var baseFlatten = _baseFlatten;
18426 /**
18427  * Flattens `array` a single level deep.
18428  *
18429  * @static
18430  * @memberOf _
18431  * @since 0.1.0
18432  * @category Array
18433  * @param {Array} array The array to flatten.
18434  * @returns {Array} Returns the new flattened array.
18435  * @example
18436  *
18437  * _.flatten([1, [2, [3, [4]], 5]]);
18438  * // => [1, 2, [3, [4]], 5]
18439  */
18440
18441 function flatten$1(array) {
18442   var length = array == null ? 0 : array.length;
18443   return length ? baseFlatten(array, 1) : [];
18444 }
18445
18446 var flatten_1 = flatten$1;
18447
18448 /**
18449  * A faster alternative to `Function#apply`, this function invokes `func`
18450  * with the `this` binding of `thisArg` and the arguments of `args`.
18451  *
18452  * @private
18453  * @param {Function} func The function to invoke.
18454  * @param {*} thisArg The `this` binding of `func`.
18455  * @param {Array} args The arguments to invoke `func` with.
18456  * @returns {*} Returns the result of `func`.
18457  */
18458
18459 function apply$1(func, thisArg, args) {
18460   switch (args.length) {
18461     case 0:
18462       return func.call(thisArg);
18463
18464     case 1:
18465       return func.call(thisArg, args[0]);
18466
18467     case 2:
18468       return func.call(thisArg, args[0], args[1]);
18469
18470     case 3:
18471       return func.call(thisArg, args[0], args[1], args[2]);
18472   }
18473
18474   return func.apply(thisArg, args);
18475 }
18476
18477 var _apply = apply$1;
18478
18479 var apply = _apply;
18480 /* Built-in method references for those with the same name as other `lodash` methods. */
18481
18482 var nativeMax = Math.max;
18483 /**
18484  * A specialized version of `baseRest` which transforms the rest array.
18485  *
18486  * @private
18487  * @param {Function} func The function to apply a rest parameter to.
18488  * @param {number} [start=func.length-1] The start position of the rest parameter.
18489  * @param {Function} transform The rest array transform.
18490  * @returns {Function} Returns the new function.
18491  */
18492
18493 function overRest$1(func, start, transform) {
18494   start = nativeMax(start === undefined ? func.length - 1 : start, 0);
18495   return function () {
18496     var args = arguments,
18497         index = -1,
18498         length = nativeMax(args.length - start, 0),
18499         array = Array(length);
18500
18501     while (++index < length) {
18502       array[index] = args[start + index];
18503     }
18504
18505     index = -1;
18506     var otherArgs = Array(start + 1);
18507
18508     while (++index < start) {
18509       otherArgs[index] = args[index];
18510     }
18511
18512     otherArgs[start] = transform(array);
18513     return apply(func, this, otherArgs);
18514   };
18515 }
18516
18517 var _overRest = overRest$1;
18518
18519 /**
18520  * Creates a function that returns `value`.
18521  *
18522  * @static
18523  * @memberOf _
18524  * @since 2.4.0
18525  * @category Util
18526  * @param {*} value The value to return from the new function.
18527  * @returns {Function} Returns the new constant function.
18528  * @example
18529  *
18530  * var objects = _.times(2, _.constant({ 'a': 1 }));
18531  *
18532  * console.log(objects);
18533  * // => [{ 'a': 1 }, { 'a': 1 }]
18534  *
18535  * console.log(objects[0] === objects[1]);
18536  * // => true
18537  */
18538
18539 function constant$4(value) {
18540   return function () {
18541     return value;
18542   };
18543 }
18544
18545 var constant_1 = constant$4;
18546
18547 var constant$3 = constant_1,
18548     defineProperty = _defineProperty,
18549     identity = identity_1;
18550 /**
18551  * The base implementation of `setToString` without support for hot loop shorting.
18552  *
18553  * @private
18554  * @param {Function} func The function to modify.
18555  * @param {Function} string The `toString` result.
18556  * @returns {Function} Returns `func`.
18557  */
18558
18559 var baseSetToString$1 = !defineProperty ? identity : function (func, string) {
18560   return defineProperty(func, 'toString', {
18561     'configurable': true,
18562     'enumerable': false,
18563     'value': constant$3(string),
18564     'writable': true
18565   });
18566 };
18567 var _baseSetToString = baseSetToString$1;
18568
18569 /** Used to detect hot functions by number of calls within a span of milliseconds. */
18570 var HOT_COUNT = 800,
18571     HOT_SPAN = 16;
18572 /* Built-in method references for those with the same name as other `lodash` methods. */
18573
18574 var nativeNow = Date.now;
18575 /**
18576  * Creates a function that'll short out and invoke `identity` instead
18577  * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
18578  * milliseconds.
18579  *
18580  * @private
18581  * @param {Function} func The function to restrict.
18582  * @returns {Function} Returns the new shortable function.
18583  */
18584
18585 function shortOut$1(func) {
18586   var count = 0,
18587       lastCalled = 0;
18588   return function () {
18589     var stamp = nativeNow(),
18590         remaining = HOT_SPAN - (stamp - lastCalled);
18591     lastCalled = stamp;
18592
18593     if (remaining > 0) {
18594       if (++count >= HOT_COUNT) {
18595         return arguments[0];
18596       }
18597     } else {
18598       count = 0;
18599     }
18600
18601     return func.apply(undefined, arguments);
18602   };
18603 }
18604
18605 var _shortOut = shortOut$1;
18606
18607 var baseSetToString = _baseSetToString,
18608     shortOut = _shortOut;
18609 /**
18610  * Sets the `toString` method of `func` to return `string`.
18611  *
18612  * @private
18613  * @param {Function} func The function to modify.
18614  * @param {Function} string The `toString` result.
18615  * @returns {Function} Returns `func`.
18616  */
18617
18618 var setToString$1 = shortOut(baseSetToString);
18619 var _setToString = setToString$1;
18620
18621 var flatten = flatten_1,
18622     overRest = _overRest,
18623     setToString = _setToString;
18624 /**
18625  * A specialized version of `baseRest` which flattens the rest array.
18626  *
18627  * @private
18628  * @param {Function} func The function to apply a rest parameter to.
18629  * @returns {Function} Returns the new function.
18630  */
18631
18632 function flatRest$1(func) {
18633   return setToString(overRest(func, undefined, flatten), func + '');
18634 }
18635
18636 var _flatRest = flatRest$1;
18637
18638 var basePick = _basePick,
18639     flatRest = _flatRest;
18640 /**
18641  * Creates an object composed of the picked `object` properties.
18642  *
18643  * @static
18644  * @since 0.1.0
18645  * @memberOf _
18646  * @category Object
18647  * @param {Object} object The source object.
18648  * @param {...(string|string[])} [paths] The property paths to pick.
18649  * @returns {Object} Returns the new object.
18650  * @example
18651  *
18652  * var object = { 'a': 1, 'b': '2', 'c': 3 };
18653  *
18654  * _.pick(object, ['a', 'c']);
18655  * // => { 'a': 1, 'c': 3 }
18656  */
18657
18658 var pick$1 = flatRest(function (object, paths) {
18659   return object == null ? {} : basePick(object, paths);
18660 });
18661 var pick_1 = pick$1;
18662
18663 var lib = {exports: {}};
18664
18665 (function (module, exports) {
18666
18667   Object.defineProperty(exports, "__esModule", {
18668     value: true
18669   });
18670   exports.outdent = void 0; // In the absence of a WeakSet or WeakMap implementation, don't break, but don't cache either.
18671
18672   function noop() {
18673     var args = [];
18674
18675     for (var _i = 0; _i < arguments.length; _i++) {
18676       args[_i] = arguments[_i];
18677     }
18678   }
18679
18680   function createWeakMap() {
18681     if (typeof WeakMap !== "undefined") {
18682       return new WeakMap();
18683     } else {
18684       return fakeSetOrMap();
18685     }
18686   }
18687   /**
18688    * Creates and returns a no-op implementation of a WeakMap / WeakSet that never stores anything.
18689    */
18690
18691
18692   function fakeSetOrMap() {
18693     return {
18694       add: noop,
18695       delete: noop,
18696       get: noop,
18697       set: noop,
18698       has: function (k) {
18699         return false;
18700       }
18701     };
18702   } // Safe hasOwnProperty
18703
18704
18705   var hop = Object.prototype.hasOwnProperty;
18706
18707   var has = function (obj, prop) {
18708     return hop.call(obj, prop);
18709   }; // Copy all own enumerable properties from source to target
18710
18711
18712   function extend(target, source) {
18713     for (var prop in source) {
18714       if (has(source, prop)) {
18715         target[prop] = source[prop];
18716       }
18717     }
18718
18719     return target;
18720   }
18721
18722   var reLeadingNewline = /^[ \t]*(?:\r\n|\r|\n)/;
18723   var reTrailingNewline = /(?:\r\n|\r|\n)[ \t]*$/;
18724   var reStartsWithNewlineOrIsEmpty = /^(?:[\r\n]|$)/;
18725   var reDetectIndentation = /(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/;
18726   var reOnlyWhitespaceWithAtLeastOneNewline = /^[ \t]*[\r\n][ \t\r\n]*$/;
18727
18728   function _outdentArray(strings, firstInterpolatedValueSetsIndentationLevel, options) {
18729     // If first interpolated value is a reference to outdent,
18730     // determine indentation level from the indentation of the interpolated value.
18731     var indentationLevel = 0;
18732     var match = strings[0].match(reDetectIndentation);
18733
18734     if (match) {
18735       indentationLevel = match[1].length;
18736     }
18737
18738     var reSource = "(\\r\\n|\\r|\\n).{0," + indentationLevel + "}";
18739     var reMatchIndent = new RegExp(reSource, "g");
18740
18741     if (firstInterpolatedValueSetsIndentationLevel) {
18742       strings = strings.slice(1);
18743     }
18744
18745     var newline = options.newline,
18746         trimLeadingNewline = options.trimLeadingNewline,
18747         trimTrailingNewline = options.trimTrailingNewline;
18748     var normalizeNewlines = typeof newline === "string";
18749     var l = strings.length;
18750     var outdentedStrings = strings.map(function (v, i) {
18751       // Remove leading indentation from all lines
18752       v = v.replace(reMatchIndent, "$1"); // Trim a leading newline from the first string
18753
18754       if (i === 0 && trimLeadingNewline) {
18755         v = v.replace(reLeadingNewline, "");
18756       } // Trim a trailing newline from the last string
18757
18758
18759       if (i === l - 1 && trimTrailingNewline) {
18760         v = v.replace(reTrailingNewline, "");
18761       } // Normalize newlines
18762
18763
18764       if (normalizeNewlines) {
18765         v = v.replace(/\r\n|\n|\r/g, function (_) {
18766           return newline;
18767         });
18768       }
18769
18770       return v;
18771     });
18772     return outdentedStrings;
18773   }
18774
18775   function concatStringsAndValues(strings, values) {
18776     var ret = "";
18777
18778     for (var i = 0, l = strings.length; i < l; i++) {
18779       ret += strings[i];
18780
18781       if (i < l - 1) {
18782         ret += values[i];
18783       }
18784     }
18785
18786     return ret;
18787   }
18788
18789   function isTemplateStringsArray(v) {
18790     return has(v, "raw") && has(v, "length");
18791   }
18792   /**
18793    * It is assumed that opts will not change.  If this is a problem, clone your options object and pass the clone to
18794    * makeInstance
18795    * @param options
18796    * @return {outdent}
18797    */
18798
18799
18800   function createInstance(options) {
18801     /** Cache of pre-processed template literal arrays */
18802     var arrayAutoIndentCache = createWeakMap();
18803     /**
18804        * Cache of pre-processed template literal arrays, where first interpolated value is a reference to outdent,
18805        * before interpolated values are injected.
18806        */
18807
18808     var arrayFirstInterpSetsIndentCache = createWeakMap();
18809
18810     function outdent(stringsOrOptions) {
18811       var values = [];
18812
18813       for (var _i = 1; _i < arguments.length; _i++) {
18814         values[_i - 1] = arguments[_i];
18815       }
18816       /* tslint:enable:no-shadowed-variable */
18817
18818
18819       if (isTemplateStringsArray(stringsOrOptions)) {
18820         var strings = stringsOrOptions; // Is first interpolated value a reference to outdent, alone on its own line, without any preceding non-whitespace?
18821
18822         var firstInterpolatedValueSetsIndentationLevel = (values[0] === outdent || values[0] === defaultOutdent) && reOnlyWhitespaceWithAtLeastOneNewline.test(strings[0]) && reStartsWithNewlineOrIsEmpty.test(strings[1]); // Perform outdentation
18823
18824         var cache = firstInterpolatedValueSetsIndentationLevel ? arrayFirstInterpSetsIndentCache : arrayAutoIndentCache;
18825         var renderedArray = cache.get(strings);
18826
18827         if (!renderedArray) {
18828           renderedArray = _outdentArray(strings, firstInterpolatedValueSetsIndentationLevel, options);
18829           cache.set(strings, renderedArray);
18830         }
18831         /** If no interpolated values, skip concatenation step */
18832
18833
18834         if (values.length === 0) {
18835           return renderedArray[0];
18836         }
18837         /** Concatenate string literals with interpolated values */
18838
18839
18840         var rendered = concatStringsAndValues(renderedArray, firstInterpolatedValueSetsIndentationLevel ? values.slice(1) : values);
18841         return rendered;
18842       } else {
18843         // Create and return a new instance of outdent with the given options
18844         return createInstance(extend(extend({}, options), stringsOrOptions || {}));
18845       }
18846     }
18847
18848     var fullOutdent = extend(outdent, {
18849       string: function (str) {
18850         return _outdentArray([str], false, options)[0];
18851       }
18852     });
18853     return fullOutdent;
18854   }
18855
18856   var defaultOutdent = createInstance({
18857     trimLeadingNewline: true,
18858     trimTrailingNewline: true
18859   });
18860   exports.outdent = defaultOutdent; // Named exports.  Simple and preferred.
18861   // import outdent from 'outdent';
18862
18863   exports.default = defaultOutdent;
18864
18865   {
18866     // In webpack harmony-modules environments, module.exports is read-only,
18867     // so we fail gracefully.
18868     try {
18869       module.exports = defaultOutdent;
18870       Object.defineProperty(defaultOutdent, "__esModule", {
18871         value: true
18872       });
18873       defaultOutdent.default = defaultOutdent;
18874       defaultOutdent.outdent = defaultOutdent;
18875     } catch (e) {}
18876   }
18877 })(lib, lib.exports);
18878
18879 const {
18880   outdent
18881 } = lib.exports;
18882 const {
18883   coreOptions: coreOptions$1
18884 } = prettierInternal;
18885 const categoryOrder = [coreOptions$1.CATEGORY_OUTPUT, coreOptions$1.CATEGORY_FORMAT, coreOptions$1.CATEGORY_CONFIG, coreOptions$1.CATEGORY_EDITOR, coreOptions$1.CATEGORY_OTHER];
18886 /**
18887  * {
18888  *   [optionName]: {
18889  *     // The type of the option. For 'choice', see also `choices` below.
18890  *     // When passing a type other than the ones listed below, the option is
18891  *     // treated as taking any string as argument, and `--option <${type}>` will
18892  *     // be displayed in --help.
18893  *     type: "boolean" | "choice" | "int" | string;
18894  *
18895  *     // Default value to be passed to the minimist option `default`.
18896  *     default?: any;
18897  *
18898  *     // Alias name to be passed to the minimist option `alias`.
18899  *     alias?: string;
18900  *
18901  *     // For grouping options by category in --help.
18902  *     category?: string;
18903  *
18904  *     // Description to be displayed in --help. If omitted, the option won't be
18905  *     // shown at all in --help (but see also `oppositeDescription` below).
18906  *     description?: string;
18907  *
18908  *     // Description for `--no-${name}` to be displayed in --help. If omitted,
18909  *     // `--no-${name}` won't be shown.
18910  *     oppositeDescription?: string;
18911  *
18912  *     // Indicate if this option is simply passed to the API.
18913  *     // true: use camelified name as the API option name.
18914  *     // string: use this value as the API option name.
18915  *     forwardToApi?: boolean | string;
18916  *
18917  *     // Indicate that a CLI flag should be an array when forwarded to the API.
18918  *     array?: boolean;
18919  *
18920  *     // Specify available choices for validation. They will also be displayed
18921  *     // in --help as <a|b|c>.
18922  *     // Use an object instead of a string if a choice is deprecated and should
18923  *     // be treated as `redirect` instead, or if you'd like to add description for
18924  *     // the choice.
18925  *     choices?: Array<
18926  *       | string
18927  *       | { value: string, description?: string, deprecated?: boolean, redirect?: string }
18928  *     >;
18929  *
18930  *     // If the option has a value that is an exception to the regular value
18931  *     // constraints, indicate that value here (or use a function for more
18932  *     // flexibility).
18933  *     exception?: ((value: any) => boolean);
18934  *
18935  *     // Indicate that the option is deprecated. Use a string to add an extra
18936  *     // message to --help for the option, for example to suggest a replacement
18937  *     // option.
18938  *     deprecated?: true | string;
18939  *   }
18940  * }
18941  *
18942  * Note: The options below are sorted alphabetically.
18943  */
18944
18945 const options = {
18946   check: {
18947     type: "boolean",
18948     category: coreOptions$1.CATEGORY_OUTPUT,
18949     alias: "c",
18950     description: outdent`
18951       Check if the given files are formatted, print a human-friendly summary
18952       message and paths to unformatted files (see also --list-different).
18953     `
18954   },
18955   color: {
18956     // The supports-color package (a sub sub dependency) looks directly at
18957     // `process.argv` for `--no-color` and such-like options. The reason it is
18958     // listed here is to avoid "Ignored unknown option: --no-color" warnings.
18959     // See https://github.com/chalk/supports-color/#info for more information.
18960     type: "boolean",
18961     default: true,
18962     description: "Colorize error messages.",
18963     oppositeDescription: "Do not colorize error messages."
18964   },
18965   config: {
18966     type: "path",
18967     category: coreOptions$1.CATEGORY_CONFIG,
18968     description: "Path to a Prettier configuration file (.prettierrc, package.json, prettier.config.js).",
18969     oppositeDescription: "Do not look for a configuration file.",
18970     exception: value => value === false
18971   },
18972   "config-precedence": {
18973     type: "choice",
18974     category: coreOptions$1.CATEGORY_CONFIG,
18975     default: "cli-override",
18976     choices: [{
18977       value: "cli-override",
18978       description: "CLI options take precedence over config file"
18979     }, {
18980       value: "file-override",
18981       description: "Config file take precedence over CLI options"
18982     }, {
18983       value: "prefer-file",
18984       description: outdent`
18985           If a config file is found will evaluate it and ignore other CLI options.
18986           If no config file is found CLI options will evaluate as normal.
18987         `
18988     }],
18989     description: "Define in which order config files and CLI options should be evaluated."
18990   },
18991   "debug-benchmark": {
18992     // Run the formatting benchmarks. Requires 'benchmark' module to be installed.
18993     type: "boolean"
18994   },
18995   "debug-check": {
18996     // Run the formatting once again on the formatted output, throw if different.
18997     type: "boolean"
18998   },
18999   "debug-print-doc": {
19000     type: "boolean"
19001   },
19002   "debug-print-comments": {
19003     type: "boolean"
19004   },
19005   "debug-print-ast": {
19006     type: "boolean"
19007   },
19008   "debug-repeat": {
19009     // Repeat the formatting a few times and measure the average duration.
19010     type: "int",
19011     default: 0
19012   },
19013   editorconfig: {
19014     type: "boolean",
19015     category: coreOptions$1.CATEGORY_CONFIG,
19016     description: "Take .editorconfig into account when parsing configuration.",
19017     oppositeDescription: "Don't take .editorconfig into account when parsing configuration.",
19018     default: true
19019   },
19020   "error-on-unmatched-pattern": {
19021     type: "boolean",
19022     oppositeDescription: "Prevent errors when pattern is unmatched."
19023   },
19024   "find-config-path": {
19025     type: "path",
19026     category: coreOptions$1.CATEGORY_CONFIG,
19027     description: "Find and print the path to a configuration file for the given input file."
19028   },
19029   "file-info": {
19030     type: "path",
19031     description: outdent`
19032       Extract the following info (as JSON) for a given file path. Reported fields:
19033       * ignored (boolean) - true if file path is filtered by --ignore-path
19034       * inferredParser (string | null) - name of parser inferred from file path
19035     `
19036   },
19037   help: {
19038     type: "flag",
19039     alias: "h",
19040     description: outdent`
19041       Show CLI usage, or details about the given flag.
19042       Example: --help write
19043     `,
19044     exception: value => value === ""
19045   },
19046   "ignore-path": {
19047     type: "path",
19048     category: coreOptions$1.CATEGORY_CONFIG,
19049     default: ".prettierignore",
19050     description: "Path to a file with patterns describing files to ignore."
19051   },
19052   "ignore-unknown": {
19053     type: "boolean",
19054     alias: "u",
19055     description: "Ignore unknown files."
19056   },
19057   "list-different": {
19058     type: "boolean",
19059     category: coreOptions$1.CATEGORY_OUTPUT,
19060     alias: "l",
19061     description: "Print the names of files that are different from Prettier's formatting (see also --check)."
19062   },
19063   loglevel: {
19064     type: "choice",
19065     description: "What level of logs to report.",
19066     default: "log",
19067     choices: ["silent", "error", "warn", "log", "debug"]
19068   },
19069   "support-info": {
19070     type: "boolean",
19071     description: "Print support information as JSON."
19072   },
19073   version: {
19074     type: "boolean",
19075     alias: "v",
19076     description: "Print Prettier version."
19077   },
19078   "with-node-modules": {
19079     type: "boolean",
19080     category: coreOptions$1.CATEGORY_CONFIG,
19081     description: "Process files inside 'node_modules' directory."
19082   },
19083   write: {
19084     type: "boolean",
19085     alias: "w",
19086     category: coreOptions$1.CATEGORY_OUTPUT,
19087     description: "Edit files in-place. (Beware!)"
19088   }
19089 };
19090 const usageSummary = outdent`
19091   Usage: prettier [options] [file/dir/glob ...]
19092
19093   By default, output is written to stdout.
19094   Stdin is read if it is piped to Prettier and no files are given.
19095 `;
19096 var constant$2 = {
19097   categoryOrder,
19098   options,
19099   usageSummary
19100 };
19101
19102 const dashify = dashify$2;
19103 const {
19104   coreOptions
19105 } = prettierInternal;
19106
19107 function normalizeDetailedOption(name, option) {
19108   return Object.assign(Object.assign({
19109     category: coreOptions.CATEGORY_OTHER
19110   }, option), {}, {
19111     choices: option.choices && option.choices.map(choice => {
19112       const newChoice = Object.assign({
19113         description: "",
19114         deprecated: false
19115       }, typeof choice === "object" ? choice : {
19116         value: choice
19117       });
19118       /* istanbul ignore next */
19119
19120       if (newChoice.value === true) {
19121         newChoice.value = ""; // backward compatibility for original boolean option
19122       }
19123
19124       return newChoice;
19125     })
19126   });
19127 }
19128
19129 function normalizeDetailedOptionMap$2(detailedOptionMap) {
19130   return Object.fromEntries(Object.entries(detailedOptionMap).sort(([leftName], [rightName]) => leftName.localeCompare(rightName)).map(([name, option]) => [name, normalizeDetailedOption(name, option)]));
19131 }
19132
19133 function createDetailedOptionMap$2(supportOptions) {
19134   return Object.fromEntries(supportOptions.map(option => {
19135     const newOption = Object.assign(Object.assign({}, option), {}, {
19136       name: option.cliName || dashify(option.name),
19137       description: option.cliDescription || option.description,
19138       category: option.cliCategory || coreOptions.CATEGORY_FORMAT,
19139       forwardToApi: option.name
19140     });
19141     /* istanbul ignore next */
19142
19143     if (option.deprecated) {
19144       delete newOption.forwardToApi;
19145       delete newOption.description;
19146       delete newOption.oppositeDescription;
19147       newOption.deprecated = true;
19148     }
19149
19150     return [newOption.name, newOption];
19151   }));
19152 }
19153
19154 var optionMap = {
19155   normalizeDetailedOptionMap: normalizeDetailedOptionMap$2,
19156   createDetailedOptionMap: createDetailedOptionMap$2
19157 };
19158
19159 const pick = pick_1; // eslint-disable-next-line no-restricted-modules
19160
19161 const prettier$3 = require$$3;
19162 const {
19163   optionsModule,
19164   optionsNormalizer: {
19165     normalizeCliOptions
19166   },
19167   utils: {
19168     arrayify
19169   }
19170 } = prettierInternal;
19171 const minimist = minimist_1;
19172 const constant$1 = constant$2;
19173 const {
19174   createDetailedOptionMap: createDetailedOptionMap$1,
19175   normalizeDetailedOptionMap: normalizeDetailedOptionMap$1
19176 } = optionMap;
19177 const createMinimistOptions = createMinimistOptions$2;
19178 /**
19179  * @typedef {Object} Context
19180  * @property logger
19181  * @property {string[]} rawArguments
19182  * @property argv
19183  * @property {string[]} filePatterns
19184  * @property {any[]} supportOptions
19185  * @property detailedOptions
19186  * @property detailedOptionMap
19187  * @property apiDefaultOptions
19188  * @property languages
19189  * @property {Partial<Context>[]} stack
19190  * @property pushContextPlugins
19191  * @property popContextPlugins
19192  */
19193
19194 class Context$1 {
19195   constructor({
19196     rawArguments,
19197     logger
19198   }) {
19199     this.rawArguments = rawArguments;
19200     this.logger = logger;
19201     this.stack = [];
19202     const {
19203       plugin: plugins,
19204       "plugin-search-dir": pluginSearchDirs
19205     } = parseArgvWithoutPlugins$1(rawArguments, logger, ["plugin", "plugin-search-dir"]);
19206     this.pushContextPlugins(plugins, pluginSearchDirs);
19207     const argv = parseArgv(rawArguments, this.detailedOptions, logger);
19208     this.argv = argv;
19209     this.filePatterns = argv._.map(file => String(file));
19210   }
19211   /**
19212    * @param {string[]} plugins
19213    * @param {string[]=} pluginSearchDirs
19214    */
19215
19216
19217   pushContextPlugins(plugins, pluginSearchDirs) {
19218     this.stack.push(pick(this, ["supportOptions", "detailedOptions", "detailedOptionMap", "apiDefaultOptions", "languages"]));
19219     Object.assign(this, getContextOptions(plugins, pluginSearchDirs));
19220   }
19221
19222   popContextPlugins() {
19223     Object.assign(this, this.stack.pop());
19224   }
19225
19226 }
19227
19228 function getContextOptions(plugins, pluginSearchDirs) {
19229   const {
19230     options: supportOptions,
19231     languages
19232   } = prettier$3.getSupportInfo({
19233     showDeprecated: true,
19234     showUnreleased: true,
19235     showInternal: true,
19236     plugins,
19237     pluginSearchDirs
19238   });
19239   const detailedOptionMap = normalizeDetailedOptionMap$1(Object.assign(Object.assign({}, createDetailedOptionMap$1(supportOptions)), constant$1.options));
19240   const detailedOptions = arrayify(detailedOptionMap, "name");
19241   const apiDefaultOptions = Object.assign(Object.assign({}, optionsModule.hiddenDefaults), Object.fromEntries(supportOptions.filter(({
19242     deprecated
19243   }) => !deprecated).map(option => [option.name, option.default])));
19244   return {
19245     supportOptions,
19246     detailedOptions,
19247     detailedOptionMap,
19248     apiDefaultOptions,
19249     languages
19250   };
19251 }
19252
19253 function parseArgv(rawArguments, detailedOptions, logger, keys) {
19254   const minimistOptions = createMinimistOptions(detailedOptions);
19255   let argv = minimist(rawArguments, minimistOptions);
19256
19257   if (keys) {
19258     detailedOptions = detailedOptions.filter(option => keys.includes(option.name));
19259     argv = pick(argv, keys);
19260   }
19261
19262   return normalizeCliOptions(argv, detailedOptions, {
19263     logger
19264   });
19265 }
19266
19267 const detailedOptionsWithoutPlugins = getContextOptions().detailedOptions;
19268
19269 function parseArgvWithoutPlugins$1(rawArguments, logger, keys) {
19270   return parseArgv(rawArguments, detailedOptionsWithoutPlugins, logger, typeof keys === "string" ? [keys] : keys);
19271 }
19272
19273 var context = {
19274   Context: Context$1,
19275   parseArgvWithoutPlugins: parseArgvWithoutPlugins$1
19276 };
19277
19278 var $ = _export;
19279 var flattenIntoArray = flattenIntoArray_1;
19280 var toObject = toObject$4;
19281 var lengthOfArrayLike = lengthOfArrayLike$6;
19282 var toIntegerOrInfinity = toIntegerOrInfinity$3;
19283 var arraySpeciesCreate = arraySpeciesCreate$2;
19284
19285 // `Array.prototype.flat` method
19286 // https://tc39.es/ecma262/#sec-array.prototype.flat
19287 $({ target: 'Array', proto: true }, {
19288   flat: function flat(/* depthArg = 1 */) {
19289     var depthArg = arguments.length ? arguments[0] : undefined;
19290     var O = toObject(this);
19291     var sourceLen = lengthOfArrayLike(O);
19292     var A = arraySpeciesCreate(O, 0);
19293     A.length = flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toIntegerOrInfinity(depthArg));
19294     return A;
19295   }
19296 });
19297
19298 var internalObjectKeys = objectKeysInternal;
19299 var enumBugKeys$1 = enumBugKeys$3;
19300
19301 // `Object.keys` method
19302 // https://tc39.es/ecma262/#sec-object.keys
19303 // eslint-disable-next-line es/no-object-keys -- safe
19304 var objectKeys$1 = Object.keys || function keys(O) {
19305   return internalObjectKeys(O, enumBugKeys$1);
19306 };
19307
19308 var DESCRIPTORS = descriptors;
19309 var definePropertyModule$1 = objectDefineProperty;
19310 var anObject$1 = anObject$7;
19311 var toIndexedObject = toIndexedObject$4;
19312 var objectKeys = objectKeys$1;
19313
19314 // `Object.defineProperties` method
19315 // https://tc39.es/ecma262/#sec-object.defineproperties
19316 // eslint-disable-next-line es/no-object-defineproperties -- safe
19317 var objectDefineProperties = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {
19318   anObject$1(O);
19319   var props = toIndexedObject(Properties);
19320   var keys = objectKeys(Properties);
19321   var length = keys.length;
19322   var index = 0;
19323   var key;
19324   while (length > index) definePropertyModule$1.f(O, key = keys[index++], props[key]);
19325   return O;
19326 };
19327
19328 var getBuiltIn = getBuiltIn$5;
19329
19330 var html$1 = getBuiltIn('document', 'documentElement');
19331
19332 /* global ActiveXObject -- old IE, WSH */
19333
19334 var anObject = anObject$7;
19335 var defineProperties = objectDefineProperties;
19336 var enumBugKeys = enumBugKeys$3;
19337 var hiddenKeys = hiddenKeys$4;
19338 var html = html$1;
19339 var documentCreateElement = documentCreateElement$1;
19340 var sharedKey = sharedKey$2;
19341
19342 var GT = '>';
19343 var LT = '<';
19344 var PROTOTYPE = 'prototype';
19345 var SCRIPT = 'script';
19346 var IE_PROTO = sharedKey('IE_PROTO');
19347
19348 var EmptyConstructor = function () { /* empty */ };
19349
19350 var scriptTag = function (content) {
19351   return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
19352 };
19353
19354 // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
19355 var NullProtoObjectViaActiveX = function (activeXDocument) {
19356   activeXDocument.write(scriptTag(''));
19357   activeXDocument.close();
19358   var temp = activeXDocument.parentWindow.Object;
19359   activeXDocument = null; // avoid memory leak
19360   return temp;
19361 };
19362
19363 // Create object with fake `null` prototype: use iframe Object with cleared prototype
19364 var NullProtoObjectViaIFrame = function () {
19365   // Thrash, waste and sodomy: IE GC bug
19366   var iframe = documentCreateElement('iframe');
19367   var JS = 'java' + SCRIPT + ':';
19368   var iframeDocument;
19369   iframe.style.display = 'none';
19370   html.appendChild(iframe);
19371   // https://github.com/zloirock/core-js/issues/475
19372   iframe.src = String(JS);
19373   iframeDocument = iframe.contentWindow.document;
19374   iframeDocument.open();
19375   iframeDocument.write(scriptTag('document.F=Object'));
19376   iframeDocument.close();
19377   return iframeDocument.F;
19378 };
19379
19380 // Check for document.domain and active x support
19381 // No need to use active x approach when document.domain is not set
19382 // see https://github.com/es-shims/es5-shim/issues/150
19383 // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
19384 // avoid IE GC bug
19385 var activeXDocument;
19386 var NullProtoObject = function () {
19387   try {
19388     activeXDocument = new ActiveXObject('htmlfile');
19389   } catch (error) { /* ignore */ }
19390   NullProtoObject = typeof document != 'undefined'
19391     ? document.domain && activeXDocument
19392       ? NullProtoObjectViaActiveX(activeXDocument) // old IE
19393       : NullProtoObjectViaIFrame()
19394     : NullProtoObjectViaActiveX(activeXDocument); // WSH
19395   var length = enumBugKeys.length;
19396   while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
19397   return NullProtoObject();
19398 };
19399
19400 hiddenKeys[IE_PROTO] = true;
19401
19402 // `Object.create` method
19403 // https://tc39.es/ecma262/#sec-object.create
19404 var objectCreate = Object.create || function create(O, Properties) {
19405   var result;
19406   if (O !== null) {
19407     EmptyConstructor[PROTOTYPE] = anObject(O);
19408     result = new EmptyConstructor();
19409     EmptyConstructor[PROTOTYPE] = null;
19410     // add "__proto__" for Object.getPrototypeOf polyfill
19411     result[IE_PROTO] = O;
19412   } else result = NullProtoObject();
19413   return Properties === undefined ? result : defineProperties(result, Properties);
19414 };
19415
19416 var wellKnownSymbol = wellKnownSymbol$7;
19417 var create = objectCreate;
19418 var definePropertyModule = objectDefineProperty;
19419
19420 var UNSCOPABLES = wellKnownSymbol('unscopables');
19421 var ArrayPrototype = Array.prototype;
19422
19423 // Array.prototype[@@unscopables]
19424 // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
19425 if (ArrayPrototype[UNSCOPABLES] == undefined) {
19426   definePropertyModule.f(ArrayPrototype, UNSCOPABLES, {
19427     configurable: true,
19428     value: create(null)
19429   });
19430 }
19431
19432 // add a key to Array.prototype[@@unscopables]
19433 var addToUnscopables$1 = function (key) {
19434   ArrayPrototype[UNSCOPABLES][key] = true;
19435 };
19436
19437 // this method was added to unscopables after implementation
19438 // in popular engines, so it's moved to a separate module
19439 var addToUnscopables = addToUnscopables$1;
19440
19441 // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
19442 addToUnscopables('flat');
19443
19444 var baseAssignValue = _baseAssignValue,
19445     createAggregator = _createAggregator;
19446 /** Used for built-in method references. */
19447
19448 var objectProto = Object.prototype;
19449 /** Used to check objects for own properties. */
19450
19451 var hasOwnProperty = objectProto.hasOwnProperty;
19452 /**
19453  * Creates an object composed of keys generated from the results of running
19454  * each element of `collection` thru `iteratee`. The order of grouped values
19455  * is determined by the order they occur in `collection`. The corresponding
19456  * value of each key is an array of elements responsible for generating the
19457  * key. The iteratee is invoked with one argument: (value).
19458  *
19459  * @static
19460  * @memberOf _
19461  * @since 0.1.0
19462  * @category Collection
19463  * @param {Array|Object} collection The collection to iterate over.
19464  * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
19465  * @returns {Object} Returns the composed aggregate object.
19466  * @example
19467  *
19468  * _.groupBy([6.1, 4.2, 6.3], Math.floor);
19469  * // => { '4': [4.2], '6': [6.1, 6.3] }
19470  *
19471  * // The `_.property` iteratee shorthand.
19472  * _.groupBy(['one', 'two', 'three'], 'length');
19473  * // => { '3': ['one', 'two'], '5': ['three'] }
19474  */
19475
19476 var groupBy$1 = createAggregator(function (result, value, key) {
19477   if (hasOwnProperty.call(result, key)) {
19478     result[key].push(value);
19479   } else {
19480     baseAssignValue(result, key, [value]);
19481   }
19482 });
19483 var groupBy_1 = groupBy$1;
19484
19485 var camelcase = {exports: {}};
19486
19487 const UPPERCASE = /[\p{Lu}]/u;
19488 const LOWERCASE = /[\p{Ll}]/u;
19489 const LEADING_CAPITAL = /^[\p{Lu}](?![\p{Lu}])/gu;
19490 const IDENTIFIER = /([\p{Alpha}\p{N}_]|$)/u;
19491 const SEPARATORS = /[_.\- ]+/;
19492 const LEADING_SEPARATORS = new RegExp('^' + SEPARATORS.source);
19493 const SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source, 'gu');
19494 const NUMBERS_AND_IDENTIFIER = new RegExp('\\d+' + IDENTIFIER.source, 'gu');
19495
19496 const preserveCamelCase = (string, locale) => {
19497   let isLastCharLower = false;
19498   let isLastCharUpper = false;
19499   let isLastLastCharUpper = false;
19500
19501   for (let i = 0; i < string.length; i++) {
19502     const character = string[i];
19503
19504     if (isLastCharLower && UPPERCASE.test(character)) {
19505       string = string.slice(0, i) + '-' + string.slice(i);
19506       isLastCharLower = false;
19507       isLastLastCharUpper = isLastCharUpper;
19508       isLastCharUpper = true;
19509       i++;
19510     } else if (isLastCharUpper && isLastLastCharUpper && LOWERCASE.test(character)) {
19511       string = string.slice(0, i - 1) + '-' + string.slice(i - 1);
19512       isLastLastCharUpper = isLastCharUpper;
19513       isLastCharUpper = false;
19514       isLastCharLower = true;
19515     } else {
19516       isLastCharLower = character.toLocaleLowerCase(locale) === character && character.toLocaleUpperCase(locale) !== character;
19517       isLastLastCharUpper = isLastCharUpper;
19518       isLastCharUpper = character.toLocaleUpperCase(locale) === character && character.toLocaleLowerCase(locale) !== character;
19519     }
19520   }
19521
19522   return string;
19523 };
19524
19525 const preserveConsecutiveUppercase = input => {
19526   LEADING_CAPITAL.lastIndex = 0;
19527   return input.replace(LEADING_CAPITAL, m1 => m1.toLowerCase());
19528 };
19529
19530 const postProcess = (input, options) => {
19531   SEPARATORS_AND_IDENTIFIER.lastIndex = 0;
19532   NUMBERS_AND_IDENTIFIER.lastIndex = 0;
19533   return input.replace(SEPARATORS_AND_IDENTIFIER, (_, identifier) => identifier.toLocaleUpperCase(options.locale)).replace(NUMBERS_AND_IDENTIFIER, m => m.toLocaleUpperCase(options.locale));
19534 };
19535
19536 const camelCase$1 = (input, options) => {
19537   if (!(typeof input === 'string' || Array.isArray(input))) {
19538     throw new TypeError('Expected the input to be `string | string[]`');
19539   }
19540
19541   options = Object.assign({
19542     pascalCase: false,
19543     preserveConsecutiveUppercase: false
19544   }, options);
19545
19546   if (Array.isArray(input)) {
19547     input = input.map(x => x.trim()).filter(x => x.length).join('-');
19548   } else {
19549     input = input.trim();
19550   }
19551
19552   if (input.length === 0) {
19553     return '';
19554   }
19555
19556   if (input.length === 1) {
19557     return options.pascalCase ? input.toLocaleUpperCase(options.locale) : input.toLocaleLowerCase(options.locale);
19558   }
19559
19560   const hasUpperCase = input !== input.toLocaleLowerCase(options.locale);
19561
19562   if (hasUpperCase) {
19563     input = preserveCamelCase(input, options.locale);
19564   }
19565
19566   input = input.replace(LEADING_SEPARATORS, '');
19567
19568   if (options.preserveConsecutiveUppercase) {
19569     input = preserveConsecutiveUppercase(input);
19570   } else {
19571     input = input.toLocaleLowerCase();
19572   }
19573
19574   if (options.pascalCase) {
19575     input = input.charAt(0).toLocaleUpperCase(options.locale) + input.slice(1);
19576   }
19577
19578   return postProcess(input, options);
19579 };
19580
19581 camelcase.exports = camelCase$1; // TODO: Remove this for the next major release
19582
19583 camelcase.exports.default = camelCase$1;
19584
19585 const groupBy = groupBy_1;
19586 const camelCase = camelcase.exports;
19587 const constant = constant$2;
19588 const OPTION_USAGE_THRESHOLD = 25;
19589 const CHOICE_USAGE_MARGIN = 3;
19590 const CHOICE_USAGE_INDENTATION = 2;
19591
19592 function indent(str, spaces) {
19593   return str.replace(/^/gm, " ".repeat(spaces));
19594 }
19595
19596 function createDefaultValueDisplay(value) {
19597   return Array.isArray(value) ? `[${value.map(createDefaultValueDisplay).join(", ")}]` : value;
19598 }
19599
19600 function getOptionDefaultValue(context, optionName) {
19601   // --no-option
19602   if (!(optionName in context.detailedOptionMap)) {
19603     return;
19604   }
19605
19606   const option = context.detailedOptionMap[optionName];
19607
19608   if (option.default !== undefined) {
19609     return option.default;
19610   }
19611
19612   const optionCamelName = camelCase(optionName);
19613
19614   if (optionCamelName in context.apiDefaultOptions) {
19615     return context.apiDefaultOptions[optionCamelName];
19616   }
19617 }
19618
19619 function createOptionUsageHeader(option) {
19620   const name = `--${option.name}`;
19621   const alias = option.alias ? `-${option.alias},` : null;
19622   const type = createOptionUsageType(option);
19623   return [alias, name, type].filter(Boolean).join(" ");
19624 }
19625
19626 function createOptionUsageRow(header, content, threshold) {
19627   const separator = header.length >= threshold ? `\n${" ".repeat(threshold)}` : " ".repeat(threshold - header.length);
19628   const description = content.replace(/\n/g, `\n${" ".repeat(threshold)}`);
19629   return `${header}${separator}${description}`;
19630 }
19631
19632 function createOptionUsageType(option) {
19633   switch (option.type) {
19634     case "boolean":
19635       return null;
19636
19637     case "choice":
19638       return `<${option.choices.filter(choice => !choice.deprecated && choice.since !== null).map(choice => choice.value).join("|")}>`;
19639
19640     default:
19641       return `<${option.type}>`;
19642   }
19643 }
19644
19645 function createChoiceUsages(choices, margin, indentation) {
19646   const activeChoices = choices.filter(choice => !choice.deprecated && choice.since !== null);
19647   const threshold = Math.max(0, ...activeChoices.map(choice => choice.value.length)) + margin;
19648   return activeChoices.map(choice => indent(createOptionUsageRow(choice.value, choice.description, threshold), indentation));
19649 }
19650
19651 function createOptionUsage(context, option, threshold) {
19652   const header = createOptionUsageHeader(option);
19653   const optionDefaultValue = getOptionDefaultValue(context, option.name);
19654   return createOptionUsageRow(header, `${option.description}${optionDefaultValue === undefined ? "" : `\nDefaults to ${createDefaultValueDisplay(optionDefaultValue)}.`}`, threshold);
19655 }
19656
19657 function getOptionsWithOpposites(options) {
19658   // Add --no-foo after --foo.
19659   const optionsWithOpposites = options.map(option => [option.description ? option : null, option.oppositeDescription ? Object.assign(Object.assign({}, option), {}, {
19660     name: `no-${option.name}`,
19661     type: "boolean",
19662     description: option.oppositeDescription
19663   }) : null]);
19664   return optionsWithOpposites.flat().filter(Boolean);
19665 }
19666
19667 function createUsage$1(context) {
19668   const options = getOptionsWithOpposites(context.detailedOptions).filter( // remove unnecessary option (e.g. `semi`, `color`, etc.), which is only used for --help <flag>
19669   option => !(option.type === "boolean" && option.oppositeDescription && !option.name.startsWith("no-")));
19670   const groupedOptions = groupBy(options, option => option.category);
19671   const firstCategories = constant.categoryOrder.slice(0, -1);
19672   const lastCategories = constant.categoryOrder.slice(-1);
19673   const restCategories = Object.keys(groupedOptions).filter(category => !constant.categoryOrder.includes(category));
19674   const allCategories = [...firstCategories, ...restCategories, ...lastCategories];
19675   const optionsUsage = allCategories.map(category => {
19676     const categoryOptions = groupedOptions[category].map(option => createOptionUsage(context, option, OPTION_USAGE_THRESHOLD)).join("\n");
19677     return `${category} options:\n\n${indent(categoryOptions, 2)}`;
19678   });
19679   return [constant.usageSummary, ...optionsUsage, ""].join("\n\n");
19680 }
19681
19682 function createDetailedUsage$1(context, flag) {
19683   const option = getOptionsWithOpposites(context.detailedOptions).find(option => option.name === flag || option.alias === flag);
19684   const header = createOptionUsageHeader(option);
19685   const description = `\n\n${indent(option.description, 2)}`;
19686   const choices = option.type !== "choice" ? "" : `\n\nValid options:\n\n${createChoiceUsages(option.choices, CHOICE_USAGE_MARGIN, CHOICE_USAGE_INDENTATION).join("\n")}`;
19687   const optionDefaultValue = getOptionDefaultValue(context, option.name);
19688   const defaults = optionDefaultValue !== undefined ? `\n\nDefault: ${createDefaultValueDisplay(optionDefaultValue)}` : "";
19689   const pluginDefaults = option.pluginDefaults && Object.keys(option.pluginDefaults).length > 0 ? `\nPlugin defaults:${Object.entries(option.pluginDefaults).map(([key, value]) => `\n* ${key}: ${createDefaultValueDisplay(value)}`)}` : "";
19690   return `${header}${description}${choices}${defaults}${pluginDefaults}`;
19691 }
19692
19693 var usage = {
19694   createUsage: createUsage$1,
19695   createDetailedUsage: createDetailedUsage$1
19696 };
19697
19698 var ansiRegex$1 = ({
19699   onlyFirst = false
19700 } = {}) => {
19701   const pattern = ['[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))'].join('|');
19702   return new RegExp(pattern, onlyFirst ? undefined : 'g');
19703 };
19704
19705 const ansiRegex = ansiRegex$1;
19706
19707 var stripAnsi$1 = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string;
19708
19709 var wcwidth$2 = {exports: {}};
19710
19711 var clone$1 = {exports: {}};
19712
19713 (function (module) {
19714   var clone = function () {
19715     /**
19716      * Clones (copies) an Object using deep copying.
19717      *
19718      * This function supports circular references by default, but if you are certain
19719      * there are no circular references in your object, you can save some CPU time
19720      * by calling clone(obj, false).
19721      *
19722      * Caution: if `circular` is false and `parent` contains circular references,
19723      * your program may enter an infinite loop and crash.
19724      *
19725      * @param `parent` - the object to be cloned
19726      * @param `circular` - set to true if the object to be cloned may contain
19727      *    circular references. (optional - true by default)
19728      * @param `depth` - set to a number if the object is only to be cloned to
19729      *    a particular depth. (optional - defaults to Infinity)
19730      * @param `prototype` - sets the prototype to be used when cloning an object.
19731      *    (optional - defaults to parent prototype).
19732     */
19733
19734     function clone(parent, circular, depth, prototype) {
19735
19736       if (typeof circular === 'object') {
19737         depth = circular.depth;
19738         prototype = circular.prototype;
19739         circular = circular.circular;
19740       } // maintain two arrays for circular references, where corresponding parents
19741       // and children have the same index
19742
19743
19744       var allParents = [];
19745       var allChildren = [];
19746       var useBuffer = typeof Buffer != 'undefined';
19747       if (typeof circular == 'undefined') circular = true;
19748       if (typeof depth == 'undefined') depth = Infinity; // recurse this function so we don't reset allParents and allChildren
19749
19750       function _clone(parent, depth) {
19751         // cloning null always returns null
19752         if (parent === null) return null;
19753         if (depth == 0) return parent;
19754         var child;
19755         var proto;
19756
19757         if (typeof parent != 'object') {
19758           return parent;
19759         }
19760
19761         if (clone.__isArray(parent)) {
19762           child = [];
19763         } else if (clone.__isRegExp(parent)) {
19764           child = new RegExp(parent.source, __getRegExpFlags(parent));
19765           if (parent.lastIndex) child.lastIndex = parent.lastIndex;
19766         } else if (clone.__isDate(parent)) {
19767           child = new Date(parent.getTime());
19768         } else if (useBuffer && Buffer.isBuffer(parent)) {
19769           if (Buffer.allocUnsafe) {
19770             // Node.js >= 4.5.0
19771             child = Buffer.allocUnsafe(parent.length);
19772           } else {
19773             // Older Node.js versions
19774             child = new Buffer(parent.length);
19775           }
19776
19777           parent.copy(child);
19778           return child;
19779         } else {
19780           if (typeof prototype == 'undefined') {
19781             proto = Object.getPrototypeOf(parent);
19782             child = Object.create(proto);
19783           } else {
19784             child = Object.create(prototype);
19785             proto = prototype;
19786           }
19787         }
19788
19789         if (circular) {
19790           var index = allParents.indexOf(parent);
19791
19792           if (index != -1) {
19793             return allChildren[index];
19794           }
19795
19796           allParents.push(parent);
19797           allChildren.push(child);
19798         }
19799
19800         for (var i in parent) {
19801           var attrs;
19802
19803           if (proto) {
19804             attrs = Object.getOwnPropertyDescriptor(proto, i);
19805           }
19806
19807           if (attrs && attrs.set == null) {
19808             continue;
19809           }
19810
19811           child[i] = _clone(parent[i], depth - 1);
19812         }
19813
19814         return child;
19815       }
19816
19817       return _clone(parent, depth);
19818     }
19819     /**
19820      * Simple flat clone using prototype, accepts only objects, usefull for property
19821      * override on FLAT configuration object (no nested props).
19822      *
19823      * USE WITH CAUTION! This may not behave as you wish if you do not know how this
19824      * works.
19825      */
19826
19827
19828     clone.clonePrototype = function clonePrototype(parent) {
19829       if (parent === null) return null;
19830
19831       var c = function () {};
19832
19833       c.prototype = parent;
19834       return new c();
19835     }; // private utility functions
19836
19837
19838     function __objToStr(o) {
19839       return Object.prototype.toString.call(o);
19840     }
19841     clone.__objToStr = __objToStr;
19842
19843     function __isDate(o) {
19844       return typeof o === 'object' && __objToStr(o) === '[object Date]';
19845     }
19846     clone.__isDate = __isDate;
19847
19848     function __isArray(o) {
19849       return typeof o === 'object' && __objToStr(o) === '[object Array]';
19850     }
19851     clone.__isArray = __isArray;
19852
19853     function __isRegExp(o) {
19854       return typeof o === 'object' && __objToStr(o) === '[object RegExp]';
19855     }
19856     clone.__isRegExp = __isRegExp;
19857
19858     function __getRegExpFlags(re) {
19859       var flags = '';
19860       if (re.global) flags += 'g';
19861       if (re.ignoreCase) flags += 'i';
19862       if (re.multiline) flags += 'm';
19863       return flags;
19864     }
19865     clone.__getRegExpFlags = __getRegExpFlags;
19866     return clone;
19867   }();
19868
19869   if (module.exports) {
19870     module.exports = clone;
19871   }
19872 })(clone$1);
19873
19874 var clone = clone$1.exports;
19875
19876 var defaults$1 = function (options, defaults) {
19877   options = options || {};
19878   Object.keys(defaults).forEach(function (key) {
19879     if (typeof options[key] === 'undefined') {
19880       options[key] = clone(defaults[key]);
19881     }
19882   });
19883   return options;
19884 };
19885
19886 var combining$1 = [[0x0300, 0x036F], [0x0483, 0x0486], [0x0488, 0x0489], [0x0591, 0x05BD], [0x05BF, 0x05BF], [0x05C1, 0x05C2], [0x05C4, 0x05C5], [0x05C7, 0x05C7], [0x0600, 0x0603], [0x0610, 0x0615], [0x064B, 0x065E], [0x0670, 0x0670], [0x06D6, 0x06E4], [0x06E7, 0x06E8], [0x06EA, 0x06ED], [0x070F, 0x070F], [0x0711, 0x0711], [0x0730, 0x074A], [0x07A6, 0x07B0], [0x07EB, 0x07F3], [0x0901, 0x0902], [0x093C, 0x093C], [0x0941, 0x0948], [0x094D, 0x094D], [0x0951, 0x0954], [0x0962, 0x0963], [0x0981, 0x0981], [0x09BC, 0x09BC], [0x09C1, 0x09C4], [0x09CD, 0x09CD], [0x09E2, 0x09E3], [0x0A01, 0x0A02], [0x0A3C, 0x0A3C], [0x0A41, 0x0A42], [0x0A47, 0x0A48], [0x0A4B, 0x0A4D], [0x0A70, 0x0A71], [0x0A81, 0x0A82], [0x0ABC, 0x0ABC], [0x0AC1, 0x0AC5], [0x0AC7, 0x0AC8], [0x0ACD, 0x0ACD], [0x0AE2, 0x0AE3], [0x0B01, 0x0B01], [0x0B3C, 0x0B3C], [0x0B3F, 0x0B3F], [0x0B41, 0x0B43], [0x0B4D, 0x0B4D], [0x0B56, 0x0B56], [0x0B82, 0x0B82], [0x0BC0, 0x0BC0], [0x0BCD, 0x0BCD], [0x0C3E, 0x0C40], [0x0C46, 0x0C48], [0x0C4A, 0x0C4D], [0x0C55, 0x0C56], [0x0CBC, 0x0CBC], [0x0CBF, 0x0CBF], [0x0CC6, 0x0CC6], [0x0CCC, 0x0CCD], [0x0CE2, 0x0CE3], [0x0D41, 0x0D43], [0x0D4D, 0x0D4D], [0x0DCA, 0x0DCA], [0x0DD2, 0x0DD4], [0x0DD6, 0x0DD6], [0x0E31, 0x0E31], [0x0E34, 0x0E3A], [0x0E47, 0x0E4E], [0x0EB1, 0x0EB1], [0x0EB4, 0x0EB9], [0x0EBB, 0x0EBC], [0x0EC8, 0x0ECD], [0x0F18, 0x0F19], [0x0F35, 0x0F35], [0x0F37, 0x0F37], [0x0F39, 0x0F39], [0x0F71, 0x0F7E], [0x0F80, 0x0F84], [0x0F86, 0x0F87], [0x0F90, 0x0F97], [0x0F99, 0x0FBC], [0x0FC6, 0x0FC6], [0x102D, 0x1030], [0x1032, 0x1032], [0x1036, 0x1037], [0x1039, 0x1039], [0x1058, 0x1059], [0x1160, 0x11FF], [0x135F, 0x135F], [0x1712, 0x1714], [0x1732, 0x1734], [0x1752, 0x1753], [0x1772, 0x1773], [0x17B4, 0x17B5], [0x17B7, 0x17BD], [0x17C6, 0x17C6], [0x17C9, 0x17D3], [0x17DD, 0x17DD], [0x180B, 0x180D], [0x18A9, 0x18A9], [0x1920, 0x1922], [0x1927, 0x1928], [0x1932, 0x1932], [0x1939, 0x193B], [0x1A17, 0x1A18], [0x1B00, 0x1B03], [0x1B34, 0x1B34], [0x1B36, 0x1B3A], [0x1B3C, 0x1B3C], [0x1B42, 0x1B42], [0x1B6B, 0x1B73], [0x1DC0, 0x1DCA], [0x1DFE, 0x1DFF], [0x200B, 0x200F], [0x202A, 0x202E], [0x2060, 0x2063], [0x206A, 0x206F], [0x20D0, 0x20EF], [0x302A, 0x302F], [0x3099, 0x309A], [0xA806, 0xA806], [0xA80B, 0xA80B], [0xA825, 0xA826], [0xFB1E, 0xFB1E], [0xFE00, 0xFE0F], [0xFE20, 0xFE23], [0xFEFF, 0xFEFF], [0xFFF9, 0xFFFB], [0x10A01, 0x10A03], [0x10A05, 0x10A06], [0x10A0C, 0x10A0F], [0x10A38, 0x10A3A], [0x10A3F, 0x10A3F], [0x1D167, 0x1D169], [0x1D173, 0x1D182], [0x1D185, 0x1D18B], [0x1D1AA, 0x1D1AD], [0x1D242, 0x1D244], [0xE0001, 0xE0001], [0xE0020, 0xE007F], [0xE0100, 0xE01EF]];
19887
19888 var defaults = defaults$1;
19889 var combining = combining$1;
19890 var DEFAULTS = {
19891   nul: 0,
19892   control: 0
19893 };
19894
19895 wcwidth$2.exports = function wcwidth(str) {
19896   return wcswidth(str, DEFAULTS);
19897 };
19898
19899 wcwidth$2.exports.config = function (opts) {
19900   opts = defaults(opts || {}, DEFAULTS);
19901   return function wcwidth(str) {
19902     return wcswidth(str, opts);
19903   };
19904 };
19905 /*
19906  *  The following functions define the column width of an ISO 10646
19907  *  character as follows:
19908  *  - The null character (U+0000) has a column width of 0.
19909  *  - Other C0/C1 control characters and DEL will lead to a return value
19910  *    of -1.
19911  *  - Non-spacing and enclosing combining characters (general category
19912  *    code Mn or Me in the
19913  *    Unicode database) have a column width of 0.
19914  *  - SOFT HYPHEN (U+00AD) has a column width of 1.
19915  *  - Other format characters (general category code Cf in the Unicode
19916  *    database) and ZERO WIDTH
19917  *    SPACE (U+200B) have a column width of 0.
19918  *  - Hangul Jamo medial vowels and final consonants (U+1160-U+11FF)
19919  *    have a column width of 0.
19920  *  - Spacing characters in the East Asian Wide (W) or East Asian
19921  *    Full-width (F) category as
19922  *    defined in Unicode Technical Report #11 have a column width of 2.
19923  *  - All remaining characters (including all printable ISO 8859-1 and
19924  *    WGL4 characters, Unicode control characters, etc.) have a column
19925  *    width of 1.
19926  *  This implementation assumes that characters are encoded in ISO 10646.
19927 */
19928
19929
19930 function wcswidth(str, opts) {
19931   if (typeof str !== 'string') return wcwidth$1(str, opts);
19932   var s = 0;
19933
19934   for (var i = 0; i < str.length; i++) {
19935     var n = wcwidth$1(str.charCodeAt(i), opts);
19936     if (n < 0) return -1;
19937     s += n;
19938   }
19939
19940   return s;
19941 }
19942
19943 function wcwidth$1(ucs, opts) {
19944   // test for 8-bit control characters
19945   if (ucs === 0) return opts.nul;
19946   if (ucs < 32 || ucs >= 0x7f && ucs < 0xa0) return opts.control; // binary search in table of non-spacing characters
19947
19948   if (bisearch(ucs)) return 0; // if we arrive here, ucs is not a combining or C0/C1 control character
19949
19950   return 1 + (ucs >= 0x1100 && (ucs <= 0x115f || // Hangul Jamo init. consonants
19951   ucs == 0x2329 || ucs == 0x232a || ucs >= 0x2e80 && ucs <= 0xa4cf && ucs != 0x303f || // CJK ... Yi
19952   ucs >= 0xac00 && ucs <= 0xd7a3 || // Hangul Syllables
19953   ucs >= 0xf900 && ucs <= 0xfaff || // CJK Compatibility Ideographs
19954   ucs >= 0xfe10 && ucs <= 0xfe19 || // Vertical forms
19955   ucs >= 0xfe30 && ucs <= 0xfe6f || // CJK Compatibility Forms
19956   ucs >= 0xff00 && ucs <= 0xff60 || // Fullwidth Forms
19957   ucs >= 0xffe0 && ucs <= 0xffe6 || ucs >= 0x20000 && ucs <= 0x2fffd || ucs >= 0x30000 && ucs <= 0x3fffd));
19958 }
19959
19960 function bisearch(ucs) {
19961   var min = 0;
19962   var max = combining.length - 1;
19963   var mid;
19964   if (ucs < combining[0][0] || ucs > combining[max][1]) return false;
19965
19966   while (max >= min) {
19967     mid = Math.floor((min + max) / 2);
19968     if (ucs > combining[mid][1]) min = mid + 1;else if (ucs < combining[mid][0]) max = mid - 1;else return true;
19969   }
19970
19971   return false;
19972 }
19973
19974 const readline = require$$0__default$6["default"];
19975 const chalk = source;
19976 const stripAnsi = stripAnsi$1;
19977 const wcwidth = wcwidth$2.exports;
19978
19979 const countLines = (stream, text) => {
19980   const columns = stream.columns || 80;
19981   let lineCount = 0;
19982
19983   for (const line of stripAnsi(text).split("\n")) {
19984     lineCount += Math.max(1, Math.ceil(wcwidth(line) / columns));
19985   }
19986
19987   return lineCount;
19988 };
19989
19990 const clear = (stream, text) => () => {
19991   const lineCount = countLines(stream, text);
19992
19993   for (let line = 0; line < lineCount; line++) {
19994     if (line > 0) {
19995       readline.moveCursor(stream, 0, -1);
19996     }
19997
19998     readline.clearLine(stream, 0);
19999     readline.cursorTo(stream, 0);
20000   }
20001 };
20002
20003 const emptyLogResult = {
20004   clear() {}
20005
20006 };
20007
20008 function createLogger$1(logLevel = "log") {
20009   return {
20010     logLevel,
20011     warn: createLogFunc("warn", "yellow"),
20012     error: createLogFunc("error", "red"),
20013     debug: createLogFunc("debug", "blue"),
20014     log: createLogFunc("log")
20015   };
20016
20017   function createLogFunc(loggerName, color) {
20018     if (!shouldLog(loggerName)) {
20019       return () => emptyLogResult;
20020     }
20021
20022     const prefix = color ? `[${chalk[color](loggerName)}] ` : "";
20023     const stream = process[loggerName === "log" ? "stdout" : "stderr"];
20024     return (message, options) => {
20025       options = Object.assign({
20026         newline: true,
20027         clearable: false
20028       }, options);
20029       message = message.replace(/^/gm, prefix) + (options.newline ? "\n" : "");
20030       stream.write(message);
20031
20032       if (options.clearable) {
20033         return {
20034           clear: clear(stream, message)
20035         };
20036       }
20037     };
20038   }
20039
20040   function shouldLog(loggerName) {
20041     switch (logLevel) {
20042       case "silent":
20043         return false;
20044
20045       case "debug":
20046         if (loggerName === "debug") {
20047           return true;
20048         }
20049
20050       // fall through
20051
20052       case "log":
20053         if (loggerName === "log") {
20054           return true;
20055         }
20056
20057       // fall through
20058
20059       case "warn":
20060         if (loggerName === "warn") {
20061           return true;
20062         }
20063
20064       // fall through
20065
20066       case "error":
20067         return loggerName === "error";
20068     }
20069   }
20070 }
20071
20072 var logger = {
20073   createLogger: createLogger$1
20074 };
20075
20076 const path = require$$0__default$1["default"];
20077 const stringify$1 = fastJsonStableStringify; // eslint-disable-next-line no-restricted-modules
20078
20079 const prettier$2 = require$$3;
20080 const {
20081   format,
20082   formatStdin,
20083   formatFiles
20084 } = format_1;
20085 const {
20086   Context,
20087   parseArgvWithoutPlugins
20088 } = context;
20089 const {
20090   normalizeDetailedOptionMap,
20091   createDetailedOptionMap
20092 } = optionMap;
20093 const {
20094   createDetailedUsage,
20095   createUsage
20096 } = usage;
20097 const {
20098   createLogger
20099 } = logger;
20100
20101 async function logResolvedConfigPathOrDie(context) {
20102   const file = context.argv["find-config-path"];
20103   const configFile = await prettier$2.resolveConfigFile(file);
20104
20105   if (configFile) {
20106     context.logger.log(path.relative(process.cwd(), configFile));
20107   } else {
20108     throw new Error(`Can not find configure file for "${file}"`);
20109   }
20110 }
20111
20112 async function logFileInfoOrDie(context) {
20113   const options = {
20114     ignorePath: context.argv["ignore-path"],
20115     withNodeModules: context.argv["with-node-modules"],
20116     plugins: context.argv.plugin,
20117     pluginSearchDirs: context.argv["plugin-search-dir"],
20118     resolveConfig: context.argv.config !== false
20119   };
20120   context.logger.log(prettier$2.format(stringify$1(await prettier$2.getFileInfo(context.argv["file-info"], options)), {
20121     parser: "json"
20122   }));
20123 }
20124
20125 var core$1 = {
20126   Context,
20127   createDetailedOptionMap,
20128   createDetailedUsage,
20129   createUsage,
20130   format,
20131   formatFiles,
20132   formatStdin,
20133   logResolvedConfigPathOrDie,
20134   logFileInfoOrDie,
20135   normalizeDetailedOptionMap,
20136   parseArgvWithoutPlugins,
20137   createLogger
20138 };
20139
20140 const packageJson = require$$0;
20141 pleaseUpgradeNode(packageJson); // eslint-disable-next-line import/order
20142
20143 const stringify = fastJsonStableStringify; // eslint-disable-next-line no-restricted-modules
20144
20145 const prettier$1 = require$$3;
20146 const core = core$1;
20147
20148 async function run(rawArguments) {
20149   // Create a default level logger, so we can log errors during `logLevel` parsing
20150   let logger = core.createLogger();
20151
20152   try {
20153     const logLevel = core.parseArgvWithoutPlugins(rawArguments, logger, "loglevel").loglevel;
20154
20155     if (logLevel !== logger.logLevel) {
20156       logger = core.createLogger(logLevel);
20157     }
20158
20159     await main(rawArguments, logger);
20160   } catch (error) {
20161     logger.error(error.message);
20162     process.exitCode = 1;
20163   }
20164 }
20165
20166 async function main(rawArguments, logger) {
20167   const context = new core.Context({
20168     rawArguments,
20169     logger
20170   });
20171   logger.debug(`normalized argv: ${JSON.stringify(context.argv)}`);
20172
20173   if (context.argv.check && context.argv["list-different"]) {
20174     throw new Error("Cannot use --check and --list-different together.");
20175   }
20176
20177   if (context.argv.write && context.argv["debug-check"]) {
20178     throw new Error("Cannot use --write and --debug-check together.");
20179   }
20180
20181   if (context.argv["find-config-path"] && context.filePatterns.length > 0) {
20182     throw new Error("Cannot use --find-config-path with multiple files");
20183   }
20184
20185   if (context.argv["file-info"] && context.filePatterns.length > 0) {
20186     throw new Error("Cannot use --file-info with multiple files");
20187   }
20188
20189   if (context.argv.version) {
20190     logger.log(prettier$1.version);
20191     return;
20192   }
20193
20194   if (context.argv.help !== undefined) {
20195     logger.log(typeof context.argv.help === "string" && context.argv.help !== "" ? core.createDetailedUsage(context, context.argv.help) : core.createUsage(context));
20196     return;
20197   }
20198
20199   if (context.argv["support-info"]) {
20200     logger.log(prettier$1.format(stringify(prettier$1.getSupportInfo()), {
20201       parser: "json"
20202     }));
20203     return;
20204   }
20205
20206   const hasFilePatterns = context.filePatterns.length > 0;
20207   const useStdin = !hasFilePatterns && (!process.stdin.isTTY || context.argv["stdin-filepath"]);
20208
20209   if (context.argv["find-config-path"]) {
20210     await core.logResolvedConfigPathOrDie(context);
20211   } else if (context.argv["file-info"]) {
20212     await core.logFileInfoOrDie(context);
20213   } else if (useStdin) {
20214     await core.formatStdin(context);
20215   } else if (hasFilePatterns) {
20216     await core.formatFiles(context);
20217   } else {
20218     logger.log(core.createUsage(context));
20219     process.exitCode = 1;
20220   }
20221 }
20222
20223 var cli = {
20224   run
20225 };
20226
20227 var prettier = cli.run(process.argv.slice(2));
20228
20229 module.exports = prettier;