UNPKG

smart-browser-detection

Version:

Smart browser detection library with anti-spoofing capabilities, multi-method detection, and mobile browser support. Outperforms UA-Parser-JS with superior accuracy and spoofing resistance.

1,497 lines (1,255 loc) 151 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), Object.defineProperty(e, "prototype", { writable: false }), e; } function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) { t && (r = t); var n = 0, F = function () {}; return { s: F, n: function () { return n >= r.length ? { done: true } : { done: false, value: r[n++] }; }, e: function (r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = true, u = false; return { s: function () { t = t.call(r); }, n: function () { var r = t.next(); return a = r.done, r; }, e: function (r) { u = true, o = r; }, f: function () { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; } function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return (String )(t); } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; var check = function (it) { return it && it.Math === Math && it; }; // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 var globalThis_1 = // eslint-disable-next-line es/no-global-this -- safe check(typeof globalThis == 'object' && globalThis) || check(typeof window == 'object' && window) || // eslint-disable-next-line no-restricted-globals -- safe check(typeof self == 'object' && self) || check(typeof commonjsGlobal == 'object' && commonjsGlobal) || check(typeof commonjsGlobal == 'object' && commonjsGlobal) || // eslint-disable-next-line no-new-func -- fallback (function () { return this; })() || Function('return this')(); var objectGetOwnPropertyDescriptor = {}; var fails$q = function (exec) { try { return !!exec(); } catch (error) { return true; } }; var fails$p = fails$q; // Detect IE8's incomplete defineProperty implementation var descriptors = !fails$p(function () { // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7; }); var fails$o = fails$q; var functionBindNative = !fails$o(function () { // eslint-disable-next-line es/no-function-prototype-bind -- safe var test = (function () { /* empty */ }).bind(); // eslint-disable-next-line no-prototype-builtins -- safe return typeof test != 'function' || test.hasOwnProperty('prototype'); }); var NATIVE_BIND$3 = functionBindNative; var call$h = Function.prototype.call; // eslint-disable-next-line es/no-function-prototype-bind -- safe var functionCall = NATIVE_BIND$3 ? call$h.bind(call$h) : function () { return call$h.apply(call$h, arguments); }; var objectPropertyIsEnumerable = {}; var $propertyIsEnumerable = {}.propertyIsEnumerable; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor; // Nashorn ~ JDK8 bug var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1); // `Object.prototype.propertyIsEnumerable` method implementation // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) { var descriptor = getOwnPropertyDescriptor$1(this, V); return !!descriptor && descriptor.enumerable; } : $propertyIsEnumerable; var createPropertyDescriptor$4 = function (bitmap, value) { return { enumerable: !(bitmap & 1), configurable: !(bitmap & 2), writable: !(bitmap & 4), value: value }; }; var NATIVE_BIND$2 = functionBindNative; var FunctionPrototype$2 = Function.prototype; var call$g = FunctionPrototype$2.call; // eslint-disable-next-line es/no-function-prototype-bind -- safe var uncurryThisWithBind = NATIVE_BIND$2 && FunctionPrototype$2.bind.bind(call$g, call$g); var functionUncurryThis = NATIVE_BIND$2 ? uncurryThisWithBind : function (fn) { return function () { return call$g.apply(fn, arguments); }; }; var uncurryThis$n = functionUncurryThis; var toString$9 = uncurryThis$n({}.toString); var stringSlice$5 = uncurryThis$n(''.slice); var classofRaw$2 = function (it) { return stringSlice$5(toString$9(it), 8, -1); }; var uncurryThis$m = functionUncurryThis; var fails$n = fails$q; var classof$a = classofRaw$2; var $Object$4 = Object; var split = uncurryThis$m(''.split); // fallback for non-array-like ES3 and non-enumerable old V8 strings var indexedObject = fails$n(function () { // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 // eslint-disable-next-line no-prototype-builtins -- safe return !$Object$4('z').propertyIsEnumerable(0); }) ? function (it) { return classof$a(it) === 'String' ? split(it, '') : $Object$4(it); } : $Object$4; // we can't use just `it == null` since of `document.all` special case // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec var isNullOrUndefined$5 = function (it) { return it === null || it === undefined; }; var isNullOrUndefined$4 = isNullOrUndefined$5; var $TypeError$b = TypeError; // `RequireObjectCoercible` abstract operation // https://tc39.es/ecma262/#sec-requireobjectcoercible var requireObjectCoercible$7 = function (it) { if (isNullOrUndefined$4(it)) throw new $TypeError$b("Can't call method on " + it); return it; }; // toObject with fallback for non-array-like ES3 strings var IndexedObject$2 = indexedObject; var requireObjectCoercible$6 = requireObjectCoercible$7; var toIndexedObject$6 = function (it) { return IndexedObject$2(requireObjectCoercible$6(it)); }; // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot var documentAll = typeof document == 'object' && document.all; // `IsCallable` abstract operation // https://tc39.es/ecma262/#sec-iscallable // eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing var isCallable$j = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) { return typeof argument == 'function' || argument === documentAll; } : function (argument) { return typeof argument == 'function'; }; var isCallable$i = isCallable$j; var isObject$g = function (it) { return typeof it == 'object' ? it !== null : isCallable$i(it); }; var globalThis$i = globalThis_1; var isCallable$h = isCallable$j; var aFunction = function (argument) { return isCallable$h(argument) ? argument : undefined; }; var getBuiltIn$5 = function (namespace, method) { return arguments.length < 2 ? aFunction(globalThis$i[namespace]) : globalThis$i[namespace] && globalThis$i[namespace][method]; }; var uncurryThis$l = functionUncurryThis; var objectIsPrototypeOf = uncurryThis$l({}.isPrototypeOf); var globalThis$h = globalThis_1; var navigator$1 = globalThis$h.navigator; var userAgent$1 = navigator$1 && navigator$1.userAgent; var environmentUserAgent = userAgent$1 ? String(userAgent$1) : ''; var globalThis$g = globalThis_1; var userAgent = environmentUserAgent; var process = globalThis$g.process; var Deno = globalThis$g.Deno; var versions = process && process.versions || Deno && Deno.version; var v8 = versions && versions.v8; var match, version; if (v8) { match = v8.split('.'); // in old Chrome, versions of V8 isn't V8 = Chrome / 10 // but their correct versions are not interesting for us version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]); } // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0` // so check `userAgent` even if `.v8` exists, but 0 if (!version && userAgent) { match = userAgent.match(/Edge\/(\d+)/); if (!match || match[1] >= 74) { match = userAgent.match(/Chrome\/(\d+)/); if (match) version = +match[1]; } } var environmentV8Version = version; /* eslint-disable es/no-symbol -- required for testing */ var V8_VERSION$1 = environmentV8Version; var fails$m = fails$q; var globalThis$f = globalThis_1; var $String$5 = globalThis$f.String; // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$m(function () { var symbol = Symbol('symbol detection'); // Chrome 38 Symbol has incorrect toString conversion // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will, // of course, fail. return !$String$5(symbol) || !(Object(symbol) instanceof Symbol) || // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances !Symbol.sham && V8_VERSION$1 && V8_VERSION$1 < 41; }); /* eslint-disable es/no-symbol -- required for testing */ var NATIVE_SYMBOL$1 = symbolConstructorDetection; var useSymbolAsUid = NATIVE_SYMBOL$1 && !Symbol.sham && typeof Symbol.iterator == 'symbol'; var getBuiltIn$4 = getBuiltIn$5; var isCallable$g = isCallable$j; var isPrototypeOf$3 = objectIsPrototypeOf; var USE_SYMBOL_AS_UID$1 = useSymbolAsUid; var $Object$3 = Object; var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) { return typeof it == 'symbol'; } : function (it) { var $Symbol = getBuiltIn$4('Symbol'); return isCallable$g($Symbol) && isPrototypeOf$3($Symbol.prototype, $Object$3(it)); }; var $String$4 = String; var tryToString$3 = function (argument) { try { return $String$4(argument); } catch (error) { return 'Object'; } }; var isCallable$f = isCallable$j; var tryToString$2 = tryToString$3; var $TypeError$a = TypeError; // `Assert: IsCallable(argument) is true` var aCallable$4 = function (argument) { if (isCallable$f(argument)) return argument; throw new $TypeError$a(tryToString$2(argument) + ' is not a function'); }; var aCallable$3 = aCallable$4; var isNullOrUndefined$3 = isNullOrUndefined$5; // `GetMethod` abstract operation // https://tc39.es/ecma262/#sec-getmethod var getMethod$5 = function (V, P) { var func = V[P]; return isNullOrUndefined$3(func) ? undefined : aCallable$3(func); }; var call$f = functionCall; var isCallable$e = isCallable$j; var isObject$f = isObject$g; var $TypeError$9 = TypeError; // `OrdinaryToPrimitive` abstract operation // https://tc39.es/ecma262/#sec-ordinarytoprimitive var ordinaryToPrimitive$1 = function (input, pref) { var fn, val; if (pref === 'string' && isCallable$e(fn = input.toString) && !isObject$f(val = call$f(fn, input))) return val; if (isCallable$e(fn = input.valueOf) && !isObject$f(val = call$f(fn, input))) return val; if (pref !== 'string' && isCallable$e(fn = input.toString) && !isObject$f(val = call$f(fn, input))) return val; throw new $TypeError$9("Can't convert object to primitive value"); }; var sharedStore = {exports: {}}; var globalThis$e = globalThis_1; // eslint-disable-next-line es/no-object-defineproperty -- safe var defineProperty$7 = Object.defineProperty; var defineGlobalProperty$3 = function (key, value) { try { defineProperty$7(globalThis$e, key, { value: value, configurable: true, writable: true }); } catch (error) { globalThis$e[key] = value; } return value; }; var globalThis$d = globalThis_1; var defineGlobalProperty$2 = defineGlobalProperty$3; var SHARED = '__core-js_shared__'; var store$3 = sharedStore.exports = globalThis$d[SHARED] || defineGlobalProperty$2(SHARED, {}); (store$3.versions || (store$3.versions = [])).push({ version: '3.43.0', mode: 'global', copyright: '© 2014-2025 Denis Pushkarev (zloirock.ru)', license: 'https://github.com/zloirock/core-js/blob/v3.43.0/LICENSE', source: 'https://github.com/zloirock/core-js' }); var sharedStoreExports = sharedStore.exports; var store$2 = sharedStoreExports; var shared$4 = function (key, value) { return store$2[key] || (store$2[key] = value || {}); }; var requireObjectCoercible$5 = requireObjectCoercible$7; var $Object$2 = Object; // `ToObject` abstract operation // https://tc39.es/ecma262/#sec-toobject var toObject$7 = function (argument) { return $Object$2(requireObjectCoercible$5(argument)); }; var uncurryThis$k = functionUncurryThis; var toObject$6 = toObject$7; var hasOwnProperty = uncurryThis$k({}.hasOwnProperty); // `HasOwnProperty` abstract operation // https://tc39.es/ecma262/#sec-hasownproperty // eslint-disable-next-line es/no-object-hasown -- safe var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) { return hasOwnProperty(toObject$6(it), key); }; var uncurryThis$j = functionUncurryThis; var id$1 = 0; var postfix = Math.random(); var toString$8 = uncurryThis$j(1.1.toString); var uid$3 = function (key) { return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$8(++id$1 + postfix, 36); }; var globalThis$c = globalThis_1; var shared$3 = shared$4; var hasOwn$a = hasOwnProperty_1; var uid$2 = uid$3; var NATIVE_SYMBOL = symbolConstructorDetection; var USE_SYMBOL_AS_UID = useSymbolAsUid; var Symbol$1 = globalThis$c.Symbol; var WellKnownSymbolsStore = shared$3('wks'); var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1['for'] || Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$2; var wellKnownSymbol$i = function (name) { if (!hasOwn$a(WellKnownSymbolsStore, name)) { WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn$a(Symbol$1, name) ? Symbol$1[name] : createWellKnownSymbol('Symbol.' + name); } return WellKnownSymbolsStore[name]; }; var call$e = functionCall; var isObject$e = isObject$g; var isSymbol$1 = isSymbol$2; var getMethod$4 = getMethod$5; var ordinaryToPrimitive = ordinaryToPrimitive$1; var wellKnownSymbol$h = wellKnownSymbol$i; var $TypeError$8 = TypeError; var TO_PRIMITIVE = wellKnownSymbol$h('toPrimitive'); // `ToPrimitive` abstract operation // https://tc39.es/ecma262/#sec-toprimitive var toPrimitive$1 = function (input, pref) { if (!isObject$e(input) || isSymbol$1(input)) return input; var exoticToPrim = getMethod$4(input, TO_PRIMITIVE); var result; if (exoticToPrim) { if (pref === undefined) pref = 'default'; result = call$e(exoticToPrim, input, pref); if (!isObject$e(result) || isSymbol$1(result)) return result; throw new $TypeError$8("Can't convert object to primitive value"); } if (pref === undefined) pref = 'number'; return ordinaryToPrimitive(input, pref); }; var toPrimitive = toPrimitive$1; var isSymbol = isSymbol$2; // `ToPropertyKey` abstract operation // https://tc39.es/ecma262/#sec-topropertykey var toPropertyKey$2 = function (argument) { var key = toPrimitive(argument, 'string'); return isSymbol(key) ? key : key + ''; }; var globalThis$b = globalThis_1; var isObject$d = isObject$g; var document$1 = globalThis$b.document; // typeof document.createElement is 'object' in old IE var EXISTS$1 = isObject$d(document$1) && isObject$d(document$1.createElement); var documentCreateElement$2 = function (it) { return EXISTS$1 ? document$1.createElement(it) : {}; }; var DESCRIPTORS$c = descriptors; var fails$l = fails$q; var createElement = documentCreateElement$2; // Thanks to IE8 for its funny defineProperty var ie8DomDefine = !DESCRIPTORS$c && !fails$l(function () { // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty(createElement('div'), 'a', { get: function () { return 7; } }).a !== 7; }); var DESCRIPTORS$b = descriptors; var call$d = functionCall; var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable; var createPropertyDescriptor$3 = createPropertyDescriptor$4; var toIndexedObject$5 = toIndexedObject$6; var toPropertyKey$1 = toPropertyKey$2; var hasOwn$9 = hasOwnProperty_1; var IE8_DOM_DEFINE$1 = ie8DomDefine; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor; // `Object.getOwnPropertyDescriptor` method // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor objectGetOwnPropertyDescriptor.f = DESCRIPTORS$b ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) { O = toIndexedObject$5(O); P = toPropertyKey$1(P); if (IE8_DOM_DEFINE$1) try { return $getOwnPropertyDescriptor$1(O, P); } catch (error) { /* empty */ } if (hasOwn$9(O, P)) return createPropertyDescriptor$3(!call$d(propertyIsEnumerableModule$1.f, O, P), O[P]); }; var objectDefineProperty = {}; var DESCRIPTORS$a = descriptors; var fails$k = fails$q; // V8 ~ Chrome 36- // https://bugs.chromium.org/p/v8/issues/detail?id=3334 var v8PrototypeDefineBug = DESCRIPTORS$a && fails$k(function () { // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty(function () { /* empty */ }, 'prototype', { value: 42, writable: false }).prototype !== 42; }); var isObject$c = isObject$g; var $String$3 = String; var $TypeError$7 = TypeError; // `Assert: Type(argument) is Object` var anObject$c = function (argument) { if (isObject$c(argument)) return argument; throw new $TypeError$7($String$3(argument) + ' is not an object'); }; var DESCRIPTORS$9 = descriptors; var IE8_DOM_DEFINE = ie8DomDefine; var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug; var anObject$b = anObject$c; var toPropertyKey = toPropertyKey$2; var $TypeError$6 = TypeError; // eslint-disable-next-line es/no-object-defineproperty -- safe var $defineProperty = Object.defineProperty; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; var ENUMERABLE = 'enumerable'; var CONFIGURABLE$1 = 'configurable'; var WRITABLE = 'writable'; // `Object.defineProperty` method // https://tc39.es/ecma262/#sec-object.defineproperty objectDefineProperty.f = DESCRIPTORS$9 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) { anObject$b(O); P = toPropertyKey(P); anObject$b(Attributes); if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) { var current = $getOwnPropertyDescriptor(O, P); if (current && current[WRITABLE]) { O[P] = Attributes.value; Attributes = { configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1], enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE], writable: false }; } } return $defineProperty(O, P, Attributes); } : $defineProperty : function defineProperty(O, P, Attributes) { anObject$b(O); P = toPropertyKey(P); anObject$b(Attributes); if (IE8_DOM_DEFINE) try { return $defineProperty(O, P, Attributes); } catch (error) { /* empty */ } if ('get' in Attributes || 'set' in Attributes) throw new $TypeError$6('Accessors not supported'); if ('value' in Attributes) O[P] = Attributes.value; return O; }; var DESCRIPTORS$8 = descriptors; var definePropertyModule$4 = objectDefineProperty; var createPropertyDescriptor$2 = createPropertyDescriptor$4; var createNonEnumerableProperty$6 = DESCRIPTORS$8 ? function (object, key, value) { return definePropertyModule$4.f(object, key, createPropertyDescriptor$2(1, value)); } : function (object, key, value) { object[key] = value; return object; }; var makeBuiltIn$3 = {exports: {}}; var DESCRIPTORS$7 = descriptors; var hasOwn$8 = hasOwnProperty_1; var FunctionPrototype$1 = Function.prototype; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var getDescriptor = DESCRIPTORS$7 && Object.getOwnPropertyDescriptor; var EXISTS = hasOwn$8(FunctionPrototype$1, 'name'); // additional protection from minified / mangled / dropped function names var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something'; var CONFIGURABLE = EXISTS && (!DESCRIPTORS$7 || (DESCRIPTORS$7 && getDescriptor(FunctionPrototype$1, 'name').configurable)); var functionName = { PROPER: PROPER, CONFIGURABLE: CONFIGURABLE }; var uncurryThis$i = functionUncurryThis; var isCallable$d = isCallable$j; var store$1 = sharedStoreExports; var functionToString = uncurryThis$i(Function.toString); // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper if (!isCallable$d(store$1.inspectSource)) { store$1.inspectSource = function (it) { return functionToString(it); }; } var inspectSource$2 = store$1.inspectSource; var globalThis$a = globalThis_1; var isCallable$c = isCallable$j; var WeakMap$1 = globalThis$a.WeakMap; var weakMapBasicDetection = isCallable$c(WeakMap$1) && /native code/.test(String(WeakMap$1)); var shared$2 = shared$4; var uid$1 = uid$3; var keys = shared$2('keys'); var sharedKey$3 = function (key) { return keys[key] || (keys[key] = uid$1(key)); }; var hiddenKeys$5 = {}; var NATIVE_WEAK_MAP = weakMapBasicDetection; var globalThis$9 = globalThis_1; var isObject$b = isObject$g; var createNonEnumerableProperty$5 = createNonEnumerableProperty$6; var hasOwn$7 = hasOwnProperty_1; var shared$1 = sharedStoreExports; var sharedKey$2 = sharedKey$3; var hiddenKeys$4 = hiddenKeys$5; var OBJECT_ALREADY_INITIALIZED = 'Object already initialized'; var TypeError$1 = globalThis$9.TypeError; var WeakMap = globalThis$9.WeakMap; var set, get, has; var enforce = function (it) { return has(it) ? get(it) : set(it, {}); }; var getterFor = function (TYPE) { return function (it) { var state; if (!isObject$b(it) || (state = get(it)).type !== TYPE) { throw new TypeError$1('Incompatible receiver, ' + TYPE + ' required'); } return state; }; }; if (NATIVE_WEAK_MAP || shared$1.state) { var store = shared$1.state || (shared$1.state = new WeakMap()); /* eslint-disable no-self-assign -- prototype methods protection */ store.get = store.get; store.has = store.has; store.set = store.set; /* eslint-enable no-self-assign -- prototype methods protection */ set = function (it, metadata) { if (store.has(it)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED); metadata.facade = it; store.set(it, metadata); return metadata; }; get = function (it) { return store.get(it) || {}; }; has = function (it) { return store.has(it); }; } else { var STATE = sharedKey$2('state'); hiddenKeys$4[STATE] = true; set = function (it, metadata) { if (hasOwn$7(it, STATE)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED); metadata.facade = it; createNonEnumerableProperty$5(it, STATE, metadata); return metadata; }; get = function (it) { return hasOwn$7(it, STATE) ? it[STATE] : {}; }; has = function (it) { return hasOwn$7(it, STATE); }; } var internalState = { set: set, get: get, has: has, enforce: enforce, getterFor: getterFor }; var uncurryThis$h = functionUncurryThis; var fails$j = fails$q; var isCallable$b = isCallable$j; var hasOwn$6 = hasOwnProperty_1; var DESCRIPTORS$6 = descriptors; var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE; var inspectSource$1 = inspectSource$2; var InternalStateModule$3 = internalState; var enforceInternalState = InternalStateModule$3.enforce; var getInternalState$3 = InternalStateModule$3.get; var $String$2 = String; // eslint-disable-next-line es/no-object-defineproperty -- safe var defineProperty$6 = Object.defineProperty; var stringSlice$4 = uncurryThis$h(''.slice); var replace$2 = uncurryThis$h(''.replace); var join = uncurryThis$h([].join); var CONFIGURABLE_LENGTH = DESCRIPTORS$6 && !fails$j(function () { return defineProperty$6(function () { /* empty */ }, 'length', { value: 8 }).length !== 8; }); var TEMPLATE = String(String).split('String'); var makeBuiltIn$2 = makeBuiltIn$3.exports = function (value, name, options) { if (stringSlice$4($String$2(name), 0, 7) === 'Symbol(') { name = '[' + replace$2($String$2(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']'; } if (options && options.getter) name = 'get ' + name; if (options && options.setter) name = 'set ' + name; if (!hasOwn$6(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) { if (DESCRIPTORS$6) defineProperty$6(value, 'name', { value: name, configurable: true }); else value.name = name; } if (CONFIGURABLE_LENGTH && options && hasOwn$6(options, 'arity') && value.length !== options.arity) { defineProperty$6(value, 'length', { value: options.arity }); } try { if (options && hasOwn$6(options, 'constructor') && options.constructor) { if (DESCRIPTORS$6) defineProperty$6(value, 'prototype', { writable: false }); // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable } else if (value.prototype) value.prototype = undefined; } catch (error) { /* empty */ } var state = enforceInternalState(value); if (!hasOwn$6(state, 'source')) { state.source = join(TEMPLATE, typeof name == 'string' ? name : ''); } return value; }; // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative // eslint-disable-next-line no-extend-native -- required Function.prototype.toString = makeBuiltIn$2(function toString() { return isCallable$b(this) && getInternalState$3(this).source || inspectSource$1(this); }, 'toString'); var makeBuiltInExports = makeBuiltIn$3.exports; var isCallable$a = isCallable$j; var definePropertyModule$3 = objectDefineProperty; var makeBuiltIn$1 = makeBuiltInExports; var defineGlobalProperty$1 = defineGlobalProperty$3; var defineBuiltIn$7 = function (O, key, value, options) { if (!options) options = {}; var simple = options.enumerable; var name = options.name !== undefined ? options.name : key; if (isCallable$a(value)) makeBuiltIn$1(value, name, options); if (options.global) { if (simple) O[key] = value; else defineGlobalProperty$1(key, value); } else { try { if (!options.unsafe) delete O[key]; else if (O[key]) simple = true; } catch (error) { /* empty */ } if (simple) O[key] = value; else definePropertyModule$3.f(O, key, { value: value, enumerable: false, configurable: !options.nonConfigurable, writable: !options.nonWritable }); } return O; }; var objectGetOwnPropertyNames = {}; var ceil = Math.ceil; var floor$1 = Math.floor; // `Math.trunc` method // https://tc39.es/ecma262/#sec-math.trunc // eslint-disable-next-line es/no-math-trunc -- safe var mathTrunc = Math.trunc || function trunc(x) { var n = +x; return (n > 0 ? floor$1 : ceil)(n); }; var trunc = mathTrunc; // `ToIntegerOrInfinity` abstract operation // https://tc39.es/ecma262/#sec-tointegerorinfinity var toIntegerOrInfinity$4 = function (argument) { var number = +argument; // eslint-disable-next-line no-self-compare -- NaN check return number !== number || number === 0 ? 0 : trunc(number); }; var toIntegerOrInfinity$3 = toIntegerOrInfinity$4; var max$1 = Math.max; var min$2 = Math.min; // Helper for a popular repeating case of the spec: // Let integer be ? ToInteger(index). // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length). var toAbsoluteIndex$1 = function (index, length) { var integer = toIntegerOrInfinity$3(index); return integer < 0 ? max$1(integer + length, 0) : min$2(integer, length); }; var toIntegerOrInfinity$2 = toIntegerOrInfinity$4; var min$1 = Math.min; // `ToLength` abstract operation // https://tc39.es/ecma262/#sec-tolength var toLength$3 = function (argument) { var len = toIntegerOrInfinity$2(argument); return len > 0 ? min$1(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 }; var toLength$2 = toLength$3; // `LengthOfArrayLike` abstract operation // https://tc39.es/ecma262/#sec-lengthofarraylike var lengthOfArrayLike$4 = function (obj) { return toLength$2(obj.length); }; var toIndexedObject$4 = toIndexedObject$6; var toAbsoluteIndex = toAbsoluteIndex$1; var lengthOfArrayLike$3 = lengthOfArrayLike$4; // `Array.prototype.{ indexOf, includes }` methods implementation var createMethod$2 = function (IS_INCLUDES) { return function ($this, el, fromIndex) { var O = toIndexedObject$4($this); var length = lengthOfArrayLike$3(O); if (length === 0) return !IS_INCLUDES && -1; var index = toAbsoluteIndex(fromIndex, length); var value; // Array#includes uses SameValueZero equality algorithm // eslint-disable-next-line no-self-compare -- NaN check if (IS_INCLUDES && el !== el) while (length > index) { value = O[index++]; // eslint-disable-next-line no-self-compare -- NaN check if (value !== value) return true; // Array#indexOf ignores holes, Array#includes - not } else for (;length > index; index++) { if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0; } return !IS_INCLUDES && -1; }; }; var arrayIncludes = { // `Array.prototype.includes` method // https://tc39.es/ecma262/#sec-array.prototype.includes includes: createMethod$2(true), // `Array.prototype.indexOf` method // https://tc39.es/ecma262/#sec-array.prototype.indexof indexOf: createMethod$2(false) }; var uncurryThis$g = functionUncurryThis; var hasOwn$5 = hasOwnProperty_1; var toIndexedObject$3 = toIndexedObject$6; var indexOf$1 = arrayIncludes.indexOf; var hiddenKeys$3 = hiddenKeys$5; var push$2 = uncurryThis$g([].push); var objectKeysInternal = function (object, names) { var O = toIndexedObject$3(object); var i = 0; var result = []; var key; for (key in O) !hasOwn$5(hiddenKeys$3, key) && hasOwn$5(O, key) && push$2(result, key); // Don't enum bug & hidden keys while (names.length > i) if (hasOwn$5(O, key = names[i++])) { ~indexOf$1(result, key) || push$2(result, key); } return result; }; // IE8- don't enum bug keys var enumBugKeys$3 = [ 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf' ]; var internalObjectKeys$1 = objectKeysInternal; var enumBugKeys$2 = enumBugKeys$3; var hiddenKeys$2 = enumBugKeys$2.concat('length', 'prototype'); // `Object.getOwnPropertyNames` method // https://tc39.es/ecma262/#sec-object.getownpropertynames // eslint-disable-next-line es/no-object-getownpropertynames -- safe objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { return internalObjectKeys$1(O, hiddenKeys$2); }; var objectGetOwnPropertySymbols = {}; // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols; var getBuiltIn$3 = getBuiltIn$5; var uncurryThis$f = functionUncurryThis; var getOwnPropertyNamesModule$1 = objectGetOwnPropertyNames; var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols; var anObject$a = anObject$c; var concat$2 = uncurryThis$f([].concat); // all object keys, includes non-enumerable and symbols var ownKeys$1 = getBuiltIn$3('Reflect', 'ownKeys') || function ownKeys(it) { var keys = getOwnPropertyNamesModule$1.f(anObject$a(it)); var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f; return getOwnPropertySymbols ? concat$2(keys, getOwnPropertySymbols(it)) : keys; }; var hasOwn$4 = hasOwnProperty_1; var ownKeys = ownKeys$1; var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor; var definePropertyModule$2 = objectDefineProperty; var copyConstructorProperties$1 = function (target, source, exceptions) { var keys = ownKeys(source); var defineProperty = definePropertyModule$2.f; var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; for (var i = 0; i < keys.length; i++) { var key = keys[i]; if (!hasOwn$4(target, key) && !(exceptions && hasOwn$4(exceptions, key))) { defineProperty(target, key, getOwnPropertyDescriptor(source, key)); } } }; var fails$i = fails$q; var isCallable$9 = isCallable$j; var replacement = /#|\.prototype\./; var isForced$2 = function (feature, detection) { var value = data[normalize(feature)]; return value === POLYFILL ? true : value === NATIVE ? false : isCallable$9(detection) ? fails$i(detection) : !!detection; }; var normalize = isForced$2.normalize = function (string) { return String(string).replace(replacement, '.').toLowerCase(); }; var data = isForced$2.data = {}; var NATIVE = isForced$2.NATIVE = 'N'; var POLYFILL = isForced$2.POLYFILL = 'P'; var isForced_1 = isForced$2; var globalThis$8 = globalThis_1; var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f; var createNonEnumerableProperty$4 = createNonEnumerableProperty$6; var defineBuiltIn$6 = defineBuiltIn$7; var defineGlobalProperty = defineGlobalProperty$3; var copyConstructorProperties = copyConstructorProperties$1; var isForced$1 = isForced_1; /* options.target - name of the target object options.global - target is the global object options.stat - export as static methods of target options.proto - export as prototype methods of target options.real - real prototype method for the `pure` version options.forced - export even if the native feature is available options.bind - bind methods to the target, required for the `pure` version options.wrap - wrap constructors to preventing global pollution, required for the `pure` version options.unsafe - use the simple assignment of property instead of delete + defineProperty options.sham - add a flag to not completely full polyfills options.enumerable - export as enumerable property options.dontCallGetSet - prevent calling a getter on target options.name - the .name of the function if it does not match the key */ var _export = function (options, source) { var TARGET = options.target; var GLOBAL = options.global; var STATIC = options.stat; var FORCED, target, key, targetProperty, sourceProperty, descriptor; if (GLOBAL) { target = globalThis$8; } else if (STATIC) { target = globalThis$8[TARGET] || defineGlobalProperty(TARGET, {}); } else { target = globalThis$8[TARGET] && globalThis$8[TARGET].prototype; } if (target) for (key in source) { sourceProperty = source[key]; if (options.dontCallGetSet) { descriptor = getOwnPropertyDescriptor(target, key); targetProperty = descriptor && descriptor.value; } else targetProperty = target[key]; FORCED = isForced$1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); // contained in target if (!FORCED && targetProperty !== undefined) { if (typeof sourceProperty == typeof targetProperty) continue; copyConstructorProperties(sourceProperty, targetProperty); } // add a flag to not completely full polyfills if (options.sham || (targetProperty && targetProperty.sham)) { createNonEnumerableProperty$4(sourceProperty, 'sham', true); } defineBuiltIn$6(target, key, sourceProperty, options); } }; var classofRaw$1 = classofRaw$2; var uncurryThis$e = functionUncurryThis; var functionUncurryThisClause = function (fn) { // Nashorn bug: // https://github.com/zloirock/core-js/issues/1128 // https://github.com/zloirock/core-js/issues/1130 if (classofRaw$1(fn) === 'Function') return uncurryThis$e(fn); }; var uncurryThis$d = functionUncurryThisClause; var aCallable$2 = aCallable$4; var NATIVE_BIND$1 = functionBindNative; var bind$4 = uncurryThis$d(uncurryThis$d.bind); // optional / simple context binding var functionBindContext = function (fn, that) { aCallable$2(fn); return that === undefined ? fn : NATIVE_BIND$1 ? bind$4(fn, that) : function (/* ...args */) { return fn.apply(that, arguments); }; }; var classof$9 = classofRaw$2; // `IsArray` abstract operation // https://tc39.es/ecma262/#sec-isarray // eslint-disable-next-line es/no-array-isarray -- safe var isArray$1 = Array.isArray || function isArray(argument) { return classof$9(argument) === 'Array'; }; var wellKnownSymbol$g = wellKnownSymbol$i; var TO_STRING_TAG$2 = wellKnownSymbol$g('toStringTag'); var test = {}; test[TO_STRING_TAG$2] = 'z'; var toStringTagSupport = String(test) === '[object z]'; var TO_STRING_TAG_SUPPORT$2 = toStringTagSupport; var isCallable$8 = isCallable$j; var classofRaw = classofRaw$2; var wellKnownSymbol$f = wellKnownSymbol$i; var TO_STRING_TAG$1 = wellKnownSymbol$f('toStringTag'); var $Object$1 = Object; // ES3 wrong here var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments'; // fallback for IE11 Script Access Denied error var tryGet = function (it, key) { try { return it[key]; } catch (error) { /* empty */ } }; // getting tag from ES6+ `Object.prototype.toString` var classof$8 = TO_STRING_TAG_SUPPORT$2 ? classofRaw : function (it) { var O, tag, result; return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case : typeof (tag = tryGet(O = $Object$1(it), TO_STRING_TAG$1)) == 'string' ? tag // builtinTag case : CORRECT_ARGUMENTS ? classofRaw(O) // ES3 arguments fallback : (result = classofRaw(O)) === 'Object' && isCallable$8(O.callee) ? 'Arguments' : result; }; var uncurryThis$c = functionUncurryThis; var fails$h = fails$q; var isCallable$7 = isCallable$j; var classof$7 = classof$8; var getBuiltIn$2 = getBuiltIn$5; var inspectSource = inspectSource$2; var noop = function () { /* empty */ }; var construct = getBuiltIn$2('Reflect', 'construct'); var constructorRegExp = /^\s*(?:class|function)\b/; var exec$1 = uncurryThis$c(constructorRegExp.exec); var INCORRECT_TO_STRING = !constructorRegExp.test(noop); var isConstructorModern = function isConstructor(argument) { if (!isCallable$7(argument)) return false; try { construct(noop, [], argument); return true; } catch (error) { return false; } }; var isConstructorLegacy = function isConstructor(argument) { if (!isCallable$7(argument)) return false; switch (classof$7(argument)) { case 'AsyncFunction': case 'GeneratorFunction': case 'AsyncGeneratorFunction': return false; } try { // we can't check .prototype since constructors produced by .bind haven't it // `Function#toString` throws on some built-it function in some legacy engines // (for example, `DOMQuad` and similar in FF41-) return INCORRECT_TO_STRING || !!exec$1(constructorRegExp, inspectSource(argument)); } catch (error) { return true; } }; isConstructorLegacy.sham = true; // `IsConstructor` abstract operation // https://tc39.es/ecma262/#sec-isconstructor var isConstructor$2 = !construct || fails$h(function () { var called; return isConstructorModern(isConstructorModern.call) || !isConstructorModern(Object) || !isConstructorModern(function () { called = true; }) || called; }) ? isConstructorLegacy : isConstructorModern; var isArray = isArray$1; var isConstructor$1 = isConstructor$2; var isObject$a = isObject$g; var wellKnownSymbol$e = wellKnownSymbol$i; var SPECIES$3 = wellKnownSymbol$e('species'); var $Array$1 = Array; // a part of `ArraySpeciesCreate` abstract operation // https://tc39.es/ecma262/#sec-arrayspeciescreate var arraySpeciesConstructor$1 = function (originalArray) { var C; if (isArray(originalArray)) { C = originalArray.constructor; // cross-realm fallback if (isConstructor$1(C) && (C === $Array$1 || isArray(C.prototype))) C = undefined; else if (isObject$a(C)) { C = C[SPECIES$3]; if (C === null) C = undefined; } } return C === undefined ? $Array$1 : C; }; var arraySpeciesConstructor = arraySpeciesConstructor$1; // `ArraySpeciesCreate` abstract operation // https://tc39.es/ecma262/#sec-arrayspeciescreate var arraySpeciesCreate$1 = function (originalArray, length) { return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length); }; var bind$3 = functionBindContext; var uncurryThis$b = functionUncurryThis; var IndexedObject$1 = indexedObject; var toObject$5 = toObject$7; var lengthOfArrayLike$2 = lengthOfArrayLike$4; var arraySpeciesCreate = arraySpeciesCreate$1; var push$1 = uncurryThis$b([].push); // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation var createMethod$1 = function (TYPE) { var IS_MAP = TYPE === 1; var IS_FILTER = TYPE === 2; var IS_SOME = TYPE === 3; var IS_EVERY = TYPE === 4; var IS_FIND_INDEX = TYPE === 6; var IS_FILTER_REJECT = TYPE === 7; var NO_HOLES = TYPE === 5 || IS_FIND_INDEX; return function ($this, callbackfn, that, specificCreate) { var O = toObject$5($this); var self = IndexedObject$1(O); var length = lengthOfArrayLike$2(self); var boundFunction = bind$3(callbackfn, that); var index = 0; var create = specificCreate || arraySpeciesCreate; var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined; var value, result; for (;length > index; index++) if (NO_HOLES || index in self) { value = self[index]; result = boundFunction(value, index, O); if (TYPE) { if (IS_MAP) target[index] = result; // map else if (result) switch (TYPE) { case 3: return true; // some case 5: return value; // find case 6: return index; // findIndex case 2: push$1(target, value); // filter } else switch (TYPE) { case 4: return false; // every case 7: push$1(target, value); // filterReject } } } return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target; }; }; var arrayIteration = { // `Array.prototype.forEach` method // https://tc39.es/ecma262/#sec-array.prototype.foreach forEach: createMethod$1(0), // `Array.prototype.map` method // https://tc39.es/ecma262/#sec-array.prototype.map map: createMethod$1(1), // `Array.prototype.filter` method // https://tc39.es/ecma262/#sec-array.prototype.filter filter: createMethod$1(2)}; var fails$g = fails$q; var wellKnownSymbol$d = wellKnownSymbol$i; var V8_VERSION = environmentV8Version; var SPECIES$2 = wellKnownSymbol$d('species'); var arrayMethodHasSpeciesSupport$2 = function (METHOD_NAME) { // We can't use this feature detection in V8 since it causes // deoptimization and serious performance degradation // https://github.com/zloirock/core-js/issues/677 return V8_VERSION >= 51 || !fails$g(function () { var array = []; var constructor = array.constructor = {}; constructor[SPECIES$2] = function () { return { foo: 1 }; }; return array[METHOD_NAME](Boolean).foo !== 1; }); }; var $$a = _export; var $filter = arrayIteration.filter; var arrayMethodHasSpeciesSupport$1 = arrayMethodHasSpeciesSupport$2; var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport$1('filter'); // `Array.prototype.filter` method // https://tc39.es/ecma262/#sec-array.prototype.filter // with adding support of @@species $$a({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, { filter: function filter(callbackfn /* , thisArg */) { return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); var call$c = functionCall; var anObject$9 = anObject$c; var getMethod$3 = getMethod$5; var iteratorClose$2 = function (iterator, kind, value) { var innerResult, innerError; anObject$9(iterator); try { innerResult = getMethod$3(iterator, 'return'); if (!innerResult) { if (kind === 'throw') throw value; return value; } innerResult = call$c(innerResult, iterator); } catch (error) { innerError = true; innerResult = error; } if (kind === 'throw') throw value; if (innerError) throw innerResult; anObject$9(innerResult); return value; }; var anObject$8 = anObject$c; var iteratorClose$1 = iteratorClose$2; // call something on iterator step with safe closing on error var callWithSafeIterationClosing$1 = function (iterator, fn, value, ENTRIES) { try { return ENTRIES ? fn(anObject$8(value)[0], value[1]) : fn(value); } catch (error) { iteratorClose$1(iterator, 'throw', error); } }; var iterators = {}; var wellKnownSymbol$c = wellKnownSymbol$i; var Iterators$4 = iterators; var ITERATOR$5 = wellKnownSymbol$c('iterator'); var ArrayPrototype$1 = Array.prototype; // check on default Array iterator var isArrayIteratorMethod$2 = function (it) { return it !== undefined && (Iterators$4.Array === it || ArrayPrototype$1[ITERATOR$5] === it); }; var DESCRIPTORS$5 = descriptors; var definePropertyModule$1 = objectDefineProperty; var createPropertyDescriptor$1 = createPropertyDescriptor$4; var createProperty$1 = function (object, key, value) { if (DESCRIPTORS$5) definePropertyModule$1.f(object, key, createPropertyDescriptor$1(0, value)); else object[key] = value; }; var classof$6 = classof$8; var getMethod$2 = getMethod$5; var isNullOrUndefined$2 = isNullOrUndefined$5; var Iterators$3 = iterators; var wellKnownSymbol$b = wellKnownSymbol$i; var ITERATOR$4 = wellKnownSymbol$b('iterator'); var getIteratorMethod$3 = function (it) { if (!isNullOrUndefined$2(it)) return getMethod$2(it, ITERATOR$4) || getMethod$2(it, '@@iterator') || Iterators$3[classof$6(it)]; }; var call$b = functionCall; var aCallable$1 = aCallable$4; var anObject$7 = anObject$c; var tryToString$1 = tryToString$3; var getIteratorMethod$2 = getIteratorMethod$3; var $TypeError$5 = TypeError; var getIterator$2 = function (argument, usingIterator) { var iteratorMethod = arguments.length < 2 ? getIteratorMethod$2(argument) : usingIterator; if (aCallable$1(iteratorMethod)) return anObject$7(call$b(iteratorMethod, argument)); throw new $TypeError$5(tryToString$1(argument) + ' is not iterable'); }; var bind$2 = functionBindContext; var call$a = functionCall; var toObject$4 = toObject$7; var callWithSafeIterationClosing = callWithSafeIterationClosing$1; var isArrayIteratorMethod$1 = isArrayIteratorMethod$2; var isConstructor = isConstructor$2; var lengthOfArrayLike$1 = lengthOfArrayLike$4; var createProperty = createProperty$1; var getIterator$1 = getIterator$2; var getIteratorMethod$1 = getIteratorMethod$3; var $Array = Array; // `Array.from` method implementation // https://tc39.es/ecma262/#sec-array.from var arrayFrom = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { var O = toObject$4(arrayLike); var IS_CONSTRUCTOR = isConstructor(this); var argumentsLength = arguments.length; var mapfn = argumentsLength > 1 ? arguments[1] : undefined; var mapping = mapfn !== undefined; if (mapping) mapfn = bind$2(mapfn, argumentsLength > 2 ? arguments[2] : undefined); var iteratorMethod = getIteratorMethod$1(O); var index = 0; var length, result, step, iterator, next, value; // if the target is not iterable or it's an array with the default iterator - use a simple case if (iteratorMethod && !(this === $Array && isArrayIteratorMethod$1(iteratorMethod))) { result = IS_CONSTRUCTOR ? new this() : []; iterator = getIterator$1(O, iteratorMethod); next = iterator.next; for (;!(step = call$a(next, iterator)).done; index++) { value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value; createProperty(result, index, value); } } else { length = lengthOfArrayLike$1(O); result = IS_CONSTRUCTOR ? new this(length) : $Array(length); for (;length > index; index++) { value = mapping ? mapfn(O[index], index) : O[index]; createProperty(result, index, value); } } result.length = index; return result; }; var wellKnownSymbol$a = wellKnownSymbol$i; var ITERATOR$3 = wellKnownSymbol$a('iterator'); var SAFE_CLOSING = false; try { var called = 0; var iteratorWithReturn = { next: function () { return { done: !!called++ }; }, 'return': function () { SAFE_CLOSING = true; } }; iteratorWithReturn[ITERATOR$3] = function () { return this; }; // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing Array.from(iteratorWithReturn, function () { throw 2; }); } catch (error) { /*