mazey 2.0.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.cjs.js CHANGED
@@ -1,4786 +1 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
6
-
7
- function createCommonjsModule(fn, module) {
8
- return module = { exports: {} }, fn(module, module.exports), module.exports;
9
- }
10
-
11
- var check = function (it) {
12
- return it && it.Math == Math && it;
13
- };
14
-
15
- // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
16
- var global_1 =
17
- // eslint-disable-next-line no-undef
18
- check(typeof globalThis == 'object' && globalThis) ||
19
- check(typeof window == 'object' && window) ||
20
- check(typeof self == 'object' && self) ||
21
- check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
22
- // eslint-disable-next-line no-new-func
23
- Function('return this')();
24
-
25
- var fails = function (exec) {
26
- try {
27
- return !!exec();
28
- } catch (error) {
29
- return true;
30
- }
31
- };
32
-
33
- // Thank's IE8 for his funny defineProperty
34
- var descriptors = !fails(function () {
35
- return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
36
- });
37
-
38
- var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
39
- var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
40
-
41
- // Nashorn ~ JDK8 bug
42
- var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
43
-
44
- // `Object.prototype.propertyIsEnumerable` method implementation
45
- // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable
46
- var f = NASHORN_BUG ? function propertyIsEnumerable(V) {
47
- var descriptor = getOwnPropertyDescriptor(this, V);
48
- return !!descriptor && descriptor.enumerable;
49
- } : nativePropertyIsEnumerable;
50
-
51
- var objectPropertyIsEnumerable = {
52
- f: f
53
- };
54
-
55
- var createPropertyDescriptor = function (bitmap, value) {
56
- return {
57
- enumerable: !(bitmap & 1),
58
- configurable: !(bitmap & 2),
59
- writable: !(bitmap & 4),
60
- value: value
61
- };
62
- };
63
-
64
- var toString = {}.toString;
65
-
66
- var classofRaw = function (it) {
67
- return toString.call(it).slice(8, -1);
68
- };
69
-
70
- var split = ''.split;
71
-
72
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
73
- var indexedObject = fails(function () {
74
- // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
75
- // eslint-disable-next-line no-prototype-builtins
76
- return !Object('z').propertyIsEnumerable(0);
77
- }) ? function (it) {
78
- return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
79
- } : Object;
80
-
81
- // `RequireObjectCoercible` abstract operation
82
- // https://tc39.github.io/ecma262/#sec-requireobjectcoercible
83
- var requireObjectCoercible = function (it) {
84
- if (it == undefined) throw TypeError("Can't call method on " + it);
85
- return it;
86
- };
87
-
88
- // toObject with fallback for non-array-like ES3 strings
89
-
90
-
91
-
92
- var toIndexedObject = function (it) {
93
- return indexedObject(requireObjectCoercible(it));
94
- };
95
-
96
- var isObject = function (it) {
97
- return typeof it === 'object' ? it !== null : typeof it === 'function';
98
- };
99
-
100
- // `ToPrimitive` abstract operation
101
- // https://tc39.github.io/ecma262/#sec-toprimitive
102
- // instead of the ES6 spec version, we didn't implement @@toPrimitive case
103
- // and the second argument - flag - preferred type is a string
104
- var toPrimitive = function (input, PREFERRED_STRING) {
105
- if (!isObject(input)) return input;
106
- var fn, val;
107
- if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
108
- if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
109
- if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
110
- throw TypeError("Can't convert object to primitive value");
111
- };
112
-
113
- var hasOwnProperty = {}.hasOwnProperty;
114
-
115
- var has = function (it, key) {
116
- return hasOwnProperty.call(it, key);
117
- };
118
-
119
- var document$1 = global_1.document;
120
- // typeof document.createElement is 'object' in old IE
121
- var EXISTS = isObject(document$1) && isObject(document$1.createElement);
122
-
123
- var documentCreateElement = function (it) {
124
- return EXISTS ? document$1.createElement(it) : {};
125
- };
126
-
127
- // Thank's IE8 for his funny defineProperty
128
- var ie8DomDefine = !descriptors && !fails(function () {
129
- return Object.defineProperty(documentCreateElement('div'), 'a', {
130
- get: function () { return 7; }
131
- }).a != 7;
132
- });
133
-
134
- var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
135
-
136
- // `Object.getOwnPropertyDescriptor` method
137
- // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor
138
- var f$1 = descriptors ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
139
- O = toIndexedObject(O);
140
- P = toPrimitive(P, true);
141
- if (ie8DomDefine) try {
142
- return nativeGetOwnPropertyDescriptor(O, P);
143
- } catch (error) { /* empty */ }
144
- if (has(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
145
- };
146
-
147
- var objectGetOwnPropertyDescriptor = {
148
- f: f$1
149
- };
150
-
151
- var anObject = function (it) {
152
- if (!isObject(it)) {
153
- throw TypeError(String(it) + ' is not an object');
154
- } return it;
155
- };
156
-
157
- var nativeDefineProperty = Object.defineProperty;
158
-
159
- // `Object.defineProperty` method
160
- // https://tc39.github.io/ecma262/#sec-object.defineproperty
161
- var f$2 = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
162
- anObject(O);
163
- P = toPrimitive(P, true);
164
- anObject(Attributes);
165
- if (ie8DomDefine) try {
166
- return nativeDefineProperty(O, P, Attributes);
167
- } catch (error) { /* empty */ }
168
- if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
169
- if ('value' in Attributes) O[P] = Attributes.value;
170
- return O;
171
- };
172
-
173
- var objectDefineProperty = {
174
- f: f$2
175
- };
176
-
177
- var createNonEnumerableProperty = descriptors ? function (object, key, value) {
178
- return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
179
- } : function (object, key, value) {
180
- object[key] = value;
181
- return object;
182
- };
183
-
184
- var setGlobal = function (key, value) {
185
- try {
186
- createNonEnumerableProperty(global_1, key, value);
187
- } catch (error) {
188
- global_1[key] = value;
189
- } return value;
190
- };
191
-
192
- var SHARED = '__core-js_shared__';
193
- var store = global_1[SHARED] || setGlobal(SHARED, {});
194
-
195
- var sharedStore = store;
196
-
197
- var functionToString = Function.toString;
198
-
199
- // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
200
- if (typeof sharedStore.inspectSource != 'function') {
201
- sharedStore.inspectSource = function (it) {
202
- return functionToString.call(it);
203
- };
204
- }
205
-
206
- var inspectSource = sharedStore.inspectSource;
207
-
208
- var WeakMap = global_1.WeakMap;
209
-
210
- var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
211
-
212
- var shared = createCommonjsModule(function (module) {
213
- (module.exports = function (key, value) {
214
- return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
215
- })('versions', []).push({
216
- version: '3.6.5',
217
- mode: 'global',
218
- copyright: '© 2020 Denis Pushkarev (zloirock.ru)'
219
- });
220
- });
221
-
222
- var id = 0;
223
- var postfix = Math.random();
224
-
225
- var uid = function (key) {
226
- return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
227
- };
228
-
229
- var keys = shared('keys');
230
-
231
- var sharedKey = function (key) {
232
- return keys[key] || (keys[key] = uid(key));
233
- };
234
-
235
- var hiddenKeys = {};
236
-
237
- var WeakMap$1 = global_1.WeakMap;
238
- var set, get, has$1;
239
-
240
- var enforce = function (it) {
241
- return has$1(it) ? get(it) : set(it, {});
242
- };
243
-
244
- var getterFor = function (TYPE) {
245
- return function (it) {
246
- var state;
247
- if (!isObject(it) || (state = get(it)).type !== TYPE) {
248
- throw TypeError('Incompatible receiver, ' + TYPE + ' required');
249
- } return state;
250
- };
251
- };
252
-
253
- if (nativeWeakMap) {
254
- var store$1 = new WeakMap$1();
255
- var wmget = store$1.get;
256
- var wmhas = store$1.has;
257
- var wmset = store$1.set;
258
- set = function (it, metadata) {
259
- wmset.call(store$1, it, metadata);
260
- return metadata;
261
- };
262
- get = function (it) {
263
- return wmget.call(store$1, it) || {};
264
- };
265
- has$1 = function (it) {
266
- return wmhas.call(store$1, it);
267
- };
268
- } else {
269
- var STATE = sharedKey('state');
270
- hiddenKeys[STATE] = true;
271
- set = function (it, metadata) {
272
- createNonEnumerableProperty(it, STATE, metadata);
273
- return metadata;
274
- };
275
- get = function (it) {
276
- return has(it, STATE) ? it[STATE] : {};
277
- };
278
- has$1 = function (it) {
279
- return has(it, STATE);
280
- };
281
- }
282
-
283
- var internalState = {
284
- set: set,
285
- get: get,
286
- has: has$1,
287
- enforce: enforce,
288
- getterFor: getterFor
289
- };
290
-
291
- var redefine = createCommonjsModule(function (module) {
292
- var getInternalState = internalState.get;
293
- var enforceInternalState = internalState.enforce;
294
- var TEMPLATE = String(String).split('String');
295
-
296
- (module.exports = function (O, key, value, options) {
297
- var unsafe = options ? !!options.unsafe : false;
298
- var simple = options ? !!options.enumerable : false;
299
- var noTargetGet = options ? !!options.noTargetGet : false;
300
- if (typeof value == 'function') {
301
- if (typeof key == 'string' && !has(value, 'name')) createNonEnumerableProperty(value, 'name', key);
302
- enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : '');
303
- }
304
- if (O === global_1) {
305
- if (simple) O[key] = value;
306
- else setGlobal(key, value);
307
- return;
308
- } else if (!unsafe) {
309
- delete O[key];
310
- } else if (!noTargetGet && O[key]) {
311
- simple = true;
312
- }
313
- if (simple) O[key] = value;
314
- else createNonEnumerableProperty(O, key, value);
315
- // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
316
- })(Function.prototype, 'toString', function toString() {
317
- return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
318
- });
319
- });
320
-
321
- var path = global_1;
322
-
323
- var aFunction = function (variable) {
324
- return typeof variable == 'function' ? variable : undefined;
325
- };
326
-
327
- var getBuiltIn = function (namespace, method) {
328
- return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global_1[namespace])
329
- : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
330
- };
331
-
332
- var ceil = Math.ceil;
333
- var floor = Math.floor;
334
-
335
- // `ToInteger` abstract operation
336
- // https://tc39.github.io/ecma262/#sec-tointeger
337
- var toInteger = function (argument) {
338
- return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
339
- };
340
-
341
- var min = Math.min;
342
-
343
- // `ToLength` abstract operation
344
- // https://tc39.github.io/ecma262/#sec-tolength
345
- var toLength = function (argument) {
346
- return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
347
- };
348
-
349
- var max = Math.max;
350
- var min$1 = Math.min;
351
-
352
- // Helper for a popular repeating case of the spec:
353
- // Let integer be ? ToInteger(index).
354
- // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
355
- var toAbsoluteIndex = function (index, length) {
356
- var integer = toInteger(index);
357
- return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
358
- };
359
-
360
- // `Array.prototype.{ indexOf, includes }` methods implementation
361
- var createMethod = function (IS_INCLUDES) {
362
- return function ($this, el, fromIndex) {
363
- var O = toIndexedObject($this);
364
- var length = toLength(O.length);
365
- var index = toAbsoluteIndex(fromIndex, length);
366
- var value;
367
- // Array#includes uses SameValueZero equality algorithm
368
- // eslint-disable-next-line no-self-compare
369
- if (IS_INCLUDES && el != el) while (length > index) {
370
- value = O[index++];
371
- // eslint-disable-next-line no-self-compare
372
- if (value != value) return true;
373
- // Array#indexOf ignores holes, Array#includes - not
374
- } else for (;length > index; index++) {
375
- if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
376
- } return !IS_INCLUDES && -1;
377
- };
378
- };
379
-
380
- var arrayIncludes = {
381
- // `Array.prototype.includes` method
382
- // https://tc39.github.io/ecma262/#sec-array.prototype.includes
383
- includes: createMethod(true),
384
- // `Array.prototype.indexOf` method
385
- // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
386
- indexOf: createMethod(false)
387
- };
388
-
389
- var indexOf = arrayIncludes.indexOf;
390
-
391
-
392
- var objectKeysInternal = function (object, names) {
393
- var O = toIndexedObject(object);
394
- var i = 0;
395
- var result = [];
396
- var key;
397
- for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
398
- // Don't enum bug & hidden keys
399
- while (names.length > i) if (has(O, key = names[i++])) {
400
- ~indexOf(result, key) || result.push(key);
401
- }
402
- return result;
403
- };
404
-
405
- // IE8- don't enum bug keys
406
- var enumBugKeys = [
407
- 'constructor',
408
- 'hasOwnProperty',
409
- 'isPrototypeOf',
410
- 'propertyIsEnumerable',
411
- 'toLocaleString',
412
- 'toString',
413
- 'valueOf'
414
- ];
415
-
416
- var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
417
-
418
- // `Object.getOwnPropertyNames` method
419
- // https://tc39.github.io/ecma262/#sec-object.getownpropertynames
420
- var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
421
- return objectKeysInternal(O, hiddenKeys$1);
422
- };
423
-
424
- var objectGetOwnPropertyNames = {
425
- f: f$3
426
- };
427
-
428
- var f$4 = Object.getOwnPropertySymbols;
429
-
430
- var objectGetOwnPropertySymbols = {
431
- f: f$4
432
- };
433
-
434
- // all object keys, includes non-enumerable and symbols
435
- var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
436
- var keys = objectGetOwnPropertyNames.f(anObject(it));
437
- var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
438
- return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
439
- };
440
-
441
- var copyConstructorProperties = function (target, source) {
442
- var keys = ownKeys(source);
443
- var defineProperty = objectDefineProperty.f;
444
- var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
445
- for (var i = 0; i < keys.length; i++) {
446
- var key = keys[i];
447
- if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
448
- }
449
- };
450
-
451
- var replacement = /#|\.prototype\./;
452
-
453
- var isForced = function (feature, detection) {
454
- var value = data[normalize(feature)];
455
- return value == POLYFILL ? true
456
- : value == NATIVE ? false
457
- : typeof detection == 'function' ? fails(detection)
458
- : !!detection;
459
- };
460
-
461
- var normalize = isForced.normalize = function (string) {
462
- return String(string).replace(replacement, '.').toLowerCase();
463
- };
464
-
465
- var data = isForced.data = {};
466
- var NATIVE = isForced.NATIVE = 'N';
467
- var POLYFILL = isForced.POLYFILL = 'P';
468
-
469
- var isForced_1 = isForced;
470
-
471
- var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
472
-
473
-
474
-
475
-
476
-
477
-
478
- /*
479
- options.target - name of the target object
480
- options.global - target is the global object
481
- options.stat - export as static methods of target
482
- options.proto - export as prototype methods of target
483
- options.real - real prototype method for the `pure` version
484
- options.forced - export even if the native feature is available
485
- options.bind - bind methods to the target, required for the `pure` version
486
- options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
487
- options.unsafe - use the simple assignment of property instead of delete + defineProperty
488
- options.sham - add a flag to not completely full polyfills
489
- options.enumerable - export as enumerable property
490
- options.noTargetGet - prevent calling a getter on target
491
- */
492
- var _export = function (options, source) {
493
- var TARGET = options.target;
494
- var GLOBAL = options.global;
495
- var STATIC = options.stat;
496
- var FORCED, target, key, targetProperty, sourceProperty, descriptor;
497
- if (GLOBAL) {
498
- target = global_1;
499
- } else if (STATIC) {
500
- target = global_1[TARGET] || setGlobal(TARGET, {});
501
- } else {
502
- target = (global_1[TARGET] || {}).prototype;
503
- }
504
- if (target) for (key in source) {
505
- sourceProperty = source[key];
506
- if (options.noTargetGet) {
507
- descriptor = getOwnPropertyDescriptor$1(target, key);
508
- targetProperty = descriptor && descriptor.value;
509
- } else targetProperty = target[key];
510
- FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
511
- // contained in target
512
- if (!FORCED && targetProperty !== undefined) {
513
- if (typeof sourceProperty === typeof targetProperty) continue;
514
- copyConstructorProperties(sourceProperty, targetProperty);
515
- }
516
- // add a flag to not completely full polyfills
517
- if (options.sham || (targetProperty && targetProperty.sham)) {
518
- createNonEnumerableProperty(sourceProperty, 'sham', true);
519
- }
520
- // extend global
521
- redefine(target, key, sourceProperty, options);
522
- }
523
- };
524
-
525
- // `IsArray` abstract operation
526
- // https://tc39.github.io/ecma262/#sec-isarray
527
- var isArray = Array.isArray || function isArray(arg) {
528
- return classofRaw(arg) == 'Array';
529
- };
530
-
531
- // `ToObject` abstract operation
532
- // https://tc39.github.io/ecma262/#sec-toobject
533
- var toObject = function (argument) {
534
- return Object(requireObjectCoercible(argument));
535
- };
536
-
537
- var createProperty = function (object, key, value) {
538
- var propertyKey = toPrimitive(key);
539
- if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
540
- else object[propertyKey] = value;
541
- };
542
-
543
- var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
544
- // Chrome 38 Symbol has incorrect toString conversion
545
- // eslint-disable-next-line no-undef
546
- return !String(Symbol());
547
- });
548
-
549
- var useSymbolAsUid = nativeSymbol
550
- // eslint-disable-next-line no-undef
551
- && !Symbol.sham
552
- // eslint-disable-next-line no-undef
553
- && typeof Symbol.iterator == 'symbol';
554
-
555
- var WellKnownSymbolsStore = shared('wks');
556
- var Symbol$1 = global_1.Symbol;
557
- var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
558
-
559
- var wellKnownSymbol = function (name) {
560
- if (!has(WellKnownSymbolsStore, name)) {
561
- if (nativeSymbol && has(Symbol$1, name)) WellKnownSymbolsStore[name] = Symbol$1[name];
562
- else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
563
- } return WellKnownSymbolsStore[name];
564
- };
565
-
566
- var SPECIES = wellKnownSymbol('species');
567
-
568
- // `ArraySpeciesCreate` abstract operation
569
- // https://tc39.github.io/ecma262/#sec-arrayspeciescreate
570
- var arraySpeciesCreate = function (originalArray, length) {
571
- var C;
572
- if (isArray(originalArray)) {
573
- C = originalArray.constructor;
574
- // cross-realm fallback
575
- if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
576
- else if (isObject(C)) {
577
- C = C[SPECIES];
578
- if (C === null) C = undefined;
579
- }
580
- } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
581
- };
582
-
583
- var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
584
-
585
- var process = global_1.process;
586
- var versions = process && process.versions;
587
- var v8 = versions && versions.v8;
588
- var match, version;
589
-
590
- if (v8) {
591
- match = v8.split('.');
592
- version = match[0] + match[1];
593
- } else if (engineUserAgent) {
594
- match = engineUserAgent.match(/Edge\/(\d+)/);
595
- if (!match || match[1] >= 74) {
596
- match = engineUserAgent.match(/Chrome\/(\d+)/);
597
- if (match) version = match[1];
598
- }
599
- }
600
-
601
- var engineV8Version = version && +version;
602
-
603
- var SPECIES$1 = wellKnownSymbol('species');
604
-
605
- var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
606
- // We can't use this feature detection in V8 since it causes
607
- // deoptimization and serious performance degradation
608
- // https://github.com/zloirock/core-js/issues/677
609
- return engineV8Version >= 51 || !fails(function () {
610
- var array = [];
611
- var constructor = array.constructor = {};
612
- constructor[SPECIES$1] = function () {
613
- return { foo: 1 };
614
- };
615
- return array[METHOD_NAME](Boolean).foo !== 1;
616
- });
617
- };
618
-
619
- var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
620
- var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
621
- var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
622
-
623
- // We can't use this feature detection in V8 since it causes
624
- // deoptimization and serious performance degradation
625
- // https://github.com/zloirock/core-js/issues/679
626
- var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () {
627
- var array = [];
628
- array[IS_CONCAT_SPREADABLE] = false;
629
- return array.concat()[0] !== array;
630
- });
631
-
632
- var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
633
-
634
- var isConcatSpreadable = function (O) {
635
- if (!isObject(O)) return false;
636
- var spreadable = O[IS_CONCAT_SPREADABLE];
637
- return spreadable !== undefined ? !!spreadable : isArray(O);
638
- };
639
-
640
- var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
641
-
642
- // `Array.prototype.concat` method
643
- // https://tc39.github.io/ecma262/#sec-array.prototype.concat
644
- // with adding support of @@isConcatSpreadable and @@species
645
- _export({ target: 'Array', proto: true, forced: FORCED }, {
646
- concat: function concat(arg) { // eslint-disable-line no-unused-vars
647
- var O = toObject(this);
648
- var A = arraySpeciesCreate(O, 0);
649
- var n = 0;
650
- var i, k, length, len, E;
651
- for (i = -1, length = arguments.length; i < length; i++) {
652
- E = i === -1 ? O : arguments[i];
653
- if (isConcatSpreadable(E)) {
654
- len = toLength(E.length);
655
- if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
656
- for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
657
- } else {
658
- if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
659
- createProperty(A, n++, E);
660
- }
661
- }
662
- A.length = n;
663
- return A;
664
- }
665
- });
666
-
667
- // `Array.prototype.fill` method implementation
668
- // https://tc39.github.io/ecma262/#sec-array.prototype.fill
669
- var arrayFill = function fill(value /* , start = 0, end = @length */) {
670
- var O = toObject(this);
671
- var length = toLength(O.length);
672
- var argumentsLength = arguments.length;
673
- var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length);
674
- var end = argumentsLength > 2 ? arguments[2] : undefined;
675
- var endPos = end === undefined ? length : toAbsoluteIndex(end, length);
676
- while (endPos > index) O[index++] = value;
677
- return O;
678
- };
679
-
680
- // `Object.keys` method
681
- // https://tc39.github.io/ecma262/#sec-object.keys
682
- var objectKeys = Object.keys || function keys(O) {
683
- return objectKeysInternal(O, enumBugKeys);
684
- };
685
-
686
- // `Object.defineProperties` method
687
- // https://tc39.github.io/ecma262/#sec-object.defineproperties
688
- var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
689
- anObject(O);
690
- var keys = objectKeys(Properties);
691
- var length = keys.length;
692
- var index = 0;
693
- var key;
694
- while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
695
- return O;
696
- };
697
-
698
- var html = getBuiltIn('document', 'documentElement');
699
-
700
- var GT = '>';
701
- var LT = '<';
702
- var PROTOTYPE = 'prototype';
703
- var SCRIPT = 'script';
704
- var IE_PROTO = sharedKey('IE_PROTO');
705
-
706
- var EmptyConstructor = function () { /* empty */ };
707
-
708
- var scriptTag = function (content) {
709
- return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
710
- };
711
-
712
- // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
713
- var NullProtoObjectViaActiveX = function (activeXDocument) {
714
- activeXDocument.write(scriptTag(''));
715
- activeXDocument.close();
716
- var temp = activeXDocument.parentWindow.Object;
717
- activeXDocument = null; // avoid memory leak
718
- return temp;
719
- };
720
-
721
- // Create object with fake `null` prototype: use iframe Object with cleared prototype
722
- var NullProtoObjectViaIFrame = function () {
723
- // Thrash, waste and sodomy: IE GC bug
724
- var iframe = documentCreateElement('iframe');
725
- var JS = 'java' + SCRIPT + ':';
726
- var iframeDocument;
727
- iframe.style.display = 'none';
728
- html.appendChild(iframe);
729
- // https://github.com/zloirock/core-js/issues/475
730
- iframe.src = String(JS);
731
- iframeDocument = iframe.contentWindow.document;
732
- iframeDocument.open();
733
- iframeDocument.write(scriptTag('document.F=Object'));
734
- iframeDocument.close();
735
- return iframeDocument.F;
736
- };
737
-
738
- // Check for document.domain and active x support
739
- // No need to use active x approach when document.domain is not set
740
- // see https://github.com/es-shims/es5-shim/issues/150
741
- // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
742
- // avoid IE GC bug
743
- var activeXDocument;
744
- var NullProtoObject = function () {
745
- try {
746
- /* global ActiveXObject */
747
- activeXDocument = document.domain && new ActiveXObject('htmlfile');
748
- } catch (error) { /* ignore */ }
749
- NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
750
- var length = enumBugKeys.length;
751
- while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
752
- return NullProtoObject();
753
- };
754
-
755
- hiddenKeys[IE_PROTO] = true;
756
-
757
- // `Object.create` method
758
- // https://tc39.github.io/ecma262/#sec-object.create
759
- var objectCreate = Object.create || function create(O, Properties) {
760
- var result;
761
- if (O !== null) {
762
- EmptyConstructor[PROTOTYPE] = anObject(O);
763
- result = new EmptyConstructor();
764
- EmptyConstructor[PROTOTYPE] = null;
765
- // add "__proto__" for Object.getPrototypeOf polyfill
766
- result[IE_PROTO] = O;
767
- } else result = NullProtoObject();
768
- return Properties === undefined ? result : objectDefineProperties(result, Properties);
769
- };
770
-
771
- var UNSCOPABLES = wellKnownSymbol('unscopables');
772
- var ArrayPrototype = Array.prototype;
773
-
774
- // Array.prototype[@@unscopables]
775
- // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
776
- if (ArrayPrototype[UNSCOPABLES] == undefined) {
777
- objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
778
- configurable: true,
779
- value: objectCreate(null)
780
- });
781
- }
782
-
783
- // add a key to Array.prototype[@@unscopables]
784
- var addToUnscopables = function (key) {
785
- ArrayPrototype[UNSCOPABLES][key] = true;
786
- };
787
-
788
- // `Array.prototype.fill` method
789
- // https://tc39.github.io/ecma262/#sec-array.prototype.fill
790
- _export({ target: 'Array', proto: true }, {
791
- fill: arrayFill
792
- });
793
-
794
- // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
795
- addToUnscopables('fill');
796
-
797
- var aFunction$1 = function (it) {
798
- if (typeof it != 'function') {
799
- throw TypeError(String(it) + ' is not a function');
800
- } return it;
801
- };
802
-
803
- // optional / simple context binding
804
- var functionBindContext = function (fn, that, length) {
805
- aFunction$1(fn);
806
- if (that === undefined) return fn;
807
- switch (length) {
808
- case 0: return function () {
809
- return fn.call(that);
810
- };
811
- case 1: return function (a) {
812
- return fn.call(that, a);
813
- };
814
- case 2: return function (a, b) {
815
- return fn.call(that, a, b);
816
- };
817
- case 3: return function (a, b, c) {
818
- return fn.call(that, a, b, c);
819
- };
820
- }
821
- return function (/* ...args */) {
822
- return fn.apply(that, arguments);
823
- };
824
- };
825
-
826
- var push = [].push;
827
-
828
- // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation
829
- var createMethod$1 = function (TYPE) {
830
- var IS_MAP = TYPE == 1;
831
- var IS_FILTER = TYPE == 2;
832
- var IS_SOME = TYPE == 3;
833
- var IS_EVERY = TYPE == 4;
834
- var IS_FIND_INDEX = TYPE == 6;
835
- var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
836
- return function ($this, callbackfn, that, specificCreate) {
837
- var O = toObject($this);
838
- var self = indexedObject(O);
839
- var boundFunction = functionBindContext(callbackfn, that, 3);
840
- var length = toLength(self.length);
841
- var index = 0;
842
- var create = specificCreate || arraySpeciesCreate;
843
- var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
844
- var value, result;
845
- for (;length > index; index++) if (NO_HOLES || index in self) {
846
- value = self[index];
847
- result = boundFunction(value, index, O);
848
- if (TYPE) {
849
- if (IS_MAP) target[index] = result; // map
850
- else if (result) switch (TYPE) {
851
- case 3: return true; // some
852
- case 5: return value; // find
853
- case 6: return index; // findIndex
854
- case 2: push.call(target, value); // filter
855
- } else if (IS_EVERY) return false; // every
856
- }
857
- }
858
- return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
859
- };
860
- };
861
-
862
- var arrayIteration = {
863
- // `Array.prototype.forEach` method
864
- // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
865
- forEach: createMethod$1(0),
866
- // `Array.prototype.map` method
867
- // https://tc39.github.io/ecma262/#sec-array.prototype.map
868
- map: createMethod$1(1),
869
- // `Array.prototype.filter` method
870
- // https://tc39.github.io/ecma262/#sec-array.prototype.filter
871
- filter: createMethod$1(2),
872
- // `Array.prototype.some` method
873
- // https://tc39.github.io/ecma262/#sec-array.prototype.some
874
- some: createMethod$1(3),
875
- // `Array.prototype.every` method
876
- // https://tc39.github.io/ecma262/#sec-array.prototype.every
877
- every: createMethod$1(4),
878
- // `Array.prototype.find` method
879
- // https://tc39.github.io/ecma262/#sec-array.prototype.find
880
- find: createMethod$1(5),
881
- // `Array.prototype.findIndex` method
882
- // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
883
- findIndex: createMethod$1(6)
884
- };
885
-
886
- var arrayMethodIsStrict = function (METHOD_NAME, argument) {
887
- var method = [][METHOD_NAME];
888
- return !!method && fails(function () {
889
- // eslint-disable-next-line no-useless-call,no-throw-literal
890
- method.call(null, argument || function () { throw 1; }, 1);
891
- });
892
- };
893
-
894
- var defineProperty = Object.defineProperty;
895
- var cache = {};
896
-
897
- var thrower = function (it) { throw it; };
898
-
899
- var arrayMethodUsesToLength = function (METHOD_NAME, options) {
900
- if (has(cache, METHOD_NAME)) return cache[METHOD_NAME];
901
- if (!options) options = {};
902
- var method = [][METHOD_NAME];
903
- var ACCESSORS = has(options, 'ACCESSORS') ? options.ACCESSORS : false;
904
- var argument0 = has(options, 0) ? options[0] : thrower;
905
- var argument1 = has(options, 1) ? options[1] : undefined;
906
-
907
- return cache[METHOD_NAME] = !!method && !fails(function () {
908
- if (ACCESSORS && !descriptors) return true;
909
- var O = { length: -1 };
910
-
911
- if (ACCESSORS) defineProperty(O, 1, { enumerable: true, get: thrower });
912
- else O[1] = 1;
913
-
914
- method.call(O, argument0, argument1);
915
- });
916
- };
917
-
918
- var $forEach = arrayIteration.forEach;
919
-
920
-
921
-
922
- var STRICT_METHOD = arrayMethodIsStrict('forEach');
923
- var USES_TO_LENGTH = arrayMethodUsesToLength('forEach');
924
-
925
- // `Array.prototype.forEach` method implementation
926
- // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
927
- var arrayForEach = (!STRICT_METHOD || !USES_TO_LENGTH) ? function forEach(callbackfn /* , thisArg */) {
928
- return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
929
- } : [].forEach;
930
-
931
- // `Array.prototype.forEach` method
932
- // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
933
- _export({ target: 'Array', proto: true, forced: [].forEach != arrayForEach }, {
934
- forEach: arrayForEach
935
- });
936
-
937
- var $indexOf = arrayIncludes.indexOf;
938
-
939
-
940
-
941
- var nativeIndexOf = [].indexOf;
942
-
943
- var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0;
944
- var STRICT_METHOD$1 = arrayMethodIsStrict('indexOf');
945
- var USES_TO_LENGTH$1 = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });
946
-
947
- // `Array.prototype.indexOf` method
948
- // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
949
- _export({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD$1 || !USES_TO_LENGTH$1 }, {
950
- indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
951
- return NEGATIVE_ZERO
952
- // convert -0 to +0
953
- ? nativeIndexOf.apply(this, arguments) || 0
954
- : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined);
955
- }
956
- });
957
-
958
- var nativeJoin = [].join;
959
-
960
- var ES3_STRINGS = indexedObject != Object;
961
- var STRICT_METHOD$2 = arrayMethodIsStrict('join', ',');
962
-
963
- // `Array.prototype.join` method
964
- // https://tc39.github.io/ecma262/#sec-array.prototype.join
965
- _export({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD$2 }, {
966
- join: function join(separator) {
967
- return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
968
- }
969
- });
970
-
971
- // `Array.prototype.{ reduce, reduceRight }` methods implementation
972
- var createMethod$2 = function (IS_RIGHT) {
973
- return function (that, callbackfn, argumentsLength, memo) {
974
- aFunction$1(callbackfn);
975
- var O = toObject(that);
976
- var self = indexedObject(O);
977
- var length = toLength(O.length);
978
- var index = IS_RIGHT ? length - 1 : 0;
979
- var i = IS_RIGHT ? -1 : 1;
980
- if (argumentsLength < 2) while (true) {
981
- if (index in self) {
982
- memo = self[index];
983
- index += i;
984
- break;
985
- }
986
- index += i;
987
- if (IS_RIGHT ? index < 0 : length <= index) {
988
- throw TypeError('Reduce of empty array with no initial value');
989
- }
990
- }
991
- for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
992
- memo = callbackfn(memo, self[index], index, O);
993
- }
994
- return memo;
995
- };
996
- };
997
-
998
- var arrayReduce = {
999
- // `Array.prototype.reduce` method
1000
- // https://tc39.github.io/ecma262/#sec-array.prototype.reduce
1001
- left: createMethod$2(false),
1002
- // `Array.prototype.reduceRight` method
1003
- // https://tc39.github.io/ecma262/#sec-array.prototype.reduceright
1004
- right: createMethod$2(true)
1005
- };
1006
-
1007
- var $reduce = arrayReduce.left;
1008
-
1009
-
1010
-
1011
- var STRICT_METHOD$3 = arrayMethodIsStrict('reduce');
1012
- var USES_TO_LENGTH$2 = arrayMethodUsesToLength('reduce', { 1: 0 });
1013
-
1014
- // `Array.prototype.reduce` method
1015
- // https://tc39.github.io/ecma262/#sec-array.prototype.reduce
1016
- _export({ target: 'Array', proto: true, forced: !STRICT_METHOD$3 || !USES_TO_LENGTH$2 }, {
1017
- reduce: function reduce(callbackfn /* , initialValue */) {
1018
- return $reduce(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
1019
- }
1020
- });
1021
-
1022
- var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');
1023
- var USES_TO_LENGTH$3 = arrayMethodUsesToLength('slice', { ACCESSORS: true, 0: 0, 1: 2 });
1024
-
1025
- var SPECIES$2 = wellKnownSymbol('species');
1026
- var nativeSlice = [].slice;
1027
- var max$1 = Math.max;
1028
-
1029
- // `Array.prototype.slice` method
1030
- // https://tc39.github.io/ecma262/#sec-array.prototype.slice
1031
- // fallback for not array-like ES3 strings and DOM objects
1032
- _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH$3 }, {
1033
- slice: function slice(start, end) {
1034
- var O = toIndexedObject(this);
1035
- var length = toLength(O.length);
1036
- var k = toAbsoluteIndex(start, length);
1037
- var fin = toAbsoluteIndex(end === undefined ? length : end, length);
1038
- // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
1039
- var Constructor, result, n;
1040
- if (isArray(O)) {
1041
- Constructor = O.constructor;
1042
- // cross-realm fallback
1043
- if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {
1044
- Constructor = undefined;
1045
- } else if (isObject(Constructor)) {
1046
- Constructor = Constructor[SPECIES$2];
1047
- if (Constructor === null) Constructor = undefined;
1048
- }
1049
- if (Constructor === Array || Constructor === undefined) {
1050
- return nativeSlice.call(O, k, fin);
1051
- }
1052
- }
1053
- result = new (Constructor === undefined ? Array : Constructor)(max$1(fin - k, 0));
1054
- for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
1055
- result.length = n;
1056
- return result;
1057
- }
1058
- });
1059
-
1060
- var defineProperty$1 = objectDefineProperty.f;
1061
-
1062
- var FunctionPrototype = Function.prototype;
1063
- var FunctionPrototypeToString = FunctionPrototype.toString;
1064
- var nameRE = /^\s*function ([^ (]*)/;
1065
- var NAME = 'name';
1066
-
1067
- // Function instances `.name` property
1068
- // https://tc39.github.io/ecma262/#sec-function-instances-name
1069
- if (descriptors && !(NAME in FunctionPrototype)) {
1070
- defineProperty$1(FunctionPrototype, NAME, {
1071
- configurable: true,
1072
- get: function () {
1073
- try {
1074
- return FunctionPrototypeToString.call(this).match(nameRE)[1];
1075
- } catch (error) {
1076
- return '';
1077
- }
1078
- }
1079
- });
1080
- }
1081
-
1082
- // `thisNumberValue` abstract operation
1083
- // https://tc39.github.io/ecma262/#sec-thisnumbervalue
1084
- var thisNumberValue = function (value) {
1085
- if (typeof value != 'number' && classofRaw(value) != 'Number') {
1086
- throw TypeError('Incorrect invocation');
1087
- }
1088
- return +value;
1089
- };
1090
-
1091
- // `String.prototype.repeat` method implementation
1092
- // https://tc39.github.io/ecma262/#sec-string.prototype.repeat
1093
- var stringRepeat = ''.repeat || function repeat(count) {
1094
- var str = String(requireObjectCoercible(this));
1095
- var result = '';
1096
- var n = toInteger(count);
1097
- if (n < 0 || n == Infinity) throw RangeError('Wrong number of repetitions');
1098
- for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str;
1099
- return result;
1100
- };
1101
-
1102
- var nativeToFixed = 1.0.toFixed;
1103
- var floor$1 = Math.floor;
1104
-
1105
- var pow = function (x, n, acc) {
1106
- return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);
1107
- };
1108
-
1109
- var log = function (x) {
1110
- var n = 0;
1111
- var x2 = x;
1112
- while (x2 >= 4096) {
1113
- n += 12;
1114
- x2 /= 4096;
1115
- }
1116
- while (x2 >= 2) {
1117
- n += 1;
1118
- x2 /= 2;
1119
- } return n;
1120
- };
1121
-
1122
- var FORCED$1 = nativeToFixed && (
1123
- 0.00008.toFixed(3) !== '0.000' ||
1124
- 0.9.toFixed(0) !== '1' ||
1125
- 1.255.toFixed(2) !== '1.25' ||
1126
- 1000000000000000128.0.toFixed(0) !== '1000000000000000128'
1127
- ) || !fails(function () {
1128
- // V8 ~ Android 4.3-
1129
- nativeToFixed.call({});
1130
- });
1131
-
1132
- // `Number.prototype.toFixed` method
1133
- // https://tc39.github.io/ecma262/#sec-number.prototype.tofixed
1134
- _export({ target: 'Number', proto: true, forced: FORCED$1 }, {
1135
- // eslint-disable-next-line max-statements
1136
- toFixed: function toFixed(fractionDigits) {
1137
- var number = thisNumberValue(this);
1138
- var fractDigits = toInteger(fractionDigits);
1139
- var data = [0, 0, 0, 0, 0, 0];
1140
- var sign = '';
1141
- var result = '0';
1142
- var e, z, j, k;
1143
-
1144
- var multiply = function (n, c) {
1145
- var index = -1;
1146
- var c2 = c;
1147
- while (++index < 6) {
1148
- c2 += n * data[index];
1149
- data[index] = c2 % 1e7;
1150
- c2 = floor$1(c2 / 1e7);
1151
- }
1152
- };
1153
-
1154
- var divide = function (n) {
1155
- var index = 6;
1156
- var c = 0;
1157
- while (--index >= 0) {
1158
- c += data[index];
1159
- data[index] = floor$1(c / n);
1160
- c = (c % n) * 1e7;
1161
- }
1162
- };
1163
-
1164
- var dataToString = function () {
1165
- var index = 6;
1166
- var s = '';
1167
- while (--index >= 0) {
1168
- if (s !== '' || index === 0 || data[index] !== 0) {
1169
- var t = String(data[index]);
1170
- s = s === '' ? t : s + stringRepeat.call('0', 7 - t.length) + t;
1171
- }
1172
- } return s;
1173
- };
1174
-
1175
- if (fractDigits < 0 || fractDigits > 20) throw RangeError('Incorrect fraction digits');
1176
- // eslint-disable-next-line no-self-compare
1177
- if (number != number) return 'NaN';
1178
- if (number <= -1e21 || number >= 1e21) return String(number);
1179
- if (number < 0) {
1180
- sign = '-';
1181
- number = -number;
1182
- }
1183
- if (number > 1e-21) {
1184
- e = log(number * pow(2, 69, 1)) - 69;
1185
- z = e < 0 ? number * pow(2, -e, 1) : number / pow(2, e, 1);
1186
- z *= 0x10000000000000;
1187
- e = 52 - e;
1188
- if (e > 0) {
1189
- multiply(0, z);
1190
- j = fractDigits;
1191
- while (j >= 7) {
1192
- multiply(1e7, 0);
1193
- j -= 7;
1194
- }
1195
- multiply(pow(10, j, 1), 0);
1196
- j = e - 1;
1197
- while (j >= 23) {
1198
- divide(1 << 23);
1199
- j -= 23;
1200
- }
1201
- divide(1 << j);
1202
- multiply(1, 1);
1203
- divide(2);
1204
- result = dataToString();
1205
- } else {
1206
- multiply(0, z);
1207
- multiply(1 << -e, 0);
1208
- result = dataToString() + stringRepeat.call('0', fractDigits);
1209
- }
1210
- }
1211
- if (fractDigits > 0) {
1212
- k = result.length;
1213
- result = sign + (k <= fractDigits
1214
- ? '0.' + stringRepeat.call('0', fractDigits - k) + result
1215
- : result.slice(0, k - fractDigits) + '.' + result.slice(k - fractDigits));
1216
- } else {
1217
- result = sign + result;
1218
- } return result;
1219
- }
1220
- });
1221
-
1222
- var nativeAssign = Object.assign;
1223
- var defineProperty$2 = Object.defineProperty;
1224
-
1225
- // `Object.assign` method
1226
- // https://tc39.github.io/ecma262/#sec-object.assign
1227
- var objectAssign = !nativeAssign || fails(function () {
1228
- // should have correct order of operations (Edge bug)
1229
- if (descriptors && nativeAssign({ b: 1 }, nativeAssign(defineProperty$2({}, 'a', {
1230
- enumerable: true,
1231
- get: function () {
1232
- defineProperty$2(this, 'b', {
1233
- value: 3,
1234
- enumerable: false
1235
- });
1236
- }
1237
- }), { b: 2 })).b !== 1) return true;
1238
- // should work with symbols and should have deterministic property order (V8 bug)
1239
- var A = {};
1240
- var B = {};
1241
- // eslint-disable-next-line no-undef
1242
- var symbol = Symbol();
1243
- var alphabet = 'abcdefghijklmnopqrst';
1244
- A[symbol] = 7;
1245
- alphabet.split('').forEach(function (chr) { B[chr] = chr; });
1246
- return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet;
1247
- }) ? function assign(target, source) { // eslint-disable-line no-unused-vars
1248
- var T = toObject(target);
1249
- var argumentsLength = arguments.length;
1250
- var index = 1;
1251
- var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
1252
- var propertyIsEnumerable = objectPropertyIsEnumerable.f;
1253
- while (argumentsLength > index) {
1254
- var S = indexedObject(arguments[index++]);
1255
- var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);
1256
- var length = keys.length;
1257
- var j = 0;
1258
- var key;
1259
- while (length > j) {
1260
- key = keys[j++];
1261
- if (!descriptors || propertyIsEnumerable.call(S, key)) T[key] = S[key];
1262
- }
1263
- } return T;
1264
- } : nativeAssign;
1265
-
1266
- // `Object.assign` method
1267
- // https://tc39.github.io/ecma262/#sec-object.assign
1268
- _export({ target: 'Object', stat: true, forced: Object.assign !== objectAssign }, {
1269
- assign: objectAssign
1270
- });
1271
-
1272
- var correctPrototypeGetter = !fails(function () {
1273
- function F() { /* empty */ }
1274
- F.prototype.constructor = null;
1275
- return Object.getPrototypeOf(new F()) !== F.prototype;
1276
- });
1277
-
1278
- var IE_PROTO$1 = sharedKey('IE_PROTO');
1279
- var ObjectPrototype = Object.prototype;
1280
-
1281
- // `Object.getPrototypeOf` method
1282
- // https://tc39.github.io/ecma262/#sec-object.getprototypeof
1283
- var objectGetPrototypeOf = correctPrototypeGetter ? Object.getPrototypeOf : function (O) {
1284
- O = toObject(O);
1285
- if (has(O, IE_PROTO$1)) return O[IE_PROTO$1];
1286
- if (typeof O.constructor == 'function' && O instanceof O.constructor) {
1287
- return O.constructor.prototype;
1288
- } return O instanceof Object ? ObjectPrototype : null;
1289
- };
1290
-
1291
- var FAILS_ON_PRIMITIVES = fails(function () { objectGetPrototypeOf(1); });
1292
-
1293
- // `Object.getPrototypeOf` method
1294
- // https://tc39.github.io/ecma262/#sec-object.getprototypeof
1295
- _export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !correctPrototypeGetter }, {
1296
- getPrototypeOf: function getPrototypeOf(it) {
1297
- return objectGetPrototypeOf(toObject(it));
1298
- }
1299
- });
1300
-
1301
- var FAILS_ON_PRIMITIVES$1 = fails(function () { objectKeys(1); });
1302
-
1303
- // `Object.keys` method
1304
- // https://tc39.github.io/ecma262/#sec-object.keys
1305
- _export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$1 }, {
1306
- keys: function keys(it) {
1307
- return objectKeys(toObject(it));
1308
- }
1309
- });
1310
-
1311
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
1312
- var test = {};
1313
-
1314
- test[TO_STRING_TAG] = 'z';
1315
-
1316
- var toStringTagSupport = String(test) === '[object z]';
1317
-
1318
- var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
1319
- // ES3 wrong here
1320
- var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
1321
-
1322
- // fallback for IE11 Script Access Denied error
1323
- var tryGet = function (it, key) {
1324
- try {
1325
- return it[key];
1326
- } catch (error) { /* empty */ }
1327
- };
1328
-
1329
- // getting tag from ES6+ `Object.prototype.toString`
1330
- var classof = toStringTagSupport ? classofRaw : function (it) {
1331
- var O, tag, result;
1332
- return it === undefined ? 'Undefined' : it === null ? 'Null'
1333
- // @@toStringTag case
1334
- : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG$1)) == 'string' ? tag
1335
- // builtinTag case
1336
- : CORRECT_ARGUMENTS ? classofRaw(O)
1337
- // ES3 arguments fallback
1338
- : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
1339
- };
1340
-
1341
- // `Object.prototype.toString` method implementation
1342
- // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
1343
- var objectToString = toStringTagSupport ? {}.toString : function toString() {
1344
- return '[object ' + classof(this) + ']';
1345
- };
1346
-
1347
- // `Object.prototype.toString` method
1348
- // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
1349
- if (!toStringTagSupport) {
1350
- redefine(Object.prototype, 'toString', objectToString, { unsafe: true });
1351
- }
1352
-
1353
- // a string of all valid unicode whitespaces
1354
- // eslint-disable-next-line max-len
1355
- var whitespaces = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
1356
-
1357
- var whitespace = '[' + whitespaces + ']';
1358
- var ltrim = RegExp('^' + whitespace + whitespace + '*');
1359
- var rtrim = RegExp(whitespace + whitespace + '*$');
1360
-
1361
- // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
1362
- var createMethod$3 = function (TYPE) {
1363
- return function ($this) {
1364
- var string = String(requireObjectCoercible($this));
1365
- if (TYPE & 1) string = string.replace(ltrim, '');
1366
- if (TYPE & 2) string = string.replace(rtrim, '');
1367
- return string;
1368
- };
1369
- };
1370
-
1371
- var stringTrim = {
1372
- // `String.prototype.{ trimLeft, trimStart }` methods
1373
- // https://tc39.github.io/ecma262/#sec-string.prototype.trimstart
1374
- start: createMethod$3(1),
1375
- // `String.prototype.{ trimRight, trimEnd }` methods
1376
- // https://tc39.github.io/ecma262/#sec-string.prototype.trimend
1377
- end: createMethod$3(2),
1378
- // `String.prototype.trim` method
1379
- // https://tc39.github.io/ecma262/#sec-string.prototype.trim
1380
- trim: createMethod$3(3)
1381
- };
1382
-
1383
- var trim = stringTrim.trim;
1384
-
1385
-
1386
- var $parseFloat = global_1.parseFloat;
1387
- var FORCED$2 = 1 / $parseFloat(whitespaces + '-0') !== -Infinity;
1388
-
1389
- // `parseFloat` method
1390
- // https://tc39.github.io/ecma262/#sec-parsefloat-string
1391
- var numberParseFloat = FORCED$2 ? function parseFloat(string) {
1392
- var trimmedString = trim(String(string));
1393
- var result = $parseFloat(trimmedString);
1394
- return result === 0 && trimmedString.charAt(0) == '-' ? -0 : result;
1395
- } : $parseFloat;
1396
-
1397
- // `parseFloat` method
1398
- // https://tc39.github.io/ecma262/#sec-parsefloat-string
1399
- _export({ global: true, forced: parseFloat != numberParseFloat }, {
1400
- parseFloat: numberParseFloat
1401
- });
1402
-
1403
- var nativePromiseConstructor = global_1.Promise;
1404
-
1405
- var redefineAll = function (target, src, options) {
1406
- for (var key in src) redefine(target, key, src[key], options);
1407
- return target;
1408
- };
1409
-
1410
- var defineProperty$3 = objectDefineProperty.f;
1411
-
1412
-
1413
-
1414
- var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
1415
-
1416
- var setToStringTag = function (it, TAG, STATIC) {
1417
- if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG$2)) {
1418
- defineProperty$3(it, TO_STRING_TAG$2, { configurable: true, value: TAG });
1419
- }
1420
- };
1421
-
1422
- var SPECIES$3 = wellKnownSymbol('species');
1423
-
1424
- var setSpecies = function (CONSTRUCTOR_NAME) {
1425
- var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
1426
- var defineProperty = objectDefineProperty.f;
1427
-
1428
- if (descriptors && Constructor && !Constructor[SPECIES$3]) {
1429
- defineProperty(Constructor, SPECIES$3, {
1430
- configurable: true,
1431
- get: function () { return this; }
1432
- });
1433
- }
1434
- };
1435
-
1436
- var anInstance = function (it, Constructor, name) {
1437
- if (!(it instanceof Constructor)) {
1438
- throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation');
1439
- } return it;
1440
- };
1441
-
1442
- var iterators = {};
1443
-
1444
- var ITERATOR = wellKnownSymbol('iterator');
1445
- var ArrayPrototype$1 = Array.prototype;
1446
-
1447
- // check on default Array iterator
1448
- var isArrayIteratorMethod = function (it) {
1449
- return it !== undefined && (iterators.Array === it || ArrayPrototype$1[ITERATOR] === it);
1450
- };
1451
-
1452
- var ITERATOR$1 = wellKnownSymbol('iterator');
1453
-
1454
- var getIteratorMethod = function (it) {
1455
- if (it != undefined) return it[ITERATOR$1]
1456
- || it['@@iterator']
1457
- || iterators[classof(it)];
1458
- };
1459
-
1460
- // call something on iterator step with safe closing on error
1461
- var callWithSafeIterationClosing = function (iterator, fn, value, ENTRIES) {
1462
- try {
1463
- return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
1464
- // 7.4.6 IteratorClose(iterator, completion)
1465
- } catch (error) {
1466
- var returnMethod = iterator['return'];
1467
- if (returnMethod !== undefined) anObject(returnMethod.call(iterator));
1468
- throw error;
1469
- }
1470
- };
1471
-
1472
- var iterate_1 = createCommonjsModule(function (module) {
1473
- var Result = function (stopped, result) {
1474
- this.stopped = stopped;
1475
- this.result = result;
1476
- };
1477
-
1478
- var iterate = module.exports = function (iterable, fn, that, AS_ENTRIES, IS_ITERATOR) {
1479
- var boundFunction = functionBindContext(fn, that, AS_ENTRIES ? 2 : 1);
1480
- var iterator, iterFn, index, length, result, next, step;
1481
-
1482
- if (IS_ITERATOR) {
1483
- iterator = iterable;
1484
- } else {
1485
- iterFn = getIteratorMethod(iterable);
1486
- if (typeof iterFn != 'function') throw TypeError('Target is not iterable');
1487
- // optimisation for array iterators
1488
- if (isArrayIteratorMethod(iterFn)) {
1489
- for (index = 0, length = toLength(iterable.length); length > index; index++) {
1490
- result = AS_ENTRIES
1491
- ? boundFunction(anObject(step = iterable[index])[0], step[1])
1492
- : boundFunction(iterable[index]);
1493
- if (result && result instanceof Result) return result;
1494
- } return new Result(false);
1495
- }
1496
- iterator = iterFn.call(iterable);
1497
- }
1498
-
1499
- next = iterator.next;
1500
- while (!(step = next.call(iterator)).done) {
1501
- result = callWithSafeIterationClosing(iterator, boundFunction, step.value, AS_ENTRIES);
1502
- if (typeof result == 'object' && result && result instanceof Result) return result;
1503
- } return new Result(false);
1504
- };
1505
-
1506
- iterate.stop = function (result) {
1507
- return new Result(true, result);
1508
- };
1509
- });
1510
-
1511
- var ITERATOR$2 = wellKnownSymbol('iterator');
1512
- var SAFE_CLOSING = false;
1513
-
1514
- try {
1515
- var called = 0;
1516
- var iteratorWithReturn = {
1517
- next: function () {
1518
- return { done: !!called++ };
1519
- },
1520
- 'return': function () {
1521
- SAFE_CLOSING = true;
1522
- }
1523
- };
1524
- iteratorWithReturn[ITERATOR$2] = function () {
1525
- return this;
1526
- };
1527
- // eslint-disable-next-line no-throw-literal
1528
- Array.from(iteratorWithReturn, function () { throw 2; });
1529
- } catch (error) { /* empty */ }
1530
-
1531
- var checkCorrectnessOfIteration = function (exec, SKIP_CLOSING) {
1532
- if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
1533
- var ITERATION_SUPPORT = false;
1534
- try {
1535
- var object = {};
1536
- object[ITERATOR$2] = function () {
1537
- return {
1538
- next: function () {
1539
- return { done: ITERATION_SUPPORT = true };
1540
- }
1541
- };
1542
- };
1543
- exec(object);
1544
- } catch (error) { /* empty */ }
1545
- return ITERATION_SUPPORT;
1546
- };
1547
-
1548
- var SPECIES$4 = wellKnownSymbol('species');
1549
-
1550
- // `SpeciesConstructor` abstract operation
1551
- // https://tc39.github.io/ecma262/#sec-speciesconstructor
1552
- var speciesConstructor = function (O, defaultConstructor) {
1553
- var C = anObject(O).constructor;
1554
- var S;
1555
- return C === undefined || (S = anObject(C)[SPECIES$4]) == undefined ? defaultConstructor : aFunction$1(S);
1556
- };
1557
-
1558
- var engineIsIos = /(iphone|ipod|ipad).*applewebkit/i.test(engineUserAgent);
1559
-
1560
- var location$1 = global_1.location;
1561
- var set$1 = global_1.setImmediate;
1562
- var clear = global_1.clearImmediate;
1563
- var process$1 = global_1.process;
1564
- var MessageChannel = global_1.MessageChannel;
1565
- var Dispatch = global_1.Dispatch;
1566
- var counter = 0;
1567
- var queue = {};
1568
- var ONREADYSTATECHANGE = 'onreadystatechange';
1569
- var defer, channel, port;
1570
-
1571
- var run = function (id) {
1572
- // eslint-disable-next-line no-prototype-builtins
1573
- if (queue.hasOwnProperty(id)) {
1574
- var fn = queue[id];
1575
- delete queue[id];
1576
- fn();
1577
- }
1578
- };
1579
-
1580
- var runner = function (id) {
1581
- return function () {
1582
- run(id);
1583
- };
1584
- };
1585
-
1586
- var listener = function (event) {
1587
- run(event.data);
1588
- };
1589
-
1590
- var post = function (id) {
1591
- // old engines have not location.origin
1592
- global_1.postMessage(id + '', location$1.protocol + '//' + location$1.host);
1593
- };
1594
-
1595
- // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
1596
- if (!set$1 || !clear) {
1597
- set$1 = function setImmediate(fn) {
1598
- var args = [];
1599
- var i = 1;
1600
- while (arguments.length > i) args.push(arguments[i++]);
1601
- queue[++counter] = function () {
1602
- // eslint-disable-next-line no-new-func
1603
- (typeof fn == 'function' ? fn : Function(fn)).apply(undefined, args);
1604
- };
1605
- defer(counter);
1606
- return counter;
1607
- };
1608
- clear = function clearImmediate(id) {
1609
- delete queue[id];
1610
- };
1611
- // Node.js 0.8-
1612
- if (classofRaw(process$1) == 'process') {
1613
- defer = function (id) {
1614
- process$1.nextTick(runner(id));
1615
- };
1616
- // Sphere (JS game engine) Dispatch API
1617
- } else if (Dispatch && Dispatch.now) {
1618
- defer = function (id) {
1619
- Dispatch.now(runner(id));
1620
- };
1621
- // Browsers with MessageChannel, includes WebWorkers
1622
- // except iOS - https://github.com/zloirock/core-js/issues/624
1623
- } else if (MessageChannel && !engineIsIos) {
1624
- channel = new MessageChannel();
1625
- port = channel.port2;
1626
- channel.port1.onmessage = listener;
1627
- defer = functionBindContext(port.postMessage, port, 1);
1628
- // Browsers with postMessage, skip WebWorkers
1629
- // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
1630
- } else if (
1631
- global_1.addEventListener &&
1632
- typeof postMessage == 'function' &&
1633
- !global_1.importScripts &&
1634
- !fails(post) &&
1635
- location$1.protocol !== 'file:'
1636
- ) {
1637
- defer = post;
1638
- global_1.addEventListener('message', listener, false);
1639
- // IE8-
1640
- } else if (ONREADYSTATECHANGE in documentCreateElement('script')) {
1641
- defer = function (id) {
1642
- html.appendChild(documentCreateElement('script'))[ONREADYSTATECHANGE] = function () {
1643
- html.removeChild(this);
1644
- run(id);
1645
- };
1646
- };
1647
- // Rest old browsers
1648
- } else {
1649
- defer = function (id) {
1650
- setTimeout(runner(id), 0);
1651
- };
1652
- }
1653
- }
1654
-
1655
- var task = {
1656
- set: set$1,
1657
- clear: clear
1658
- };
1659
-
1660
- var getOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor.f;
1661
-
1662
- var macrotask = task.set;
1663
-
1664
-
1665
- var MutationObserver = global_1.MutationObserver || global_1.WebKitMutationObserver;
1666
- var process$2 = global_1.process;
1667
- var Promise$1 = global_1.Promise;
1668
- var IS_NODE = classofRaw(process$2) == 'process';
1669
- // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
1670
- var queueMicrotaskDescriptor = getOwnPropertyDescriptor$2(global_1, 'queueMicrotask');
1671
- var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
1672
-
1673
- var flush, head, last, notify, toggle, node, promise, then;
1674
-
1675
- // modern engines have queueMicrotask method
1676
- if (!queueMicrotask) {
1677
- flush = function () {
1678
- var parent, fn;
1679
- if (IS_NODE && (parent = process$2.domain)) parent.exit();
1680
- while (head) {
1681
- fn = head.fn;
1682
- head = head.next;
1683
- try {
1684
- fn();
1685
- } catch (error) {
1686
- if (head) notify();
1687
- else last = undefined;
1688
- throw error;
1689
- }
1690
- } last = undefined;
1691
- if (parent) parent.enter();
1692
- };
1693
-
1694
- // Node.js
1695
- if (IS_NODE) {
1696
- notify = function () {
1697
- process$2.nextTick(flush);
1698
- };
1699
- // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
1700
- } else if (MutationObserver && !engineIsIos) {
1701
- toggle = true;
1702
- node = document.createTextNode('');
1703
- new MutationObserver(flush).observe(node, { characterData: true });
1704
- notify = function () {
1705
- node.data = toggle = !toggle;
1706
- };
1707
- // environments with maybe non-completely correct, but existent Promise
1708
- } else if (Promise$1 && Promise$1.resolve) {
1709
- // Promise.resolve without an argument throws an error in LG WebOS 2
1710
- promise = Promise$1.resolve(undefined);
1711
- then = promise.then;
1712
- notify = function () {
1713
- then.call(promise, flush);
1714
- };
1715
- // for other environments - macrotask based on:
1716
- // - setImmediate
1717
- // - MessageChannel
1718
- // - window.postMessag
1719
- // - onreadystatechange
1720
- // - setTimeout
1721
- } else {
1722
- notify = function () {
1723
- // strange IE + webpack dev server bug - use .call(global)
1724
- macrotask.call(global_1, flush);
1725
- };
1726
- }
1727
- }
1728
-
1729
- var microtask = queueMicrotask || function (fn) {
1730
- var task = { fn: fn, next: undefined };
1731
- if (last) last.next = task;
1732
- if (!head) {
1733
- head = task;
1734
- notify();
1735
- } last = task;
1736
- };
1737
-
1738
- var PromiseCapability = function (C) {
1739
- var resolve, reject;
1740
- this.promise = new C(function ($$resolve, $$reject) {
1741
- if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
1742
- resolve = $$resolve;
1743
- reject = $$reject;
1744
- });
1745
- this.resolve = aFunction$1(resolve);
1746
- this.reject = aFunction$1(reject);
1747
- };
1748
-
1749
- // 25.4.1.5 NewPromiseCapability(C)
1750
- var f$5 = function (C) {
1751
- return new PromiseCapability(C);
1752
- };
1753
-
1754
- var newPromiseCapability = {
1755
- f: f$5
1756
- };
1757
-
1758
- var promiseResolve = function (C, x) {
1759
- anObject(C);
1760
- if (isObject(x) && x.constructor === C) return x;
1761
- var promiseCapability = newPromiseCapability.f(C);
1762
- var resolve = promiseCapability.resolve;
1763
- resolve(x);
1764
- return promiseCapability.promise;
1765
- };
1766
-
1767
- var hostReportErrors = function (a, b) {
1768
- var console = global_1.console;
1769
- if (console && console.error) {
1770
- arguments.length === 1 ? console.error(a) : console.error(a, b);
1771
- }
1772
- };
1773
-
1774
- var perform = function (exec) {
1775
- try {
1776
- return { error: false, value: exec() };
1777
- } catch (error) {
1778
- return { error: true, value: error };
1779
- }
1780
- };
1781
-
1782
- var task$1 = task.set;
1783
-
1784
-
1785
-
1786
-
1787
-
1788
-
1789
-
1790
-
1791
-
1792
-
1793
- var SPECIES$5 = wellKnownSymbol('species');
1794
- var PROMISE = 'Promise';
1795
- var getInternalState = internalState.get;
1796
- var setInternalState = internalState.set;
1797
- var getInternalPromiseState = internalState.getterFor(PROMISE);
1798
- var PromiseConstructor = nativePromiseConstructor;
1799
- var TypeError$1 = global_1.TypeError;
1800
- var document$2 = global_1.document;
1801
- var process$3 = global_1.process;
1802
- var $fetch = getBuiltIn('fetch');
1803
- var newPromiseCapability$1 = newPromiseCapability.f;
1804
- var newGenericPromiseCapability = newPromiseCapability$1;
1805
- var IS_NODE$1 = classofRaw(process$3) == 'process';
1806
- var DISPATCH_EVENT = !!(document$2 && document$2.createEvent && global_1.dispatchEvent);
1807
- var UNHANDLED_REJECTION = 'unhandledrejection';
1808
- var REJECTION_HANDLED = 'rejectionhandled';
1809
- var PENDING = 0;
1810
- var FULFILLED = 1;
1811
- var REJECTED = 2;
1812
- var HANDLED = 1;
1813
- var UNHANDLED = 2;
1814
- var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
1815
-
1816
- var FORCED$3 = isForced_1(PROMISE, function () {
1817
- var GLOBAL_CORE_JS_PROMISE = inspectSource(PromiseConstructor) !== String(PromiseConstructor);
1818
- if (!GLOBAL_CORE_JS_PROMISE) {
1819
- // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
1820
- // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
1821
- // We can't detect it synchronously, so just check versions
1822
- if (engineV8Version === 66) return true;
1823
- // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
1824
- if (!IS_NODE$1 && typeof PromiseRejectionEvent != 'function') return true;
1825
- }
1826
- // We can't use @@species feature detection in V8 since it causes
1827
- // deoptimization and performance degradation
1828
- // https://github.com/zloirock/core-js/issues/679
1829
- if (engineV8Version >= 51 && /native code/.test(PromiseConstructor)) return false;
1830
- // Detect correctness of subclassing with @@species support
1831
- var promise = PromiseConstructor.resolve(1);
1832
- var FakePromise = function (exec) {
1833
- exec(function () { /* empty */ }, function () { /* empty */ });
1834
- };
1835
- var constructor = promise.constructor = {};
1836
- constructor[SPECIES$5] = FakePromise;
1837
- return !(promise.then(function () { /* empty */ }) instanceof FakePromise);
1838
- });
1839
-
1840
- var INCORRECT_ITERATION = FORCED$3 || !checkCorrectnessOfIteration(function (iterable) {
1841
- PromiseConstructor.all(iterable)['catch'](function () { /* empty */ });
1842
- });
1843
-
1844
- // helpers
1845
- var isThenable = function (it) {
1846
- var then;
1847
- return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
1848
- };
1849
-
1850
- var notify$1 = function (promise, state, isReject) {
1851
- if (state.notified) return;
1852
- state.notified = true;
1853
- var chain = state.reactions;
1854
- microtask(function () {
1855
- var value = state.value;
1856
- var ok = state.state == FULFILLED;
1857
- var index = 0;
1858
- // variable length - can't use forEach
1859
- while (chain.length > index) {
1860
- var reaction = chain[index++];
1861
- var handler = ok ? reaction.ok : reaction.fail;
1862
- var resolve = reaction.resolve;
1863
- var reject = reaction.reject;
1864
- var domain = reaction.domain;
1865
- var result, then, exited;
1866
- try {
1867
- if (handler) {
1868
- if (!ok) {
1869
- if (state.rejection === UNHANDLED) onHandleUnhandled(promise, state);
1870
- state.rejection = HANDLED;
1871
- }
1872
- if (handler === true) result = value;
1873
- else {
1874
- if (domain) domain.enter();
1875
- result = handler(value); // can throw
1876
- if (domain) {
1877
- domain.exit();
1878
- exited = true;
1879
- }
1880
- }
1881
- if (result === reaction.promise) {
1882
- reject(TypeError$1('Promise-chain cycle'));
1883
- } else if (then = isThenable(result)) {
1884
- then.call(result, resolve, reject);
1885
- } else resolve(result);
1886
- } else reject(value);
1887
- } catch (error) {
1888
- if (domain && !exited) domain.exit();
1889
- reject(error);
1890
- }
1891
- }
1892
- state.reactions = [];
1893
- state.notified = false;
1894
- if (isReject && !state.rejection) onUnhandled(promise, state);
1895
- });
1896
- };
1897
-
1898
- var dispatchEvent = function (name, promise, reason) {
1899
- var event, handler;
1900
- if (DISPATCH_EVENT) {
1901
- event = document$2.createEvent('Event');
1902
- event.promise = promise;
1903
- event.reason = reason;
1904
- event.initEvent(name, false, true);
1905
- global_1.dispatchEvent(event);
1906
- } else event = { promise: promise, reason: reason };
1907
- if (handler = global_1['on' + name]) handler(event);
1908
- else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
1909
- };
1910
-
1911
- var onUnhandled = function (promise, state) {
1912
- task$1.call(global_1, function () {
1913
- var value = state.value;
1914
- var IS_UNHANDLED = isUnhandled(state);
1915
- var result;
1916
- if (IS_UNHANDLED) {
1917
- result = perform(function () {
1918
- if (IS_NODE$1) {
1919
- process$3.emit('unhandledRejection', value, promise);
1920
- } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
1921
- });
1922
- // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
1923
- state.rejection = IS_NODE$1 || isUnhandled(state) ? UNHANDLED : HANDLED;
1924
- if (result.error) throw result.value;
1925
- }
1926
- });
1927
- };
1928
-
1929
- var isUnhandled = function (state) {
1930
- return state.rejection !== HANDLED && !state.parent;
1931
- };
1932
-
1933
- var onHandleUnhandled = function (promise, state) {
1934
- task$1.call(global_1, function () {
1935
- if (IS_NODE$1) {
1936
- process$3.emit('rejectionHandled', promise);
1937
- } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
1938
- });
1939
- };
1940
-
1941
- var bind = function (fn, promise, state, unwrap) {
1942
- return function (value) {
1943
- fn(promise, state, value, unwrap);
1944
- };
1945
- };
1946
-
1947
- var internalReject = function (promise, state, value, unwrap) {
1948
- if (state.done) return;
1949
- state.done = true;
1950
- if (unwrap) state = unwrap;
1951
- state.value = value;
1952
- state.state = REJECTED;
1953
- notify$1(promise, state, true);
1954
- };
1955
-
1956
- var internalResolve = function (promise, state, value, unwrap) {
1957
- if (state.done) return;
1958
- state.done = true;
1959
- if (unwrap) state = unwrap;
1960
- try {
1961
- if (promise === value) throw TypeError$1("Promise can't be resolved itself");
1962
- var then = isThenable(value);
1963
- if (then) {
1964
- microtask(function () {
1965
- var wrapper = { done: false };
1966
- try {
1967
- then.call(value,
1968
- bind(internalResolve, promise, wrapper, state),
1969
- bind(internalReject, promise, wrapper, state)
1970
- );
1971
- } catch (error) {
1972
- internalReject(promise, wrapper, error, state);
1973
- }
1974
- });
1975
- } else {
1976
- state.value = value;
1977
- state.state = FULFILLED;
1978
- notify$1(promise, state, false);
1979
- }
1980
- } catch (error) {
1981
- internalReject(promise, { done: false }, error, state);
1982
- }
1983
- };
1984
-
1985
- // constructor polyfill
1986
- if (FORCED$3) {
1987
- // 25.4.3.1 Promise(executor)
1988
- PromiseConstructor = function Promise(executor) {
1989
- anInstance(this, PromiseConstructor, PROMISE);
1990
- aFunction$1(executor);
1991
- Internal.call(this);
1992
- var state = getInternalState(this);
1993
- try {
1994
- executor(bind(internalResolve, this, state), bind(internalReject, this, state));
1995
- } catch (error) {
1996
- internalReject(this, state, error);
1997
- }
1998
- };
1999
- // eslint-disable-next-line no-unused-vars
2000
- Internal = function Promise(executor) {
2001
- setInternalState(this, {
2002
- type: PROMISE,
2003
- done: false,
2004
- notified: false,
2005
- parent: false,
2006
- reactions: [],
2007
- rejection: false,
2008
- state: PENDING,
2009
- value: undefined
2010
- });
2011
- };
2012
- Internal.prototype = redefineAll(PromiseConstructor.prototype, {
2013
- // `Promise.prototype.then` method
2014
- // https://tc39.github.io/ecma262/#sec-promise.prototype.then
2015
- then: function then(onFulfilled, onRejected) {
2016
- var state = getInternalPromiseState(this);
2017
- var reaction = newPromiseCapability$1(speciesConstructor(this, PromiseConstructor));
2018
- reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
2019
- reaction.fail = typeof onRejected == 'function' && onRejected;
2020
- reaction.domain = IS_NODE$1 ? process$3.domain : undefined;
2021
- state.parent = true;
2022
- state.reactions.push(reaction);
2023
- if (state.state != PENDING) notify$1(this, state, false);
2024
- return reaction.promise;
2025
- },
2026
- // `Promise.prototype.catch` method
2027
- // https://tc39.github.io/ecma262/#sec-promise.prototype.catch
2028
- 'catch': function (onRejected) {
2029
- return this.then(undefined, onRejected);
2030
- }
2031
- });
2032
- OwnPromiseCapability = function () {
2033
- var promise = new Internal();
2034
- var state = getInternalState(promise);
2035
- this.promise = promise;
2036
- this.resolve = bind(internalResolve, promise, state);
2037
- this.reject = bind(internalReject, promise, state);
2038
- };
2039
- newPromiseCapability.f = newPromiseCapability$1 = function (C) {
2040
- return C === PromiseConstructor || C === PromiseWrapper
2041
- ? new OwnPromiseCapability(C)
2042
- : newGenericPromiseCapability(C);
2043
- };
2044
-
2045
- if ( typeof nativePromiseConstructor == 'function') {
2046
- nativeThen = nativePromiseConstructor.prototype.then;
2047
-
2048
- // wrap native Promise#then for native async functions
2049
- redefine(nativePromiseConstructor.prototype, 'then', function then(onFulfilled, onRejected) {
2050
- var that = this;
2051
- return new PromiseConstructor(function (resolve, reject) {
2052
- nativeThen.call(that, resolve, reject);
2053
- }).then(onFulfilled, onRejected);
2054
- // https://github.com/zloirock/core-js/issues/640
2055
- }, { unsafe: true });
2056
-
2057
- // wrap fetch result
2058
- if (typeof $fetch == 'function') _export({ global: true, enumerable: true, forced: true }, {
2059
- // eslint-disable-next-line no-unused-vars
2060
- fetch: function fetch(input /* , init */) {
2061
- return promiseResolve(PromiseConstructor, $fetch.apply(global_1, arguments));
2062
- }
2063
- });
2064
- }
2065
- }
2066
-
2067
- _export({ global: true, wrap: true, forced: FORCED$3 }, {
2068
- Promise: PromiseConstructor
2069
- });
2070
-
2071
- setToStringTag(PromiseConstructor, PROMISE, false);
2072
- setSpecies(PROMISE);
2073
-
2074
- PromiseWrapper = getBuiltIn(PROMISE);
2075
-
2076
- // statics
2077
- _export({ target: PROMISE, stat: true, forced: FORCED$3 }, {
2078
- // `Promise.reject` method
2079
- // https://tc39.github.io/ecma262/#sec-promise.reject
2080
- reject: function reject(r) {
2081
- var capability = newPromiseCapability$1(this);
2082
- capability.reject.call(undefined, r);
2083
- return capability.promise;
2084
- }
2085
- });
2086
-
2087
- _export({ target: PROMISE, stat: true, forced: FORCED$3 }, {
2088
- // `Promise.resolve` method
2089
- // https://tc39.github.io/ecma262/#sec-promise.resolve
2090
- resolve: function resolve(x) {
2091
- return promiseResolve( this, x);
2092
- }
2093
- });
2094
-
2095
- _export({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION }, {
2096
- // `Promise.all` method
2097
- // https://tc39.github.io/ecma262/#sec-promise.all
2098
- all: function all(iterable) {
2099
- var C = this;
2100
- var capability = newPromiseCapability$1(C);
2101
- var resolve = capability.resolve;
2102
- var reject = capability.reject;
2103
- var result = perform(function () {
2104
- var $promiseResolve = aFunction$1(C.resolve);
2105
- var values = [];
2106
- var counter = 0;
2107
- var remaining = 1;
2108
- iterate_1(iterable, function (promise) {
2109
- var index = counter++;
2110
- var alreadyCalled = false;
2111
- values.push(undefined);
2112
- remaining++;
2113
- $promiseResolve.call(C, promise).then(function (value) {
2114
- if (alreadyCalled) return;
2115
- alreadyCalled = true;
2116
- values[index] = value;
2117
- --remaining || resolve(values);
2118
- }, reject);
2119
- });
2120
- --remaining || resolve(values);
2121
- });
2122
- if (result.error) reject(result.value);
2123
- return capability.promise;
2124
- },
2125
- // `Promise.race` method
2126
- // https://tc39.github.io/ecma262/#sec-promise.race
2127
- race: function race(iterable) {
2128
- var C = this;
2129
- var capability = newPromiseCapability$1(C);
2130
- var reject = capability.reject;
2131
- var result = perform(function () {
2132
- var $promiseResolve = aFunction$1(C.resolve);
2133
- iterate_1(iterable, function (promise) {
2134
- $promiseResolve.call(C, promise).then(capability.resolve, reject);
2135
- });
2136
- });
2137
- if (result.error) reject(result.value);
2138
- return capability.promise;
2139
- }
2140
- });
2141
-
2142
- var aPossiblePrototype = function (it) {
2143
- if (!isObject(it) && it !== null) {
2144
- throw TypeError("Can't set " + String(it) + ' as a prototype');
2145
- } return it;
2146
- };
2147
-
2148
- // `Object.setPrototypeOf` method
2149
- // https://tc39.github.io/ecma262/#sec-object.setprototypeof
2150
- // Works with __proto__ only. Old v8 can't work with null proto objects.
2151
- /* eslint-disable no-proto */
2152
- var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
2153
- var CORRECT_SETTER = false;
2154
- var test = {};
2155
- var setter;
2156
- try {
2157
- setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
2158
- setter.call(test, []);
2159
- CORRECT_SETTER = test instanceof Array;
2160
- } catch (error) { /* empty */ }
2161
- return function setPrototypeOf(O, proto) {
2162
- anObject(O);
2163
- aPossiblePrototype(proto);
2164
- if (CORRECT_SETTER) setter.call(O, proto);
2165
- else O.__proto__ = proto;
2166
- return O;
2167
- };
2168
- }() : undefined);
2169
-
2170
- // makes subclassing work correct for wrapped built-ins
2171
- var inheritIfRequired = function ($this, dummy, Wrapper) {
2172
- var NewTarget, NewTargetPrototype;
2173
- if (
2174
- // it can work only with native `setPrototypeOf`
2175
- objectSetPrototypeOf &&
2176
- // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
2177
- typeof (NewTarget = dummy.constructor) == 'function' &&
2178
- NewTarget !== Wrapper &&
2179
- isObject(NewTargetPrototype = NewTarget.prototype) &&
2180
- NewTargetPrototype !== Wrapper.prototype
2181
- ) objectSetPrototypeOf($this, NewTargetPrototype);
2182
- return $this;
2183
- };
2184
-
2185
- var MATCH = wellKnownSymbol('match');
2186
-
2187
- // `IsRegExp` abstract operation
2188
- // https://tc39.github.io/ecma262/#sec-isregexp
2189
- var isRegexp = function (it) {
2190
- var isRegExp;
2191
- return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
2192
- };
2193
-
2194
- // `RegExp.prototype.flags` getter implementation
2195
- // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags
2196
- var regexpFlags = function () {
2197
- var that = anObject(this);
2198
- var result = '';
2199
- if (that.global) result += 'g';
2200
- if (that.ignoreCase) result += 'i';
2201
- if (that.multiline) result += 'm';
2202
- if (that.dotAll) result += 's';
2203
- if (that.unicode) result += 'u';
2204
- if (that.sticky) result += 'y';
2205
- return result;
2206
- };
2207
-
2208
- // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,
2209
- // so we use an intermediate function.
2210
- function RE(s, f) {
2211
- return RegExp(s, f);
2212
- }
2213
-
2214
- var UNSUPPORTED_Y = fails(function () {
2215
- // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
2216
- var re = RE('a', 'y');
2217
- re.lastIndex = 2;
2218
- return re.exec('abcd') != null;
2219
- });
2220
-
2221
- var BROKEN_CARET = fails(function () {
2222
- // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
2223
- var re = RE('^r', 'gy');
2224
- re.lastIndex = 2;
2225
- return re.exec('str') != null;
2226
- });
2227
-
2228
- var regexpStickyHelpers = {
2229
- UNSUPPORTED_Y: UNSUPPORTED_Y,
2230
- BROKEN_CARET: BROKEN_CARET
2231
- };
2232
-
2233
- var defineProperty$4 = objectDefineProperty.f;
2234
- var getOwnPropertyNames = objectGetOwnPropertyNames.f;
2235
-
2236
-
2237
-
2238
-
2239
-
2240
- var setInternalState$1 = internalState.set;
2241
-
2242
-
2243
-
2244
- var MATCH$1 = wellKnownSymbol('match');
2245
- var NativeRegExp = global_1.RegExp;
2246
- var RegExpPrototype = NativeRegExp.prototype;
2247
- var re1 = /a/g;
2248
- var re2 = /a/g;
2249
-
2250
- // "new" should create a new object, old webkit bug
2251
- var CORRECT_NEW = new NativeRegExp(re1) !== re1;
2252
-
2253
- var UNSUPPORTED_Y$1 = regexpStickyHelpers.UNSUPPORTED_Y;
2254
-
2255
- var FORCED$4 = descriptors && isForced_1('RegExp', (!CORRECT_NEW || UNSUPPORTED_Y$1 || fails(function () {
2256
- re2[MATCH$1] = false;
2257
- // RegExp constructor can alter flags and IsRegExp works correct with @@match
2258
- return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, 'i') != '/a/i';
2259
- })));
2260
-
2261
- // `RegExp` constructor
2262
- // https://tc39.github.io/ecma262/#sec-regexp-constructor
2263
- if (FORCED$4) {
2264
- var RegExpWrapper = function RegExp(pattern, flags) {
2265
- var thisIsRegExp = this instanceof RegExpWrapper;
2266
- var patternIsRegExp = isRegexp(pattern);
2267
- var flagsAreUndefined = flags === undefined;
2268
- var sticky;
2269
-
2270
- if (!thisIsRegExp && patternIsRegExp && pattern.constructor === RegExpWrapper && flagsAreUndefined) {
2271
- return pattern;
2272
- }
2273
-
2274
- if (CORRECT_NEW) {
2275
- if (patternIsRegExp && !flagsAreUndefined) pattern = pattern.source;
2276
- } else if (pattern instanceof RegExpWrapper) {
2277
- if (flagsAreUndefined) flags = regexpFlags.call(pattern);
2278
- pattern = pattern.source;
2279
- }
2280
-
2281
- if (UNSUPPORTED_Y$1) {
2282
- sticky = !!flags && flags.indexOf('y') > -1;
2283
- if (sticky) flags = flags.replace(/y/g, '');
2284
- }
2285
-
2286
- var result = inheritIfRequired(
2287
- CORRECT_NEW ? new NativeRegExp(pattern, flags) : NativeRegExp(pattern, flags),
2288
- thisIsRegExp ? this : RegExpPrototype,
2289
- RegExpWrapper
2290
- );
2291
-
2292
- if (UNSUPPORTED_Y$1 && sticky) setInternalState$1(result, { sticky: sticky });
2293
-
2294
- return result;
2295
- };
2296
- var proxy = function (key) {
2297
- key in RegExpWrapper || defineProperty$4(RegExpWrapper, key, {
2298
- configurable: true,
2299
- get: function () { return NativeRegExp[key]; },
2300
- set: function (it) { NativeRegExp[key] = it; }
2301
- });
2302
- };
2303
- var keys$1 = getOwnPropertyNames(NativeRegExp);
2304
- var index = 0;
2305
- while (keys$1.length > index) proxy(keys$1[index++]);
2306
- RegExpPrototype.constructor = RegExpWrapper;
2307
- RegExpWrapper.prototype = RegExpPrototype;
2308
- redefine(global_1, 'RegExp', RegExpWrapper);
2309
- }
2310
-
2311
- // https://tc39.github.io/ecma262/#sec-get-regexp-@@species
2312
- setSpecies('RegExp');
2313
-
2314
- var nativeExec = RegExp.prototype.exec;
2315
- // This always refers to the native implementation, because the
2316
- // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
2317
- // which loads this file before patching the method.
2318
- var nativeReplace = String.prototype.replace;
2319
-
2320
- var patchedExec = nativeExec;
2321
-
2322
- var UPDATES_LAST_INDEX_WRONG = (function () {
2323
- var re1 = /a/;
2324
- var re2 = /b*/g;
2325
- nativeExec.call(re1, 'a');
2326
- nativeExec.call(re2, 'a');
2327
- return re1.lastIndex !== 0 || re2.lastIndex !== 0;
2328
- })();
2329
-
2330
- var UNSUPPORTED_Y$2 = regexpStickyHelpers.UNSUPPORTED_Y || regexpStickyHelpers.BROKEN_CARET;
2331
-
2332
- // nonparticipating capturing group, copied from es5-shim's String#split patch.
2333
- var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
2334
-
2335
- var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$2;
2336
-
2337
- if (PATCH) {
2338
- patchedExec = function exec(str) {
2339
- var re = this;
2340
- var lastIndex, reCopy, match, i;
2341
- var sticky = UNSUPPORTED_Y$2 && re.sticky;
2342
- var flags = regexpFlags.call(re);
2343
- var source = re.source;
2344
- var charsAdded = 0;
2345
- var strCopy = str;
2346
-
2347
- if (sticky) {
2348
- flags = flags.replace('y', '');
2349
- if (flags.indexOf('g') === -1) {
2350
- flags += 'g';
2351
- }
2352
-
2353
- strCopy = String(str).slice(re.lastIndex);
2354
- // Support anchored sticky behavior.
2355
- if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) {
2356
- source = '(?: ' + source + ')';
2357
- strCopy = ' ' + strCopy;
2358
- charsAdded++;
2359
- }
2360
- // ^(? + rx + ) is needed, in combination with some str slicing, to
2361
- // simulate the 'y' flag.
2362
- reCopy = new RegExp('^(?:' + source + ')', flags);
2363
- }
2364
-
2365
- if (NPCG_INCLUDED) {
2366
- reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
2367
- }
2368
- if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
2369
-
2370
- match = nativeExec.call(sticky ? reCopy : re, strCopy);
2371
-
2372
- if (sticky) {
2373
- if (match) {
2374
- match.input = match.input.slice(charsAdded);
2375
- match[0] = match[0].slice(charsAdded);
2376
- match.index = re.lastIndex;
2377
- re.lastIndex += match[0].length;
2378
- } else re.lastIndex = 0;
2379
- } else if (UPDATES_LAST_INDEX_WRONG && match) {
2380
- re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
2381
- }
2382
- if (NPCG_INCLUDED && match && match.length > 1) {
2383
- // Fix browsers whose `exec` methods don't consistently return `undefined`
2384
- // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
2385
- nativeReplace.call(match[0], reCopy, function () {
2386
- for (i = 1; i < arguments.length - 2; i++) {
2387
- if (arguments[i] === undefined) match[i] = undefined;
2388
- }
2389
- });
2390
- }
2391
-
2392
- return match;
2393
- };
2394
- }
2395
-
2396
- var regexpExec = patchedExec;
2397
-
2398
- _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
2399
- exec: regexpExec
2400
- });
2401
-
2402
- var TO_STRING = 'toString';
2403
- var RegExpPrototype$1 = RegExp.prototype;
2404
- var nativeToString = RegExpPrototype$1[TO_STRING];
2405
-
2406
- var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
2407
- // FF44- RegExp#toString has a wrong name
2408
- var INCORRECT_NAME = nativeToString.name != TO_STRING;
2409
-
2410
- // `RegExp.prototype.toString` method
2411
- // https://tc39.github.io/ecma262/#sec-regexp.prototype.tostring
2412
- if (NOT_GENERIC || INCORRECT_NAME) {
2413
- redefine(RegExp.prototype, TO_STRING, function toString() {
2414
- var R = anObject(this);
2415
- var p = String(R.source);
2416
- var rf = R.flags;
2417
- var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype$1) ? regexpFlags.call(R) : rf);
2418
- return '/' + p + '/' + f;
2419
- }, { unsafe: true });
2420
- }
2421
-
2422
- _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
2423
- exec: regexpExec
2424
- });
2425
-
2426
- // TODO: Remove from `core-js@4` since it's moved to entry points
2427
-
2428
-
2429
-
2430
-
2431
-
2432
-
2433
-
2434
- var SPECIES$6 = wellKnownSymbol('species');
2435
-
2436
- var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
2437
- // #replace needs built-in support for named groups.
2438
- // #match works fine because it just return the exec results, even if it has
2439
- // a "grops" property.
2440
- var re = /./;
2441
- re.exec = function () {
2442
- var result = [];
2443
- result.groups = { a: '7' };
2444
- return result;
2445
- };
2446
- return ''.replace(re, '$<a>') !== '7';
2447
- });
2448
-
2449
- // IE <= 11 replaces $0 with the whole match, as if it was $&
2450
- // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
2451
- var REPLACE_KEEPS_$0 = (function () {
2452
- return 'a'.replace(/./, '$0') === '$0';
2453
- })();
2454
-
2455
- var REPLACE = wellKnownSymbol('replace');
2456
- // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
2457
- var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
2458
- if (/./[REPLACE]) {
2459
- return /./[REPLACE]('a', '$0') === '';
2460
- }
2461
- return false;
2462
- })();
2463
-
2464
- // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
2465
- // Weex JS has frozen built-in prototypes, so use try / catch wrapper
2466
- var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
2467
- var re = /(?:)/;
2468
- var originalExec = re.exec;
2469
- re.exec = function () { return originalExec.apply(this, arguments); };
2470
- var result = 'ab'.split(re);
2471
- return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
2472
- });
2473
-
2474
- var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) {
2475
- var SYMBOL = wellKnownSymbol(KEY);
2476
-
2477
- var DELEGATES_TO_SYMBOL = !fails(function () {
2478
- // String methods call symbol-named RegEp methods
2479
- var O = {};
2480
- O[SYMBOL] = function () { return 7; };
2481
- return ''[KEY](O) != 7;
2482
- });
2483
-
2484
- var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
2485
- // Symbol-named RegExp methods call .exec
2486
- var execCalled = false;
2487
- var re = /a/;
2488
-
2489
- if (KEY === 'split') {
2490
- // We can't use real regex here since it causes deoptimization
2491
- // and serious performance degradation in V8
2492
- // https://github.com/zloirock/core-js/issues/306
2493
- re = {};
2494
- // RegExp[@@split] doesn't call the regex's exec method, but first creates
2495
- // a new one. We need to return the patched regex when creating the new one.
2496
- re.constructor = {};
2497
- re.constructor[SPECIES$6] = function () { return re; };
2498
- re.flags = '';
2499
- re[SYMBOL] = /./[SYMBOL];
2500
- }
2501
-
2502
- re.exec = function () { execCalled = true; return null; };
2503
-
2504
- re[SYMBOL]('');
2505
- return !execCalled;
2506
- });
2507
-
2508
- if (
2509
- !DELEGATES_TO_SYMBOL ||
2510
- !DELEGATES_TO_EXEC ||
2511
- (KEY === 'replace' && !(
2512
- REPLACE_SUPPORTS_NAMED_GROUPS &&
2513
- REPLACE_KEEPS_$0 &&
2514
- !REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
2515
- )) ||
2516
- (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
2517
- ) {
2518
- var nativeRegExpMethod = /./[SYMBOL];
2519
- var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
2520
- if (regexp.exec === regexpExec) {
2521
- if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
2522
- // The native String method already delegates to @@method (this
2523
- // polyfilled function), leasing to infinite recursion.
2524
- // We avoid it by directly calling the native @@method method.
2525
- return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
2526
- }
2527
- return { done: true, value: nativeMethod.call(str, regexp, arg2) };
2528
- }
2529
- return { done: false };
2530
- }, {
2531
- REPLACE_KEEPS_$0: REPLACE_KEEPS_$0,
2532
- REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE: REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
2533
- });
2534
- var stringMethod = methods[0];
2535
- var regexMethod = methods[1];
2536
-
2537
- redefine(String.prototype, KEY, stringMethod);
2538
- redefine(RegExp.prototype, SYMBOL, length == 2
2539
- // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
2540
- // 21.2.5.11 RegExp.prototype[@@split](string, limit)
2541
- ? function (string, arg) { return regexMethod.call(string, this, arg); }
2542
- // 21.2.5.6 RegExp.prototype[@@match](string)
2543
- // 21.2.5.9 RegExp.prototype[@@search](string)
2544
- : function (string) { return regexMethod.call(string, this); }
2545
- );
2546
- }
2547
-
2548
- if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
2549
- };
2550
-
2551
- // `String.prototype.{ codePointAt, at }` methods implementation
2552
- var createMethod$4 = function (CONVERT_TO_STRING) {
2553
- return function ($this, pos) {
2554
- var S = String(requireObjectCoercible($this));
2555
- var position = toInteger(pos);
2556
- var size = S.length;
2557
- var first, second;
2558
- if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
2559
- first = S.charCodeAt(position);
2560
- return first < 0xD800 || first > 0xDBFF || position + 1 === size
2561
- || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
2562
- ? CONVERT_TO_STRING ? S.charAt(position) : first
2563
- : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
2564
- };
2565
- };
2566
-
2567
- var stringMultibyte = {
2568
- // `String.prototype.codePointAt` method
2569
- // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat
2570
- codeAt: createMethod$4(false),
2571
- // `String.prototype.at` method
2572
- // https://github.com/mathiasbynens/String.prototype.at
2573
- charAt: createMethod$4(true)
2574
- };
2575
-
2576
- var charAt = stringMultibyte.charAt;
2577
-
2578
- // `AdvanceStringIndex` abstract operation
2579
- // https://tc39.github.io/ecma262/#sec-advancestringindex
2580
- var advanceStringIndex = function (S, index, unicode) {
2581
- return index + (unicode ? charAt(S, index).length : 1);
2582
- };
2583
-
2584
- // `RegExpExec` abstract operation
2585
- // https://tc39.github.io/ecma262/#sec-regexpexec
2586
- var regexpExecAbstract = function (R, S) {
2587
- var exec = R.exec;
2588
- if (typeof exec === 'function') {
2589
- var result = exec.call(R, S);
2590
- if (typeof result !== 'object') {
2591
- throw TypeError('RegExp exec method returned something other than an Object or null');
2592
- }
2593
- return result;
2594
- }
2595
-
2596
- if (classofRaw(R) !== 'RegExp') {
2597
- throw TypeError('RegExp#exec called on incompatible receiver');
2598
- }
2599
-
2600
- return regexpExec.call(R, S);
2601
- };
2602
-
2603
- // @@match logic
2604
- fixRegexpWellKnownSymbolLogic('match', 1, function (MATCH, nativeMatch, maybeCallNative) {
2605
- return [
2606
- // `String.prototype.match` method
2607
- // https://tc39.github.io/ecma262/#sec-string.prototype.match
2608
- function match(regexp) {
2609
- var O = requireObjectCoercible(this);
2610
- var matcher = regexp == undefined ? undefined : regexp[MATCH];
2611
- return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
2612
- },
2613
- // `RegExp.prototype[@@match]` method
2614
- // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match
2615
- function (regexp) {
2616
- var res = maybeCallNative(nativeMatch, regexp, this);
2617
- if (res.done) return res.value;
2618
-
2619
- var rx = anObject(regexp);
2620
- var S = String(this);
2621
-
2622
- if (!rx.global) return regexpExecAbstract(rx, S);
2623
-
2624
- var fullUnicode = rx.unicode;
2625
- rx.lastIndex = 0;
2626
- var A = [];
2627
- var n = 0;
2628
- var result;
2629
- while ((result = regexpExecAbstract(rx, S)) !== null) {
2630
- var matchStr = String(result[0]);
2631
- A[n] = matchStr;
2632
- if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
2633
- n++;
2634
- }
2635
- return n === 0 ? null : A;
2636
- }
2637
- ];
2638
- });
2639
-
2640
- var max$2 = Math.max;
2641
- var min$2 = Math.min;
2642
- var floor$2 = Math.floor;
2643
- var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g;
2644
- var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g;
2645
-
2646
- var maybeToString = function (it) {
2647
- return it === undefined ? it : String(it);
2648
- };
2649
-
2650
- // @@replace logic
2651
- fixRegexpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative, reason) {
2652
- var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = reason.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE;
2653
- var REPLACE_KEEPS_$0 = reason.REPLACE_KEEPS_$0;
2654
- var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
2655
-
2656
- return [
2657
- // `String.prototype.replace` method
2658
- // https://tc39.github.io/ecma262/#sec-string.prototype.replace
2659
- function replace(searchValue, replaceValue) {
2660
- var O = requireObjectCoercible(this);
2661
- var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
2662
- return replacer !== undefined
2663
- ? replacer.call(searchValue, O, replaceValue)
2664
- : nativeReplace.call(String(O), searchValue, replaceValue);
2665
- },
2666
- // `RegExp.prototype[@@replace]` method
2667
- // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
2668
- function (regexp, replaceValue) {
2669
- if (
2670
- (!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE && REPLACE_KEEPS_$0) ||
2671
- (typeof replaceValue === 'string' && replaceValue.indexOf(UNSAFE_SUBSTITUTE) === -1)
2672
- ) {
2673
- var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
2674
- if (res.done) return res.value;
2675
- }
2676
-
2677
- var rx = anObject(regexp);
2678
- var S = String(this);
2679
-
2680
- var functionalReplace = typeof replaceValue === 'function';
2681
- if (!functionalReplace) replaceValue = String(replaceValue);
2682
-
2683
- var global = rx.global;
2684
- if (global) {
2685
- var fullUnicode = rx.unicode;
2686
- rx.lastIndex = 0;
2687
- }
2688
- var results = [];
2689
- while (true) {
2690
- var result = regexpExecAbstract(rx, S);
2691
- if (result === null) break;
2692
-
2693
- results.push(result);
2694
- if (!global) break;
2695
-
2696
- var matchStr = String(result[0]);
2697
- if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
2698
- }
2699
-
2700
- var accumulatedResult = '';
2701
- var nextSourcePosition = 0;
2702
- for (var i = 0; i < results.length; i++) {
2703
- result = results[i];
2704
-
2705
- var matched = String(result[0]);
2706
- var position = max$2(min$2(toInteger(result.index), S.length), 0);
2707
- var captures = [];
2708
- // NOTE: This is equivalent to
2709
- // captures = result.slice(1).map(maybeToString)
2710
- // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
2711
- // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
2712
- // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
2713
- for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
2714
- var namedCaptures = result.groups;
2715
- if (functionalReplace) {
2716
- var replacerArgs = [matched].concat(captures, position, S);
2717
- if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
2718
- var replacement = String(replaceValue.apply(undefined, replacerArgs));
2719
- } else {
2720
- replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
2721
- }
2722
- if (position >= nextSourcePosition) {
2723
- accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
2724
- nextSourcePosition = position + matched.length;
2725
- }
2726
- }
2727
- return accumulatedResult + S.slice(nextSourcePosition);
2728
- }
2729
- ];
2730
-
2731
- // https://tc39.github.io/ecma262/#sec-getsubstitution
2732
- function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
2733
- var tailPos = position + matched.length;
2734
- var m = captures.length;
2735
- var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
2736
- if (namedCaptures !== undefined) {
2737
- namedCaptures = toObject(namedCaptures);
2738
- symbols = SUBSTITUTION_SYMBOLS;
2739
- }
2740
- return nativeReplace.call(replacement, symbols, function (match, ch) {
2741
- var capture;
2742
- switch (ch.charAt(0)) {
2743
- case '$': return '$';
2744
- case '&': return matched;
2745
- case '`': return str.slice(0, position);
2746
- case "'": return str.slice(tailPos);
2747
- case '<':
2748
- capture = namedCaptures[ch.slice(1, -1)];
2749
- break;
2750
- default: // \d\d?
2751
- var n = +ch;
2752
- if (n === 0) return match;
2753
- if (n > m) {
2754
- var f = floor$2(n / 10);
2755
- if (f === 0) return match;
2756
- if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
2757
- return match;
2758
- }
2759
- capture = captures[n - 1];
2760
- }
2761
- return capture === undefined ? '' : capture;
2762
- });
2763
- }
2764
- });
2765
-
2766
- // `SameValue` abstract operation
2767
- // https://tc39.github.io/ecma262/#sec-samevalue
2768
- var sameValue = Object.is || function is(x, y) {
2769
- // eslint-disable-next-line no-self-compare
2770
- return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
2771
- };
2772
-
2773
- // @@search logic
2774
- fixRegexpWellKnownSymbolLogic('search', 1, function (SEARCH, nativeSearch, maybeCallNative) {
2775
- return [
2776
- // `String.prototype.search` method
2777
- // https://tc39.github.io/ecma262/#sec-string.prototype.search
2778
- function search(regexp) {
2779
- var O = requireObjectCoercible(this);
2780
- var searcher = regexp == undefined ? undefined : regexp[SEARCH];
2781
- return searcher !== undefined ? searcher.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
2782
- },
2783
- // `RegExp.prototype[@@search]` method
2784
- // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search
2785
- function (regexp) {
2786
- var res = maybeCallNative(nativeSearch, regexp, this);
2787
- if (res.done) return res.value;
2788
-
2789
- var rx = anObject(regexp);
2790
- var S = String(this);
2791
-
2792
- var previousLastIndex = rx.lastIndex;
2793
- if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
2794
- var result = regexpExecAbstract(rx, S);
2795
- if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
2796
- return result === null ? -1 : result.index;
2797
- }
2798
- ];
2799
- });
2800
-
2801
- var arrayPush = [].push;
2802
- var min$3 = Math.min;
2803
- var MAX_UINT32 = 0xFFFFFFFF;
2804
-
2805
- // babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError
2806
- var SUPPORTS_Y = !fails(function () { return !RegExp(MAX_UINT32, 'y'); });
2807
-
2808
- // @@split logic
2809
- fixRegexpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCallNative) {
2810
- var internalSplit;
2811
- if (
2812
- 'abbc'.split(/(b)*/)[1] == 'c' ||
2813
- 'test'.split(/(?:)/, -1).length != 4 ||
2814
- 'ab'.split(/(?:ab)*/).length != 2 ||
2815
- '.'.split(/(.?)(.?)/).length != 4 ||
2816
- '.'.split(/()()/).length > 1 ||
2817
- ''.split(/.?/).length
2818
- ) {
2819
- // based on es5-shim implementation, need to rework it
2820
- internalSplit = function (separator, limit) {
2821
- var string = String(requireObjectCoercible(this));
2822
- var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
2823
- if (lim === 0) return [];
2824
- if (separator === undefined) return [string];
2825
- // If `separator` is not a regex, use native split
2826
- if (!isRegexp(separator)) {
2827
- return nativeSplit.call(string, separator, lim);
2828
- }
2829
- var output = [];
2830
- var flags = (separator.ignoreCase ? 'i' : '') +
2831
- (separator.multiline ? 'm' : '') +
2832
- (separator.unicode ? 'u' : '') +
2833
- (separator.sticky ? 'y' : '');
2834
- var lastLastIndex = 0;
2835
- // Make `global` and avoid `lastIndex` issues by working with a copy
2836
- var separatorCopy = new RegExp(separator.source, flags + 'g');
2837
- var match, lastIndex, lastLength;
2838
- while (match = regexpExec.call(separatorCopy, string)) {
2839
- lastIndex = separatorCopy.lastIndex;
2840
- if (lastIndex > lastLastIndex) {
2841
- output.push(string.slice(lastLastIndex, match.index));
2842
- if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(1));
2843
- lastLength = match[0].length;
2844
- lastLastIndex = lastIndex;
2845
- if (output.length >= lim) break;
2846
- }
2847
- if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
2848
- }
2849
- if (lastLastIndex === string.length) {
2850
- if (lastLength || !separatorCopy.test('')) output.push('');
2851
- } else output.push(string.slice(lastLastIndex));
2852
- return output.length > lim ? output.slice(0, lim) : output;
2853
- };
2854
- // Chakra, V8
2855
- } else if ('0'.split(undefined, 0).length) {
2856
- internalSplit = function (separator, limit) {
2857
- return separator === undefined && limit === 0 ? [] : nativeSplit.call(this, separator, limit);
2858
- };
2859
- } else internalSplit = nativeSplit;
2860
-
2861
- return [
2862
- // `String.prototype.split` method
2863
- // https://tc39.github.io/ecma262/#sec-string.prototype.split
2864
- function split(separator, limit) {
2865
- var O = requireObjectCoercible(this);
2866
- var splitter = separator == undefined ? undefined : separator[SPLIT];
2867
- return splitter !== undefined
2868
- ? splitter.call(separator, O, limit)
2869
- : internalSplit.call(String(O), separator, limit);
2870
- },
2871
- // `RegExp.prototype[@@split]` method
2872
- // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split
2873
- //
2874
- // NOTE: This cannot be properly polyfilled in engines that don't support
2875
- // the 'y' flag.
2876
- function (regexp, limit) {
2877
- var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== nativeSplit);
2878
- if (res.done) return res.value;
2879
-
2880
- var rx = anObject(regexp);
2881
- var S = String(this);
2882
- var C = speciesConstructor(rx, RegExp);
2883
-
2884
- var unicodeMatching = rx.unicode;
2885
- var flags = (rx.ignoreCase ? 'i' : '') +
2886
- (rx.multiline ? 'm' : '') +
2887
- (rx.unicode ? 'u' : '') +
2888
- (SUPPORTS_Y ? 'y' : 'g');
2889
-
2890
- // ^(? + rx + ) is needed, in combination with some S slicing, to
2891
- // simulate the 'y' flag.
2892
- var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);
2893
- var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
2894
- if (lim === 0) return [];
2895
- if (S.length === 0) return regexpExecAbstract(splitter, S) === null ? [S] : [];
2896
- var p = 0;
2897
- var q = 0;
2898
- var A = [];
2899
- while (q < S.length) {
2900
- splitter.lastIndex = SUPPORTS_Y ? q : 0;
2901
- var z = regexpExecAbstract(splitter, SUPPORTS_Y ? S : S.slice(q));
2902
- var e;
2903
- if (
2904
- z === null ||
2905
- (e = min$3(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p
2906
- ) {
2907
- q = advanceStringIndex(S, q, unicodeMatching);
2908
- } else {
2909
- A.push(S.slice(p, q));
2910
- if (A.length === lim) return A;
2911
- for (var i = 1; i <= z.length - 1; i++) {
2912
- A.push(z[i]);
2913
- if (A.length === lim) return A;
2914
- }
2915
- q = p = e;
2916
- }
2917
- }
2918
- A.push(S.slice(p));
2919
- return A;
2920
- }
2921
- ];
2922
- }, !SUPPORTS_Y);
2923
-
2924
- // iterable DOM collections
2925
- // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
2926
- var domIterables = {
2927
- CSSRuleList: 0,
2928
- CSSStyleDeclaration: 0,
2929
- CSSValueList: 0,
2930
- ClientRectList: 0,
2931
- DOMRectList: 0,
2932
- DOMStringList: 0,
2933
- DOMTokenList: 1,
2934
- DataTransferItemList: 0,
2935
- FileList: 0,
2936
- HTMLAllCollection: 0,
2937
- HTMLCollection: 0,
2938
- HTMLFormElement: 0,
2939
- HTMLSelectElement: 0,
2940
- MediaList: 0,
2941
- MimeTypeArray: 0,
2942
- NamedNodeMap: 0,
2943
- NodeList: 1,
2944
- PaintRequestList: 0,
2945
- Plugin: 0,
2946
- PluginArray: 0,
2947
- SVGLengthList: 0,
2948
- SVGNumberList: 0,
2949
- SVGPathSegList: 0,
2950
- SVGPointList: 0,
2951
- SVGStringList: 0,
2952
- SVGTransformList: 0,
2953
- SourceBufferList: 0,
2954
- StyleSheetList: 0,
2955
- TextTrackCueList: 0,
2956
- TextTrackList: 0,
2957
- TouchList: 0
2958
- };
2959
-
2960
- for (var COLLECTION_NAME in domIterables) {
2961
- var Collection = global_1[COLLECTION_NAME];
2962
- var CollectionPrototype = Collection && Collection.prototype;
2963
- // some Chrome versions have non-configurable methods on DOMTokenList
2964
- if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try {
2965
- createNonEnumerableProperty(CollectionPrototype, 'forEach', arrayForEach);
2966
- } catch (error) {
2967
- CollectionPrototype.forEach = arrayForEach;
2968
- }
2969
- }
2970
-
2971
- var _typeof_1 = createCommonjsModule(function (module) {
2972
- function _typeof(obj) {
2973
- "@babel/helpers - typeof";
2974
-
2975
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
2976
- module.exports = _typeof = function _typeof(obj) {
2977
- return typeof obj;
2978
- };
2979
- } else {
2980
- module.exports = _typeof = function _typeof(obj) {
2981
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
2982
- };
2983
- }
2984
-
2985
- return _typeof(obj);
2986
- }
2987
-
2988
- module.exports = _typeof;
2989
- });
2990
-
2991
- /*! *****************************************************************************
2992
- Copyright (c) Microsoft Corporation.
2993
-
2994
- Permission to use, copy, modify, and/or distribute this software for any
2995
- purpose with or without fee is hereby granted.
2996
-
2997
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
2998
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
2999
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
3000
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
3001
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
3002
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
3003
- PERFORMANCE OF THIS SOFTWARE.
3004
- ***************************************************************************** */
3005
-
3006
- function __spreadArrays() {
3007
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
3008
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
3009
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
3010
- r[k] = a[j];
3011
- return r;
3012
- }
3013
-
3014
- /**
3015
- * @method calLongestCommonSubstring
3016
- * @description 计算两个字符串的最长公共子串
3017
- * @param {String} aStr 字符串
3018
- * @param {String} bStr 字符串
3019
- * @return {Number} 长度
3020
- */
3021
-
3022
- function calLongestCommonSubstring(aStr, bStr) {
3023
- if (aStr === void 0) {
3024
- aStr = '';
3025
- }
3026
-
3027
- if (bStr === void 0) {
3028
- bStr = '';
3029
- }
3030
-
3031
- var aLen = aStr.length;
3032
- var bLen = bStr.length; // 创建二维数组并且深拷贝
3033
-
3034
- var arr = deepCopyObject(new Array(aLen).fill(new Array(bLen).fill(0)));
3035
-
3036
- for (var i = 0; i < aLen; ++i) {
3037
- for (var j = 0; j < bLen; ++j) {
3038
- if (aStr[i] === bStr[j]) {
3039
- var baseNum = 0;
3040
-
3041
- if (i > 0 && j > 0) {
3042
- baseNum = arr[i - 1][j - 1];
3043
- }
3044
-
3045
- arr[i][j] = baseNum + 1;
3046
- }
3047
- }
3048
- } // 二维数组转一维数组
3049
-
3050
-
3051
- var arr1 = Array.prototype.concat.apply([], arr); // 获取最长公共子串
3052
-
3053
- var maxLong = Math.max.apply(Math, arr1);
3054
- return maxLong;
3055
- }
3056
- /**
3057
- * @method calLongestCommonSubsequence
3058
- * @description 计算两个字符串的最长公共子序列
3059
- * @param {String} aStr 字符串
3060
- * @param {String} bStr 字符串
3061
- * @return {Number} 长度
3062
- */
3063
-
3064
- function calLongestCommonSubsequence(aStr, bStr) {
3065
- if (aStr === void 0) {
3066
- aStr = '';
3067
- }
3068
-
3069
- if (bStr === void 0) {
3070
- bStr = '';
3071
- }
3072
-
3073
- var aLen = aStr.length;
3074
- var bLen = bStr.length; // 创建二维数组并且深拷贝
3075
-
3076
- var arr = deepCopyObject(new Array(aLen).fill(new Array(bLen).fill(0)));
3077
-
3078
- for (var i = 0; i < aLen; ++i) {
3079
- for (var j = 0; j < bLen; ++j) {
3080
- if (aStr[i] === bStr[j]) {
3081
- var baseNum = 0;
3082
-
3083
- if (i > 0 && j > 0) {
3084
- baseNum = arr[i - 1][j - 1];
3085
- }
3086
-
3087
- arr[i][j] = baseNum + 1;
3088
- } else {
3089
- var _a = [0, 0],
3090
- leftValue = _a[0],
3091
- topValue = _a[1];
3092
-
3093
- if (j > 0) {
3094
- leftValue = arr[i][j - 1];
3095
- }
3096
-
3097
- if (i > 0) {
3098
- topValue = arr[i - 1][j];
3099
- }
3100
-
3101
- arr[i][j] = Math.max(leftValue, topValue);
3102
- }
3103
- }
3104
- } // 二维数组转一维数组
3105
-
3106
-
3107
- var arr1 = Array.prototype.concat.apply([], arr); // 获取最长公共子串
3108
-
3109
- var maxLong = Math.max.apply(Math, arr1);
3110
- return maxLong;
3111
- }
3112
- /**
3113
- * @method getQueryParam
3114
- * @description Get the query param's value of the current Web URL(`location.search`).
3115
- * @param {String} param Query param.
3116
- * @return {String} value
3117
- * */
3118
-
3119
- function getQueryParam(param) {
3120
- if (param === void 0) {
3121
- param = '';
3122
- }
3123
-
3124
- var reg = new RegExp('(^|&)' + param + '=([^&]*)(&|$)');
3125
- var r = location.search.substr(1).match(reg);
3126
-
3127
- if (r !== null) {
3128
- return decodeURIComponent(unescape(r[2]));
3129
- }
3130
-
3131
- return '';
3132
- }
3133
- /**
3134
- * @method getUrlParam
3135
- * @description Get the query param's value of the input URL.
3136
- * @param {String} url URL string.
3137
- * @param {String} param Query param.
3138
- * @return {String} value
3139
- * */
3140
-
3141
- function getUrlParam(url, param) {
3142
- if (url === void 0) {
3143
- url = '';
3144
- }
3145
-
3146
- if (param === void 0) {
3147
- param = '';
3148
- }
3149
-
3150
- var result = {}; // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace
3151
-
3152
- url.replace(/\??(\w+)=([^&]*)&?/g, function (a, k, v) {
3153
- if (result[k] !== undefined) {
3154
- var t = result[k];
3155
- result[k] = [].concat(t, v);
3156
- } else {
3157
- result[k] = v;
3158
- }
3159
- }); // if (param === undefined) {
3160
- // return result;
3161
- // } else {
3162
- // return result[param] || '';
3163
- // }
3164
-
3165
- return result[param] || '';
3166
- }
3167
- /**
3168
- * @method updateQueryParam
3169
- * @description Update the query param's value of the input URL.
3170
- * @param {String} url URL string.
3171
- * @param {String} param Query param.
3172
- * @param {String} value Param's value.
3173
- * @return {String} URL.
3174
- * */
3175
-
3176
- function updateQueryParam(url, param, value) {
3177
- if (url === void 0) {
3178
- url = '';
3179
- }
3180
-
3181
- if (param === void 0) {
3182
- param = '';
3183
- }
3184
-
3185
- if (value === void 0) {
3186
- value = '';
3187
- }
3188
-
3189
- var re = new RegExp('([?&])' + param + '=.*?(&|$)', 'i');
3190
- var separator = url.indexOf('?') !== -1 ? '&' : '?';
3191
-
3192
- if (url.match(re)) {
3193
- return url.replace(re, '$1' + param + '=' + value + '$2');
3194
- } else {
3195
- return url + separator + param + '=' + value;
3196
- }
3197
- }
3198
- /**
3199
- * @method getHashQueryParam
3200
- * @description Get the hash query param's value of the current Web URL(`location.hash`).
3201
- * @param {String} param Query param.
3202
- * @return {String} value
3203
- */
3204
-
3205
- function getHashQueryParam(param) {
3206
- if (param === void 0) {
3207
- param = '';
3208
- }
3209
-
3210
- var hashs = location.hash.split('?');
3211
-
3212
- if (hashs.length === 1) {
3213
- return '';
3214
- }
3215
-
3216
- var reg = new RegExp("(^|&)" + param + "=([^&]*)(&|$)");
3217
- var ret = hashs[1].match(reg);
3218
- return ret ? ret[2] : '';
3219
- }
3220
- /**
3221
- * @method getDomain
3222
- * @description Get the domain of URL, and other params.
3223
- * @param {String} url
3224
- * @param {Array} rules Object.keys(location), ['href', 'protocol', 'host', 'hostname', 'port', 'pathname', 'search', 'hash'], ['hostname', 'pathname'] = 'km.mazey.net/plugins/servlet/mobile'
3225
- * */
3226
-
3227
- function getDomain(url, rules) {
3228
- if (url === void 0) {
3229
- url = '';
3230
- }
3231
-
3232
- if (rules === void 0) {
3233
- rules = ['hostname'];
3234
- }
3235
-
3236
- var aEl = document.createElement('a');
3237
- aEl.href = url;
3238
- return rules.reduce(function (ret, v) {
3239
- ret += aEl[v];
3240
- return ret;
3241
- }, '');
3242
- }
3243
- /**
3244
- * @method camelCaseToKebabCase
3245
- * @description Transfer CamelCase to KebabCase.
3246
- * @param {String} camelCase 'aBC' or 'ABC'
3247
- * @return {String} 'a-b-c'
3248
- * */
3249
-
3250
- function camelCaseToKebabCase(camelCase) {
3251
- if (camelCase === void 0) {
3252
- camelCase = '';
3253
- }
3254
-
3255
- var kebabCase = camelCase.replace(/([A-Z])/g, '-$1').toLowerCase();
3256
- return kebabCase[0] === '-' ? kebabCase.substr(1) : kebabCase;
3257
- }
3258
- /**
3259
- * @method camelCase2Underscore
3260
- * @description Transfer CamelCase to Underscore.
3261
- * @param {String} camelCase 'aBC' or 'ABC'
3262
- * @return {String} 'a_b_c'
3263
- * */
3264
-
3265
- function camelCase2Underscore(camelCase) {
3266
- if (camelCase === void 0) {
3267
- camelCase = '';
3268
- }
3269
-
3270
- var kebabCase = camelCase.replace(/([A-Z])/g, '_$1').toLowerCase();
3271
- return kebabCase[0] === '_' ? kebabCase.substr(1) : kebabCase;
3272
- }
3273
- /**
3274
- * @method mTrim
3275
- * @description Remove leading and trailing whitespace or specified characters from string.
3276
- * @param {String} str The string to trim.
3277
- * @return {String} Trimmed string.
3278
- * */
3279
-
3280
- function mTrim(str) {
3281
- if (str === void 0) {
3282
- str = '';
3283
- }
3284
-
3285
- str = str.replace(/^\s+/, ''); // 去除头部空格
3286
-
3287
- var end = str.length - 1;
3288
- var ws = /\s/;
3289
-
3290
- while (ws.test(str.charAt(end))) {
3291
- end--; // 最后一个非空格字符的索引
3292
- }
3293
-
3294
- return str.slice(0, end + 1);
3295
- }
3296
- /**
3297
- * @method newLine
3298
- * @description Make a newline of HTML.
3299
- * @param {String} str The string to make a newline.
3300
- * @return {String} A newline with `<br />`.
3301
- * */
3302
-
3303
- function newLine(str) {
3304
- if (str === void 0) {
3305
- str = '';
3306
- }
3307
-
3308
- if (!str) {
3309
- return '';
3310
- }
3311
-
3312
- var reg = new RegExp('\\n', 'g');
3313
- return str.replace(reg, '<br />');
3314
- }
3315
- /**
3316
- * @method deepCopyObject
3317
- * @description Clone Object deeply.
3318
- * @param {Object} obj The value to clone.
3319
- * @return {Object} Returns the deep cloned value.
3320
- * */
3321
-
3322
- function deepCopyObject(obj) {
3323
- return JSON.parse(JSON.stringify(obj));
3324
- }
3325
- /**
3326
- * @method isJsonString
3327
- * @description Check whether it is a valid JSON string.
3328
- * @param {String} str The string to check.
3329
- * @return {Boolean} Return the result of checking.
3330
- * */
3331
-
3332
- function isJsonString(str) {
3333
- if (str === void 0) {
3334
- str = '';
3335
- }
3336
-
3337
- try {
3338
- if (_typeof_1(JSON.parse(str)) === 'object') {
3339
- return true;
3340
- }
3341
- } catch (e) {
3342
- /* pass */
3343
- }
3344
-
3345
- return false;
3346
- }
3347
- /**
3348
- * @method generateRndNum
3349
- * @description Produce a random string of number, `generateRndNum(7)` => '7658495'.
3350
- * @param {Number} n Length
3351
- * @return {String} Return the random string.
3352
- * */
3353
-
3354
- function generateRndNum(n) {
3355
- if (n === void 0) {
3356
- n = 5;
3357
- }
3358
-
3359
- var ret = '';
3360
-
3361
- while (n--) {
3362
- ret += Math.floor(Math.random() * 10);
3363
- }
3364
-
3365
- return ret;
3366
- }
3367
- /**
3368
- * @method generateUniqueNum
3369
- * @description 根据时间生成唯一标志的数字 mGenerateUniqueNum() => 1538324722364123。
3370
- * @param {Number} n 随机数的长度
3371
- * */
3372
-
3373
- function generateUniqueNum(n) {
3374
- if (n === void 0) {
3375
- n = 3;
3376
- }
3377
-
3378
- var _a = [mNow(), generateRndNum(n || 3)],
3379
- now = _a[0],
3380
- rnd = _a[1];
3381
- return now + rnd;
3382
- }
3383
- /**
3384
- * @method floatToPercent
3385
- * @description 浮点数转为百分比 0.2 => 20%。
3386
- * @param {Number} num 浮点数
3387
- * @param {Number} fixSize 保留几位浮点数
3388
- * */
3389
-
3390
- function floatToPercent(num, fixSize) {
3391
- if (num === void 0) {
3392
- num = 0;
3393
- }
3394
-
3395
- if (fixSize === void 0) {
3396
- fixSize = 0;
3397
- }
3398
-
3399
- var ret = '';
3400
-
3401
- if (fixSize) {
3402
- ret = (num * 100).toFixed(fixSize);
3403
- } else {
3404
- ret = String(Math.floor(num * 100));
3405
- }
3406
-
3407
- return ret + "%";
3408
- }
3409
- /**
3410
- * @method floatFixed
3411
- * @description 浮点数保留指定位。
3412
- * */
3413
-
3414
- function floatFixed(num, size) {
3415
- if (size === void 0) {
3416
- size = 0;
3417
- }
3418
-
3419
- return parseFloat(num).toFixed(size);
3420
- }
3421
- /**
3422
- * @method cancelBubble
3423
- * @description 阻止冒泡。
3424
- * */
3425
-
3426
- function cancelBubble(e) {
3427
- var ev = e || window.event;
3428
-
3429
- if (ev.stopPropagation) {
3430
- // W3C
3431
- ev.stopPropagation();
3432
- } else {
3433
- // IE
3434
- ev.cancelBubble = true;
3435
- }
3436
- }
3437
- /**
3438
- * @method hasClass
3439
- * */
3440
-
3441
- function hasClass(obj, cls) {
3442
- var oriCls = obj.className; // 获取对象的class值
3443
-
3444
- var oriClsArr = oriCls.split(/\s+/); // 分隔空格转换成数组
3445
-
3446
- for (var i = 0; i < oriClsArr.length; i++) {
3447
- if (oriClsArr[i] === cls) {
3448
- return true; // 若匹配到class则返回True
3449
- }
3450
- }
3451
-
3452
- return false; // 否则返回False
3453
- }
3454
- /**
3455
- * @method addClass
3456
- * */
3457
-
3458
- function addClass(obj, cls) {
3459
- var oriCls = obj.className;
3460
- var space = '';
3461
- var newCls = ''; // 获取对象的class值
3462
-
3463
- if (oriCls !== '') {
3464
- space = ' '; // 若原来的class不为空,跟一个空格
3465
- }
3466
-
3467
- newCls = oriCls + space + cls; // 将新的class加进去
3468
-
3469
- obj.className = newCls; // 替换新class
3470
- }
3471
- /**
3472
- * @method removeClass
3473
- * */
3474
-
3475
- function removeClass(obj, cls) {
3476
- var oriCls = obj.className;
3477
- var newCls; // 获取对象的class值
3478
-
3479
- newCls = ' ' + oriCls + ' '; // 前后加空格
3480
-
3481
- newCls = newCls.replace(/(\s+)/gi, ' '); // 将多余的空格替换成一个空格
3482
-
3483
- newCls = newCls.replace(' ' + cls + ' ', ' '); // 将加了前后空格的cls替换成空格' '
3484
-
3485
- newCls = newCls.replace(/(^\s+)|(\s+$)/g, ''); // 去掉前后空格
3486
-
3487
- obj.className = newCls;
3488
- }
3489
- /**
3490
- * @method throttle
3491
- * @description 节流。
3492
- * */
3493
-
3494
- function throttle(func, wait, options) {
3495
- // timeout: setTimeout Handle
3496
- // previous: 上次时间戳
3497
- var context = null;
3498
- var args = null;
3499
- var timeout = null;
3500
- var _a = [null, 0],
3501
- result = _a[0],
3502
- previous = _a[1];
3503
-
3504
- if (!options) {
3505
- options = {};
3506
- }
3507
-
3508
- var later = function later() {
3509
- previous = options.leading === false ? 0 : mNow();
3510
- timeout = null;
3511
- result = func.apply(context, args);
3512
-
3513
- if (!timeout) {
3514
- context = args = null;
3515
- }
3516
- };
3517
-
3518
- return function () {
3519
- var argRest = [];
3520
-
3521
- for (var _i = 0; _i < arguments.length; _i++) {
3522
- argRest[_i] = arguments[_i];
3523
- }
3524
-
3525
- var now = mNow();
3526
-
3527
- if (!previous && options.leading === false) {
3528
- previous = now;
3529
- }
3530
-
3531
- var remaining = wait - (now - previous);
3532
- context = this;
3533
- args = argRest;
3534
-
3535
- if (remaining <= 0 || remaining > wait) {
3536
- if (timeout) {
3537
- clearTimeout(timeout);
3538
- timeout = null;
3539
- }
3540
-
3541
- previous = now;
3542
- result = func.apply(context, args);
3543
-
3544
- if (!timeout) {
3545
- context = args = null;
3546
- }
3547
- } else if (!timeout && options.trailing !== false) {
3548
- timeout = setTimeout(later, remaining);
3549
- }
3550
-
3551
- return result;
3552
- };
3553
- }
3554
- /**
3555
- * @method debounce
3556
- * @description 去抖。
3557
- * */
3558
-
3559
- function debounce(func, wait, immediate) {
3560
- var context = null;
3561
- var timeout = null;
3562
- var timestamp = null;
3563
- var args = null;
3564
- var result = [null][0];
3565
-
3566
- var later = function later() {
3567
- var last = mNow() - timestamp;
3568
-
3569
- if (last < wait && last >= 0) {
3570
- timeout = setTimeout(later, wait - last);
3571
- } else {
3572
- timeout = null;
3573
-
3574
- if (!immediate) {
3575
- result = func.apply(context, args);
3576
-
3577
- if (!timeout) {
3578
- context = args = null;
3579
- }
3580
- }
3581
- }
3582
- };
3583
-
3584
- return function () {
3585
- var argRest = [];
3586
-
3587
- for (var _i = 0; _i < arguments.length; _i++) {
3588
- argRest[_i] = arguments[_i];
3589
- }
3590
-
3591
- context = this;
3592
- args = argRest;
3593
- timestamp = mNow();
3594
- var callNow = immediate && !timeout;
3595
-
3596
- if (!timeout) {
3597
- timeout = setTimeout(later, wait);
3598
- }
3599
-
3600
- if (callNow) {
3601
- result = func.apply(context, args);
3602
- context = args = null;
3603
- }
3604
-
3605
- return result;
3606
- };
3607
- }
3608
- /**
3609
- * @method friendlyInterval
3610
- * @description 获取间隔时间。
3611
- * @param {Number/Date} start 开始时间戳 1585325367122
3612
- * @param {Number/Date} end 结束时间戳 1585325367122
3613
- * @type {String} type 返回类型 d: 2(天) text: 2 天 4 时...
3614
- * @return {String/Number} 取决于 type
3615
- * */
3616
-
3617
- function friendlyInterval(_a) {
3618
- var _b = _a === void 0 ? {} : _a,
3619
- _c = _b.start,
3620
- start = _c === void 0 ? 0 : _c,
3621
- _d = _b.end,
3622
- end = _d === void 0 ? 0 : _d,
3623
- _e = _b.type,
3624
- type = _e === void 0 ? 'd' : _e;
3625
-
3626
- if (!isNumber(start)) start = new Date(start).getTime();
3627
- if (!isNumber(end)) end = new Date(end).getTime();
3628
- var t = end - start;
3629
- var ret = null;
3630
-
3631
- var _f = new Array(4).fill(0),
3632
- d = _f[0],
3633
- h = _f[1],
3634
- m = _f[2],
3635
- s = _f[3];
3636
-
3637
- if (t >= 0) {
3638
- d = Math.floor(t / 1000 / 60 / 60 / 24);
3639
- h = Math.floor(t / 1000 / 60 / 60);
3640
- m = Math.floor(t / 1000 / 60);
3641
- s = Math.floor(t / 1000);
3642
-
3643
- switch (type) {
3644
- case 'd':
3645
- ret = d;
3646
- break;
3647
-
3648
- case 'text':
3649
- d = Math.floor(t / 1000 / 60 / 60 / 24);
3650
- h = Math.floor(t / 1000 / 60 / 60 % 24);
3651
- m = Math.floor(t / 1000 / 60 % 60);
3652
- s = Math.floor(t / 1000 % 60);
3653
- ret = d + ' 天 ' + h + ' 时 ' + m + ' 分 ' + s + ' 秒';
3654
- break;
3655
-
3656
- default:
3657
- ret = s;
3658
- }
3659
- }
3660
-
3661
- return ret;
3662
- }
3663
- /**
3664
- * @method isNumber
3665
- * @description 判断是否有效数字
3666
- * @param {*} num 被判断的值
3667
- * @param {Boolean} isNaNAsNumber 是否 NaN 算数字(默认不算)
3668
- * @param {Boolean} isUnFiniteAsNumber 是否 无限 算数字(默认不算)
3669
- * @return {Boolean} true 是数字
3670
- */
3671
-
3672
- function isNumber(num, _a) {
3673
- var _b = _a === void 0 ? {} : _a,
3674
- _c = _b.isNaNAsNumber,
3675
- isNaNAsNumber = _c === void 0 ? false : _c,
3676
- _d = _b.isUnFiniteAsNumber,
3677
- isUnFiniteAsNumber = _d === void 0 ? false : _d;
3678
-
3679
- var ret = true; // 数字类型
3680
-
3681
- if (typeof num !== 'number') {
3682
- ret = false;
3683
- } // 无限值
3684
-
3685
-
3686
- if (isUnFiniteAsNumber === false && !isFinite(num)) {
3687
- // console.log('1333');
3688
- ret = false;
3689
- } // NaN
3690
-
3691
-
3692
- if (isNaNAsNumber === false && isNaN(num)) {
3693
- // console.log('2333');
3694
- ret = false;
3695
- }
3696
-
3697
- return ret;
3698
- }
3699
- /**
3700
- * @method doFn
3701
- * @description 执行有效函数
3702
- * @param {Function} fn 等待被执行的未知是否有效的函数
3703
- * */
3704
-
3705
- function doFn(fn) {
3706
- var params = [];
3707
-
3708
- for (var _i = 1; _i < arguments.length; _i++) {
3709
- params[_i - 1] = arguments[_i];
3710
- }
3711
-
3712
- var ret = null;
3713
-
3714
- if (fn && typeof fn === 'function') {
3715
- ret = fn.apply(void 0, params);
3716
- }
3717
-
3718
- return ret;
3719
- }
3720
- /**
3721
- * @method setSessionStorage
3722
- * @description 存储数据到 sessionStorage
3723
- * @param {String} key 键
3724
- * @param {String} value 值
3725
- * */
3726
-
3727
- function setSessionStorage(key, value) {
3728
- if (value === void 0) {
3729
- value = null;
3730
- }
3731
-
3732
- if (key) {
3733
- sessionStorage.setItem(key, JSON.stringify(value));
3734
- }
3735
- }
3736
- /**
3737
- * @method getSessionStorage
3738
- * @description 存储数据到 sessionStorage
3739
- * @param {String} key 键
3740
- * @return {*} 返回值
3741
- * */
3742
-
3743
- function getSessionStorage(key) {
3744
- var ret = null;
3745
-
3746
- if (key) {
3747
- var value = sessionStorage.getItem(key);
3748
-
3749
- if (value) {
3750
- ret = JSON.parse(value);
3751
- }
3752
- }
3753
-
3754
- return ret;
3755
- }
3756
- /**
3757
- * @method setLocalStorage
3758
- * @description 存储数据到 localStorage
3759
- * @param {String} key 键
3760
- * @param {String} value 值
3761
- * */
3762
-
3763
- function setLocalStorage(key, value) {
3764
- if (value === void 0) {
3765
- value = null;
3766
- }
3767
-
3768
- if (key) {
3769
- localStorage.setItem(key, JSON.stringify(value));
3770
- }
3771
- }
3772
- /**
3773
- * @method getLocalStorage
3774
- * @description 存储数据到 localStorage
3775
- * @param {String} key 键
3776
- * @return {*} 返回值
3777
- * */
3778
-
3779
- function getLocalStorage(key) {
3780
- var ret = null;
3781
-
3782
- if (key) {
3783
- var value = localStorage.getItem(key);
3784
-
3785
- if (value) {
3786
- ret = JSON.parse(value);
3787
- }
3788
- }
3789
-
3790
- return ret;
3791
- }
3792
- /**
3793
- * @method loadCSS
3794
- * @description 动态加载css文件
3795
- * @param {String} url -- css资源路径
3796
- * @param {String} id -- link标签id
3797
- * @return {Promise<Boolean>} true -- 加载成功
3798
- */
3799
-
3800
- function loadCSS(_a) {
3801
- var _b = _a === void 0 ? {} : _a,
3802
- _c = _b.url,
3803
- url = _c === void 0 ? '' : _c,
3804
- _d = _b.id,
3805
- id = _d === void 0 ? '' : _d;
3806
-
3807
- var success = null;
3808
- var fail = null;
3809
- var status = new Promise(function (resolve, reject) {
3810
- var _a;
3811
-
3812
- _a = [resolve, reject], success = _a[0], fail = _a[1];
3813
- }); // const tempCB = (typeof callback === 'function' ? callback : function () { });
3814
-
3815
- var callback = function callback() {
3816
- doFn(success, true);
3817
- };
3818
-
3819
- var node = document.createElement('link');
3820
- var supportOnload = ('onload' in node);
3821
- var isOldWebKit = +navigator.userAgent.replace(/.*(?:AppleWebKit|AndroidWebKit)\/?(\d+).*/i, '$1') < 536; // webkit旧内核做特殊处理
3822
-
3823
- var protectNum = 300000; // 阈值10分钟,一秒钟执行pollCss 500次
3824
-
3825
- node.rel = 'stylesheet';
3826
- node.type = 'text/css';
3827
- node.href = url;
3828
-
3829
- if (typeof id !== 'undefined') {
3830
- node.id = id;
3831
- }
3832
-
3833
- document.getElementsByTagName('head')[0].appendChild(node); // for Old WebKit and Old Firefox
3834
-
3835
- if (isOldWebKit || !supportOnload) {
3836
- // Begin after node insertion
3837
- setTimeout(function () {
3838
- pollCss(node, callback, 0);
3839
- }, 1);
3840
- return status;
3841
- }
3842
-
3843
- if (supportOnload) {
3844
- node.onload = onload;
3845
-
3846
- node.onerror = function () {
3847
- // 加载失败(404)
3848
- onload();
3849
- };
3850
- } else {
3851
- // todo: 和 !supportOnload 重复
3852
- node.onreadystatechange = function () {
3853
- if (/loaded|complete/.test(node.readyState)) {
3854
- onload();
3855
- }
3856
- };
3857
- }
3858
-
3859
- function onload() {
3860
- // 确保只跑一次下载操作
3861
- node.onload = node.onerror = node.onreadystatechange = null; // 清空node引用,在低版本IE,不清除会造成内存泄露
3862
-
3863
- node = null;
3864
- callback();
3865
- } // 循环判断css是否已加载成功
3866
-
3867
- /*
3868
- * @param node -- link节点
3869
- * @param callback -- 回调函数
3870
- * @param step -- 计步器,避免无限循环
3871
- */
3872
-
3873
-
3874
- function pollCss(node, callback, step) {
3875
- var sheet = node.sheet;
3876
- var isLoaded;
3877
- step += 1; // 保护,大于10分钟,则不再轮询
3878
-
3879
- if (step > protectNum) {
3880
- isLoaded = true; // 清空node引用
3881
-
3882
- node = null;
3883
- callback();
3884
- return;
3885
- }
3886
-
3887
- if (isOldWebKit) {
3888
- // for WebKit < 536
3889
- if (sheet) {
3890
- isLoaded = true;
3891
- }
3892
- } else if (sheet) {
3893
- // for Firefox < 9.0
3894
- try {
3895
- if (sheet.cssRules) {
3896
- isLoaded = true;
3897
- }
3898
- } catch (ex) {
3899
- // 火狐特殊版本,通过特定值获知是否下载成功
3900
- // The value of `ex.name` is changed from "NS_ERROR_DOM_SECURITY_ERR"
3901
- // to "SecurityError" since Firefox 13.0. But Firefox is less than 9.0
3902
- // in here, So it is ok to just rely on "NS_ERROR_DOM_SECURITY_ERR"
3903
- if (ex.name === 'NS_ERROR_DOM_SECURITY_ERR') {
3904
- isLoaded = true;
3905
- }
3906
- }
3907
- }
3908
-
3909
- setTimeout(function () {
3910
- if (isLoaded) {
3911
- // 延迟20ms是为了给下载的样式留够渲染的时间
3912
- callback();
3913
- } else {
3914
- pollCss(node, callback, step);
3915
- }
3916
- }, 20);
3917
- }
3918
-
3919
- return status;
3920
- }
3921
- /**
3922
- * @method loadScript
3923
- * @description 动态加载js文件
3924
- * @param {String} url -- js资源路径
3925
- * @param {String} id -- DOM ID
3926
- * @param {Function} callback -- 加载后回调函数
3927
- * @param {Number} timeout -- 超时时长
3928
- * @param {Boolean} isDefer -- 是否添加 defer 标签
3929
- * @return {Promise<Boolean>} -- true 成功
3930
- */
3931
-
3932
- function loadScript(_a) {
3933
- var _b = _a === void 0 ? {} : _a,
3934
- _c = _b.url,
3935
- url = _c === void 0 ? '' : _c,
3936
- _d = _b.id,
3937
- id = _d === void 0 ? '' : _d,
3938
- _e = _b.callback,
3939
- callback = _e === void 0 ? function () {} : _e,
3940
- _f = _b.timeout,
3941
- timeout = _f === void 0 ? 5000 : _f,
3942
- _g = _b.isDefer,
3943
- isDefer = _g === void 0 ? false : _g;
3944
-
3945
- var success = null;
3946
- var fail = null;
3947
- var script = document.createElement('script'); // 如果没有 script 标签,那么代码就不会运行。可以利用这一事实,在页面的第一个 script 标签上使用 insertBefore()。
3948
-
3949
- var firstScript = document.getElementsByTagName('script')[0];
3950
- script.type = 'text/javascript';
3951
-
3952
- if (isDefer) {
3953
- script.defer = 'defer';
3954
- }
3955
-
3956
- if (id) {
3957
- script.id = id;
3958
- }
3959
-
3960
- if (script.readyState) {
3961
- // IE
3962
- script.onreadystatechange = function () {
3963
- if (script.readyState === 'loaded' || script.readyState === 'complete') {
3964
- script.onreadystatechange = null;
3965
- doFn(callback);
3966
- doFn(success, true);
3967
- }
3968
- };
3969
- } else {
3970
- // Others
3971
- script.onload = function () {
3972
- doFn(callback);
3973
- doFn(success, true);
3974
- };
3975
- }
3976
-
3977
- script.src = url;
3978
- firstScript && firstScript.parentNode.insertBefore(script, firstScript);
3979
- return new Promise(function (resolve, reject) {
3980
- var _a;
3981
-
3982
- _a = [resolve, reject], success = _a[0], fail = _a[1];
3983
-
3984
- if (timeout) {
3985
- setTimeout(fail.bind(null, 'timeout'), timeout);
3986
- }
3987
- });
3988
- }
3989
- /**
3990
- * @method mNow
3991
- * @description 获取时间戳
3992
- */
3993
-
3994
- function mNow() {
3995
- var ret = 0;
3996
-
3997
- if (Date.now) {
3998
- ret = Date.now();
3999
- } else {
4000
- ret = new Date().getTime();
4001
- }
4002
-
4003
- return ret;
4004
- }
4005
- /**
4006
- * @method setCookie
4007
- * @description 设置 Cookie
4008
- */
4009
-
4010
- function setCookie(name, value, days, domain) {
4011
- var domainParts, expires;
4012
- var date;
4013
-
4014
- if (days) {
4015
- date = new Date();
4016
- date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
4017
- expires = "; expires=" + date.toGMTString();
4018
- } else {
4019
- expires = "";
4020
- }
4021
-
4022
- var host = location.host;
4023
-
4024
- if (host.split('.').length === 1) {
4025
- // no "." in a domain - it's localhost or something similar
4026
- document.cookie = name + "=" + value + expires + "; path=/";
4027
- } else {
4028
- // Remember the cookie on all subdomains.
4029
- //
4030
- // Start with trying to set cookie to the top domain.
4031
- // (example: if user is on foo.com, try to set
4032
- // cookie to domain ".com")
4033
- //
4034
- // If the cookie will not be set, it means ".com"
4035
- // is a top level domain and we need to
4036
- // set the cookie to ".foo.com"
4037
- domainParts = host.split('.');
4038
- domainParts.shift();
4039
- domain = domain || '.' + domainParts.join('.');
4040
- document.cookie = name + "=" + value + expires + "; path=/; domain=" + domain; // check if cookie was successfuly set to the given domain
4041
- // (otherwise it was a Top-Level Domain)
4042
-
4043
- if (getCookie(name) === null || getCookie(name) !== value) {
4044
- // append "." to current domain
4045
- domain = domain || '.' + host;
4046
- document.cookie = name + "=" + value + expires + "; path=/; domain=" + domain;
4047
- }
4048
- }
4049
- }
4050
- /**
4051
- * @method getCookie
4052
- * @description 获取 Cookie
4053
- */
4054
-
4055
- function getCookie(name) {
4056
- var nameEQ = name + "=";
4057
- var ca = document.cookie.split(';');
4058
-
4059
- for (var i = 0; i < ca.length; i++) {
4060
- var c = ca[i];
4061
-
4062
- while (c.charAt(0) == ' ') {
4063
- c = c.substring(1, c.length);
4064
- }
4065
-
4066
- if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
4067
- }
4068
-
4069
- return '';
4070
- }
4071
- /**
4072
- * @method getPerformance
4073
- * @description 获取页面加载相关的各项数据
4074
- * @param {Boolean} camelCase -- true(默认) 以驼峰形式返回数据 false 以下划线形式返回数据
4075
- * @return {Promise<Object>} 加载数据
4076
- */
4077
-
4078
- function getPerformance(_a) {
4079
- var _b = (_a === void 0 ? {} : _a).camelCase,
4080
- camelCase = _b === void 0 ? true : _b;
4081
- var success;
4082
- var fail;
4083
- var status = new Promise(function (resolve, reject) {
4084
- var _a;
4085
-
4086
- _a = [resolve, reject], success = _a[0], fail = _a[1];
4087
- });
4088
- var timing = window.performance.timing;
4089
- var startTime = timing.navigationStart || timing.fetchStart;
4090
- var firstPaintTime;
4091
- var firstContentfulPaintTime; // 是否已经形成数据(页面加载完成之后)
4092
-
4093
- if (window.performance && window.performance.timing && window.performance.timing.loadEventEnd > 0) {
4094
- // console.log('created')
4095
- getTiming();
4096
- } else {
4097
- // console.log('creating')
4098
- window.addEventListener("load", function () {
4099
- //不能影响最后的时间计算
4100
- window.setTimeout(function () {
4101
- getTiming();
4102
- }, 0);
4103
- });
4104
- } // performance
4105
-
4106
-
4107
- function getTiming() {
4108
- // 获取首次渲染时间
4109
- try {
4110
- if (window.performance && Boolean(window.performance.getEntriesByType)) {
4111
- var performance_1 = window.performance;
4112
- var performanceEntries = performance_1.getEntriesByType('paint');
4113
- performanceEntries.forEach(function (performanceEntry, i, entries) {
4114
- var startTime = Math.round(performanceEntry.startTime);
4115
- if (performanceEntry.name === 'first-paint') firstPaintTime = startTime;else if (performanceEntry.name === 'first-contentful-paint') firstContentfulPaintTime = startTime;
4116
- });
4117
- } else {
4118
- console.error('paint');
4119
- }
4120
- } catch (e) {
4121
- console.error(e.message);
4122
- } // 获取加载时间
4123
-
4124
-
4125
- if (window.performance && typeof window.performance.getEntries === 'function') {
4126
- var performanceNavigationTiming = (window.performance.getEntries() || [])[0] || {};
4127
- var data_1 = {
4128
- // url: encodeURI(location.href),
4129
- // ua: navigator.userAgent,
4130
- os: getOS(),
4131
- osVersion: getOSVersion(),
4132
- deviceType: getDeviceType(),
4133
- network: getNetWork(),
4134
- screenDirection: getOrientationStatu(),
4135
- unloadTime: timing.unloadEventEnd - timing.unloadEventStart,
4136
- redirectTime: timing.redirectEnd - timing.redirectStart,
4137
- dnsTime: timing.domainLookupEnd - timing.domainLookupStart,
4138
- tcpTime: timing.connectEnd - timing.connectStart,
4139
- sslTime: getSSLTime(timing.connectEnd, timing.secureConnectionStart),
4140
- responseTime: timing.responseStart - timing.requestStart,
4141
- downloadTime: timing.responseEnd - timing.responseStart,
4142
- firstPaintTime: firstPaintTime,
4143
- firstContentfulPaintTime: firstContentfulPaintTime,
4144
- domreadyTime: timing.domContentLoadedEventStart - startTime || 0,
4145
- onloadTime: timing.loadEventStart - startTime || 0,
4146
- whiteTime: timing.responseStart - startTime,
4147
- renderTime: timing.loadEventEnd - startTime || 0,
4148
- decodedBodySize: performanceNavigationTiming.decodedBodySize || '',
4149
- encodedBodySize: performanceNavigationTiming.encodedBodySize || ''
4150
- }; // 过滤异常数据
4151
-
4152
- Object.keys(data_1).forEach(function (k) {
4153
- // 过滤掉 <0 的数据
4154
- if (isNumber(data_1[k]) && data_1[k] < 0) {
4155
- data_1[k] = 0;
4156
- }
4157
- }); // 过滤掉白屏时间 > onload 的数据
4158
-
4159
- if (isNumber(data_1.whiteTime) && data_1.whiteTime > data_1.onloadTime) {
4160
- data_1.whiteTime = 0;
4161
- }
4162
-
4163
- if (startTime > 0) {
4164
- var Underscore_1;
4165
-
4166
- if (!camelCase) {
4167
- Object.keys(data_1).forEach(function (k) {
4168
- if (!Underscore_1) Underscore_1 = {}; // console.log('camelCase2Underscore', k, data, )
4169
-
4170
- Underscore_1[camelCase2Underscore(k)] = data_1[k];
4171
- });
4172
- }
4173
-
4174
- success(Underscore_1 || data_1);
4175
- } else {
4176
- fail('startTime');
4177
- }
4178
- } else {
4179
- fail('getEntries');
4180
- }
4181
- } //获取当前操作系统
4182
-
4183
-
4184
- function getOS() {
4185
- var os;
4186
-
4187
- if (navigator.userAgent.indexOf('Android') > -1 || navigator.userAgent.indexOf('Linux') > -1) {
4188
- os = 'android';
4189
- } else if (navigator.userAgent.indexOf('iPhone') > -1) {
4190
- os = 'ios';
4191
- } else if (navigator.userAgent.indexOf('Windows Phone') > -1) {
4192
- os = 'wp';
4193
- } else {
4194
- os = 'others';
4195
- }
4196
-
4197
- return os;
4198
- } // 获取操作系统版本
4199
-
4200
-
4201
- function getOSVersion() {
4202
- var OSVision;
4203
- var u = navigator.userAgent;
4204
- var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //Android
4205
-
4206
- var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
4207
-
4208
- if (isAndroid) {
4209
- OSVision = (navigator.userAgent.split(';')[1].match(/\d+\.\d+/g) || [])[0];
4210
- }
4211
-
4212
- if (isIOS) {
4213
- OSVision = (navigator.userAgent.split(';')[1].match(/(\d+)_(\d+)_?(\d+)?/) || [])[0];
4214
- }
4215
-
4216
- return OSVision;
4217
- } //获取设备类型
4218
-
4219
-
4220
- function getDeviceType() {
4221
- var deviceType;
4222
- var sUserAgent = navigator.userAgent.toLowerCase();
4223
- var bIsIpad = sUserAgent.match(/(ipad)/i) && 'ipad';
4224
- var bIsIphoneOs = sUserAgent.match(/iphone os/i) && 'iphone os';
4225
- var bIsMidp = sUserAgent.match(/midp/i) && 'midp';
4226
- var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) && 'rv:1.2.3.4';
4227
- var bIsUc = sUserAgent.match(/ucweb/i) && 'ucweb';
4228
- var bIsAndroid = sUserAgent.match(/android/i) && 'android';
4229
- var bIsCE = sUserAgent.match(/windows ce/i) && 'windows ce';
4230
- var bIsWM = sUserAgent.match(/windows mobile/i) && 'windows mobile';
4231
-
4232
- if (!(bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM)) {
4233
- deviceType = 'pc'; //pc
4234
- } else if (bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {
4235
- deviceType = 'phone'; //phone
4236
- } else if (bIsIpad) {
4237
- deviceType = 'ipad'; //ipad
4238
- } else {
4239
- deviceType = undefined;
4240
- }
4241
-
4242
- return deviceType;
4243
- } // 获取网络状态
4244
-
4245
-
4246
- function getNetWork() {
4247
- var netWork;
4248
-
4249
- if (navigator.connection && navigator.connection.effectiveType) {
4250
- switch (navigator.connection.effectiveType) {
4251
- case 'wifi':
4252
- netWork = 'wifi'; // wifi
4253
-
4254
- break;
4255
-
4256
- case '4g':
4257
- netWork = '4g'; // 4g
4258
-
4259
- break;
4260
-
4261
- case '2g':
4262
- netWork = '2g'; // 2g
4263
-
4264
- break;
4265
-
4266
- case '3g':
4267
- netWork = '3g'; // 3g
4268
-
4269
- break;
4270
-
4271
- case 'ethernet':
4272
- netWork = 'ethernet'; // ethernet
4273
-
4274
- break;
4275
-
4276
- case 'default':
4277
- netWork = undefined; // 未知
4278
-
4279
- break;
4280
- }
4281
- }
4282
-
4283
- return netWork;
4284
- } // 获取横竖屏状态
4285
-
4286
-
4287
- function getOrientationStatu() {
4288
- var orientationStatu;
4289
-
4290
- if (window.screen && window.screen.orientation && window.screen.orientation.angle) {
4291
- if (window.screen.orientation.angle === 180 || window.screen.orientation.angle === 0) {
4292
- // 竖屏
4293
- orientationStatu = '|';
4294
- }
4295
-
4296
- if (window.screen.orientation.angle === 90 || window.screen.orientation.angle === -90) {
4297
- // 横屏
4298
- orientationStatu = '-';
4299
- }
4300
- }
4301
-
4302
- return orientationStatu;
4303
- } // 获取ssl连接时间
4304
-
4305
-
4306
- function getSSLTime(connectEnd, secureConnectionStart) {
4307
- var ssl_time;
4308
-
4309
- if (secureConnectionStart) {
4310
- ssl_time = connectEnd - secureConnectionStart;
4311
- }
4312
-
4313
- return ssl_time;
4314
- }
4315
-
4316
- return status;
4317
- }
4318
- /**
4319
- * @method inRate
4320
- * @description 百分位概率
4321
- * @param {Number} rate -- 0.1 ~ 1 => 1% ~ 100%
4322
- * @return {Boolean} true 命中
4323
- */
4324
-
4325
- function inRate(rate) {
4326
- if (Math.random() < rate) {
4327
- return true;
4328
- }
4329
-
4330
- return false;
4331
- }
4332
- /**
4333
- * @method isSafePWAEnv
4334
- * @description 判断是否是安全的 PWA 环境
4335
- * @return {Boolean} true 是
4336
- */
4337
-
4338
- function isSafePWAEnv() {
4339
- // 判断是否支持 async await
4340
- function isSupportAsyncAwait() {
4341
- var isSupportAsyncAwaitFunc;
4342
-
4343
- try {
4344
- // eval("func = async function(){};");
4345
- var fn = new Function("return async function(){};");
4346
- isSupportAsyncAwaitFunc = fn(); // console.log('isSupportAsyncAwaitFunc', isSupportAsyncAwaitFunc);
4347
- // 由于async函数的构造器不是全局对象,所以我们需要由下面代码来获取async函数的构造器
4348
- // 具体可以查看以下MDN上有关于AsyncFunction的说明,
4349
- // 地址:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AsyncFunction
4350
-
4351
- return Object.getPrototypeOf(isSupportAsyncAwaitFunc).constructor != null;
4352
- } catch (e) {
4353
- return false;
4354
- }
4355
- } // 判断是否支持 Promise
4356
-
4357
-
4358
- function isSupportPromise() {
4359
- if (typeof Promise !== "undefined" && Promise.toString().indexOf("[native code]") !== -1) {
4360
- return true;
4361
- }
4362
-
4363
- return false;
4364
- } // 浏览器信息
4365
-
4366
-
4367
- var BrowserType = getBrowserType();
4368
-
4369
- if ('serviceWorker' in navigator && isSupportAsyncAwait() && isSupportPromise() && Boolean(window.fetch) && Boolean(window.indexedDB) && Boolean(window.caches) && !BrowserType['shell']) {
4370
- return true;
4371
- }
4372
-
4373
- return false;
4374
- }
4375
- /**
4376
- * @method getBrowserType
4377
- * @description 返回浏览器信息 https://github.com/JowayYoung/juejin-code/blob/master/browser-type.js
4378
- * @return {Object} 浏览器信息
4379
- */
4380
-
4381
- function getBrowserType() {
4382
- try {
4383
- // 权重:系统 + 系统版本 > 平台 > 内核 + 载体 + 内核版本 + 载体版本 > 外壳 + 外壳版本
4384
- var ua_1 = navigator.userAgent.toLowerCase();
4385
-
4386
- var testUa = function testUa(regexp) {
4387
- return regexp.test(ua_1);
4388
- };
4389
-
4390
- var testVs = function testVs(regexp) {
4391
- return ua_1.match(regexp).toString().replace(/[^0-9|_.]/g, "").replace(/_/g, ".");
4392
- }; // 系统
4393
-
4394
-
4395
- var system = "unknow";
4396
-
4397
- if (testUa(/windows|win32|win64|wow32|wow64/g)) {
4398
- system = "windows"; // windows系统
4399
- } else if (testUa(/macintosh|macintel/g)) {
4400
- system = "macos"; // macos系统
4401
- } else if (testUa(/x11/g)) {
4402
- system = "linux"; // linux系统
4403
- } else if (testUa(/android|adr/g)) {
4404
- system = "android"; // android系统
4405
- } else if (testUa(/ios|iphone|ipad|ipod|iwatch/g)) {
4406
- system = "ios"; // ios系统
4407
- } // 系统版本
4408
-
4409
-
4410
- var systemVs = "unknow";
4411
-
4412
- if (system === "windows") {
4413
- if (testUa(/windows nt 5.0|windows 2000/g)) {
4414
- systemVs = "2000";
4415
- } else if (testUa(/windows nt 5.1|windows xp/g)) {
4416
- systemVs = "xp";
4417
- } else if (testUa(/windows nt 5.2|windows 2003/g)) {
4418
- systemVs = "2003";
4419
- } else if (testUa(/windows nt 6.0|windows vista/g)) {
4420
- systemVs = "vista";
4421
- } else if (testUa(/windows nt 6.1|windows 7/g)) {
4422
- systemVs = "7";
4423
- } else if (testUa(/windows nt 6.2|windows 8/g)) {
4424
- systemVs = "8";
4425
- } else if (testUa(/windows nt 6.3|windows 8.1/g)) {
4426
- systemVs = "8.1";
4427
- } else if (testUa(/windows nt 10.0|windows 10/g)) {
4428
- systemVs = "10";
4429
- }
4430
- } else if (system === "macos") {
4431
- systemVs = testVs(/os x [\d._]+/g);
4432
- } else if (system === "android") {
4433
- systemVs = testVs(/android [\d._]+/g);
4434
- } else if (system === "ios") {
4435
- systemVs = testVs(/os [\d._]+/g);
4436
- } // 平台
4437
-
4438
-
4439
- var platform = "unknow";
4440
-
4441
- if (system === "windows" || system === "macos" || system === "linux") {
4442
- platform = "desktop"; // 桌面端
4443
- } else if (system === "android" || system === "ios" || testUa(/mobile/g)) {
4444
- platform = "mobile"; // 移动端
4445
- } // 内核和载体
4446
-
4447
-
4448
- var engine = "unknow";
4449
- var supporter = "unknow";
4450
-
4451
- if (testUa(/applewebkit/g)) {
4452
- engine = "webkit"; // webkit内核
4453
-
4454
- if (testUa(/edge/g)) {
4455
- supporter = "edge"; // edge浏览器
4456
- } else if (testUa(/opr/g)) {
4457
- supporter = "opera"; // opera浏览器
4458
- } else if (testUa(/chrome/g)) {
4459
- supporter = "chrome"; // chrome浏览器
4460
- } else if (testUa(/safari/g)) {
4461
- supporter = "safari"; // safari浏览器
4462
- }
4463
- } else if (testUa(/gecko/g) && testUa(/firefox/g)) {
4464
- engine = "gecko"; // gecko内核
4465
-
4466
- supporter = "firefox"; // firefox浏览器
4467
- } else if (testUa(/presto/g)) {
4468
- engine = "presto"; // presto内核
4469
-
4470
- supporter = "opera"; // opera浏览器
4471
- } else if (testUa(/trident|compatible|msie/g)) {
4472
- engine = "trident"; // trident内核
4473
-
4474
- supporter = "iexplore"; // iexplore浏览器
4475
- } // 内核版本
4476
-
4477
-
4478
- var engineVs = "unknow";
4479
-
4480
- if (engine === "webkit") {
4481
- engineVs = testVs(/applewebkit\/[\d._]+/g);
4482
- } else if (engine === "gecko") {
4483
- engineVs = testVs(/gecko\/[\d._]+/g);
4484
- } else if (engine === "presto") {
4485
- engineVs = testVs(/presto\/[\d._]+/g);
4486
- } else if (engine === "trident") {
4487
- engineVs = testVs(/trident\/[\d._]+/g);
4488
- } // 载体版本
4489
-
4490
-
4491
- var supporterVs = "unknow";
4492
-
4493
- if (supporter === "chrome") {
4494
- supporterVs = testVs(/chrome\/[\d._]+/g);
4495
- } else if (supporter === "safari") {
4496
- supporterVs = testVs(/version\/[\d._]+/g);
4497
- } else if (supporter === "firefox") {
4498
- supporterVs = testVs(/firefox\/[\d._]+/g);
4499
- } else if (supporter === "opera") {
4500
- supporterVs = testVs(/opr\/[\d._]+/g);
4501
- } else if (supporter === "iexplore") {
4502
- supporterVs = testVs(/(msie [\d._]+)|(rv:[\d._]+)/g);
4503
- } else if (supporter === "edge") {
4504
- supporterVs = testVs(/edge\/[\d._]+/g);
4505
- } // 外壳和外壳版本
4506
-
4507
-
4508
- var shell = "none";
4509
- var shellVs = "unknow";
4510
-
4511
- if (testUa(/micromessenger/g)) {
4512
- shell = "wechat"; // 微信浏览器
4513
-
4514
- shellVs = testVs(/micromessenger\/[\d._]+/g);
4515
- } else if (testUa(/qqbrowser/g)) {
4516
- shell = "qq"; // QQ浏览器
4517
-
4518
- shellVs = testVs(/qqbrowser\/[\d._]+/g);
4519
- } else if (testUa(/ucbrowser/g)) {
4520
- shell = "uc"; // UC浏览器
4521
-
4522
- shellVs = testVs(/ucbrowser\/[\d._]+/g);
4523
- } else if (testUa(/qihu 360se/g)) {
4524
- shell = "360"; // 360浏览器(无版本)
4525
- } else if (testUa(/2345explorer/g)) {
4526
- shell = "2345"; // 2345浏览器
4527
-
4528
- shellVs = testVs(/2345explorer\/[\d._]+/g);
4529
- } else if (testUa(/metasr/g)) {
4530
- shell = "sougou"; // 搜狗浏览器(无版本)
4531
- } else if (testUa(/lbbrowser/g)) {
4532
- shell = "liebao"; // 猎豹浏览器(无版本)
4533
- } else if (testUa(/maxthon/g)) {
4534
- shell = "maxthon"; // 遨游浏览器
4535
-
4536
- shellVs = testVs(/maxthon\/[\d._]+/g);
4537
- }
4538
-
4539
- return Object.assign({
4540
- engine: engine,
4541
- engineVs: engineVs,
4542
- platform: platform,
4543
- supporter: supporter,
4544
- supporterVs: supporterVs,
4545
- system: system,
4546
- systemVs: systemVs
4547
- }, shell === "none" ? {} : {
4548
- shell: shell,
4549
- shellVs: shellVs
4550
- });
4551
- } catch (err) {
4552
- return {};
4553
- }
4554
- }
4555
- /**
4556
- * @method clearHtml
4557
- * @description 去除HTML标签
4558
- * @param {String} string 带html标签的字符串
4559
- * @return {String} 字符串
4560
- */
4561
-
4562
- function clearHtml(string) {
4563
- if (string === void 0) {
4564
- string = '';
4565
- }
4566
-
4567
- return string.replace(/<\/?.+?>/g, '').replace(/[\r\n]/g, '');
4568
- }
4569
- /**
4570
- * @method cutCHSString
4571
- * @description 截取字符串,中文算2个字节
4572
- * @param {String} str 要截取的字符串
4573
- * @param {Number} len
4574
- * @param {Boolean} hasDot
4575
- * @returns {String} 返回截取后的字符串
4576
- */
4577
-
4578
- function cutCHSString(str, len, hasDot) {
4579
- if (str === void 0) {
4580
- str = '';
4581
- }
4582
-
4583
- if (len === void 0) {
4584
- len = str.length;
4585
- }
4586
-
4587
- if (hasDot === void 0) {
4588
- hasDot = false;
4589
- }
4590
-
4591
- if (str == '' || !str) {
4592
- return '';
4593
- } else {
4594
- var newLength = 0;
4595
- var newStr = ''; // eslint-disable-next-line no-control-regex
4596
-
4597
- var chineseRegex = /[^\x00-\xff]/g;
4598
- var singleChar = '';
4599
- var strLength = str.replace(chineseRegex, '**').length;
4600
-
4601
- for (var i = 0; i < strLength; i++) {
4602
- singleChar = str.charAt(i).toString();
4603
-
4604
- if (singleChar.match(chineseRegex) != null) {
4605
- newLength += 2;
4606
- } else {
4607
- newLength++;
4608
- }
4609
-
4610
- if (newLength > len) {
4611
- break;
4612
- }
4613
-
4614
- newStr += singleChar;
4615
- }
4616
-
4617
- if (hasDot && strLength > len) {
4618
- newStr += '...';
4619
- }
4620
-
4621
- return newStr;
4622
- }
4623
- }
4624
- /**
4625
- * @method windowLoaded
4626
- * @description 页面加载完成
4627
- * @param {Number} timeout 超时时间 / 单位:秒
4628
- * @return {Promise<string>} document is loaded? 'complete' 'load' / 'timeout'
4629
- */
4630
-
4631
- function windowLoaded(_a) {
4632
- var _b = (_a === void 0 ? {} : _a).timeout,
4633
- timeout = _b === void 0 ? 90 : _b;
4634
-
4635
- var loaded = function loaded() {
4636
- return undefined;
4637
- };
4638
-
4639
- var loadFail = function loadFail() {
4640
- return undefined;
4641
- };
4642
-
4643
- var status = new Promise(function (resolve, reject) {
4644
- loaded = resolve;
4645
- loadFail = reject;
4646
- });
4647
-
4648
- if (document.readyState === 'complete') {
4649
- loaded('complete');
4650
- } else {
4651
- window.addEventListener('load', function () {
4652
- return loaded('load');
4653
- });
4654
- } // 超过 timeout 秒后加载失败
4655
-
4656
-
4657
- setTimeout(function () {
4658
- return loadFail('timeout');
4659
- }, timeout * 1000);
4660
- return status;
4661
- }
4662
- /**
4663
- * @method addInlineStyle
4664
- * @description 添加内联样式
4665
- * @param {String} inlineStyle 内联样式字符串
4666
- * @param {String} id <style> 标签的 ID
4667
- * @return {Boolean} 添加成功/失败
4668
- */
4669
-
4670
- function addInlineStyle(_a) {
4671
- var _b = _a === void 0 ? {} : _a,
4672
- _c = _b.inlineStyle,
4673
- inlineStyle = _c === void 0 ? '' : _c,
4674
- _d = _b.id,
4675
- id = _d === void 0 ? '' : _d;
4676
-
4677
- if (!inlineStyle) {
4678
- return false;
4679
- } // 创建 style 文档碎片
4680
-
4681
-
4682
- var styleFrag = document.createDocumentFragment();
4683
- var idDom = null;
4684
- var domId = ''; // Custom Style
4685
-
4686
- var customStyle = document.createElement('style'); // 如果需要 ID
4687
-
4688
- if (id) {
4689
- domId = "" + id;
4690
- idDom = document.getElementById(domId); // 如果 Dom 不存在,插入 style
4691
-
4692
- if (!idDom) {
4693
- customStyle.setAttribute('id', id);
4694
- customStyle.innerHTML = inlineStyle;
4695
- styleFrag.appendChild(customStyle);
4696
- document.head.appendChild(styleFrag);
4697
- } else {
4698
- // 如果 Dom 存在,直接更新
4699
- idDom.innerHTML = inlineStyle;
4700
- }
4701
- } else {
4702
- // 不需要 ID,直接添加新标签
4703
- customStyle.innerHTML = inlineStyle;
4704
- styleFrag.appendChild(customStyle);
4705
- document.head.appendChild(styleFrag);
4706
- }
4707
-
4708
- return true;
4709
- }
4710
- /**
4711
- * @method genCustomConsole
4712
- * @description 生成自定义控制台打印
4713
- * @param {String} prefix 前缀
4714
- * @param {Function} allowFn 允许打印的判断函数
4715
- * @return {Object} 新实例
4716
- */
4717
-
4718
- function genCustomConsole(_a) {
4719
- var _b = (_a === void 0 ? {} : _a).prefix,
4720
- prefix = _b === void 0 ? '' : _b;
4721
- var methods = ['log', 'info', 'warn', 'error'];
4722
- var newConsole = Object.create(null);
4723
- methods.forEach(function (method) {
4724
- newConsole[method] = function () {
4725
- var _a, _b;
4726
-
4727
- var argu = [];
4728
-
4729
- for (var _i = 0; _i < arguments.length; _i++) {
4730
- argu[_i] = arguments[_i];
4731
- }
4732
-
4733
- if (prefix) {
4734
- (_a = console)[method].apply(_a, __spreadArrays([prefix], argu));
4735
- } else {
4736
- (_b = console)[method].apply(_b, argu);
4737
- }
4738
- };
4739
- });
4740
- return newConsole;
4741
- }
4742
-
4743
- exports.addClass = addClass;
4744
- exports.addInlineStyle = addInlineStyle;
4745
- exports.calLongestCommonSubsequence = calLongestCommonSubsequence;
4746
- exports.calLongestCommonSubstring = calLongestCommonSubstring;
4747
- exports.camelCase2Underscore = camelCase2Underscore;
4748
- exports.camelCaseToKebabCase = camelCaseToKebabCase;
4749
- exports.cancelBubble = cancelBubble;
4750
- exports.clearHtml = clearHtml;
4751
- exports.cutCHSString = cutCHSString;
4752
- exports.debounce = debounce;
4753
- exports.deepCopyObject = deepCopyObject;
4754
- exports.doFn = doFn;
4755
- exports.floatFixed = floatFixed;
4756
- exports.floatToPercent = floatToPercent;
4757
- exports.friendlyInterval = friendlyInterval;
4758
- exports.genCustomConsole = genCustomConsole;
4759
- exports.generateRndNum = generateRndNum;
4760
- exports.generateUniqueNum = generateUniqueNum;
4761
- exports.getBrowserType = getBrowserType;
4762
- exports.getCookie = getCookie;
4763
- exports.getDomain = getDomain;
4764
- exports.getHashQueryParam = getHashQueryParam;
4765
- exports.getLocalStorage = getLocalStorage;
4766
- exports.getPerformance = getPerformance;
4767
- exports.getQueryParam = getQueryParam;
4768
- exports.getSessionStorage = getSessionStorage;
4769
- exports.getUrlParam = getUrlParam;
4770
- exports.hasClass = hasClass;
4771
- exports.inRate = inRate;
4772
- exports.isJsonString = isJsonString;
4773
- exports.isNumber = isNumber;
4774
- exports.isSafePWAEnv = isSafePWAEnv;
4775
- exports.loadCSS = loadCSS;
4776
- exports.loadScript = loadScript;
4777
- exports.mNow = mNow;
4778
- exports.mTrim = mTrim;
4779
- exports.newLine = newLine;
4780
- exports.removeClass = removeClass;
4781
- exports.setCookie = setCookie;
4782
- exports.setLocalStorage = setLocalStorage;
4783
- exports.setSessionStorage = setSessionStorage;
4784
- exports.throttle = throttle;
4785
- exports.updateQueryParam = updateQueryParam;
4786
- exports.windowLoaded = windowLoaded;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e,t){return e(t={exports:{}},t.exports),t.exports}var n=function(e){return e&&e.Math==Math&&e},r=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||Function("return this")(),o=function(e){try{return!!e()}catch(e){return!0}},i=!o((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),a={}.propertyIsEnumerable,c=Object.getOwnPropertyDescriptor,u={f:c&&!a.call({1:2},1)?function(e){var t=c(this,e);return!!t&&t.enumerable}:a},l=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},f={}.toString,s=function(e){return f.call(e).slice(8,-1)},d="".split,p=o((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==s(e)?d.call(e,""):Object(e)}:Object,v=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},g=function(e){return p(v(e))},h=function(e){return"object"==typeof e?null!==e:"function"==typeof e},m=function(e,t){if(!h(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!h(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!h(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!h(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},y={}.hasOwnProperty,w=function(e,t){return y.call(e,t)},x=r.document,b=h(x)&&h(x.createElement),S=function(e){return b?x.createElement(e):{}},E=!i&&!o((function(){return 7!=Object.defineProperty(S("div"),"a",{get:function(){return 7}}).a})),O=Object.getOwnPropertyDescriptor,T={f:i?O:function(e,t){if(e=g(e),t=m(t,!0),E)try{return O(e,t)}catch(e){}if(w(e,t))return l(!u.f.call(e,t),e[t])}},j=function(e){if(!h(e))throw TypeError(String(e)+" is not an object");return e},A=Object.defineProperty,P={f:i?A:function(e,t,n){if(j(e),t=m(t,!0),j(n),E)try{return A(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},_=i?function(e,t,n){return P.f(e,t,l(1,n))}:function(e,t,n){return e[t]=n,e},R=function(e,t){try{_(r,e,t)}catch(n){r[e]=t}return t},C=r["__core-js_shared__"]||R("__core-js_shared__",{}),M=Function.toString;"function"!=typeof C.inspectSource&&(C.inspectSource=function(e){return M.call(e)});var L,k,I,N=C.inspectSource,F=r.WeakMap,D="function"==typeof F&&/native code/.test(N(F)),B=t((function(e){(e.exports=function(e,t){return C[e]||(C[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.5",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),$=0,U=Math.random(),q=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++$+U).toString(36)},V=B("keys"),G=function(e){return V[e]||(V[e]=q(e))},H={},W=r.WeakMap;if(D){var z=new W,K=z.get,J=z.has,Y=z.set;L=function(e,t){return Y.call(z,e,t),t},k=function(e){return K.call(z,e)||{}},I=function(e){return J.call(z,e)}}else{var X=G("state");H[X]=!0,L=function(e,t){return _(e,X,t),t},k=function(e){return w(e,X)?e[X]:{}},I=function(e){return w(e,X)}}var Q,Z,ee={set:L,get:k,has:I,enforce:function(e){return I(e)?k(e):L(e,{})},getterFor:function(e){return function(t){var n;if(!h(t)||(n=k(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},te=t((function(e){var t=ee.get,n=ee.enforce,o=String(String).split("String");(e.exports=function(e,t,i,a){var c=!!a&&!!a.unsafe,u=!!a&&!!a.enumerable,l=!!a&&!!a.noTargetGet;"function"==typeof i&&("string"!=typeof t||w(i,"name")||_(i,"name",t),n(i).source=o.join("string"==typeof t?t:"")),e!==r?(c?!l&&e[t]&&(u=!0):delete e[t],u?e[t]=i:_(e,t,i)):u?e[t]=i:R(t,i)})(Function.prototype,"toString",(function(){return"function"==typeof this&&t(this).source||N(this)}))})),ne=r,re=function(e){return"function"==typeof e?e:void 0},oe=function(e,t){return arguments.length<2?re(ne[e])||re(r[e]):ne[e]&&ne[e][t]||r[e]&&r[e][t]},ie=Math.ceil,ae=Math.floor,ce=function(e){return isNaN(e=+e)?0:(e>0?ae:ie)(e)},ue=Math.min,le=function(e){return e>0?ue(ce(e),9007199254740991):0},fe=Math.max,se=Math.min,de=function(e,t){var n=ce(e);return n<0?fe(n+t,0):se(n,t)},pe=function(e){return function(t,n,r){var o,i=g(t),a=le(i.length),c=de(r,a);if(e&&n!=n){for(;a>c;)if((o=i[c++])!=o)return!0}else for(;a>c;c++)if((e||c in i)&&i[c]===n)return e||c||0;return!e&&-1}},ve={includes:pe(!0),indexOf:pe(!1)},ge=ve.indexOf,he=function(e,t){var n,r=g(e),o=0,i=[];for(n in r)!w(H,n)&&w(r,n)&&i.push(n);for(;t.length>o;)w(r,n=t[o++])&&(~ge(i,n)||i.push(n));return i},me=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ye=me.concat("length","prototype"),we={f:Object.getOwnPropertyNames||function(e){return he(e,ye)}},xe={f:Object.getOwnPropertySymbols},be=oe("Reflect","ownKeys")||function(e){var t=we.f(j(e)),n=xe.f;return n?t.concat(n(e)):t},Se=function(e,t){for(var n=be(t),r=P.f,o=T.f,i=0;i<n.length;i++){var a=n[i];w(e,a)||r(e,a,o(t,a))}},Ee=/#|\.prototype\./,Oe=function(e,t){var n=je[Te(e)];return n==Pe||n!=Ae&&("function"==typeof t?o(t):!!t)},Te=Oe.normalize=function(e){return String(e).replace(Ee,".").toLowerCase()},je=Oe.data={},Ae=Oe.NATIVE="N",Pe=Oe.POLYFILL="P",_e=Oe,Re=T.f,Ce=function(e,t){var n,o,i,a,c,u=e.target,l=e.global,f=e.stat;if(n=l?r:f?r[u]||R(u,{}):(r[u]||{}).prototype)for(o in t){if(a=t[o],i=e.noTargetGet?(c=Re(n,o))&&c.value:n[o],!_e(l?o:u+(f?".":"#")+o,e.forced)&&void 0!==i){if(typeof a==typeof i)continue;Se(a,i)}(e.sham||i&&i.sham)&&_(a,"sham",!0),te(n,o,a,e)}},Me=Array.isArray||function(e){return"Array"==s(e)},Le=function(e){return Object(v(e))},ke=function(e,t,n){var r=m(t);r in e?P.f(e,r,l(0,n)):e[r]=n},Ie=!!Object.getOwnPropertySymbols&&!o((function(){return!String(Symbol())})),Ne=Ie&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Fe=B("wks"),De=r.Symbol,Be=Ne?De:De&&De.withoutSetter||q,$e=function(e){return w(Fe,e)||(Ie&&w(De,e)?Fe[e]=De[e]:Fe[e]=Be("Symbol."+e)),Fe[e]},Ue=$e("species"),qe=function(e,t){var n;return Me(e)&&("function"!=typeof(n=e.constructor)||n!==Array&&!Me(n.prototype)?h(n)&&null===(n=n[Ue])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===t?0:t)},Ve=oe("navigator","userAgent")||"",Ge=r.process,He=Ge&&Ge.versions,We=He&&He.v8;We?Z=(Q=We.split("."))[0]+Q[1]:Ve&&(!(Q=Ve.match(/Edge\/(\d+)/))||Q[1]>=74)&&(Q=Ve.match(/Chrome\/(\d+)/))&&(Z=Q[1]);var ze=Z&&+Z,Ke=$e("species"),Je=function(e){return ze>=51||!o((function(){var t=[];return(t.constructor={})[Ke]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},Ye=$e("isConcatSpreadable"),Xe=ze>=51||!o((function(){var e=[];return e[Ye]=!1,e.concat()[0]!==e})),Qe=Je("concat"),Ze=function(e){if(!h(e))return!1;var t=e[Ye];return void 0!==t?!!t:Me(e)};Ce({target:"Array",proto:!0,forced:!Xe||!Qe},{concat:function(e){var t,n,r,o,i,a=Le(this),c=qe(a,0),u=0;for(t=-1,r=arguments.length;t<r;t++)if(Ze(i=-1===t?a:arguments[t])){if(u+(o=le(i.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n<o;n++,u++)n in i&&ke(c,u,i[n])}else{if(u>=9007199254740991)throw TypeError("Maximum allowed index exceeded");ke(c,u++,i)}return c.length=u,c}});var et,tt=Object.keys||function(e){return he(e,me)},nt=i?Object.defineProperties:function(e,t){j(e);for(var n,r=tt(t),o=r.length,i=0;o>i;)P.f(e,n=r[i++],t[n]);return e},rt=oe("document","documentElement"),ot=G("IE_PROTO"),it=function(){},at=function(e){return"<script>"+e+"<\/script>"},ct=function(){try{et=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;ct=et?function(e){e.write(at("")),e.close();var t=e.parentWindow.Object;return e=null,t}(et):((t=S("iframe")).style.display="none",rt.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(at("document.F=Object")),e.close(),e.F);for(var n=me.length;n--;)delete ct.prototype[me[n]];return ct()};H[ot]=!0;var ut=Object.create||function(e,t){var n;return null!==e?(it.prototype=j(e),n=new it,it.prototype=null,n[ot]=e):n=ct(),void 0===t?n:nt(n,t)},lt=$e("unscopables"),ft=Array.prototype;null==ft[lt]&&P.f(ft,lt,{configurable:!0,value:ut(null)});var st;Ce({target:"Array",proto:!0},{fill:function(e){for(var t=Le(this),n=le(t.length),r=arguments.length,o=de(r>1?arguments[1]:void 0,n),i=r>2?arguments[2]:void 0,a=void 0===i?n:de(i,n);a>o;)t[o++]=e;return t}}),st="fill",ft[lt][st]=!0;var dt=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},pt=function(e,t,n){if(dt(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}},vt=[].push,gt=function(e){var t=1==e,n=2==e,r=3==e,o=4==e,i=6==e,a=5==e||i;return function(c,u,l,f){for(var s,d,v=Le(c),g=p(v),h=pt(u,l,3),m=le(g.length),y=0,w=f||qe,x=t?w(c,m):n?w(c,0):void 0;m>y;y++)if((a||y in g)&&(d=h(s=g[y],y,v),e))if(t)x[y]=d;else if(d)switch(e){case 3:return!0;case 5:return s;case 6:return y;case 2:vt.call(x,s)}else if(o)return!1;return i?-1:r||o?o:x}},ht={forEach:gt(0),map:gt(1),filter:gt(2),some:gt(3),every:gt(4),find:gt(5),findIndex:gt(6)},mt=function(e,t){var n=[][e];return!!n&&o((function(){n.call(null,t||function(){throw 1},1)}))},yt=Object.defineProperty,wt={},xt=function(e){throw e},bt=function(e,t){if(w(wt,e))return wt[e];t||(t={});var n=[][e],r=!!w(t,"ACCESSORS")&&t.ACCESSORS,a=w(t,0)?t[0]:xt,c=w(t,1)?t[1]:void 0;return wt[e]=!!n&&!o((function(){if(r&&!i)return!0;var e={length:-1};r?yt(e,1,{enumerable:!0,get:xt}):e[1]=1,n.call(e,a,c)}))},St=ht.forEach,Et=mt("forEach"),Ot=bt("forEach"),Tt=Et&&Ot?[].forEach:function(e){return St(this,e,arguments.length>1?arguments[1]:void 0)};Ce({target:"Array",proto:!0,forced:[].forEach!=Tt},{forEach:Tt});var jt=ve.indexOf,At=[].indexOf,Pt=!!At&&1/[1].indexOf(1,-0)<0,_t=mt("indexOf"),Rt=bt("indexOf",{ACCESSORS:!0,1:0});Ce({target:"Array",proto:!0,forced:Pt||!_t||!Rt},{indexOf:function(e){return Pt?At.apply(this,arguments)||0:jt(this,e,arguments.length>1?arguments[1]:void 0)}});var Ct=[].join,Mt=p!=Object,Lt=mt("join",",");Ce({target:"Array",proto:!0,forced:Mt||!Lt},{join:function(e){return Ct.call(g(this),void 0===e?",":e)}});var kt=function(e){return function(t,n,r,o){dt(n);var i=Le(t),a=p(i),c=le(i.length),u=e?c-1:0,l=e?-1:1;if(r<2)for(;;){if(u in a){o=a[u],u+=l;break}if(u+=l,e?u<0:c<=u)throw TypeError("Reduce of empty array with no initial value")}for(;e?u>=0:c>u;u+=l)u in a&&(o=n(o,a[u],u,i));return o}},It={left:kt(!1),right:kt(!0)}.left,Nt=mt("reduce"),Ft=bt("reduce",{1:0});Ce({target:"Array",proto:!0,forced:!Nt||!Ft},{reduce:function(e){return It(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}});var Dt=Je("slice"),Bt=bt("slice",{ACCESSORS:!0,0:0,1:2}),$t=$e("species"),Ut=[].slice,qt=Math.max;Ce({target:"Array",proto:!0,forced:!Dt||!Bt},{slice:function(e,t){var n,r,o,i=g(this),a=le(i.length),c=de(e,a),u=de(void 0===t?a:t,a);if(Me(i)&&("function"!=typeof(n=i.constructor)||n!==Array&&!Me(n.prototype)?h(n)&&null===(n=n[$t])&&(n=void 0):n=void 0,n===Array||void 0===n))return Ut.call(i,c,u);for(r=new(void 0===n?Array:n)(qt(u-c,0)),o=0;c<u;c++,o++)c in i&&ke(r,o,i[c]);return r.length=o,r}});var Vt=P.f,Gt=Function.prototype,Ht=Gt.toString,Wt=/^\s*function ([^ (]*)/;i&&!("name"in Gt)&&Vt(Gt,"name",{configurable:!0,get:function(){try{return Ht.call(this).match(Wt)[1]}catch(e){return""}}});var zt="".repeat||function(e){var t=String(v(this)),n="",r=ce(e);if(r<0||r==1/0)throw RangeError("Wrong number of repetitions");for(;r>0;(r>>>=1)&&(t+=t))1&r&&(n+=t);return n},Kt=1..toFixed,Jt=Math.floor,Yt=function(e,t,n){return 0===t?n:t%2==1?Yt(e,t-1,n*e):Yt(e*e,t/2,n)};Ce({target:"Number",proto:!0,forced:Kt&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!o((function(){Kt.call({})}))},{toFixed:function(e){var t,n,r,o,i=function(e){if("number"!=typeof e&&"Number"!=s(e))throw TypeError("Incorrect invocation");return+e}(this),a=ce(e),c=[0,0,0,0,0,0],u="",l="0",f=function(e,t){for(var n=-1,r=t;++n<6;)r+=e*c[n],c[n]=r%1e7,r=Jt(r/1e7)},d=function(e){for(var t=6,n=0;--t>=0;)n+=c[t],c[t]=Jt(n/e),n=n%e*1e7},p=function(){for(var e=6,t="";--e>=0;)if(""!==t||0===e||0!==c[e]){var n=String(c[e]);t=""===t?n:t+zt.call("0",7-n.length)+n}return t};if(a<0||a>20)throw RangeError("Incorrect fraction digits");if(i!=i)return"NaN";if(i<=-1e21||i>=1e21)return String(i);if(i<0&&(u="-",i=-i),i>1e-21)if(n=(t=function(e){for(var t=0,n=e;n>=4096;)t+=12,n/=4096;for(;n>=2;)t+=1,n/=2;return t}(i*Yt(2,69,1))-69)<0?i*Yt(2,-t,1):i/Yt(2,t,1),n*=4503599627370496,(t=52-t)>0){for(f(0,n),r=a;r>=7;)f(1e7,0),r-=7;for(f(Yt(10,r,1),0),r=t-1;r>=23;)d(1<<23),r-=23;d(1<<r),f(1,1),d(2),l=p()}else f(0,n),f(1<<-t,0),l=p()+zt.call("0",a);return l=a>0?u+((o=l.length)<=a?"0."+zt.call("0",a-o)+l:l.slice(0,o-a)+"."+l.slice(o-a)):u+l}});var Xt=Object.assign,Qt=Object.defineProperty,Zt=!Xt||o((function(){if(i&&1!==Xt({b:1},Xt(Qt({},"a",{enumerable:!0,get:function(){Qt(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=Xt({},e)[n]||tt(Xt({},t)).join("")!=r}))?function(e,t){for(var n=Le(e),r=arguments.length,o=1,a=xe.f,c=u.f;r>o;)for(var l,f=p(arguments[o++]),s=a?tt(f).concat(a(f)):tt(f),d=s.length,v=0;d>v;)l=s[v++],i&&!c.call(f,l)||(n[l]=f[l]);return n}:Xt;Ce({target:"Object",stat:!0,forced:Object.assign!==Zt},{assign:Zt});var en=!o((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),tn=G("IE_PROTO"),nn=Object.prototype,rn=en?Object.getPrototypeOf:function(e){return e=Le(e),w(e,tn)?e[tn]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?nn:null};Ce({target:"Object",stat:!0,forced:o((function(){rn(1)})),sham:!en},{getPrototypeOf:function(e){return rn(Le(e))}}),Ce({target:"Object",stat:!0,forced:o((function(){tt(1)}))},{keys:function(e){return tt(Le(e))}});var on={};on[$e("toStringTag")]="z";var an="[object z]"===String(on),cn=$e("toStringTag"),un="Arguments"==s(function(){return arguments}()),ln=an?s:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),cn))?n:un?s(t):"Object"==(r=s(t))&&"function"==typeof t.callee?"Arguments":r},fn=an?{}.toString:function(){return"[object "+ln(this)+"]"};an||te(Object.prototype,"toString",fn,{unsafe:!0});var sn="[\t\n\v\f\r                 \u2028\u2029\ufeff]",dn=RegExp("^"+sn+sn+"*"),pn=RegExp(sn+sn+"*$"),vn=function(e){return function(t){var n=String(v(t));return 1&e&&(n=n.replace(dn,"")),2&e&&(n=n.replace(pn,"")),n}},gn={start:vn(1),end:vn(2),trim:vn(3)}.trim,hn=r.parseFloat,mn=1/hn("\t\n\v\f\r                 \u2028\u2029\ufeff-0")!=-1/0?function(e){var t=gn(String(e)),n=hn(t);return 0===n&&"-"==t.charAt(0)?-0:n}:hn;Ce({global:!0,forced:parseFloat!=mn},{parseFloat:mn});var yn=r.Promise,wn=P.f,xn=$e("toStringTag"),bn=$e("species"),Sn=function(e){var t=oe(e),n=P.f;i&&t&&!t[bn]&&n(t,bn,{configurable:!0,get:function(){return this}})},En={},On=$e("iterator"),Tn=Array.prototype,jn=$e("iterator"),An=function(e,t,n,r){try{return r?t(j(n)[0],n[1]):t(n)}catch(t){var o=e.return;throw void 0!==o&&j(o.call(e)),t}},Pn=t((function(e){var t=function(e,t){this.stopped=e,this.result=t},n=e.exports=function(e,n,r,o,i){var a,c,u,l,f,s,d,p,v=pt(n,r,o?2:1);if(i)a=e;else{if(c=function(e){if(null!=e)return e[jn]||e["@@iterator"]||En[ln(e)]}(e),"function"!=typeof c)throw TypeError("Target is not iterable");if(void 0!==(p=c)&&(En.Array===p||Tn[On]===p)){for(u=0,l=le(e.length);l>u;u++)if((f=o?v(j(d=e[u])[0],d[1]):v(e[u]))&&f instanceof t)return f;return new t(!1)}a=c.call(e)}for(s=a.next;!(d=s.call(a)).done;)if("object"==typeof(f=An(a,v,d.value,o))&&f&&f instanceof t)return f;return new t(!1)};n.stop=function(e){return new t(!0,e)}})),_n=$e("iterator"),Rn=!1;try{var Cn=0,Mn={next:function(){return{done:!!Cn++}},return:function(){Rn=!0}};Mn[_n]=function(){return this},Array.from(Mn,(function(){throw 2}))}catch(e){}var Ln,kn,In,Nn=$e("species"),Fn=function(e,t){var n,r=j(e).constructor;return void 0===r||null==(n=j(r)[Nn])?t:dt(n)},Dn=/(iphone|ipod|ipad).*applewebkit/i.test(Ve),Bn=r.location,$n=r.setImmediate,Un=r.clearImmediate,qn=r.process,Vn=r.MessageChannel,Gn=r.Dispatch,Hn=0,Wn={},zn=function(e){if(Wn.hasOwnProperty(e)){var t=Wn[e];delete Wn[e],t()}},Kn=function(e){return function(){zn(e)}},Jn=function(e){zn(e.data)},Yn=function(e){r.postMessage(e+"",Bn.protocol+"//"+Bn.host)};$n&&Un||($n=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return Wn[++Hn]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},Ln(Hn),Hn},Un=function(e){delete Wn[e]},"process"==s(qn)?Ln=function(e){qn.nextTick(Kn(e))}:Gn&&Gn.now?Ln=function(e){Gn.now(Kn(e))}:Vn&&!Dn?(In=(kn=new Vn).port2,kn.port1.onmessage=Jn,Ln=pt(In.postMessage,In,1)):!r.addEventListener||"function"!=typeof postMessage||r.importScripts||o(Yn)||"file:"===Bn.protocol?Ln="onreadystatechange"in S("script")?function(e){rt.appendChild(S("script")).onreadystatechange=function(){rt.removeChild(this),zn(e)}}:function(e){setTimeout(Kn(e),0)}:(Ln=Yn,r.addEventListener("message",Jn,!1)));var Xn,Qn,Zn,er,tr,nr,rr,or,ir={set:$n,clear:Un},ar=T.f,cr=ir.set,ur=r.MutationObserver||r.WebKitMutationObserver,lr=r.process,fr=r.Promise,sr="process"==s(lr),dr=ar(r,"queueMicrotask"),pr=dr&&dr.value;pr||(Xn=function(){var e,t;for(sr&&(e=lr.domain)&&e.exit();Qn;){t=Qn.fn,Qn=Qn.next;try{t()}catch(e){throw Qn?er():Zn=void 0,e}}Zn=void 0,e&&e.enter()},sr?er=function(){lr.nextTick(Xn)}:ur&&!Dn?(tr=!0,nr=document.createTextNode(""),new ur(Xn).observe(nr,{characterData:!0}),er=function(){nr.data=tr=!tr}):fr&&fr.resolve?(rr=fr.resolve(void 0),or=rr.then,er=function(){or.call(rr,Xn)}):er=function(){cr.call(r,Xn)});var vr,gr,hr,mr,yr,wr,xr,br=pr||function(e){var t={fn:e,next:void 0};Zn&&(Zn.next=t),Qn||(Qn=t,er()),Zn=t},Sr=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=dt(t),this.reject=dt(n)},Er={f:function(e){return new Sr(e)}},Or=function(e,t){if(j(e),h(t)&&t.constructor===e)return t;var n=Er.f(e);return(0,n.resolve)(t),n.promise},Tr=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},jr=ir.set,Ar=$e("species"),Pr="Promise",_r=ee.get,Rr=ee.set,Cr=ee.getterFor(Pr),Mr=yn,Lr=r.TypeError,kr=r.document,Ir=r.process,Nr=oe("fetch"),Fr=Er.f,Dr=Fr,Br="process"==s(Ir),$r=!!(kr&&kr.createEvent&&r.dispatchEvent),Ur=_e(Pr,(function(){if(!(N(Mr)!==String(Mr))){if(66===ze)return!0;if(!Br&&"function"!=typeof PromiseRejectionEvent)return!0}if(ze>=51&&/native code/.test(Mr))return!1;var e=Mr.resolve(1),t=function(e){e((function(){}),(function(){}))};return(e.constructor={})[Ar]=t,!(e.then((function(){}))instanceof t)})),qr=Ur||!function(e,t){if(!t&&!Rn)return!1;var n=!1;try{var r={};r[_n]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n}((function(e){Mr.all(e).catch((function(){}))})),Vr=function(e){var t;return!(!h(e)||"function"!=typeof(t=e.then))&&t},Gr=function(e,t,n){if(!t.notified){t.notified=!0;var r=t.reactions;br((function(){for(var o=t.value,i=1==t.state,a=0;r.length>a;){var c,u,l,f=r[a++],s=i?f.ok:f.fail,d=f.resolve,p=f.reject,v=f.domain;try{s?(i||(2===t.rejection&&Kr(e,t),t.rejection=1),!0===s?c=o:(v&&v.enter(),c=s(o),v&&(v.exit(),l=!0)),c===f.promise?p(Lr("Promise-chain cycle")):(u=Vr(c))?u.call(c,d,p):d(c)):p(o)}catch(e){v&&!l&&v.exit(),p(e)}}t.reactions=[],t.notified=!1,n&&!t.rejection&&Wr(e,t)}))}},Hr=function(e,t,n){var o,i;$r?((o=kr.createEvent("Event")).promise=t,o.reason=n,o.initEvent(e,!1,!0),r.dispatchEvent(o)):o={promise:t,reason:n},(i=r["on"+e])?i(o):"unhandledrejection"===e&&function(e,t){var n=r.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))}("Unhandled promise rejection",n)},Wr=function(e,t){jr.call(r,(function(){var n,r=t.value;if(zr(t)&&(n=Tr((function(){Br?Ir.emit("unhandledRejection",r,e):Hr("unhandledrejection",e,r)})),t.rejection=Br||zr(t)?2:1,n.error))throw n.value}))},zr=function(e){return 1!==e.rejection&&!e.parent},Kr=function(e,t){jr.call(r,(function(){Br?Ir.emit("rejectionHandled",e):Hr("rejectionhandled",e,t.value)}))},Jr=function(e,t,n,r){return function(o){e(t,n,o,r)}},Yr=function(e,t,n,r){t.done||(t.done=!0,r&&(t=r),t.value=n,t.state=2,Gr(e,t,!0))},Xr=function(e,t,n,r){if(!t.done){t.done=!0,r&&(t=r);try{if(e===n)throw Lr("Promise can't be resolved itself");var o=Vr(n);o?br((function(){var r={done:!1};try{o.call(n,Jr(Xr,e,r,t),Jr(Yr,e,r,t))}catch(n){Yr(e,r,n,t)}})):(t.value=n,t.state=1,Gr(e,t,!1))}catch(n){Yr(e,{done:!1},n,t)}}};Ur&&(Mr=function(e){!function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation")}(this,Mr,Pr),dt(e),vr.call(this);var t=_r(this);try{e(Jr(Xr,this,t),Jr(Yr,this,t))}catch(e){Yr(this,t,e)}},(vr=function(e){Rr(this,{type:Pr,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=function(e,t,n){for(var r in t)te(e,r,t[r],n);return e}(Mr.prototype,{then:function(e,t){var n=Cr(this),r=Fr(Fn(this,Mr));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=Br?Ir.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&Gr(this,n,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),gr=function(){var e=new vr,t=_r(e);this.promise=e,this.resolve=Jr(Xr,e,t),this.reject=Jr(Yr,e,t)},Er.f=Fr=function(e){return e===Mr||e===hr?new gr(e):Dr(e)},"function"==typeof yn&&(mr=yn.prototype.then,te(yn.prototype,"then",(function(e,t){var n=this;return new Mr((function(e,t){mr.call(n,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof Nr&&Ce({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return Or(Mr,Nr.apply(r,arguments))}}))),Ce({global:!0,wrap:!0,forced:Ur},{Promise:Mr}),wr=Pr,xr=!1,(yr=Mr)&&!w(yr=xr?yr:yr.prototype,xn)&&wn(yr,xn,{configurable:!0,value:wr}),Sn(Pr),hr=oe(Pr),Ce({target:Pr,stat:!0,forced:Ur},{reject:function(e){var t=Fr(this);return t.reject.call(void 0,e),t.promise}}),Ce({target:Pr,stat:!0,forced:Ur},{resolve:function(e){return Or(this,e)}}),Ce({target:Pr,stat:!0,forced:qr},{all:function(e){var t=this,n=Fr(t),r=n.resolve,o=n.reject,i=Tr((function(){var n=dt(t.resolve),i=[],a=0,c=1;Pn(e,(function(e){var u=a++,l=!1;i.push(void 0),c++,n.call(t,e).then((function(e){l||(l=!0,i[u]=e,--c||r(i))}),o)})),--c||r(i)}));return i.error&&o(i.value),n.promise},race:function(e){var t=this,n=Fr(t),r=n.reject,o=Tr((function(){var o=dt(t.resolve);Pn(e,(function(e){o.call(t,e).then(n.resolve,r)}))}));return o.error&&r(o.value),n.promise}});var Qr=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return j(n),function(e){if(!h(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype")}(r),t?e.call(n,r):n.__proto__=r,n}}():void 0),Zr=$e("match"),eo=function(e){var t;return h(e)&&(void 0!==(t=e[Zr])?!!t:"RegExp"==s(e))},to=function(){var e=j(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t};function no(e,t){return RegExp(e,t)}var ro={UNSUPPORTED_Y:o((function(){var e=no("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),BROKEN_CARET:o((function(){var e=no("^r","gy");return e.lastIndex=2,null!=e.exec("str")}))},oo=P.f,io=we.f,ao=ee.set,co=$e("match"),uo=r.RegExp,lo=uo.prototype,fo=/a/g,so=/a/g,po=new uo(fo)!==fo,vo=ro.UNSUPPORTED_Y;if(i&&_e("RegExp",!po||vo||o((function(){return so[co]=!1,uo(fo)!=fo||uo(so)==so||"/a/i"!=uo(fo,"i")})))){for(var go=function(e,t){var n,r=this instanceof go,o=eo(e),i=void 0===t;if(!r&&o&&e.constructor===go&&i)return e;po?o&&!i&&(e=e.source):e instanceof go&&(i&&(t=to.call(e)),e=e.source),vo&&(n=!!t&&t.indexOf("y")>-1)&&(t=t.replace(/y/g,""));var a,c,u,l,f,s=(a=po?new uo(e,t):uo(e,t),c=r?this:lo,u=go,Qr&&"function"==typeof(l=c.constructor)&&l!==u&&h(f=l.prototype)&&f!==u.prototype&&Qr(a,f),a);return vo&&n&&ao(s,{sticky:n}),s},ho=function(e){e in go||oo(go,e,{configurable:!0,get:function(){return uo[e]},set:function(t){uo[e]=t}})},mo=io(uo),yo=0;mo.length>yo;)ho(mo[yo++]);lo.constructor=go,go.prototype=lo,te(r,"RegExp",go)}Sn("RegExp");var wo=RegExp.prototype.exec,xo=String.prototype.replace,bo=wo,So=function(){var e=/a/,t=/b*/g;return wo.call(e,"a"),wo.call(t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),Eo=ro.UNSUPPORTED_Y||ro.BROKEN_CARET,Oo=void 0!==/()??/.exec("")[1];(So||Oo||Eo)&&(bo=function(e){var t,n,r,o,i=this,a=Eo&&i.sticky,c=to.call(i),u=i.source,l=0,f=e;return a&&(-1===(c=c.replace("y","")).indexOf("g")&&(c+="g"),f=String(e).slice(i.lastIndex),i.lastIndex>0&&(!i.multiline||i.multiline&&"\n"!==e[i.lastIndex-1])&&(u="(?: "+u+")",f=" "+f,l++),n=new RegExp("^(?:"+u+")",c)),Oo&&(n=new RegExp("^"+u+"$(?!\\s)",c)),So&&(t=i.lastIndex),r=wo.call(a?n:i,f),a?r?(r.input=r.input.slice(l),r[0]=r[0].slice(l),r.index=i.lastIndex,i.lastIndex+=r[0].length):i.lastIndex=0:So&&r&&(i.lastIndex=i.global?r.index+r[0].length:t),Oo&&r&&r.length>1&&xo.call(r[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)})),r});var To=bo;Ce({target:"RegExp",proto:!0,forced:/./.exec!==To},{exec:To});var jo=RegExp.prototype,Ao=jo.toString,Po=o((function(){return"/a/b"!=Ao.call({source:"a",flags:"b"})})),_o="toString"!=Ao.name;(Po||_o)&&te(RegExp.prototype,"toString",(function(){var e=j(this),t=String(e.source),n=e.flags;return"/"+t+"/"+String(void 0===n&&e instanceof RegExp&&!("flags"in jo)?to.call(e):n)}),{unsafe:!0}),Ce({target:"RegExp",proto:!0,forced:/./.exec!==To},{exec:To});var Ro=$e("species"),Co=!o((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),Mo="$0"==="a".replace(/./,"$0"),Lo=$e("replace"),ko=!!/./[Lo]&&""===/./[Lo]("a","$0"),Io=!o((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),No=function(e,t,n,r){var i=$e(e),a=!o((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),c=a&&!o((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[Ro]=function(){return n},n.flags="",n[i]=/./[i]),n.exec=function(){return t=!0,null},n[i](""),!t}));if(!a||!c||"replace"===e&&(!Co||!Mo||ko)||"split"===e&&!Io){var u=/./[i],l=n(i,""[e],(function(e,t,n,r,o){return t.exec===To?a&&!o?{done:!0,value:u.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),{REPLACE_KEEPS_$0:Mo,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:ko}),f=l[0],s=l[1];te(String.prototype,e,f),te(RegExp.prototype,i,2==t?function(e,t){return s.call(e,this,t)}:function(e){return s.call(e,this)})}r&&_(RegExp.prototype[i],"sham",!0)},Fo=function(e){return function(t,n){var r,o,i=String(v(t)),a=ce(n),c=i.length;return a<0||a>=c?e?"":void 0:(r=i.charCodeAt(a))<55296||r>56319||a+1===c||(o=i.charCodeAt(a+1))<56320||o>57343?e?i.charAt(a):r:e?i.slice(a,a+2):o-56320+(r-55296<<10)+65536}},Do={codeAt:Fo(!1),charAt:Fo(!0)}.charAt,Bo=function(e,t,n){return t+(n?Do(e,t).length:1)},$o=function(e,t){var n=e.exec;if("function"==typeof n){var r=n.call(e,t);if("object"!=typeof r)throw TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==s(e))throw TypeError("RegExp#exec called on incompatible receiver");return To.call(e,t)};No("match",1,(function(e,t,n){return[function(t){var n=v(this),r=null==t?void 0:t[e];return void 0!==r?r.call(t,n):new RegExp(t)[e](String(n))},function(e){var r=n(t,e,this);if(r.done)return r.value;var o=j(e),i=String(this);if(!o.global)return $o(o,i);var a=o.unicode;o.lastIndex=0;for(var c,u=[],l=0;null!==(c=$o(o,i));){var f=String(c[0]);u[l]=f,""===f&&(o.lastIndex=Bo(i,le(o.lastIndex),a)),l++}return 0===l?null:u}]}));var Uo=Math.max,qo=Math.min,Vo=Math.floor,Go=/\$([$&'`]|\d\d?|<[^>]*>)/g,Ho=/\$([$&'`]|\d\d?)/g,Wo=function(e){return void 0===e?e:String(e)};No("replace",2,(function(e,t,n,r){var o=r.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,i=r.REPLACE_KEEPS_$0,a=o?"$":"$0";return[function(n,r){var o=v(this),i=null==n?void 0:n[e];return void 0!==i?i.call(n,o,r):t.call(String(o),n,r)},function(e,r){if(!o&&i||"string"==typeof r&&-1===r.indexOf(a)){var u=n(t,e,this,r);if(u.done)return u.value}var l=j(e),f=String(this),s="function"==typeof r;s||(r=String(r));var d=l.global;if(d){var p=l.unicode;l.lastIndex=0}for(var v=[];;){var g=$o(l,f);if(null===g)break;if(v.push(g),!d)break;""===String(g[0])&&(l.lastIndex=Bo(f,le(l.lastIndex),p))}for(var h="",m=0,y=0;y<v.length;y++){g=v[y];for(var w=String(g[0]),x=Uo(qo(ce(g.index),f.length),0),b=[],S=1;S<g.length;S++)b.push(Wo(g[S]));var E=g.groups;if(s){var O=[w].concat(b,x,f);void 0!==E&&O.push(E);var T=String(r.apply(void 0,O))}else T=c(w,f,x,b,E,r);x>=m&&(h+=f.slice(m,x)+T,m=x+w.length)}return h+f.slice(m)}];function c(e,n,r,o,i,a){var c=r+e.length,u=o.length,l=Ho;return void 0!==i&&(i=Le(i),l=Go),t.call(a,l,(function(t,a){var l;switch(a.charAt(0)){case"$":return"$";case"&":return e;case"`":return n.slice(0,r);case"'":return n.slice(c);case"<":l=i[a.slice(1,-1)];break;default:var f=+a;if(0===f)return t;if(f>u){var s=Vo(f/10);return 0===s?t:s<=u?void 0===o[s-1]?a.charAt(1):o[s-1]+a.charAt(1):t}l=o[f-1]}return void 0===l?"":l}))}}));var zo=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};No("search",1,(function(e,t,n){return[function(t){var n=v(this),r=null==t?void 0:t[e];return void 0!==r?r.call(t,n):new RegExp(t)[e](String(n))},function(e){var r=n(t,e,this);if(r.done)return r.value;var o=j(e),i=String(this),a=o.lastIndex;zo(a,0)||(o.lastIndex=0);var c=$o(o,i);return zo(o.lastIndex,a)||(o.lastIndex=a),null===c?-1:c.index}]}));var Ko=[].push,Jo=Math.min,Yo=!o((function(){return!RegExp(4294967295,"y")}));No("split",2,(function(e,t,n){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var r=String(v(this)),o=void 0===n?4294967295:n>>>0;if(0===o)return[];if(void 0===e)return[r];if(!eo(e))return t.call(r,e,o);for(var i,a,c,u=[],l=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),f=0,s=new RegExp(e.source,l+"g");(i=To.call(s,r))&&!((a=s.lastIndex)>f&&(u.push(r.slice(f,i.index)),i.length>1&&i.index<r.length&&Ko.apply(u,i.slice(1)),c=i[0].length,f=a,u.length>=o));)s.lastIndex===i.index&&s.lastIndex++;return f===r.length?!c&&s.test("")||u.push(""):u.push(r.slice(f)),u.length>o?u.slice(0,o):u}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:t.call(this,e,n)}:t,[function(t,n){var o=v(this),i=null==t?void 0:t[e];return void 0!==i?i.call(t,o,n):r.call(String(o),t,n)},function(e,o){var i=n(r,e,this,o,r!==t);if(i.done)return i.value;var a=j(e),c=String(this),u=Fn(a,RegExp),l=a.unicode,f=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(Yo?"y":"g"),s=new u(Yo?a:"^(?:"+a.source+")",f),d=void 0===o?4294967295:o>>>0;if(0===d)return[];if(0===c.length)return null===$o(s,c)?[c]:[];for(var p=0,v=0,g=[];v<c.length;){s.lastIndex=Yo?v:0;var h,m=$o(s,Yo?c:c.slice(v));if(null===m||(h=Jo(le(s.lastIndex+(Yo?0:v)),c.length))===p)v=Bo(c,v,l);else{if(g.push(c.slice(p,v)),g.length===d)return g;for(var y=1;y<=m.length-1;y++)if(g.push(m[y]),g.length===d)return g;v=p=h}}return g.push(c.slice(p)),g}]}),!Yo);for(var Xo in{CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}){var Qo=r[Xo],Zo=Qo&&Qo.prototype;if(Zo&&Zo.forEach!==Tt)try{_(Zo,"forEach",Tt)}catch(e){Zo.forEach=Tt}}var ei=t((function(e){function t(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=t=function(e){return typeof e}:e.exports=t=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(n)}e.exports=t}));function ti(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,c=i.length;a<c;a++,o++)r[o]=i[a];return r}function ni(e){void 0===e&&(e="");var t=e.replace(/([A-Z])/g,"_$1").toLowerCase();return"_"===t[0]?t.substr(1):t}function ri(e){return JSON.parse(JSON.stringify(e))}function oi(e){void 0===e&&(e=5);for(var t="";e--;)t+=Math.floor(10*Math.random());return t}function ii(e,t){var n=void 0===t?{}:t,r=n.isNaNAsNumber,o=void 0!==r&&r,i=n.isUnFiniteAsNumber,a=!0;return"number"!=typeof e&&(a=!1),!1!==(void 0!==i&&i)||isFinite(e)||(a=!1),!1===o&&isNaN(e)&&(a=!1),a}function ai(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=null;return e&&"function"==typeof e&&(r=e.apply(void 0,t)),r}function ci(){return Date.now?Date.now():(new Date).getTime()}function ui(e){for(var t=e+"=",n=document.cookie.split(";"),r=0;r<n.length;r++){for(var o=n[r];" "==o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(t))return o.substring(t.length,o.length)}return""}function li(){try{var e=navigator.userAgent.toLowerCase(),t=function(t){return t.test(e)},n=function(t){return e.match(t).toString().replace(/[^0-9|_.]/g,"").replace(/_/g,".")},r="",o="";t(/windows|win32|win64|wow32|wow64/g)?r="windows":t(/macintosh|macintel/g)?r="macos":t(/x11/g)?r="linux":t(/android|adr/g)?r="android":t(/ios|iphone|ipad|ipod|iwatch/g)&&(r="ios",t(/iphone/g)?o="iphone":t(/ipad/g)?o="ipad":t(/iwatch/g)?o="iwatch":t(/ipod/g)&&(o="ipod"));var i="";"windows"===r?t(/windows nt 5.0|windows 2000/g)?i="2000":t(/windows nt 5.1|windows xp/g)?i="xp":t(/windows nt 5.2|windows 2003/g)?i="2003":t(/windows nt 6.0|windows vista/g)?i="vista":t(/windows nt 6.1|windows 7/g)?i="7":t(/windows nt 6.2|windows 8/g)?i="8":t(/windows nt 6.3|windows 8.1/g)?i="8.1":t(/windows nt 10.0|windows 10/g)&&(i="10"):"macos"===r?i=n(/os x [\d._]+/g):"android"===r?i=n(/android [\d._]+/g):"ios"===r&&(i=n(/os [\d._]+/g));var a="";"windows"===r||"macos"===r||"linux"===r?a="desktop":("android"===r||"ios"===r||t(/mobile/g))&&(a="mobile");var c="",u="";t(/applewebkit/g)?(c="webkit",t(/edge/g)?u="edge":t(/opr/g)?u="opera":t(/chrome/g)?u="chrome":t(/safari/g)&&(u="safari")):t(/gecko/g)&&t(/firefox/g)?(c="gecko",u="firefox"):t(/presto/g)?(c="presto",u="opera"):t(/trident|compatible|msie/g)&&(c="trident",u="iexplore");var l="";"webkit"===c?l=n(/applewebkit\/[\d._]+/g):"gecko"===c?l=n(/gecko\/[\d._]+/g):"presto"===c?l=n(/presto\/[\d._]+/g):"trident"===c&&(l=n(/trident\/[\d._]+/g));var f="";"chrome"===u?f=n(/chrome\/[\d._]+/g):"safari"===u?f=n(/version\/[\d._]+/g):"firefox"===u?f=n(/firefox\/[\d._]+/g):"opera"===u?f=n(/opr\/[\d._]+/g):"iexplore"===u?f=n(/(msie [\d._]+)|(rv:[\d._]+)/g):"edge"===u&&(f=n(/edge\/[\d._]+/g));var s="",d="";return t(/micromessenger/g)?(s="wechat",d=n(/micromessenger\/[\d._]+/g)):t(/qqbrowser/g)?(s="qq_browser",d=n(/qqbrowser\/[\d._]+/g)):t(/\sqq/g)?s="qq_app":t(/ucbrowser/g)?(s="uc",d=n(/ucbrowser\/[\d._]+/g)):t(/qihu 360se/g)?s="360":t(/2345explorer/g)?(s="2345",d=n(/2345explorer\/[\d._]+/g)):t(/metasr/g)?s="sougou":t(/lbbrowser/g)?s="liebao":t(/maxthon/g)?(s="maxthon",d=n(/maxthon\/[\d._]+/g)):t(/biliapp/g)&&(s="bilibili"),Object.assign({engine:c,engineVs:l,platform:a,supporter:u,supporterVs:f,system:r,systemVs:i},{shell:s,shellVs:d,appleType:o})}catch(e){return{}}}exports.addClass=function(e,t){var n,r=e.className,o="";""!==r&&(o=" "),n=r+o+t,e.className=n},exports.addInlineStyle=function(e){var t=void 0===e?{}:e,n=t.inlineStyle,r=void 0===n?"":n,o=t.id,i=void 0===o?"":o;if(!r)return!1;var a=document.createDocumentFragment(),c=null,u="",l=document.createElement("style");return i?(u=""+i,(c=document.getElementById(u))?c.innerHTML=r:(l.setAttribute("id",i),l.innerHTML=r,a.appendChild(l),document.head.appendChild(a))):(l.innerHTML=r,a.appendChild(l),document.head.appendChild(a)),!0},exports.calLongestCommonSubsequence=function(e,t){void 0===e&&(e=""),void 0===t&&(t="");for(var n=e.length,r=t.length,o=ri(new Array(n).fill(new Array(r).fill(0))),i=0;i<n;++i)for(var a=0;a<r;++a)if(e[i]===t[a]){var c=0;i>0&&a>0&&(c=o[i-1][a-1]),o[i][a]=c+1}else{var u=[0,0],l=u[0],f=u[1];a>0&&(l=o[i][a-1]),i>0&&(f=o[i-1][a]),o[i][a]=Math.max(l,f)}var s=Array.prototype.concat.apply([],o);return Math.max.apply(Math,s)},exports.calLongestCommonSubstring=function(e,t){void 0===e&&(e=""),void 0===t&&(t="");for(var n=e.length,r=t.length,o=ri(new Array(n).fill(new Array(r).fill(0))),i=0;i<n;++i)for(var a=0;a<r;++a)if(e[i]===t[a]){var c=0;i>0&&a>0&&(c=o[i-1][a-1]),o[i][a]=c+1}var u=Array.prototype.concat.apply([],o);return Math.max.apply(Math,u)},exports.camelCase2Underscore=ni,exports.camelCaseToKebabCase=function(e){void 0===e&&(e="");var t=e.replace(/([A-Z])/g,"-$1").toLowerCase();return"-"===t[0]?t.substr(1):t},exports.cancelBubble=function(e){var t=e||window.event;t.stopPropagation?t.stopPropagation():t.cancelBubble=!0},exports.clearHtml=function(e){return void 0===e&&(e=""),e.replace(/<\/?.+?>/g,"").replace(/[\r\n]/g,"")},exports.cutCHSString=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=e.length),void 0===n&&(n=!1),""!=e&&e){for(var r=0,o="",i=/[^\x00-\xff]/g,a="",c=e.replace(i,"**").length,u=0;u<c&&(null!=(a=e.charAt(u).toString()).match(i)?r+=2:r++,!(r>t));u++)o+=a;return n&&c>t&&(o+="..."),o}return""},exports.debounce=function(e,t,n){var r=null,o=null,i=null,a=null,c=null,u=function u(){var l=ci()-i;l<t&&l>=0?o=setTimeout(u,t-l):(o=null,n||(c=e.apply(r,a),o||(r=a=null)))};return function(){for(var l=[],f=0;f<arguments.length;f++)l[f]=arguments[f];r=this,a=l,i=ci();var s=n&&!o;return o||(o=setTimeout(u,t)),s&&(c=e.apply(r,a),r=a=null),c}},exports.deepCopyObject=ri,exports.doFn=ai,exports.floatFixed=function(e,t){return void 0===t&&(t=0),parseFloat(e).toFixed(t)},exports.floatToPercent=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=0),(t?(100*e).toFixed(t):String(Math.floor(100*e)))+"%"},exports.friendlyInterval=function(e){var t=void 0===e?{}:e,n=t.start,r=void 0===n?0:n,o=t.end,i=void 0===o?0:o,a=t.type,c=void 0===a?"d":a;ii(r)||(r=new Date(r).getTime()),ii(i)||(i=new Date(i).getTime());var u=i-r,l=null,f=new Array(4).fill(0),s=f[0],d=(f[1],f[2],f[3]);if(u>=0)switch(s=Math.floor(u/1e3/60/60/24),Math.floor(u/1e3/60/60),Math.floor(u/1e3/60),d=Math.floor(u/1e3),c){case"d":l=s;break;case"text":l=(s=Math.floor(u/1e3/60/60/24))+" 天 "+Math.floor(u/1e3/60/60%24)+" 时 "+Math.floor(u/1e3/60%60)+" 分 "+(d=Math.floor(u/1e3%60))+" 秒";break;default:l=d}return l},exports.genCustomConsole=function(e){var t=(void 0===e?{}:e).prefix,n=void 0===t?"":t,r=Object.create(null);return["log","info","warn","error"].forEach((function(e){r[e]=function(){for(var t,r,o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];n?(t=console)[e].apply(t,ti([n],o)):(r=console)[e].apply(r,o)}})),r},exports.generateRndNum=oi,exports.generateUniqueNum=function(e){void 0===e&&(e=3);var t=[ci(),oi(e||3)];return t[0]+t[1]},exports.getBrowserInfo=li,exports.getCookie=ui,exports.getDomain=function(e,t){void 0===e&&(e=""),void 0===t&&(t=["hostname"]);var n=document.createElement("a");return n.href=e,t.reduce((function(e,t){return e+=n[t]}),"")},exports.getHashQueryParam=function(e){void 0===e&&(e="");var t=location.hash.split("?");if(1===t.length)return"";var n=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),r=t[1].match(n);return r?r[2]:""},exports.getLocalStorage=function(e){var t=null;if(e){var n=localStorage.getItem(e);n&&(t=JSON.parse(n))}return t},exports.getPerformance=function(e){var t,n,r,o,i=(void 0===e?{}:e).camelCase,a=void 0===i||i,c=new Promise((function(e,r){var o;t=(o=[e,r])[0],n=o[1]})),u=window.performance.timing,l=u.navigationStart||u.fetchStart;function f(){try{if(window.performance&&Boolean(window.performance.getEntriesByType))window.performance.getEntriesByType("paint").forEach((function(e,t,n){var i=Math.round(e.startTime);"first-paint"===e.name?r=i:"first-contentful-paint"===e.name&&(o=i)}));else console.error("paint")}catch(e){console.error(e.message)}if(window.performance&&"function"==typeof window.performance.getEntries){var e,i=(window.performance.getEntries()||[])[0]||{},c={os:s(),osVersion:d(),deviceType:p(),network:v(),screenDirection:g(),unloadTime:u.unloadEventEnd-u.unloadEventStart,redirectTime:u.redirectEnd-u.redirectStart,dnsTime:u.domainLookupEnd-u.domainLookupStart,tcpTime:u.connectEnd-u.connectStart,sslTime:h(u.connectEnd,u.secureConnectionStart),responseTime:u.responseStart-u.requestStart,downloadTime:u.responseEnd-u.responseStart,firstPaintTime:r,firstContentfulPaintTime:o,domreadyTime:u.domContentLoadedEventStart-l||0,onloadTime:u.loadEventStart-l||0,whiteTime:u.responseStart-l,renderTime:u.loadEventEnd-l||0,decodedBodySize:i.decodedBodySize||"",encodedBodySize:i.encodedBodySize||""};if(Object.keys(c).forEach((function(e){ii(c[e])&&c[e]<0&&(c[e]=0)})),ii(c.whiteTime)&&c.whiteTime>c.onloadTime&&(c.whiteTime=0),l>0)a||Object.keys(c).forEach((function(t){e||(e={}),e[ni(t)]=c[t]})),t(e||c);else n("startTime")}else n("getEntries")}function s(){return navigator.userAgent.indexOf("Android")>-1||navigator.userAgent.indexOf("Linux")>-1?"android":navigator.userAgent.indexOf("iPhone")>-1?"ios":navigator.userAgent.indexOf("Windows Phone")>-1?"wp":"others"}function d(){var e,t=navigator.userAgent,n=t.indexOf("Android")>-1||t.indexOf("Linux")>-1,r=!!t.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);return n&&(e=(navigator.userAgent.split(";")[1].match(/\d+\.\d+/g)||[])[0]),r&&(e=(navigator.userAgent.split(";")[1].match(/(\d+)_(\d+)_?(\d+)?/)||[])[0]),e}function p(){var e=navigator.userAgent.toLowerCase(),t=e.match(/(ipad)/i)&&"ipad",n=e.match(/iphone os/i)&&"iphone os",r=e.match(/midp/i)&&"midp",o=e.match(/rv:1.2.3.4/i)&&"rv:1.2.3.4",i=e.match(/ucweb/i)&&"ucweb",a=e.match(/android/i)&&"android",c=e.match(/windows ce/i)&&"windows ce",u=e.match(/windows mobile/i)&&"windows mobile";return t||n||r||o||i||a||c||u?n||r||o||i||a||c||u?"phone":t?"ipad":void 0:"pc"}function v(){var e;if(navigator.connection&&navigator.connection.effectiveType)switch(navigator.connection.effectiveType){case"wifi":e="wifi";break;case"4g":e="4g";break;case"2g":e="2g";break;case"3g":e="3g";break;case"ethernet":e="ethernet";break;case"default":e=void 0}return e}function g(){var e;return window.screen&&window.screen.orientation&&window.screen.orientation.angle&&(180!==window.screen.orientation.angle&&0!==window.screen.orientation.angle||(e="|"),90!==window.screen.orientation.angle&&-90!==window.screen.orientation.angle||(e="-")),e}function h(e,t){var n;return t&&(n=e-t),n}return window.performance&&window.performance.timing&&window.performance.timing.loadEventEnd>0?f():window.addEventListener("load",(function(){window.setTimeout((function(){f()}),0)})),c},exports.getQueryParam=function(e){void 0===e&&(e="");var t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),n=location.search.substr(1).match(t);return null!==n?decodeURIComponent(unescape(n[2])):""},exports.getSessionStorage=function(e){var t=null;if(e){var n=sessionStorage.getItem(e);n&&(t=JSON.parse(n))}return t},exports.getUrlParam=function(e,t){void 0===e&&(e=""),void 0===t&&(t="");var n={};return e.replace(/\??(\w+)=([^&]*)&?/g,(function(e,t,r){if(void 0!==n[t]){var o=n[t];n[t]=[].concat(o,r)}else n[t]=r})),n[t]||""},exports.hasClass=function(e,t){for(var n=e.className.split(/\s+/),r=0;r<n.length;r++)if(n[r]===t)return!0;return!1},exports.inRate=function(e){return Math.random()<e},exports.isJsonString=function(e){void 0===e&&(e="");try{if("object"===ei(JSON.parse(e)))return!0}catch(e){}return!1},exports.isNumber=ii,exports.isSafePWAEnv=function(){var e=li();return!(!("serviceWorker"in navigator&&function(){var e;try{return e=new Function("return async function(){};")(),null!=Object.getPrototypeOf(e).constructor}catch(e){return!1}}()&&"undefined"!=typeof Promise&&-1!==Promise.toString().indexOf("[native code]")&&Boolean(window.fetch)&&Boolean(window.indexedDB)&&Boolean(window.caches))||e.shell)},exports.loadCSS=function(e){var t=void 0===e?{}:e,n=t.url,r=void 0===n?"":n,o=t.id,i=void 0===o?"":o,a=null,c=new Promise((function(e,t){var n;a=(n=[e,t])[0],n[1]})),u=function(){ai(a,!0)},l=document.createElement("link"),f="onload"in l,s=+navigator.userAgent.replace(/.*(?:AppleWebKit|AndroidWebKit)\/?(\d+).*/i,"$1")<536;if(l.rel="stylesheet",l.type="text/css",l.href=r,void 0!==i&&(l.id=i),document.getElementsByTagName("head")[0].appendChild(l),s||!f)return setTimeout((function(){p(l,u,0)}),1),c;function d(){l.onload=l.onerror=l.onreadystatechange=null,l=null,u()}function p(e,t,n){var r,o=e.sheet;if((n+=1)>3e5)return r=!0,e=null,void t();if(s)o&&(r=!0);else if(o)try{o.cssRules&&(r=!0)}catch(e){"NS_ERROR_DOM_SECURITY_ERR"===e.name&&(r=!0)}setTimeout((function(){r?t():p(e,t,n)}),20)}return f?(l.onload=d,l.onerror=function(){d()}):l.onreadystatechange=function(){/loaded|complete/.test(l.readyState)&&d()},c},exports.loadScript=function(e){var t=void 0===e?{}:e,n=t.url,r=void 0===n?"":n,o=t.id,i=void 0===o?"":o,a=t.callback,c=void 0===a?function(){}:a,u=t.timeout,l=void 0===u?5e3:u,f=t.isDefer,s=void 0!==f&&f,d=null,p=null,v=document.createElement("script"),g=document.getElementsByTagName("script")[0];return v.type="text/javascript",s&&(v.defer="defer"),i&&(v.id=i),v.readyState?v.onreadystatechange=function(){"loaded"!==v.readyState&&"complete"!==v.readyState||(v.onreadystatechange=null,ai(c),ai(d,!0))}:v.onload=function(){ai(c),ai(d,!0)},v.src=r,g&&g.parentNode.insertBefore(v,g),new Promise((function(e,t){var n;d=(n=[e,t])[0],p=n[1],l&&setTimeout(p.bind(null,"timeout"),l)}))},exports.mNow=ci,exports.mTrim=function(e){void 0===e&&(e="");for(var t=(e=e.replace(/^\s+/,"")).length-1,n=/\s/;n.test(e.charAt(t));)t--;return e.slice(0,t+1)},exports.newLine=function(e){if(void 0===e&&(e=""),!e)return"";var t=new RegExp("\\n","g");return e.replace(t,"<br />")},exports.removeClass=function(e,t){var n;n=(n=(n=(n=" "+e.className+" ").replace(/(\s+)/gi," ")).replace(" "+t+" "," ")).replace(/(^\s+)|(\s+$)/g,""),e.className=n},exports.setCookie=function(e,t,n,r){var o,i,a;n?((a=new Date).setTime(a.getTime()+24*n*60*60*1e3),i="; expires="+a.toGMTString()):i="";var c=location.host;1===c.split(".").length?document.cookie=e+"="+t+i+"; path=/":((o=c.split(".")).shift(),r=r||"."+o.join("."),document.cookie=e+"="+t+i+"; path=/; domain="+r,null!==ui(e)&&ui(e)===t||(r=r||"."+c,document.cookie=e+"="+t+i+"; path=/; domain="+r))},exports.setLocalStorage=function(e,t){void 0===t&&(t=null),e&&localStorage.setItem(e,JSON.stringify(t))},exports.setSessionStorage=function(e,t){void 0===t&&(t=null),e&&sessionStorage.setItem(e,JSON.stringify(t))},exports.throttle=function(e,t,n){var r=null,o=null,i=null,a=[null,0],c=a[0],u=a[1];n||(n={});var l=function(){u=!1===n.leading?0:ci(),i=null,c=e.apply(r,o),i||(r=o=null)};return function(){for(var a=[],f=0;f<arguments.length;f++)a[f]=arguments[f];var s=ci();u||!1!==n.leading||(u=s);var d=t-(s-u);return r=this,o=a,d<=0||d>t?(i&&(clearTimeout(i),i=null),u=s,c=e.apply(r,o),i||(r=o=null)):i||!1===n.trailing||(i=setTimeout(l,d)),c}},exports.updateQueryParam=function(e,t,n){void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n="");var r=new RegExp("([?&])"+t+"=.*?(&|$)","i"),o=-1!==e.indexOf("?")?"&":"?";return e.match(r)?e.replace(r,"$1"+t+"="+n+"$2"):e+o+t+"="+n},exports.windowLoaded=function(e){var t=(void 0===e?{}:e).timeout,n=void 0===t?90:t,r=function(){},o=function(){},i=new Promise((function(e,t){r=e,o=t}));return"complete"===document.readyState?r("complete"):window.addEventListener("load",(function(){return r("load")})),setTimeout((function(){return o("timeout")}),1e3*n),i};