UNPKG

122 kBJavaScriptView Raw
1'use strict';
2
3Object.defineProperty(exports, '__esModule', { value: true });
4
5function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
6
7var timestring = _interopDefault(require('timestring'));
8
9function unwrapExports (x) {
10 return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
11}
12
13function createCommonjsModule(fn, module) {
14 return module = { exports: {} }, fn(module, module.exports), module.exports;
15}
16
17var _global = createCommonjsModule(function (module) {
18// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
19var global = module.exports = typeof window != 'undefined' && window.Math == Math
20 ? window : typeof self != 'undefined' && self.Math == Math ? self
21 // eslint-disable-next-line no-new-func
22 : Function('return this')();
23if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
24});
25
26var _global$1 = /*#__PURE__*/Object.freeze({
27 default: _global,
28 __moduleExports: _global
29});
30
31var _core = createCommonjsModule(function (module) {
32var core = module.exports = { version: '2.5.7' };
33if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
34});
35var _core_1 = _core.version;
36
37var _core$1 = /*#__PURE__*/Object.freeze({
38 default: _core,
39 __moduleExports: _core,
40 version: _core_1
41});
42
43var _isObject = function (it) {
44 return typeof it === 'object' ? it !== null : typeof it === 'function';
45};
46
47var _isObject$1 = /*#__PURE__*/Object.freeze({
48 default: _isObject,
49 __moduleExports: _isObject
50});
51
52var isObject = ( _isObject$1 && _isObject ) || _isObject$1;
53
54var _anObject = function (it) {
55 if (!isObject(it)) throw TypeError(it + ' is not an object!');
56 return it;
57};
58
59var _anObject$1 = /*#__PURE__*/Object.freeze({
60 default: _anObject,
61 __moduleExports: _anObject
62});
63
64var _fails = function (exec) {
65 try {
66 return !!exec();
67 } catch (e) {
68 return true;
69 }
70};
71
72var _fails$1 = /*#__PURE__*/Object.freeze({
73 default: _fails,
74 __moduleExports: _fails
75});
76
77var require$$1 = ( _fails$1 && _fails ) || _fails$1;
78
79// Thank's IE8 for his funny defineProperty
80var _descriptors = !require$$1(function () {
81 return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
82});
83
84var _descriptors$1 = /*#__PURE__*/Object.freeze({
85 default: _descriptors,
86 __moduleExports: _descriptors
87});
88
89var global$1 = ( _global$1 && _global ) || _global$1;
90
91var document = global$1.document;
92// typeof document.createElement is 'object' in old IE
93var is = isObject(document) && isObject(document.createElement);
94var _domCreate = function (it) {
95 return is ? document.createElement(it) : {};
96};
97
98var _domCreate$1 = /*#__PURE__*/Object.freeze({
99 default: _domCreate,
100 __moduleExports: _domCreate
101});
102
103var DESCRIPTORS = ( _descriptors$1 && _descriptors ) || _descriptors$1;
104
105var require$$2 = ( _domCreate$1 && _domCreate ) || _domCreate$1;
106
107var _ie8DomDefine = !DESCRIPTORS && !require$$1(function () {
108 return Object.defineProperty(require$$2('div'), 'a', { get: function () { return 7; } }).a != 7;
109});
110
111var _ie8DomDefine$1 = /*#__PURE__*/Object.freeze({
112 default: _ie8DomDefine,
113 __moduleExports: _ie8DomDefine
114});
115
116// 7.1.1 ToPrimitive(input [, PreferredType])
117
118// instead of the ES6 spec version, we didn't implement @@toPrimitive case
119// and the second argument - flag - preferred type is a string
120var _toPrimitive = function (it, S) {
121 if (!isObject(it)) return it;
122 var fn, val;
123 if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
124 if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
125 if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
126 throw TypeError("Can't convert object to primitive value");
127};
128
129var _toPrimitive$1 = /*#__PURE__*/Object.freeze({
130 default: _toPrimitive,
131 __moduleExports: _toPrimitive
132});
133
134var anObject = ( _anObject$1 && _anObject ) || _anObject$1;
135
136var IE8_DOM_DEFINE = ( _ie8DomDefine$1 && _ie8DomDefine ) || _ie8DomDefine$1;
137
138var toPrimitive = ( _toPrimitive$1 && _toPrimitive ) || _toPrimitive$1;
139
140var dP = Object.defineProperty;
141
142var f = DESCRIPTORS ? Object.defineProperty : function defineProperty(O, P, Attributes) {
143 anObject(O);
144 P = toPrimitive(P, true);
145 anObject(Attributes);
146 if (IE8_DOM_DEFINE) try {
147 return dP(O, P, Attributes);
148 } catch (e) { /* empty */ }
149 if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
150 if ('value' in Attributes) O[P] = Attributes.value;
151 return O;
152};
153
154var _objectDp = {
155 f: f
156};
157
158var _objectDp$1 = /*#__PURE__*/Object.freeze({
159 default: _objectDp,
160 __moduleExports: _objectDp,
161 f: f
162});
163
164var _propertyDesc = function (bitmap, value) {
165 return {
166 enumerable: !(bitmap & 1),
167 configurable: !(bitmap & 2),
168 writable: !(bitmap & 4),
169 value: value
170 };
171};
172
173var _propertyDesc$1 = /*#__PURE__*/Object.freeze({
174 default: _propertyDesc,
175 __moduleExports: _propertyDesc
176});
177
178var dP$1 = ( _objectDp$1 && _objectDp ) || _objectDp$1;
179
180var descriptor = ( _propertyDesc$1 && _propertyDesc ) || _propertyDesc$1;
181
182var _hide = DESCRIPTORS ? function (object, key, value) {
183 return dP$1.f(object, key, descriptor(1, value));
184} : function (object, key, value) {
185 object[key] = value;
186 return object;
187};
188
189var _hide$1 = /*#__PURE__*/Object.freeze({
190 default: _hide,
191 __moduleExports: _hide
192});
193
194var hasOwnProperty = {}.hasOwnProperty;
195var _has = function (it, key) {
196 return hasOwnProperty.call(it, key);
197};
198
199var _has$1 = /*#__PURE__*/Object.freeze({
200 default: _has,
201 __moduleExports: _has
202});
203
204var id = 0;
205var px = Math.random();
206var _uid = function (key) {
207 return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
208};
209
210var _uid$1 = /*#__PURE__*/Object.freeze({
211 default: _uid,
212 __moduleExports: _uid
213});
214
215var require$$0 = ( _hide$1 && _hide ) || _hide$1;
216
217var has = ( _has$1 && _has ) || _has$1;
218
219var uid = ( _uid$1 && _uid ) || _uid$1;
220
221var require$$1$1 = ( _core$1 && _core ) || _core$1;
222
223var _redefine = createCommonjsModule(function (module) {
224var SRC = uid('src');
225var TO_STRING = 'toString';
226var $toString = Function[TO_STRING];
227var TPL = ('' + $toString).split(TO_STRING);
228
229require$$1$1.inspectSource = function (it) {
230 return $toString.call(it);
231};
232
233(module.exports = function (O, key, val, safe) {
234 var isFunction = typeof val == 'function';
235 if (isFunction) has(val, 'name') || require$$0(val, 'name', key);
236 if (O[key] === val) return;
237 if (isFunction) has(val, SRC) || require$$0(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));
238 if (O === global$1) {
239 O[key] = val;
240 } else if (!safe) {
241 delete O[key];
242 require$$0(O, key, val);
243 } else if (O[key]) {
244 O[key] = val;
245 } else {
246 require$$0(O, key, val);
247 }
248// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
249})(Function.prototype, TO_STRING, function toString() {
250 return typeof this == 'function' && this[SRC] || $toString.call(this);
251});
252});
253
254var _redefine$1 = /*#__PURE__*/Object.freeze({
255 default: _redefine,
256 __moduleExports: _redefine
257});
258
259var _aFunction = function (it) {
260 if (typeof it != 'function') throw TypeError(it + ' is not a function!');
261 return it;
262};
263
264var _aFunction$1 = /*#__PURE__*/Object.freeze({
265 default: _aFunction,
266 __moduleExports: _aFunction
267});
268
269var aFunction = ( _aFunction$1 && _aFunction ) || _aFunction$1;
270
271// optional / simple context binding
272
273var _ctx = function (fn, that, length) {
274 aFunction(fn);
275 if (that === undefined) return fn;
276 switch (length) {
277 case 1: return function (a) {
278 return fn.call(that, a);
279 };
280 case 2: return function (a, b) {
281 return fn.call(that, a, b);
282 };
283 case 3: return function (a, b, c) {
284 return fn.call(that, a, b, c);
285 };
286 }
287 return function (/* ...args */) {
288 return fn.apply(that, arguments);
289 };
290};
291
292var _ctx$1 = /*#__PURE__*/Object.freeze({
293 default: _ctx,
294 __moduleExports: _ctx
295});
296
297var redefine = ( _redefine$1 && _redefine ) || _redefine$1;
298
299var require$$0$1 = ( _ctx$1 && _ctx ) || _ctx$1;
300
301var PROTOTYPE = 'prototype';
302
303var $export = function (type, name, source) {
304 var IS_FORCED = type & $export.F;
305 var IS_GLOBAL = type & $export.G;
306 var IS_STATIC = type & $export.S;
307 var IS_PROTO = type & $export.P;
308 var IS_BIND = type & $export.B;
309 var target = IS_GLOBAL ? global$1 : IS_STATIC ? global$1[name] || (global$1[name] = {}) : (global$1[name] || {})[PROTOTYPE];
310 var exports = IS_GLOBAL ? require$$1$1 : require$$1$1[name] || (require$$1$1[name] = {});
311 var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});
312 var key, own, out, exp;
313 if (IS_GLOBAL) source = name;
314 for (key in source) {
315 // contains in native
316 own = !IS_FORCED && target && target[key] !== undefined;
317 // export native or passed
318 out = (own ? target : source)[key];
319 // bind timers to global for call from export context
320 exp = IS_BIND && own ? require$$0$1(out, global$1) : IS_PROTO && typeof out == 'function' ? require$$0$1(Function.call, out) : out;
321 // extend global
322 if (target) redefine(target, key, out, type & $export.U);
323 // export
324 if (exports[key] != out) require$$0(exports, key, exp);
325 if (IS_PROTO && expProto[key] != out) expProto[key] = out;
326 }
327};
328global$1.core = require$$1$1;
329// type bitmap
330$export.F = 1; // forced
331$export.G = 2; // global
332$export.S = 4; // static
333$export.P = 8; // proto
334$export.B = 16; // bind
335$export.W = 32; // wrap
336$export.U = 64; // safe
337$export.R = 128; // real proto method for `library`
338var _export = $export;
339
340var _export$1 = /*#__PURE__*/Object.freeze({
341 default: _export,
342 __moduleExports: _export
343});
344
345// 7.2.1 RequireObjectCoercible(argument)
346var _defined = function (it) {
347 if (it == undefined) throw TypeError("Can't call method on " + it);
348 return it;
349};
350
351var _defined$1 = /*#__PURE__*/Object.freeze({
352 default: _defined,
353 __moduleExports: _defined
354});
355
356var defined = ( _defined$1 && _defined ) || _defined$1;
357
358// 7.1.13 ToObject(argument)
359
360var _toObject = function (it) {
361 return Object(defined(it));
362};
363
364var _toObject$1 = /*#__PURE__*/Object.freeze({
365 default: _toObject,
366 __moduleExports: _toObject
367});
368
369var $export$1 = ( _export$1 && _export ) || _export$1;
370
371var toObject = ( _toObject$1 && _toObject ) || _toObject$1;
372
373$export$1($export$1.P + $export$1.F * require$$1(function () {
374 return new Date(NaN).toJSON() !== null
375 || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1;
376}), 'Date', {
377 // eslint-disable-next-line no-unused-vars
378 toJSON: function toJSON(key) {
379 var O = toObject(this);
380 var pv = toPrimitive(O);
381 return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString();
382 }
383});
384
385var toString = {}.toString;
386
387var _cof = function (it) {
388 return toString.call(it).slice(8, -1);
389};
390
391var _cof$1 = /*#__PURE__*/Object.freeze({
392 default: _cof,
393 __moduleExports: _cof
394});
395
396var cof = ( _cof$1 && _cof ) || _cof$1;
397
398// fallback for non-array-like ES3 and non-enumerable old V8 strings
399
400// eslint-disable-next-line no-prototype-builtins
401var _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
402 return cof(it) == 'String' ? it.split('') : Object(it);
403};
404
405var _iobject$1 = /*#__PURE__*/Object.freeze({
406 default: _iobject,
407 __moduleExports: _iobject
408});
409
410var IObject = ( _iobject$1 && _iobject ) || _iobject$1;
411
412// to indexed object, toObject with fallback for non-array-like ES3 strings
413
414
415var _toIobject = function (it) {
416 return IObject(defined(it));
417};
418
419var _toIobject$1 = /*#__PURE__*/Object.freeze({
420 default: _toIobject,
421 __moduleExports: _toIobject
422});
423
424// 7.1.4 ToInteger
425var ceil = Math.ceil;
426var floor = Math.floor;
427var _toInteger = function (it) {
428 return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
429};
430
431var _toInteger$1 = /*#__PURE__*/Object.freeze({
432 default: _toInteger,
433 __moduleExports: _toInteger
434});
435
436var toInteger = ( _toInteger$1 && _toInteger ) || _toInteger$1;
437
438// 7.1.15 ToLength
439
440var min = Math.min;
441var _toLength = function (it) {
442 return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
443};
444
445var _toLength$1 = /*#__PURE__*/Object.freeze({
446 default: _toLength,
447 __moduleExports: _toLength
448});
449
450var max = Math.max;
451var min$1 = Math.min;
452var _toAbsoluteIndex = function (index, length) {
453 index = toInteger(index);
454 return index < 0 ? max(index + length, 0) : min$1(index, length);
455};
456
457var _toAbsoluteIndex$1 = /*#__PURE__*/Object.freeze({
458 default: _toAbsoluteIndex,
459 __moduleExports: _toAbsoluteIndex
460});
461
462var toIObject = ( _toIobject$1 && _toIobject ) || _toIobject$1;
463
464var toLength = ( _toLength$1 && _toLength ) || _toLength$1;
465
466var toAbsoluteIndex = ( _toAbsoluteIndex$1 && _toAbsoluteIndex ) || _toAbsoluteIndex$1;
467
468// false -> Array#indexOf
469// true -> Array#includes
470
471
472
473var _arrayIncludes = function (IS_INCLUDES) {
474 return function ($this, el, fromIndex) {
475 var O = toIObject($this);
476 var length = toLength(O.length);
477 var index = toAbsoluteIndex(fromIndex, length);
478 var value;
479 // Array#includes uses SameValueZero equality algorithm
480 // eslint-disable-next-line no-self-compare
481 if (IS_INCLUDES && el != el) while (length > index) {
482 value = O[index++];
483 // eslint-disable-next-line no-self-compare
484 if (value != value) return true;
485 // Array#indexOf ignores holes, Array#includes - not
486 } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
487 if (O[index] === el) return IS_INCLUDES || index || 0;
488 } return !IS_INCLUDES && -1;
489 };
490};
491
492var _arrayIncludes$1 = /*#__PURE__*/Object.freeze({
493 default: _arrayIncludes,
494 __moduleExports: _arrayIncludes
495});
496
497var _library = false;
498
499var _library$1 = /*#__PURE__*/Object.freeze({
500 default: _library,
501 __moduleExports: _library
502});
503
504var LIBRARY = ( _library$1 && _library ) || _library$1;
505
506var _shared = createCommonjsModule(function (module) {
507var SHARED = '__core-js_shared__';
508var store = global$1[SHARED] || (global$1[SHARED] = {});
509
510(module.exports = function (key, value) {
511 return store[key] || (store[key] = value !== undefined ? value : {});
512})('versions', []).push({
513 version: require$$1$1.version,
514 mode: LIBRARY ? 'pure' : 'global',
515 copyright: '© 2018 Denis Pushkarev (zloirock.ru)'
516});
517});
518
519var _shared$1 = /*#__PURE__*/Object.freeze({
520 default: _shared,
521 __moduleExports: _shared
522});
523
524var require$$0$2 = ( _shared$1 && _shared ) || _shared$1;
525
526var shared = require$$0$2('keys');
527
528var _sharedKey = function (key) {
529 return shared[key] || (shared[key] = uid(key));
530};
531
532var _sharedKey$1 = /*#__PURE__*/Object.freeze({
533 default: _sharedKey,
534 __moduleExports: _sharedKey
535});
536
537var require$$0$3 = ( _arrayIncludes$1 && _arrayIncludes ) || _arrayIncludes$1;
538
539var require$$0$4 = ( _sharedKey$1 && _sharedKey ) || _sharedKey$1;
540
541var arrayIndexOf = require$$0$3(false);
542var IE_PROTO = require$$0$4('IE_PROTO');
543
544var _objectKeysInternal = function (object, names) {
545 var O = toIObject(object);
546 var i = 0;
547 var result = [];
548 var key;
549 for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
550 // Don't enum bug & hidden keys
551 while (names.length > i) if (has(O, key = names[i++])) {
552 ~arrayIndexOf(result, key) || result.push(key);
553 }
554 return result;
555};
556
557var _objectKeysInternal$1 = /*#__PURE__*/Object.freeze({
558 default: _objectKeysInternal,
559 __moduleExports: _objectKeysInternal
560});
561
562// IE 8- don't enum bug keys
563var _enumBugKeys = (
564 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
565).split(',');
566
567var _enumBugKeys$1 = /*#__PURE__*/Object.freeze({
568 default: _enumBugKeys,
569 __moduleExports: _enumBugKeys
570});
571
572var $keys = ( _objectKeysInternal$1 && _objectKeysInternal ) || _objectKeysInternal$1;
573
574var require$$0$5 = ( _enumBugKeys$1 && _enumBugKeys ) || _enumBugKeys$1;
575
576// 19.1.2.14 / 15.2.3.14 Object.keys(O)
577
578
579
580var _objectKeys = Object.keys || function keys(O) {
581 return $keys(O, require$$0$5);
582};
583
584var _objectKeys$1 = /*#__PURE__*/Object.freeze({
585 default: _objectKeys,
586 __moduleExports: _objectKeys
587});
588
589var f$1 = Object.getOwnPropertySymbols;
590
591var _objectGops = {
592 f: f$1
593};
594
595var _objectGops$1 = /*#__PURE__*/Object.freeze({
596 default: _objectGops,
597 __moduleExports: _objectGops,
598 f: f$1
599});
600
601var f$2 = {}.propertyIsEnumerable;
602
603var _objectPie = {
604 f: f$2
605};
606
607var _objectPie$1 = /*#__PURE__*/Object.freeze({
608 default: _objectPie,
609 __moduleExports: _objectPie,
610 f: f$2
611});
612
613var getKeys = ( _objectKeys$1 && _objectKeys ) || _objectKeys$1;
614
615var gOPS = ( _objectGops$1 && _objectGops ) || _objectGops$1;
616
617var pIE = ( _objectPie$1 && _objectPie ) || _objectPie$1;
618
619// 19.1.2.1 Object.assign(target, source, ...)
620
621
622
623
624
625var $assign = Object.assign;
626
627// should work with symbols and should have deterministic property order (V8 bug)
628var _objectAssign = !$assign || require$$1(function () {
629 var A = {};
630 var B = {};
631 // eslint-disable-next-line no-undef
632 var S = Symbol();
633 var K = 'abcdefghijklmnopqrst';
634 A[S] = 7;
635 K.split('').forEach(function (k) { B[k] = k; });
636 return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
637}) ? function assign(target, source) { // eslint-disable-line no-unused-vars
638 var T = toObject(target);
639 var aLen = arguments.length;
640 var index = 1;
641 var getSymbols = gOPS.f;
642 var isEnum = pIE.f;
643 while (aLen > index) {
644 var S = IObject(arguments[index++]);
645 var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);
646 var length = keys.length;
647 var j = 0;
648 var key;
649 while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];
650 } return T;
651} : $assign;
652
653var _objectAssign$1 = /*#__PURE__*/Object.freeze({
654 default: _objectAssign,
655 __moduleExports: _objectAssign
656});
657
658var require$$0$6 = ( _objectAssign$1 && _objectAssign ) || _objectAssign$1;
659
660// 19.1.3.1 Object.assign(target, source)
661
662
663$export$1($export$1.S + $export$1.F, 'Object', { assign: require$$0$6 });
664
665function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
666 try {
667 var info = gen[key](arg);
668 var value = info.value;
669 } catch (error) {
670 reject(error);
671 return;
672 }
673
674 if (info.done) {
675 resolve(value);
676 } else {
677 Promise.resolve(value).then(_next, _throw);
678 }
679}
680
681function _asyncToGenerator(fn) {
682 return function () {
683 var self = this,
684 args = arguments;
685 return new Promise(function (resolve, reject) {
686 var gen = fn.apply(self, args);
687
688 function _next(value) {
689 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
690 }
691
692 function _throw(err) {
693 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
694 }
695
696 _next(undefined);
697 });
698 };
699}
700
701function _classCallCheck(instance, Constructor) {
702 if (!(instance instanceof Constructor)) {
703 throw new TypeError("Cannot call a class as a function");
704 }
705}
706
707function _defineProperties(target, props) {
708 for (var i = 0; i < props.length; i++) {
709 var descriptor = props[i];
710 descriptor.enumerable = descriptor.enumerable || false;
711 descriptor.configurable = true;
712 if ("value" in descriptor) descriptor.writable = true;
713 Object.defineProperty(target, descriptor.key, descriptor);
714 }
715}
716
717function _createClass(Constructor, protoProps, staticProps) {
718 if (protoProps) _defineProperties(Constructor.prototype, protoProps);
719 if (staticProps) _defineProperties(Constructor, staticProps);
720 return Constructor;
721}
722
723function _defineProperty(obj, key, value) {
724 if (key in obj) {
725 Object.defineProperty(obj, key, {
726 value: value,
727 enumerable: true,
728 configurable: true,
729 writable: true
730 });
731 } else {
732 obj[key] = value;
733 }
734
735 return obj;
736}
737
738function _inherits(subClass, superClass) {
739 if (typeof superClass !== "function" && superClass !== null) {
740 throw new TypeError("Super expression must either be null or a function");
741 }
742
743 subClass.prototype = Object.create(superClass && superClass.prototype, {
744 constructor: {
745 value: subClass,
746 writable: true,
747 configurable: true
748 }
749 });
750 if (superClass) _setPrototypeOf(subClass, superClass);
751}
752
753function _getPrototypeOf(o) {
754 _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
755 return o.__proto__ || Object.getPrototypeOf(o);
756 };
757 return _getPrototypeOf(o);
758}
759
760function _setPrototypeOf(o, p) {
761 _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
762 o.__proto__ = p;
763 return o;
764 };
765
766 return _setPrototypeOf(o, p);
767}
768
769function isNativeReflectConstruct() {
770 if (typeof Reflect === "undefined" || !Reflect.construct) return false;
771 if (Reflect.construct.sham) return false;
772 if (typeof Proxy === "function") return true;
773
774 try {
775 Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
776 return true;
777 } catch (e) {
778 return false;
779 }
780}
781
782function _construct(Parent, args, Class) {
783 if (isNativeReflectConstruct()) {
784 _construct = Reflect.construct;
785 } else {
786 _construct = function _construct(Parent, args, Class) {
787 var a = [null];
788 a.push.apply(a, args);
789 var Constructor = Function.bind.apply(Parent, a);
790 var instance = new Constructor();
791 if (Class) _setPrototypeOf(instance, Class.prototype);
792 return instance;
793 };
794 }
795
796 return _construct.apply(null, arguments);
797}
798
799function _isNativeFunction(fn) {
800 return Function.toString.call(fn).indexOf("[native code]") !== -1;
801}
802
803function _wrapNativeSuper(Class) {
804 var _cache = typeof Map === "function" ? new Map() : undefined;
805
806 _wrapNativeSuper = function _wrapNativeSuper(Class) {
807 if (Class === null || !_isNativeFunction(Class)) return Class;
808
809 if (typeof Class !== "function") {
810 throw new TypeError("Super expression must either be null or a function");
811 }
812
813 if (typeof _cache !== "undefined") {
814 if (_cache.has(Class)) return _cache.get(Class);
815
816 _cache.set(Class, Wrapper);
817 }
818
819 function Wrapper() {
820 return _construct(Class, arguments, _getPrototypeOf(this).constructor);
821 }
822
823 Wrapper.prototype = Object.create(Class.prototype, {
824 constructor: {
825 value: Wrapper,
826 enumerable: false,
827 writable: true,
828 configurable: true
829 }
830 });
831 return _setPrototypeOf(Wrapper, Class);
832 };
833
834 return _wrapNativeSuper(Class);
835}
836
837function _assertThisInitialized(self) {
838 if (self === void 0) {
839 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
840 }
841
842 return self;
843}
844
845function _possibleConstructorReturn(self, call) {
846 if (call && (typeof call === "object" || typeof call === "function")) {
847 return call;
848 }
849
850 return _assertThisInitialized(self);
851}
852
853function _superPropBase(object, property) {
854 while (!Object.prototype.hasOwnProperty.call(object, property)) {
855 object = _getPrototypeOf(object);
856 if (object === null) break;
857 }
858
859 return object;
860}
861
862function _get(target, property, receiver) {
863 if (typeof Reflect !== "undefined" && Reflect.get) {
864 _get = Reflect.get;
865 } else {
866 _get = function _get(target, property, receiver) {
867 var base = _superPropBase(target, property);
868
869 if (!base) return;
870 var desc = Object.getOwnPropertyDescriptor(base, property);
871
872 if (desc.get) {
873 return desc.get.call(receiver);
874 }
875
876 return desc.value;
877 };
878 }
879
880 return _get(target, property, receiver || target);
881}
882
883function _toConsumableArray(arr) {
884 return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
885}
886
887function _arrayWithoutHoles(arr) {
888 if (Array.isArray(arr)) {
889 for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
890
891 return arr2;
892 }
893}
894
895function _iterableToArray(iter) {
896 if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
897}
898
899function _nonIterableSpread() {
900 throw new TypeError("Invalid attempt to spread non-iterable instance");
901}
902
903var _wks = createCommonjsModule(function (module) {
904var store = require$$0$2('wks');
905
906var Symbol = global$1.Symbol;
907var USE_SYMBOL = typeof Symbol == 'function';
908
909var $exports = module.exports = function (name) {
910 return store[name] || (store[name] =
911 USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
912};
913
914$exports.store = store;
915});
916
917var _wks$1 = /*#__PURE__*/Object.freeze({
918 default: _wks,
919 __moduleExports: _wks
920});
921
922var require$$0$7 = ( _wks$1 && _wks ) || _wks$1;
923
924var f$3 = require$$0$7;
925
926var _wksExt = {
927 f: f$3
928};
929
930var _wksExt$1 = /*#__PURE__*/Object.freeze({
931 default: _wksExt,
932 __moduleExports: _wksExt,
933 f: f$3
934});
935
936var wksExt = ( _wksExt$1 && _wksExt ) || _wksExt$1;
937
938var defineProperty = dP$1.f;
939var _wksDefine = function (name) {
940 var $Symbol = require$$1$1.Symbol || (require$$1$1.Symbol = LIBRARY ? {} : global$1.Symbol || {});
941 if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });
942};
943
944var _wksDefine$1 = /*#__PURE__*/Object.freeze({
945 default: _wksDefine,
946 __moduleExports: _wksDefine
947});
948
949var wksDefine = ( _wksDefine$1 && _wksDefine ) || _wksDefine$1;
950
951wksDefine('asyncIterator');
952
953var _meta = createCommonjsModule(function (module) {
954var META = uid('meta');
955
956
957var setDesc = dP$1.f;
958var id = 0;
959var isExtensible = Object.isExtensible || function () {
960 return true;
961};
962var FREEZE = !require$$1(function () {
963 return isExtensible(Object.preventExtensions({}));
964});
965var setMeta = function (it) {
966 setDesc(it, META, { value: {
967 i: 'O' + ++id, // object ID
968 w: {} // weak collections IDs
969 } });
970};
971var fastKey = function (it, create) {
972 // return primitive with prefix
973 if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
974 if (!has(it, META)) {
975 // can't set metadata to uncaught frozen object
976 if (!isExtensible(it)) return 'F';
977 // not necessary to add metadata
978 if (!create) return 'E';
979 // add missing metadata
980 setMeta(it);
981 // return object ID
982 } return it[META].i;
983};
984var getWeak = function (it, create) {
985 if (!has(it, META)) {
986 // can't set metadata to uncaught frozen object
987 if (!isExtensible(it)) return true;
988 // not necessary to add metadata
989 if (!create) return false;
990 // add missing metadata
991 setMeta(it);
992 // return hash weak collections IDs
993 } return it[META].w;
994};
995// add metadata on freeze-family methods calling
996var onFreeze = function (it) {
997 if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);
998 return it;
999};
1000var meta = module.exports = {
1001 KEY: META,
1002 NEED: false,
1003 fastKey: fastKey,
1004 getWeak: getWeak,
1005 onFreeze: onFreeze
1006};
1007});
1008var _meta_1 = _meta.KEY;
1009var _meta_2 = _meta.NEED;
1010var _meta_3 = _meta.fastKey;
1011var _meta_4 = _meta.getWeak;
1012var _meta_5 = _meta.onFreeze;
1013
1014var _meta$1 = /*#__PURE__*/Object.freeze({
1015 default: _meta,
1016 __moduleExports: _meta,
1017 KEY: _meta_1,
1018 NEED: _meta_2,
1019 fastKey: _meta_3,
1020 getWeak: _meta_4,
1021 onFreeze: _meta_5
1022});
1023
1024var def = dP$1.f;
1025
1026var TAG = require$$0$7('toStringTag');
1027
1028var _setToStringTag = function (it, tag, stat) {
1029 if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
1030};
1031
1032var _setToStringTag$1 = /*#__PURE__*/Object.freeze({
1033 default: _setToStringTag,
1034 __moduleExports: _setToStringTag
1035});
1036
1037// all enumerable object keys, includes symbols
1038
1039
1040
1041var _enumKeys = function (it) {
1042 var result = getKeys(it);
1043 var getSymbols = gOPS.f;
1044 if (getSymbols) {
1045 var symbols = getSymbols(it);
1046 var isEnum = pIE.f;
1047 var i = 0;
1048 var key;
1049 while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);
1050 } return result;
1051};
1052
1053var _enumKeys$1 = /*#__PURE__*/Object.freeze({
1054 default: _enumKeys,
1055 __moduleExports: _enumKeys
1056});
1057
1058// 7.2.2 IsArray(argument)
1059
1060var _isArray = Array.isArray || function isArray(arg) {
1061 return cof(arg) == 'Array';
1062};
1063
1064var _isArray$1 = /*#__PURE__*/Object.freeze({
1065 default: _isArray,
1066 __moduleExports: _isArray
1067});
1068
1069var _objectDps = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {
1070 anObject(O);
1071 var keys = getKeys(Properties);
1072 var length = keys.length;
1073 var i = 0;
1074 var P;
1075 while (length > i) dP$1.f(O, P = keys[i++], Properties[P]);
1076 return O;
1077};
1078
1079var _objectDps$1 = /*#__PURE__*/Object.freeze({
1080 default: _objectDps,
1081 __moduleExports: _objectDps
1082});
1083
1084var document$1 = global$1.document;
1085var _html = document$1 && document$1.documentElement;
1086
1087var _html$1 = /*#__PURE__*/Object.freeze({
1088 default: _html,
1089 __moduleExports: _html
1090});
1091
1092var dPs = ( _objectDps$1 && _objectDps ) || _objectDps$1;
1093
1094var require$$2$1 = ( _html$1 && _html ) || _html$1;
1095
1096// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
1097
1098
1099
1100var IE_PROTO$1 = require$$0$4('IE_PROTO');
1101var Empty = function () { /* empty */ };
1102var PROTOTYPE$1 = 'prototype';
1103
1104// Create object with fake `null` prototype: use iframe Object with cleared prototype
1105var createDict = function () {
1106 // Thrash, waste and sodomy: IE GC bug
1107 var iframe = require$$2('iframe');
1108 var i = require$$0$5.length;
1109 var lt = '<';
1110 var gt = '>';
1111 var iframeDocument;
1112 iframe.style.display = 'none';
1113 require$$2$1.appendChild(iframe);
1114 iframe.src = 'javascript:'; // eslint-disable-line no-script-url
1115 // createDict = iframe.contentWindow.Object;
1116 // html.removeChild(iframe);
1117 iframeDocument = iframe.contentWindow.document;
1118 iframeDocument.open();
1119 iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
1120 iframeDocument.close();
1121 createDict = iframeDocument.F;
1122 while (i--) delete createDict[PROTOTYPE$1][require$$0$5[i]];
1123 return createDict();
1124};
1125
1126var _objectCreate = Object.create || function create(O, Properties) {
1127 var result;
1128 if (O !== null) {
1129 Empty[PROTOTYPE$1] = anObject(O);
1130 result = new Empty();
1131 Empty[PROTOTYPE$1] = null;
1132 // add "__proto__" for Object.getPrototypeOf polyfill
1133 result[IE_PROTO$1] = O;
1134 } else result = createDict();
1135 return Properties === undefined ? result : dPs(result, Properties);
1136};
1137
1138var _objectCreate$1 = /*#__PURE__*/Object.freeze({
1139 default: _objectCreate,
1140 __moduleExports: _objectCreate
1141});
1142
1143// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
1144
1145var hiddenKeys = require$$0$5.concat('length', 'prototype');
1146
1147var f$4 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
1148 return $keys(O, hiddenKeys);
1149};
1150
1151var _objectGopn = {
1152 f: f$4
1153};
1154
1155var _objectGopn$1 = /*#__PURE__*/Object.freeze({
1156 default: _objectGopn,
1157 __moduleExports: _objectGopn,
1158 f: f$4
1159});
1160
1161var require$$0$8 = ( _objectGopn$1 && _objectGopn ) || _objectGopn$1;
1162
1163// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
1164
1165var gOPN = require$$0$8.f;
1166var toString$1 = {}.toString;
1167
1168var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
1169 ? Object.getOwnPropertyNames(window) : [];
1170
1171var getWindowNames = function (it) {
1172 try {
1173 return gOPN(it);
1174 } catch (e) {
1175 return windowNames.slice();
1176 }
1177};
1178
1179var f$5 = function getOwnPropertyNames(it) {
1180 return windowNames && toString$1.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
1181};
1182
1183var _objectGopnExt = {
1184 f: f$5
1185};
1186
1187var _objectGopnExt$1 = /*#__PURE__*/Object.freeze({
1188 default: _objectGopnExt,
1189 __moduleExports: _objectGopnExt,
1190 f: f$5
1191});
1192
1193var gOPD = Object.getOwnPropertyDescriptor;
1194
1195var f$6 = DESCRIPTORS ? gOPD : function getOwnPropertyDescriptor(O, P) {
1196 O = toIObject(O);
1197 P = toPrimitive(P, true);
1198 if (IE8_DOM_DEFINE) try {
1199 return gOPD(O, P);
1200 } catch (e) { /* empty */ }
1201 if (has(O, P)) return descriptor(!pIE.f.call(O, P), O[P]);
1202};
1203
1204var _objectGopd = {
1205 f: f$6
1206};
1207
1208var _objectGopd$1 = /*#__PURE__*/Object.freeze({
1209 default: _objectGopd,
1210 __moduleExports: _objectGopd,
1211 f: f$6
1212});
1213
1214var meta = ( _meta$1 && _meta ) || _meta$1;
1215
1216var setToStringTag = ( _setToStringTag$1 && _setToStringTag ) || _setToStringTag$1;
1217
1218var enumKeys = ( _enumKeys$1 && _enumKeys ) || _enumKeys$1;
1219
1220var isArray = ( _isArray$1 && _isArray ) || _isArray$1;
1221
1222var create = ( _objectCreate$1 && _objectCreate ) || _objectCreate$1;
1223
1224var gOPNExt = ( _objectGopnExt$1 && _objectGopnExt ) || _objectGopnExt$1;
1225
1226var require$$1$2 = ( _objectGopd$1 && _objectGopd ) || _objectGopd$1;
1227
1228// ECMAScript 6 symbols shim
1229
1230
1231
1232
1233
1234var META = meta.KEY;
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254var gOPD$1 = require$$1$2.f;
1255var dP$2 = dP$1.f;
1256var gOPN$1 = gOPNExt.f;
1257var $Symbol = global$1.Symbol;
1258var $JSON = global$1.JSON;
1259var _stringify = $JSON && $JSON.stringify;
1260var PROTOTYPE$2 = 'prototype';
1261var HIDDEN = require$$0$7('_hidden');
1262var TO_PRIMITIVE = require$$0$7('toPrimitive');
1263var isEnum = {}.propertyIsEnumerable;
1264var SymbolRegistry = require$$0$2('symbol-registry');
1265var AllSymbols = require$$0$2('symbols');
1266var OPSymbols = require$$0$2('op-symbols');
1267var ObjectProto = Object[PROTOTYPE$2];
1268var USE_NATIVE = typeof $Symbol == 'function';
1269var QObject = global$1.QObject;
1270// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
1271var setter = !QObject || !QObject[PROTOTYPE$2] || !QObject[PROTOTYPE$2].findChild;
1272
1273// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
1274var setSymbolDesc = DESCRIPTORS && require$$1(function () {
1275 return create(dP$2({}, 'a', {
1276 get: function () { return dP$2(this, 'a', { value: 7 }).a; }
1277 })).a != 7;
1278}) ? function (it, key, D) {
1279 var protoDesc = gOPD$1(ObjectProto, key);
1280 if (protoDesc) delete ObjectProto[key];
1281 dP$2(it, key, D);
1282 if (protoDesc && it !== ObjectProto) dP$2(ObjectProto, key, protoDesc);
1283} : dP$2;
1284
1285var wrap = function (tag) {
1286 var sym = AllSymbols[tag] = create($Symbol[PROTOTYPE$2]);
1287 sym._k = tag;
1288 return sym;
1289};
1290
1291var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {
1292 return typeof it == 'symbol';
1293} : function (it) {
1294 return it instanceof $Symbol;
1295};
1296
1297var $defineProperty = function defineProperty(it, key, D) {
1298 if (it === ObjectProto) $defineProperty(OPSymbols, key, D);
1299 anObject(it);
1300 key = toPrimitive(key, true);
1301 anObject(D);
1302 if (has(AllSymbols, key)) {
1303 if (!D.enumerable) {
1304 if (!has(it, HIDDEN)) dP$2(it, HIDDEN, descriptor(1, {}));
1305 it[HIDDEN][key] = true;
1306 } else {
1307 if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;
1308 D = create(D, { enumerable: descriptor(0, false) });
1309 } return setSymbolDesc(it, key, D);
1310 } return dP$2(it, key, D);
1311};
1312var $defineProperties = function defineProperties(it, P) {
1313 anObject(it);
1314 var keys = enumKeys(P = toIObject(P));
1315 var i = 0;
1316 var l = keys.length;
1317 var key;
1318 while (l > i) $defineProperty(it, key = keys[i++], P[key]);
1319 return it;
1320};
1321var $create = function create$$1(it, P) {
1322 return P === undefined ? create(it) : $defineProperties(create(it), P);
1323};
1324var $propertyIsEnumerable = function propertyIsEnumerable(key) {
1325 var E = isEnum.call(this, key = toPrimitive(key, true));
1326 if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;
1327 return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
1328};
1329var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
1330 it = toIObject(it);
1331 key = toPrimitive(key, true);
1332 if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;
1333 var D = gOPD$1(it, key);
1334 if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
1335 return D;
1336};
1337var $getOwnPropertyNames = function getOwnPropertyNames(it) {
1338 var names = gOPN$1(toIObject(it));
1339 var result = [];
1340 var i = 0;
1341 var key;
1342 while (names.length > i) {
1343 if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);
1344 } return result;
1345};
1346var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
1347 var IS_OP = it === ObjectProto;
1348 var names = gOPN$1(IS_OP ? OPSymbols : toIObject(it));
1349 var result = [];
1350 var i = 0;
1351 var key;
1352 while (names.length > i) {
1353 if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);
1354 } return result;
1355};
1356
1357// 19.4.1.1 Symbol([description])
1358if (!USE_NATIVE) {
1359 $Symbol = function Symbol() {
1360 if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');
1361 var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
1362 var $set = function (value) {
1363 if (this === ObjectProto) $set.call(OPSymbols, value);
1364 if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
1365 setSymbolDesc(this, tag, descriptor(1, value));
1366 };
1367 if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });
1368 return wrap(tag);
1369 };
1370 redefine($Symbol[PROTOTYPE$2], 'toString', function toString() {
1371 return this._k;
1372 });
1373
1374 require$$1$2.f = $getOwnPropertyDescriptor;
1375 dP$1.f = $defineProperty;
1376 require$$0$8.f = gOPNExt.f = $getOwnPropertyNames;
1377 pIE.f = $propertyIsEnumerable;
1378 gOPS.f = $getOwnPropertySymbols;
1379
1380 if (DESCRIPTORS && !LIBRARY) {
1381 redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
1382 }
1383
1384 wksExt.f = function (name) {
1385 return wrap(require$$0$7(name));
1386 };
1387}
1388
1389$export$1($export$1.G + $export$1.W + $export$1.F * !USE_NATIVE, { Symbol: $Symbol });
1390
1391for (var es6Symbols = (
1392 // 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
1393 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
1394).split(','), j = 0; es6Symbols.length > j;)require$$0$7(es6Symbols[j++]);
1395
1396for (var wellKnownSymbols = getKeys(require$$0$7.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);
1397
1398$export$1($export$1.S + $export$1.F * !USE_NATIVE, 'Symbol', {
1399 // 19.4.2.1 Symbol.for(key)
1400 'for': function (key) {
1401 return has(SymbolRegistry, key += '')
1402 ? SymbolRegistry[key]
1403 : SymbolRegistry[key] = $Symbol(key);
1404 },
1405 // 19.4.2.5 Symbol.keyFor(sym)
1406 keyFor: function keyFor(sym) {
1407 if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');
1408 for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;
1409 },
1410 useSetter: function () { setter = true; },
1411 useSimple: function () { setter = false; }
1412});
1413
1414$export$1($export$1.S + $export$1.F * !USE_NATIVE, 'Object', {
1415 // 19.1.2.2 Object.create(O [, Properties])
1416 create: $create,
1417 // 19.1.2.4 Object.defineProperty(O, P, Attributes)
1418 defineProperty: $defineProperty,
1419 // 19.1.2.3 Object.defineProperties(O, Properties)
1420 defineProperties: $defineProperties,
1421 // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
1422 getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
1423 // 19.1.2.7 Object.getOwnPropertyNames(O)
1424 getOwnPropertyNames: $getOwnPropertyNames,
1425 // 19.1.2.8 Object.getOwnPropertySymbols(O)
1426 getOwnPropertySymbols: $getOwnPropertySymbols
1427});
1428
1429// 24.3.2 JSON.stringify(value [, replacer [, space]])
1430$JSON && $export$1($export$1.S + $export$1.F * (!USE_NATIVE || require$$1(function () {
1431 var S = $Symbol();
1432 // MS Edge converts symbol values to JSON as {}
1433 // WebKit converts symbol values to JSON as null
1434 // V8 throws on boxed symbols
1435 return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';
1436})), 'JSON', {
1437 stringify: function stringify(it) {
1438 var args = [it];
1439 var i = 1;
1440 var replacer, $replacer;
1441 while (arguments.length > i) args.push(arguments[i++]);
1442 $replacer = replacer = args[1];
1443 if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
1444 if (!isArray(replacer)) replacer = function (key, value) {
1445 if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
1446 if (!isSymbol(value)) return value;
1447 };
1448 args[1] = replacer;
1449 return _stringify.apply($JSON, args);
1450 }
1451});
1452
1453// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
1454$Symbol[PROTOTYPE$2][TO_PRIMITIVE] || require$$0($Symbol[PROTOTYPE$2], TO_PRIMITIVE, $Symbol[PROTOTYPE$2].valueOf);
1455// 19.4.3.5 Symbol.prototype[@@toStringTag]
1456setToStringTag($Symbol, 'Symbol');
1457// 20.2.1.9 Math[@@toStringTag]
1458setToStringTag(Math, 'Math', true);
1459// 24.3.3 JSON[@@toStringTag]
1460setToStringTag(global$1.JSON, 'JSON', true);
1461
1462// 22.1.3.31 Array.prototype[@@unscopables]
1463var UNSCOPABLES = require$$0$7('unscopables');
1464var ArrayProto = Array.prototype;
1465if (ArrayProto[UNSCOPABLES] == undefined) require$$0(ArrayProto, UNSCOPABLES, {});
1466var _addToUnscopables = function (key) {
1467 ArrayProto[UNSCOPABLES][key] = true;
1468};
1469
1470var _addToUnscopables$1 = /*#__PURE__*/Object.freeze({
1471 default: _addToUnscopables,
1472 __moduleExports: _addToUnscopables
1473});
1474
1475var _iterStep = function (done, value) {
1476 return { value: value, done: !!done };
1477};
1478
1479var _iterStep$1 = /*#__PURE__*/Object.freeze({
1480 default: _iterStep,
1481 __moduleExports: _iterStep
1482});
1483
1484var _iterators = {};
1485
1486var _iterators$1 = /*#__PURE__*/Object.freeze({
1487 default: _iterators,
1488 __moduleExports: _iterators
1489});
1490
1491var IteratorPrototype = {};
1492
1493// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
1494require$$0(IteratorPrototype, require$$0$7('iterator'), function () { return this; });
1495
1496var _iterCreate = function (Constructor, NAME, next) {
1497 Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
1498 setToStringTag(Constructor, NAME + ' Iterator');
1499};
1500
1501var _iterCreate$1 = /*#__PURE__*/Object.freeze({
1502 default: _iterCreate,
1503 __moduleExports: _iterCreate
1504});
1505
1506// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
1507
1508
1509var IE_PROTO$2 = require$$0$4('IE_PROTO');
1510var ObjectProto$1 = Object.prototype;
1511
1512var _objectGpo = Object.getPrototypeOf || function (O) {
1513 O = toObject(O);
1514 if (has(O, IE_PROTO$2)) return O[IE_PROTO$2];
1515 if (typeof O.constructor == 'function' && O instanceof O.constructor) {
1516 return O.constructor.prototype;
1517 } return O instanceof Object ? ObjectProto$1 : null;
1518};
1519
1520var _objectGpo$1 = /*#__PURE__*/Object.freeze({
1521 default: _objectGpo,
1522 __moduleExports: _objectGpo
1523});
1524
1525var Iterators = ( _iterators$1 && _iterators ) || _iterators$1;
1526
1527var $iterCreate = ( _iterCreate$1 && _iterCreate ) || _iterCreate$1;
1528
1529var getPrototypeOf = ( _objectGpo$1 && _objectGpo ) || _objectGpo$1;
1530
1531var ITERATOR = require$$0$7('iterator');
1532var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
1533var FF_ITERATOR = '@@iterator';
1534var KEYS = 'keys';
1535var VALUES = 'values';
1536
1537var returnThis = function () { return this; };
1538
1539var _iterDefine = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
1540 $iterCreate(Constructor, NAME, next);
1541 var getMethod = function (kind) {
1542 if (!BUGGY && kind in proto) return proto[kind];
1543 switch (kind) {
1544 case KEYS: return function keys() { return new Constructor(this, kind); };
1545 case VALUES: return function values() { return new Constructor(this, kind); };
1546 } return function entries() { return new Constructor(this, kind); };
1547 };
1548 var TAG = NAME + ' Iterator';
1549 var DEF_VALUES = DEFAULT == VALUES;
1550 var VALUES_BUG = false;
1551 var proto = Base.prototype;
1552 var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
1553 var $default = $native || getMethod(DEFAULT);
1554 var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
1555 var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
1556 var methods, key, IteratorPrototype;
1557 // Fix native
1558 if ($anyNative) {
1559 IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
1560 if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
1561 // Set @@toStringTag to native iterators
1562 setToStringTag(IteratorPrototype, TAG, true);
1563 // fix for some old engines
1564 if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') require$$0(IteratorPrototype, ITERATOR, returnThis);
1565 }
1566 }
1567 // fix Array#{values, @@iterator}.name in V8 / FF
1568 if (DEF_VALUES && $native && $native.name !== VALUES) {
1569 VALUES_BUG = true;
1570 $default = function values() { return $native.call(this); };
1571 }
1572 // Define iterator
1573 if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
1574 require$$0(proto, ITERATOR, $default);
1575 }
1576 // Plug for library
1577 Iterators[NAME] = $default;
1578 Iterators[TAG] = returnThis;
1579 if (DEFAULT) {
1580 methods = {
1581 values: DEF_VALUES ? $default : getMethod(VALUES),
1582 keys: IS_SET ? $default : getMethod(KEYS),
1583 entries: $entries
1584 };
1585 if (FORCED) for (key in methods) {
1586 if (!(key in proto)) redefine(proto, key, methods[key]);
1587 } else $export$1($export$1.P + $export$1.F * (BUGGY || VALUES_BUG), NAME, methods);
1588 }
1589 return methods;
1590};
1591
1592var _iterDefine$1 = /*#__PURE__*/Object.freeze({
1593 default: _iterDefine,
1594 __moduleExports: _iterDefine
1595});
1596
1597var require$$1$3 = ( _addToUnscopables$1 && _addToUnscopables ) || _addToUnscopables$1;
1598
1599var step = ( _iterStep$1 && _iterStep ) || _iterStep$1;
1600
1601var $iterDefine = ( _iterDefine$1 && _iterDefine ) || _iterDefine$1;
1602
1603// 22.1.3.4 Array.prototype.entries()
1604// 22.1.3.13 Array.prototype.keys()
1605// 22.1.3.29 Array.prototype.values()
1606// 22.1.3.30 Array.prototype[@@iterator]()
1607var es6_array_iterator = $iterDefine(Array, 'Array', function (iterated, kind) {
1608 this._t = toIObject(iterated); // target
1609 this._i = 0; // next index
1610 this._k = kind; // kind
1611// 22.1.5.2.1 %ArrayIteratorPrototype%.next()
1612}, function () {
1613 var O = this._t;
1614 var kind = this._k;
1615 var index = this._i++;
1616 if (!O || index >= O.length) {
1617 this._t = undefined;
1618 return step(1);
1619 }
1620 if (kind == 'keys') return step(0, index);
1621 if (kind == 'values') return step(0, O[index]);
1622 return step(0, [index, O[index]]);
1623}, 'values');
1624
1625// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
1626Iterators.Arguments = Iterators.Array;
1627
1628require$$1$3('keys');
1629require$$1$3('values');
1630require$$1$3('entries');
1631
1632var es6_array_iterator$1 = /*#__PURE__*/Object.freeze({
1633 default: es6_array_iterator,
1634 __moduleExports: es6_array_iterator
1635});
1636
1637var $iterators = ( es6_array_iterator$1 && es6_array_iterator ) || es6_array_iterator$1;
1638
1639var ITERATOR$1 = require$$0$7('iterator');
1640var TO_STRING_TAG = require$$0$7('toStringTag');
1641var ArrayValues = Iterators.Array;
1642
1643var DOMIterables = {
1644 CSSRuleList: true, // TODO: Not spec compliant, should be false.
1645 CSSStyleDeclaration: false,
1646 CSSValueList: false,
1647 ClientRectList: false,
1648 DOMRectList: false,
1649 DOMStringList: false,
1650 DOMTokenList: true,
1651 DataTransferItemList: false,
1652 FileList: false,
1653 HTMLAllCollection: false,
1654 HTMLCollection: false,
1655 HTMLFormElement: false,
1656 HTMLSelectElement: false,
1657 MediaList: true, // TODO: Not spec compliant, should be false.
1658 MimeTypeArray: false,
1659 NamedNodeMap: false,
1660 NodeList: true,
1661 PaintRequestList: false,
1662 Plugin: false,
1663 PluginArray: false,
1664 SVGLengthList: false,
1665 SVGNumberList: false,
1666 SVGPathSegList: false,
1667 SVGPointList: false,
1668 SVGStringList: false,
1669 SVGTransformList: false,
1670 SourceBufferList: false,
1671 StyleSheetList: true, // TODO: Not spec compliant, should be false.
1672 TextTrackCueList: false,
1673 TextTrackList: false,
1674 TouchList: false
1675};
1676
1677for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {
1678 var NAME = collections[i];
1679 var explicit = DOMIterables[NAME];
1680 var Collection = global$1[NAME];
1681 var proto = Collection && Collection.prototype;
1682 var key;
1683 if (proto) {
1684 if (!proto[ITERATOR$1]) require$$0(proto, ITERATOR$1, ArrayValues);
1685 if (!proto[TO_STRING_TAG]) require$$0(proto, TO_STRING_TAG, NAME);
1686 Iterators[NAME] = ArrayValues;
1687 if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true);
1688 }
1689}
1690
1691// 22.1.2.2 / 15.4.3.2 Array.isArray(arg)
1692
1693
1694$export$1($export$1.S, 'Array', { isArray: isArray });
1695
1696var SPECIES = require$$0$7('species');
1697
1698var _arraySpeciesConstructor = function (original) {
1699 var C;
1700 if (isArray(original)) {
1701 C = original.constructor;
1702 // cross-realm fallback
1703 if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
1704 if (isObject(C)) {
1705 C = C[SPECIES];
1706 if (C === null) C = undefined;
1707 }
1708 } return C === undefined ? Array : C;
1709};
1710
1711var _arraySpeciesConstructor$1 = /*#__PURE__*/Object.freeze({
1712 default: _arraySpeciesConstructor,
1713 __moduleExports: _arraySpeciesConstructor
1714});
1715
1716var speciesConstructor = ( _arraySpeciesConstructor$1 && _arraySpeciesConstructor ) || _arraySpeciesConstructor$1;
1717
1718// 9.4.2.3 ArraySpeciesCreate(originalArray, length)
1719
1720
1721var _arraySpeciesCreate = function (original, length) {
1722 return new (speciesConstructor(original))(length);
1723};
1724
1725var _arraySpeciesCreate$1 = /*#__PURE__*/Object.freeze({
1726 default: _arraySpeciesCreate,
1727 __moduleExports: _arraySpeciesCreate
1728});
1729
1730var asc = ( _arraySpeciesCreate$1 && _arraySpeciesCreate ) || _arraySpeciesCreate$1;
1731
1732// 0 -> Array#forEach
1733// 1 -> Array#map
1734// 2 -> Array#filter
1735// 3 -> Array#some
1736// 4 -> Array#every
1737// 5 -> Array#find
1738// 6 -> Array#findIndex
1739
1740
1741
1742
1743
1744var _arrayMethods = function (TYPE, $create) {
1745 var IS_MAP = TYPE == 1;
1746 var IS_FILTER = TYPE == 2;
1747 var IS_SOME = TYPE == 3;
1748 var IS_EVERY = TYPE == 4;
1749 var IS_FIND_INDEX = TYPE == 6;
1750 var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
1751 var create = $create || asc;
1752 return function ($this, callbackfn, that) {
1753 var O = toObject($this);
1754 var self = IObject(O);
1755 var f = require$$0$1(callbackfn, that, 3);
1756 var length = toLength(self.length);
1757 var index = 0;
1758 var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
1759 var val, res;
1760 for (;length > index; index++) if (NO_HOLES || index in self) {
1761 val = self[index];
1762 res = f(val, index, O);
1763 if (TYPE) {
1764 if (IS_MAP) result[index] = res; // map
1765 else if (res) switch (TYPE) {
1766 case 3: return true; // some
1767 case 5: return val; // find
1768 case 6: return index; // findIndex
1769 case 2: result.push(val); // filter
1770 } else if (IS_EVERY) return false; // every
1771 }
1772 }
1773 return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
1774 };
1775};
1776
1777var _arrayMethods$1 = /*#__PURE__*/Object.freeze({
1778 default: _arrayMethods,
1779 __moduleExports: _arrayMethods
1780});
1781
1782var _strictMethod = function (method, arg) {
1783 return !!method && require$$1(function () {
1784 // eslint-disable-next-line no-useless-call
1785 arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null);
1786 });
1787};
1788
1789var _strictMethod$1 = /*#__PURE__*/Object.freeze({
1790 default: _strictMethod,
1791 __moduleExports: _strictMethod
1792});
1793
1794var require$$0$9 = ( _arrayMethods$1 && _arrayMethods ) || _arrayMethods$1;
1795
1796var require$$1$4 = ( _strictMethod$1 && _strictMethod ) || _strictMethod$1;
1797
1798var $forEach = require$$0$9(0);
1799var STRICT = require$$1$4([].forEach, true);
1800
1801$export$1($export$1.P + $export$1.F * !STRICT, 'Array', {
1802 // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg])
1803 forEach: function forEach(callbackfn /* , thisArg */) {
1804 return $forEach(this, callbackfn, arguments[1]);
1805 }
1806});
1807
1808var runtime = createCommonjsModule(function (module) {
1809/**
1810 * Copyright (c) 2014-present, Facebook, Inc.
1811 *
1812 * This source code is licensed under the MIT license found in the
1813 * LICENSE file in the root directory of this source tree.
1814 */
1815
1816!(function(global) {
1817
1818 var Op = Object.prototype;
1819 var hasOwn = Op.hasOwnProperty;
1820 var undefined; // More compressible than void 0.
1821 var $Symbol = typeof Symbol === "function" ? Symbol : {};
1822 var iteratorSymbol = $Symbol.iterator || "@@iterator";
1823 var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
1824 var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
1825 var runtime = global.regeneratorRuntime;
1826 if (runtime) {
1827 {
1828 // If regeneratorRuntime is defined globally and we're in a module,
1829 // make the exports object identical to regeneratorRuntime.
1830 module.exports = runtime;
1831 }
1832 // Don't bother evaluating the rest of this file if the runtime was
1833 // already defined globally.
1834 return;
1835 }
1836
1837 // Define the runtime globally (as expected by generated code) as either
1838 // module.exports (if we're in a module) or a new, empty object.
1839 runtime = global.regeneratorRuntime = module.exports;
1840
1841 function wrap(innerFn, outerFn, self, tryLocsList) {
1842 // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
1843 var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
1844 var generator = Object.create(protoGenerator.prototype);
1845 var context = new Context(tryLocsList || []);
1846
1847 // The ._invoke method unifies the implementations of the .next,
1848 // .throw, and .return methods.
1849 generator._invoke = makeInvokeMethod(innerFn, self, context);
1850
1851 return generator;
1852 }
1853 runtime.wrap = wrap;
1854
1855 // Try/catch helper to minimize deoptimizations. Returns a completion
1856 // record like context.tryEntries[i].completion. This interface could
1857 // have been (and was previously) designed to take a closure to be
1858 // invoked without arguments, but in all the cases we care about we
1859 // already have an existing method we want to call, so there's no need
1860 // to create a new function object. We can even get away with assuming
1861 // the method takes exactly one argument, since that happens to be true
1862 // in every case, so we don't have to touch the arguments object. The
1863 // only additional allocation required is the completion record, which
1864 // has a stable shape and so hopefully should be cheap to allocate.
1865 function tryCatch(fn, obj, arg) {
1866 try {
1867 return { type: "normal", arg: fn.call(obj, arg) };
1868 } catch (err) {
1869 return { type: "throw", arg: err };
1870 }
1871 }
1872
1873 var GenStateSuspendedStart = "suspendedStart";
1874 var GenStateSuspendedYield = "suspendedYield";
1875 var GenStateExecuting = "executing";
1876 var GenStateCompleted = "completed";
1877
1878 // Returning this object from the innerFn has the same effect as
1879 // breaking out of the dispatch switch statement.
1880 var ContinueSentinel = {};
1881
1882 // Dummy constructor functions that we use as the .constructor and
1883 // .constructor.prototype properties for functions that return Generator
1884 // objects. For full spec compliance, you may wish to configure your
1885 // minifier not to mangle the names of these two functions.
1886 function Generator() {}
1887 function GeneratorFunction() {}
1888 function GeneratorFunctionPrototype() {}
1889
1890 // This is a polyfill for %IteratorPrototype% for environments that
1891 // don't natively support it.
1892 var IteratorPrototype = {};
1893 IteratorPrototype[iteratorSymbol] = function () {
1894 return this;
1895 };
1896
1897 var getProto = Object.getPrototypeOf;
1898 var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
1899 if (NativeIteratorPrototype &&
1900 NativeIteratorPrototype !== Op &&
1901 hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
1902 // This environment has a native %IteratorPrototype%; use it instead
1903 // of the polyfill.
1904 IteratorPrototype = NativeIteratorPrototype;
1905 }
1906
1907 var Gp = GeneratorFunctionPrototype.prototype =
1908 Generator.prototype = Object.create(IteratorPrototype);
1909 GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
1910 GeneratorFunctionPrototype.constructor = GeneratorFunction;
1911 GeneratorFunctionPrototype[toStringTagSymbol] =
1912 GeneratorFunction.displayName = "GeneratorFunction";
1913
1914 // Helper for defining the .next, .throw, and .return methods of the
1915 // Iterator interface in terms of a single ._invoke method.
1916 function defineIteratorMethods(prototype) {
1917 ["next", "throw", "return"].forEach(function(method) {
1918 prototype[method] = function(arg) {
1919 return this._invoke(method, arg);
1920 };
1921 });
1922 }
1923
1924 runtime.isGeneratorFunction = function(genFun) {
1925 var ctor = typeof genFun === "function" && genFun.constructor;
1926 return ctor
1927 ? ctor === GeneratorFunction ||
1928 // For the native GeneratorFunction constructor, the best we can
1929 // do is to check its .name property.
1930 (ctor.displayName || ctor.name) === "GeneratorFunction"
1931 : false;
1932 };
1933
1934 runtime.mark = function(genFun) {
1935 if (Object.setPrototypeOf) {
1936 Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
1937 } else {
1938 genFun.__proto__ = GeneratorFunctionPrototype;
1939 if (!(toStringTagSymbol in genFun)) {
1940 genFun[toStringTagSymbol] = "GeneratorFunction";
1941 }
1942 }
1943 genFun.prototype = Object.create(Gp);
1944 return genFun;
1945 };
1946
1947 // Within the body of any async function, `await x` is transformed to
1948 // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
1949 // `hasOwn.call(value, "__await")` to determine if the yielded value is
1950 // meant to be awaited.
1951 runtime.awrap = function(arg) {
1952 return { __await: arg };
1953 };
1954
1955 function AsyncIterator(generator) {
1956 function invoke(method, arg, resolve, reject) {
1957 var record = tryCatch(generator[method], generator, arg);
1958 if (record.type === "throw") {
1959 reject(record.arg);
1960 } else {
1961 var result = record.arg;
1962 var value = result.value;
1963 if (value &&
1964 typeof value === "object" &&
1965 hasOwn.call(value, "__await")) {
1966 return Promise.resolve(value.__await).then(function(value) {
1967 invoke("next", value, resolve, reject);
1968 }, function(err) {
1969 invoke("throw", err, resolve, reject);
1970 });
1971 }
1972
1973 return Promise.resolve(value).then(function(unwrapped) {
1974 // When a yielded Promise is resolved, its final value becomes
1975 // the .value of the Promise<{value,done}> result for the
1976 // current iteration. If the Promise is rejected, however, the
1977 // result for this iteration will be rejected with the same
1978 // reason. Note that rejections of yielded Promises are not
1979 // thrown back into the generator function, as is the case
1980 // when an awaited Promise is rejected. This difference in
1981 // behavior between yield and await is important, because it
1982 // allows the consumer to decide what to do with the yielded
1983 // rejection (swallow it and continue, manually .throw it back
1984 // into the generator, abandon iteration, whatever). With
1985 // await, by contrast, there is no opportunity to examine the
1986 // rejection reason outside the generator function, so the
1987 // only option is to throw it from the await expression, and
1988 // let the generator function handle the exception.
1989 result.value = unwrapped;
1990 resolve(result);
1991 }, reject);
1992 }
1993 }
1994
1995 var previousPromise;
1996
1997 function enqueue(method, arg) {
1998 function callInvokeWithMethodAndArg() {
1999 return new Promise(function(resolve, reject) {
2000 invoke(method, arg, resolve, reject);
2001 });
2002 }
2003
2004 return previousPromise =
2005 // If enqueue has been called before, then we want to wait until
2006 // all previous Promises have been resolved before calling invoke,
2007 // so that results are always delivered in the correct order. If
2008 // enqueue has not been called before, then it is important to
2009 // call invoke immediately, without waiting on a callback to fire,
2010 // so that the async generator function has the opportunity to do
2011 // any necessary setup in a predictable way. This predictability
2012 // is why the Promise constructor synchronously invokes its
2013 // executor callback, and why async functions synchronously
2014 // execute code before the first await. Since we implement simple
2015 // async functions in terms of async generators, it is especially
2016 // important to get this right, even though it requires care.
2017 previousPromise ? previousPromise.then(
2018 callInvokeWithMethodAndArg,
2019 // Avoid propagating failures to Promises returned by later
2020 // invocations of the iterator.
2021 callInvokeWithMethodAndArg
2022 ) : callInvokeWithMethodAndArg();
2023 }
2024
2025 // Define the unified helper method that is used to implement .next,
2026 // .throw, and .return (see defineIteratorMethods).
2027 this._invoke = enqueue;
2028 }
2029
2030 defineIteratorMethods(AsyncIterator.prototype);
2031 AsyncIterator.prototype[asyncIteratorSymbol] = function () {
2032 return this;
2033 };
2034 runtime.AsyncIterator = AsyncIterator;
2035
2036 // Note that simple async functions are implemented on top of
2037 // AsyncIterator objects; they just return a Promise for the value of
2038 // the final result produced by the iterator.
2039 runtime.async = function(innerFn, outerFn, self, tryLocsList) {
2040 var iter = new AsyncIterator(
2041 wrap(innerFn, outerFn, self, tryLocsList)
2042 );
2043
2044 return runtime.isGeneratorFunction(outerFn)
2045 ? iter // If outerFn is a generator, return the full iterator.
2046 : iter.next().then(function(result) {
2047 return result.done ? result.value : iter.next();
2048 });
2049 };
2050
2051 function makeInvokeMethod(innerFn, self, context) {
2052 var state = GenStateSuspendedStart;
2053
2054 return function invoke(method, arg) {
2055 if (state === GenStateExecuting) {
2056 throw new Error("Generator is already running");
2057 }
2058
2059 if (state === GenStateCompleted) {
2060 if (method === "throw") {
2061 throw arg;
2062 }
2063
2064 // Be forgiving, per 25.3.3.3.3 of the spec:
2065 // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
2066 return doneResult();
2067 }
2068
2069 context.method = method;
2070 context.arg = arg;
2071
2072 while (true) {
2073 var delegate = context.delegate;
2074 if (delegate) {
2075 var delegateResult = maybeInvokeDelegate(delegate, context);
2076 if (delegateResult) {
2077 if (delegateResult === ContinueSentinel) continue;
2078 return delegateResult;
2079 }
2080 }
2081
2082 if (context.method === "next") {
2083 // Setting context._sent for legacy support of Babel's
2084 // function.sent implementation.
2085 context.sent = context._sent = context.arg;
2086
2087 } else if (context.method === "throw") {
2088 if (state === GenStateSuspendedStart) {
2089 state = GenStateCompleted;
2090 throw context.arg;
2091 }
2092
2093 context.dispatchException(context.arg);
2094
2095 } else if (context.method === "return") {
2096 context.abrupt("return", context.arg);
2097 }
2098
2099 state = GenStateExecuting;
2100
2101 var record = tryCatch(innerFn, self, context);
2102 if (record.type === "normal") {
2103 // If an exception is thrown from innerFn, we leave state ===
2104 // GenStateExecuting and loop back for another invocation.
2105 state = context.done
2106 ? GenStateCompleted
2107 : GenStateSuspendedYield;
2108
2109 if (record.arg === ContinueSentinel) {
2110 continue;
2111 }
2112
2113 return {
2114 value: record.arg,
2115 done: context.done
2116 };
2117
2118 } else if (record.type === "throw") {
2119 state = GenStateCompleted;
2120 // Dispatch the exception by looping back around to the
2121 // context.dispatchException(context.arg) call above.
2122 context.method = "throw";
2123 context.arg = record.arg;
2124 }
2125 }
2126 };
2127 }
2128
2129 // Call delegate.iterator[context.method](context.arg) and handle the
2130 // result, either by returning a { value, done } result from the
2131 // delegate iterator, or by modifying context.method and context.arg,
2132 // setting context.delegate to null, and returning the ContinueSentinel.
2133 function maybeInvokeDelegate(delegate, context) {
2134 var method = delegate.iterator[context.method];
2135 if (method === undefined) {
2136 // A .throw or .return when the delegate iterator has no .throw
2137 // method always terminates the yield* loop.
2138 context.delegate = null;
2139
2140 if (context.method === "throw") {
2141 if (delegate.iterator.return) {
2142 // If the delegate iterator has a return method, give it a
2143 // chance to clean up.
2144 context.method = "return";
2145 context.arg = undefined;
2146 maybeInvokeDelegate(delegate, context);
2147
2148 if (context.method === "throw") {
2149 // If maybeInvokeDelegate(context) changed context.method from
2150 // "return" to "throw", let that override the TypeError below.
2151 return ContinueSentinel;
2152 }
2153 }
2154
2155 context.method = "throw";
2156 context.arg = new TypeError(
2157 "The iterator does not provide a 'throw' method");
2158 }
2159
2160 return ContinueSentinel;
2161 }
2162
2163 var record = tryCatch(method, delegate.iterator, context.arg);
2164
2165 if (record.type === "throw") {
2166 context.method = "throw";
2167 context.arg = record.arg;
2168 context.delegate = null;
2169 return ContinueSentinel;
2170 }
2171
2172 var info = record.arg;
2173
2174 if (! info) {
2175 context.method = "throw";
2176 context.arg = new TypeError("iterator result is not an object");
2177 context.delegate = null;
2178 return ContinueSentinel;
2179 }
2180
2181 if (info.done) {
2182 // Assign the result of the finished delegate to the temporary
2183 // variable specified by delegate.resultName (see delegateYield).
2184 context[delegate.resultName] = info.value;
2185
2186 // Resume execution at the desired location (see delegateYield).
2187 context.next = delegate.nextLoc;
2188
2189 // If context.method was "throw" but the delegate handled the
2190 // exception, let the outer generator proceed normally. If
2191 // context.method was "next", forget context.arg since it has been
2192 // "consumed" by the delegate iterator. If context.method was
2193 // "return", allow the original .return call to continue in the
2194 // outer generator.
2195 if (context.method !== "return") {
2196 context.method = "next";
2197 context.arg = undefined;
2198 }
2199
2200 } else {
2201 // Re-yield the result returned by the delegate method.
2202 return info;
2203 }
2204
2205 // The delegate iterator is finished, so forget it and continue with
2206 // the outer generator.
2207 context.delegate = null;
2208 return ContinueSentinel;
2209 }
2210
2211 // Define Generator.prototype.{next,throw,return} in terms of the
2212 // unified ._invoke helper method.
2213 defineIteratorMethods(Gp);
2214
2215 Gp[toStringTagSymbol] = "Generator";
2216
2217 // A Generator should always return itself as the iterator object when the
2218 // @@iterator function is called on it. Some browsers' implementations of the
2219 // iterator prototype chain incorrectly implement this, causing the Generator
2220 // object to not be returned from this call. This ensures that doesn't happen.
2221 // See https://github.com/facebook/regenerator/issues/274 for more details.
2222 Gp[iteratorSymbol] = function() {
2223 return this;
2224 };
2225
2226 Gp.toString = function() {
2227 return "[object Generator]";
2228 };
2229
2230 function pushTryEntry(locs) {
2231 var entry = { tryLoc: locs[0] };
2232
2233 if (1 in locs) {
2234 entry.catchLoc = locs[1];
2235 }
2236
2237 if (2 in locs) {
2238 entry.finallyLoc = locs[2];
2239 entry.afterLoc = locs[3];
2240 }
2241
2242 this.tryEntries.push(entry);
2243 }
2244
2245 function resetTryEntry(entry) {
2246 var record = entry.completion || {};
2247 record.type = "normal";
2248 delete record.arg;
2249 entry.completion = record;
2250 }
2251
2252 function Context(tryLocsList) {
2253 // The root entry object (effectively a try statement without a catch
2254 // or a finally block) gives us a place to store values thrown from
2255 // locations where there is no enclosing try statement.
2256 this.tryEntries = [{ tryLoc: "root" }];
2257 tryLocsList.forEach(pushTryEntry, this);
2258 this.reset(true);
2259 }
2260
2261 runtime.keys = function(object) {
2262 var keys = [];
2263 for (var key in object) {
2264 keys.push(key);
2265 }
2266 keys.reverse();
2267
2268 // Rather than returning an object with a next method, we keep
2269 // things simple and return the next function itself.
2270 return function next() {
2271 while (keys.length) {
2272 var key = keys.pop();
2273 if (key in object) {
2274 next.value = key;
2275 next.done = false;
2276 return next;
2277 }
2278 }
2279
2280 // To avoid creating an additional object, we just hang the .value
2281 // and .done properties off the next function object itself. This
2282 // also ensures that the minifier will not anonymize the function.
2283 next.done = true;
2284 return next;
2285 };
2286 };
2287
2288 function values(iterable) {
2289 if (iterable) {
2290 var iteratorMethod = iterable[iteratorSymbol];
2291 if (iteratorMethod) {
2292 return iteratorMethod.call(iterable);
2293 }
2294
2295 if (typeof iterable.next === "function") {
2296 return iterable;
2297 }
2298
2299 if (!isNaN(iterable.length)) {
2300 var i = -1, next = function next() {
2301 while (++i < iterable.length) {
2302 if (hasOwn.call(iterable, i)) {
2303 next.value = iterable[i];
2304 next.done = false;
2305 return next;
2306 }
2307 }
2308
2309 next.value = undefined;
2310 next.done = true;
2311
2312 return next;
2313 };
2314
2315 return next.next = next;
2316 }
2317 }
2318
2319 // Return an iterator with no values.
2320 return { next: doneResult };
2321 }
2322 runtime.values = values;
2323
2324 function doneResult() {
2325 return { value: undefined, done: true };
2326 }
2327
2328 Context.prototype = {
2329 constructor: Context,
2330
2331 reset: function(skipTempReset) {
2332 this.prev = 0;
2333 this.next = 0;
2334 // Resetting context._sent for legacy support of Babel's
2335 // function.sent implementation.
2336 this.sent = this._sent = undefined;
2337 this.done = false;
2338 this.delegate = null;
2339
2340 this.method = "next";
2341 this.arg = undefined;
2342
2343 this.tryEntries.forEach(resetTryEntry);
2344
2345 if (!skipTempReset) {
2346 for (var name in this) {
2347 // Not sure about the optimal order of these conditions:
2348 if (name.charAt(0) === "t" &&
2349 hasOwn.call(this, name) &&
2350 !isNaN(+name.slice(1))) {
2351 this[name] = undefined;
2352 }
2353 }
2354 }
2355 },
2356
2357 stop: function() {
2358 this.done = true;
2359
2360 var rootEntry = this.tryEntries[0];
2361 var rootRecord = rootEntry.completion;
2362 if (rootRecord.type === "throw") {
2363 throw rootRecord.arg;
2364 }
2365
2366 return this.rval;
2367 },
2368
2369 dispatchException: function(exception) {
2370 if (this.done) {
2371 throw exception;
2372 }
2373
2374 var context = this;
2375 function handle(loc, caught) {
2376 record.type = "throw";
2377 record.arg = exception;
2378 context.next = loc;
2379
2380 if (caught) {
2381 // If the dispatched exception was caught by a catch block,
2382 // then let that catch block handle the exception normally.
2383 context.method = "next";
2384 context.arg = undefined;
2385 }
2386
2387 return !! caught;
2388 }
2389
2390 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2391 var entry = this.tryEntries[i];
2392 var record = entry.completion;
2393
2394 if (entry.tryLoc === "root") {
2395 // Exception thrown outside of any try block that could handle
2396 // it, so set the completion value of the entire function to
2397 // throw the exception.
2398 return handle("end");
2399 }
2400
2401 if (entry.tryLoc <= this.prev) {
2402 var hasCatch = hasOwn.call(entry, "catchLoc");
2403 var hasFinally = hasOwn.call(entry, "finallyLoc");
2404
2405 if (hasCatch && hasFinally) {
2406 if (this.prev < entry.catchLoc) {
2407 return handle(entry.catchLoc, true);
2408 } else if (this.prev < entry.finallyLoc) {
2409 return handle(entry.finallyLoc);
2410 }
2411
2412 } else if (hasCatch) {
2413 if (this.prev < entry.catchLoc) {
2414 return handle(entry.catchLoc, true);
2415 }
2416
2417 } else if (hasFinally) {
2418 if (this.prev < entry.finallyLoc) {
2419 return handle(entry.finallyLoc);
2420 }
2421
2422 } else {
2423 throw new Error("try statement without catch or finally");
2424 }
2425 }
2426 }
2427 },
2428
2429 abrupt: function(type, arg) {
2430 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2431 var entry = this.tryEntries[i];
2432 if (entry.tryLoc <= this.prev &&
2433 hasOwn.call(entry, "finallyLoc") &&
2434 this.prev < entry.finallyLoc) {
2435 var finallyEntry = entry;
2436 break;
2437 }
2438 }
2439
2440 if (finallyEntry &&
2441 (type === "break" ||
2442 type === "continue") &&
2443 finallyEntry.tryLoc <= arg &&
2444 arg <= finallyEntry.finallyLoc) {
2445 // Ignore the finally entry if control is not jumping to a
2446 // location outside the try/catch block.
2447 finallyEntry = null;
2448 }
2449
2450 var record = finallyEntry ? finallyEntry.completion : {};
2451 record.type = type;
2452 record.arg = arg;
2453
2454 if (finallyEntry) {
2455 this.method = "next";
2456 this.next = finallyEntry.finallyLoc;
2457 return ContinueSentinel;
2458 }
2459
2460 return this.complete(record);
2461 },
2462
2463 complete: function(record, afterLoc) {
2464 if (record.type === "throw") {
2465 throw record.arg;
2466 }
2467
2468 if (record.type === "break" ||
2469 record.type === "continue") {
2470 this.next = record.arg;
2471 } else if (record.type === "return") {
2472 this.rval = this.arg = record.arg;
2473 this.method = "return";
2474 this.next = "end";
2475 } else if (record.type === "normal" && afterLoc) {
2476 this.next = afterLoc;
2477 }
2478
2479 return ContinueSentinel;
2480 },
2481
2482 finish: function(finallyLoc) {
2483 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2484 var entry = this.tryEntries[i];
2485 if (entry.finallyLoc === finallyLoc) {
2486 this.complete(entry.completion, entry.afterLoc);
2487 resetTryEntry(entry);
2488 return ContinueSentinel;
2489 }
2490 }
2491 },
2492
2493 "catch": function(tryLoc) {
2494 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2495 var entry = this.tryEntries[i];
2496 if (entry.tryLoc === tryLoc) {
2497 var record = entry.completion;
2498 if (record.type === "throw") {
2499 var thrown = record.arg;
2500 resetTryEntry(entry);
2501 }
2502 return thrown;
2503 }
2504 }
2505
2506 // The context.catch method must only be called with a location
2507 // argument that corresponds to a known catch block.
2508 throw new Error("illegal catch attempt");
2509 },
2510
2511 delegateYield: function(iterable, resultName, nextLoc) {
2512 this.delegate = {
2513 iterator: values(iterable),
2514 resultName: resultName,
2515 nextLoc: nextLoc
2516 };
2517
2518 if (this.method === "next") {
2519 // Deliberately forget the last sent value so that we don't
2520 // accidentally pass it on to the delegate.
2521 this.arg = undefined;
2522 }
2523
2524 return ContinueSentinel;
2525 }
2526 };
2527})(
2528 // In sloppy mode, unbound `this` refers to the global object, fallback to
2529 // Function constructor if we're in global strict mode. That is sadly a form
2530 // of indirect eval which violates Content Security Policy.
2531 (function() { return this })() || Function("return this")()
2532);
2533});
2534
2535// true -> String#at
2536// false -> String#codePointAt
2537var _stringAt = function (TO_STRING) {
2538 return function (that, pos) {
2539 var s = String(defined(that));
2540 var i = toInteger(pos);
2541 var l = s.length;
2542 var a, b;
2543 if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
2544 a = s.charCodeAt(i);
2545 return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
2546 ? TO_STRING ? s.charAt(i) : a
2547 : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
2548 };
2549};
2550
2551var _stringAt$1 = /*#__PURE__*/Object.freeze({
2552 default: _stringAt,
2553 __moduleExports: _stringAt
2554});
2555
2556var require$$0$a = ( _stringAt$1 && _stringAt ) || _stringAt$1;
2557
2558var $at = require$$0$a(true);
2559
2560// 21.1.3.27 String.prototype[@@iterator]()
2561$iterDefine(String, 'String', function (iterated) {
2562 this._t = String(iterated); // target
2563 this._i = 0; // next index
2564// 21.1.5.2.1 %StringIteratorPrototype%.next()
2565}, function () {
2566 var O = this._t;
2567 var index = this._i;
2568 var point;
2569 if (index >= O.length) return { value: undefined, done: true };
2570 point = $at(O, index);
2571 this._i += point.length;
2572 return { value: point, done: false };
2573});
2574
2575var _redefineAll = function (target, src, safe) {
2576 for (var key in src) redefine(target, key, src[key], safe);
2577 return target;
2578};
2579
2580var _redefineAll$1 = /*#__PURE__*/Object.freeze({
2581 default: _redefineAll,
2582 __moduleExports: _redefineAll
2583});
2584
2585var _anInstance = function (it, Constructor, name, forbiddenField) {
2586 if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {
2587 throw TypeError(name + ': incorrect invocation!');
2588 } return it;
2589};
2590
2591var _anInstance$1 = /*#__PURE__*/Object.freeze({
2592 default: _anInstance,
2593 __moduleExports: _anInstance
2594});
2595
2596// call something on iterator step with safe closing on error
2597
2598var _iterCall = function (iterator, fn, value, entries) {
2599 try {
2600 return entries ? fn(anObject(value)[0], value[1]) : fn(value);
2601 // 7.4.6 IteratorClose(iterator, completion)
2602 } catch (e) {
2603 var ret = iterator['return'];
2604 if (ret !== undefined) anObject(ret.call(iterator));
2605 throw e;
2606 }
2607};
2608
2609var _iterCall$1 = /*#__PURE__*/Object.freeze({
2610 default: _iterCall,
2611 __moduleExports: _iterCall
2612});
2613
2614// check on default Array iterator
2615
2616var ITERATOR$2 = require$$0$7('iterator');
2617var ArrayProto$1 = Array.prototype;
2618
2619var _isArrayIter = function (it) {
2620 return it !== undefined && (Iterators.Array === it || ArrayProto$1[ITERATOR$2] === it);
2621};
2622
2623var _isArrayIter$1 = /*#__PURE__*/Object.freeze({
2624 default: _isArrayIter,
2625 __moduleExports: _isArrayIter
2626});
2627
2628// getting tag from 19.1.3.6 Object.prototype.toString()
2629
2630var TAG$1 = require$$0$7('toStringTag');
2631// ES3 wrong here
2632var ARG = cof(function () { return arguments; }()) == 'Arguments';
2633
2634// fallback for IE11 Script Access Denied error
2635var tryGet = function (it, key) {
2636 try {
2637 return it[key];
2638 } catch (e) { /* empty */ }
2639};
2640
2641var _classof = function (it) {
2642 var O, T, B;
2643 return it === undefined ? 'Undefined' : it === null ? 'Null'
2644 // @@toStringTag case
2645 : typeof (T = tryGet(O = Object(it), TAG$1)) == 'string' ? T
2646 // builtinTag case
2647 : ARG ? cof(O)
2648 // ES3 arguments fallback
2649 : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
2650};
2651
2652var _classof$1 = /*#__PURE__*/Object.freeze({
2653 default: _classof,
2654 __moduleExports: _classof
2655});
2656
2657var classof = ( _classof$1 && _classof ) || _classof$1;
2658
2659var ITERATOR$3 = require$$0$7('iterator');
2660
2661var core_getIteratorMethod = require$$1$1.getIteratorMethod = function (it) {
2662 if (it != undefined) return it[ITERATOR$3]
2663 || it['@@iterator']
2664 || Iterators[classof(it)];
2665};
2666
2667var core_getIteratorMethod$1 = /*#__PURE__*/Object.freeze({
2668 default: core_getIteratorMethod,
2669 __moduleExports: core_getIteratorMethod
2670});
2671
2672var call = ( _iterCall$1 && _iterCall ) || _iterCall$1;
2673
2674var isArrayIter = ( _isArrayIter$1 && _isArrayIter ) || _isArrayIter$1;
2675
2676var getIterFn = ( core_getIteratorMethod$1 && core_getIteratorMethod ) || core_getIteratorMethod$1;
2677
2678var _forOf = createCommonjsModule(function (module) {
2679var BREAK = {};
2680var RETURN = {};
2681var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
2682 var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);
2683 var f = require$$0$1(fn, that, entries ? 2 : 1);
2684 var index = 0;
2685 var length, step, iterator, result;
2686 if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');
2687 // fast case for arrays with default iterator
2688 if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {
2689 result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
2690 if (result === BREAK || result === RETURN) return result;
2691 } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {
2692 result = call(iterator, f, step.value, entries);
2693 if (result === BREAK || result === RETURN) return result;
2694 }
2695};
2696exports.BREAK = BREAK;
2697exports.RETURN = RETURN;
2698});
2699
2700var _forOf$1 = /*#__PURE__*/Object.freeze({
2701 default: _forOf,
2702 __moduleExports: _forOf
2703});
2704
2705var SPECIES$1 = require$$0$7('species');
2706
2707var _setSpecies = function (KEY) {
2708 var C = global$1[KEY];
2709 if (DESCRIPTORS && C && !C[SPECIES$1]) dP$1.f(C, SPECIES$1, {
2710 configurable: true,
2711 get: function () { return this; }
2712 });
2713};
2714
2715var _setSpecies$1 = /*#__PURE__*/Object.freeze({
2716 default: _setSpecies,
2717 __moduleExports: _setSpecies
2718});
2719
2720var _validateCollection = function (it, TYPE) {
2721 if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');
2722 return it;
2723};
2724
2725var _validateCollection$1 = /*#__PURE__*/Object.freeze({
2726 default: _validateCollection,
2727 __moduleExports: _validateCollection
2728});
2729
2730var redefineAll = ( _redefineAll$1 && _redefineAll ) || _redefineAll$1;
2731
2732var anInstance = ( _anInstance$1 && _anInstance ) || _anInstance$1;
2733
2734var forOf = ( _forOf$1 && _forOf ) || _forOf$1;
2735
2736var setSpecies = ( _setSpecies$1 && _setSpecies ) || _setSpecies$1;
2737
2738var validate = ( _validateCollection$1 && _validateCollection ) || _validateCollection$1;
2739
2740var dP$3 = dP$1.f;
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750var fastKey = meta.fastKey;
2751
2752var SIZE = DESCRIPTORS ? '_s' : 'size';
2753
2754var getEntry = function (that, key) {
2755 // fast case
2756 var index = fastKey(key);
2757 var entry;
2758 if (index !== 'F') return that._i[index];
2759 // frozen object case
2760 for (entry = that._f; entry; entry = entry.n) {
2761 if (entry.k == key) return entry;
2762 }
2763};
2764
2765var _collectionStrong = {
2766 getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {
2767 var C = wrapper(function (that, iterable) {
2768 anInstance(that, C, NAME, '_i');
2769 that._t = NAME; // collection type
2770 that._i = create(null); // index
2771 that._f = undefined; // first entry
2772 that._l = undefined; // last entry
2773 that[SIZE] = 0; // size
2774 if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
2775 });
2776 redefineAll(C.prototype, {
2777 // 23.1.3.1 Map.prototype.clear()
2778 // 23.2.3.2 Set.prototype.clear()
2779 clear: function clear() {
2780 for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {
2781 entry.r = true;
2782 if (entry.p) entry.p = entry.p.n = undefined;
2783 delete data[entry.i];
2784 }
2785 that._f = that._l = undefined;
2786 that[SIZE] = 0;
2787 },
2788 // 23.1.3.3 Map.prototype.delete(key)
2789 // 23.2.3.4 Set.prototype.delete(value)
2790 'delete': function (key) {
2791 var that = validate(this, NAME);
2792 var entry = getEntry(that, key);
2793 if (entry) {
2794 var next = entry.n;
2795 var prev = entry.p;
2796 delete that._i[entry.i];
2797 entry.r = true;
2798 if (prev) prev.n = next;
2799 if (next) next.p = prev;
2800 if (that._f == entry) that._f = next;
2801 if (that._l == entry) that._l = prev;
2802 that[SIZE]--;
2803 } return !!entry;
2804 },
2805 // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
2806 // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
2807 forEach: function forEach(callbackfn /* , that = undefined */) {
2808 validate(this, NAME);
2809 var f = require$$0$1(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
2810 var entry;
2811 while (entry = entry ? entry.n : this._f) {
2812 f(entry.v, entry.k, this);
2813 // revert to the last existing entry
2814 while (entry && entry.r) entry = entry.p;
2815 }
2816 },
2817 // 23.1.3.7 Map.prototype.has(key)
2818 // 23.2.3.7 Set.prototype.has(value)
2819 has: function has(key) {
2820 return !!getEntry(validate(this, NAME), key);
2821 }
2822 });
2823 if (DESCRIPTORS) dP$3(C.prototype, 'size', {
2824 get: function () {
2825 return validate(this, NAME)[SIZE];
2826 }
2827 });
2828 return C;
2829 },
2830 def: function (that, key, value) {
2831 var entry = getEntry(that, key);
2832 var prev, index;
2833 // change existing entry
2834 if (entry) {
2835 entry.v = value;
2836 // create new entry
2837 } else {
2838 that._l = entry = {
2839 i: index = fastKey(key, true), // <- index
2840 k: key, // <- key
2841 v: value, // <- value
2842 p: prev = that._l, // <- previous entry
2843 n: undefined, // <- next entry
2844 r: false // <- removed
2845 };
2846 if (!that._f) that._f = entry;
2847 if (prev) prev.n = entry;
2848 that[SIZE]++;
2849 // add to index
2850 if (index !== 'F') that._i[index] = entry;
2851 } return that;
2852 },
2853 getEntry: getEntry,
2854 setStrong: function (C, NAME, IS_MAP) {
2855 // add .keys, .values, .entries, [@@iterator]
2856 // 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
2857 $iterDefine(C, NAME, function (iterated, kind) {
2858 this._t = validate(iterated, NAME); // target
2859 this._k = kind; // kind
2860 this._l = undefined; // previous
2861 }, function () {
2862 var that = this;
2863 var kind = that._k;
2864 var entry = that._l;
2865 // revert to the last existing entry
2866 while (entry && entry.r) entry = entry.p;
2867 // get next entry
2868 if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {
2869 // or finish the iteration
2870 that._t = undefined;
2871 return step(1);
2872 }
2873 // return step by kind
2874 if (kind == 'keys') return step(0, entry.k);
2875 if (kind == 'values') return step(0, entry.v);
2876 return step(0, [entry.k, entry.v]);
2877 }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
2878
2879 // add [@@species], 23.1.2.2, 23.2.2.2
2880 setSpecies(NAME);
2881 }
2882};
2883var _collectionStrong_1 = _collectionStrong.getConstructor;
2884var _collectionStrong_2 = _collectionStrong.def;
2885var _collectionStrong_3 = _collectionStrong.getEntry;
2886var _collectionStrong_4 = _collectionStrong.setStrong;
2887
2888var _collectionStrong$1 = /*#__PURE__*/Object.freeze({
2889 default: _collectionStrong,
2890 __moduleExports: _collectionStrong,
2891 getConstructor: _collectionStrong_1,
2892 def: _collectionStrong_2,
2893 getEntry: _collectionStrong_3,
2894 setStrong: _collectionStrong_4
2895});
2896
2897var ITERATOR$4 = require$$0$7('iterator');
2898var SAFE_CLOSING = false;
2899
2900try {
2901 var riter = [7][ITERATOR$4]();
2902 riter['return'] = function () { SAFE_CLOSING = true; };
2903} catch (e) { /* empty */ }
2904
2905var _iterDetect = function (exec, skipClosing) {
2906 if (!skipClosing && !SAFE_CLOSING) return false;
2907 var safe = false;
2908 try {
2909 var arr = [7];
2910 var iter = arr[ITERATOR$4]();
2911 iter.next = function () { return { done: safe = true }; };
2912 arr[ITERATOR$4] = function () { return iter; };
2913 exec(arr);
2914 } catch (e) { /* empty */ }
2915 return safe;
2916};
2917
2918var _iterDetect$1 = /*#__PURE__*/Object.freeze({
2919 default: _iterDetect,
2920 __moduleExports: _iterDetect
2921});
2922
2923// Works with __proto__ only. Old v8 can't work with null proto objects.
2924/* eslint-disable no-proto */
2925
2926
2927var check = function (O, proto) {
2928 anObject(O);
2929 if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!");
2930};
2931var _setProto = {
2932 set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line
2933 function (test, buggy, set) {
2934 try {
2935 set = require$$0$1(Function.call, require$$1$2.f(Object.prototype, '__proto__').set, 2);
2936 set(test, []);
2937 buggy = !(test instanceof Array);
2938 } catch (e) { buggy = true; }
2939 return function setPrototypeOf(O, proto) {
2940 check(O, proto);
2941 if (buggy) O.__proto__ = proto;
2942 else set(O, proto);
2943 return O;
2944 };
2945 }({}, false) : undefined),
2946 check: check
2947};
2948var _setProto_1 = _setProto.set;
2949var _setProto_2 = _setProto.check;
2950
2951var _setProto$1 = /*#__PURE__*/Object.freeze({
2952 default: _setProto,
2953 __moduleExports: _setProto,
2954 set: _setProto_1,
2955 check: _setProto_2
2956});
2957
2958var require$$0$b = ( _setProto$1 && _setProto ) || _setProto$1;
2959
2960var setPrototypeOf = require$$0$b.set;
2961var _inheritIfRequired = function (that, target, C) {
2962 var S = target.constructor;
2963 var P;
2964 if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) {
2965 setPrototypeOf(that, P);
2966 } return that;
2967};
2968
2969var _inheritIfRequired$1 = /*#__PURE__*/Object.freeze({
2970 default: _inheritIfRequired,
2971 __moduleExports: _inheritIfRequired
2972});
2973
2974var $iterDetect = ( _iterDetect$1 && _iterDetect ) || _iterDetect$1;
2975
2976var inheritIfRequired = ( _inheritIfRequired$1 && _inheritIfRequired ) || _inheritIfRequired$1;
2977
2978var _collection = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {
2979 var Base = global$1[NAME];
2980 var C = Base;
2981 var ADDER = IS_MAP ? 'set' : 'add';
2982 var proto = C && C.prototype;
2983 var O = {};
2984 var fixMethod = function (KEY) {
2985 var fn = proto[KEY];
2986 redefine(proto, KEY,
2987 KEY == 'delete' ? function (a) {
2988 return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
2989 } : KEY == 'has' ? function has(a) {
2990 return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
2991 } : KEY == 'get' ? function get(a) {
2992 return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);
2993 } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; }
2994 : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; }
2995 );
2996 };
2997 if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !require$$1(function () {
2998 new C().entries().next();
2999 }))) {
3000 // create collection constructor
3001 C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);
3002 redefineAll(C.prototype, methods);
3003 meta.NEED = true;
3004 } else {
3005 var instance = new C();
3006 // early implementations not supports chaining
3007 var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;
3008 // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
3009 var THROWS_ON_PRIMITIVES = require$$1(function () { instance.has(1); });
3010 // most early implementations doesn't supports iterables, most modern - not close it correctly
3011 var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new
3012 // for early implementations -0 and +0 not the same
3013 var BUGGY_ZERO = !IS_WEAK && require$$1(function () {
3014 // V8 ~ Chromium 42- fails only with 5+ elements
3015 var $instance = new C();
3016 var index = 5;
3017 while (index--) $instance[ADDER](index, index);
3018 return !$instance.has(-0);
3019 });
3020 if (!ACCEPT_ITERABLES) {
3021 C = wrapper(function (target, iterable) {
3022 anInstance(target, C, NAME);
3023 var that = inheritIfRequired(new Base(), target, C);
3024 if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
3025 return that;
3026 });
3027 C.prototype = proto;
3028 proto.constructor = C;
3029 }
3030 if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {
3031 fixMethod('delete');
3032 fixMethod('has');
3033 IS_MAP && fixMethod('get');
3034 }
3035 if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);
3036 // weak collections should not contains .clear method
3037 if (IS_WEAK && proto.clear) delete proto.clear;
3038 }
3039
3040 setToStringTag(C, NAME);
3041
3042 O[NAME] = C;
3043 $export$1($export$1.G + $export$1.W + $export$1.F * (C != Base), O);
3044
3045 if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);
3046
3047 return C;
3048};
3049
3050var _collection$1 = /*#__PURE__*/Object.freeze({
3051 default: _collection,
3052 __moduleExports: _collection
3053});
3054
3055var strong = ( _collectionStrong$1 && _collectionStrong ) || _collectionStrong$1;
3056
3057var require$$0$c = ( _collection$1 && _collection ) || _collection$1;
3058
3059var SET = 'Set';
3060
3061// 23.2 Set Objects
3062var es6_set = require$$0$c(SET, function (get) {
3063 return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
3064}, {
3065 // 23.2.3.1 Set.prototype.add(value)
3066 add: function add(value) {
3067 return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value);
3068 }
3069}, strong);
3070
3071var $some = require$$0$9(3);
3072
3073$export$1($export$1.P + $export$1.F * !require$$1$4([].some, true), 'Array', {
3074 // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg])
3075 some: function some(callbackfn /* , thisArg */) {
3076 return $some(this, callbackfn, arguments[1]);
3077 }
3078});
3079
3080var $sort = [].sort;
3081var test = [1, 2, 3];
3082
3083$export$1($export$1.P + $export$1.F * (require$$1(function () {
3084 // IE8-
3085 test.sort(undefined);
3086}) || !require$$1(function () {
3087 // V8 bug
3088 test.sort(null);
3089 // Old WebKit
3090}) || !require$$1$4($sort)), 'Array', {
3091 // 22.1.3.25 Array.prototype.sort(comparefn)
3092 sort: function sort(comparefn) {
3093 return comparefn === undefined
3094 ? $sort.call(toObject(this))
3095 : $sort.call(toObject(this), aFunction(comparefn));
3096 }
3097});
3098
3099var $filter = require$$0$9(2);
3100
3101$export$1($export$1.P + $export$1.F * !require$$1$4([].filter, true), 'Array', {
3102 // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg])
3103 filter: function filter(callbackfn /* , thisArg */) {
3104 return $filter(this, callbackfn, arguments[1]);
3105 }
3106});
3107
3108var $indexOf = require$$0$3(false);
3109var $native = [].indexOf;
3110var NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0;
3111
3112$export$1($export$1.P + $export$1.F * (NEGATIVE_ZERO || !require$$1$4($native)), 'Array', {
3113 // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex])
3114 indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
3115 return NEGATIVE_ZERO
3116 // convert -0 to +0
3117 ? $native.apply(this, arguments) || 0
3118 : $indexOf(this, searchElement, arguments[1]);
3119 }
3120});
3121
3122// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)
3123
3124var $find = require$$0$9(5);
3125var KEY = 'find';
3126var forced = true;
3127// Shouldn't skip holes
3128if (KEY in []) Array(1)[KEY](function () { forced = false; });
3129$export$1($export$1.P + $export$1.F * forced, 'Array', {
3130 find: function find(callbackfn /* , that = undefined */) {
3131 return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
3132 }
3133});
3134require$$1$3(KEY);
3135
3136var dP$4 = dP$1.f;
3137var FProto = Function.prototype;
3138var nameRE = /^\s*function ([^ (]*)/;
3139var NAME$1 = 'name';
3140
3141// 19.2.4.2 name
3142NAME$1 in FProto || DESCRIPTORS && dP$4(FProto, NAME$1, {
3143 configurable: true,
3144 get: function () {
3145 try {
3146 return ('' + this).match(nameRE)[1];
3147 } catch (e) {
3148 return '';
3149 }
3150 }
3151});
3152
3153var $map = require$$0$9(1);
3154
3155$export$1($export$1.P + $export$1.F * !require$$1$4([].map, true), 'Array', {
3156 // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg])
3157 map: function map(callbackfn /* , thisArg */) {
3158 return $map(this, callbackfn, arguments[1]);
3159 }
3160});
3161
3162var GanttInvalidOp =
3163/*#__PURE__*/
3164function (_Error) {
3165 _inherits(GanttInvalidOp, _Error);
3166
3167 function GanttInvalidOp(op) {
3168 _classCallCheck(this, GanttInvalidOp);
3169
3170 return _possibleConstructorReturn(this, _getPrototypeOf(GanttInvalidOp).call(this, 'invalid operaion: ' + op));
3171 }
3172
3173 return GanttInvalidOp;
3174}(_wrapNativeSuper(Error));
3175
3176/**
3177 * Has own property.
3178 *
3179 * @type {Function}
3180 */
3181
3182var has$1 = Object.prototype.hasOwnProperty;
3183
3184/**
3185 * To string.
3186 *
3187 * @type {Function}
3188 */
3189
3190var toString$2 = Object.prototype.toString;
3191
3192/**
3193 * Test whether a value is "empty".
3194 *
3195 * @param {Mixed} val
3196 * @return {Boolean}
3197 */
3198
3199function isEmpty(val) {
3200 // Null and Undefined...
3201 if (val == null) return true
3202
3203 // Booleans...
3204 if ('boolean' == typeof val) return false
3205
3206 // Numbers...
3207 if ('number' == typeof val) return val === 0
3208
3209 // Strings...
3210 if ('string' == typeof val) return val.length === 0
3211
3212 // Functions...
3213 if ('function' == typeof val) return val.length === 0
3214
3215 // Arrays...
3216 if (Array.isArray(val)) return val.length === 0
3217
3218 // Errors...
3219 if (val instanceof Error) return val.message === ''
3220
3221 // Objects...
3222 if (val.toString == toString$2) {
3223 switch (val.toString()) {
3224
3225 // Maps, Sets, Files and Errors...
3226 case '[object File]':
3227 case '[object Map]':
3228 case '[object Set]': {
3229 return val.size === 0
3230 }
3231
3232 // Plain objects...
3233 case '[object Object]': {
3234 for (var key in val) {
3235 if (has$1.call(val, key)) return false
3236 }
3237
3238 return true
3239 }
3240 }
3241 }
3242
3243 // Anything else...
3244 return false
3245}
3246
3247/**
3248 * Export `isEmpty`.
3249 *
3250 * @type {Function}
3251 */
3252
3253var lib = isEmpty;
3254
3255/*!
3256 * is-var-name | ISC (c) Shinnosuke Watanabe
3257 * https://github.com/shinnn/is-var-name
3258*/
3259function isVarName(str) {
3260 if (typeof str !== 'string') {
3261 return false;
3262 }
3263
3264 if (str.trim() !== str) {
3265 return false;
3266 }
3267
3268 try {
3269 new Function(str, 'var ' + str);
3270 } catch (e) {
3271 return false;
3272 }
3273
3274 return true;
3275}
3276
3277var arrayStartsWith_1 = createCommonjsModule(function (module, exports) {
3278
3279Object.defineProperty(exports, "__esModule", {
3280 value: true
3281});
3282function arrayStartsWith(base, start) {
3283 for (let i = 0; i < start.length; i++) {
3284 if (base[i] !== start[i]) {
3285 return false;
3286 }
3287 }
3288
3289 return true;
3290}
3291
3292exports.default = arrayStartsWith;
3293});
3294
3295var arrayStartsWith = unwrapExports(arrayStartsWith_1);
3296
3297var arrayStartsWith$1 = /*#__PURE__*/Object.freeze({
3298 default: arrayStartsWith,
3299 __moduleExports: arrayStartsWith_1
3300});
3301
3302var _arrayStartsWith = ( arrayStartsWith$1 && arrayStartsWith ) || arrayStartsWith$1;
3303
3304var build = createCommonjsModule(function (module, exports) {
3305
3306Object.defineProperty(exports, "__esModule", {
3307 value: true
3308});
3309
3310
3311
3312var _arrayStartsWith2 = _interopRequireDefault(_arrayStartsWith);
3313
3314function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3315
3316exports.default = _arrayStartsWith2.default;
3317});
3318
3319var arrayStartsWith$2 = unwrapExports(build);
3320
3321function taskError(taskName, tpl) {
3322 if (taskName instanceof Task) {
3323 taskName = taskName.canonicalName;
3324 }
3325
3326 taskName = '[' + [].concat(taskName).map(function (it) {
3327 return "'".concat(it, "'");
3328 }).join(', ') + ']';
3329 return new Error(tpl(taskName));
3330}
3331
3332var Task =
3333/*#__PURE__*/
3334function () {
3335 function Task(name, parent) {
3336 _classCallCheck(this, Task);
3337
3338 name && this.name(name);
3339 this._parent = parent;
3340 this._onStartCbs = [];
3341 this._onFinishCbs = [];
3342 this._subTasks = [];
3343 this._dependsUpon = [];
3344 this._level = parent ? parent.level + 1 : 0;
3345 this._base = 0;
3346 this.$ = this.find;
3347 this.duration = this.expectedTimeSpan;
3348 }
3349
3350 _createClass(Task, [{
3351 key: "base",
3352 value: function base(arg) {
3353 if (arg === void 0) {
3354 return this._base;
3355 }
3356
3357 this._base = new Date(arg).getTime();
3358 return this;
3359 }
3360 }, {
3361 key: "name",
3362 value: function name(arg) {
3363 if (arg === void 0) {
3364 return this._name;
3365 }
3366
3367 if (!isVarName(arg)) {
3368 throw new Error('invalid task name ' + arg + ', should use a valid javascript identifier name');
3369 }
3370
3371 this._name = arg;
3372 return this;
3373 }
3374 }, {
3375 key: "bundle",
3376 value: function bundle(arg) {
3377 if (arg === void 0) {
3378 return this._bundle;
3379 }
3380
3381 this._bundle = arg;
3382 return this;
3383 }
3384 }, {
3385 key: "label",
3386 value: function label(labelArg) {
3387 if (labelArg === void 0) {
3388 return this._label || this._name;
3389 }
3390
3391 this._label = labelArg;
3392 return this;
3393 }
3394 }, {
3395 key: "addSubTask",
3396 value: function addSubTask(arg) {
3397 var task;
3398
3399 if (arg instanceof Task) {
3400 task = arg;
3401 } else {
3402 if (typeof arg === 'function') {
3403 task = new Task('', this);
3404 } else if (typeof arg === 'string') {
3405 task = new Task(arg, this);
3406 } else {
3407 throw new Error('task must be a function or string');
3408 }
3409 }
3410
3411 if (this._subTasks.hasOwnProperty(task.name())) {
3412 throw new Error('task ' + task.name() + ' already exists');
3413 }
3414
3415 this._subTasks.push(task); // add at first, then apply function, otherwise sub task can't depends upon
3416 // some tasks
3417
3418
3419 if (typeof arg === 'function') {
3420 arg(task);
3421 }
3422
3423 return this;
3424 }
3425 }, {
3426 key: "find",
3427 value: function find(taskName, updateFunc) {
3428 return this._findIter(taskName, updateFunc, this);
3429 }
3430 }, {
3431 key: "_findIter",
3432 value: function _findIter(taskName, updateFunc, root) {
3433 var taskNames = [].concat(taskName);
3434
3435 if (taskNames.length === 0) {
3436 if (typeof updateFunc === 'function') {
3437 updateFunc.apply(root, [this]);
3438 }
3439
3440 return this;
3441 }
3442
3443 var idx = this._subTasks.map(function (it) {
3444 return it._name;
3445 }).indexOf(taskNames[0]);
3446
3447 if (idx === -1) {
3448 return null;
3449 }
3450
3451 return this._subTasks[idx].find(taskNames.slice(1), updateFunc, root);
3452 }
3453 }, {
3454 key: "moveSubTask",
3455 value: function moveSubTask(taskName, before) {
3456 var subTaskNames = this._subTasks.map(function (it) {
3457 return it.name();
3458 });
3459
3460 var fromIdx = subTaskNames.indexOf(taskName);
3461
3462 if (fromIdx === -1) {
3463 throw taskError(taskName, function (n) {
3464 return "no such task: ".concat(n);
3465 });
3466 }
3467
3468 var toIdx = before ? subTaskNames.indexOf(before) : subTaskNames.length - 1;
3469
3470 if (toIdx === -1) {
3471 throw taskError(taskName, function (n) {
3472 return "no such task: ".concat(n);
3473 });
3474 }
3475
3476 var subTask = this._subTasks.splice(fromIdx, 1)[0];
3477
3478 this._subTasks.splice(toIdx, 0, subTask);
3479
3480 return this;
3481 }
3482 }, {
3483 key: "removeSubTask",
3484 value: function removeSubTask(taskName) {
3485 var subTasks = this._subTasks.filter(function (it) {
3486 return it.name() !== taskName;
3487 });
3488
3489 if (subTasks.length === this._subTasks.length) {
3490 throw new Error('no such task: ' + taskName);
3491 }
3492
3493 this._subTasks = subTasks;
3494 return this;
3495 }
3496 }, {
3497 key: "isMyAncestor",
3498 value: function isMyAncestor(task) {
3499 if (task instanceof Task) {
3500 task = task.canonicalName;
3501 }
3502
3503 var myCanonicalName = this.canonicalName;
3504
3505 for (var i = 0; i < task.length; ++i) {
3506 if (task[i] !== myCanonicalName[i]) {
3507 return false;
3508 }
3509 }
3510
3511 return true;
3512 }
3513 }, {
3514 key: "getDependsUpon",
3515 value: function getDependsUpon() {
3516 if (!this._parent) {
3517 return [];
3518 }
3519
3520 var dependsUpon = this._parent.getDependsUpon().concat(this._dependsUpon) // see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort
3521 // array of array could be sorted
3522 .map(function (it) {
3523 return it.canonicalName;
3524 }).sort();
3525
3526 if (!dependsUpon.length) {
3527 return [];
3528 }
3529
3530 var pivot = dependsUpon[0];
3531 var ret = [pivot];
3532 var i = 0;
3533
3534 while (i < dependsUpon.length) {
3535 if (!arrayStartsWith$2(dependsUpon[i], pivot)) {
3536 pivot = dependsUpon[i];
3537 ret.push(pivot);
3538 }
3539
3540 ++i;
3541 }
3542
3543 var root = this.root;
3544 return ret.map(function (it) {
3545 return root.$(it);
3546 });
3547 }
3548 }, {
3549 key: "doesDependUpon",
3550 value: function doesDependUpon(task) {
3551 if (task instanceof Task) {
3552 task = task.canonicalName;
3553 }
3554
3555 return this.getDependsUpon().some(function (it) {
3556 return arrayStartsWith$2(task, it.canonicalName);
3557 });
3558 }
3559 /**
3560 * 设定依赖关系,并可能根据依赖关系调整expectedToStartAt
3561 * */
3562
3563 }, {
3564 key: "dependsUpon",
3565 value: function dependsUpon() {
3566 for (var _len = arguments.length, canonicalNames = new Array(_len), _key = 0; _key < _len; _key++) {
3567 canonicalNames[_key] = arguments[_key];
3568 }
3569
3570 if (canonicalNames.length === 0) {
3571 return this.getDependsUpon();
3572 }
3573
3574 canonicalNames = canonicalNames.map(function (it) {
3575 return it instanceof Task ? it.canonicalName : it;
3576 });
3577 var dependsUpon = [];
3578 var root = this.root;
3579 var _iteratorNormalCompletion = true;
3580 var _didIteratorError = false;
3581 var _iteratorError = undefined;
3582
3583 try {
3584 for (var _iterator = canonicalNames[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
3585 var n = _step.value;
3586 var task = root.$(n);
3587
3588 if (!task) {
3589 throw taskError(n, function (n) {
3590 return "no such task: ".concat(n);
3591 });
3592 }
3593
3594 if (this === task) {
3595 throw taskError(n, function (n) {
3596 return "can not depends upon self: ".concat(n);
3597 });
3598 }
3599
3600 if (this.isMyAncestor(task)) {
3601 throw taskError(n, function (n) {
3602 return "can not depends upon ancestor: ".concat(n);
3603 });
3604 }
3605
3606 if (this.doesDependUpon(task)) {
3607 throw taskError(n, function (n) {
3608 return "already depends upon task ".concat(n);
3609 });
3610 }
3611
3612 if (task.doesDependUpon(this)) {
3613 throw taskError(n, function (n) {
3614 return "depends upon a task ".concat(n, " which depends on myself (cylic dependent)");
3615 });
3616 }
3617
3618 dependsUpon.push(task);
3619 }
3620 } catch (err) {
3621 _didIteratorError = true;
3622 _iteratorError = err;
3623 } finally {
3624 try {
3625 if (!_iteratorNormalCompletion && _iterator.return != null) {
3626 _iterator.return();
3627 }
3628 } finally {
3629 if (_didIteratorError) {
3630 throw _iteratorError;
3631 }
3632 }
3633 }
3634
3635 this._dependsUpon = this._dependsUpon.concat(dependsUpon);
3636 return this;
3637 }
3638 }, {
3639 key: "removeDependsUpon",
3640 value: function removeDependsUpon() {
3641 for (var _len2 = arguments.length, canonicalNames = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
3642 canonicalNames[_key2] = arguments[_key2];
3643 }
3644
3645 canonicalNames = new Set(canonicalNames.map(function (it) {
3646 return it instanceof Task ? it.canonicalName : it;
3647 }).map(function (it) {
3648 return it.join('.');
3649 }));
3650 this._dependsUpon = this._dependsUpon.filter(function (it) {
3651 return !canonicalNames.has(it.canonicalName.join('.'));
3652 });
3653 return this;
3654 }
3655 /**
3656 * when this task is expected to start at.
3657 * it will equal to startAt when it is started
3658 * */
3659
3660 }, {
3661 key: "start",
3662 value: function start(args) {
3663 return this.startAt(new Date(), args);
3664 }
3665 }, {
3666 key: "startAt",
3667 value: function startAt(t) {
3668 if (this.isLeaf) {
3669 if (t === void 0) {
3670 return this._startAt;
3671 }
3672
3673 if (!(typeof t === 'string' || typeof t === 'number' || t instanceof Date)) {
3674 throw Error(t + ' should be string or number');
3675 }
3676
3677 this._startAt = new Date(t).getTime();
3678 } else {
3679 if (t === void 0) {
3680 var startedTasks = this._subTasks.filter(function (it) {
3681 return it.startAt() !== void 0;
3682 });
3683
3684 if (!startedTasks.length) {
3685 return;
3686 }
3687
3688 return Math.min.apply(null, startedTasks.map(function (it) {
3689 return it.startAt();
3690 }));
3691 }
3692
3693 throw Error('non-leaf task can not set start at');
3694 }
3695
3696 return this;
3697 }
3698 }, {
3699 key: "startArg",
3700 value: function startArg(arg) {
3701 if (arg === void 0) {
3702 return this._startArg;
3703 }
3704
3705 this._startArg = typeof arg === 'string' ? timestring(arg, 'ms') : arg;
3706 return this;
3707 }
3708 }, {
3709 key: "expectedTimeSpan",
3710 value: function expectedTimeSpan(arg) {
3711 if (this.isLeaf) {
3712 if (arg === void 0) {
3713 if (this.finishAt()) {
3714 if (this.startAt()) {
3715 return this.finishAt() - this.startAt();
3716 }
3717
3718 return 0;
3719 }
3720
3721 return this._expectedTimeSpan || 0;
3722 }
3723
3724 this._expectedTimeSpan = typeof arg === 'string' ? timestring(arg, 'ms') : arg;
3725 } else {
3726 if (arg === void 0) {
3727 return this.expectedToFinishAt - this.expectedToStartAt;
3728 }
3729
3730 throw new Error('non-leaf task can not set expected time span');
3731 }
3732
3733 return this;
3734 }
3735 }, {
3736 key: "finish",
3737 value: function finish(args) {
3738 return this.finishAt(new Date(), args);
3739 }
3740 }, {
3741 key: "finishAt",
3742 value: function finishAt(t) {
3743 if (this.isLeaf) {
3744 if (t === void 0) {
3745 return this._finishAt;
3746 }
3747
3748 if (!(typeof t === 'string' || typeof t === 'number' || t instanceof Date)) {
3749 throw Error(t + ' should be string or number');
3750 }
3751
3752 this._finishAt = new Date(t).getTime();
3753 } else {
3754 if (t === void 0) {
3755 var finishedTasks = this._subTasks.filter(function (it) {
3756 return it.finishAt() !== void 0;
3757 });
3758
3759 if (!finishedTasks.length) {
3760 return;
3761 }
3762
3763 return Math.max.apply(null, finishedTasks.map(function (it) {
3764 return it.finishAt();
3765 }));
3766 }
3767
3768 throw Error('non-leaf task can not set finish at');
3769 }
3770
3771 return this;
3772 }
3773 }, {
3774 key: "description",
3775 value: function description(arg) {
3776 if (arg === void 0) {
3777 return this._description;
3778 }
3779
3780 this._description = arg;
3781 return this;
3782 }
3783 }, {
3784 key: "finishArg",
3785 value: function finishArg(arg) {
3786 if (arg === void 0) {
3787 return this._finishArg;
3788 }
3789
3790 this._finishArg = arg;
3791 return this;
3792 }
3793 }, {
3794 key: "opsFilter",
3795 value: function opsFilter(arg) {
3796 this._opsFilter = arg;
3797 return this;
3798 }
3799 }, {
3800 key: "perform",
3801 value: function () {
3802 var _perform = _asyncToGenerator(
3803 /*#__PURE__*/
3804 regeneratorRuntime.mark(function _callee(action, arg) {
3805 var _Task$OP_START$Task$O;
3806
3807 var _iteratorNormalCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, cb, _iteratorNormalCompletion3, _didIteratorError3, _iteratorError3, _iterator3, _step3, _cb;
3808
3809 return regeneratorRuntime.wrap(function _callee$(_context) {
3810 while (1) {
3811 switch (_context.prev = _context.next) {
3812 case 0:
3813 if (this.isLeaf) {
3814 _context.next = 2;
3815 break;
3816 }
3817
3818 throw new Error('you can\'t perform operation upon non-leaf task');
3819
3820 case 2:
3821 if (!(this.ops.indexOf(action) === -1)) {
3822 _context.next = 4;
3823 break;
3824 }
3825
3826 throw new GanttInvalidOp(action);
3827
3828 case 4:
3829 action = (_Task$OP_START$Task$O = {}, _defineProperty(_Task$OP_START$Task$O, Task.OP_START, 'start'), _defineProperty(_Task$OP_START$Task$O, Task.OP_FINISH, 'finish'), _Task$OP_START$Task$O)[action];
3830 this[action](arg);
3831
3832 if (!(action === 'start')) {
3833 _context.next = 35;
3834 break;
3835 }
3836
3837 _iteratorNormalCompletion2 = true;
3838 _didIteratorError2 = false;
3839 _iteratorError2 = undefined;
3840 _context.prev = 10;
3841 _iterator2 = this._onStartCbs[Symbol.iterator]();
3842
3843 case 12:
3844 if (_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done) {
3845 _context.next = 19;
3846 break;
3847 }
3848
3849 cb = _step2.value;
3850 _context.next = 16;
3851 return cb.call(this);
3852
3853 case 16:
3854 _iteratorNormalCompletion2 = true;
3855 _context.next = 12;
3856 break;
3857
3858 case 19:
3859 _context.next = 25;
3860 break;
3861
3862 case 21:
3863 _context.prev = 21;
3864 _context.t0 = _context["catch"](10);
3865 _didIteratorError2 = true;
3866 _iteratorError2 = _context.t0;
3867
3868 case 25:
3869 _context.prev = 25;
3870 _context.prev = 26;
3871
3872 if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
3873 _iterator2.return();
3874 }
3875
3876 case 28:
3877 _context.prev = 28;
3878
3879 if (!_didIteratorError2) {
3880 _context.next = 31;
3881 break;
3882 }
3883
3884 throw _iteratorError2;
3885
3886 case 31:
3887 return _context.finish(28);
3888
3889 case 32:
3890 return _context.finish(25);
3891
3892 case 33:
3893 _context.next = 62;
3894 break;
3895
3896 case 35:
3897 if (!(action === 'finish')) {
3898 _context.next = 62;
3899 break;
3900 }
3901
3902 _iteratorNormalCompletion3 = true;
3903 _didIteratorError3 = false;
3904 _iteratorError3 = undefined;
3905 _context.prev = 39;
3906 _iterator3 = this._onFinishCbs[Symbol.iterator]();
3907
3908 case 41:
3909 if (_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done) {
3910 _context.next = 48;
3911 break;
3912 }
3913
3914 _cb = _step3.value;
3915 _context.next = 45;
3916 return _cb.call(this);
3917
3918 case 45:
3919 _iteratorNormalCompletion3 = true;
3920 _context.next = 41;
3921 break;
3922
3923 case 48:
3924 _context.next = 54;
3925 break;
3926
3927 case 50:
3928 _context.prev = 50;
3929 _context.t1 = _context["catch"](39);
3930 _didIteratorError3 = true;
3931 _iteratorError3 = _context.t1;
3932
3933 case 54:
3934 _context.prev = 54;
3935 _context.prev = 55;
3936
3937 if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
3938 _iterator3.return();
3939 }
3940
3941 case 57:
3942 _context.prev = 57;
3943
3944 if (!_didIteratorError3) {
3945 _context.next = 60;
3946 break;
3947 }
3948
3949 throw _iteratorError3;
3950
3951 case 60:
3952 return _context.finish(57);
3953
3954 case 61:
3955 return _context.finish(54);
3956
3957 case 62:
3958 case "end":
3959 return _context.stop();
3960 }
3961 }
3962 }, _callee, this, [[10, 21, 25, 33], [26,, 28, 32], [39, 50, 54, 62], [55,, 57, 61]]);
3963 }));
3964
3965 return function perform(_x, _x2) {
3966 return _perform.apply(this, arguments);
3967 };
3968 }()
3969 }, {
3970 key: "onStart",
3971 value: function onStart(arg) {
3972 this._onStartCbs.push(arg);
3973
3974 return this;
3975 }
3976 }, {
3977 key: "onFinish",
3978 value: function onFinish(arg) {
3979 this._onFinishCbs.push(arg);
3980
3981 return this;
3982 }
3983 }, {
3984 key: "toJSON",
3985 value: function toJSON() {
3986 return {
3987 name: this.name(),
3988 bundle: this.bundle(),
3989 parent: (this._parent || {}).canonicalName,
3990 depth: this.depth,
3991 isLeaf: this.isLeaf,
3992 canonicalName: this.canonicalName,
3993 label: this.label(),
3994 subTasks: this.subTasks.map(function (it) {
3995 return it.toJSON();
3996 }),
3997 dependsUpon: this.getDependsUpon().map(function (it) {
3998 return it.canonicalName;
3999 }),
4000 expectedToStartAt: this.expectedToStartAt,
4001 startAt: this.startAt(),
4002 startArg: this.startArg(),
4003 expectedTimeSpan: this.expectedTimeSpan(),
4004 duration: this.expectedTimeSpan(),
4005 finishAt: this.finishAt(),
4006 finishArg: this.finishArg(),
4007 expectedToFinishAt: this.expectedToFinishAt,
4008 description: this.description(),
4009 ops: this.ops,
4010 nextOp: this.nextOp,
4011 level: this.level
4012 };
4013 }
4014 }, {
4015 key: "fromJSON",
4016 value: function fromJSON(arg) {
4017 var _this = this;
4018
4019 var _arr = ['name', 'label', 'startAt', 'startArg', 'expectedTimeSpan', 'finishAt', 'finishArg', 'description', 'bundle'];
4020
4021 for (var _i = 0; _i < _arr.length; _i++) {
4022 var k = _arr[_i];
4023 arg[k] !== void 0 && this[k](arg[k]);
4024 }
4025
4026 arg.subTasks && arg.subTasks.length && arg.subTasks.forEach(function (it) {
4027 return _this.addSubTask(function (task) {
4028 return task.fromJSON(it);
4029 });
4030 });
4031 arg.dependsUpon && arg.dependsUpon.length && this.dependsUpon.apply(this, _toConsumableArray(arg.dependsUpon));
4032 return this;
4033 }
4034 }, {
4035 key: "level",
4036 get: function get() {
4037 return this._level;
4038 }
4039 }, {
4040 key: "isLeaf",
4041 get: function get() {
4042 return lib(this._subTasks);
4043 }
4044 }, {
4045 key: "root",
4046 get: function get() {
4047 return this._parent ? this._parent.root : this;
4048 }
4049 }, {
4050 key: "canonicalName",
4051 get: function get() {
4052 return (this._parent ? this._parent.canonicalName : []).concat(this._name);
4053 }
4054 }, {
4055 key: "subTasks",
4056 get: function get() {
4057 return this._subTasks;
4058 }
4059 }, {
4060 key: "expectedToStartAt",
4061 get: function get() {
4062 if (this.isLeaf) {
4063 var startAt = this.startAt();
4064
4065 if (startAt) {
4066 return startAt;
4067 }
4068
4069 var dependsUpon = this.getDependsUpon();
4070
4071 if (lib(dependsUpon)) {
4072 return this.root.base();
4073 }
4074
4075 return Math.max.apply(Math, _toConsumableArray(this.getDependsUpon().map(function (it) {
4076 return it.expectedToFinishAt;
4077 })));
4078 }
4079
4080 return Math.max.apply(Math, _toConsumableArray(this.subTasks.map(function (it) {
4081 return it.expectedToStartAt;
4082 })));
4083 }
4084 }, {
4085 key: "expectedToFinishAt",
4086 get: function get() {
4087 if (this.isLeaf) {
4088 return this._finishAt || (this.startAt() || this.expectedToStartAt) + this._expectedTimeSpan;
4089 }
4090
4091 return Math.max.apply(null, this._subTasks.map(function (it) {
4092 return it.expectedToFinishAt;
4093 }));
4094 }
4095 }, {
4096 key: "ops",
4097 get: function get() {
4098 if (!this.isLeaf || !this.getDependsUpon().every(function (it) {
4099 return it._finishAt;
4100 }) || this._finishAt) {
4101 return [];
4102 }
4103
4104 var ret = [Task.OP_START, Task.OP_FINISH];
4105
4106 if (this._startAt) {
4107 ret = ret.slice(1);
4108 }
4109
4110 if (this._opsFilter) {
4111 ret = this._opsFilter(ret);
4112 }
4113
4114 return ret;
4115 }
4116 }, {
4117 key: "depth",
4118 get: function get() {
4119 if (this.isLeaf) {
4120 return 1;
4121 }
4122
4123 return Math.max.apply(Math, _toConsumableArray(this._subTasks.map(function (it) {
4124 return it.depth;
4125 }))) + 1;
4126 }
4127 }, {
4128 key: "nextOp",
4129 get: function get() {
4130 return (this.ops || [])[0];
4131 }
4132 }]);
4133
4134 return Task;
4135}();
4136
4137Task.OP_START = 'start';
4138Task.OP_FINISH = 'finish';
4139
4140function _clearTask(json, fields) {
4141 var _iteratorNormalCompletion = true;
4142 var _didIteratorError = false;
4143 var _iteratorError = undefined;
4144
4145 try {
4146 for (var _iterator = fields[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
4147 var it = _step.value;
4148 delete json[it];
4149 }
4150 } catch (err) {
4151 _didIteratorError = true;
4152 _iteratorError = err;
4153 } finally {
4154 try {
4155 if (!_iteratorNormalCompletion && _iterator.return != null) {
4156 _iterator.return();
4157 }
4158 } finally {
4159 if (_didIteratorError) {
4160 throw _iteratorError;
4161 }
4162 }
4163 }
4164
4165 var _iteratorNormalCompletion2 = true;
4166 var _didIteratorError2 = false;
4167 var _iteratorError2 = undefined;
4168
4169 try {
4170 for (var _iterator2 = json.subTasks[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
4171 var t = _step2.value;
4172
4173 _clearTask(t, fields);
4174 }
4175 } catch (err) {
4176 _didIteratorError2 = true;
4177 _iteratorError2 = err;
4178 } finally {
4179 try {
4180 if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
4181 _iterator2.return();
4182 }
4183 } finally {
4184 if (_didIteratorError2) {
4185 throw _iteratorError2;
4186 }
4187 }
4188 }
4189}
4190
4191var Project =
4192/*#__PURE__*/
4193function (_Task) {
4194 _inherits(Project, _Task);
4195
4196 function Project() {
4197 _classCallCheck(this, Project);
4198
4199 return _possibleConstructorReturn(this, _getPrototypeOf(Project).apply(this, arguments));
4200 }
4201
4202 _createClass(Project, [{
4203 key: "toJSON",
4204 value: function toJSON() {
4205 return Object.assign(_get(_getPrototypeOf(Project.prototype), "toJSON", this).call(this), {
4206 base: this.base()
4207 });
4208 }
4209 }, {
4210 key: "fromJSON",
4211 value: function fromJSON(arg) {
4212 _get(_getPrototypeOf(Project.prototype), "fromJSON", this).call(this, arg);
4213
4214 this.base(arg.base);
4215 return this;
4216 }
4217 }, {
4218 key: "canonicalName",
4219 get: function get$$1() {
4220 return [];
4221 }
4222 }, {
4223 key: "baseline",
4224 get: function get$$1() {
4225 var json = this.toJSON();
4226
4227 _clearTask(json, ['startAt', 'startArg', 'finishAt', 'finishArg']);
4228
4229 return new Project().fromJSON(json);
4230 }
4231 }]);
4232
4233 return Project;
4234}(Task);
4235
4236function project(name) {
4237 return new Project(name);
4238}
4239
4240exports.project = project;
4241exports.Project = Project;
4242exports.Task = Task;