UNPKG

jslib-tools

Version:

js工具库 封装常用的工具函数 如深拷贝 时间转换日期格式化、浏览器判断等,提高开发效率

1,544 lines (1,337 loc) 207 kB
/*! * jtools v0.1.6 * jlb web team */ 'use strict'; function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } var regeneratorRuntime = _interopDefault(require('regenerator-runtime')); // 7.1.4 ToInteger // 7.2.1 RequireObjectCoercible(argument) // 7.1.4 ToInteger var ceil$1 = Math.ceil; var floor$1 = Math.floor; var _toInteger$1 = function (it) { return isNaN(it = +it) ? 0 : (it > 0 ? floor$1 : ceil$1)(it); }; // 7.2.1 RequireObjectCoercible(argument) var _defined$1 = function (it) { if (it == undefined) throw TypeError("Can't call method on " + it); return it; }; function unwrapExports (x) { return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; } function createCommonjsModule(fn, module) { return module = { exports: {} }, fn(module, module.exports), module.exports; } var _global = createCommonjsModule(function (module) { // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 var global = module.exports = typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self // eslint-disable-next-line no-new-func : Function('return this')(); if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef }); var _core = createCommonjsModule(function (module) { var core = module.exports = { version: '2.6.12' }; if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef }); var _core_1 = _core.version; var _aFunction$1 = function (it) { if (typeof it != 'function') throw TypeError(it + ' is not a function!'); return it; }; var _isObject$1 = function (it) { return typeof it === 'object' ? it !== null : typeof it === 'function'; }; var _fails$1 = function (exec) { try { return !!exec(); } catch (e) { return true; } }; // Thank's IE8 for his funny defineProperty var _descriptors = !_fails$1(function () { return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; }); var _global$1 = createCommonjsModule(function (module) { // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 var global = module.exports = typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self // eslint-disable-next-line no-new-func : Function('return this')(); if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef }); var document$1 = _global$1.document; // typeof document.createElement is 'object' in old IE var is = _isObject$1(document$1) && _isObject$1(document$1.createElement); // Thank's IE8 for his funny defineProperty var _descriptors$1 = !_fails$1(function () { return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; }); var document$2 = _global$1.document; // typeof document.createElement is 'object' in old IE var is$1 = _isObject$1(document$2) && _isObject$1(document$2.createElement); var _domCreate$1 = function (it) { return is$1 ? document$2.createElement(it) : {}; }; var _ie8DomDefine = !_descriptors$1 && !_fails$1(function () { return Object.defineProperty(_domCreate$1('div'), 'a', { get: function () { return 7; } }).a != 7; }); var _anObject$1 = function (it) { if (!_isObject$1(it)) throw TypeError(it + ' is not an object!'); return it; }; var _ie8DomDefine$1 = !_descriptors$1 && !_fails$1(function () { return Object.defineProperty(_domCreate$1('div'), 'a', { get: function () { return 7; } }).a != 7; }); // 7.1.1 ToPrimitive(input [, PreferredType]) // instead of the ES6 spec version, we didn't implement @@toPrimitive case // and the second argument - flag - preferred type is a string var _toPrimitive$1 = function (it, S) { if (!_isObject$1(it)) return it; var fn, val; if (S && typeof (fn = it.toString) == 'function' && !_isObject$1(val = fn.call(it))) return val; if (typeof (fn = it.valueOf) == 'function' && !_isObject$1(val = fn.call(it))) return val; if (!S && typeof (fn = it.toString) == 'function' && !_isObject$1(val = fn.call(it))) return val; throw TypeError("Can't convert object to primitive value"); }; var dP$1 = Object.defineProperty; var f$1 = _descriptors$1 ? Object.defineProperty : function defineProperty(O, P, Attributes) { _anObject$1(O); P = _toPrimitive$1(P, true); _anObject$1(Attributes); if (_ie8DomDefine$1) try { return dP$1(O, P, Attributes); } catch (e) { /* empty */ } if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); if ('value' in Attributes) O[P] = Attributes.value; return O; }; var _objectDp$1 = { f: f$1 }; var _propertyDesc$1 = function (bitmap, value) { return { enumerable: !(bitmap & 1), configurable: !(bitmap & 2), writable: !(bitmap & 4), value: value }; }; var _core$1 = createCommonjsModule(function (module) { var core = module.exports = { version: '2.6.12' }; if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef }); var _core_1$1 = _core$1.version; // optional / simple context binding var _ctx$1 = function (fn, that, length) { _aFunction$1(fn); if (that === undefined) return fn; switch (length) { case 1: return function (a) { return fn.call(that, a); }; case 2: return function (a, b) { return fn.call(that, a, b); }; case 3: return function (a, b, c) { return fn.call(that, a, b, c); }; } return function (/* ...args */) { return fn.apply(that, arguments); }; }; var _hide$1 = _descriptors$1 ? function (object, key, value) { return _objectDp$1.f(object, key, _propertyDesc$1(1, value)); } : function (object, key, value) { object[key] = value; return object; }; var hasOwnProperty$1 = {}.hasOwnProperty; var _has$1 = function (it, key) { return hasOwnProperty$1.call(it, key); }; var toString$1 = {}.toString; var _cof$1 = function (it) { return toString$1.call(it).slice(8, -1); }; // fallback for non-array-like ES3 and non-enumerable old V8 strings // eslint-disable-next-line no-prototype-builtins var _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) { return _cof$1(it) == 'String' ? it.split('') : Object(it); }; // fallback for non-array-like ES3 and non-enumerable old V8 strings // eslint-disable-next-line no-prototype-builtins var _iobject$1 = Object('z').propertyIsEnumerable(0) ? Object : function (it) { return _cof$1(it) == 'String' ? it.split('') : Object(it); }; // to indexed object, toObject with fallback for non-array-like ES3 strings var _toIobject$1 = function (it) { return _iobject$1(_defined$1(it)); }; // 7.1.15 ToLength var min$2 = Math.min; var _toLength$1 = function (it) { return it > 0 ? min$2(_toInteger$1(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 }; var max$1 = Math.max; var min$3 = Math.min; var _toAbsoluteIndex$1 = function (index, length) { index = _toInteger$1(index); return index < 0 ? max$1(index + length, 0) : min$3(index, length); }; var _library$1 = true; var _shared = createCommonjsModule(function (module) { var SHARED = '__core-js_shared__'; var store = _global$1[SHARED] || (_global$1[SHARED] = {}); (module.exports = function (key, value) { return store[key] || (store[key] = value !== undefined ? value : {}); })('versions', []).push({ version: _core$1.version, mode: 'pure', copyright: '© 2020 Denis Pushkarev (zloirock.ru)' }); }); var _shared$1 = createCommonjsModule(function (module) { var SHARED = '__core-js_shared__'; var store = _global$1[SHARED] || (_global$1[SHARED] = {}); (module.exports = function (key, value) { return store[key] || (store[key] = value !== undefined ? value : {}); })('versions', []).push({ version: _core$1.version, mode: 'pure', copyright: '© 2020 Denis Pushkarev (zloirock.ru)' }); }); var id$1 = 0; var px$1 = Math.random(); var _uid$1 = function (key) { return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id$1 + px$1).toString(36)); }; var shared = _shared$1('keys'); // false -> Array#indexOf // true -> Array#includes var _arrayIncludes$1 = function (IS_INCLUDES) { return function ($this, el, fromIndex) { var O = _toIobject$1($this); var length = _toLength$1(O.length); var index = _toAbsoluteIndex$1(fromIndex, length); var value; // Array#includes uses SameValueZero equality algorithm // eslint-disable-next-line no-self-compare if (IS_INCLUDES && el != el) while (length > index) { value = O[index++]; // eslint-disable-next-line no-self-compare if (value != value) return true; // Array#indexOf ignores holes, Array#includes - not } else for (;length > index; index++) if (IS_INCLUDES || index in O) { if (O[index] === el) return IS_INCLUDES || index || 0; } return !IS_INCLUDES && -1; }; }; var shared$1 = _shared$1('keys'); var _sharedKey$1 = function (key) { return shared$1[key] || (shared$1[key] = _uid$1(key)); }; var IE_PROTO = _sharedKey$1('IE_PROTO'); // IE 8- don't enum bug keys var arrayIndexOf$1 = _arrayIncludes$1(false); var IE_PROTO$1 = _sharedKey$1('IE_PROTO'); var _objectKeysInternal$1 = function (object, names) { var O = _toIobject$1(object); var i = 0; var result = []; var key; for (key in O) if (key != IE_PROTO$1) _has$1(O, key) && result.push(key); // Don't enum bug & hidden keys while (names.length > i) if (_has$1(O, key = names[i++])) { ~arrayIndexOf$1(result, key) || result.push(key); } return result; }; // IE 8- don't enum bug keys var _enumBugKeys$1 = ( 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' ).split(','); // 19.1.2.14 / 15.2.3.14 Object.keys(O) var _objectKeys$1 = Object.keys || function keys(O) { return _objectKeysInternal$1(O, _enumBugKeys$1); }; var document$3 = _global$1.document; var _html = document$3 && document$3.documentElement; var _objectDps$1 = _descriptors$1 ? Object.defineProperties : function defineProperties(O, Properties) { _anObject$1(O); var keys = _objectKeys$1(Properties); var length = keys.length; var i = 0; var P; while (length > i) _objectDp$1.f(O, P = keys[i++], Properties[P]); return O; }; var document$4 = _global$1.document; var _html$1 = document$4 && document$4.documentElement; // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) var IE_PROTO$2 = _sharedKey$1('IE_PROTO'); var _wks = createCommonjsModule(function (module) { var store = _shared$1('wks'); var Symbol = _global$1.Symbol; var USE_SYMBOL = typeof Symbol == 'function'; var $exports = module.exports = function (name) { return store[name] || (store[name] = USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : _uid$1)('Symbol.' + name)); }; $exports.store = store; }); var _wks$1 = createCommonjsModule(function (module) { var store = _shared$1('wks'); var Symbol = _global$1.Symbol; var USE_SYMBOL = typeof Symbol == 'function'; var $exports = module.exports = function (name) { return store[name] || (store[name] = USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : _uid$1)('Symbol.' + name)); }; $exports.store = store; }); var TAG = _wks$1('toStringTag'); // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) var IE_PROTO$3 = _sharedKey$1('IE_PROTO'); var Empty$1 = function () { /* empty */ }; var PROTOTYPE$2 = 'prototype'; // Create object with fake `null` prototype: use iframe Object with cleared prototype var createDict$1 = function () { // Thrash, waste and sodomy: IE GC bug var iframe = _domCreate$1('iframe'); var i = _enumBugKeys$1.length; var lt = '<'; var gt = '>'; var iframeDocument; iframe.style.display = 'none'; _html$1.appendChild(iframe); iframe.src = 'javascript:'; // eslint-disable-line no-script-url // createDict = iframe.contentWindow.Object; // html.removeChild(iframe); iframeDocument = iframe.contentWindow.document; iframeDocument.open(); iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); iframeDocument.close(); createDict$1 = iframeDocument.F; while (i--) delete createDict$1[PROTOTYPE$2][_enumBugKeys$1[i]]; return createDict$1(); }; var _objectCreate$1 = Object.create || function create(O, Properties) { var result; if (O !== null) { Empty$1[PROTOTYPE$2] = _anObject$1(O); result = new Empty$1(); Empty$1[PROTOTYPE$2] = null; // add "__proto__" for Object.getPrototypeOf polyfill result[IE_PROTO$3] = O; } else result = createDict$1(); return Properties === undefined ? result : _objectDps$1(result, Properties); }; var def$1 = _objectDp$1.f; var TAG$1 = _wks$1('toStringTag'); var _setToStringTag$1 = function (it, tag, stat) { if (it && !_has$1(it = stat ? it : it.prototype, TAG$1)) def$1(it, TAG$1, { configurable: true, value: tag }); }; var IteratorPrototype = {}; // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() _hide$1(IteratorPrototype, _wks$1('iterator'), function () { return this; }); // 7.1.13 ToObject(argument) var _toObject$1 = function (it) { return Object(_defined$1(it)); }; // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) var IE_PROTO$4 = _sharedKey$1('IE_PROTO'); var PROTOTYPE$3 = 'prototype'; var $export$1 = function (type, name, source) { var IS_FORCED = type & $export$1.F; var IS_GLOBAL = type & $export$1.G; var IS_STATIC = type & $export$1.S; var IS_PROTO = type & $export$1.P; var IS_BIND = type & $export$1.B; var IS_WRAP = type & $export$1.W; var exports = IS_GLOBAL ? _core$1 : _core$1[name] || (_core$1[name] = {}); var expProto = exports[PROTOTYPE$3]; var target = IS_GLOBAL ? _global$1 : IS_STATIC ? _global$1[name] : (_global$1[name] || {})[PROTOTYPE$3]; var key, own, out; if (IS_GLOBAL) source = name; for (key in source) { // contains in native own = !IS_FORCED && target && target[key] !== undefined; if (own && _has$1(exports, key)) continue; // export native or passed out = own ? target[key] : source[key]; // prevent global pollution for namespaces exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] // bind timers to global for call from export context : IS_BIND && own ? _ctx$1(out, _global$1) // wrap global constructors for prevent change them in library : IS_WRAP && target[key] == out ? (function (C) { var F = function (a, b, c) { if (this instanceof C) { switch (arguments.length) { case 0: return new C(); case 1: return new C(a); case 2: return new C(a, b); } return new C(a, b, c); } return C.apply(this, arguments); }; F[PROTOTYPE$3] = C[PROTOTYPE$3]; return F; // make static versions for prototype methods })(out) : IS_PROTO && typeof out == 'function' ? _ctx$1(Function.call, out) : out; // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% if (IS_PROTO) { (exports.virtual || (exports.virtual = {}))[key] = out; // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% if (type & $export$1.R && expProto && !expProto[key]) _hide$1(expProto, key, out); } } }; // type bitmap $export$1.F = 1; // forced $export$1.G = 2; // global $export$1.S = 4; // static $export$1.P = 8; // proto $export$1.B = 16; // bind $export$1.W = 32; // wrap $export$1.U = 64; // safe $export$1.R = 128; // real proto method for `library` var _export$1 = $export$1; var _redefine$1 = _hide$1; var _iterators$1 = {}; var IteratorPrototype$1 = {}; // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() _hide$1(IteratorPrototype$1, _wks$1('iterator'), function () { return this; }); var _iterCreate$1 = function (Constructor, NAME, next) { Constructor.prototype = _objectCreate$1(IteratorPrototype$1, { next: _propertyDesc$1(1, next) }); _setToStringTag$1(Constructor, NAME + ' Iterator'); }; // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) var IE_PROTO$5 = _sharedKey$1('IE_PROTO'); var ObjectProto$1 = Object.prototype; var _objectGpo$1 = Object.getPrototypeOf || function (O) { O = _toObject$1(O); if (_has$1(O, IE_PROTO$5)) return O[IE_PROTO$5]; if (typeof O.constructor == 'function' && O instanceof O.constructor) { return O.constructor.prototype; } return O instanceof Object ? ObjectProto$1 : null; }; var ITERATOR = _wks$1('iterator'); var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` // true -> String#at // false -> String#codePointAt var _stringAt$1 = function (TO_STRING) { return function (that, pos) { var s = String(_defined$1(that)); var i = _toInteger$1(pos); var l = s.length; var a, b; if (i < 0 || i >= l) return TO_STRING ? '' : undefined; a = s.charCodeAt(i); return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff ? TO_STRING ? s.charAt(i) : a : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; }; }; var ITERATOR$1 = _wks$1('iterator'); var BUGGY$1 = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` var FF_ITERATOR$1 = '@@iterator'; var KEYS$1 = 'keys'; var VALUES$1 = 'values'; var returnThis$1 = function () { return this; }; var _iterDefine$1 = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { _iterCreate$1(Constructor, NAME, next); var getMethod = function (kind) { if (!BUGGY$1 && kind in proto) return proto[kind]; switch (kind) { case KEYS$1: return function keys() { return new Constructor(this, kind); }; case VALUES$1: return function values() { return new Constructor(this, kind); }; } return function entries() { return new Constructor(this, kind); }; }; var TAG = NAME + ' Iterator'; var DEF_VALUES = DEFAULT == VALUES$1; var VALUES_BUG = false; var proto = Base.prototype; var $native = proto[ITERATOR$1] || proto[FF_ITERATOR$1] || DEFAULT && proto[DEFAULT]; var $default = $native || getMethod(DEFAULT); var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; var methods, key, IteratorPrototype; // Fix native if ($anyNative) { IteratorPrototype = _objectGpo$1($anyNative.call(new Base())); if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { // Set @@toStringTag to native iterators _setToStringTag$1(IteratorPrototype, TAG, true); } } // fix Array#{values, @@iterator}.name in V8 / FF if (DEF_VALUES && $native && $native.name !== VALUES$1) { VALUES_BUG = true; $default = function values() { return $native.call(this); }; } // Define iterator if ((FORCED) && (BUGGY$1 || VALUES_BUG || !proto[ITERATOR$1])) { _hide$1(proto, ITERATOR$1, $default); } // Plug for library _iterators$1[NAME] = $default; _iterators$1[TAG] = returnThis$1; if (DEFAULT) { methods = { values: DEF_VALUES ? $default : getMethod(VALUES$1), keys: IS_SET ? $default : getMethod(KEYS$1), entries: $entries }; if (FORCED) for (key in methods) { if (!(key in proto)) _redefine$1(proto, key, methods[key]); } else _export$1(_export$1.P + _export$1.F * (BUGGY$1 || VALUES_BUG), NAME, methods); } return methods; }; var $at = _stringAt$1(true); // 21.1.3.27 String.prototype[@@iterator]() _iterDefine$1(String, 'String', function (iterated) { this._t = String(iterated); // target this._i = 0; // next index // 21.1.5.2.1 %StringIteratorPrototype%.next() }, function () { var O = this._t; var index = this._i; var point; if (index >= O.length) return { value: undefined, done: true }; point = $at(O, index); this._i += point.length; return { value: point, done: false }; }); var _iterStep$1 = function (done, value) { return { value: value, done: !!done }; }; // 22.1.3.4 Array.prototype.entries() // 22.1.3.13 Array.prototype.keys() // 22.1.3.29 Array.prototype.values() // 22.1.3.30 Array.prototype[@@iterator]() var es6_array_iterator = _iterDefine$1(Array, 'Array', function (iterated, kind) { this._t = _toIobject$1(iterated); // target this._i = 0; // next index this._k = kind; // kind // 22.1.5.2.1 %ArrayIteratorPrototype%.next() }, function () { var O = this._t; var kind = this._k; var index = this._i++; if (!O || index >= O.length) { this._t = undefined; return _iterStep$1(1); } if (kind == 'keys') return _iterStep$1(0, index); if (kind == 'values') return _iterStep$1(0, O[index]); return _iterStep$1(0, [index, O[index]]); }, 'values'); // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) _iterators$1.Arguments = _iterators$1.Array; // 22.1.3.4 Array.prototype.entries() // 22.1.3.13 Array.prototype.keys() // 22.1.3.29 Array.prototype.values() // 22.1.3.30 Array.prototype[@@iterator]() var es6_array_iterator$1 = _iterDefine$1(Array, 'Array', function (iterated, kind) { this._t = _toIobject$1(iterated); // target this._i = 0; // next index this._k = kind; // kind // 22.1.5.2.1 %ArrayIteratorPrototype%.next() }, function () { var O = this._t; var kind = this._k; var index = this._i++; if (!O || index >= O.length) { this._t = undefined; return _iterStep$1(1); } if (kind == 'keys') return _iterStep$1(0, index); if (kind == 'values') return _iterStep$1(0, O[index]); return _iterStep$1(0, [index, O[index]]); }, 'values'); // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) _iterators$1.Arguments = _iterators$1.Array; var TO_STRING_TAG = _wks$1('toStringTag'); var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' + 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' + 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' + 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' + 'TextTrackList,TouchList').split(','); for (var i = 0; i < DOMIterables.length; i++) { var NAME = DOMIterables[i]; var Collection = _global$1[NAME]; var proto = Collection && Collection.prototype; if (proto && !proto[TO_STRING_TAG]) _hide$1(proto, TO_STRING_TAG, NAME); _iterators$1[NAME] = _iterators$1.Array; } // getting tag from 19.1.3.6 Object.prototype.toString() var TAG$2 = _wks$1('toStringTag'); // ES3 wrong here var ARG = _cof$1(function () { return arguments; }()) == 'Arguments'; // check on default Array iterator var ITERATOR$2 = _wks$1('iterator'); // getting tag from 19.1.3.6 Object.prototype.toString() var TAG$3 = _wks$1('toStringTag'); // ES3 wrong here var ARG$1 = _cof$1(function () { return arguments; }()) == 'Arguments'; // fallback for IE11 Script Access Denied error var tryGet$1 = function (it, key) { try { return it[key]; } catch (e) { /* empty */ } }; var _classof$1 = function (it) { var O, T, B; return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case : typeof (T = tryGet$1(O = Object(it), TAG$3)) == 'string' ? T // builtinTag case : ARG$1 ? _cof$1(O) // ES3 arguments fallback : (B = _cof$1(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; }; var ITERATOR$3 = _wks$1('iterator'); var core_getIteratorMethod = _core$1.getIteratorMethod = function (it) { if (it != undefined) return it[ITERATOR$3] || it['@@iterator'] || _iterators$1[_classof$1(it)]; }; // call something on iterator step with safe closing on error var _iterCall$1 = function (iterator, fn, value, entries) { try { return entries ? fn(_anObject$1(value)[0], value[1]) : fn(value); // 7.4.6 IteratorClose(iterator, completion) } catch (e) { var ret = iterator['return']; if (ret !== undefined) _anObject$1(ret.call(iterator)); throw e; } }; // check on default Array iterator var ITERATOR$4 = _wks$1('iterator'); var ArrayProto$1 = Array.prototype; var _isArrayIter$1 = function (it) { return it !== undefined && (_iterators$1.Array === it || ArrayProto$1[ITERATOR$4] === it); }; var ITERATOR$5 = _wks$1('iterator'); var core_getIteratorMethod$1 = _core$1.getIteratorMethod = function (it) { if (it != undefined) return it[ITERATOR$5] || it['@@iterator'] || _iterators$1[_classof$1(it)]; }; var _forOf = createCommonjsModule(function (module) { var BREAK = {}; var RETURN = {}; var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) { var iterFn = ITERATOR ? function () { return iterable; } : core_getIteratorMethod$1(iterable); var f = _ctx$1(fn, that, entries ? 2 : 1); var index = 0; var length, step, iterator, result; if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!'); // fast case for arrays with default iterator if (_isArrayIter$1(iterFn)) for (length = _toLength$1(iterable.length); length > index; index++) { result = entries ? f(_anObject$1(step = iterable[index])[0], step[1]) : f(iterable[index]); if (result === BREAK || result === RETURN) return result; } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) { result = _iterCall$1(iterator, f, step.value, entries); if (result === BREAK || result === RETURN) return result; } }; exports.BREAK = BREAK; exports.RETURN = RETURN; }); // 7.3.20 SpeciesConstructor(O, defaultConstructor) var SPECIES = _wks$1('species'); // fast apply, http://jsperf.lnkit.com/fast-apply/5 // fast apply, http://jsperf.lnkit.com/fast-apply/5 var _invoke$1 = function (fn, args, that) { var un = that === undefined; switch (args.length) { case 0: return un ? fn() : fn.call(that); case 1: return un ? fn(args[0]) : fn.call(that, args[0]); case 2: return un ? fn(args[0], args[1]) : fn.call(that, args[0], args[1]); case 3: return un ? fn(args[0], args[1], args[2]) : fn.call(that, args[0], args[1], args[2]); case 4: return un ? fn(args[0], args[1], args[2], args[3]) : fn.call(that, args[0], args[1], args[2], args[3]); } return fn.apply(that, args); }; var process$1 = _global$1.process; var setTask = _global$1.setImmediate; var clearTask = _global$1.clearImmediate; var MessageChannel = _global$1.MessageChannel; var Dispatch = _global$1.Dispatch; var counter = 0; var queue = {}; var ONREADYSTATECHANGE = 'onreadystatechange'; var defer, channel, port; var run = function () { var id = +this; // eslint-disable-next-line no-prototype-builtins if (queue.hasOwnProperty(id)) { var fn = queue[id]; delete queue[id]; fn(); } }; var listener = function (event) { run.call(event.data); }; // Node.js 0.9+ & IE10+ has setImmediate, otherwise: if (!setTask || !clearTask) { setTask = function setImmediate(fn) { var args = []; var i = 1; while (arguments.length > i) args.push(arguments[i++]); queue[++counter] = function () { // eslint-disable-next-line no-new-func _invoke$1(typeof fn == 'function' ? fn : Function(fn), args); }; defer(counter); return counter; }; clearTask = function clearImmediate(id) { delete queue[id]; }; // Node.js 0.8- if (_cof$1(process$1) == 'process') { defer = function (id) { process$1.nextTick(_ctx$1(run, id, 1)); }; // Sphere (JS game engine) Dispatch API } else if (Dispatch && Dispatch.now) { defer = function (id) { Dispatch.now(_ctx$1(run, id, 1)); }; // Browsers with MessageChannel, includes WebWorkers } else if (MessageChannel) { channel = new MessageChannel(); port = channel.port2; channel.port1.onmessage = listener; defer = _ctx$1(port.postMessage, port, 1); // Browsers with postMessage, skip WebWorkers // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' } else if (_global$1.addEventListener && typeof postMessage == 'function' && !_global$1.importScripts) { defer = function (id) { _global$1.postMessage(id + '', '*'); }; _global$1.addEventListener('message', listener, false); // IE8- } else if (ONREADYSTATECHANGE in _domCreate$1('script')) { defer = function (id) { _html$1.appendChild(_domCreate$1('script'))[ONREADYSTATECHANGE] = function () { _html$1.removeChild(this); run.call(id); }; }; // Rest old browsers } else { defer = function (id) { setTimeout(_ctx$1(run, id, 1), 0); }; } } var process$2 = _global$1.process; var setTask$1 = _global$1.setImmediate; var clearTask$1 = _global$1.clearImmediate; var MessageChannel$1 = _global$1.MessageChannel; var Dispatch$1 = _global$1.Dispatch; var counter$1 = 0; var queue$1 = {}; var ONREADYSTATECHANGE$1 = 'onreadystatechange'; var defer$1, channel$1, port$1; var run$1 = function () { var id = +this; // eslint-disable-next-line no-prototype-builtins if (queue$1.hasOwnProperty(id)) { var fn = queue$1[id]; delete queue$1[id]; fn(); } }; var listener$1 = function (event) { run$1.call(event.data); }; // Node.js 0.9+ & IE10+ has setImmediate, otherwise: if (!setTask$1 || !clearTask$1) { setTask$1 = function setImmediate(fn) { var args = []; var i = 1; while (arguments.length > i) args.push(arguments[i++]); queue$1[++counter$1] = function () { // eslint-disable-next-line no-new-func _invoke$1(typeof fn == 'function' ? fn : Function(fn), args); }; defer$1(counter$1); return counter$1; }; clearTask$1 = function clearImmediate(id) { delete queue$1[id]; }; // Node.js 0.8- if (_cof$1(process$2) == 'process') { defer$1 = function (id) { process$2.nextTick(_ctx$1(run$1, id, 1)); }; // Sphere (JS game engine) Dispatch API } else if (Dispatch$1 && Dispatch$1.now) { defer$1 = function (id) { Dispatch$1.now(_ctx$1(run$1, id, 1)); }; // Browsers with MessageChannel, includes WebWorkers } else if (MessageChannel$1) { channel$1 = new MessageChannel$1(); port$1 = channel$1.port2; channel$1.port1.onmessage = listener$1; defer$1 = _ctx$1(port$1.postMessage, port$1, 1); // Browsers with postMessage, skip WebWorkers // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' } else if (_global$1.addEventListener && typeof postMessage == 'function' && !_global$1.importScripts) { defer$1 = function (id) { _global$1.postMessage(id + '', '*'); }; _global$1.addEventListener('message', listener$1, false); // IE8- } else if (ONREADYSTATECHANGE$1 in _domCreate$1('script')) { defer$1 = function (id) { _html$1.appendChild(_domCreate$1('script'))[ONREADYSTATECHANGE$1] = function () { _html$1.removeChild(this); run$1.call(id); }; }; // Rest old browsers } else { defer$1 = function (id) { setTimeout(_ctx$1(run$1, id, 1), 0); }; } } var _task$1 = { set: setTask$1, clear: clearTask$1 }; var Observer = _global$1.MutationObserver || _global$1.WebKitMutationObserver; var process$3 = _global$1.process; var Promise = _global$1.Promise; var isNode = _cof$1(process$3) == 'process'; var navigator$1 = _global$1.navigator; var _userAgent = navigator$1 && navigator$1.userAgent || ''; // 25.4.1.5 NewPromiseCapability(C) function PromiseCapability$1(C) { var resolve, reject; this.promise = new C(function ($$resolve, $$reject) { if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); resolve = $$resolve; reject = $$reject; }); this.resolve = _aFunction$1(resolve); this.reject = _aFunction$1(reject); } var f$3 = function (C) { return new PromiseCapability$1(C); }; var _newPromiseCapability$1 = { f: f$3 }; var SPECIES$1 = _wks$1('species'); var ITERATOR$6 = _wks$1('iterator'); try { var riter = [7][ITERATOR$6](); riter['return'] = function () { }; } catch (e) { /* empty */ } var _anInstance$1 = function (it, Constructor, name, forbiddenField) { if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) { throw TypeError(name + ': incorrect invocation!'); } return it; }; var _forOf$1 = createCommonjsModule(function (module) { var BREAK = {}; var RETURN = {}; var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) { var iterFn = ITERATOR ? function () { return iterable; } : core_getIteratorMethod$1(iterable); var f = _ctx$1(fn, that, entries ? 2 : 1); var index = 0; var length, step, iterator, result; if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!'); // fast case for arrays with default iterator if (_isArrayIter$1(iterFn)) for (length = _toLength$1(iterable.length); length > index; index++) { result = entries ? f(_anObject$1(step = iterable[index])[0], step[1]) : f(iterable[index]); if (result === BREAK || result === RETURN) return result; } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) { result = _iterCall$1(iterator, f, step.value, entries); if (result === BREAK || result === RETURN) return result; } }; exports.BREAK = BREAK; exports.RETURN = RETURN; }); // 7.3.20 SpeciesConstructor(O, defaultConstructor) var SPECIES$2 = _wks$1('species'); var _speciesConstructor$1 = function (O, D) { var C = _anObject$1(O).constructor; var S; return C === undefined || (S = _anObject$1(C)[SPECIES$2]) == undefined ? D : _aFunction$1(S); }; var macrotask$1 = _task$1.set; var Observer$1 = _global$1.MutationObserver || _global$1.WebKitMutationObserver; var process$4 = _global$1.process; var Promise$1 = _global$1.Promise; var isNode$1 = _cof$1(process$4) == 'process'; var _microtask$1 = function () { var head, last, notify; var flush = function () { var parent, fn; if (isNode$1 && (parent = process$4.domain)) parent.exit(); while (head) { fn = head.fn; head = head.next; try { fn(); } catch (e) { if (head) notify(); else last = undefined; throw e; } } last = undefined; if (parent) parent.enter(); }; // Node.js if (isNode$1) { notify = function () { process$4.nextTick(flush); }; // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339 } else if (Observer$1 && !(_global$1.navigator && _global$1.navigator.standalone)) { var toggle = true; var node = document.createTextNode(''); new Observer$1(flush).observe(node, { characterData: true }); // eslint-disable-line no-new notify = function () { node.data = toggle = !toggle; }; // environments with maybe non-completely correct, but existent Promise } else if (Promise$1 && Promise$1.resolve) { // Promise.resolve without an argument throws an error in LG WebOS 2 var promise = Promise$1.resolve(undefined); notify = function () { promise.then(flush); }; // for other environments - macrotask based on: // - setImmediate // - MessageChannel // - window.postMessag // - onreadystatechange // - setTimeout } else { notify = function () { // strange IE + webpack dev server bug - use .call(global) macrotask$1.call(_global$1, flush); }; } return function (fn) { var task = { fn: fn, next: undefined }; if (last) last.next = task; if (!head) { head = task; notify(); } last = task; }; }; var _perform$1 = function (exec) { try { return { e: false, v: exec() }; } catch (e) { return { e: true, v: e }; } }; var navigator$2 = _global$1.navigator; var _userAgent$1 = navigator$2 && navigator$2.userAgent || ''; var _promiseResolve$1 = function (C, x) { _anObject$1(C); if (_isObject$1(x) && x.constructor === C) return x; var promiseCapability = _newPromiseCapability$1.f(C); var resolve = promiseCapability.resolve; resolve(x); return promiseCapability.promise; }; var _redefineAll$1 = function (target, src, safe) { for (var key in src) { if (safe && target[key]) target[key] = src[key]; else _hide$1(target, key, src[key]); } return target; }; var SPECIES$3 = _wks$1('species'); var _setSpecies$1 = function (KEY) { var C = typeof _core$1[KEY] == 'function' ? _core$1[KEY] : _global$1[KEY]; if (_descriptors$1 && C && !C[SPECIES$3]) _objectDp$1.f(C, SPECIES$3, { configurable: true, get: function () { return this; } }); }; var ITERATOR$7 = _wks$1('iterator'); var SAFE_CLOSING$1 = false; try { var riter$1 = [7][ITERATOR$7](); riter$1['return'] = function () { SAFE_CLOSING$1 = true; }; } catch (e) { /* empty */ } var _iterDetect$1 = function (exec, skipClosing) { if (!skipClosing && !SAFE_CLOSING$1) return false; var safe = false; try { var arr = [7]; var iter = arr[ITERATOR$7](); iter.next = function () { return { done: safe = true }; }; arr[ITERATOR$7] = function () { return iter; }; exec(arr); } catch (e) { /* empty */ } return safe; }; var task = _task$1.set; var microtask = _microtask$1(); var PROMISE = 'Promise'; var TypeError$1 = _global$1.TypeError; var process$5 = _global$1.process; var versions = process$5 && process$5.versions; var v8 = versions && versions.v8 || ''; var $Promise = _global$1[PROMISE]; var isNode$2 = _classof$1(process$5) == 'process'; var empty = function () { /* empty */ }; var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper; var newPromiseCapability = newGenericPromiseCapability = _newPromiseCapability$1.f; var USE_NATIVE = !!function () { try { // correct subclassing with @@species support var promise = $Promise.resolve(1); var FakePromise = (promise.constructor = {})[_wks$1('species')] = function (exec) { exec(empty, empty); }; // unhandled rejections tracking support, NodeJS Promise without it fails @@species test return (isNode$2 || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 // we can't detect it synchronously, so just check versions && v8.indexOf('6.6') !== 0 && _userAgent$1.indexOf('Chrome/66') === -1; } catch (e) { /* empty */ } }(); // helpers var isThenable = function (it) { var then; return _isObject$1(it) && typeof (then = it.then) == 'function' ? then : false; }; var notify = function (promise, isReject) { if (promise._n) return; promise._n = true; var chain = promise._c; microtask(function () { var value = promise._v; var ok = promise._s == 1; var i = 0; var run = function (reaction) { var handler = ok ? reaction.ok : reaction.fail; var resolve = reaction.resolve; var reject = reaction.reject; var domain = reaction.domain; var result, then, exited; try { if (handler) { if (!ok) { if (promise._h == 2) onHandleUnhandled(promise); promise._h = 1; } if (handler === true) result = value; else { if (domain) domain.enter(); result = handler(value); // may throw if (domain) { domain.exit(); exited = true; } } if (result === reaction.promise) { reject(TypeError$1('Promise-chain cycle')); } else if (then = isThenable(result)) { then.call(result, resolve, reject); } else resolve(result); } else reject(value); } catch (e) { if (domain && !exited) domain.exit(); reject(e); } }; while (chain.length > i) run(chain[i++]); // variable length - can't use forEach promise._c = []; promise._n = false; if (isReject && !promise._h) onUnhandled(promise); }); }; var onUnhandled = function (promise) { task.call(_global$1, function () { var value = promise._v; var unhandled = isUnhandled(promise); var result, handler, console; if (unhandled) { result = _perform$1(function () { if (isNode$2) { process$5.emit('unhandledRejection', value, promise); } else if (handler = _global$1.onunhandledrejection) { handler({ promise: promise, reason: value }); } else if ((console = _global$1.console) && console.error) { console.error('Unhandled promise rejection', value); } }); // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should promise._h = isNode$2 || isUnhandled(promise) ? 2 : 1; } promise._a = undefined; if (unhandled && result.e) throw result.v; }); }; var isUnhandled = function (promise) { return promise._h !== 1 && (promise._a || promise._c).length === 0; }; var onHandleUnhandled = function (promise) { task.call(_global$1, function () { var handler; if (isNode$2) { process$5.emit('rejectionHandled', promise); } else if (handler = _global$1.onrejectionhandled) { handler({ promise: promise, reason: promise._v }); } }); }; var $reject = function (value) { var promise = this; if (promise._d) return; promise._d = true; promise = promise._w || promise; // unwrap promise._v = value; promise._s = 2; if (!promise._a) promise._a = promise._c.slice(); notify(promise, true); }; var $resolve = function (value) { var promise = this; var then; if (promise._d) return; promise._d = true; promise = promise._w || promise; // unwrap try { if (promise === value) throw TypeError$1("Promise can't be resolved itself"); if (then = isThenable(value)) { microtask(function () { var wrapper = { _w: promise, _d: false }; // wrap try { then.call(value, _ctx$1($resolve, wrapper, 1), _ctx$1($reject, wrapper, 1)); } catch (e) { $reject.call(wrapper, e); } }); } else { promise._v = value; promise._s = 1; notify(promise, false); } } catch (e) { $reject.call({ _w: promise, _d: false }, e); // wrap } }; // constructor polyfill if (!USE_NATIVE) { // 25.4.3.1 Promise(executor) $Promise = function Promise(executor) { _anInstance$1(this, $Promise, PROMISE, '_h'); _aFunction$1(executor); Internal.call(this); try { executor(_ctx$1($resolve, this, 1), _ctx$1($reject, this, 1)); } catch (err) { $reject.call(this, err); } }; // eslint-disable-next-line no-unused-vars Internal = function Promise(executor) { this._c = []; // <- awaiting reactions this._a = undefined; // <- checked in isUnhandled reactions this._s = 0; // <- state this._d = false; // <- done this._v = undefined; // <- value this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled this._n = false; // <- notify }; Internal.prototype = _redefineAll$1($Promise.prototype, { // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) then: function then(onFulfilled, onRejected) { var reaction = newPromiseCapability(_speciesConstructor$1(this, $Promise)); reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; reaction.fail = typeof onRejected == 'function' && onRejected; reaction.domain = isNode$2 ? process$5.domain : undefined; this._c.push(reaction); if (this._a) this._a.push(reaction); if (this._s) notify(this, false); return reaction.promise; }, // 25.4.5.1 Promise.prototype.catch(onRejected) 'catch': function (onRejected) { return this.then(undefined, onRejected); } }); OwnPromiseCapability = function () { var promise = new Internal(); this.promise = promise; this.resolve = _ctx$1($resolve, promise, 1); this.reject = _ctx$1($reject, promise, 1); }; _newPromiseCapability$1.f = newPromiseCapability = function (C) { return C === $Promise || C === Wrapper ? new OwnPromiseCapability(C) : newGenericPromiseCapability(C); }; } _export$1(_export$1.G + _export$1.W + _export$1.F * !USE_NATIVE, { Promise: $Promise }); _setToStringTag$1($Promise, PROMISE); _setSpecies$1(PROMISE); Wrapper = _core$1[PROMISE]; // statics _export$1(_export$1.S + _export$1.F * !USE_NATIVE, PROMISE, { // 25.4.4.5 Promise.reject(r) reject: function reject(r) { var capability = newPromiseCapability(this); var $$reject = capability.reject; $$reject(r); return capability.promise; } }); _export$1(_export$1.S + _export$1.F * (_library$1), PROMISE, { // 25.4.4.6 Promise.resolve(x) resolve: function resolve(x) { return _promiseResolve$1(this === Wrapper ? $Promise : this, x); } }); _export$1(_export$1.S + _export$1.F * !(USE_NATIVE && _iterDetect$1(function (iter) { $Promise.all(iter)['catch'](empty); })), PROMISE, { // 25.4.4.1 Promise.all(iterable) all: function all(iterable) { var C = this; var capability = newPromiseCapability(C); var resolve = capability.resolve; var reject = capability.reject; var result = _perform$1(function () { var values = []; var index = 0; var remaining = 1; _forOf$1(iterable, false, function (promise) { var $index = index++; var alreadyCalled = false; values.push(undefined); remaining++; C.resolve(promise).then(function (value) { if (alreadyCalled) return; alreadyCalled = true; values[$index] = value; --remaining || resolve(values); }, reject); }); --remaining || resolve(values); }); if (result.e) reject(result.v); return capability.promise; }, // 25.4.4.4 Promise.race(iterable) race: function race(iterable) { var C = this; var capability = newPromiseCapability(C); var reject = capability.reject; var result = _perform$1(function () { _forOf$1(iterable, false, function (promise) { C.resolve(promise).then(capability.resolve, reject); }); }); if (result.e) reject(result.v); return capability.promise; } }); _export$1(_export$1.P + _export$1.R, 'Promise', { 'finally': function (onFinally) { var C = _speciesConstructor$1(this, _core$1.Promise || _global$1.Promise); var isFunction = typeof onFinally == 'function'; return this.then( isFunction ? function (x) { return _promiseResolve$1(C, onFinally()).then(function () { return x; }); } : onFinally, isFunction ? function (e) { return _promiseResolve$1(C, onFinally()).then(function () { throw e; }); } : onFinally ); } }); // https://github.com/tc39/proposal-promise-try _export$1(_export$1.S, 'Promise', { 'try': function (callbackfn) { var promiseCapability = _newPromiseCapability$1.f(this); var result = _perform$1(callbackfn); (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v); return promiseCapability.promise; } }); var $at$1 = _stringAt$1(true); // 21.1.3.27 String.prototype[@@iterator]() _iterDefine$1(String, 'String', function (iterated) { this._t = String(iterated); // target this._i = 0; // next index // 21.1.5.2.1 %StringIteratorPrototype%.next() }, function () { var O = this._t; var index = this._i; var point; if (index >= O.length) return { value: undefined, done: true }; point = $at$1(O, index); this._i += point.length; return { value: point, done: false }; }); var TO_STRING_TAG$1 = _wks$1('toStringTag'); var DOMIterables$1 = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' + 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' + 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' + 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' + 'TextTrackList,TouchList').split(','); for (var i$1 = 0; i$1 < DOMIterables$1.length; i$1++) { var NAME$1 = DOMIterables$1[i$1]; var Collection$1 = _global$1[NAME$1]; var proto$1 = Collection$1 && Collection$1.prototype; if (proto$1 && !proto$1[TO_STRING_TAG$1]) _hide$1(proto$1, TO_STRING_TAG$1, NAME$1); _iterators$1[NAME$1] = _iterators$1.Array; } var task$1 = _task$1.set; var microtask$1 = _microtask$1(); var PROMISE$1 = 'Promise'; var TypeError$2 = _global$1.TypeError; var process$6 = _global$1.process; var versions$1 = process$6 && process$6.versions; var v8$1 = versions$1 && versions$1.v8 || ''; var $Promise$1 = _global$1[PROMISE$1]; var isNode$3 = _classof$1(process$6) == 'process'; var empty$1 = function () { /* empty */ }; var Internal$1, newGenericPromiseCapability$1, OwnPromiseCapability$1, Wrapper$1; var newPromiseCapability$1 = newGenericPromiseCapability$1 = _newPromiseCapability$1.f; var USE_NATIVE$1 = !!function () { try { // correct subclassing with @@species support var promise = $Promise$1.resolve(1); var FakePromise = (promise.constructor = {})[_wks$1('species')] = function (exec) { exec(empty$1, empty$1); }; // unhandled rejections tracking support, NodeJS Promise without it fails @@species test return (isNode$3 || typeof PromiseRejectionEvent == 'function') && promise.then(empty$1) instanceof FakePromise // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 // we can't detect it synchronously, so just check versions && v8$1.indexOf('6.6') !== 0 && _use