UNPKG

@yext/answers-search-ui

Version:

Javascript Search Programming Interface

1,425 lines (1,154 loc) 5.93 MB
(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.ANSWERS = factory()); })(this, (function () { 'use strict'; var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; 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; } function getCjsExportFromNamespace (n) { return n && n['default'] || n; } 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 fails = function (exec) { try { return !!exec(); } catch (error) { return true; } }; var functionBindNative = !fails(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 FunctionPrototype$4 = Function.prototype; var apply = FunctionPrototype$4.apply; var call$2 = FunctionPrototype$4.call; // eslint-disable-next-line es/no-function-prototype-bind, es/no-reflect -- safe var functionApply = typeof Reflect == 'object' && Reflect.apply || (functionBindNative ? call$2.bind(apply) : function () { return call$2.apply(apply, arguments); }); var FunctionPrototype$3 = Function.prototype; var call$1 = FunctionPrototype$3.call; // eslint-disable-next-line es/no-function-prototype-bind -- safe var uncurryThisWithBind = functionBindNative && FunctionPrototype$3.bind.bind(call$1, call$1); var functionUncurryThis = functionBindNative ? uncurryThisWithBind : function (fn) { return function () { return call$1.apply(fn, arguments); }; }; var toString$1 = functionUncurryThis({}.toString); var stringSlice$5 = functionUncurryThis(''.slice); var classofRaw = function (it) { return stringSlice$5(toString$1(it), 8, -1); }; var functionUncurryThisClause = function (fn) { // Nashorn bug: // https://github.com/zloirock/core-js/issues/1128 // https://github.com/zloirock/core-js/issues/1130 if (classofRaw(fn) === 'Function') return functionUncurryThis(fn); }; // 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 = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) { return typeof argument == 'function' || argument === documentAll; } : function (argument) { return typeof argument == 'function'; }; // Detect IE8's incomplete defineProperty implementation var descriptors = !fails(function () { // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7; }); var call = Function.prototype.call; // eslint-disable-next-line es/no-function-prototype-bind -- safe var functionCall = functionBindNative ? call.bind(call) : function () { return call.apply(call, arguments); }; var $propertyIsEnumerable$2 = {}.propertyIsEnumerable; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var getOwnPropertyDescriptor$5 = Object.getOwnPropertyDescriptor; // Nashorn ~ JDK8 bug var NASHORN_BUG = getOwnPropertyDescriptor$5 && !$propertyIsEnumerable$2.call({ 1: 2 }, 1); // `Object.prototype.propertyIsEnumerable` method implementation // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable var f$9 = NASHORN_BUG ? function propertyIsEnumerable(V) { var descriptor = getOwnPropertyDescriptor$5(this, V); return !!descriptor && descriptor.enumerable; } : $propertyIsEnumerable$2; var objectPropertyIsEnumerable = { f: f$9 }; var createPropertyDescriptor = function (bitmap, value) { return { enumerable: !(bitmap & 1), configurable: !(bitmap & 2), writable: !(bitmap & 4), value: value }; }; var $Object$4 = Object; var split$3 = functionUncurryThis(''.split); // fallback for non-array-like ES3 and non-enumerable old V8 strings var indexedObject = fails(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 classofRaw(it) === 'String' ? split$3(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 = function (it) { return it === null || it === undefined; }; var $TypeError$n = TypeError; // `RequireObjectCoercible` abstract operation // https://tc39.es/ecma262/#sec-requireobjectcoercible var requireObjectCoercible = function (it) { if (isNullOrUndefined(it)) throw new $TypeError$n("Can't call method on " + it); return it; }; // toObject with fallback for non-array-like ES3 strings var toIndexedObject = function (it) { return indexedObject(requireObjectCoercible(it)); }; var isObject$1 = function (it) { return typeof it == 'object' ? it !== null : isCallable(it); }; var path = {}; var aFunction = function (variable) { return isCallable(variable) ? variable : undefined; }; var getBuiltIn = function (namespace, method) { return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(globalThis_1[namespace]) : path[namespace] && path[namespace][method] || globalThis_1[namespace] && globalThis_1[namespace][method]; }; var objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf); var navigator$1 = globalThis_1.navigator; var userAgent = navigator$1 && navigator$1.userAgent; var environmentUserAgent = userAgent ? String(userAgent) : ''; var process$3 = globalThis_1.process; var Deno$1 = globalThis_1.Deno; var versions = process$3 && process$3.versions || Deno$1 && Deno$1.version; var v8 = versions && versions.v8; var match, version$1; 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$1 = 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$1 && environmentUserAgent) { match = environmentUserAgent.match(/Edge\/(\d+)/); if (!match || match[1] >= 74) { match = environmentUserAgent.match(/Chrome\/(\d+)/); if (match) version$1 = +match[1]; } } var environmentV8Version = version$1; /* eslint-disable es/no-symbol -- required for testing */ var $String$5 = globalThis_1.String; // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails(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 && environmentV8Version && environmentV8Version < 41; }); /* eslint-disable es/no-symbol -- required for testing */ var useSymbolAsUid = symbolConstructorDetection && !Symbol.sham && typeof Symbol.iterator == 'symbol'; var $Object$3 = Object; var isSymbol = useSymbolAsUid ? function (it) { return typeof it == 'symbol'; } : function (it) { var $Symbol = getBuiltIn('Symbol'); return isCallable($Symbol) && objectIsPrototypeOf($Symbol.prototype, $Object$3(it)); }; var $String$4 = String; var tryToString = function (argument) { try { return $String$4(argument); } catch (error) { return 'Object'; } }; var $TypeError$m = TypeError; // `Assert: IsCallable(argument) is true` var aCallable = function (argument) { if (isCallable(argument)) return argument; throw new $TypeError$m(tryToString(argument) + ' is not a function'); }; // `GetMethod` abstract operation // https://tc39.es/ecma262/#sec-getmethod var getMethod = function (V, P) { var func = V[P]; return isNullOrUndefined(func) ? undefined : aCallable(func); }; var $TypeError$l = TypeError; // `OrdinaryToPrimitive` abstract operation // https://tc39.es/ecma262/#sec-ordinarytoprimitive var ordinaryToPrimitive = function (input, pref) { var fn, val; if (pref === 'string' && isCallable(fn = input.toString) && !isObject$1(val = functionCall(fn, input))) return val; if (isCallable(fn = input.valueOf) && !isObject$1(val = functionCall(fn, input))) return val; if (pref !== 'string' && isCallable(fn = input.toString) && !isObject$1(val = functionCall(fn, input))) return val; throw new $TypeError$l("Can't convert object to primitive value"); }; var isPure = true; // eslint-disable-next-line es/no-object-defineproperty -- safe var defineProperty$d = Object.defineProperty; var defineGlobalProperty = function (key, value) { try { defineProperty$d(globalThis_1, key, { value: value, configurable: true, writable: true }); } catch (error) { globalThis_1[key] = value; } return value; }; var sharedStore = createCommonjsModule(function (module) { var SHARED = '__core-js_shared__'; var store = module.exports = globalThis_1[SHARED] || defineGlobalProperty(SHARED, {}); (store.versions || (store.versions = [])).push({ version: '3.40.0', mode: 'pure' , copyright: '© 2014-2025 Denis Pushkarev (zloirock.ru)', license: 'https://github.com/zloirock/core-js/blob/v3.40.0/LICENSE', source: 'https://github.com/zloirock/core-js' }); }); var shared = function (key, value) { return sharedStore[key] || (sharedStore[key] = value || {}); }; var $Object$2 = Object; // `ToObject` abstract operation // https://tc39.es/ecma262/#sec-toobject var toObject = function (argument) { return $Object$2(requireObjectCoercible(argument)); }; var hasOwnProperty$a = functionUncurryThis({}.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$a(toObject(it), key); }; var id = 0; var postfix = Math.random(); var toString = functionUncurryThis(1.0.toString); var uid = function (key) { return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36); }; var Symbol$6 = globalThis_1.Symbol; var WellKnownSymbolsStore$2 = shared('wks'); var createWellKnownSymbol = useSymbolAsUid ? Symbol$6['for'] || Symbol$6 : Symbol$6 && Symbol$6.withoutSetter || uid; var wellKnownSymbol = function (name) { if (!hasOwnProperty_1(WellKnownSymbolsStore$2, name)) { WellKnownSymbolsStore$2[name] = symbolConstructorDetection && hasOwnProperty_1(Symbol$6, name) ? Symbol$6[name] : createWellKnownSymbol('Symbol.' + name); } return WellKnownSymbolsStore$2[name]; }; var $TypeError$k = TypeError; var TO_PRIMITIVE = wellKnownSymbol('toPrimitive'); // `ToPrimitive` abstract operation // https://tc39.es/ecma262/#sec-toprimitive var toPrimitive$6 = function (input, pref) { if (!isObject$1(input) || isSymbol(input)) return input; var exoticToPrim = getMethod(input, TO_PRIMITIVE); var result; if (exoticToPrim) { if (pref === undefined) pref = 'default'; result = functionCall(exoticToPrim, input, pref); if (!isObject$1(result) || isSymbol(result)) return result; throw new $TypeError$k("Can't convert object to primitive value"); } if (pref === undefined) pref = 'number'; return ordinaryToPrimitive(input, pref); }; // `ToPropertyKey` abstract operation // https://tc39.es/ecma262/#sec-topropertykey var toPropertyKey = function (argument) { var key = toPrimitive$6(argument, 'string'); return isSymbol(key) ? key : key + ''; }; var document$4 = globalThis_1.document; // typeof document.createElement is 'object' in old IE var EXISTS$1 = isObject$1(document$4) && isObject$1(document$4.createElement); var documentCreateElement = function (it) { return EXISTS$1 ? document$4.createElement(it) : {}; }; // Thanks to IE8 for its funny defineProperty var ie8DomDefine = !descriptors && !fails(function () { // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty(documentCreateElement('div'), 'a', { get: function () { return 7; } }).a !== 7; }); // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var $getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor; // `Object.getOwnPropertyDescriptor` method // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor var f$8 = descriptors ? $getOwnPropertyDescriptor$2 : function getOwnPropertyDescriptor(O, P) { O = toIndexedObject(O); P = toPropertyKey(P); if (ie8DomDefine) try { return $getOwnPropertyDescriptor$2(O, P); } catch (error) { /* empty */ } if (hasOwnProperty_1(O, P)) return createPropertyDescriptor(!functionCall(objectPropertyIsEnumerable.f, O, P), O[P]); }; var objectGetOwnPropertyDescriptor = { f: f$8 }; var replacement = /#|\.prototype\./; var isForced = function (feature, detection) { var value = data[normalize(feature)]; return value === POLYFILL ? true : value === NATIVE ? false : isCallable(detection) ? fails(detection) : !!detection; }; var normalize = isForced.normalize = function (string) { return String(string).replace(replacement, '.').toLowerCase(); }; var data = isForced.data = {}; var NATIVE = isForced.NATIVE = 'N'; var POLYFILL = isForced.POLYFILL = 'P'; var isForced_1 = isForced; var bind$8 = functionUncurryThisClause(functionUncurryThisClause.bind); // optional / simple context binding var functionBindContext = function (fn, that) { aCallable(fn); return that === undefined ? fn : functionBindNative ? bind$8(fn, that) : function (/* ...args */) { return fn.apply(that, arguments); }; }; // V8 ~ Chrome 36- // https://bugs.chromium.org/p/v8/issues/detail?id=3334 var v8PrototypeDefineBug = descriptors && fails(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 $String$3 = String; var $TypeError$j = TypeError; // `Assert: Type(argument) is Object` var anObject = function (argument) { if (isObject$1(argument)) return argument; throw new $TypeError$j($String$3(argument) + ' is not an object'); }; var $TypeError$i = TypeError; // eslint-disable-next-line es/no-object-defineproperty -- safe var $defineProperty$1 = Object.defineProperty; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor; var ENUMERABLE = 'enumerable'; var CONFIGURABLE$1 = 'configurable'; var WRITABLE = 'writable'; // `Object.defineProperty` method // https://tc39.es/ecma262/#sec-object.defineproperty var f$7 = descriptors ? v8PrototypeDefineBug ? function defineProperty(O, P, Attributes) { anObject(O); P = toPropertyKey(P); anObject(Attributes); if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) { var current = $getOwnPropertyDescriptor$1(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$1(O, P, Attributes); } : $defineProperty$1 : function defineProperty(O, P, Attributes) { anObject(O); P = toPropertyKey(P); anObject(Attributes); if (ie8DomDefine) try { return $defineProperty$1(O, P, Attributes); } catch (error) { /* empty */ } if ('get' in Attributes || 'set' in Attributes) throw new $TypeError$i('Accessors not supported'); if ('value' in Attributes) O[P] = Attributes.value; return O; }; var objectDefineProperty = { f: f$7 }; var createNonEnumerableProperty = descriptors ? function (object, key, value) { return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value)); } : function (object, key, value) { object[key] = value; return object; }; var getOwnPropertyDescriptor$4 = objectGetOwnPropertyDescriptor.f; // add debugging info var wrapConstructor = function (NativeConstructor) { var Wrapper = function (a, b, c) { if (this instanceof Wrapper) { switch (arguments.length) { case 0: return new NativeConstructor(); case 1: return new NativeConstructor(a); case 2: return new NativeConstructor(a, b); } return new NativeConstructor(a, b, c); } return functionApply(NativeConstructor, this, arguments); }; Wrapper.prototype = NativeConstructor.prototype; return Wrapper; }; /* 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 PROTO = options.proto; var nativeSource = GLOBAL ? globalThis_1 : STATIC ? globalThis_1[TARGET] : globalThis_1[TARGET] && globalThis_1[TARGET].prototype; var target = GLOBAL ? path : path[TARGET] || createNonEnumerableProperty(path, TARGET, {})[TARGET]; var targetPrototype = target.prototype; var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE; var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor; for (key in source) { FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); // contains in native USE_NATIVE = !FORCED && nativeSource && hasOwnProperty_1(nativeSource, key); targetProperty = target[key]; if (USE_NATIVE) if (options.dontCallGetSet) { descriptor = getOwnPropertyDescriptor$4(nativeSource, key); nativeProperty = descriptor && descriptor.value; } else nativeProperty = nativeSource[key]; // export native or implementation sourceProperty = (USE_NATIVE && nativeProperty) ? nativeProperty : source[key]; if (!FORCED && !PROTO && typeof targetProperty == typeof sourceProperty) continue; // bind methods to global for calling from export context if (options.bind && USE_NATIVE) resultProperty = functionBindContext(sourceProperty, globalThis_1); // wrap global constructors for prevent changes in this version else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty); // make static versions for prototype methods else if (PROTO && isCallable(sourceProperty)) resultProperty = functionUncurryThisClause(sourceProperty); // default case else resultProperty = sourceProperty; // add a flag to not completely full polyfills if (options.sham || (sourceProperty && sourceProperty.sham) || (targetProperty && targetProperty.sham)) { createNonEnumerableProperty(resultProperty, 'sham', true); } createNonEnumerableProperty(target, key, resultProperty); if (PROTO) { VIRTUAL_PROTOTYPE = TARGET + 'Prototype'; if (!hasOwnProperty_1(path, VIRTUAL_PROTOTYPE)) { createNonEnumerableProperty(path, VIRTUAL_PROTOTYPE, {}); } // export virtual prototype methods createNonEnumerableProperty(path[VIRTUAL_PROTOTYPE], key, sourceProperty); // export real prototype methods if (options.real && targetPrototype && (FORCED || !targetPrototype[key])) { createNonEnumerableProperty(targetPrototype, key, sourceProperty); } } } }; var ceil$1 = Math.ceil; var floor$3 = 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$3 : ceil$1)(n); }; // `ToIntegerOrInfinity` abstract operation // https://tc39.es/ecma262/#sec-tointegerorinfinity var toIntegerOrInfinity = function (argument) { var number = +argument; // eslint-disable-next-line no-self-compare -- NaN check return number !== number || number === 0 ? 0 : mathTrunc(number); }; var max$3 = Math.max; var min$3 = 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 = function (index, length) { var integer = toIntegerOrInfinity(index); return integer < 0 ? max$3(integer + length, 0) : min$3(integer, length); }; var min$2 = Math.min; // `ToLength` abstract operation // https://tc39.es/ecma262/#sec-tolength var toLength = function (argument) { var len = toIntegerOrInfinity(argument); return len > 0 ? min$2(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 }; // `LengthOfArrayLike` abstract operation // https://tc39.es/ecma262/#sec-lengthofarraylike var lengthOfArrayLike = function (obj) { return toLength(obj.length); }; // `Array.prototype.{ indexOf, includes }` methods implementation var createMethod$6 = function (IS_INCLUDES) { return function ($this, el, fromIndex) { var O = toIndexedObject($this); var length = lengthOfArrayLike(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$6(true), // `Array.prototype.indexOf` method // https://tc39.es/ecma262/#sec-array.prototype.indexof indexOf: createMethod$6(false) }; var hiddenKeys$1 = {}; var indexOf$7 = arrayIncludes.indexOf; var push$h = functionUncurryThis([].push); var objectKeysInternal = function (object, names) { var O = toIndexedObject(object); var i = 0; var result = []; var key; for (key in O) !hasOwnProperty_1(hiddenKeys$1, key) && hasOwnProperty_1(O, key) && push$h(result, key); // Don't enum bug & hidden keys while (names.length > i) if (hasOwnProperty_1(O, key = names[i++])) { ~indexOf$7(result, key) || push$h(result, key); } return result; }; // IE8- don't enum bug keys var enumBugKeys = [ 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf' ]; // `Object.keys` method // https://tc39.es/ecma262/#sec-object.keys // eslint-disable-next-line es/no-object-keys -- safe var objectKeys = Object.keys || function keys(O) { return objectKeysInternal(O, enumBugKeys); }; // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe var f$6 = Object.getOwnPropertySymbols; var objectGetOwnPropertySymbols = { f: f$6 }; // eslint-disable-next-line es/no-object-assign -- safe var $assign = Object.assign; // eslint-disable-next-line es/no-object-defineproperty -- required for testing var defineProperty$c = Object.defineProperty; var concat$6 = functionUncurryThis([].concat); // `Object.assign` method // https://tc39.es/ecma262/#sec-object.assign var objectAssign = !$assign || fails(function () { // should have correct order of operations (Edge bug) if (descriptors && $assign({ b: 1 }, $assign(defineProperty$c({}, 'a', { enumerable: true, get: function () { defineProperty$c(this, 'b', { value: 3, enumerable: false }); } }), { b: 2 })).b !== 1) return true; // should work with symbols and should have deterministic property order (V8 bug) var A = {}; var B = {}; // eslint-disable-next-line es/no-symbol -- safe var symbol = Symbol('assign detection'); var alphabet = 'abcdefghijklmnopqrst'; A[symbol] = 7; // eslint-disable-next-line es/no-array-prototype-foreach -- safe alphabet.split('').forEach(function (chr) { B[chr] = chr; }); return $assign({}, A)[symbol] !== 7 || objectKeys($assign({}, B)).join('') !== alphabet; }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length` var T = toObject(target); var argumentsLength = arguments.length; var index = 1; var getOwnPropertySymbols = objectGetOwnPropertySymbols.f; var propertyIsEnumerable = objectPropertyIsEnumerable.f; while (argumentsLength > index) { var S = indexedObject(arguments[index++]); var keys = getOwnPropertySymbols ? concat$6(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S); var length = keys.length; var j = 0; var key; while (length > j) { key = keys[j++]; if (!descriptors || functionCall(propertyIsEnumerable, S, key)) T[key] = S[key]; } } return T; } : $assign; // `Object.assign` method // https://tc39.es/ecma262/#sec-object.assign // eslint-disable-next-line es/no-object-assign -- required for testing _export({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== objectAssign }, { assign: objectAssign }); var assign$5 = path.Object.assign; var assign$4 = assign$5; var assign$3 = assign$4; var assign$2 = assign$3; var assign$1 = assign$2; var arraySlice = functionUncurryThis([].slice); var $Function = Function; var concat$5 = functionUncurryThis([].concat); var join$4 = functionUncurryThis([].join); var factories = {}; var construct$7 = function (C, argsLength, args) { if (!hasOwnProperty_1(factories, argsLength)) { var list = []; var i = 0; for (; i < argsLength; i++) list[i] = 'a[' + i + ']'; factories[argsLength] = $Function('C,a', 'return new C(' + join$4(list, ',') + ')'); } return factories[argsLength](C, args); }; // `Function.prototype.bind` method implementation // https://tc39.es/ecma262/#sec-function.prototype.bind // eslint-disable-next-line es/no-function-prototype-bind -- detection var functionBind = functionBindNative ? $Function.bind : function bind(that /* , ...args */) { var F = aCallable(this); var Prototype = F.prototype; var partArgs = arraySlice(arguments, 1); var boundFunction = function bound(/* args... */) { var args = concat$5(partArgs, arraySlice(arguments)); return this instanceof boundFunction ? construct$7(F, args.length, args) : F.apply(that, args); }; if (isObject$1(Prototype)) boundFunction.prototype = Prototype; return boundFunction; }; // TODO: Remove from `core-js@4` // `Function.prototype.bind` method // https://tc39.es/ecma262/#sec-function.prototype.bind // eslint-disable-next-line es/no-function-prototype-bind -- detection _export({ target: 'Function', proto: true, forced: Function.bind !== functionBind }, { bind: functionBind }); var getBuiltInPrototypeMethod = function (CONSTRUCTOR, METHOD) { var Namespace = path[CONSTRUCTOR + 'Prototype']; var pureMethod = Namespace && Namespace[METHOD]; if (pureMethod) return pureMethod; var NativeConstructor = globalThis_1[CONSTRUCTOR]; var NativePrototype = NativeConstructor && NativeConstructor.prototype; return NativePrototype && NativePrototype[METHOD]; }; var bind$7 = getBuiltInPrototypeMethod('Function', 'bind'); var FunctionPrototype$2 = Function.prototype; var bind$6 = function (it) { var own = it.bind; return it === FunctionPrototype$2 || (objectIsPrototypeOf(FunctionPrototype$2, it) && own === FunctionPrototype$2.bind) ? bind$7 : own; }; var bind$5 = bind$6; var bind$4 = bind$5; var bind$3 = bind$4; var bind$2 = bind$3; var _extends_1 = createCommonjsModule(function (module) { function _extends() { var _context; return module.exports = _extends = assign$1 ? bind$2(_context = assign$1).call(_context) : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, module.exports.__esModule = true, module.exports["default"] = module.exports, _extends.apply(null, arguments); } module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports; }); var _extends$1 = unwrapExports(_extends_1); var iterators = {}; var WeakMap$2 = globalThis_1.WeakMap; var weakMapBasicDetection = isCallable(WeakMap$2) && /native code/.test(String(WeakMap$2)); var keys$8 = shared('keys'); var sharedKey = function (key) { return keys$8[key] || (keys$8[key] = uid(key)); }; var OBJECT_ALREADY_INITIALIZED = 'Object already initialized'; var TypeError$5 = globalThis_1.TypeError; var WeakMap$1 = globalThis_1.WeakMap; var set$d, get$5, has$a; var enforce = function (it) { return has$a(it) ? get$5(it) : set$d(it, {}); }; var getterFor = function (TYPE) { return function (it) { var state; if (!isObject$1(it) || (state = get$5(it)).type !== TYPE) { throw new TypeError$5('Incompatible receiver, ' + TYPE + ' required'); } return state; }; }; if (weakMapBasicDetection || sharedStore.state) { var store = sharedStore.state || (sharedStore.state = new WeakMap$1()); /* 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$d = function (it, metadata) { if (store.has(it)) throw new TypeError$5(OBJECT_ALREADY_INITIALIZED); metadata.facade = it; store.set(it, metadata); return metadata; }; get$5 = function (it) { return store.get(it) || {}; }; has$a = function (it) { return store.has(it); }; } else { var STATE = sharedKey('state'); hiddenKeys$1[STATE] = true; set$d = function (it, metadata) { if (hasOwnProperty_1(it, STATE)) throw new TypeError$5(OBJECT_ALREADY_INITIALIZED); metadata.facade = it; createNonEnumerableProperty(it, STATE, metadata); return metadata; }; get$5 = function (it) { return hasOwnProperty_1(it, STATE) ? it[STATE] : {}; }; has$a = function (it) { return hasOwnProperty_1(it, STATE); }; } var internalState = { set: set$d, get: get$5, has: has$a, enforce: enforce, getterFor: getterFor }; var FunctionPrototype$1 = Function.prototype; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var getDescriptor = descriptors && Object.getOwnPropertyDescriptor; var EXISTS = hasOwnProperty_1(FunctionPrototype$1, 'name'); // additional protection from minified / mangled / dropped function names var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something'; var CONFIGURABLE = EXISTS && (!descriptors || (descriptors && getDescriptor(FunctionPrototype$1, 'name').configurable)); var functionName = { EXISTS: EXISTS, PROPER: PROPER, CONFIGURABLE: CONFIGURABLE }; // `Object.defineProperties` method // https://tc39.es/ecma262/#sec-object.defineproperties // eslint-disable-next-line es/no-object-defineproperties -- safe var f$5 = descriptors && !v8PrototypeDefineBug ? Object.defineProperties : function defineProperties(O, Properties) { anObject(O); var props = toIndexedObject(Properties); var keys = objectKeys(Properties); var length = keys.length; var index = 0; var key; while (length > index) objectDefineProperty.f(O, key = keys[index++], props[key]); return O; }; var objectDefineProperties = { f: f$5 }; var html = getBuiltIn('document', 'documentElement'); /* global ActiveXObject -- old IE, WSH */ var GT = '>'; var LT = '<'; var PROTOTYPE$1 = 'prototype'; var SCRIPT = 'script'; var IE_PROTO$1 = sharedKey('IE_PROTO'); var EmptyConstructor = function () { /* empty */ }; var scriptTag = function (content) { return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT; }; // Create object with fake `null` prototype: use ActiveX Object with cleared prototype var NullProtoObjectViaActiveX = function (activeXDocument) { activeXDocument.write(scriptTag('')); activeXDocument.close(); var temp = activeXDocument.parentWindow.Object; // eslint-disable-next-line no-useless-assignment -- avoid memory leak activeXDocument = null; return temp; }; // Create object with fake `null` prototype: use iframe Object with cleared prototype var NullProtoObjectViaIFrame = function () { // Thrash, waste and sodomy: IE GC bug var iframe = documentCreateElement('iframe'); var JS = 'java' + SCRIPT + ':'; var iframeDocument; iframe.style.display = 'none'; html.appendChild(iframe); // https://github.com/zloirock/core-js/issues/475 iframe.src = String(JS); iframeDocument = iframe.contentWindow.document; iframeDocument.open(); iframeDocument.write(scriptTag('document.F=Object')); iframeDocument.close(); return iframeDocument.F; }; // Check for document.domain and active x support // No need to use active x approach when document.domain is not set // see https://github.com/es-shims/es5-shim/issues/150 // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346 // avoid IE GC bug var activeXDocument; var NullProtoObject = function () { try { activeXDocument = new ActiveXObject('htmlfile'); } catch (error) { /* ignore */ } NullProtoObject = typeof document != 'undefined' ? document.domain && activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) // old IE : NullProtoObjectViaIFrame() : NullProtoObjectViaActiveX(activeXDocument); // WSH var length = enumBugKeys.length; while (length--) delete NullProtoObject[PROTOTYPE$1][enumBugKeys[length]]; return NullProtoObject(); }; hiddenKeys$1[IE_PROTO$1] = true; // `Object.create` method // https://tc39.es/ecma262/#sec-object.create // eslint-disable-next-line es/no-object-create -- safe var objectCreate$1 = Object.create || function create(O, Properties) { var result; if (O !== null) { EmptyConstructor[PROTOTYPE$1] = anObject(O); result = new EmptyConstructor(); EmptyConstructor[PROTOTYPE$1] = null; // add "__proto__" for Object.getPrototypeOf polyfill result[IE_PROTO$1] = O; } else result = NullProtoObject(); return Properties === undefined ? result : objectDefineProperties.f(result, Properties); }; var correctPrototypeGetter = !fails(function () { function F() { /* empty */ } F.prototype.constructor = null; // eslint-disable-next-line es/no-object-getprototypeof -- required for testing return Object.getPrototypeOf(new F()) !== F.prototype; }); var IE_PROTO = sharedKey('IE_PROTO'); var $Object$1 = Object; var ObjectPrototype$2 = $Object$1.prototype; // `Object.getPrototypeOf` method // https://tc39.es/ecma262/#sec-object.getprototypeof // eslint-disable-next-line es/no-object-getprototypeof -- safe var objectGetPrototypeOf = correctPrototypeGetter ? $Object$1.getPrototypeOf : function (O) { var object = toObject(O); if (hasOwnProperty_1(object, IE_PROTO)) return object[IE_PROTO]; var constructor = object.constructor; if (isCallable(constructor) && object instanceof constructor) { return constructor.prototype; } return object instanceof $Object$1 ? ObjectPrototype$2 : null; }; var defineBuiltIn = function (target, key, value, options) { if (options && options.enumerable) target[key] = value; else createNonEnumerableProperty(target, key, value); return target; }; var ITERATOR$8 = wellKnownSymbol('iterator'); var BUGGY_SAFARI_ITERATORS$1 = false; // `%IteratorPrototype%` object // https://tc39.es/ecma262/#sec-%iteratorprototype%-object var IteratorPrototype$1, PrototypeOfArrayIteratorPrototype, arrayIterator; /* eslint-disable es/no-array-prototype-keys -- safe */ if ([].keys) { arrayIterator = [].keys(); // Safari 8 has buggy iterators w/o `next` if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true; else { PrototypeOfArrayIteratorPrototype = objectGetPrototypeOf(objectGetPrototypeOf(arrayIterator)); if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$1 = PrototypeOfArrayIteratorPrototype; } } var NEW_ITERATOR_PROTOTYPE = !isObject$1(IteratorPrototype$1) || fails(function () { var test = {}; // FF44- legacy iterators case return IteratorPrototype$1[ITERATOR$8].call(test) !== test; }); if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$1 = {}; else IteratorPrototype$1 = objectCreate$1(IteratorPrototype$1); // `%IteratorPrototype%[@@iterator]()` method // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator if (!isCallable(IteratorPrototype$1[ITERATOR$8])) { defineBuiltIn(IteratorPrototype$1, ITERATOR$8, function () { return this; }); } var iteratorsCore = { IteratorPrototype: IteratorPrototype$1, BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1 }; var TO_STRING_TAG$3 = wellKnownSymbol('toStringTag'); var test$2 = {}; test$2[TO_STRING_TAG$3] = 'z'; var toStringTagSupport = String(test$2) === '[object z]'; var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag'); var $Object = 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 = toStringTagSupport ? classofRaw : function (it) { var O, tag, result; return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG$2)) == 'string' ? tag // builtinTag case : CORRECT_ARGUMENTS ? classofRaw(O) // ES3 arguments fallback : (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result; }; // `Object.prototype.toString` method implementation // https://tc39.es/ecma262/#sec-object.prototype.tostring var objectToString$1 = toStringTagSupport ? {}.toString : function toString() { return '[object ' + classof(this) + ']'; }; var defineProperty$b = objectDefineProperty.f; var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag'); var setToStringTag = function (it, TAG, STATIC, SET_METHOD) { var target = STATIC ? it : it && it.prototype; if (target) { if (!hasOwnProperty_1(target, TO_STRING_TAG$1)) { defineProperty$b(target, TO_STRING_TAG$1, { configurable: true, value: TAG }); } if (SET_METHOD && !toStringTagSupport) { createNonEnumerableProperty(target, 'toString', objectToString$1); } } }; var IteratorPrototype = iteratorsCore.IteratorPrototype; var returnThis$1 = function () { return this; }; var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) { var TO_STRING_TAG = NAME + ' Iterator'; IteratorConstructor.prototype = objectCreate$1(IteratorPrototype, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) }); setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true); iterators[TO_STRING_TAG] = returnThis$1; return IteratorConstructor; }; var functionUncurryThisAccessor = function (object, key, method) { try { // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe return functionUncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method])); } catch (error) { /* empty */ } }; var isPossiblePrototype = function (argument) { return isObject$1(argument) || argument === null; }; var $String$2 = String; var $TypeError$h = TypeError; var aPossiblePrototype = function (argument) { if (isPossiblePrototype(argument)) return argument; throw new $TypeError$h("Can't set " + $String$2(argument) + ' as a prototype'); }; /* eslint-disable no-proto -- safe */ // `Object.setPrototypeOf` method // https://tc39.es/ecma262/#sec-object.setprototypeof // Works with __proto__ only. Old v8 can't work with null proto objects. // eslint-disable-next-line es/no-object-setprototypeof -- safe var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () { var CORRECT_SETTER = false; var test = {}; var setter; try { setter = functionUncurryThisAccessor(Object.prototype, '__proto__', 'set'); setter(test, []); CORRECT_SETTER = test instanceof Array; } catch (error) { /* empty */ } return function setPrototypeOf(O, proto) { requireObjectCoercible(O); aPossiblePrototype(proto); if (!isObject$1(O)) return O; if (CORRECT_SETTER) setter(O, proto); else O.__proto__ = proto; return O; }; }() : undefined); var PROPER_FUNCTION_NAME$1 = functionName.PROPER; var BUGGY_SAFARI_ITERATORS = iteratorsCore.BUGGY_SAFARI_ITERATORS; var ITERATOR$7 = wellKnownSymbol('iterator'); var KEYS = 'keys'; var VALUES = 'values'; var ENTRIES = 'entries'; var returnThis = function () { return this; }; var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) { iteratorCreateConstructor(IteratorConstructor, NAME, next); var getIterationMethod = function (KIND) { if (KIND === DEFAULT && defaultIterator) return defaultIterator; if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND]; switch (KIND) { case KEYS: return function keys() { return new IteratorConstructor(this, KIND); }; case VALUES: return function values() { return new IteratorConstructor(this, KIND); }; case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); }; } return function () { return new IteratorConstructor(this); }; }; var TO_STRING_TAG = NAME + ' Iterator'; var INCORRECT_VALUES_NAME = false; var IterablePrototype = Iterable.prototype; var nativeIterator = IterablePrototype[ITERATOR$7] || IterablePrototype['@@iterator'] || DEFAULT && IterablePrototype[DEFAULT]; var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT); var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator; var CurrentIteratorPrototype, methods, KEY; // fix native if (anyNativeIterator) { CurrentIteratorPrototype = objectGetPrototypeOf(anyNativeIterator.call(new Iterable())); if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) { // Set @@toStringTag to native iterators setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true); iterators[TO_STRING_TAG] = returnThis; } } // fix Array.prototype.{ values, @@iterator }.name in V8 / FF if (PROPER_FUNCTION_NAME$1 && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) { { INCORRECT_VALUES_NAME = true; defaultIterator = function values() { return functionCall(nativeIterator, this); }; } } // export additional methods if (DEFAULT) { methods = { values: getIterationMethod(VALUES), keys: IS_SET ? defaultIterator : getIterationMethod(KEYS), entries: getIterationMethod(ENTRIES) }; if (FORCED) for (KEY in methods) { if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) { defineBuiltIn(IterablePrototype, KEY, methods[KEY]); } } else _export({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods); } // define iterator if ((FORCED) && IterablePrototype[ITERATOR$7] !== defaultIterator) { defineBuiltIn(IterablePrototype, ITERATOR$7, defaultIterator, { name: DEFAULT }); } iterators[NAME] = defaultIterator; return methods; }; // `CreateIterResultObject` abstract operation // https://tc39.es/ecma262/#sec-createiterresultobject var createIterResultObject = function (value, done) { return { value: value, done: done }; }; objectDefineProperty.f; var ARRAY_ITERATOR = 'Array Iterator'; var setInternalState$7 = internalState.set; var getInternalState$2 = internalState.getterFor(ARRAY_ITERATOR); // `Array.prototype.entries` method // https://tc39.es/ecma262/#sec-array.prototype.entries // `Array.prototype.keys` method // https://tc39.es/ecma262/#sec-array.prototype.keys // `Array.prototype.values` method // https://tc39.es/ecma262/#sec-array.prototype.values // `Array.prototype[@@iterator]` method // https://tc39.es/ecma262/#sec-array.prototype-@@iterator // `CreateArrayIterator` internal method // https://tc39.es/ecma262/#sec-createarrayiterator iteratorDefine(Array, 'Array', function (iterated, kind) { setInternalState$7(this, { type: ARRAY_ITERATOR, target: toIndexedObject(iterated), // target index: 0, // next index kind: kind // kind }); // `%ArrayIteratorPrototype%.next` method // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next }, function () { var state = getInternalState$2(this); var target = state.target; var index = state.index++; if (!target || index >= target.length) { state.target = null; return createIterResultObject(undefined, true); } switch (state.kind) { case 'keys': return createIterResultObject(index, false); case 'values': return createIterResultObject(target[index], false); } return createIterResultObject([index, target[index]], false); }, 'values'); // argumentsList[@@iterator] is %ArrayProto_values% // https://tc39.es/ecma262/#sec-createunmappedargumentsobject // https://tc39.es/ecma262/#sec-createmappedargumentsobject iterators.Arguments = iterators.Array; var ITERATOR$6 = wellKnownSymbol('iterator'); var ArrayPrototype$j = Array.prototype; // check on default Array iterator var isArrayIteratorMethod = function (it) { return it !== undefined && (iterators.Array === it || ArrayPrototype$j[ITERATOR$6] === it); }; var ITERATOR$5 = wellKnownSymbol('iterator'); var getIteratorMethod$5 = function (it) { if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR$5) || getMethod(it, '@@iterator') || iterators[classof(it)]; }; var $TypeError$g = TypeError; var getIterator = function (argument, usingIterator) { var iteratorMethod = arguments.length < 2 ? getIteratorMethod$5(argument) : usingIterator; if (aCallable(iteratorMethod)) return anObject(functionCall(iteratorMethod, argument)); thr