.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / pretty-format / build-es5 / index.js
1 (function (global, factory) {
2         typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
3         typeof define === 'function' && define.amd ? define(factory) :
4         (factory());
5 }(this, (function () { 'use strict';
6
7 function unwrapExports (x) {
8         return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
9 }
10
11 function createCommonjsModule(fn, module) {
12         return module = { exports: {} }, fn(module, module.exports), module.exports;
13 }
14
15 var _global = createCommonjsModule(function (module) {
16 // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
17 var global = module.exports = typeof window != 'undefined' && window.Math == Math
18   ? window : typeof self != 'undefined' && self.Math == Math ? self
19   // eslint-disable-next-line no-new-func
20   : Function('return this')();
21 if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
22 });
23
24 var _core = createCommonjsModule(function (module) {
25 var core = module.exports = { version: '2.5.7' };
26 if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
27 });
28 var _core_1 = _core.version;
29
30 var _aFunction = function (it) {
31   if (typeof it != 'function') throw TypeError(it + ' is not a function!');
32   return it;
33 };
34
35 // optional / simple context binding
36
37 var _ctx = function (fn, that, length) {
38   _aFunction(fn);
39   if (that === undefined) return fn;
40   switch (length) {
41     case 1: return function (a) {
42       return fn.call(that, a);
43     };
44     case 2: return function (a, b) {
45       return fn.call(that, a, b);
46     };
47     case 3: return function (a, b, c) {
48       return fn.call(that, a, b, c);
49     };
50   }
51   return function (/* ...args */) {
52     return fn.apply(that, arguments);
53   };
54 };
55
56 var _isObject = function (it) {
57   return typeof it === 'object' ? it !== null : typeof it === 'function';
58 };
59
60 var _anObject = function (it) {
61   if (!_isObject(it)) throw TypeError(it + ' is not an object!');
62   return it;
63 };
64
65 var _fails = function (exec) {
66   try {
67     return !!exec();
68   } catch (e) {
69     return true;
70   }
71 };
72
73 // Thank's IE8 for his funny defineProperty
74 var _descriptors = !_fails(function () {
75   return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
76 });
77
78 var document = _global.document;
79 // typeof document.createElement is 'object' in old IE
80 var is = _isObject(document) && _isObject(document.createElement);
81 var _domCreate = function (it) {
82   return is ? document.createElement(it) : {};
83 };
84
85 var _ie8DomDefine = !_descriptors && !_fails(function () {
86   return Object.defineProperty(_domCreate('div'), 'a', { get: function () { return 7; } }).a != 7;
87 });
88
89 // 7.1.1 ToPrimitive(input [, PreferredType])
90
91 // instead of the ES6 spec version, we didn't implement @@toPrimitive case
92 // and the second argument - flag - preferred type is a string
93 var _toPrimitive = function (it, S) {
94   if (!_isObject(it)) return it;
95   var fn, val;
96   if (S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;
97   if (typeof (fn = it.valueOf) == 'function' && !_isObject(val = fn.call(it))) return val;
98   if (!S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;
99   throw TypeError("Can't convert object to primitive value");
100 };
101
102 var dP = Object.defineProperty;
103
104 var f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) {
105   _anObject(O);
106   P = _toPrimitive(P, true);
107   _anObject(Attributes);
108   if (_ie8DomDefine) try {
109     return dP(O, P, Attributes);
110   } catch (e) { /* empty */ }
111   if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
112   if ('value' in Attributes) O[P] = Attributes.value;
113   return O;
114 };
115
116 var _objectDp = {
117         f: f
118 };
119
120 var _propertyDesc = function (bitmap, value) {
121   return {
122     enumerable: !(bitmap & 1),
123     configurable: !(bitmap & 2),
124     writable: !(bitmap & 4),
125     value: value
126   };
127 };
128
129 var _hide = _descriptors ? function (object, key, value) {
130   return _objectDp.f(object, key, _propertyDesc(1, value));
131 } : function (object, key, value) {
132   object[key] = value;
133   return object;
134 };
135
136 var hasOwnProperty = {}.hasOwnProperty;
137 var _has = function (it, key) {
138   return hasOwnProperty.call(it, key);
139 };
140
141 var PROTOTYPE = 'prototype';
142
143 var $export = function (type, name, source) {
144   var IS_FORCED = type & $export.F;
145   var IS_GLOBAL = type & $export.G;
146   var IS_STATIC = type & $export.S;
147   var IS_PROTO = type & $export.P;
148   var IS_BIND = type & $export.B;
149   var IS_WRAP = type & $export.W;
150   var exports = IS_GLOBAL ? _core : _core[name] || (_core[name] = {});
151   var expProto = exports[PROTOTYPE];
152   var target = IS_GLOBAL ? _global : IS_STATIC ? _global[name] : (_global[name] || {})[PROTOTYPE];
153   var key, own, out;
154   if (IS_GLOBAL) source = name;
155   for (key in source) {
156     // contains in native
157     own = !IS_FORCED && target && target[key] !== undefined;
158     if (own && _has(exports, key)) continue;
159     // export native or passed
160     out = own ? target[key] : source[key];
161     // prevent global pollution for namespaces
162     exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
163     // bind timers to global for call from export context
164     : IS_BIND && own ? _ctx(out, _global)
165     // wrap global constructors for prevent change them in library
166     : IS_WRAP && target[key] == out ? (function (C) {
167       var F = function (a, b, c) {
168         if (this instanceof C) {
169           switch (arguments.length) {
170             case 0: return new C();
171             case 1: return new C(a);
172             case 2: return new C(a, b);
173           } return new C(a, b, c);
174         } return C.apply(this, arguments);
175       };
176       F[PROTOTYPE] = C[PROTOTYPE];
177       return F;
178     // make static versions for prototype methods
179     })(out) : IS_PROTO && typeof out == 'function' ? _ctx(Function.call, out) : out;
180     // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
181     if (IS_PROTO) {
182       (exports.virtual || (exports.virtual = {}))[key] = out;
183       // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
184       if (type & $export.R && expProto && !expProto[key]) _hide(expProto, key, out);
185     }
186   }
187 };
188 // type bitmap
189 $export.F = 1;   // forced
190 $export.G = 2;   // global
191 $export.S = 4;   // static
192 $export.P = 8;   // proto
193 $export.B = 16;  // bind
194 $export.W = 32;  // wrap
195 $export.U = 64;  // safe
196 $export.R = 128; // real proto method for `library`
197 var _export = $export;
198
199 var toString$1 = {}.toString;
200
201 var _cof = function (it) {
202   return toString$1.call(it).slice(8, -1);
203 };
204
205 // fallback for non-array-like ES3 and non-enumerable old V8 strings
206
207 // eslint-disable-next-line no-prototype-builtins
208 var _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
209   return _cof(it) == 'String' ? it.split('') : Object(it);
210 };
211
212 // 7.2.1 RequireObjectCoercible(argument)
213 var _defined = function (it) {
214   if (it == undefined) throw TypeError("Can't call method on  " + it);
215   return it;
216 };
217
218 // to indexed object, toObject with fallback for non-array-like ES3 strings
219
220
221 var _toIobject = function (it) {
222   return _iobject(_defined(it));
223 };
224
225 // 7.1.4 ToInteger
226 var ceil = Math.ceil;
227 var floor = Math.floor;
228 var _toInteger = function (it) {
229   return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
230 };
231
232 // 7.1.15 ToLength
233
234 var min = Math.min;
235 var _toLength = function (it) {
236   return it > 0 ? min(_toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
237 };
238
239 var max = Math.max;
240 var min$1 = Math.min;
241 var _toAbsoluteIndex = function (index, length) {
242   index = _toInteger(index);
243   return index < 0 ? max(index + length, 0) : min$1(index, length);
244 };
245
246 // false -> Array#indexOf
247 // true  -> Array#includes
248
249
250
251 var _arrayIncludes = function (IS_INCLUDES) {
252   return function ($this, el, fromIndex) {
253     var O = _toIobject($this);
254     var length = _toLength(O.length);
255     var index = _toAbsoluteIndex(fromIndex, length);
256     var value;
257     // Array#includes uses SameValueZero equality algorithm
258     // eslint-disable-next-line no-self-compare
259     if (IS_INCLUDES && el != el) while (length > index) {
260       value = O[index++];
261       // eslint-disable-next-line no-self-compare
262       if (value != value) return true;
263     // Array#indexOf ignores holes, Array#includes - not
264     } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
265       if (O[index] === el) return IS_INCLUDES || index || 0;
266     } return !IS_INCLUDES && -1;
267   };
268 };
269
270 var _library = true;
271
272 var _shared = createCommonjsModule(function (module) {
273 var SHARED = '__core-js_shared__';
274 var store = _global[SHARED] || (_global[SHARED] = {});
275
276 (module.exports = function (key, value) {
277   return store[key] || (store[key] = value !== undefined ? value : {});
278 })('versions', []).push({
279   version: _core.version,
280   mode: _library ? 'pure' : 'global',
281   copyright: '© 2018 Denis Pushkarev (zloirock.ru)'
282 });
283 });
284
285 var id = 0;
286 var px = Math.random();
287 var _uid = function (key) {
288   return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
289 };
290
291 var shared = _shared('keys');
292
293 var _sharedKey = function (key) {
294   return shared[key] || (shared[key] = _uid(key));
295 };
296
297 var arrayIndexOf = _arrayIncludes(false);
298 var IE_PROTO = _sharedKey('IE_PROTO');
299
300 var _objectKeysInternal = function (object, names) {
301   var O = _toIobject(object);
302   var i = 0;
303   var result = [];
304   var key;
305   for (key in O) if (key != IE_PROTO) _has(O, key) && result.push(key);
306   // Don't enum bug & hidden keys
307   while (names.length > i) if (_has(O, key = names[i++])) {
308     ~arrayIndexOf(result, key) || result.push(key);
309   }
310   return result;
311 };
312
313 // IE 8- don't enum bug keys
314 var _enumBugKeys = (
315   'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
316 ).split(',');
317
318 // 19.1.2.14 / 15.2.3.14 Object.keys(O)
319
320
321
322 var _objectKeys = Object.keys || function keys(O) {
323   return _objectKeysInternal(O, _enumBugKeys);
324 };
325
326 var _objectDps = _descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
327   _anObject(O);
328   var keys = _objectKeys(Properties);
329   var length = keys.length;
330   var i = 0;
331   var P;
332   while (length > i) _objectDp.f(O, P = keys[i++], Properties[P]);
333   return O;
334 };
335
336 var document$1 = _global.document;
337 var _html = document$1 && document$1.documentElement;
338
339 // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
340
341
342
343 var IE_PROTO$1 = _sharedKey('IE_PROTO');
344 var Empty = function () { /* empty */ };
345 var PROTOTYPE$1 = 'prototype';
346
347 // Create object with fake `null` prototype: use iframe Object with cleared prototype
348 var createDict = function () {
349   // Thrash, waste and sodomy: IE GC bug
350   var iframe = _domCreate('iframe');
351   var i = _enumBugKeys.length;
352   var lt = '<';
353   var gt = '>';
354   var iframeDocument;
355   iframe.style.display = 'none';
356   _html.appendChild(iframe);
357   iframe.src = 'javascript:'; // eslint-disable-line no-script-url
358   // createDict = iframe.contentWindow.Object;
359   // html.removeChild(iframe);
360   iframeDocument = iframe.contentWindow.document;
361   iframeDocument.open();
362   iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
363   iframeDocument.close();
364   createDict = iframeDocument.F;
365   while (i--) delete createDict[PROTOTYPE$1][_enumBugKeys[i]];
366   return createDict();
367 };
368
369 var _objectCreate = Object.create || function create(O, Properties) {
370   var result;
371   if (O !== null) {
372     Empty[PROTOTYPE$1] = _anObject(O);
373     result = new Empty();
374     Empty[PROTOTYPE$1] = null;
375     // add "__proto__" for Object.getPrototypeOf polyfill
376     result[IE_PROTO$1] = O;
377   } else result = createDict();
378   return Properties === undefined ? result : _objectDps(result, Properties);
379 };
380
381 // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
382 _export(_export.S, 'Object', { create: _objectCreate });
383
384 var $Object = _core.Object;
385 var create = function create(P, D) {
386   return $Object.create(P, D);
387 };
388
389 var create$1 = createCommonjsModule(function (module) {
390 module.exports = { "default": create, __esModule: true };
391 });
392
393 var _Object$create = unwrapExports(create$1);
394
395 // 7.1.13 ToObject(argument)
396
397 var _toObject = function (it) {
398   return Object(_defined(it));
399 };
400
401 // most Object methods by ES6 should accept primitives
402
403
404
405 var _objectSap = function (KEY, exec) {
406   var fn = (_core.Object || {})[KEY] || Object[KEY];
407   var exp = {};
408   exp[KEY] = exec(fn);
409   _export(_export.S + _export.F * _fails(function () { fn(1); }), 'Object', exp);
410 };
411
412 // 19.1.2.14 Object.keys(O)
413
414
415
416 _objectSap('keys', function () {
417   return function keys(it) {
418     return _objectKeys(_toObject(it));
419   };
420 });
421
422 var keys = _core.Object.keys;
423
424 var keys$1 = createCommonjsModule(function (module) {
425 module.exports = { "default": keys, __esModule: true };
426 });
427
428 var _Object$keys = unwrapExports(keys$1);
429
430 // true  -> String#at
431 // false -> String#codePointAt
432 var _stringAt = function (TO_STRING) {
433   return function (that, pos) {
434     var s = String(_defined(that));
435     var i = _toInteger(pos);
436     var l = s.length;
437     var a, b;
438     if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
439     a = s.charCodeAt(i);
440     return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
441       ? TO_STRING ? s.charAt(i) : a
442       : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
443   };
444 };
445
446 var _redefine = _hide;
447
448 var _iterators = {};
449
450 var _wks = createCommonjsModule(function (module) {
451 var store = _shared('wks');
452
453 var Symbol = _global.Symbol;
454 var USE_SYMBOL = typeof Symbol == 'function';
455
456 var $exports = module.exports = function (name) {
457   return store[name] || (store[name] =
458     USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : _uid)('Symbol.' + name));
459 };
460
461 $exports.store = store;
462 });
463
464 var def = _objectDp.f;
465
466 var TAG = _wks('toStringTag');
467
468 var _setToStringTag = function (it, tag, stat) {
469   if (it && !_has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
470 };
471
472 var IteratorPrototype = {};
473
474 // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
475 _hide(IteratorPrototype, _wks('iterator'), function () { return this; });
476
477 var _iterCreate = function (Constructor, NAME, next) {
478   Constructor.prototype = _objectCreate(IteratorPrototype, { next: _propertyDesc(1, next) });
479   _setToStringTag(Constructor, NAME + ' Iterator');
480 };
481
482 // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
483
484
485 var IE_PROTO$2 = _sharedKey('IE_PROTO');
486 var ObjectProto = Object.prototype;
487
488 var _objectGpo = Object.getPrototypeOf || function (O) {
489   O = _toObject(O);
490   if (_has(O, IE_PROTO$2)) return O[IE_PROTO$2];
491   if (typeof O.constructor == 'function' && O instanceof O.constructor) {
492     return O.constructor.prototype;
493   } return O instanceof Object ? ObjectProto : null;
494 };
495
496 var ITERATOR = _wks('iterator');
497 var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
498 var FF_ITERATOR = '@@iterator';
499 var KEYS = 'keys';
500 var VALUES = 'values';
501
502 var returnThis = function () { return this; };
503
504 var _iterDefine = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
505   _iterCreate(Constructor, NAME, next);
506   var getMethod = function (kind) {
507     if (!BUGGY && kind in proto) return proto[kind];
508     switch (kind) {
509       case KEYS: return function keys() { return new Constructor(this, kind); };
510       case VALUES: return function values() { return new Constructor(this, kind); };
511     } return function entries() { return new Constructor(this, kind); };
512   };
513   var TAG = NAME + ' Iterator';
514   var DEF_VALUES = DEFAULT == VALUES;
515   var VALUES_BUG = false;
516   var proto = Base.prototype;
517   var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
518   var $default = $native || getMethod(DEFAULT);
519   var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
520   var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
521   var methods, key, IteratorPrototype;
522   // Fix native
523   if ($anyNative) {
524     IteratorPrototype = _objectGpo($anyNative.call(new Base()));
525     if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
526       // Set @@toStringTag to native iterators
527       _setToStringTag(IteratorPrototype, TAG, true);
528       // fix for some old engines
529       if (!_library && typeof IteratorPrototype[ITERATOR] != 'function') _hide(IteratorPrototype, ITERATOR, returnThis);
530     }
531   }
532   // fix Array#{values, @@iterator}.name in V8 / FF
533   if (DEF_VALUES && $native && $native.name !== VALUES) {
534     VALUES_BUG = true;
535     $default = function values() { return $native.call(this); };
536   }
537   // Define iterator
538   if ((!_library || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
539     _hide(proto, ITERATOR, $default);
540   }
541   // Plug for library
542   _iterators[NAME] = $default;
543   _iterators[TAG] = returnThis;
544   if (DEFAULT) {
545     methods = {
546       values: DEF_VALUES ? $default : getMethod(VALUES),
547       keys: IS_SET ? $default : getMethod(KEYS),
548       entries: $entries
549     };
550     if (FORCED) for (key in methods) {
551       if (!(key in proto)) _redefine(proto, key, methods[key]);
552     } else _export(_export.P + _export.F * (BUGGY || VALUES_BUG), NAME, methods);
553   }
554   return methods;
555 };
556
557 var $at = _stringAt(true);
558
559 // 21.1.3.27 String.prototype[@@iterator]()
560 _iterDefine(String, 'String', function (iterated) {
561   this._t = String(iterated); // target
562   this._i = 0;                // next index
563 // 21.1.5.2.1 %StringIteratorPrototype%.next()
564 }, function () {
565   var O = this._t;
566   var index = this._i;
567   var point;
568   if (index >= O.length) return { value: undefined, done: true };
569   point = $at(O, index);
570   this._i += point.length;
571   return { value: point, done: false };
572 });
573
574 var _iterStep = function (done, value) {
575   return { value: value, done: !!done };
576 };
577
578 // 22.1.3.4 Array.prototype.entries()
579 // 22.1.3.13 Array.prototype.keys()
580 // 22.1.3.29 Array.prototype.values()
581 // 22.1.3.30 Array.prototype[@@iterator]()
582 var es6_array_iterator = _iterDefine(Array, 'Array', function (iterated, kind) {
583   this._t = _toIobject(iterated); // target
584   this._i = 0;                   // next index
585   this._k = kind;                // kind
586 // 22.1.5.2.1 %ArrayIteratorPrototype%.next()
587 }, function () {
588   var O = this._t;
589   var kind = this._k;
590   var index = this._i++;
591   if (!O || index >= O.length) {
592     this._t = undefined;
593     return _iterStep(1);
594   }
595   if (kind == 'keys') return _iterStep(0, index);
596   if (kind == 'values') return _iterStep(0, O[index]);
597   return _iterStep(0, [index, O[index]]);
598 }, 'values');
599
600 // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
601 _iterators.Arguments = _iterators.Array;
602
603 var TO_STRING_TAG = _wks('toStringTag');
604
605 var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' +
606   'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' +
607   'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' +
608   'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' +
609   'TextTrackList,TouchList').split(',');
610
611 for (var i = 0; i < DOMIterables.length; i++) {
612   var NAME = DOMIterables[i];
613   var Collection = _global[NAME];
614   var proto = Collection && Collection.prototype;
615   if (proto && !proto[TO_STRING_TAG]) _hide(proto, TO_STRING_TAG, NAME);
616   _iterators[NAME] = _iterators.Array;
617 }
618
619 var f$1 = _wks;
620
621 var _wksExt = {
622         f: f$1
623 };
624
625 var iterator = _wksExt.f('iterator');
626
627 var iterator$1 = createCommonjsModule(function (module) {
628 module.exports = { "default": iterator, __esModule: true };
629 });
630
631 unwrapExports(iterator$1);
632
633 var _meta = createCommonjsModule(function (module) {
634 var META = _uid('meta');
635
636
637 var setDesc = _objectDp.f;
638 var id = 0;
639 var isExtensible = Object.isExtensible || function () {
640   return true;
641 };
642 var FREEZE = !_fails(function () {
643   return isExtensible(Object.preventExtensions({}));
644 });
645 var setMeta = function (it) {
646   setDesc(it, META, { value: {
647     i: 'O' + ++id, // object ID
648     w: {}          // weak collections IDs
649   } });
650 };
651 var fastKey = function (it, create) {
652   // return primitive with prefix
653   if (!_isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
654   if (!_has(it, META)) {
655     // can't set metadata to uncaught frozen object
656     if (!isExtensible(it)) return 'F';
657     // not necessary to add metadata
658     if (!create) return 'E';
659     // add missing metadata
660     setMeta(it);
661   // return object ID
662   } return it[META].i;
663 };
664 var getWeak = function (it, create) {
665   if (!_has(it, META)) {
666     // can't set metadata to uncaught frozen object
667     if (!isExtensible(it)) return true;
668     // not necessary to add metadata
669     if (!create) return false;
670     // add missing metadata
671     setMeta(it);
672   // return hash weak collections IDs
673   } return it[META].w;
674 };
675 // add metadata on freeze-family methods calling
676 var onFreeze = function (it) {
677   if (FREEZE && meta.NEED && isExtensible(it) && !_has(it, META)) setMeta(it);
678   return it;
679 };
680 var meta = module.exports = {
681   KEY: META,
682   NEED: false,
683   fastKey: fastKey,
684   getWeak: getWeak,
685   onFreeze: onFreeze
686 };
687 });
688 var _meta_1 = _meta.KEY;
689 var _meta_2 = _meta.NEED;
690 var _meta_3 = _meta.fastKey;
691 var _meta_4 = _meta.getWeak;
692 var _meta_5 = _meta.onFreeze;
693
694 var defineProperty = _objectDp.f;
695 var _wksDefine = function (name) {
696   var $Symbol = _core.Symbol || (_core.Symbol = _library ? {} : _global.Symbol || {});
697   if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: _wksExt.f(name) });
698 };
699
700 var f$2 = Object.getOwnPropertySymbols;
701
702 var _objectGops = {
703         f: f$2
704 };
705
706 var f$3 = {}.propertyIsEnumerable;
707
708 var _objectPie = {
709         f: f$3
710 };
711
712 // all enumerable object keys, includes symbols
713
714
715
716 var _enumKeys = function (it) {
717   var result = _objectKeys(it);
718   var getSymbols = _objectGops.f;
719   if (getSymbols) {
720     var symbols = getSymbols(it);
721     var isEnum = _objectPie.f;
722     var i = 0;
723     var key;
724     while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);
725   } return result;
726 };
727
728 // 7.2.2 IsArray(argument)
729
730 var _isArray = Array.isArray || function isArray(arg) {
731   return _cof(arg) == 'Array';
732 };
733
734 // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
735
736 var hiddenKeys = _enumBugKeys.concat('length', 'prototype');
737
738 var f$4 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
739   return _objectKeysInternal(O, hiddenKeys);
740 };
741
742 var _objectGopn = {
743         f: f$4
744 };
745
746 // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
747
748 var gOPN = _objectGopn.f;
749 var toString$2 = {}.toString;
750
751 var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
752   ? Object.getOwnPropertyNames(window) : [];
753
754 var getWindowNames = function (it) {
755   try {
756     return gOPN(it);
757   } catch (e) {
758     return windowNames.slice();
759   }
760 };
761
762 var f$5 = function getOwnPropertyNames(it) {
763   return windowNames && toString$2.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(_toIobject(it));
764 };
765
766 var _objectGopnExt = {
767         f: f$5
768 };
769
770 var gOPD = Object.getOwnPropertyDescriptor;
771
772 var f$6 = _descriptors ? gOPD : function getOwnPropertyDescriptor(O, P) {
773   O = _toIobject(O);
774   P = _toPrimitive(P, true);
775   if (_ie8DomDefine) try {
776     return gOPD(O, P);
777   } catch (e) { /* empty */ }
778   if (_has(O, P)) return _propertyDesc(!_objectPie.f.call(O, P), O[P]);
779 };
780
781 var _objectGopd = {
782         f: f$6
783 };
784
785 // ECMAScript 6 symbols shim
786
787
788
789
790
791 var META = _meta.KEY;
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811 var gOPD$1 = _objectGopd.f;
812 var dP$1 = _objectDp.f;
813 var gOPN$1 = _objectGopnExt.f;
814 var $Symbol = _global.Symbol;
815 var $JSON = _global.JSON;
816 var _stringify = $JSON && $JSON.stringify;
817 var PROTOTYPE$2 = 'prototype';
818 var HIDDEN = _wks('_hidden');
819 var TO_PRIMITIVE = _wks('toPrimitive');
820 var isEnum = {}.propertyIsEnumerable;
821 var SymbolRegistry = _shared('symbol-registry');
822 var AllSymbols = _shared('symbols');
823 var OPSymbols = _shared('op-symbols');
824 var ObjectProto$1 = Object[PROTOTYPE$2];
825 var USE_NATIVE = typeof $Symbol == 'function';
826 var QObject = _global.QObject;
827 // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
828 var setter = !QObject || !QObject[PROTOTYPE$2] || !QObject[PROTOTYPE$2].findChild;
829
830 // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
831 var setSymbolDesc = _descriptors && _fails(function () {
832   return _objectCreate(dP$1({}, 'a', {
833     get: function () { return dP$1(this, 'a', { value: 7 }).a; }
834   })).a != 7;
835 }) ? function (it, key, D) {
836   var protoDesc = gOPD$1(ObjectProto$1, key);
837   if (protoDesc) delete ObjectProto$1[key];
838   dP$1(it, key, D);
839   if (protoDesc && it !== ObjectProto$1) dP$1(ObjectProto$1, key, protoDesc);
840 } : dP$1;
841
842 var wrap = function (tag) {
843   var sym = AllSymbols[tag] = _objectCreate($Symbol[PROTOTYPE$2]);
844   sym._k = tag;
845   return sym;
846 };
847
848 var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {
849   return typeof it == 'symbol';
850 } : function (it) {
851   return it instanceof $Symbol;
852 };
853
854 var $defineProperty = function defineProperty(it, key, D) {
855   if (it === ObjectProto$1) $defineProperty(OPSymbols, key, D);
856   _anObject(it);
857   key = _toPrimitive(key, true);
858   _anObject(D);
859   if (_has(AllSymbols, key)) {
860     if (!D.enumerable) {
861       if (!_has(it, HIDDEN)) dP$1(it, HIDDEN, _propertyDesc(1, {}));
862       it[HIDDEN][key] = true;
863     } else {
864       if (_has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;
865       D = _objectCreate(D, { enumerable: _propertyDesc(0, false) });
866     } return setSymbolDesc(it, key, D);
867   } return dP$1(it, key, D);
868 };
869 var $defineProperties = function defineProperties(it, P) {
870   _anObject(it);
871   var keys = _enumKeys(P = _toIobject(P));
872   var i = 0;
873   var l = keys.length;
874   var key;
875   while (l > i) $defineProperty(it, key = keys[i++], P[key]);
876   return it;
877 };
878 var $create = function create(it, P) {
879   return P === undefined ? _objectCreate(it) : $defineProperties(_objectCreate(it), P);
880 };
881 var $propertyIsEnumerable = function propertyIsEnumerable(key) {
882   var E = isEnum.call(this, key = _toPrimitive(key, true));
883   if (this === ObjectProto$1 && _has(AllSymbols, key) && !_has(OPSymbols, key)) return false;
884   return E || !_has(this, key) || !_has(AllSymbols, key) || _has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
885 };
886 var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
887   it = _toIobject(it);
888   key = _toPrimitive(key, true);
889   if (it === ObjectProto$1 && _has(AllSymbols, key) && !_has(OPSymbols, key)) return;
890   var D = gOPD$1(it, key);
891   if (D && _has(AllSymbols, key) && !(_has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
892   return D;
893 };
894 var $getOwnPropertyNames = function getOwnPropertyNames(it) {
895   var names = gOPN$1(_toIobject(it));
896   var result = [];
897   var i = 0;
898   var key;
899   while (names.length > i) {
900     if (!_has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);
901   } return result;
902 };
903 var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
904   var IS_OP = it === ObjectProto$1;
905   var names = gOPN$1(IS_OP ? OPSymbols : _toIobject(it));
906   var result = [];
907   var i = 0;
908   var key;
909   while (names.length > i) {
910     if (_has(AllSymbols, key = names[i++]) && (IS_OP ? _has(ObjectProto$1, key) : true)) result.push(AllSymbols[key]);
911   } return result;
912 };
913
914 // 19.4.1.1 Symbol([description])
915 if (!USE_NATIVE) {
916   $Symbol = function Symbol() {
917     if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');
918     var tag = _uid(arguments.length > 0 ? arguments[0] : undefined);
919     var $set = function (value) {
920       if (this === ObjectProto$1) $set.call(OPSymbols, value);
921       if (_has(this, HIDDEN) && _has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
922       setSymbolDesc(this, tag, _propertyDesc(1, value));
923     };
924     if (_descriptors && setter) setSymbolDesc(ObjectProto$1, tag, { configurable: true, set: $set });
925     return wrap(tag);
926   };
927   _redefine($Symbol[PROTOTYPE$2], 'toString', function toString() {
928     return this._k;
929   });
930
931   _objectGopd.f = $getOwnPropertyDescriptor;
932   _objectDp.f = $defineProperty;
933   _objectGopn.f = _objectGopnExt.f = $getOwnPropertyNames;
934   _objectPie.f = $propertyIsEnumerable;
935   _objectGops.f = $getOwnPropertySymbols;
936
937   if (_descriptors && !_library) {
938     _redefine(ObjectProto$1, 'propertyIsEnumerable', $propertyIsEnumerable, true);
939   }
940
941   _wksExt.f = function (name) {
942     return wrap(_wks(name));
943   };
944 }
945
946 _export(_export.G + _export.W + _export.F * !USE_NATIVE, { Symbol: $Symbol });
947
948 for (var es6Symbols = (
949   // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
950   'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
951 ).split(','), j = 0; es6Symbols.length > j;)_wks(es6Symbols[j++]);
952
953 for (var wellKnownSymbols = _objectKeys(_wks.store), k = 0; wellKnownSymbols.length > k;) _wksDefine(wellKnownSymbols[k++]);
954
955 _export(_export.S + _export.F * !USE_NATIVE, 'Symbol', {
956   // 19.4.2.1 Symbol.for(key)
957   'for': function (key) {
958     return _has(SymbolRegistry, key += '')
959       ? SymbolRegistry[key]
960       : SymbolRegistry[key] = $Symbol(key);
961   },
962   // 19.4.2.5 Symbol.keyFor(sym)
963   keyFor: function keyFor(sym) {
964     if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');
965     for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;
966   },
967   useSetter: function () { setter = true; },
968   useSimple: function () { setter = false; }
969 });
970
971 _export(_export.S + _export.F * !USE_NATIVE, 'Object', {
972   // 19.1.2.2 Object.create(O [, Properties])
973   create: $create,
974   // 19.1.2.4 Object.defineProperty(O, P, Attributes)
975   defineProperty: $defineProperty,
976   // 19.1.2.3 Object.defineProperties(O, Properties)
977   defineProperties: $defineProperties,
978   // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
979   getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
980   // 19.1.2.7 Object.getOwnPropertyNames(O)
981   getOwnPropertyNames: $getOwnPropertyNames,
982   // 19.1.2.8 Object.getOwnPropertySymbols(O)
983   getOwnPropertySymbols: $getOwnPropertySymbols
984 });
985
986 // 24.3.2 JSON.stringify(value [, replacer [, space]])
987 $JSON && _export(_export.S + _export.F * (!USE_NATIVE || _fails(function () {
988   var S = $Symbol();
989   // MS Edge converts symbol values to JSON as {}
990   // WebKit converts symbol values to JSON as null
991   // V8 throws on boxed symbols
992   return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';
993 })), 'JSON', {
994   stringify: function stringify(it) {
995     var args = [it];
996     var i = 1;
997     var replacer, $replacer;
998     while (arguments.length > i) args.push(arguments[i++]);
999     $replacer = replacer = args[1];
1000     if (!_isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
1001     if (!_isArray(replacer)) replacer = function (key, value) {
1002       if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
1003       if (!isSymbol(value)) return value;
1004     };
1005     args[1] = replacer;
1006     return _stringify.apply($JSON, args);
1007   }
1008 });
1009
1010 // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
1011 $Symbol[PROTOTYPE$2][TO_PRIMITIVE] || _hide($Symbol[PROTOTYPE$2], TO_PRIMITIVE, $Symbol[PROTOTYPE$2].valueOf);
1012 // 19.4.3.5 Symbol.prototype[@@toStringTag]
1013 _setToStringTag($Symbol, 'Symbol');
1014 // 20.2.1.9 Math[@@toStringTag]
1015 _setToStringTag(Math, 'Math', true);
1016 // 24.3.3 JSON[@@toStringTag]
1017 _setToStringTag(_global.JSON, 'JSON', true);
1018
1019 _wksDefine('asyncIterator');
1020
1021 _wksDefine('observable');
1022
1023 var symbol = _core.Symbol;
1024
1025 var symbol$1 = createCommonjsModule(function (module) {
1026 module.exports = { "default": symbol, __esModule: true };
1027 });
1028
1029 var _Symbol = unwrapExports(symbol$1);
1030
1031 var _typeof_1 = createCommonjsModule(function (module, exports) {
1032
1033 exports.__esModule = true;
1034
1035
1036
1037 var _iterator2 = _interopRequireDefault(iterator$1);
1038
1039
1040
1041 var _symbol2 = _interopRequireDefault(symbol$1);
1042
1043 var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; };
1044
1045 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1046
1047 exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) {
1048   return typeof obj === "undefined" ? "undefined" : _typeof(obj);
1049 } : function (obj) {
1050   return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj);
1051 };
1052 });
1053
1054 var _typeof = unwrapExports(_typeof_1);
1055
1056 // 7.2.9 SameValue(x, y)
1057 var _sameValue = Object.is || function is(x, y) {
1058   // eslint-disable-next-line no-self-compare
1059   return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
1060 };
1061
1062 // 19.1.3.10 Object.is(value1, value2)
1063
1064 _export(_export.S, 'Object', { is: _sameValue });
1065
1066 var is$1 = _core.Object.is;
1067
1068 var is$2 = createCommonjsModule(function (module) {
1069 module.exports = { "default": is$1, __esModule: true };
1070 });
1071
1072 var _Object$is = unwrapExports(is$2);
1073
1074 // 19.1.2.9 Object.getPrototypeOf(O)
1075
1076
1077
1078 _objectSap('getPrototypeOf', function () {
1079   return function getPrototypeOf(it) {
1080     return _objectGpo(_toObject(it));
1081   };
1082 });
1083
1084 var getPrototypeOf = _core.Object.getPrototypeOf;
1085
1086 var getPrototypeOf$1 = createCommonjsModule(function (module) {
1087 module.exports = { "default": getPrototypeOf, __esModule: true };
1088 });
1089
1090 var _Object$getPrototypeOf = unwrapExports(getPrototypeOf$1);
1091
1092 var classCallCheck = createCommonjsModule(function (module, exports) {
1093
1094 exports.__esModule = true;
1095
1096 exports.default = function (instance, Constructor) {
1097   if (!(instance instanceof Constructor)) {
1098     throw new TypeError("Cannot call a class as a function");
1099   }
1100 };
1101 });
1102
1103 var _classCallCheck = unwrapExports(classCallCheck);
1104
1105 var possibleConstructorReturn = createCommonjsModule(function (module, exports) {
1106
1107 exports.__esModule = true;
1108
1109
1110
1111 var _typeof3 = _interopRequireDefault(_typeof_1);
1112
1113 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1114
1115 exports.default = function (self, call) {
1116   if (!self) {
1117     throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1118   }
1119
1120   return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self;
1121 };
1122 });
1123
1124 var _possibleConstructorReturn = unwrapExports(possibleConstructorReturn);
1125
1126 // Works with __proto__ only. Old v8 can't work with null proto objects.
1127 /* eslint-disable no-proto */
1128
1129
1130 var check = function (O, proto) {
1131   _anObject(O);
1132   if (!_isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!");
1133 };
1134 var _setProto = {
1135   set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line
1136     function (test, buggy, set) {
1137       try {
1138         set = _ctx(Function.call, _objectGopd.f(Object.prototype, '__proto__').set, 2);
1139         set(test, []);
1140         buggy = !(test instanceof Array);
1141       } catch (e) { buggy = true; }
1142       return function setPrototypeOf(O, proto) {
1143         check(O, proto);
1144         if (buggy) O.__proto__ = proto;
1145         else set(O, proto);
1146         return O;
1147       };
1148     }({}, false) : undefined),
1149   check: check
1150 };
1151
1152 // 19.1.3.19 Object.setPrototypeOf(O, proto)
1153
1154 _export(_export.S, 'Object', { setPrototypeOf: _setProto.set });
1155
1156 var setPrototypeOf = _core.Object.setPrototypeOf;
1157
1158 var setPrototypeOf$1 = createCommonjsModule(function (module) {
1159 module.exports = { "default": setPrototypeOf, __esModule: true };
1160 });
1161
1162 unwrapExports(setPrototypeOf$1);
1163
1164 var inherits = createCommonjsModule(function (module, exports) {
1165
1166 exports.__esModule = true;
1167
1168
1169
1170 var _setPrototypeOf2 = _interopRequireDefault(setPrototypeOf$1);
1171
1172
1173
1174 var _create2 = _interopRequireDefault(create$1);
1175
1176
1177
1178 var _typeof3 = _interopRequireDefault(_typeof_1);
1179
1180 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1181
1182 exports.default = function (subClass, superClass) {
1183   if (typeof superClass !== "function" && superClass !== null) {
1184     throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass)));
1185   }
1186
1187   subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, {
1188     constructor: {
1189       value: subClass,
1190       enumerable: false,
1191       writable: true,
1192       configurable: true
1193     }
1194   });
1195   if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass;
1196 };
1197 });
1198
1199 var _inherits = unwrapExports(inherits);
1200
1201 // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
1202 _export(_export.S + _export.F * !_descriptors, 'Object', { defineProperty: _objectDp.f });
1203
1204 var $Object$1 = _core.Object;
1205 var defineProperty$1 = function defineProperty(it, key, desc) {
1206   return $Object$1.defineProperty(it, key, desc);
1207 };
1208
1209 var defineProperty$2 = createCommonjsModule(function (module) {
1210 module.exports = { "default": defineProperty$1, __esModule: true };
1211 });
1212
1213 var _Object$defineProperty = unwrapExports(defineProperty$2);
1214
1215 // getting tag from 19.1.3.6 Object.prototype.toString()
1216
1217 var TAG$1 = _wks('toStringTag');
1218 // ES3 wrong here
1219 var ARG = _cof(function () { return arguments; }()) == 'Arguments';
1220
1221 // fallback for IE11 Script Access Denied error
1222 var tryGet = function (it, key) {
1223   try {
1224     return it[key];
1225   } catch (e) { /* empty */ }
1226 };
1227
1228 var _classof = function (it) {
1229   var O, T, B;
1230   return it === undefined ? 'Undefined' : it === null ? 'Null'
1231     // @@toStringTag case
1232     : typeof (T = tryGet(O = Object(it), TAG$1)) == 'string' ? T
1233     // builtinTag case
1234     : ARG ? _cof(O)
1235     // ES3 arguments fallback
1236     : (B = _cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
1237 };
1238
1239 var ITERATOR$1 = _wks('iterator');
1240
1241 var core_getIteratorMethod = _core.getIteratorMethod = function (it) {
1242   if (it != undefined) return it[ITERATOR$1]
1243     || it['@@iterator']
1244     || _iterators[_classof(it)];
1245 };
1246
1247 var core_getIterator = _core.getIterator = function (it) {
1248   var iterFn = core_getIteratorMethod(it);
1249   if (typeof iterFn != 'function') throw TypeError(it + ' is not iterable!');
1250   return _anObject(iterFn.call(it));
1251 };
1252
1253 var getIterator = core_getIterator;
1254
1255 var getIterator$1 = createCommonjsModule(function (module) {
1256 module.exports = { "default": getIterator, __esModule: true };
1257 });
1258
1259 var _getIterator = unwrapExports(getIterator$1);
1260
1261 var _redefineAll = function (target, src, safe) {
1262   for (var key in src) {
1263     if (safe && target[key]) target[key] = src[key];
1264     else _hide(target, key, src[key]);
1265   } return target;
1266 };
1267
1268 var _anInstance = function (it, Constructor, name, forbiddenField) {
1269   if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {
1270     throw TypeError(name + ': incorrect invocation!');
1271   } return it;
1272 };
1273
1274 // call something on iterator step with safe closing on error
1275
1276 var _iterCall = function (iterator, fn, value, entries) {
1277   try {
1278     return entries ? fn(_anObject(value)[0], value[1]) : fn(value);
1279   // 7.4.6 IteratorClose(iterator, completion)
1280   } catch (e) {
1281     var ret = iterator['return'];
1282     if (ret !== undefined) _anObject(ret.call(iterator));
1283     throw e;
1284   }
1285 };
1286
1287 // check on default Array iterator
1288
1289 var ITERATOR$2 = _wks('iterator');
1290 var ArrayProto = Array.prototype;
1291
1292 var _isArrayIter = function (it) {
1293   return it !== undefined && (_iterators.Array === it || ArrayProto[ITERATOR$2] === it);
1294 };
1295
1296 var _forOf = createCommonjsModule(function (module) {
1297 var BREAK = {};
1298 var RETURN = {};
1299 var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
1300   var iterFn = ITERATOR ? function () { return iterable; } : core_getIteratorMethod(iterable);
1301   var f = _ctx(fn, that, entries ? 2 : 1);
1302   var index = 0;
1303   var length, step, iterator, result;
1304   if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');
1305   // fast case for arrays with default iterator
1306   if (_isArrayIter(iterFn)) for (length = _toLength(iterable.length); length > index; index++) {
1307     result = entries ? f(_anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
1308     if (result === BREAK || result === RETURN) return result;
1309   } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {
1310     result = _iterCall(iterator, f, step.value, entries);
1311     if (result === BREAK || result === RETURN) return result;
1312   }
1313 };
1314 exports.BREAK = BREAK;
1315 exports.RETURN = RETURN;
1316 });
1317
1318 var SPECIES = _wks('species');
1319
1320 var _setSpecies = function (KEY) {
1321   var C = typeof _core[KEY] == 'function' ? _core[KEY] : _global[KEY];
1322   if (_descriptors && C && !C[SPECIES]) _objectDp.f(C, SPECIES, {
1323     configurable: true,
1324     get: function () { return this; }
1325   });
1326 };
1327
1328 var _validateCollection = function (it, TYPE) {
1329   if (!_isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');
1330   return it;
1331 };
1332
1333 var dP$2 = _objectDp.f;
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343 var fastKey = _meta.fastKey;
1344
1345 var SIZE = _descriptors ? '_s' : 'size';
1346
1347 var getEntry = function (that, key) {
1348   // fast case
1349   var index = fastKey(key);
1350   var entry;
1351   if (index !== 'F') return that._i[index];
1352   // frozen object case
1353   for (entry = that._f; entry; entry = entry.n) {
1354     if (entry.k == key) return entry;
1355   }
1356 };
1357
1358 var _collectionStrong = {
1359   getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {
1360     var C = wrapper(function (that, iterable) {
1361       _anInstance(that, C, NAME, '_i');
1362       that._t = NAME;         // collection type
1363       that._i = _objectCreate(null); // index
1364       that._f = undefined;    // first entry
1365       that._l = undefined;    // last entry
1366       that[SIZE] = 0;         // size
1367       if (iterable != undefined) _forOf(iterable, IS_MAP, that[ADDER], that);
1368     });
1369     _redefineAll(C.prototype, {
1370       // 23.1.3.1 Map.prototype.clear()
1371       // 23.2.3.2 Set.prototype.clear()
1372       clear: function clear() {
1373         for (var that = _validateCollection(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {
1374           entry.r = true;
1375           if (entry.p) entry.p = entry.p.n = undefined;
1376           delete data[entry.i];
1377         }
1378         that._f = that._l = undefined;
1379         that[SIZE] = 0;
1380       },
1381       // 23.1.3.3 Map.prototype.delete(key)
1382       // 23.2.3.4 Set.prototype.delete(value)
1383       'delete': function (key) {
1384         var that = _validateCollection(this, NAME);
1385         var entry = getEntry(that, key);
1386         if (entry) {
1387           var next = entry.n;
1388           var prev = entry.p;
1389           delete that._i[entry.i];
1390           entry.r = true;
1391           if (prev) prev.n = next;
1392           if (next) next.p = prev;
1393           if (that._f == entry) that._f = next;
1394           if (that._l == entry) that._l = prev;
1395           that[SIZE]--;
1396         } return !!entry;
1397       },
1398       // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
1399       // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
1400       forEach: function forEach(callbackfn /* , that = undefined */) {
1401         _validateCollection(this, NAME);
1402         var f = _ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
1403         var entry;
1404         while (entry = entry ? entry.n : this._f) {
1405           f(entry.v, entry.k, this);
1406           // revert to the last existing entry
1407           while (entry && entry.r) entry = entry.p;
1408         }
1409       },
1410       // 23.1.3.7 Map.prototype.has(key)
1411       // 23.2.3.7 Set.prototype.has(value)
1412       has: function has(key) {
1413         return !!getEntry(_validateCollection(this, NAME), key);
1414       }
1415     });
1416     if (_descriptors) dP$2(C.prototype, 'size', {
1417       get: function () {
1418         return _validateCollection(this, NAME)[SIZE];
1419       }
1420     });
1421     return C;
1422   },
1423   def: function (that, key, value) {
1424     var entry = getEntry(that, key);
1425     var prev, index;
1426     // change existing entry
1427     if (entry) {
1428       entry.v = value;
1429     // create new entry
1430     } else {
1431       that._l = entry = {
1432         i: index = fastKey(key, true), // <- index
1433         k: key,                        // <- key
1434         v: value,                      // <- value
1435         p: prev = that._l,             // <- previous entry
1436         n: undefined,                  // <- next entry
1437         r: false                       // <- removed
1438       };
1439       if (!that._f) that._f = entry;
1440       if (prev) prev.n = entry;
1441       that[SIZE]++;
1442       // add to index
1443       if (index !== 'F') that._i[index] = entry;
1444     } return that;
1445   },
1446   getEntry: getEntry,
1447   setStrong: function (C, NAME, IS_MAP) {
1448     // add .keys, .values, .entries, [@@iterator]
1449     // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11
1450     _iterDefine(C, NAME, function (iterated, kind) {
1451       this._t = _validateCollection(iterated, NAME); // target
1452       this._k = kind;                     // kind
1453       this._l = undefined;                // previous
1454     }, function () {
1455       var that = this;
1456       var kind = that._k;
1457       var entry = that._l;
1458       // revert to the last existing entry
1459       while (entry && entry.r) entry = entry.p;
1460       // get next entry
1461       if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {
1462         // or finish the iteration
1463         that._t = undefined;
1464         return _iterStep(1);
1465       }
1466       // return step by kind
1467       if (kind == 'keys') return _iterStep(0, entry.k);
1468       if (kind == 'values') return _iterStep(0, entry.v);
1469       return _iterStep(0, [entry.k, entry.v]);
1470     }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
1471
1472     // add [@@species], 23.1.2.2, 23.2.2.2
1473     _setSpecies(NAME);
1474   }
1475 };
1476
1477 var SPECIES$1 = _wks('species');
1478
1479 var _arraySpeciesConstructor = function (original) {
1480   var C;
1481   if (_isArray(original)) {
1482     C = original.constructor;
1483     // cross-realm fallback
1484     if (typeof C == 'function' && (C === Array || _isArray(C.prototype))) C = undefined;
1485     if (_isObject(C)) {
1486       C = C[SPECIES$1];
1487       if (C === null) C = undefined;
1488     }
1489   } return C === undefined ? Array : C;
1490 };
1491
1492 // 9.4.2.3 ArraySpeciesCreate(originalArray, length)
1493
1494
1495 var _arraySpeciesCreate = function (original, length) {
1496   return new (_arraySpeciesConstructor(original))(length);
1497 };
1498
1499 // 0 -> Array#forEach
1500 // 1 -> Array#map
1501 // 2 -> Array#filter
1502 // 3 -> Array#some
1503 // 4 -> Array#every
1504 // 5 -> Array#find
1505 // 6 -> Array#findIndex
1506
1507
1508
1509
1510
1511 var _arrayMethods = function (TYPE, $create) {
1512   var IS_MAP = TYPE == 1;
1513   var IS_FILTER = TYPE == 2;
1514   var IS_SOME = TYPE == 3;
1515   var IS_EVERY = TYPE == 4;
1516   var IS_FIND_INDEX = TYPE == 6;
1517   var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
1518   var create = $create || _arraySpeciesCreate;
1519   return function ($this, callbackfn, that) {
1520     var O = _toObject($this);
1521     var self = _iobject(O);
1522     var f = _ctx(callbackfn, that, 3);
1523     var length = _toLength(self.length);
1524     var index = 0;
1525     var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
1526     var val, res;
1527     for (;length > index; index++) if (NO_HOLES || index in self) {
1528       val = self[index];
1529       res = f(val, index, O);
1530       if (TYPE) {
1531         if (IS_MAP) result[index] = res;   // map
1532         else if (res) switch (TYPE) {
1533           case 3: return true;             // some
1534           case 5: return val;              // find
1535           case 6: return index;            // findIndex
1536           case 2: result.push(val);        // filter
1537         } else if (IS_EVERY) return false; // every
1538       }
1539     }
1540     return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
1541   };
1542 };
1543
1544 var dP$3 = _objectDp.f;
1545 var each = _arrayMethods(0);
1546
1547
1548 var _collection = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {
1549   var Base = _global[NAME];
1550   var C = Base;
1551   var ADDER = IS_MAP ? 'set' : 'add';
1552   var proto = C && C.prototype;
1553   var O = {};
1554   if (!_descriptors || typeof C != 'function' || !(IS_WEAK || proto.forEach && !_fails(function () {
1555     new C().entries().next();
1556   }))) {
1557     // create collection constructor
1558     C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);
1559     _redefineAll(C.prototype, methods);
1560     _meta.NEED = true;
1561   } else {
1562     C = wrapper(function (target, iterable) {
1563       _anInstance(target, C, NAME, '_c');
1564       target._c = new Base();
1565       if (iterable != undefined) _forOf(iterable, IS_MAP, target[ADDER], target);
1566     });
1567     each('add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON'.split(','), function (KEY) {
1568       var IS_ADDER = KEY == 'add' || KEY == 'set';
1569       if (KEY in proto && !(IS_WEAK && KEY == 'clear')) _hide(C.prototype, KEY, function (a, b) {
1570         _anInstance(this, C, KEY);
1571         if (!IS_ADDER && IS_WEAK && !_isObject(a)) return KEY == 'get' ? undefined : false;
1572         var result = this._c[KEY](a === 0 ? 0 : a, b);
1573         return IS_ADDER ? this : result;
1574       });
1575     });
1576     IS_WEAK || dP$3(C.prototype, 'size', {
1577       get: function () {
1578         return this._c.size;
1579       }
1580     });
1581   }
1582
1583   _setToStringTag(C, NAME);
1584
1585   O[NAME] = C;
1586   _export(_export.G + _export.W + _export.F, O);
1587
1588   if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);
1589
1590   return C;
1591 };
1592
1593 var MAP = 'Map';
1594
1595 // 23.1 Map Objects
1596 var es6_map = _collection(MAP, function (get) {
1597   return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
1598 }, {
1599   // 23.1.3.6 Map.prototype.get(key)
1600   get: function get(key) {
1601     var entry = _collectionStrong.getEntry(_validateCollection(this, MAP), key);
1602     return entry && entry.v;
1603   },
1604   // 23.1.3.9 Map.prototype.set(key, value)
1605   set: function set(key, value) {
1606     return _collectionStrong.def(_validateCollection(this, MAP), key === 0 ? 0 : key, value);
1607   }
1608 }, _collectionStrong, true);
1609
1610 var _arrayFromIterable = function (iter, ITERATOR) {
1611   var result = [];
1612   _forOf(iter, false, result.push, result, ITERATOR);
1613   return result;
1614 };
1615
1616 // https://github.com/DavidBruant/Map-Set.prototype.toJSON
1617
1618
1619 var _collectionToJson = function (NAME) {
1620   return function toJSON() {
1621     if (_classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic");
1622     return _arrayFromIterable(this);
1623   };
1624 };
1625
1626 // https://github.com/DavidBruant/Map-Set.prototype.toJSON
1627
1628
1629 _export(_export.P + _export.R, 'Map', { toJSON: _collectionToJson('Map') });
1630
1631 // https://tc39.github.io/proposal-setmap-offrom/
1632
1633
1634 var _setCollectionOf = function (COLLECTION) {
1635   _export(_export.S, COLLECTION, { of: function of() {
1636     var length = arguments.length;
1637     var A = new Array(length);
1638     while (length--) A[length] = arguments[length];
1639     return new this(A);
1640   } });
1641 };
1642
1643 // https://tc39.github.io/proposal-setmap-offrom/#sec-map.of
1644 _setCollectionOf('Map');
1645
1646 // https://tc39.github.io/proposal-setmap-offrom/
1647
1648
1649
1650
1651
1652 var _setCollectionFrom = function (COLLECTION) {
1653   _export(_export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) {
1654     var mapFn = arguments[1];
1655     var mapping, A, n, cb;
1656     _aFunction(this);
1657     mapping = mapFn !== undefined;
1658     if (mapping) _aFunction(mapFn);
1659     if (source == undefined) return new this();
1660     A = [];
1661     if (mapping) {
1662       n = 0;
1663       cb = _ctx(mapFn, arguments[2], 2);
1664       _forOf(source, false, function (nextItem) {
1665         A.push(cb(nextItem, n++));
1666       });
1667     } else {
1668       _forOf(source, false, A.push, A);
1669     }
1670     return new this(A);
1671   } });
1672 };
1673
1674 // https://tc39.github.io/proposal-setmap-offrom/#sec-map.from
1675 _setCollectionFrom('Map');
1676
1677 var map = _core.Map;
1678
1679 var map$1 = createCommonjsModule(function (module) {
1680 module.exports = { "default": map, __esModule: true };
1681 });
1682
1683 var _Map = unwrapExports(map$1);
1684
1685 var colorName = {\r
1686         "aliceblue": [240, 248, 255],\r
1687         "antiquewhite": [250, 235, 215],\r
1688         "aqua": [0, 255, 255],\r
1689         "aquamarine": [127, 255, 212],\r
1690         "azure": [240, 255, 255],\r
1691         "beige": [245, 245, 220],\r
1692         "bisque": [255, 228, 196],\r
1693         "black": [0, 0, 0],\r
1694         "blanchedalmond": [255, 235, 205],\r
1695         "blue": [0, 0, 255],\r
1696         "blueviolet": [138, 43, 226],\r
1697         "brown": [165, 42, 42],\r
1698         "burlywood": [222, 184, 135],\r
1699         "cadetblue": [95, 158, 160],\r
1700         "chartreuse": [127, 255, 0],\r
1701         "chocolate": [210, 105, 30],\r
1702         "coral": [255, 127, 80],\r
1703         "cornflowerblue": [100, 149, 237],\r
1704         "cornsilk": [255, 248, 220],\r
1705         "crimson": [220, 20, 60],\r
1706         "cyan": [0, 255, 255],\r
1707         "darkblue": [0, 0, 139],\r
1708         "darkcyan": [0, 139, 139],\r
1709         "darkgoldenrod": [184, 134, 11],\r
1710         "darkgray": [169, 169, 169],\r
1711         "darkgreen": [0, 100, 0],\r
1712         "darkgrey": [169, 169, 169],\r
1713         "darkkhaki": [189, 183, 107],\r
1714         "darkmagenta": [139, 0, 139],\r
1715         "darkolivegreen": [85, 107, 47],\r
1716         "darkorange": [255, 140, 0],\r
1717         "darkorchid": [153, 50, 204],\r
1718         "darkred": [139, 0, 0],\r
1719         "darksalmon": [233, 150, 122],\r
1720         "darkseagreen": [143, 188, 143],\r
1721         "darkslateblue": [72, 61, 139],\r
1722         "darkslategray": [47, 79, 79],\r
1723         "darkslategrey": [47, 79, 79],\r
1724         "darkturquoise": [0, 206, 209],\r
1725         "darkviolet": [148, 0, 211],\r
1726         "deeppink": [255, 20, 147],\r
1727         "deepskyblue": [0, 191, 255],\r
1728         "dimgray": [105, 105, 105],\r
1729         "dimgrey": [105, 105, 105],\r
1730         "dodgerblue": [30, 144, 255],\r
1731         "firebrick": [178, 34, 34],\r
1732         "floralwhite": [255, 250, 240],\r
1733         "forestgreen": [34, 139, 34],\r
1734         "fuchsia": [255, 0, 255],\r
1735         "gainsboro": [220, 220, 220],\r
1736         "ghostwhite": [248, 248, 255],\r
1737         "gold": [255, 215, 0],\r
1738         "goldenrod": [218, 165, 32],\r
1739         "gray": [128, 128, 128],\r
1740         "green": [0, 128, 0],\r
1741         "greenyellow": [173, 255, 47],\r
1742         "grey": [128, 128, 128],\r
1743         "honeydew": [240, 255, 240],\r
1744         "hotpink": [255, 105, 180],\r
1745         "indianred": [205, 92, 92],\r
1746         "indigo": [75, 0, 130],\r
1747         "ivory": [255, 255, 240],\r
1748         "khaki": [240, 230, 140],\r
1749         "lavender": [230, 230, 250],\r
1750         "lavenderblush": [255, 240, 245],\r
1751         "lawngreen": [124, 252, 0],\r
1752         "lemonchiffon": [255, 250, 205],\r
1753         "lightblue": [173, 216, 230],\r
1754         "lightcoral": [240, 128, 128],\r
1755         "lightcyan": [224, 255, 255],\r
1756         "lightgoldenrodyellow": [250, 250, 210],\r
1757         "lightgray": [211, 211, 211],\r
1758         "lightgreen": [144, 238, 144],\r
1759         "lightgrey": [211, 211, 211],\r
1760         "lightpink": [255, 182, 193],\r
1761         "lightsalmon": [255, 160, 122],\r
1762         "lightseagreen": [32, 178, 170],\r
1763         "lightskyblue": [135, 206, 250],\r
1764         "lightslategray": [119, 136, 153],\r
1765         "lightslategrey": [119, 136, 153],\r
1766         "lightsteelblue": [176, 196, 222],\r
1767         "lightyellow": [255, 255, 224],\r
1768         "lime": [0, 255, 0],\r
1769         "limegreen": [50, 205, 50],\r
1770         "linen": [250, 240, 230],\r
1771         "magenta": [255, 0, 255],\r
1772         "maroon": [128, 0, 0],\r
1773         "mediumaquamarine": [102, 205, 170],\r
1774         "mediumblue": [0, 0, 205],\r
1775         "mediumorchid": [186, 85, 211],\r
1776         "mediumpurple": [147, 112, 219],\r
1777         "mediumseagreen": [60, 179, 113],\r
1778         "mediumslateblue": [123, 104, 238],\r
1779         "mediumspringgreen": [0, 250, 154],\r
1780         "mediumturquoise": [72, 209, 204],\r
1781         "mediumvioletred": [199, 21, 133],\r
1782         "midnightblue": [25, 25, 112],\r
1783         "mintcream": [245, 255, 250],\r
1784         "mistyrose": [255, 228, 225],\r
1785         "moccasin": [255, 228, 181],\r
1786         "navajowhite": [255, 222, 173],\r
1787         "navy": [0, 0, 128],\r
1788         "oldlace": [253, 245, 230],\r
1789         "olive": [128, 128, 0],\r
1790         "olivedrab": [107, 142, 35],\r
1791         "orange": [255, 165, 0],\r
1792         "orangered": [255, 69, 0],\r
1793         "orchid": [218, 112, 214],\r
1794         "palegoldenrod": [238, 232, 170],\r
1795         "palegreen": [152, 251, 152],\r
1796         "paleturquoise": [175, 238, 238],\r
1797         "palevioletred": [219, 112, 147],\r
1798         "papayawhip": [255, 239, 213],\r
1799         "peachpuff": [255, 218, 185],\r
1800         "peru": [205, 133, 63],\r
1801         "pink": [255, 192, 203],\r
1802         "plum": [221, 160, 221],\r
1803         "powderblue": [176, 224, 230],\r
1804         "purple": [128, 0, 128],\r
1805         "rebeccapurple": [102, 51, 153],\r
1806         "red": [255, 0, 0],\r
1807         "rosybrown": [188, 143, 143],\r
1808         "royalblue": [65, 105, 225],\r
1809         "saddlebrown": [139, 69, 19],\r
1810         "salmon": [250, 128, 114],\r
1811         "sandybrown": [244, 164, 96],\r
1812         "seagreen": [46, 139, 87],\r
1813         "seashell": [255, 245, 238],\r
1814         "sienna": [160, 82, 45],\r
1815         "silver": [192, 192, 192],\r
1816         "skyblue": [135, 206, 235],\r
1817         "slateblue": [106, 90, 205],\r
1818         "slategray": [112, 128, 144],\r
1819         "slategrey": [112, 128, 144],\r
1820         "snow": [255, 250, 250],\r
1821         "springgreen": [0, 255, 127],\r
1822         "steelblue": [70, 130, 180],\r
1823         "tan": [210, 180, 140],\r
1824         "teal": [0, 128, 128],\r
1825         "thistle": [216, 191, 216],\r
1826         "tomato": [255, 99, 71],\r
1827         "turquoise": [64, 224, 208],\r
1828         "violet": [238, 130, 238],\r
1829         "wheat": [245, 222, 179],\r
1830         "white": [255, 255, 255],\r
1831         "whitesmoke": [245, 245, 245],\r
1832         "yellow": [255, 255, 0],\r
1833         "yellowgreen": [154, 205, 50]\r
1834 };
1835
1836 var conversions = createCommonjsModule(function (module) {
1837 /* MIT license */
1838
1839
1840 // NOTE: conversions should only return primitive values (i.e. arrays, or
1841 //       values that give correct `typeof` results).
1842 //       do not use box values types (i.e. Number(), String(), etc.)
1843
1844 var reverseKeywords = {};
1845 for (var key in colorName) {
1846         if (colorName.hasOwnProperty(key)) {
1847                 reverseKeywords[colorName[key]] = key;
1848         }
1849 }
1850
1851 var convert = module.exports = {
1852         rgb: {channels: 3, labels: 'rgb'},
1853         hsl: {channels: 3, labels: 'hsl'},
1854         hsv: {channels: 3, labels: 'hsv'},
1855         hwb: {channels: 3, labels: 'hwb'},
1856         cmyk: {channels: 4, labels: 'cmyk'},
1857         xyz: {channels: 3, labels: 'xyz'},
1858         lab: {channels: 3, labels: 'lab'},
1859         lch: {channels: 3, labels: 'lch'},
1860         hex: {channels: 1, labels: ['hex']},
1861         keyword: {channels: 1, labels: ['keyword']},
1862         ansi16: {channels: 1, labels: ['ansi16']},
1863         ansi256: {channels: 1, labels: ['ansi256']},
1864         hcg: {channels: 3, labels: ['h', 'c', 'g']},
1865         apple: {channels: 3, labels: ['r16', 'g16', 'b16']},
1866         gray: {channels: 1, labels: ['gray']}
1867 };
1868
1869 // hide .channels and .labels properties
1870 for (var model in convert) {
1871         if (convert.hasOwnProperty(model)) {
1872                 if (!('channels' in convert[model])) {
1873                         throw new Error('missing channels property: ' + model);
1874                 }
1875
1876                 if (!('labels' in convert[model])) {
1877                         throw new Error('missing channel labels property: ' + model);
1878                 }
1879
1880                 if (convert[model].labels.length !== convert[model].channels) {
1881                         throw new Error('channel and label counts mismatch: ' + model);
1882                 }
1883
1884                 var channels = convert[model].channels;
1885                 var labels = convert[model].labels;
1886                 delete convert[model].channels;
1887                 delete convert[model].labels;
1888                 Object.defineProperty(convert[model], 'channels', {value: channels});
1889                 Object.defineProperty(convert[model], 'labels', {value: labels});
1890         }
1891 }
1892
1893 convert.rgb.hsl = function (rgb) {
1894         var r = rgb[0] / 255;
1895         var g = rgb[1] / 255;
1896         var b = rgb[2] / 255;
1897         var min = Math.min(r, g, b);
1898         var max = Math.max(r, g, b);
1899         var delta = max - min;
1900         var h;
1901         var s;
1902         var l;
1903
1904         if (max === min) {
1905                 h = 0;
1906         } else if (r === max) {
1907                 h = (g - b) / delta;
1908         } else if (g === max) {
1909                 h = 2 + (b - r) / delta;
1910         } else if (b === max) {
1911                 h = 4 + (r - g) / delta;
1912         }
1913
1914         h = Math.min(h * 60, 360);
1915
1916         if (h < 0) {
1917                 h += 360;
1918         }
1919
1920         l = (min + max) / 2;
1921
1922         if (max === min) {
1923                 s = 0;
1924         } else if (l <= 0.5) {
1925                 s = delta / (max + min);
1926         } else {
1927                 s = delta / (2 - max - min);
1928         }
1929
1930         return [h, s * 100, l * 100];
1931 };
1932
1933 convert.rgb.hsv = function (rgb) {
1934         var rdif;
1935         var gdif;
1936         var bdif;
1937         var h;
1938         var s;
1939
1940         var r = rgb[0] / 255;
1941         var g = rgb[1] / 255;
1942         var b = rgb[2] / 255;
1943         var v = Math.max(r, g, b);
1944         var diff = v - Math.min(r, g, b);
1945         var diffc = function (c) {
1946                 return (v - c) / 6 / diff + 1 / 2;
1947         };
1948
1949         if (diff === 0) {
1950                 h = s = 0;
1951         } else {
1952                 s = diff / v;
1953                 rdif = diffc(r);
1954                 gdif = diffc(g);
1955                 bdif = diffc(b);
1956
1957                 if (r === v) {
1958                         h = bdif - gdif;
1959                 } else if (g === v) {
1960                         h = (1 / 3) + rdif - bdif;
1961                 } else if (b === v) {
1962                         h = (2 / 3) + gdif - rdif;
1963                 }
1964                 if (h < 0) {
1965                         h += 1;
1966                 } else if (h > 1) {
1967                         h -= 1;
1968                 }
1969         }
1970
1971         return [
1972                 h * 360,
1973                 s * 100,
1974                 v * 100
1975         ];
1976 };
1977
1978 convert.rgb.hwb = function (rgb) {
1979         var r = rgb[0];
1980         var g = rgb[1];
1981         var b = rgb[2];
1982         var h = convert.rgb.hsl(rgb)[0];
1983         var w = 1 / 255 * Math.min(r, Math.min(g, b));
1984
1985         b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
1986
1987         return [h, w * 100, b * 100];
1988 };
1989
1990 convert.rgb.cmyk = function (rgb) {
1991         var r = rgb[0] / 255;
1992         var g = rgb[1] / 255;
1993         var b = rgb[2] / 255;
1994         var c;
1995         var m;
1996         var y;
1997         var k;
1998
1999         k = Math.min(1 - r, 1 - g, 1 - b);
2000         c = (1 - r - k) / (1 - k) || 0;
2001         m = (1 - g - k) / (1 - k) || 0;
2002         y = (1 - b - k) / (1 - k) || 0;
2003
2004         return [c * 100, m * 100, y * 100, k * 100];
2005 };
2006
2007 /**
2008  * See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance
2009  * */
2010 function comparativeDistance(x, y) {
2011         return (
2012                 Math.pow(x[0] - y[0], 2) +
2013                 Math.pow(x[1] - y[1], 2) +
2014                 Math.pow(x[2] - y[2], 2)
2015         );
2016 }
2017
2018 convert.rgb.keyword = function (rgb) {
2019         var reversed = reverseKeywords[rgb];
2020         if (reversed) {
2021                 return reversed;
2022         }
2023
2024         var currentClosestDistance = Infinity;
2025         var currentClosestKeyword;
2026
2027         for (var keyword in colorName) {
2028                 if (colorName.hasOwnProperty(keyword)) {
2029                         var value = colorName[keyword];
2030
2031                         // Compute comparative distance
2032                         var distance = comparativeDistance(rgb, value);
2033
2034                         // Check if its less, if so set as closest
2035                         if (distance < currentClosestDistance) {
2036                                 currentClosestDistance = distance;
2037                                 currentClosestKeyword = keyword;
2038                         }
2039                 }
2040         }
2041
2042         return currentClosestKeyword;
2043 };
2044
2045 convert.keyword.rgb = function (keyword) {
2046         return colorName[keyword];
2047 };
2048
2049 convert.rgb.xyz = function (rgb) {
2050         var r = rgb[0] / 255;
2051         var g = rgb[1] / 255;
2052         var b = rgb[2] / 255;
2053
2054         // assume sRGB
2055         r = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92);
2056         g = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92);
2057         b = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92);
2058
2059         var x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);
2060         var y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);
2061         var z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);
2062
2063         return [x * 100, y * 100, z * 100];
2064 };
2065
2066 convert.rgb.lab = function (rgb) {
2067         var xyz = convert.rgb.xyz(rgb);
2068         var x = xyz[0];
2069         var y = xyz[1];
2070         var z = xyz[2];
2071         var l;
2072         var a;
2073         var b;
2074
2075         x /= 95.047;
2076         y /= 100;
2077         z /= 108.883;
2078
2079         x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116);
2080         y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116);
2081         z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116);
2082
2083         l = (116 * y) - 16;
2084         a = 500 * (x - y);
2085         b = 200 * (y - z);
2086
2087         return [l, a, b];
2088 };
2089
2090 convert.hsl.rgb = function (hsl) {
2091         var h = hsl[0] / 360;
2092         var s = hsl[1] / 100;
2093         var l = hsl[2] / 100;
2094         var t1;
2095         var t2;
2096         var t3;
2097         var rgb;
2098         var val;
2099
2100         if (s === 0) {
2101                 val = l * 255;
2102                 return [val, val, val];
2103         }
2104
2105         if (l < 0.5) {
2106                 t2 = l * (1 + s);
2107         } else {
2108                 t2 = l + s - l * s;
2109         }
2110
2111         t1 = 2 * l - t2;
2112
2113         rgb = [0, 0, 0];
2114         for (var i = 0; i < 3; i++) {
2115                 t3 = h + 1 / 3 * -(i - 1);
2116                 if (t3 < 0) {
2117                         t3++;
2118                 }
2119                 if (t3 > 1) {
2120                         t3--;
2121                 }
2122
2123                 if (6 * t3 < 1) {
2124                         val = t1 + (t2 - t1) * 6 * t3;
2125                 } else if (2 * t3 < 1) {
2126                         val = t2;
2127                 } else if (3 * t3 < 2) {
2128                         val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
2129                 } else {
2130                         val = t1;
2131                 }
2132
2133                 rgb[i] = val * 255;
2134         }
2135
2136         return rgb;
2137 };
2138
2139 convert.hsl.hsv = function (hsl) {
2140         var h = hsl[0];
2141         var s = hsl[1] / 100;
2142         var l = hsl[2] / 100;
2143         var smin = s;
2144         var lmin = Math.max(l, 0.01);
2145         var sv;
2146         var v;
2147
2148         l *= 2;
2149         s *= (l <= 1) ? l : 2 - l;
2150         smin *= lmin <= 1 ? lmin : 2 - lmin;
2151         v = (l + s) / 2;
2152         sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);
2153
2154         return [h, sv * 100, v * 100];
2155 };
2156
2157 convert.hsv.rgb = function (hsv) {
2158         var h = hsv[0] / 60;
2159         var s = hsv[1] / 100;
2160         var v = hsv[2] / 100;
2161         var hi = Math.floor(h) % 6;
2162
2163         var f = h - Math.floor(h);
2164         var p = 255 * v * (1 - s);
2165         var q = 255 * v * (1 - (s * f));
2166         var t = 255 * v * (1 - (s * (1 - f)));
2167         v *= 255;
2168
2169         switch (hi) {
2170                 case 0:
2171                         return [v, t, p];
2172                 case 1:
2173                         return [q, v, p];
2174                 case 2:
2175                         return [p, v, t];
2176                 case 3:
2177                         return [p, q, v];
2178                 case 4:
2179                         return [t, p, v];
2180                 case 5:
2181                         return [v, p, q];
2182         }
2183 };
2184
2185 convert.hsv.hsl = function (hsv) {
2186         var h = hsv[0];
2187         var s = hsv[1] / 100;
2188         var v = hsv[2] / 100;
2189         var vmin = Math.max(v, 0.01);
2190         var lmin;
2191         var sl;
2192         var l;
2193
2194         l = (2 - s) * v;
2195         lmin = (2 - s) * vmin;
2196         sl = s * vmin;
2197         sl /= (lmin <= 1) ? lmin : 2 - lmin;
2198         sl = sl || 0;
2199         l /= 2;
2200
2201         return [h, sl * 100, l * 100];
2202 };
2203
2204 // http://dev.w3.org/csswg/css-color/#hwb-to-rgb
2205 convert.hwb.rgb = function (hwb) {
2206         var h = hwb[0] / 360;
2207         var wh = hwb[1] / 100;
2208         var bl = hwb[2] / 100;
2209         var ratio = wh + bl;
2210         var i;
2211         var v;
2212         var f;
2213         var n;
2214
2215         // wh + bl cant be > 1
2216         if (ratio > 1) {
2217                 wh /= ratio;
2218                 bl /= ratio;
2219         }
2220
2221         i = Math.floor(6 * h);
2222         v = 1 - bl;
2223         f = 6 * h - i;
2224
2225         if ((i & 0x01) !== 0) {
2226                 f = 1 - f;
2227         }
2228
2229         n = wh + f * (v - wh); // linear interpolation
2230
2231         var r;
2232         var g;
2233         var b;
2234         switch (i) {
2235                 default:
2236                 case 6:
2237                 case 0: r = v; g = n; b = wh; break;
2238                 case 1: r = n; g = v; b = wh; break;
2239                 case 2: r = wh; g = v; b = n; break;
2240                 case 3: r = wh; g = n; b = v; break;
2241                 case 4: r = n; g = wh; b = v; break;
2242                 case 5: r = v; g = wh; b = n; break;
2243         }
2244
2245         return [r * 255, g * 255, b * 255];
2246 };
2247
2248 convert.cmyk.rgb = function (cmyk) {
2249         var c = cmyk[0] / 100;
2250         var m = cmyk[1] / 100;
2251         var y = cmyk[2] / 100;
2252         var k = cmyk[3] / 100;
2253         var r;
2254         var g;
2255         var b;
2256
2257         r = 1 - Math.min(1, c * (1 - k) + k);
2258         g = 1 - Math.min(1, m * (1 - k) + k);
2259         b = 1 - Math.min(1, y * (1 - k) + k);
2260
2261         return [r * 255, g * 255, b * 255];
2262 };
2263
2264 convert.xyz.rgb = function (xyz) {
2265         var x = xyz[0] / 100;
2266         var y = xyz[1] / 100;
2267         var z = xyz[2] / 100;
2268         var r;
2269         var g;
2270         var b;
2271
2272         r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);
2273         g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);
2274         b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);
2275
2276         // assume sRGB
2277         r = r > 0.0031308
2278                 ? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055)
2279                 : r * 12.92;
2280
2281         g = g > 0.0031308
2282                 ? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055)
2283                 : g * 12.92;
2284
2285         b = b > 0.0031308
2286                 ? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055)
2287                 : b * 12.92;
2288
2289         r = Math.min(Math.max(0, r), 1);
2290         g = Math.min(Math.max(0, g), 1);
2291         b = Math.min(Math.max(0, b), 1);
2292
2293         return [r * 255, g * 255, b * 255];
2294 };
2295
2296 convert.xyz.lab = function (xyz) {
2297         var x = xyz[0];
2298         var y = xyz[1];
2299         var z = xyz[2];
2300         var l;
2301         var a;
2302         var b;
2303
2304         x /= 95.047;
2305         y /= 100;
2306         z /= 108.883;
2307
2308         x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116);
2309         y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116);
2310         z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116);
2311
2312         l = (116 * y) - 16;
2313         a = 500 * (x - y);
2314         b = 200 * (y - z);
2315
2316         return [l, a, b];
2317 };
2318
2319 convert.lab.xyz = function (lab) {
2320         var l = lab[0];
2321         var a = lab[1];
2322         var b = lab[2];
2323         var x;
2324         var y;
2325         var z;
2326
2327         y = (l + 16) / 116;
2328         x = a / 500 + y;
2329         z = y - b / 200;
2330
2331         var y2 = Math.pow(y, 3);
2332         var x2 = Math.pow(x, 3);
2333         var z2 = Math.pow(z, 3);
2334         y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
2335         x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
2336         z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;
2337
2338         x *= 95.047;
2339         y *= 100;
2340         z *= 108.883;
2341
2342         return [x, y, z];
2343 };
2344
2345 convert.lab.lch = function (lab) {
2346         var l = lab[0];
2347         var a = lab[1];
2348         var b = lab[2];
2349         var hr;
2350         var h;
2351         var c;
2352
2353         hr = Math.atan2(b, a);
2354         h = hr * 360 / 2 / Math.PI;
2355
2356         if (h < 0) {
2357                 h += 360;
2358         }
2359
2360         c = Math.sqrt(a * a + b * b);
2361
2362         return [l, c, h];
2363 };
2364
2365 convert.lch.lab = function (lch) {
2366         var l = lch[0];
2367         var c = lch[1];
2368         var h = lch[2];
2369         var a;
2370         var b;
2371         var hr;
2372
2373         hr = h / 360 * 2 * Math.PI;
2374         a = c * Math.cos(hr);
2375         b = c * Math.sin(hr);
2376
2377         return [l, a, b];
2378 };
2379
2380 convert.rgb.ansi16 = function (args) {
2381         var r = args[0];
2382         var g = args[1];
2383         var b = args[2];
2384         var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2]; // hsv -> ansi16 optimization
2385
2386         value = Math.round(value / 50);
2387
2388         if (value === 0) {
2389                 return 30;
2390         }
2391
2392         var ansi = 30
2393                 + ((Math.round(b / 255) << 2)
2394                 | (Math.round(g / 255) << 1)
2395                 | Math.round(r / 255));
2396
2397         if (value === 2) {
2398                 ansi += 60;
2399         }
2400
2401         return ansi;
2402 };
2403
2404 convert.hsv.ansi16 = function (args) {
2405         // optimization here; we already know the value and don't need to get
2406         // it converted for us.
2407         return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
2408 };
2409
2410 convert.rgb.ansi256 = function (args) {
2411         var r = args[0];
2412         var g = args[1];
2413         var b = args[2];
2414
2415         // we use the extended greyscale palette here, with the exception of
2416         // black and white. normal palette only has 4 greyscale shades.
2417         if (r === g && g === b) {
2418                 if (r < 8) {
2419                         return 16;
2420                 }
2421
2422                 if (r > 248) {
2423                         return 231;
2424                 }
2425
2426                 return Math.round(((r - 8) / 247) * 24) + 232;
2427         }
2428
2429         var ansi = 16
2430                 + (36 * Math.round(r / 255 * 5))
2431                 + (6 * Math.round(g / 255 * 5))
2432                 + Math.round(b / 255 * 5);
2433
2434         return ansi;
2435 };
2436
2437 convert.ansi16.rgb = function (args) {
2438         var color = args % 10;
2439
2440         // handle greyscale
2441         if (color === 0 || color === 7) {
2442                 if (args > 50) {
2443                         color += 3.5;
2444                 }
2445
2446                 color = color / 10.5 * 255;
2447
2448                 return [color, color, color];
2449         }
2450
2451         var mult = (~~(args > 50) + 1) * 0.5;
2452         var r = ((color & 1) * mult) * 255;
2453         var g = (((color >> 1) & 1) * mult) * 255;
2454         var b = (((color >> 2) & 1) * mult) * 255;
2455
2456         return [r, g, b];
2457 };
2458
2459 convert.ansi256.rgb = function (args) {
2460         // handle greyscale
2461         if (args >= 232) {
2462                 var c = (args - 232) * 10 + 8;
2463                 return [c, c, c];
2464         }
2465
2466         args -= 16;
2467
2468         var rem;
2469         var r = Math.floor(args / 36) / 5 * 255;
2470         var g = Math.floor((rem = args % 36) / 6) / 5 * 255;
2471         var b = (rem % 6) / 5 * 255;
2472
2473         return [r, g, b];
2474 };
2475
2476 convert.rgb.hex = function (args) {
2477         var integer = ((Math.round(args[0]) & 0xFF) << 16)
2478                 + ((Math.round(args[1]) & 0xFF) << 8)
2479                 + (Math.round(args[2]) & 0xFF);
2480
2481         var string = integer.toString(16).toUpperCase();
2482         return '000000'.substring(string.length) + string;
2483 };
2484
2485 convert.hex.rgb = function (args) {
2486         var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
2487         if (!match) {
2488                 return [0, 0, 0];
2489         }
2490
2491         var colorString = match[0];
2492
2493         if (match[0].length === 3) {
2494                 colorString = colorString.split('').map(function (char) {
2495                         return char + char;
2496                 }).join('');
2497         }
2498
2499         var integer = parseInt(colorString, 16);
2500         var r = (integer >> 16) & 0xFF;
2501         var g = (integer >> 8) & 0xFF;
2502         var b = integer & 0xFF;
2503
2504         return [r, g, b];
2505 };
2506
2507 convert.rgb.hcg = function (rgb) {
2508         var r = rgb[0] / 255;
2509         var g = rgb[1] / 255;
2510         var b = rgb[2] / 255;
2511         var max = Math.max(Math.max(r, g), b);
2512         var min = Math.min(Math.min(r, g), b);
2513         var chroma = (max - min);
2514         var grayscale;
2515         var hue;
2516
2517         if (chroma < 1) {
2518                 grayscale = min / (1 - chroma);
2519         } else {
2520                 grayscale = 0;
2521         }
2522
2523         if (chroma <= 0) {
2524                 hue = 0;
2525         } else
2526         if (max === r) {
2527                 hue = ((g - b) / chroma) % 6;
2528         } else
2529         if (max === g) {
2530                 hue = 2 + (b - r) / chroma;
2531         } else {
2532                 hue = 4 + (r - g) / chroma + 4;
2533         }
2534
2535         hue /= 6;
2536         hue %= 1;
2537
2538         return [hue * 360, chroma * 100, grayscale * 100];
2539 };
2540
2541 convert.hsl.hcg = function (hsl) {
2542         var s = hsl[1] / 100;
2543         var l = hsl[2] / 100;
2544         var c = 1;
2545         var f = 0;
2546
2547         if (l < 0.5) {
2548                 c = 2.0 * s * l;
2549         } else {
2550                 c = 2.0 * s * (1.0 - l);
2551         }
2552
2553         if (c < 1.0) {
2554                 f = (l - 0.5 * c) / (1.0 - c);
2555         }
2556
2557         return [hsl[0], c * 100, f * 100];
2558 };
2559
2560 convert.hsv.hcg = function (hsv) {
2561         var s = hsv[1] / 100;
2562         var v = hsv[2] / 100;
2563
2564         var c = s * v;
2565         var f = 0;
2566
2567         if (c < 1.0) {
2568                 f = (v - c) / (1 - c);
2569         }
2570
2571         return [hsv[0], c * 100, f * 100];
2572 };
2573
2574 convert.hcg.rgb = function (hcg) {
2575         var h = hcg[0] / 360;
2576         var c = hcg[1] / 100;
2577         var g = hcg[2] / 100;
2578
2579         if (c === 0.0) {
2580                 return [g * 255, g * 255, g * 255];
2581         }
2582
2583         var pure = [0, 0, 0];
2584         var hi = (h % 1) * 6;
2585         var v = hi % 1;
2586         var w = 1 - v;
2587         var mg = 0;
2588
2589         switch (Math.floor(hi)) {
2590                 case 0:
2591                         pure[0] = 1; pure[1] = v; pure[2] = 0; break;
2592                 case 1:
2593                         pure[0] = w; pure[1] = 1; pure[2] = 0; break;
2594                 case 2:
2595                         pure[0] = 0; pure[1] = 1; pure[2] = v; break;
2596                 case 3:
2597                         pure[0] = 0; pure[1] = w; pure[2] = 1; break;
2598                 case 4:
2599                         pure[0] = v; pure[1] = 0; pure[2] = 1; break;
2600                 default:
2601                         pure[0] = 1; pure[1] = 0; pure[2] = w;
2602         }
2603
2604         mg = (1.0 - c) * g;
2605
2606         return [
2607                 (c * pure[0] + mg) * 255,
2608                 (c * pure[1] + mg) * 255,
2609                 (c * pure[2] + mg) * 255
2610         ];
2611 };
2612
2613 convert.hcg.hsv = function (hcg) {
2614         var c = hcg[1] / 100;
2615         var g = hcg[2] / 100;
2616
2617         var v = c + g * (1.0 - c);
2618         var f = 0;
2619
2620         if (v > 0.0) {
2621                 f = c / v;
2622         }
2623
2624         return [hcg[0], f * 100, v * 100];
2625 };
2626
2627 convert.hcg.hsl = function (hcg) {
2628         var c = hcg[1] / 100;
2629         var g = hcg[2] / 100;
2630
2631         var l = g * (1.0 - c) + 0.5 * c;
2632         var s = 0;
2633
2634         if (l > 0.0 && l < 0.5) {
2635                 s = c / (2 * l);
2636         } else
2637         if (l >= 0.5 && l < 1.0) {
2638                 s = c / (2 * (1 - l));
2639         }
2640
2641         return [hcg[0], s * 100, l * 100];
2642 };
2643
2644 convert.hcg.hwb = function (hcg) {
2645         var c = hcg[1] / 100;
2646         var g = hcg[2] / 100;
2647         var v = c + g * (1.0 - c);
2648         return [hcg[0], (v - c) * 100, (1 - v) * 100];
2649 };
2650
2651 convert.hwb.hcg = function (hwb) {
2652         var w = hwb[1] / 100;
2653         var b = hwb[2] / 100;
2654         var v = 1 - b;
2655         var c = v - w;
2656         var g = 0;
2657
2658         if (c < 1) {
2659                 g = (v - c) / (1 - c);
2660         }
2661
2662         return [hwb[0], c * 100, g * 100];
2663 };
2664
2665 convert.apple.rgb = function (apple) {
2666         return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255];
2667 };
2668
2669 convert.rgb.apple = function (rgb) {
2670         return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535];
2671 };
2672
2673 convert.gray.rgb = function (args) {
2674         return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
2675 };
2676
2677 convert.gray.hsl = convert.gray.hsv = function (args) {
2678         return [0, 0, args[0]];
2679 };
2680
2681 convert.gray.hwb = function (gray) {
2682         return [0, 100, gray[0]];
2683 };
2684
2685 convert.gray.cmyk = function (gray) {
2686         return [0, 0, 0, gray[0]];
2687 };
2688
2689 convert.gray.lab = function (gray) {
2690         return [gray[0], 0, 0];
2691 };
2692
2693 convert.gray.hex = function (gray) {
2694         var val = Math.round(gray[0] / 100 * 255) & 0xFF;
2695         var integer = (val << 16) + (val << 8) + val;
2696
2697         var string = integer.toString(16).toUpperCase();
2698         return '000000'.substring(string.length) + string;
2699 };
2700
2701 convert.rgb.gray = function (rgb) {
2702         var val = (rgb[0] + rgb[1] + rgb[2]) / 3;
2703         return [val / 255 * 100];
2704 };
2705 });
2706 var conversions_1 = conversions.rgb;
2707 var conversions_2 = conversions.hsl;
2708 var conversions_3 = conversions.hsv;
2709 var conversions_4 = conversions.hwb;
2710 var conversions_5 = conversions.cmyk;
2711 var conversions_6 = conversions.xyz;
2712 var conversions_7 = conversions.lab;
2713 var conversions_8 = conversions.lch;
2714 var conversions_9 = conversions.hex;
2715 var conversions_10 = conversions.keyword;
2716 var conversions_11 = conversions.ansi16;
2717 var conversions_12 = conversions.ansi256;
2718 var conversions_13 = conversions.hcg;
2719 var conversions_14 = conversions.apple;
2720 var conversions_15 = conversions.gray;
2721
2722 /*
2723         this function routes a model to all other models.
2724
2725         all functions that are routed have a property `.conversion` attached
2726         to the returned synthetic function. This property is an array
2727         of strings, each with the steps in between the 'from' and 'to'
2728         color models (inclusive).
2729
2730         conversions that are not possible simply are not included.
2731 */
2732
2733 function buildGraph() {
2734         var graph = {};
2735         // https://jsperf.com/object-keys-vs-for-in-with-closure/3
2736         var models = Object.keys(conversions);
2737
2738         for (var len = models.length, i = 0; i < len; i++) {
2739                 graph[models[i]] = {
2740                         // http://jsperf.com/1-vs-infinity
2741                         // micro-opt, but this is simple.
2742                         distance: -1,
2743                         parent: null
2744                 };
2745         }
2746
2747         return graph;
2748 }
2749
2750 // https://en.wikipedia.org/wiki/Breadth-first_search
2751 function deriveBFS(fromModel) {
2752         var graph = buildGraph();
2753         var queue = [fromModel]; // unshift -> queue -> pop
2754
2755         graph[fromModel].distance = 0;
2756
2757         while (queue.length) {
2758                 var current = queue.pop();
2759                 var adjacents = Object.keys(conversions[current]);
2760
2761                 for (var len = adjacents.length, i = 0; i < len; i++) {
2762                         var adjacent = adjacents[i];
2763                         var node = graph[adjacent];
2764
2765                         if (node.distance === -1) {
2766                                 node.distance = graph[current].distance + 1;
2767                                 node.parent = current;
2768                                 queue.unshift(adjacent);
2769                         }
2770                 }
2771         }
2772
2773         return graph;
2774 }
2775
2776 function link(from, to) {
2777         return function (args) {
2778                 return to(from(args));
2779         };
2780 }
2781
2782 function wrapConversion(toModel, graph) {
2783         var path = [graph[toModel].parent, toModel];
2784         var fn = conversions[graph[toModel].parent][toModel];
2785
2786         var cur = graph[toModel].parent;
2787         while (graph[cur].parent) {
2788                 path.unshift(graph[cur].parent);
2789                 fn = link(conversions[graph[cur].parent][cur], fn);
2790                 cur = graph[cur].parent;
2791         }
2792
2793         fn.conversion = path;
2794         return fn;
2795 }
2796
2797 var route = function (fromModel) {
2798         var graph = deriveBFS(fromModel);
2799         var conversion = {};
2800
2801         var models = Object.keys(graph);
2802         for (var len = models.length, i = 0; i < len; i++) {
2803                 var toModel = models[i];
2804                 var node = graph[toModel];
2805
2806                 if (node.parent === null) {
2807                         // no possible conversion, or this node is the source model.
2808                         continue;
2809                 }
2810
2811                 conversion[toModel] = wrapConversion(toModel, graph);
2812         }
2813
2814         return conversion;
2815 };
2816
2817 var convert = {};
2818
2819 var models = Object.keys(conversions);
2820
2821 function wrapRaw(fn) {
2822         var wrappedFn = function (args) {
2823                 if (args === undefined || args === null) {
2824                         return args;
2825                 }
2826
2827                 if (arguments.length > 1) {
2828                         args = Array.prototype.slice.call(arguments);
2829                 }
2830
2831                 return fn(args);
2832         };
2833
2834         // preserve .conversion property if there is one
2835         if ('conversion' in fn) {
2836                 wrappedFn.conversion = fn.conversion;
2837         }
2838
2839         return wrappedFn;
2840 }
2841
2842 function wrapRounded(fn) {
2843         var wrappedFn = function (args) {
2844                 if (args === undefined || args === null) {
2845                         return args;
2846                 }
2847
2848                 if (arguments.length > 1) {
2849                         args = Array.prototype.slice.call(arguments);
2850                 }
2851
2852                 var result = fn(args);
2853
2854                 // we're assuming the result is an array here.
2855                 // see notice in conversions.js; don't use box types
2856                 // in conversion functions.
2857                 if (typeof result === 'object') {
2858                         for (var len = result.length, i = 0; i < len; i++) {
2859                                 result[i] = Math.round(result[i]);
2860                         }
2861                 }
2862
2863                 return result;
2864         };
2865
2866         // preserve .conversion property if there is one
2867         if ('conversion' in fn) {
2868                 wrappedFn.conversion = fn.conversion;
2869         }
2870
2871         return wrappedFn;
2872 }
2873
2874 models.forEach(function (fromModel) {
2875         convert[fromModel] = {};
2876
2877         Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});
2878         Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});
2879
2880         var routes = route(fromModel);
2881         var routeModels = Object.keys(routes);
2882
2883         routeModels.forEach(function (toModel) {
2884                 var fn = routes[toModel];
2885
2886                 convert[fromModel][toModel] = wrapRounded(fn);
2887                 convert[fromModel][toModel].raw = wrapRaw(fn);
2888         });
2889 });
2890
2891 var colorConvert = convert;
2892
2893 var ansiStyles = createCommonjsModule(function (module) {
2894
2895         var wrapAnsi16 = function wrapAnsi16(fn, offset) {
2896                 return function () {
2897                         var code = fn.apply(colorConvert, arguments);
2898                         return '\x1B[' + (code + offset) + 'm';
2899                 };
2900         };
2901
2902         var wrapAnsi256 = function wrapAnsi256(fn, offset) {
2903                 return function () {
2904                         var code = fn.apply(colorConvert, arguments);
2905                         return '\x1B[' + (38 + offset) + ';5;' + code + 'm';
2906                 };
2907         };
2908
2909         var wrapAnsi16m = function wrapAnsi16m(fn, offset) {
2910                 return function () {
2911                         var rgb = fn.apply(colorConvert, arguments);
2912                         return '\x1B[' + (38 + offset) + ';2;' + rgb[0] + ';' + rgb[1] + ';' + rgb[2] + 'm';
2913                 };
2914         };
2915
2916         function assembleStyles() {
2917                 var codes = new _Map();
2918                 var styles = {
2919                         modifier: {
2920                                 reset: [0, 0],
2921                                 // 21 isn't widely supported and 22 does the same thing
2922                                 bold: [1, 22],
2923                                 dim: [2, 22],
2924                                 italic: [3, 23],
2925                                 underline: [4, 24],
2926                                 inverse: [7, 27],
2927                                 hidden: [8, 28],
2928                                 strikethrough: [9, 29]
2929                         },
2930                         color: {
2931                                 black: [30, 39],
2932                                 red: [31, 39],
2933                                 green: [32, 39],
2934                                 yellow: [33, 39],
2935                                 blue: [34, 39],
2936                                 magenta: [35, 39],
2937                                 cyan: [36, 39],
2938                                 white: [37, 39],
2939                                 gray: [90, 39],
2940
2941                                 // Bright color
2942                                 redBright: [91, 39],
2943                                 greenBright: [92, 39],
2944                                 yellowBright: [93, 39],
2945                                 blueBright: [94, 39],
2946                                 magentaBright: [95, 39],
2947                                 cyanBright: [96, 39],
2948                                 whiteBright: [97, 39]
2949                         },
2950                         bgColor: {
2951                                 bgBlack: [40, 49],
2952                                 bgRed: [41, 49],
2953                                 bgGreen: [42, 49],
2954                                 bgYellow: [43, 49],
2955                                 bgBlue: [44, 49],
2956                                 bgMagenta: [45, 49],
2957                                 bgCyan: [46, 49],
2958                                 bgWhite: [47, 49],
2959
2960                                 // Bright color
2961                                 bgBlackBright: [100, 49],
2962                                 bgRedBright: [101, 49],
2963                                 bgGreenBright: [102, 49],
2964                                 bgYellowBright: [103, 49],
2965                                 bgBlueBright: [104, 49],
2966                                 bgMagentaBright: [105, 49],
2967                                 bgCyanBright: [106, 49],
2968                                 bgWhiteBright: [107, 49]
2969                         }
2970                 };
2971
2972                 // Fix humans
2973                 styles.color.grey = styles.color.gray;
2974
2975                 var _iteratorNormalCompletion = true;
2976                 var _didIteratorError = false;
2977                 var _iteratorError = undefined;
2978
2979                 try {
2980                         for (var _iterator = _getIterator(_Object$keys(styles)), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
2981                                 var groupName = _step.value;
2982
2983                                 var group = styles[groupName];
2984
2985                                 var _iteratorNormalCompletion3 = true;
2986                                 var _didIteratorError3 = false;
2987                                 var _iteratorError3 = undefined;
2988
2989                                 try {
2990                                         for (var _iterator3 = _getIterator(_Object$keys(group)), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
2991                                                 var styleName = _step3.value;
2992
2993                                                 var style = group[styleName];
2994
2995                                                 styles[styleName] = {
2996                                                         open: '\x1B[' + style[0] + 'm',
2997                                                         close: '\x1B[' + style[1] + 'm'
2998                                                 };
2999
3000                                                 group[styleName] = styles[styleName];
3001
3002                                                 codes.set(style[0], style[1]);
3003                                         }
3004                                 } catch (err) {
3005                                         _didIteratorError3 = true;
3006                                         _iteratorError3 = err;
3007                                 } finally {
3008                                         try {
3009                                                 if (!_iteratorNormalCompletion3 && _iterator3.return) {
3010                                                         _iterator3.return();
3011                                                 }
3012                                         } finally {
3013                                                 if (_didIteratorError3) {
3014                                                         throw _iteratorError3;
3015                                                 }
3016                                         }
3017                                 }
3018
3019                                 _Object$defineProperty(styles, groupName, {
3020                                         value: group,
3021                                         enumerable: false
3022                                 });
3023
3024                                 Object.defineProperty(styles, 'codes', {
3025                                         value: codes,
3026                                         enumerable: false
3027                                 });
3028                         }
3029                 } catch (err) {
3030                         _didIteratorError = true;
3031                         _iteratorError = err;
3032                 } finally {
3033                         try {
3034                                 if (!_iteratorNormalCompletion && _iterator.return) {
3035                                         _iterator.return();
3036                                 }
3037                         } finally {
3038                                 if (_didIteratorError) {
3039                                         throw _iteratorError;
3040                                 }
3041                         }
3042                 }
3043
3044                 var ansi2ansi = function ansi2ansi(n) {
3045                         return n;
3046                 };
3047                 var rgb2rgb = function rgb2rgb(r, g, b) {
3048                         return [r, g, b];
3049                 };
3050
3051                 styles.color.close = '\x1B[39m';
3052                 styles.bgColor.close = '\x1B[49m';
3053
3054                 styles.color.ansi = {
3055                         ansi: wrapAnsi16(ansi2ansi, 0)
3056                 };
3057                 styles.color.ansi256 = {
3058                         ansi256: wrapAnsi256(ansi2ansi, 0)
3059                 };
3060                 styles.color.ansi16m = {
3061                         rgb: wrapAnsi16m(rgb2rgb, 0)
3062                 };
3063
3064                 styles.bgColor.ansi = {
3065                         ansi: wrapAnsi16(ansi2ansi, 10)
3066                 };
3067                 styles.bgColor.ansi256 = {
3068                         ansi256: wrapAnsi256(ansi2ansi, 10)
3069                 };
3070                 styles.bgColor.ansi16m = {
3071                         rgb: wrapAnsi16m(rgb2rgb, 10)
3072                 };
3073
3074                 var _iteratorNormalCompletion2 = true;
3075                 var _didIteratorError2 = false;
3076                 var _iteratorError2 = undefined;
3077
3078                 try {
3079                         for (var _iterator2 = _getIterator(_Object$keys(colorConvert)), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
3080                                 var key = _step2.value;
3081
3082                                 if (_typeof(colorConvert[key]) !== 'object') {
3083                                         continue;
3084                                 }
3085
3086                                 var suite = colorConvert[key];
3087
3088                                 if (key === 'ansi16') {
3089                                         key = 'ansi';
3090                                 }
3091
3092                                 if ('ansi16' in suite) {
3093                                         styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0);
3094                                         styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10);
3095                                 }
3096
3097                                 if ('ansi256' in suite) {
3098                                         styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0);
3099                                         styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10);
3100                                 }
3101
3102                                 if ('rgb' in suite) {
3103                                         styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0);
3104                                         styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10);
3105                                 }
3106                         }
3107                 } catch (err) {
3108                         _didIteratorError2 = true;
3109                         _iteratorError2 = err;
3110                 } finally {
3111                         try {
3112                                 if (!_iteratorNormalCompletion2 && _iterator2.return) {
3113                                         _iterator2.return();
3114                                 }
3115                         } finally {
3116                                 if (_didIteratorError2) {
3117                                         throw _iteratorError2;
3118                                 }
3119                         }
3120                 }
3121
3122                 return styles;
3123         }
3124
3125         // Make the export immutable
3126         Object.defineProperty(module, 'exports', {
3127                 enumerable: true,
3128                 get: assembleStyles
3129         });
3130 });
3131
3132 var getOwnPropertySymbols = _core.Object.getOwnPropertySymbols;
3133
3134 var getOwnPropertySymbols$1 = createCommonjsModule(function (module) {
3135 module.exports = { "default": getOwnPropertySymbols, __esModule: true };
3136 });
3137
3138 var _Object$getOwnPropertySymbols = unwrapExports(getOwnPropertySymbols$1);
3139
3140 /**
3141  * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
3142  *
3143  * This source code is licensed under the MIT license found in the
3144  * LICENSE file in the root directory of this source tree.
3145  *
3146  *      
3147  */
3148
3149 var getSymbols = _Object$getOwnPropertySymbols || function (obj) {
3150   return [];
3151 };
3152
3153 var isSymbol$1 = function isSymbol(key) {
3154   return (
3155     // $FlowFixMe string literal `symbol`. This value is not a valid `typeof` return value
3156     (typeof key === 'undefined' ? 'undefined' : _typeof(key)) === 'symbol' || toString.call(key) === '[object Symbol]'
3157   );
3158 };
3159
3160 // Return entries (for example, of a map)
3161 // with spacing, indentation, and comma
3162 // without surrounding punctuation (for example, braces)
3163 function printIteratorEntries(
3164 // Flow 0.51.0: property `@@iterator` of $Iterator not found in Object
3165 // To allow simplistic getRecordIterator in immutable.js
3166 iterator, config, indentation, depth, refs, printer) {
3167   var separator = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : ': ';
3168
3169   var result = '';
3170   var current = iterator.next();
3171
3172   if (!current.done) {
3173     result += config.spacingOuter;
3174
3175     var indentationNext = indentation + config.indent;
3176
3177     while (!current.done) {
3178       var name = printer(current.value[0], config, indentationNext, depth, refs);
3179       var value = printer(current.value[1], config, indentationNext, depth, refs);
3180
3181       result += indentationNext + name + separator + value;
3182
3183       current = iterator.next();
3184
3185       if (!current.done) {
3186         result += ',' + config.spacingInner;
3187       } else if (!config.min) {
3188         result += ',';
3189       }
3190     }
3191
3192     result += config.spacingOuter + indentation;
3193   }
3194
3195   return result;
3196 }
3197
3198 // Return values (for example, of a set)
3199 // with spacing, indentation, and comma
3200 // without surrounding punctuation (braces or brackets)
3201 function printIteratorValues(iterator, config, indentation, depth, refs, printer) {
3202   var result = '';
3203   var current = iterator.next();
3204
3205   if (!current.done) {
3206     result += config.spacingOuter;
3207
3208     var indentationNext = indentation + config.indent;
3209
3210     while (!current.done) {
3211       result += indentationNext + printer(current.value, config, indentationNext, depth, refs);
3212
3213       current = iterator.next();
3214
3215       if (!current.done) {
3216         result += ',' + config.spacingInner;
3217       } else if (!config.min) {
3218         result += ',';
3219       }
3220     }
3221
3222     result += config.spacingOuter + indentation;
3223   }
3224
3225   return result;
3226 }
3227
3228 // Return items (for example, of an array)
3229 // with spacing, indentation, and comma
3230 // without surrounding punctuation (for example, brackets)
3231 function printListItems(list, config, indentation, depth, refs, printer) {
3232   var result = '';
3233
3234   if (list.length) {
3235     result += config.spacingOuter;
3236
3237     var indentationNext = indentation + config.indent;
3238
3239     for (var i = 0; i < list.length; i++) {
3240       result += indentationNext + printer(list[i], config, indentationNext, depth, refs);
3241
3242       if (i < list.length - 1) {
3243         result += ',' + config.spacingInner;
3244       } else if (!config.min) {
3245         result += ',';
3246       }
3247     }
3248
3249     result += config.spacingOuter + indentation;
3250   }
3251
3252   return result;
3253 }
3254
3255 // Return properties of an object
3256 // with spacing, indentation, and comma
3257 // without surrounding punctuation (for example, braces)
3258 function printObjectProperties(val, config, indentation, depth, refs, printer) {
3259   var result = '';
3260   var keys = _Object$keys(val).sort();
3261   var symbols = getSymbols(val);
3262
3263   if (symbols.length) {
3264     keys = keys.filter(function (key) {
3265       return !isSymbol$1(key);
3266     }).concat(symbols);
3267   }
3268
3269   if (keys.length) {
3270     result += config.spacingOuter;
3271
3272     var indentationNext = indentation + config.indent;
3273
3274     for (var i = 0; i < keys.length; i++) {
3275       var key = keys[i];
3276       var name = printer(key, config, indentationNext, depth, refs);
3277       var value = printer(val[key], config, indentationNext, depth, refs);
3278
3279       result += indentationNext + name + ': ' + value;
3280
3281       if (i < keys.length - 1) {
3282         result += ',' + config.spacingInner;
3283       } else if (!config.min) {
3284         result += ',';
3285       }
3286     }
3287
3288     result += config.spacingOuter + indentation;
3289   }
3290
3291   return result;
3292 }
3293
3294 var _for = _core.Symbol['for'];
3295
3296 var _for$1 = createCommonjsModule(function (module) {
3297 module.exports = { "default": _for, __esModule: true };
3298 });
3299
3300 var _Symbol$for = unwrapExports(_for$1);
3301
3302 var asymmetricMatcher = _Symbol$for('jest.asymmetricMatcher');
3303 var SPACE = ' ';
3304
3305 var serialize = function serialize(val, config, indentation, depth, refs, printer) {
3306   var stringedValue = val.toString();
3307
3308   if (stringedValue === 'ArrayContaining' || stringedValue === 'ArrayNotContaining') {
3309     if (++depth > config.maxDepth) {
3310       return '[' + stringedValue + ']';
3311     }
3312     return stringedValue + SPACE + '[' + printListItems(val.sample, config, indentation, depth, refs, printer) + ']';
3313   }
3314
3315   if (stringedValue === 'ObjectContaining' || stringedValue === 'ObjectNotContaining') {
3316     if (++depth > config.maxDepth) {
3317       return '[' + stringedValue + ']';
3318     }
3319     return stringedValue + SPACE + '{' + printObjectProperties(val.sample, config, indentation, depth, refs, printer) + '}';
3320   }
3321
3322   if (stringedValue === 'StringMatching' || stringedValue === 'StringNotMatching') {
3323     return stringedValue + SPACE + printer(val.sample, config, indentation, depth, refs);
3324   }
3325
3326   if (stringedValue === 'StringContaining' || stringedValue === 'StringNotContaining') {
3327     return stringedValue + SPACE + printer(val.sample, config, indentation, depth, refs);
3328   }
3329
3330   return val.toAsymmetricMatcher();
3331 };
3332
3333 var test = function test(val) {
3334   return val && val.$$typeof === asymmetricMatcher;
3335 };
3336
3337 var AsymmetricMatcher = { serialize: serialize, test: test };
3338
3339 var ansiRegex = createCommonjsModule(function (module) {
3340
3341         module.exports = function () {
3342                 var pattern = ['[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)', '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))'].join('|');
3343
3344                 return new RegExp(pattern, 'g');
3345         };
3346 });
3347
3348 var toHumanReadableAnsi = function toHumanReadableAnsi(text) {
3349   return text.replace(ansiRegex(), function (match, offset, string) {
3350     switch (match) {
3351       case ansiStyles.red.close:
3352       case ansiStyles.green.close:
3353       case ansiStyles.cyan.close:
3354       case ansiStyles.gray.close:
3355       case ansiStyles.white.close:
3356       case ansiStyles.yellow.close:
3357       case ansiStyles.bgRed.close:
3358       case ansiStyles.bgGreen.close:
3359       case ansiStyles.bgYellow.close:
3360       case ansiStyles.inverse.close:
3361       case ansiStyles.dim.close:
3362       case ansiStyles.bold.close:
3363       case ansiStyles.reset.open:
3364       case ansiStyles.reset.close:
3365         return '</>';
3366       case ansiStyles.red.open:
3367         return '<red>';
3368       case ansiStyles.green.open:
3369         return '<green>';
3370       case ansiStyles.cyan.open:
3371         return '<cyan>';
3372       case ansiStyles.gray.open:
3373         return '<gray>';
3374       case ansiStyles.white.open:
3375         return '<white>';
3376       case ansiStyles.yellow.open:
3377         return '<yellow>';
3378       case ansiStyles.bgRed.open:
3379         return '<bgRed>';
3380       case ansiStyles.bgGreen.open:
3381         return '<bgGreen>';
3382       case ansiStyles.bgYellow.open:
3383         return '<bgYellow>';
3384       case ansiStyles.inverse.open:
3385         return '<inverse>';
3386       case ansiStyles.dim.open:
3387         return '<dim>';
3388       case ansiStyles.bold.open:
3389         return '<bold>';
3390       default:
3391         return '';
3392     }
3393   });
3394 };
3395
3396 var test$1 = function test(val) {
3397   return typeof val === 'string' && val.match(ansiRegex());
3398 };
3399
3400 var serialize$1 = function serialize(val, config, indentation, depth, refs, printer) {
3401   return printer(toHumanReadableAnsi(val), config, indentation, depth, refs);
3402 };
3403
3404 var ConvertAnsi = { serialize: serialize$1, test: test$1 };
3405
3406 // 19.1.2.1 Object.assign(target, source, ...)
3407
3408
3409
3410
3411
3412 var $assign = Object.assign;
3413
3414 // should work with symbols and should have deterministic property order (V8 bug)
3415 var _objectAssign = !$assign || _fails(function () {
3416   var A = {};
3417   var B = {};
3418   // eslint-disable-next-line no-undef
3419   var S = Symbol();
3420   var K = 'abcdefghijklmnopqrst';
3421   A[S] = 7;
3422   K.split('').forEach(function (k) { B[k] = k; });
3423   return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
3424 }) ? function assign(target, source) { // eslint-disable-line no-unused-vars
3425   var T = _toObject(target);
3426   var aLen = arguments.length;
3427   var index = 1;
3428   var getSymbols = _objectGops.f;
3429   var isEnum = _objectPie.f;
3430   while (aLen > index) {
3431     var S = _iobject(arguments[index++]);
3432     var keys = getSymbols ? _objectKeys(S).concat(getSymbols(S)) : _objectKeys(S);
3433     var length = keys.length;
3434     var j = 0;
3435     var key;
3436     while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];
3437   } return T;
3438 } : $assign;
3439
3440 // 19.1.3.1 Object.assign(target, source)
3441
3442
3443 _export(_export.S + _export.F, 'Object', { assign: _objectAssign });
3444
3445 var assign = _core.Object.assign;
3446
3447 var assign$1 = createCommonjsModule(function (module) {
3448 module.exports = { "default": assign, __esModule: true };
3449 });
3450
3451 var _Object$assign = unwrapExports(assign$1);
3452
3453 var SPACE$1 = ' ';
3454
3455 var COLLECTION_NAMES = ['DOMStringMap', 'NamedNodeMap'];
3456
3457 var test$2 = function test(val) {
3458   return val && val.constructor && COLLECTION_NAMES.indexOf(val.constructor.name) !== -1;
3459 };
3460
3461 var convertCollectionToObject = function convertCollectionToObject(collection) {
3462   var result = {};
3463
3464   if (collection.constructor.name === 'NamedNodeMap') {
3465     for (var i = 0; i < collection.length; i++) {
3466       result[collection[i].name] = collection[i].value;
3467     }
3468   } else {
3469     result = _Object$assign({}, collection);
3470   }
3471
3472   return result;
3473 };
3474
3475 var serialize$2 = function serialize(collection, config, indentation, depth, refs, printer) {
3476   if (++depth > config.maxDepth) {
3477     return '[' + collection.constructor.name + ']';
3478   }
3479
3480   return collection.constructor.name + SPACE$1 + '{' + printObjectProperties(convertCollectionToObject(collection), config, indentation, depth, refs, printer) + '}';
3481 };
3482
3483 var DOMCollection = { serialize: serialize$2, test: test$2 };
3484
3485 /**
3486  * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
3487  *
3488  * This source code is licensed under the MIT license found in the
3489  * LICENSE file in the root directory of this source tree.
3490  *
3491  *      
3492  */
3493
3494 function escapeHTML(str) {
3495   return str.replace(/</g, '&lt;').replace(/>/g, '&gt;');
3496 }
3497
3498 // Return empty string if keys is empty.
3499 var printProps = function printProps(keys, props, config, indentation, depth, refs, printer) {
3500   var indentationNext = indentation + config.indent;
3501   var colors = config.colors;
3502   return keys.map(function (key) {
3503     var value = props[key];
3504     var printed = printer(value, config, indentationNext, depth, refs);
3505
3506     if (typeof value !== 'string') {
3507       if (printed.indexOf('\n') !== -1) {
3508         printed = config.spacingOuter + indentationNext + printed + config.spacingOuter + indentation;
3509       }
3510       printed = '{' + printed + '}';
3511     }
3512
3513     return config.spacingInner + indentation + colors.prop.open + key + colors.prop.close + '=' + colors.value.open + printed + colors.value.close;
3514   }).join('');
3515 };
3516
3517 // Return empty string if children is empty.
3518 var printChildren = function printChildren(children, config, indentation, depth, refs, printer) {
3519   return children.map(function (child) {
3520     return config.spacingOuter + indentation + (typeof child === 'string' ? printText(child, config) : printer(child, config, indentation, depth, refs));
3521   }).join('');
3522 };
3523
3524 var printText = function printText(text, config) {
3525   var contentColor = config.colors.content;
3526   return contentColor.open + escapeHTML(text) + contentColor.close;
3527 };
3528
3529 var printComment = function printComment(comment, config) {
3530   var commentColor = config.colors.comment;
3531   return commentColor.open + '<!--' + escapeHTML(comment) + '-->' + commentColor.close;
3532 };
3533
3534 // Separate the functions to format props, children, and element,
3535 // so a plugin could override a particular function, if needed.
3536 // Too bad, so sad: the traditional (but unnecessary) space
3537 // in a self-closing tagColor requires a second test of printedProps.
3538 var printElement = function printElement(type, printedProps, printedChildren, config, indentation) {
3539   var tagColor = config.colors.tag;
3540   return tagColor.open + '<' + type + (printedProps && tagColor.close + printedProps + config.spacingOuter + indentation + tagColor.open) + (printedChildren ? '>' + tagColor.close + printedChildren + config.spacingOuter + indentation + tagColor.open + '</' + type : (printedProps && !config.min ? '' : ' ') + '/') + '>' + tagColor.close;
3541 };
3542
3543 var printElementAsLeaf = function printElementAsLeaf(type, config) {
3544   var tagColor = config.colors.tag;
3545   return tagColor.open + '<' + type + tagColor.close + ' â€¦' + tagColor.open + ' />' + tagColor.close;
3546 };
3547
3548 var ELEMENT_NODE = 1;
3549 var TEXT_NODE = 3;
3550 var COMMENT_NODE = 8;
3551 var FRAGMENT_NODE = 11;
3552
3553 var ELEMENT_REGEXP = /^((HTML|SVG)\w*)?Element$/;
3554
3555 var testNode = function testNode(nodeType, name) {
3556   return nodeType === ELEMENT_NODE && ELEMENT_REGEXP.test(name) || nodeType === TEXT_NODE && name === 'Text' || nodeType === COMMENT_NODE && name === 'Comment' || nodeType === FRAGMENT_NODE && name === 'DocumentFragment';
3557 };
3558
3559 var test$3 = function test(val) {
3560   return val && val.constructor && val.constructor.name && testNode(val.nodeType, val.constructor.name);
3561 };
3562
3563 // Convert array of attribute objects to keys array and props object.
3564 var keysMapper = function keysMapper(attribute) {
3565   return attribute.name;
3566 };
3567 var propsReducer = function propsReducer(props, attribute) {
3568   props[attribute.name] = attribute.value;
3569   return props;
3570 };
3571
3572 var serialize$3 = function serialize(node, config, indentation, depth, refs, printer) {
3573   if (node.nodeType === TEXT_NODE) {
3574     return printText(node.data, config);
3575   }
3576
3577   if (node.nodeType === COMMENT_NODE) {
3578     return printComment(node.data, config);
3579   }
3580
3581   var type = node.nodeType === FRAGMENT_NODE ? 'DocumentFragment' : node.tagName.toLowerCase();
3582
3583   if (++depth > config.maxDepth) {
3584     return printElementAsLeaf(type, config);
3585   }
3586
3587   return printElement(type, printProps(Array.prototype.map.call(node.attributes || [], keysMapper).sort(), Array.prototype.reduce.call(node.attributes || [], propsReducer, {}), config, indentation + config.indent, depth, refs, printer), printChildren(Array.prototype.slice.call(node.childNodes || node.children), config, indentation + config.indent, depth, refs, printer), config, indentation);
3588 };
3589
3590 var DOMElement = { serialize: serialize$3, test: test$3 };
3591
3592 // SENTINEL constants are from https://github.com/facebook/immutable-js
3593 var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@';
3594 var IS_LIST_SENTINEL = '@@__IMMUTABLE_LIST__@@';
3595 var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@';
3596 var IS_MAP_SENTINEL = '@@__IMMUTABLE_MAP__@@';
3597 var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@';
3598 var IS_RECORD_SENTINEL = '@@__IMMUTABLE_RECORD__@@'; // immutable v4
3599 var IS_SEQ_SENTINEL = '@@__IMMUTABLE_SEQ__@@';
3600 var IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@';
3601 var IS_STACK_SENTINEL = '@@__IMMUTABLE_STACK__@@';
3602
3603 var getImmutableName = function getImmutableName(name) {
3604   return 'Immutable.' + name;
3605 };
3606 var printAsLeaf = function printAsLeaf(name) {
3607   return '[' + name + ']';
3608 };
3609 var SPACE$2 = ' ';
3610 var LAZY = '…'; // Seq is lazy if it calls a method like filter
3611
3612 var printImmutableEntries = function printImmutableEntries(val, config, indentation, depth, refs, printer, type) {
3613   return ++depth > config.maxDepth ? printAsLeaf(getImmutableName(type)) : getImmutableName(type) + SPACE$2 + '{' + printIteratorEntries(val.entries(), config, indentation, depth, refs, printer) + '}';
3614 };
3615
3616 // Record has an entries method because it is a collection in immutable v3.
3617 // Return an iterator for Immutable Record from version v3 or v4.
3618 var getRecordEntries = function getRecordEntries(val) {
3619   var i = 0;
3620   return {
3621     next: function next() {
3622       if (i < val._keys.length) {
3623         var key = val._keys[i++];
3624         return { done: false, value: [key, val.get(key)] };
3625       }
3626       return { done: true };
3627     }
3628   };
3629 };
3630
3631 var printImmutableRecord = function printImmutableRecord(val, config, indentation, depth, refs, printer) {
3632   // _name property is defined only for an Immutable Record instance
3633   // which was constructed with a second optional descriptive name arg
3634   var name = getImmutableName(val._name || 'Record');
3635   return ++depth > config.maxDepth ? printAsLeaf(name) : name + SPACE$2 + '{' + printIteratorEntries(getRecordEntries(val), config, indentation, depth, refs, printer) + '}';
3636 };
3637
3638 var printImmutableSeq = function printImmutableSeq(val, config, indentation, depth, refs, printer) {
3639   var name = getImmutableName('Seq');
3640
3641   if (++depth > config.maxDepth) {
3642     return printAsLeaf(name);
3643   }
3644
3645   if (val[IS_KEYED_SENTINEL]) {
3646     return name + SPACE$2 + '{' + (
3647     // from Immutable collection of entries or from ECMAScript object
3648     val._iter || val._object ? printIteratorEntries(val.entries(), config, indentation, depth, refs, printer) : LAZY) + '}';
3649   }
3650
3651   return name + SPACE$2 + '[' + (val._iter || // from Immutable collection of values
3652   val._array || // from ECMAScript array
3653   val._collection || // from ECMAScript collection in immutable v4
3654   val._iterable // from ECMAScript collection in immutable v3
3655   ? printIteratorValues(val.values(), config, indentation, depth, refs, printer) : LAZY) + ']';
3656 };
3657
3658 var printImmutableValues = function printImmutableValues(val, config, indentation, depth, refs, printer, type) {
3659   return ++depth > config.maxDepth ? printAsLeaf(getImmutableName(type)) : getImmutableName(type) + SPACE$2 + '[' + printIteratorValues(val.values(), config, indentation, depth, refs, printer) + ']';
3660 };
3661
3662 var serialize$4 = function serialize(val, config, indentation, depth, refs, printer) {
3663   if (val[IS_MAP_SENTINEL]) {
3664     return printImmutableEntries(val, config, indentation, depth, refs, printer, val[IS_ORDERED_SENTINEL] ? 'OrderedMap' : 'Map');
3665   }
3666
3667   if (val[IS_LIST_SENTINEL]) {
3668     return printImmutableValues(val, config, indentation, depth, refs, printer, 'List');
3669   }
3670   if (val[IS_SET_SENTINEL]) {
3671     return printImmutableValues(val, config, indentation, depth, refs, printer, val[IS_ORDERED_SENTINEL] ? 'OrderedSet' : 'Set');
3672   }
3673   if (val[IS_STACK_SENTINEL]) {
3674     return printImmutableValues(val, config, indentation, depth, refs, printer, 'Stack');
3675   }
3676
3677   if (val[IS_SEQ_SENTINEL]) {
3678     return printImmutableSeq(val, config, indentation, depth, refs, printer);
3679   }
3680
3681   // For compatibility with immutable v3 and v4, let record be the default.
3682   return printImmutableRecord(val, config, indentation, depth, refs, printer);
3683 };
3684
3685 // Explicitly comparing sentinel properties to true avoids false positive
3686 // when mock identity-obj-proxy returns the key as the value for any key.
3687 var test$4 = function test(val) {
3688   return val && (val[IS_ITERABLE_SENTINEL] === true || val[IS_RECORD_SENTINEL] === true);
3689 };
3690
3691 var Immutable = { serialize: serialize$4, test: test$4 };
3692
3693 var elementSymbol = _Symbol$for('react.element');
3694 var fragmentSymbol = _Symbol$for('react.fragment');
3695 var forwardRefSymbol = _Symbol$for('react.forward_ref');
3696 var providerSymbol = _Symbol$for('react.provider');
3697 var contextSymbol = _Symbol$for('react.context');
3698
3699 // Given element.props.children, or subtree during recursive traversal,
3700 // return flattened array of children.
3701 var getChildren = function getChildren(arg) {
3702   var children = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
3703
3704   if (Array.isArray(arg)) {
3705     arg.forEach(function (item) {
3706       getChildren(item, children);
3707     });
3708   } else if (arg != null && arg !== false) {
3709     children.push(arg);
3710   }
3711   return children;
3712 };
3713
3714 var getType = function getType(element) {
3715   var type = element.type;
3716   if (typeof type === 'string') {
3717     return type;
3718   }
3719   if (typeof type === 'function') {
3720     return type.displayName || type.name || 'Unknown';
3721   }
3722   if (type === fragmentSymbol) {
3723     return 'React.Fragment';
3724   }
3725   if ((typeof type === 'undefined' ? 'undefined' : _typeof(type)) === 'object' && type !== null) {
3726     if (type.$$typeof === providerSymbol) {
3727       return 'Context.Provider';
3728     }
3729
3730     if (type.$$typeof === contextSymbol) {
3731       return 'Context.Consumer';
3732     }
3733
3734     if (type.$$typeof === forwardRefSymbol) {
3735       var functionName = type.render.displayName || type.render.name || '';
3736
3737       return functionName !== '' ? 'ForwardRef(' + functionName + ')' : 'ForwardRef';
3738     }
3739   }
3740   return 'UNDEFINED';
3741 };
3742
3743 var getPropKeys = function getPropKeys(element) {
3744   var props = element.props;
3745
3746
3747   return _Object$keys(props).filter(function (key) {
3748     return key !== 'children' && props[key] !== undefined;
3749   }).sort();
3750 };
3751
3752 var serialize$5 = function serialize(element, config, indentation, depth, refs, printer) {
3753   return ++depth > config.maxDepth ? printElementAsLeaf(getType(element), config) : printElement(getType(element), printProps(getPropKeys(element), element.props, config, indentation + config.indent, depth, refs, printer), printChildren(getChildren(element.props.children), config, indentation + config.indent, depth, refs, printer), config, indentation);
3754 };
3755
3756 var test$5 = function test(val) {
3757   return val && val.$$typeof === elementSymbol;
3758 };
3759
3760 var ReactElement = { serialize: serialize$5, test: test$5 };
3761
3762 var testSymbol = _Symbol$for('react.test.json');
3763
3764 var getPropKeys$1 = function getPropKeys(object) {
3765   var props = object.props;
3766
3767
3768   return props ? _Object$keys(props).filter(function (key) {
3769     return props[key] !== undefined;
3770   }).sort() : [];
3771 };
3772
3773 var serialize$6 = function serialize(object, config, indentation, depth, refs, printer) {
3774   return ++depth > config.maxDepth ? printElementAsLeaf(object.type, config) : printElement(object.type, object.props ? printProps(getPropKeys$1(object),
3775   // Despite ternary expression, Flow 0.51.0 found incorrect error:
3776   // undefined is incompatible with the expected param type of Object
3777   // $FlowFixMe
3778   object.props, config, indentation + config.indent, depth, refs, printer) : '', object.children ? printChildren(object.children, config, indentation + config.indent, depth, refs, printer) : '', config, indentation);
3779 };
3780
3781 var test$6 = function test(val) {
3782   return val && val.$$typeof === testSymbol;
3783 };
3784
3785 var ReactTestComponent = { serialize: serialize$6, test: test$6 };
3786
3787 var toString$3 = Object.prototype.toString;
3788 var toISOString = Date.prototype.toISOString;
3789 var errorToString = Error.prototype.toString;
3790 var regExpToString = RegExp.prototype.toString;
3791 var symbolToString = _Symbol.prototype.toString;
3792
3793 // Explicitly comparing typeof constructor to function avoids undefined as name
3794 // when mock identity-obj-proxy returns the key as the value for any key.
3795 var getConstructorName = function getConstructorName(val) {
3796   return typeof val.constructor === 'function' && val.constructor.name || 'Object';
3797 };
3798
3799 // Is val is equal to global window object? Works even if it does not exist :)
3800 /* global window */
3801 var isWindow = function isWindow(val) {
3802   return typeof window !== 'undefined' && val === window;
3803 };
3804
3805 var SYMBOL_REGEXP = /^Symbol\((.*)\)(.*)$/;
3806 var NEWLINE_REGEXP = /\n/gi;
3807
3808 var PrettyFormatPluginError = function (_Error) {
3809   _inherits(PrettyFormatPluginError, _Error);
3810
3811   function PrettyFormatPluginError(message, stack) {
3812     _classCallCheck(this, PrettyFormatPluginError);
3813
3814     var _this = _possibleConstructorReturn(this, (PrettyFormatPluginError.__proto__ || _Object$getPrototypeOf(PrettyFormatPluginError)).call(this, message));
3815
3816     _this.stack = stack;
3817     _this.name = _this.constructor.name;
3818     return _this;
3819   }
3820
3821   return PrettyFormatPluginError;
3822 }(Error);
3823
3824 function isToStringedArrayType(toStringed) {
3825   return toStringed === '[object Array]' || toStringed === '[object ArrayBuffer]' || toStringed === '[object DataView]' || toStringed === '[object Float32Array]' || toStringed === '[object Float64Array]' || toStringed === '[object Int8Array]' || toStringed === '[object Int16Array]' || toStringed === '[object Int32Array]' || toStringed === '[object Uint8Array]' || toStringed === '[object Uint8ClampedArray]' || toStringed === '[object Uint16Array]' || toStringed === '[object Uint32Array]';
3826 }
3827
3828 function printNumber(val) {
3829   return _Object$is(val, -0) ? '-0' : String(val);
3830 }
3831
3832 function printFunction(val, printFunctionName) {
3833   if (!printFunctionName) {
3834     return '[Function]';
3835   }
3836   return '[Function ' + (val.name || 'anonymous') + ']';
3837 }
3838
3839 function printSymbol(val) {
3840   return symbolToString.call(val).replace(SYMBOL_REGEXP, 'Symbol($1)');
3841 }
3842
3843 function printError(val) {
3844   return '[' + errorToString.call(val) + ']';
3845 }
3846
3847 function printBasicValue(val, printFunctionName, escapeRegex) {
3848   if (val === true || val === false) {
3849     return '' + val;
3850   }
3851   if (val === undefined) {
3852     return 'undefined';
3853   }
3854   if (val === null) {
3855     return 'null';
3856   }
3857
3858   var typeOf = typeof val === 'undefined' ? 'undefined' : _typeof(val);
3859
3860   if (typeOf === 'number') {
3861     return printNumber(val);
3862   }
3863   if (typeOf === 'string') {
3864     return '"' + val.replace(/"|\\/g, '\\$&') + '"';
3865   }
3866   if (typeOf === 'function') {
3867     return printFunction(val, printFunctionName);
3868   }
3869   if (typeOf === 'symbol') {
3870     return printSymbol(val);
3871   }
3872
3873   var toStringed = toString$3.call(val);
3874
3875   if (toStringed === '[object WeakMap]') {
3876     return 'WeakMap {}';
3877   }
3878   if (toStringed === '[object WeakSet]') {
3879     return 'WeakSet {}';
3880   }
3881   if (toStringed === '[object Function]' || toStringed === '[object GeneratorFunction]') {
3882     return printFunction(val, printFunctionName);
3883   }
3884   if (toStringed === '[object Symbol]') {
3885     return printSymbol(val);
3886   }
3887   if (toStringed === '[object Date]') {
3888     return isNaN(+val) ? 'Date { NaN }' : toISOString.call(val);
3889   }
3890   if (toStringed === '[object Error]') {
3891     return printError(val);
3892   }
3893   if (toStringed === '[object RegExp]') {
3894     if (escapeRegex) {
3895       // https://github.com/benjamingr/RegExp.escape/blob/master/polyfill.js
3896       return regExpToString.call(val).replace(/[\\^$*+?.()|[\]{}]/g, '\\$&');
3897     }
3898     return regExpToString.call(val);
3899   }
3900
3901   if (val instanceof Error) {
3902     return printError(val);
3903   }
3904
3905   return null;
3906 }
3907
3908 function printComplexValue(val, config, indentation, depth, refs, hasCalledToJSON) {
3909   if (refs.indexOf(val) !== -1) {
3910     return '[Circular]';
3911   }
3912   refs = refs.slice();
3913   refs.push(val);
3914
3915   var hitMaxDepth = ++depth > config.maxDepth;
3916   var min = config.min;
3917
3918   if (config.callToJSON && !hitMaxDepth && val.toJSON && typeof val.toJSON === 'function' && !hasCalledToJSON) {
3919     return printer(val.toJSON(), config, indentation, depth, refs, true);
3920   }
3921
3922   var toStringed = toString$3.call(val);
3923   if (toStringed === '[object Arguments]') {
3924     return hitMaxDepth ? '[Arguments]' : (min ? '' : 'Arguments ') + '[' + printListItems(val, config, indentation, depth, refs, printer) + ']';
3925   }
3926   if (isToStringedArrayType(toStringed)) {
3927     return hitMaxDepth ? '[' + val.constructor.name + ']' : (min ? '' : val.constructor.name + ' ') + '[' + printListItems(val, config, indentation, depth, refs, printer) + ']';
3928   }
3929   if (toStringed === '[object Map]') {
3930     return hitMaxDepth ? '[Map]' : 'Map {' + printIteratorEntries(val.entries(), config, indentation, depth, refs, printer, ' => ') + '}';
3931   }
3932   if (toStringed === '[object Set]') {
3933     return hitMaxDepth ? '[Set]' : 'Set {' + printIteratorValues(val.values(), config, indentation, depth, refs, printer) + '}';
3934   }
3935
3936   // Avoid failure to serialize global window object in jsdom test environment.
3937   // For example, not even relevant if window is prop of React element.
3938   return hitMaxDepth || isWindow(val) ? '[' + getConstructorName(val) + ']' : (min ? '' : getConstructorName(val) + ' ') + '{' + printObjectProperties(val, config, indentation, depth, refs, printer) + '}';
3939 }
3940
3941 function printPlugin(plugin, val, config, indentation, depth, refs) {
3942   var printed = void 0;
3943
3944   try {
3945     printed = plugin.serialize ? plugin.serialize(val, config, indentation, depth, refs, printer) : plugin.print(val, function (valChild) {
3946       return printer(valChild, config, indentation, depth, refs);
3947     }, function (str) {
3948       var indentationNext = indentation + config.indent;
3949       return indentationNext + str.replace(NEWLINE_REGEXP, '\n' + indentationNext);
3950     }, {
3951       edgeSpacing: config.spacingOuter,
3952       min: config.min,
3953       spacing: config.spacingInner
3954     }, config.colors);
3955   } catch (error) {
3956     throw new PrettyFormatPluginError(error.message, error.stack);
3957   }
3958   if (typeof printed !== 'string') {
3959     throw new Error('pretty-format: Plugin must return type "string" but instead returned "' + (typeof printed === 'undefined' ? 'undefined' : _typeof(printed)) + '".');
3960   }
3961   return printed;
3962 }
3963
3964 function findPlugin(plugins, val) {
3965   for (var p = 0; p < plugins.length; p++) {
3966     try {
3967       if (plugins[p].test(val)) {
3968         return plugins[p];
3969       }
3970     } catch (error) {
3971       throw new PrettyFormatPluginError(error.message, error.stack);
3972     }
3973   }
3974
3975   return null;
3976 }
3977
3978 function printer(val, config, indentation, depth, refs, hasCalledToJSON) {
3979   var plugin = findPlugin(config.plugins, val);
3980   if (plugin !== null) {
3981     return printPlugin(plugin, val, config, indentation, depth, refs);
3982   }
3983
3984   var basicResult = printBasicValue(val, config.printFunctionName, config.escapeRegex);
3985   if (basicResult !== null) {
3986     return basicResult;
3987   }
3988
3989   return printComplexValue(val, config, indentation, depth, refs, hasCalledToJSON);
3990 }
3991
3992 var DEFAULT_THEME = {
3993   comment: 'gray',
3994   content: 'reset',
3995   prop: 'yellow',
3996   tag: 'cyan',
3997   value: 'green'
3998 };
3999
4000 var DEFAULT_THEME_KEYS = _Object$keys(DEFAULT_THEME);
4001
4002 var DEFAULT_OPTIONS = {
4003   callToJSON: true,
4004   escapeRegex: false,
4005   highlight: false,
4006   indent: 2,
4007   maxDepth: Infinity,
4008   min: false,
4009   plugins: [],
4010   printFunctionName: true,
4011   theme: DEFAULT_THEME
4012 };
4013
4014 function validateOptions(options) {
4015   _Object$keys(options).forEach(function (key) {
4016     if (!DEFAULT_OPTIONS.hasOwnProperty(key)) {
4017       throw new Error('pretty-format: Unknown option "' + key + '".');
4018     }
4019   });
4020
4021   if (options.min && options.indent !== undefined && options.indent !== 0) {
4022     throw new Error('pretty-format: Options "min" and "indent" cannot be used together.');
4023   }
4024
4025   if (options.theme !== undefined) {
4026     if (options.theme === null) {
4027       throw new Error('pretty-format: Option "theme" must not be null.');
4028     }
4029
4030     if (_typeof(options.theme) !== 'object') {
4031       throw new Error('pretty-format: Option "theme" must be of type "object" but instead received "' + _typeof(options.theme) + '".');
4032     }
4033   }
4034 }
4035
4036 var getColorsHighlight = function getColorsHighlight(options) {
4037   return (
4038     // $FlowFixMe: Flow thinks keys from `Colors` are missing from `DEFAULT_THEME_KEYS`
4039     DEFAULT_THEME_KEYS.reduce(function (colors, key) {
4040       var value = options.theme && options.theme[key] !== undefined ? options.theme[key] : DEFAULT_THEME[key];
4041       var color = ansiStyles[value];
4042       if (color && typeof color.close === 'string' && typeof color.open === 'string') {
4043         colors[key] = color;
4044       } else {
4045         throw new Error('pretty-format: Option "theme" has a key "' + key + '" whose value "' + value + '" is undefined in ansi-styles.');
4046       }
4047       return colors;
4048     }, _Object$create(null))
4049   );
4050 };
4051
4052 var getColorsEmpty = function getColorsEmpty() {
4053   return (
4054     // $FlowFixMe: Flow thinks keys from `Colors` are missing from `DEFAULT_THEME_KEYS`
4055     DEFAULT_THEME_KEYS.reduce(function (colors, key) {
4056       colors[key] = { close: '', open: '' };
4057       return colors;
4058     }, _Object$create(null))
4059   );
4060 };
4061
4062 var getPrintFunctionName = function getPrintFunctionName(options) {
4063   return options && options.printFunctionName !== undefined ? options.printFunctionName : DEFAULT_OPTIONS.printFunctionName;
4064 };
4065
4066 var getEscapeRegex = function getEscapeRegex(options) {
4067   return options && options.escapeRegex !== undefined ? options.escapeRegex : DEFAULT_OPTIONS.escapeRegex;
4068 };
4069
4070 var getConfig = function getConfig(options) {
4071   return {
4072     callToJSON: options && options.callToJSON !== undefined ? options.callToJSON : DEFAULT_OPTIONS.callToJSON,
4073     colors: options && options.highlight ? getColorsHighlight(options) : getColorsEmpty(),
4074     escapeRegex: getEscapeRegex(options),
4075     indent: options && options.min ? '' : createIndent(options && options.indent !== undefined ? options.indent : DEFAULT_OPTIONS.indent),
4076     maxDepth: options && options.maxDepth !== undefined ? options.maxDepth : DEFAULT_OPTIONS.maxDepth,
4077     min: options && options.min !== undefined ? options.min : DEFAULT_OPTIONS.min,
4078     plugins: options && options.plugins !== undefined ? options.plugins : DEFAULT_OPTIONS.plugins,
4079     printFunctionName: getPrintFunctionName(options),
4080     spacingInner: options && options.min ? ' ' : '\n',
4081     spacingOuter: options && options.min ? '' : '\n'
4082   };
4083 };
4084
4085 function createIndent(indent) {
4086   return new Array(indent + 1).join(' ');
4087 }
4088
4089 function prettyFormat(val, options) {
4090   if (options) {
4091     validateOptions(options);
4092     if (options.plugins) {
4093       var plugin = findPlugin(options.plugins, val);
4094       if (plugin !== null) {
4095         return printPlugin(plugin, val, getConfig(options), '', 0, []);
4096       }
4097     }
4098   }
4099
4100   var basicResult = printBasicValue(val, getPrintFunctionName(options), getEscapeRegex(options));
4101   if (basicResult !== null) {
4102     return basicResult;
4103   }
4104
4105   return printComplexValue(val, getConfig(options), '', 0, []);
4106 }
4107
4108 prettyFormat.plugins = {
4109   AsymmetricMatcher: AsymmetricMatcher,
4110   ConvertAnsi: ConvertAnsi,
4111   DOMCollection: DOMCollection,
4112   DOMElement: DOMElement,
4113   Immutable: Immutable,
4114   ReactElement: ReactElement,
4115   ReactTestComponent: ReactTestComponent
4116 };
4117
4118 module.exports = prettyFormat;
4119
4120 })));