1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, '__esModule', { value: true });
|
4 |
|
5 | function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
6 |
|
7 | var timestring = _interopDefault(require('timestring'));
|
8 |
|
9 | function unwrapExports (x) {
|
10 | return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
11 | }
|
12 |
|
13 | function createCommonjsModule(fn, module) {
|
14 | return module = { exports: {} }, fn(module, module.exports), module.exports;
|
15 | }
|
16 |
|
17 | var _global = createCommonjsModule(function (module) {
|
18 |
|
19 | var global = module.exports = typeof window != 'undefined' && window.Math == Math
|
20 | ? window : typeof self != 'undefined' && self.Math == Math ? self
|
21 |
|
22 | : Function('return this')();
|
23 | if (typeof __g == 'number') __g = global;
|
24 | });
|
25 |
|
26 | var _global$1 = Object.freeze({
|
27 | default: _global,
|
28 | __moduleExports: _global
|
29 | });
|
30 |
|
31 | var _core = createCommonjsModule(function (module) {
|
32 | var core = module.exports = { version: '2.5.7' };
|
33 | if (typeof __e == 'number') __e = core;
|
34 | });
|
35 | var _core_1 = _core.version;
|
36 |
|
37 | var _core$1 = Object.freeze({
|
38 | default: _core,
|
39 | __moduleExports: _core,
|
40 | version: _core_1
|
41 | });
|
42 |
|
43 | var _isObject = function (it) {
|
44 | return typeof it === 'object' ? it !== null : typeof it === 'function';
|
45 | };
|
46 |
|
47 | var _isObject$1 = Object.freeze({
|
48 | default: _isObject,
|
49 | __moduleExports: _isObject
|
50 | });
|
51 |
|
52 | var isObject = ( _isObject$1 && _isObject ) || _isObject$1;
|
53 |
|
54 | var _anObject = function (it) {
|
55 | if (!isObject(it)) throw TypeError(it + ' is not an object!');
|
56 | return it;
|
57 | };
|
58 |
|
59 | var _anObject$1 = Object.freeze({
|
60 | default: _anObject,
|
61 | __moduleExports: _anObject
|
62 | });
|
63 |
|
64 | var _fails = function (exec) {
|
65 | try {
|
66 | return !!exec();
|
67 | } catch (e) {
|
68 | return true;
|
69 | }
|
70 | };
|
71 |
|
72 | var _fails$1 = Object.freeze({
|
73 | default: _fails,
|
74 | __moduleExports: _fails
|
75 | });
|
76 |
|
77 | var require$$1 = ( _fails$1 && _fails ) || _fails$1;
|
78 |
|
79 |
|
80 | var _descriptors = !require$$1(function () {
|
81 | return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
|
82 | });
|
83 |
|
84 | var _descriptors$1 = Object.freeze({
|
85 | default: _descriptors,
|
86 | __moduleExports: _descriptors
|
87 | });
|
88 |
|
89 | var global$1 = ( _global$1 && _global ) || _global$1;
|
90 |
|
91 | var document = global$1.document;
|
92 |
|
93 | var is = isObject(document) && isObject(document.createElement);
|
94 | var _domCreate = function (it) {
|
95 | return is ? document.createElement(it) : {};
|
96 | };
|
97 |
|
98 | var _domCreate$1 = Object.freeze({
|
99 | default: _domCreate,
|
100 | __moduleExports: _domCreate
|
101 | });
|
102 |
|
103 | var DESCRIPTORS = ( _descriptors$1 && _descriptors ) || _descriptors$1;
|
104 |
|
105 | var require$$2 = ( _domCreate$1 && _domCreate ) || _domCreate$1;
|
106 |
|
107 | var _ie8DomDefine = !DESCRIPTORS && !require$$1(function () {
|
108 | return Object.defineProperty(require$$2('div'), 'a', { get: function () { return 7; } }).a != 7;
|
109 | });
|
110 |
|
111 | var _ie8DomDefine$1 = Object.freeze({
|
112 | default: _ie8DomDefine,
|
113 | __moduleExports: _ie8DomDefine
|
114 | });
|
115 |
|
116 |
|
117 |
|
118 |
|
119 |
|
120 | var _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 |
|
129 | var _toPrimitive$1 = Object.freeze({
|
130 | default: _toPrimitive,
|
131 | __moduleExports: _toPrimitive
|
132 | });
|
133 |
|
134 | var anObject = ( _anObject$1 && _anObject ) || _anObject$1;
|
135 |
|
136 | var IE8_DOM_DEFINE = ( _ie8DomDefine$1 && _ie8DomDefine ) || _ie8DomDefine$1;
|
137 |
|
138 | var toPrimitive = ( _toPrimitive$1 && _toPrimitive ) || _toPrimitive$1;
|
139 |
|
140 | var dP = Object.defineProperty;
|
141 |
|
142 | var 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) { }
|
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 |
|
154 | var _objectDp = {
|
155 | f: f
|
156 | };
|
157 |
|
158 | var _objectDp$1 = Object.freeze({
|
159 | default: _objectDp,
|
160 | __moduleExports: _objectDp,
|
161 | f: f
|
162 | });
|
163 |
|
164 | var _propertyDesc = function (bitmap, value) {
|
165 | return {
|
166 | enumerable: !(bitmap & 1),
|
167 | configurable: !(bitmap & 2),
|
168 | writable: !(bitmap & 4),
|
169 | value: value
|
170 | };
|
171 | };
|
172 |
|
173 | var _propertyDesc$1 = Object.freeze({
|
174 | default: _propertyDesc,
|
175 | __moduleExports: _propertyDesc
|
176 | });
|
177 |
|
178 | var dP$1 = ( _objectDp$1 && _objectDp ) || _objectDp$1;
|
179 |
|
180 | var descriptor = ( _propertyDesc$1 && _propertyDesc ) || _propertyDesc$1;
|
181 |
|
182 | var _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 |
|
189 | var _hide$1 = Object.freeze({
|
190 | default: _hide,
|
191 | __moduleExports: _hide
|
192 | });
|
193 |
|
194 | var hasOwnProperty = {}.hasOwnProperty;
|
195 | var _has = function (it, key) {
|
196 | return hasOwnProperty.call(it, key);
|
197 | };
|
198 |
|
199 | var _has$1 = Object.freeze({
|
200 | default: _has,
|
201 | __moduleExports: _has
|
202 | });
|
203 |
|
204 | var id = 0;
|
205 | var px = Math.random();
|
206 | var _uid = function (key) {
|
207 | return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
|
208 | };
|
209 |
|
210 | var _uid$1 = Object.freeze({
|
211 | default: _uid,
|
212 | __moduleExports: _uid
|
213 | });
|
214 |
|
215 | var require$$0 = ( _hide$1 && _hide ) || _hide$1;
|
216 |
|
217 | var has = ( _has$1 && _has ) || _has$1;
|
218 |
|
219 | var uid = ( _uid$1 && _uid ) || _uid$1;
|
220 |
|
221 | var require$$1$1 = ( _core$1 && _core ) || _core$1;
|
222 |
|
223 | var _redefine = createCommonjsModule(function (module) {
|
224 | var SRC = uid('src');
|
225 | var TO_STRING = 'toString';
|
226 | var $toString = Function[TO_STRING];
|
227 | var TPL = ('' + $toString).split(TO_STRING);
|
228 |
|
229 | require$$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 |
|
249 | })(Function.prototype, TO_STRING, function toString() {
|
250 | return typeof this == 'function' && this[SRC] || $toString.call(this);
|
251 | });
|
252 | });
|
253 |
|
254 | var _redefine$1 = Object.freeze({
|
255 | default: _redefine,
|
256 | __moduleExports: _redefine
|
257 | });
|
258 |
|
259 | var _aFunction = function (it) {
|
260 | if (typeof it != 'function') throw TypeError(it + ' is not a function!');
|
261 | return it;
|
262 | };
|
263 |
|
264 | var _aFunction$1 = Object.freeze({
|
265 | default: _aFunction,
|
266 | __moduleExports: _aFunction
|
267 | });
|
268 |
|
269 | var aFunction = ( _aFunction$1 && _aFunction ) || _aFunction$1;
|
270 |
|
271 |
|
272 |
|
273 | var _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 |
|
292 | var _ctx$1 = Object.freeze({
|
293 | default: _ctx,
|
294 | __moduleExports: _ctx
|
295 | });
|
296 |
|
297 | var redefine = ( _redefine$1 && _redefine ) || _redefine$1;
|
298 |
|
299 | var require$$0$1 = ( _ctx$1 && _ctx ) || _ctx$1;
|
300 |
|
301 | var PROTOTYPE = 'prototype';
|
302 |
|
303 | var $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 |
|
316 | own = !IS_FORCED && target && target[key] !== undefined;
|
317 |
|
318 | out = (own ? target : source)[key];
|
319 |
|
320 | exp = IS_BIND && own ? require$$0$1(out, global$1) : IS_PROTO && typeof out == 'function' ? require$$0$1(Function.call, out) : out;
|
321 |
|
322 | if (target) redefine(target, key, out, type & $export.U);
|
323 |
|
324 | if (exports[key] != out) require$$0(exports, key, exp);
|
325 | if (IS_PROTO && expProto[key] != out) expProto[key] = out;
|
326 | }
|
327 | };
|
328 | global$1.core = require$$1$1;
|
329 |
|
330 | $export.F = 1;
|
331 | $export.G = 2;
|
332 | $export.S = 4;
|
333 | $export.P = 8;
|
334 | $export.B = 16;
|
335 | $export.W = 32;
|
336 | $export.U = 64;
|
337 | $export.R = 128;
|
338 | var _export = $export;
|
339 |
|
340 | var _export$1 = Object.freeze({
|
341 | default: _export,
|
342 | __moduleExports: _export
|
343 | });
|
344 |
|
345 |
|
346 | var _defined = function (it) {
|
347 | if (it == undefined) throw TypeError("Can't call method on " + it);
|
348 | return it;
|
349 | };
|
350 |
|
351 | var _defined$1 = Object.freeze({
|
352 | default: _defined,
|
353 | __moduleExports: _defined
|
354 | });
|
355 |
|
356 | var defined = ( _defined$1 && _defined ) || _defined$1;
|
357 |
|
358 |
|
359 |
|
360 | var _toObject = function (it) {
|
361 | return Object(defined(it));
|
362 | };
|
363 |
|
364 | var _toObject$1 = Object.freeze({
|
365 | default: _toObject,
|
366 | __moduleExports: _toObject
|
367 | });
|
368 |
|
369 | var $export$1 = ( _export$1 && _export ) || _export$1;
|
370 |
|
371 | var 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 |
|
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 |
|
385 | var toString = {}.toString;
|
386 |
|
387 | var _cof = function (it) {
|
388 | return toString.call(it).slice(8, -1);
|
389 | };
|
390 |
|
391 | var _cof$1 = Object.freeze({
|
392 | default: _cof,
|
393 | __moduleExports: _cof
|
394 | });
|
395 |
|
396 | var cof = ( _cof$1 && _cof ) || _cof$1;
|
397 |
|
398 |
|
399 |
|
400 |
|
401 | var _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
|
402 | return cof(it) == 'String' ? it.split('') : Object(it);
|
403 | };
|
404 |
|
405 | var _iobject$1 = Object.freeze({
|
406 | default: _iobject,
|
407 | __moduleExports: _iobject
|
408 | });
|
409 |
|
410 | var IObject = ( _iobject$1 && _iobject ) || _iobject$1;
|
411 |
|
412 |
|
413 |
|
414 |
|
415 | var _toIobject = function (it) {
|
416 | return IObject(defined(it));
|
417 | };
|
418 |
|
419 | var _toIobject$1 = Object.freeze({
|
420 | default: _toIobject,
|
421 | __moduleExports: _toIobject
|
422 | });
|
423 |
|
424 |
|
425 | var ceil = Math.ceil;
|
426 | var floor = Math.floor;
|
427 | var _toInteger = function (it) {
|
428 | return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
|
429 | };
|
430 |
|
431 | var _toInteger$1 = Object.freeze({
|
432 | default: _toInteger,
|
433 | __moduleExports: _toInteger
|
434 | });
|
435 |
|
436 | var toInteger = ( _toInteger$1 && _toInteger ) || _toInteger$1;
|
437 |
|
438 |
|
439 |
|
440 | var min = Math.min;
|
441 | var _toLength = function (it) {
|
442 | return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0;
|
443 | };
|
444 |
|
445 | var _toLength$1 = Object.freeze({
|
446 | default: _toLength,
|
447 | __moduleExports: _toLength
|
448 | });
|
449 |
|
450 | var max = Math.max;
|
451 | var min$1 = Math.min;
|
452 | var _toAbsoluteIndex = function (index, length) {
|
453 | index = toInteger(index);
|
454 | return index < 0 ? max(index + length, 0) : min$1(index, length);
|
455 | };
|
456 |
|
457 | var _toAbsoluteIndex$1 = Object.freeze({
|
458 | default: _toAbsoluteIndex,
|
459 | __moduleExports: _toAbsoluteIndex
|
460 | });
|
461 |
|
462 | var toIObject = ( _toIobject$1 && _toIobject ) || _toIobject$1;
|
463 |
|
464 | var toLength = ( _toLength$1 && _toLength ) || _toLength$1;
|
465 |
|
466 | var toAbsoluteIndex = ( _toAbsoluteIndex$1 && _toAbsoluteIndex ) || _toAbsoluteIndex$1;
|
467 |
|
468 |
|
469 |
|
470 |
|
471 |
|
472 |
|
473 | var _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 |
|
480 |
|
481 | if (IS_INCLUDES && el != el) while (length > index) {
|
482 | value = O[index++];
|
483 |
|
484 | if (value != value) return true;
|
485 |
|
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 |
|
492 | var _arrayIncludes$1 = Object.freeze({
|
493 | default: _arrayIncludes,
|
494 | __moduleExports: _arrayIncludes
|
495 | });
|
496 |
|
497 | var _library = false;
|
498 |
|
499 | var _library$1 = Object.freeze({
|
500 | default: _library,
|
501 | __moduleExports: _library
|
502 | });
|
503 |
|
504 | var LIBRARY = ( _library$1 && _library ) || _library$1;
|
505 |
|
506 | var _shared = createCommonjsModule(function (module) {
|
507 | var SHARED = '__core-js_shared__';
|
508 | var 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 |
|
519 | var _shared$1 = Object.freeze({
|
520 | default: _shared,
|
521 | __moduleExports: _shared
|
522 | });
|
523 |
|
524 | var require$$0$2 = ( _shared$1 && _shared ) || _shared$1;
|
525 |
|
526 | var shared = require$$0$2('keys');
|
527 |
|
528 | var _sharedKey = function (key) {
|
529 | return shared[key] || (shared[key] = uid(key));
|
530 | };
|
531 |
|
532 | var _sharedKey$1 = Object.freeze({
|
533 | default: _sharedKey,
|
534 | __moduleExports: _sharedKey
|
535 | });
|
536 |
|
537 | var require$$0$3 = ( _arrayIncludes$1 && _arrayIncludes ) || _arrayIncludes$1;
|
538 |
|
539 | var require$$0$4 = ( _sharedKey$1 && _sharedKey ) || _sharedKey$1;
|
540 |
|
541 | var arrayIndexOf = require$$0$3(false);
|
542 | var IE_PROTO = require$$0$4('IE_PROTO');
|
543 |
|
544 | var _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 |
|
551 | while (names.length > i) if (has(O, key = names[i++])) {
|
552 | ~arrayIndexOf(result, key) || result.push(key);
|
553 | }
|
554 | return result;
|
555 | };
|
556 |
|
557 | var _objectKeysInternal$1 = Object.freeze({
|
558 | default: _objectKeysInternal,
|
559 | __moduleExports: _objectKeysInternal
|
560 | });
|
561 |
|
562 |
|
563 | var _enumBugKeys = (
|
564 | 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
|
565 | ).split(',');
|
566 |
|
567 | var _enumBugKeys$1 = Object.freeze({
|
568 | default: _enumBugKeys,
|
569 | __moduleExports: _enumBugKeys
|
570 | });
|
571 |
|
572 | var $keys = ( _objectKeysInternal$1 && _objectKeysInternal ) || _objectKeysInternal$1;
|
573 |
|
574 | var require$$0$5 = ( _enumBugKeys$1 && _enumBugKeys ) || _enumBugKeys$1;
|
575 |
|
576 |
|
577 |
|
578 |
|
579 |
|
580 | var _objectKeys = Object.keys || function keys(O) {
|
581 | return $keys(O, require$$0$5);
|
582 | };
|
583 |
|
584 | var _objectKeys$1 = Object.freeze({
|
585 | default: _objectKeys,
|
586 | __moduleExports: _objectKeys
|
587 | });
|
588 |
|
589 | var f$1 = Object.getOwnPropertySymbols;
|
590 |
|
591 | var _objectGops = {
|
592 | f: f$1
|
593 | };
|
594 |
|
595 | var _objectGops$1 = Object.freeze({
|
596 | default: _objectGops,
|
597 | __moduleExports: _objectGops,
|
598 | f: f$1
|
599 | });
|
600 |
|
601 | var f$2 = {}.propertyIsEnumerable;
|
602 |
|
603 | var _objectPie = {
|
604 | f: f$2
|
605 | };
|
606 |
|
607 | var _objectPie$1 = Object.freeze({
|
608 | default: _objectPie,
|
609 | __moduleExports: _objectPie,
|
610 | f: f$2
|
611 | });
|
612 |
|
613 | var getKeys = ( _objectKeys$1 && _objectKeys ) || _objectKeys$1;
|
614 |
|
615 | var gOPS = ( _objectGops$1 && _objectGops ) || _objectGops$1;
|
616 |
|
617 | var pIE = ( _objectPie$1 && _objectPie ) || _objectPie$1;
|
618 |
|
619 |
|
620 |
|
621 |
|
622 |
|
623 |
|
624 |
|
625 | var $assign = Object.assign;
|
626 |
|
627 |
|
628 | var _objectAssign = !$assign || require$$1(function () {
|
629 | var A = {};
|
630 | var B = {};
|
631 |
|
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) {
|
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 |
|
653 | var _objectAssign$1 = Object.freeze({
|
654 | default: _objectAssign,
|
655 | __moduleExports: _objectAssign
|
656 | });
|
657 |
|
658 | var require$$0$6 = ( _objectAssign$1 && _objectAssign ) || _objectAssign$1;
|
659 |
|
660 |
|
661 |
|
662 |
|
663 | $export$1($export$1.S + $export$1.F, 'Object', { assign: require$$0$6 });
|
664 |
|
665 | function 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 |
|
681 | function _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 |
|
701 | function _classCallCheck(instance, Constructor) {
|
702 | if (!(instance instanceof Constructor)) {
|
703 | throw new TypeError("Cannot call a class as a function");
|
704 | }
|
705 | }
|
706 |
|
707 | function _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 |
|
717 | function _createClass(Constructor, protoProps, staticProps) {
|
718 | if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
719 | if (staticProps) _defineProperties(Constructor, staticProps);
|
720 | return Constructor;
|
721 | }
|
722 |
|
723 | function _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 |
|
738 | function _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 |
|
753 | function _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 |
|
760 | function _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 |
|
769 | function 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 |
|
782 | function _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 |
|
799 | function _isNativeFunction(fn) {
|
800 | return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
801 | }
|
802 |
|
803 | function _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 |
|
837 | function _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 |
|
845 | function _possibleConstructorReturn(self, call) {
|
846 | if (call && (typeof call === "object" || typeof call === "function")) {
|
847 | return call;
|
848 | }
|
849 |
|
850 | return _assertThisInitialized(self);
|
851 | }
|
852 |
|
853 | function _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 |
|
862 | function _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 |
|
883 | function _toConsumableArray(arr) {
|
884 | return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
|
885 | }
|
886 |
|
887 | function _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 |
|
895 | function _iterableToArray(iter) {
|
896 | if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
|
897 | }
|
898 |
|
899 | function _nonIterableSpread() {
|
900 | throw new TypeError("Invalid attempt to spread non-iterable instance");
|
901 | }
|
902 |
|
903 | var _wks = createCommonjsModule(function (module) {
|
904 | var store = require$$0$2('wks');
|
905 |
|
906 | var Symbol = global$1.Symbol;
|
907 | var USE_SYMBOL = typeof Symbol == 'function';
|
908 |
|
909 | var $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 |
|
917 | var _wks$1 = Object.freeze({
|
918 | default: _wks,
|
919 | __moduleExports: _wks
|
920 | });
|
921 |
|
922 | var require$$0$7 = ( _wks$1 && _wks ) || _wks$1;
|
923 |
|
924 | var f$3 = require$$0$7;
|
925 |
|
926 | var _wksExt = {
|
927 | f: f$3
|
928 | };
|
929 |
|
930 | var _wksExt$1 = Object.freeze({
|
931 | default: _wksExt,
|
932 | __moduleExports: _wksExt,
|
933 | f: f$3
|
934 | });
|
935 |
|
936 | var wksExt = ( _wksExt$1 && _wksExt ) || _wksExt$1;
|
937 |
|
938 | var defineProperty = dP$1.f;
|
939 | var _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 |
|
944 | var _wksDefine$1 = Object.freeze({
|
945 | default: _wksDefine,
|
946 | __moduleExports: _wksDefine
|
947 | });
|
948 |
|
949 | var wksDefine = ( _wksDefine$1 && _wksDefine ) || _wksDefine$1;
|
950 |
|
951 | wksDefine('asyncIterator');
|
952 |
|
953 | var _meta = createCommonjsModule(function (module) {
|
954 | var META = uid('meta');
|
955 |
|
956 |
|
957 | var setDesc = dP$1.f;
|
958 | var id = 0;
|
959 | var isExtensible = Object.isExtensible || function () {
|
960 | return true;
|
961 | };
|
962 | var FREEZE = !require$$1(function () {
|
963 | return isExtensible(Object.preventExtensions({}));
|
964 | });
|
965 | var setMeta = function (it) {
|
966 | setDesc(it, META, { value: {
|
967 | i: 'O' + ++id,
|
968 | w: {}
|
969 | } });
|
970 | };
|
971 | var fastKey = function (it, create) {
|
972 |
|
973 | if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
|
974 | if (!has(it, META)) {
|
975 |
|
976 | if (!isExtensible(it)) return 'F';
|
977 |
|
978 | if (!create) return 'E';
|
979 |
|
980 | setMeta(it);
|
981 |
|
982 | } return it[META].i;
|
983 | };
|
984 | var getWeak = function (it, create) {
|
985 | if (!has(it, META)) {
|
986 |
|
987 | if (!isExtensible(it)) return true;
|
988 |
|
989 | if (!create) return false;
|
990 |
|
991 | setMeta(it);
|
992 |
|
993 | } return it[META].w;
|
994 | };
|
995 |
|
996 | var onFreeze = function (it) {
|
997 | if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);
|
998 | return it;
|
999 | };
|
1000 | var meta = module.exports = {
|
1001 | KEY: META,
|
1002 | NEED: false,
|
1003 | fastKey: fastKey,
|
1004 | getWeak: getWeak,
|
1005 | onFreeze: onFreeze
|
1006 | };
|
1007 | });
|
1008 | var _meta_1 = _meta.KEY;
|
1009 | var _meta_2 = _meta.NEED;
|
1010 | var _meta_3 = _meta.fastKey;
|
1011 | var _meta_4 = _meta.getWeak;
|
1012 | var _meta_5 = _meta.onFreeze;
|
1013 |
|
1014 | var _meta$1 = 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 |
|
1024 | var def = dP$1.f;
|
1025 |
|
1026 | var TAG = require$$0$7('toStringTag');
|
1027 |
|
1028 | var _setToStringTag = function (it, tag, stat) {
|
1029 | if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
|
1030 | };
|
1031 |
|
1032 | var _setToStringTag$1 = Object.freeze({
|
1033 | default: _setToStringTag,
|
1034 | __moduleExports: _setToStringTag
|
1035 | });
|
1036 |
|
1037 |
|
1038 |
|
1039 |
|
1040 |
|
1041 | var _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 |
|
1053 | var _enumKeys$1 = Object.freeze({
|
1054 | default: _enumKeys,
|
1055 | __moduleExports: _enumKeys
|
1056 | });
|
1057 |
|
1058 |
|
1059 |
|
1060 | var _isArray = Array.isArray || function isArray(arg) {
|
1061 | return cof(arg) == 'Array';
|
1062 | };
|
1063 |
|
1064 | var _isArray$1 = Object.freeze({
|
1065 | default: _isArray,
|
1066 | __moduleExports: _isArray
|
1067 | });
|
1068 |
|
1069 | var _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 |
|
1079 | var _objectDps$1 = Object.freeze({
|
1080 | default: _objectDps,
|
1081 | __moduleExports: _objectDps
|
1082 | });
|
1083 |
|
1084 | var document$1 = global$1.document;
|
1085 | var _html = document$1 && document$1.documentElement;
|
1086 |
|
1087 | var _html$1 = Object.freeze({
|
1088 | default: _html,
|
1089 | __moduleExports: _html
|
1090 | });
|
1091 |
|
1092 | var dPs = ( _objectDps$1 && _objectDps ) || _objectDps$1;
|
1093 |
|
1094 | var require$$2$1 = ( _html$1 && _html ) || _html$1;
|
1095 |
|
1096 |
|
1097 |
|
1098 |
|
1099 |
|
1100 | var IE_PROTO$1 = require$$0$4('IE_PROTO');
|
1101 | var Empty = function () { };
|
1102 | var PROTOTYPE$1 = 'prototype';
|
1103 |
|
1104 |
|
1105 | var createDict = function () {
|
1106 |
|
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:';
|
1115 |
|
1116 |
|
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 |
|
1126 | var _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 |
|
1133 | result[IE_PROTO$1] = O;
|
1134 | } else result = createDict();
|
1135 | return Properties === undefined ? result : dPs(result, Properties);
|
1136 | };
|
1137 |
|
1138 | var _objectCreate$1 = Object.freeze({
|
1139 | default: _objectCreate,
|
1140 | __moduleExports: _objectCreate
|
1141 | });
|
1142 |
|
1143 |
|
1144 |
|
1145 | var hiddenKeys = require$$0$5.concat('length', 'prototype');
|
1146 |
|
1147 | var f$4 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
1148 | return $keys(O, hiddenKeys);
|
1149 | };
|
1150 |
|
1151 | var _objectGopn = {
|
1152 | f: f$4
|
1153 | };
|
1154 |
|
1155 | var _objectGopn$1 = Object.freeze({
|
1156 | default: _objectGopn,
|
1157 | __moduleExports: _objectGopn,
|
1158 | f: f$4
|
1159 | });
|
1160 |
|
1161 | var require$$0$8 = ( _objectGopn$1 && _objectGopn ) || _objectGopn$1;
|
1162 |
|
1163 |
|
1164 |
|
1165 | var gOPN = require$$0$8.f;
|
1166 | var toString$1 = {}.toString;
|
1167 |
|
1168 | var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
|
1169 | ? Object.getOwnPropertyNames(window) : [];
|
1170 |
|
1171 | var getWindowNames = function (it) {
|
1172 | try {
|
1173 | return gOPN(it);
|
1174 | } catch (e) {
|
1175 | return windowNames.slice();
|
1176 | }
|
1177 | };
|
1178 |
|
1179 | var f$5 = function getOwnPropertyNames(it) {
|
1180 | return windowNames && toString$1.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
|
1181 | };
|
1182 |
|
1183 | var _objectGopnExt = {
|
1184 | f: f$5
|
1185 | };
|
1186 |
|
1187 | var _objectGopnExt$1 = Object.freeze({
|
1188 | default: _objectGopnExt,
|
1189 | __moduleExports: _objectGopnExt,
|
1190 | f: f$5
|
1191 | });
|
1192 |
|
1193 | var gOPD = Object.getOwnPropertyDescriptor;
|
1194 |
|
1195 | var 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) { }
|
1201 | if (has(O, P)) return descriptor(!pIE.f.call(O, P), O[P]);
|
1202 | };
|
1203 |
|
1204 | var _objectGopd = {
|
1205 | f: f$6
|
1206 | };
|
1207 |
|
1208 | var _objectGopd$1 = Object.freeze({
|
1209 | default: _objectGopd,
|
1210 | __moduleExports: _objectGopd,
|
1211 | f: f$6
|
1212 | });
|
1213 |
|
1214 | var meta = ( _meta$1 && _meta ) || _meta$1;
|
1215 |
|
1216 | var setToStringTag = ( _setToStringTag$1 && _setToStringTag ) || _setToStringTag$1;
|
1217 |
|
1218 | var enumKeys = ( _enumKeys$1 && _enumKeys ) || _enumKeys$1;
|
1219 |
|
1220 | var isArray = ( _isArray$1 && _isArray ) || _isArray$1;
|
1221 |
|
1222 | var create = ( _objectCreate$1 && _objectCreate ) || _objectCreate$1;
|
1223 |
|
1224 | var gOPNExt = ( _objectGopnExt$1 && _objectGopnExt ) || _objectGopnExt$1;
|
1225 |
|
1226 | var require$$1$2 = ( _objectGopd$1 && _objectGopd ) || _objectGopd$1;
|
1227 |
|
1228 |
|
1229 |
|
1230 |
|
1231 |
|
1232 |
|
1233 |
|
1234 | var META = meta.KEY;
|
1235 |
|
1236 |
|
1237 |
|
1238 |
|
1239 |
|
1240 |
|
1241 |
|
1242 |
|
1243 |
|
1244 |
|
1245 |
|
1246 |
|
1247 |
|
1248 |
|
1249 |
|
1250 |
|
1251 |
|
1252 |
|
1253 |
|
1254 | var gOPD$1 = require$$1$2.f;
|
1255 | var dP$2 = dP$1.f;
|
1256 | var gOPN$1 = gOPNExt.f;
|
1257 | var $Symbol = global$1.Symbol;
|
1258 | var $JSON = global$1.JSON;
|
1259 | var _stringify = $JSON && $JSON.stringify;
|
1260 | var PROTOTYPE$2 = 'prototype';
|
1261 | var HIDDEN = require$$0$7('_hidden');
|
1262 | var TO_PRIMITIVE = require$$0$7('toPrimitive');
|
1263 | var isEnum = {}.propertyIsEnumerable;
|
1264 | var SymbolRegistry = require$$0$2('symbol-registry');
|
1265 | var AllSymbols = require$$0$2('symbols');
|
1266 | var OPSymbols = require$$0$2('op-symbols');
|
1267 | var ObjectProto = Object[PROTOTYPE$2];
|
1268 | var USE_NATIVE = typeof $Symbol == 'function';
|
1269 | var QObject = global$1.QObject;
|
1270 |
|
1271 | var setter = !QObject || !QObject[PROTOTYPE$2] || !QObject[PROTOTYPE$2].findChild;
|
1272 |
|
1273 |
|
1274 | var 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 |
|
1285 | var wrap = function (tag) {
|
1286 | var sym = AllSymbols[tag] = create($Symbol[PROTOTYPE$2]);
|
1287 | sym._k = tag;
|
1288 | return sym;
|
1289 | };
|
1290 |
|
1291 | var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {
|
1292 | return typeof it == 'symbol';
|
1293 | } : function (it) {
|
1294 | return it instanceof $Symbol;
|
1295 | };
|
1296 |
|
1297 | var $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 | };
|
1312 | var $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 | };
|
1321 | var $create = function create$$1(it, P) {
|
1322 | return P === undefined ? create(it) : $defineProperties(create(it), P);
|
1323 | };
|
1324 | var $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 | };
|
1329 | var $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 | };
|
1337 | var $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 | };
|
1346 | var $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 |
|
1358 | if (!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 |
|
1391 | for (var es6Symbols = (
|
1392 |
|
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 |
|
1396 | for (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 |
|
1400 | 'for': function (key) {
|
1401 | return has(SymbolRegistry, key += '')
|
1402 | ? SymbolRegistry[key]
|
1403 | : SymbolRegistry[key] = $Symbol(key);
|
1404 | },
|
1405 |
|
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 |
|
1416 | create: $create,
|
1417 |
|
1418 | defineProperty: $defineProperty,
|
1419 |
|
1420 | defineProperties: $defineProperties,
|
1421 |
|
1422 | getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
|
1423 |
|
1424 | getOwnPropertyNames: $getOwnPropertyNames,
|
1425 |
|
1426 | getOwnPropertySymbols: $getOwnPropertySymbols
|
1427 | });
|
1428 |
|
1429 |
|
1430 | $JSON && $export$1($export$1.S + $export$1.F * (!USE_NATIVE || require$$1(function () {
|
1431 | var S = $Symbol();
|
1432 |
|
1433 |
|
1434 |
|
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;
|
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 |
|
1454 | $Symbol[PROTOTYPE$2][TO_PRIMITIVE] || require$$0($Symbol[PROTOTYPE$2], TO_PRIMITIVE, $Symbol[PROTOTYPE$2].valueOf);
|
1455 |
|
1456 | setToStringTag($Symbol, 'Symbol');
|
1457 |
|
1458 | setToStringTag(Math, 'Math', true);
|
1459 |
|
1460 | setToStringTag(global$1.JSON, 'JSON', true);
|
1461 |
|
1462 |
|
1463 | var UNSCOPABLES = require$$0$7('unscopables');
|
1464 | var ArrayProto = Array.prototype;
|
1465 | if (ArrayProto[UNSCOPABLES] == undefined) require$$0(ArrayProto, UNSCOPABLES, {});
|
1466 | var _addToUnscopables = function (key) {
|
1467 | ArrayProto[UNSCOPABLES][key] = true;
|
1468 | };
|
1469 |
|
1470 | var _addToUnscopables$1 = Object.freeze({
|
1471 | default: _addToUnscopables,
|
1472 | __moduleExports: _addToUnscopables
|
1473 | });
|
1474 |
|
1475 | var _iterStep = function (done, value) {
|
1476 | return { value: value, done: !!done };
|
1477 | };
|
1478 |
|
1479 | var _iterStep$1 = Object.freeze({
|
1480 | default: _iterStep,
|
1481 | __moduleExports: _iterStep
|
1482 | });
|
1483 |
|
1484 | var _iterators = {};
|
1485 |
|
1486 | var _iterators$1 = Object.freeze({
|
1487 | default: _iterators,
|
1488 | __moduleExports: _iterators
|
1489 | });
|
1490 |
|
1491 | var IteratorPrototype = {};
|
1492 |
|
1493 |
|
1494 | require$$0(IteratorPrototype, require$$0$7('iterator'), function () { return this; });
|
1495 |
|
1496 | var _iterCreate = function (Constructor, NAME, next) {
|
1497 | Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
|
1498 | setToStringTag(Constructor, NAME + ' Iterator');
|
1499 | };
|
1500 |
|
1501 | var _iterCreate$1 = Object.freeze({
|
1502 | default: _iterCreate,
|
1503 | __moduleExports: _iterCreate
|
1504 | });
|
1505 |
|
1506 |
|
1507 |
|
1508 |
|
1509 | var IE_PROTO$2 = require$$0$4('IE_PROTO');
|
1510 | var ObjectProto$1 = Object.prototype;
|
1511 |
|
1512 | var _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 |
|
1520 | var _objectGpo$1 = Object.freeze({
|
1521 | default: _objectGpo,
|
1522 | __moduleExports: _objectGpo
|
1523 | });
|
1524 |
|
1525 | var Iterators = ( _iterators$1 && _iterators ) || _iterators$1;
|
1526 |
|
1527 | var $iterCreate = ( _iterCreate$1 && _iterCreate ) || _iterCreate$1;
|
1528 |
|
1529 | var getPrototypeOf = ( _objectGpo$1 && _objectGpo ) || _objectGpo$1;
|
1530 |
|
1531 | var ITERATOR = require$$0$7('iterator');
|
1532 | var BUGGY = !([].keys && 'next' in [].keys());
|
1533 | var FF_ITERATOR = '@@iterator';
|
1534 | var KEYS = 'keys';
|
1535 | var VALUES = 'values';
|
1536 |
|
1537 | var returnThis = function () { return this; };
|
1538 |
|
1539 | var _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 |
|
1558 | if ($anyNative) {
|
1559 | IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
|
1560 | if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
|
1561 |
|
1562 | setToStringTag(IteratorPrototype, TAG, true);
|
1563 |
|
1564 | if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') require$$0(IteratorPrototype, ITERATOR, returnThis);
|
1565 | }
|
1566 | }
|
1567 |
|
1568 | if (DEF_VALUES && $native && $native.name !== VALUES) {
|
1569 | VALUES_BUG = true;
|
1570 | $default = function values() { return $native.call(this); };
|
1571 | }
|
1572 |
|
1573 | if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
|
1574 | require$$0(proto, ITERATOR, $default);
|
1575 | }
|
1576 |
|
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 |
|
1592 | var _iterDefine$1 = Object.freeze({
|
1593 | default: _iterDefine,
|
1594 | __moduleExports: _iterDefine
|
1595 | });
|
1596 |
|
1597 | var require$$1$3 = ( _addToUnscopables$1 && _addToUnscopables ) || _addToUnscopables$1;
|
1598 |
|
1599 | var step = ( _iterStep$1 && _iterStep ) || _iterStep$1;
|
1600 |
|
1601 | var $iterDefine = ( _iterDefine$1 && _iterDefine ) || _iterDefine$1;
|
1602 |
|
1603 |
|
1604 |
|
1605 |
|
1606 |
|
1607 | var es6_array_iterator = $iterDefine(Array, 'Array', function (iterated, kind) {
|
1608 | this._t = toIObject(iterated);
|
1609 | this._i = 0;
|
1610 | this._k = kind;
|
1611 |
|
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 |
|
1626 | Iterators.Arguments = Iterators.Array;
|
1627 |
|
1628 | require$$1$3('keys');
|
1629 | require$$1$3('values');
|
1630 | require$$1$3('entries');
|
1631 |
|
1632 | var es6_array_iterator$1 = Object.freeze({
|
1633 | default: es6_array_iterator,
|
1634 | __moduleExports: es6_array_iterator
|
1635 | });
|
1636 |
|
1637 | var $iterators = ( es6_array_iterator$1 && es6_array_iterator ) || es6_array_iterator$1;
|
1638 |
|
1639 | var ITERATOR$1 = require$$0$7('iterator');
|
1640 | var TO_STRING_TAG = require$$0$7('toStringTag');
|
1641 | var ArrayValues = Iterators.Array;
|
1642 |
|
1643 | var DOMIterables = {
|
1644 | CSSRuleList: true,
|
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,
|
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,
|
1672 | TextTrackCueList: false,
|
1673 | TextTrackList: false,
|
1674 | TouchList: false
|
1675 | };
|
1676 |
|
1677 | for (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 |
|
1692 |
|
1693 |
|
1694 | $export$1($export$1.S, 'Array', { isArray: isArray });
|
1695 |
|
1696 | var SPECIES = require$$0$7('species');
|
1697 |
|
1698 | var _arraySpeciesConstructor = function (original) {
|
1699 | var C;
|
1700 | if (isArray(original)) {
|
1701 | C = original.constructor;
|
1702 |
|
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 |
|
1711 | var _arraySpeciesConstructor$1 = Object.freeze({
|
1712 | default: _arraySpeciesConstructor,
|
1713 | __moduleExports: _arraySpeciesConstructor
|
1714 | });
|
1715 |
|
1716 | var speciesConstructor = ( _arraySpeciesConstructor$1 && _arraySpeciesConstructor ) || _arraySpeciesConstructor$1;
|
1717 |
|
1718 |
|
1719 |
|
1720 |
|
1721 | var _arraySpeciesCreate = function (original, length) {
|
1722 | return new (speciesConstructor(original))(length);
|
1723 | };
|
1724 |
|
1725 | var _arraySpeciesCreate$1 = Object.freeze({
|
1726 | default: _arraySpeciesCreate,
|
1727 | __moduleExports: _arraySpeciesCreate
|
1728 | });
|
1729 |
|
1730 | var asc = ( _arraySpeciesCreate$1 && _arraySpeciesCreate ) || _arraySpeciesCreate$1;
|
1731 |
|
1732 |
|
1733 |
|
1734 |
|
1735 |
|
1736 |
|
1737 |
|
1738 |
|
1739 |
|
1740 |
|
1741 |
|
1742 |
|
1743 |
|
1744 | var _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;
|
1765 | else if (res) switch (TYPE) {
|
1766 | case 3: return true;
|
1767 | case 5: return val;
|
1768 | case 6: return index;
|
1769 | case 2: result.push(val);
|
1770 | } else if (IS_EVERY) return false;
|
1771 | }
|
1772 | }
|
1773 | return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
|
1774 | };
|
1775 | };
|
1776 |
|
1777 | var _arrayMethods$1 = Object.freeze({
|
1778 | default: _arrayMethods,
|
1779 | __moduleExports: _arrayMethods
|
1780 | });
|
1781 |
|
1782 | var _strictMethod = function (method, arg) {
|
1783 | return !!method && require$$1(function () {
|
1784 |
|
1785 | arg ? method.call(null, function () { }, 1) : method.call(null);
|
1786 | });
|
1787 | };
|
1788 |
|
1789 | var _strictMethod$1 = Object.freeze({
|
1790 | default: _strictMethod,
|
1791 | __moduleExports: _strictMethod
|
1792 | });
|
1793 |
|
1794 | var require$$0$9 = ( _arrayMethods$1 && _arrayMethods ) || _arrayMethods$1;
|
1795 |
|
1796 | var require$$1$4 = ( _strictMethod$1 && _strictMethod ) || _strictMethod$1;
|
1797 |
|
1798 | var $forEach = require$$0$9(0);
|
1799 | var STRICT = require$$1$4([].forEach, true);
|
1800 |
|
1801 | $export$1($export$1.P + $export$1.F * !STRICT, 'Array', {
|
1802 |
|
1803 | forEach: function forEach(callbackfn /* , thisArg */) {
|
1804 | return $forEach(this, callbackfn, arguments[1]);
|
1805 | }
|
1806 | });
|
1807 |
|
1808 | var runtime = createCommonjsModule(function (module) {
|
1809 |
|
1810 |
|
1811 |
|
1812 |
|
1813 |
|
1814 |
|
1815 |
|
1816 | !(function(global) {
|
1817 |
|
1818 | var Op = Object.prototype;
|
1819 | var hasOwn = Op.hasOwnProperty;
|
1820 | var undefined;
|
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 |
|
1829 |
|
1830 | module.exports = runtime;
|
1831 | }
|
1832 |
|
1833 |
|
1834 | return;
|
1835 | }
|
1836 |
|
1837 |
|
1838 |
|
1839 | runtime = global.regeneratorRuntime = module.exports;
|
1840 |
|
1841 | function wrap(innerFn, outerFn, self, tryLocsList) {
|
1842 |
|
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 |
|
1848 |
|
1849 | generator._invoke = makeInvokeMethod(innerFn, self, context);
|
1850 |
|
1851 | return generator;
|
1852 | }
|
1853 | runtime.wrap = wrap;
|
1854 |
|
1855 |
|
1856 |
|
1857 |
|
1858 |
|
1859 |
|
1860 |
|
1861 |
|
1862 |
|
1863 |
|
1864 |
|
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 |
|
1879 |
|
1880 | var ContinueSentinel = {};
|
1881 |
|
1882 |
|
1883 |
|
1884 |
|
1885 |
|
1886 | function Generator() {}
|
1887 | function GeneratorFunction() {}
|
1888 | function GeneratorFunctionPrototype() {}
|
1889 |
|
1890 |
|
1891 |
|
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 |
|
1903 |
|
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 |
|
1915 |
|
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 |
|
1929 |
|
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 |
|
1948 |
|
1949 |
|
1950 |
|
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 |
|
1975 |
|
1976 |
|
1977 |
|
1978 |
|
1979 |
|
1980 |
|
1981 |
|
1982 |
|
1983 |
|
1984 |
|
1985 |
|
1986 |
|
1987 |
|
1988 |
|
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 |
|
2006 |
|
2007 |
|
2008 |
|
2009 |
|
2010 |
|
2011 |
|
2012 |
|
2013 |
|
2014 |
|
2015 |
|
2016 |
|
2017 | previousPromise ? previousPromise.then(
|
2018 | callInvokeWithMethodAndArg,
|
2019 |
|
2020 |
|
2021 | callInvokeWithMethodAndArg
|
2022 | ) : callInvokeWithMethodAndArg();
|
2023 | }
|
2024 |
|
2025 |
|
2026 |
|
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 |
|
2037 |
|
2038 |
|
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
|
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 |
|
2065 |
|
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 |
|
2084 |
|
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 |
|
2104 |
|
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 |
|
2121 |
|
2122 | context.method = "throw";
|
2123 | context.arg = record.arg;
|
2124 | }
|
2125 | }
|
2126 | };
|
2127 | }
|
2128 |
|
2129 |
|
2130 |
|
2131 |
|
2132 |
|
2133 | function maybeInvokeDelegate(delegate, context) {
|
2134 | var method = delegate.iterator[context.method];
|
2135 | if (method === undefined) {
|
2136 |
|
2137 |
|
2138 | context.delegate = null;
|
2139 |
|
2140 | if (context.method === "throw") {
|
2141 | if (delegate.iterator.return) {
|
2142 |
|
2143 |
|
2144 | context.method = "return";
|
2145 | context.arg = undefined;
|
2146 | maybeInvokeDelegate(delegate, context);
|
2147 |
|
2148 | if (context.method === "throw") {
|
2149 |
|
2150 |
|
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 |
|
2183 |
|
2184 | context[delegate.resultName] = info.value;
|
2185 |
|
2186 |
|
2187 | context.next = delegate.nextLoc;
|
2188 |
|
2189 |
|
2190 |
|
2191 |
|
2192 |
|
2193 |
|
2194 |
|
2195 | if (context.method !== "return") {
|
2196 | context.method = "next";
|
2197 | context.arg = undefined;
|
2198 | }
|
2199 |
|
2200 | } else {
|
2201 |
|
2202 | return info;
|
2203 | }
|
2204 |
|
2205 |
|
2206 |
|
2207 | context.delegate = null;
|
2208 | return ContinueSentinel;
|
2209 | }
|
2210 |
|
2211 |
|
2212 |
|
2213 | defineIteratorMethods(Gp);
|
2214 |
|
2215 | Gp[toStringTagSymbol] = "Generator";
|
2216 |
|
2217 |
|
2218 |
|
2219 |
|
2220 |
|
2221 |
|
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 |
|
2254 |
|
2255 |
|
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 |
|
2269 |
|
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 |
|
2281 |
|
2282 |
|
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 |
|
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 |
|
2335 |
|
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 |
|
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 |
|
2382 |
|
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 |
|
2396 |
|
2397 |
|
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 |
|
2446 |
|
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 |
|
2507 |
|
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 |
|
2520 |
|
2521 | this.arg = undefined;
|
2522 | }
|
2523 |
|
2524 | return ContinueSentinel;
|
2525 | }
|
2526 | };
|
2527 | })(
|
2528 |
|
2529 |
|
2530 |
|
2531 | (function() { return this })() || Function("return this")()
|
2532 | );
|
2533 | });
|
2534 |
|
2535 |
|
2536 |
|
2537 | var _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 |
|
2551 | var _stringAt$1 = Object.freeze({
|
2552 | default: _stringAt,
|
2553 | __moduleExports: _stringAt
|
2554 | });
|
2555 |
|
2556 | var require$$0$a = ( _stringAt$1 && _stringAt ) || _stringAt$1;
|
2557 |
|
2558 | var $at = require$$0$a(true);
|
2559 |
|
2560 |
|
2561 | $iterDefine(String, 'String', function (iterated) {
|
2562 | this._t = String(iterated);
|
2563 | this._i = 0;
|
2564 |
|
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 |
|
2575 | var _redefineAll = function (target, src, safe) {
|
2576 | for (var key in src) redefine(target, key, src[key], safe);
|
2577 | return target;
|
2578 | };
|
2579 |
|
2580 | var _redefineAll$1 = Object.freeze({
|
2581 | default: _redefineAll,
|
2582 | __moduleExports: _redefineAll
|
2583 | });
|
2584 |
|
2585 | var _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 |
|
2591 | var _anInstance$1 = Object.freeze({
|
2592 | default: _anInstance,
|
2593 | __moduleExports: _anInstance
|
2594 | });
|
2595 |
|
2596 |
|
2597 |
|
2598 | var _iterCall = function (iterator, fn, value, entries) {
|
2599 | try {
|
2600 | return entries ? fn(anObject(value)[0], value[1]) : fn(value);
|
2601 |
|
2602 | } catch (e) {
|
2603 | var ret = iterator['return'];
|
2604 | if (ret !== undefined) anObject(ret.call(iterator));
|
2605 | throw e;
|
2606 | }
|
2607 | };
|
2608 |
|
2609 | var _iterCall$1 = Object.freeze({
|
2610 | default: _iterCall,
|
2611 | __moduleExports: _iterCall
|
2612 | });
|
2613 |
|
2614 |
|
2615 |
|
2616 | var ITERATOR$2 = require$$0$7('iterator');
|
2617 | var ArrayProto$1 = Array.prototype;
|
2618 |
|
2619 | var _isArrayIter = function (it) {
|
2620 | return it !== undefined && (Iterators.Array === it || ArrayProto$1[ITERATOR$2] === it);
|
2621 | };
|
2622 |
|
2623 | var _isArrayIter$1 = Object.freeze({
|
2624 | default: _isArrayIter,
|
2625 | __moduleExports: _isArrayIter
|
2626 | });
|
2627 |
|
2628 |
|
2629 |
|
2630 | var TAG$1 = require$$0$7('toStringTag');
|
2631 |
|
2632 | var ARG = cof(function () { return arguments; }()) == 'Arguments';
|
2633 |
|
2634 |
|
2635 | var tryGet = function (it, key) {
|
2636 | try {
|
2637 | return it[key];
|
2638 | } catch (e) { }
|
2639 | };
|
2640 |
|
2641 | var _classof = function (it) {
|
2642 | var O, T, B;
|
2643 | return it === undefined ? 'Undefined' : it === null ? 'Null'
|
2644 |
|
2645 | : typeof (T = tryGet(O = Object(it), TAG$1)) == 'string' ? T
|
2646 |
|
2647 | : ARG ? cof(O)
|
2648 |
|
2649 | : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
|
2650 | };
|
2651 |
|
2652 | var _classof$1 = Object.freeze({
|
2653 | default: _classof,
|
2654 | __moduleExports: _classof
|
2655 | });
|
2656 |
|
2657 | var classof = ( _classof$1 && _classof ) || _classof$1;
|
2658 |
|
2659 | var ITERATOR$3 = require$$0$7('iterator');
|
2660 |
|
2661 | var 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 |
|
2667 | var core_getIteratorMethod$1 = Object.freeze({
|
2668 | default: core_getIteratorMethod,
|
2669 | __moduleExports: core_getIteratorMethod
|
2670 | });
|
2671 |
|
2672 | var call = ( _iterCall$1 && _iterCall ) || _iterCall$1;
|
2673 |
|
2674 | var isArrayIter = ( _isArrayIter$1 && _isArrayIter ) || _isArrayIter$1;
|
2675 |
|
2676 | var getIterFn = ( core_getIteratorMethod$1 && core_getIteratorMethod ) || core_getIteratorMethod$1;
|
2677 |
|
2678 | var _forOf = createCommonjsModule(function (module) {
|
2679 | var BREAK = {};
|
2680 | var RETURN = {};
|
2681 | var 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 |
|
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 | };
|
2696 | exports.BREAK = BREAK;
|
2697 | exports.RETURN = RETURN;
|
2698 | });
|
2699 |
|
2700 | var _forOf$1 = Object.freeze({
|
2701 | default: _forOf,
|
2702 | __moduleExports: _forOf
|
2703 | });
|
2704 |
|
2705 | var SPECIES$1 = require$$0$7('species');
|
2706 |
|
2707 | var _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 |
|
2715 | var _setSpecies$1 = Object.freeze({
|
2716 | default: _setSpecies,
|
2717 | __moduleExports: _setSpecies
|
2718 | });
|
2719 |
|
2720 | var _validateCollection = function (it, TYPE) {
|
2721 | if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');
|
2722 | return it;
|
2723 | };
|
2724 |
|
2725 | var _validateCollection$1 = Object.freeze({
|
2726 | default: _validateCollection,
|
2727 | __moduleExports: _validateCollection
|
2728 | });
|
2729 |
|
2730 | var redefineAll = ( _redefineAll$1 && _redefineAll ) || _redefineAll$1;
|
2731 |
|
2732 | var anInstance = ( _anInstance$1 && _anInstance ) || _anInstance$1;
|
2733 |
|
2734 | var forOf = ( _forOf$1 && _forOf ) || _forOf$1;
|
2735 |
|
2736 | var setSpecies = ( _setSpecies$1 && _setSpecies ) || _setSpecies$1;
|
2737 |
|
2738 | var validate = ( _validateCollection$1 && _validateCollection ) || _validateCollection$1;
|
2739 |
|
2740 | var dP$3 = dP$1.f;
|
2741 |
|
2742 |
|
2743 |
|
2744 |
|
2745 |
|
2746 |
|
2747 |
|
2748 |
|
2749 |
|
2750 | var fastKey = meta.fastKey;
|
2751 |
|
2752 | var SIZE = DESCRIPTORS ? '_s' : 'size';
|
2753 |
|
2754 | var getEntry = function (that, key) {
|
2755 |
|
2756 | var index = fastKey(key);
|
2757 | var entry;
|
2758 | if (index !== 'F') return that._i[index];
|
2759 |
|
2760 | for (entry = that._f; entry; entry = entry.n) {
|
2761 | if (entry.k == key) return entry;
|
2762 | }
|
2763 | };
|
2764 |
|
2765 | var _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;
|
2770 | that._i = create(null);
|
2771 | that._f = undefined;
|
2772 | that._l = undefined;
|
2773 | that[SIZE] = 0;
|
2774 | if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
|
2775 | });
|
2776 | redefineAll(C.prototype, {
|
2777 |
|
2778 |
|
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 |
|
2789 |
|
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 |
|
2806 |
|
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 |
|
2814 | while (entry && entry.r) entry = entry.p;
|
2815 | }
|
2816 | },
|
2817 |
|
2818 |
|
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 |
|
2834 | if (entry) {
|
2835 | entry.v = value;
|
2836 |
|
2837 | } else {
|
2838 | that._l = entry = {
|
2839 | i: index = fastKey(key, true),
|
2840 | k: key,
|
2841 | v: value,
|
2842 | p: prev = that._l,
|
2843 | n: undefined,
|
2844 | r: false
|
2845 | };
|
2846 | if (!that._f) that._f = entry;
|
2847 | if (prev) prev.n = entry;
|
2848 | that[SIZE]++;
|
2849 |
|
2850 | if (index !== 'F') that._i[index] = entry;
|
2851 | } return that;
|
2852 | },
|
2853 | getEntry: getEntry,
|
2854 | setStrong: function (C, NAME, IS_MAP) {
|
2855 |
|
2856 |
|
2857 | $iterDefine(C, NAME, function (iterated, kind) {
|
2858 | this._t = validate(iterated, NAME);
|
2859 | this._k = kind;
|
2860 | this._l = undefined;
|
2861 | }, function () {
|
2862 | var that = this;
|
2863 | var kind = that._k;
|
2864 | var entry = that._l;
|
2865 |
|
2866 | while (entry && entry.r) entry = entry.p;
|
2867 |
|
2868 | if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {
|
2869 |
|
2870 | that._t = undefined;
|
2871 | return step(1);
|
2872 | }
|
2873 |
|
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 |
|
2880 | setSpecies(NAME);
|
2881 | }
|
2882 | };
|
2883 | var _collectionStrong_1 = _collectionStrong.getConstructor;
|
2884 | var _collectionStrong_2 = _collectionStrong.def;
|
2885 | var _collectionStrong_3 = _collectionStrong.getEntry;
|
2886 | var _collectionStrong_4 = _collectionStrong.setStrong;
|
2887 |
|
2888 | var _collectionStrong$1 = 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 |
|
2897 | var ITERATOR$4 = require$$0$7('iterator');
|
2898 | var SAFE_CLOSING = false;
|
2899 |
|
2900 | try {
|
2901 | var riter = [7][ITERATOR$4]();
|
2902 | riter['return'] = function () { SAFE_CLOSING = true; };
|
2903 | } catch (e) { }
|
2904 |
|
2905 | var _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) { }
|
2915 | return safe;
|
2916 | };
|
2917 |
|
2918 | var _iterDetect$1 = Object.freeze({
|
2919 | default: _iterDetect,
|
2920 | __moduleExports: _iterDetect
|
2921 | });
|
2922 |
|
2923 |
|
2924 |
|
2925 |
|
2926 |
|
2927 | var check = function (O, proto) {
|
2928 | anObject(O);
|
2929 | if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!");
|
2930 | };
|
2931 | var _setProto = {
|
2932 | set: Object.setPrototypeOf || ('__proto__' in {} ?
|
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 | };
|
2948 | var _setProto_1 = _setProto.set;
|
2949 | var _setProto_2 = _setProto.check;
|
2950 |
|
2951 | var _setProto$1 = Object.freeze({
|
2952 | default: _setProto,
|
2953 | __moduleExports: _setProto,
|
2954 | set: _setProto_1,
|
2955 | check: _setProto_2
|
2956 | });
|
2957 |
|
2958 | var require$$0$b = ( _setProto$1 && _setProto ) || _setProto$1;
|
2959 |
|
2960 | var setPrototypeOf = require$$0$b.set;
|
2961 | var _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 |
|
2969 | var _inheritIfRequired$1 = Object.freeze({
|
2970 | default: _inheritIfRequired,
|
2971 | __moduleExports: _inheritIfRequired
|
2972 | });
|
2973 |
|
2974 | var $iterDetect = ( _iterDetect$1 && _iterDetect ) || _iterDetect$1;
|
2975 |
|
2976 | var inheritIfRequired = ( _inheritIfRequired$1 && _inheritIfRequired ) || _inheritIfRequired$1;
|
2977 |
|
2978 | var _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 |
|
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 |
|
3007 | var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;
|
3008 |
|
3009 | var THROWS_ON_PRIMITIVES = require$$1(function () { instance.has(1); });
|
3010 |
|
3011 | var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); });
|
3012 |
|
3013 | var BUGGY_ZERO = !IS_WEAK && require$$1(function () {
|
3014 |
|
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 |
|
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 |
|
3050 | var _collection$1 = Object.freeze({
|
3051 | default: _collection,
|
3052 | __moduleExports: _collection
|
3053 | });
|
3054 |
|
3055 | var strong = ( _collectionStrong$1 && _collectionStrong ) || _collectionStrong$1;
|
3056 |
|
3057 | var require$$0$c = ( _collection$1 && _collection ) || _collection$1;
|
3058 |
|
3059 | var SET = 'Set';
|
3060 |
|
3061 |
|
3062 | var es6_set = require$$0$c(SET, function (get) {
|
3063 | return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
|
3064 | }, {
|
3065 |
|
3066 | add: function add(value) {
|
3067 | return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value);
|
3068 | }
|
3069 | }, strong);
|
3070 |
|
3071 | var $some = require$$0$9(3);
|
3072 |
|
3073 | $export$1($export$1.P + $export$1.F * !require$$1$4([].some, true), 'Array', {
|
3074 |
|
3075 | some: function some(callbackfn /* , thisArg */) {
|
3076 | return $some(this, callbackfn, arguments[1]);
|
3077 | }
|
3078 | });
|
3079 |
|
3080 | var $sort = [].sort;
|
3081 | var test = [1, 2, 3];
|
3082 |
|
3083 | $export$1($export$1.P + $export$1.F * (require$$1(function () {
|
3084 |
|
3085 | test.sort(undefined);
|
3086 | }) || !require$$1(function () {
|
3087 |
|
3088 | test.sort(null);
|
3089 |
|
3090 | }) || !require$$1$4($sort)), 'Array', {
|
3091 |
|
3092 | sort: function sort(comparefn) {
|
3093 | return comparefn === undefined
|
3094 | ? $sort.call(toObject(this))
|
3095 | : $sort.call(toObject(this), aFunction(comparefn));
|
3096 | }
|
3097 | });
|
3098 |
|
3099 | var $filter = require$$0$9(2);
|
3100 |
|
3101 | $export$1($export$1.P + $export$1.F * !require$$1$4([].filter, true), 'Array', {
|
3102 |
|
3103 | filter: function filter(callbackfn /* , thisArg */) {
|
3104 | return $filter(this, callbackfn, arguments[1]);
|
3105 | }
|
3106 | });
|
3107 |
|
3108 | var $indexOf = require$$0$3(false);
|
3109 | var $native = [].indexOf;
|
3110 | var 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 |
|
3114 | indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
|
3115 | return NEGATIVE_ZERO
|
3116 |
|
3117 | ? $native.apply(this, arguments) || 0
|
3118 | : $indexOf(this, searchElement, arguments[1]);
|
3119 | }
|
3120 | });
|
3121 |
|
3122 |
|
3123 |
|
3124 | var $find = require$$0$9(5);
|
3125 | var KEY = 'find';
|
3126 | var forced = true;
|
3127 |
|
3128 | if (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 | });
|
3134 | require$$1$3(KEY);
|
3135 |
|
3136 | var dP$4 = dP$1.f;
|
3137 | var FProto = Function.prototype;
|
3138 | var nameRE = /^\s*function ([^ (]*)/;
|
3139 | var NAME$1 = 'name';
|
3140 |
|
3141 |
|
3142 | NAME$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 |
|
3153 | var $map = require$$0$9(1);
|
3154 |
|
3155 | $export$1($export$1.P + $export$1.F * !require$$1$4([].map, true), 'Array', {
|
3156 |
|
3157 | map: function map(callbackfn /* , thisArg */) {
|
3158 | return $map(this, callbackfn, arguments[1]);
|
3159 | }
|
3160 | });
|
3161 |
|
3162 | var GanttInvalidOp =
|
3163 |
|
3164 | function (_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 |
|
3178 |
|
3179 |
|
3180 |
|
3181 |
|
3182 | var has$1 = Object.prototype.hasOwnProperty;
|
3183 |
|
3184 |
|
3185 |
|
3186 |
|
3187 |
|
3188 |
|
3189 |
|
3190 | var toString$2 = Object.prototype.toString;
|
3191 |
|
3192 |
|
3193 |
|
3194 |
|
3195 |
|
3196 |
|
3197 |
|
3198 |
|
3199 | function isEmpty(val) {
|
3200 |
|
3201 | if (val == null) return true
|
3202 |
|
3203 |
|
3204 | if ('boolean' == typeof val) return false
|
3205 |
|
3206 |
|
3207 | if ('number' == typeof val) return val === 0
|
3208 |
|
3209 |
|
3210 | if ('string' == typeof val) return val.length === 0
|
3211 |
|
3212 |
|
3213 | if ('function' == typeof val) return val.length === 0
|
3214 |
|
3215 |
|
3216 | if (Array.isArray(val)) return val.length === 0
|
3217 |
|
3218 |
|
3219 | if (val instanceof Error) return val.message === ''
|
3220 |
|
3221 |
|
3222 | if (val.toString == toString$2) {
|
3223 | switch (val.toString()) {
|
3224 |
|
3225 |
|
3226 | case '[object File]':
|
3227 | case '[object Map]':
|
3228 | case '[object Set]': {
|
3229 | return val.size === 0
|
3230 | }
|
3231 |
|
3232 |
|
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 |
|
3244 | return false
|
3245 | }
|
3246 |
|
3247 |
|
3248 |
|
3249 |
|
3250 |
|
3251 |
|
3252 |
|
3253 | var lib = isEmpty;
|
3254 |
|
3255 |
|
3256 |
|
3257 |
|
3258 |
|
3259 | function 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 |
|
3277 | var arrayStartsWith_1 = createCommonjsModule(function (module, exports) {
|
3278 |
|
3279 | Object.defineProperty(exports, "__esModule", {
|
3280 | value: true
|
3281 | });
|
3282 | function 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 |
|
3292 | exports.default = arrayStartsWith;
|
3293 | });
|
3294 |
|
3295 | var arrayStartsWith = unwrapExports(arrayStartsWith_1);
|
3296 |
|
3297 | var arrayStartsWith$1 = Object.freeze({
|
3298 | default: arrayStartsWith,
|
3299 | __moduleExports: arrayStartsWith_1
|
3300 | });
|
3301 |
|
3302 | var _arrayStartsWith = ( arrayStartsWith$1 && arrayStartsWith ) || arrayStartsWith$1;
|
3303 |
|
3304 | var build = createCommonjsModule(function (module, exports) {
|
3305 |
|
3306 | Object.defineProperty(exports, "__esModule", {
|
3307 | value: true
|
3308 | });
|
3309 |
|
3310 |
|
3311 |
|
3312 | var _arrayStartsWith2 = _interopRequireDefault(_arrayStartsWith);
|
3313 |
|
3314 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
3315 |
|
3316 | exports.default = _arrayStartsWith2.default;
|
3317 | });
|
3318 |
|
3319 | var arrayStartsWith$2 = unwrapExports(build);
|
3320 |
|
3321 | function 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 |
|
3332 | var Task =
|
3333 |
|
3334 | function () {
|
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);
|
3416 |
|
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)
|
3521 |
|
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 |
|
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 |
|
3657 |
|
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 |
|
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 |
|
4137 | Task.OP_START = 'start';
|
4138 | Task.OP_FINISH = 'finish';
|
4139 |
|
4140 | function _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 |
|
4191 | var Project =
|
4192 |
|
4193 | function (_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 |
|
4236 | function project(name) {
|
4237 | return new Project(name);
|
4238 | }
|
4239 |
|
4240 | exports.project = project;
|
4241 | exports.Project = Project;
|
4242 | exports.Task = Task;
|