@rpcbase/client 0.400.0 → 0.402.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/getFeatureFlag.d.ts.map +1 -1
- package/dist/index.js +7 -420
- package/dist/index.js.map +1 -1
- package/dist/spatial-nav/SpatialNavigation.d.ts +310 -0
- package/dist/spatial-nav/SpatialNavigation.d.ts.map +1 -0
- package/dist/spatial-nav/VisualDebugger.d.ts +34 -0
- package/dist/spatial-nav/VisualDebugger.d.ts.map +1 -0
- package/dist/spatial-nav/WritingDirection.d.ts +6 -0
- package/dist/spatial-nav/WritingDirection.d.ts.map +1 -0
- package/dist/spatial-nav/index.d.ts +4 -0
- package/dist/spatial-nav/index.d.ts.map +1 -0
- package/dist/spatial-nav/index.js +4342 -0
- package/dist/spatial-nav/index.js.map +1 -0
- package/dist/spatial-nav/measureLayout.d.ts +22 -0
- package/dist/spatial-nav/measureLayout.d.ts.map +1 -0
- package/dist/spatial-nav/useFocusContext.d.ts +4 -0
- package/dist/spatial-nav/useFocusContext.d.ts.map +1 -0
- package/dist/spatial-nav/useFocusable.d.ts +35 -0
- package/dist/spatial-nav/useFocusable.d.ts.map +1 -0
- package/dist/throttle-CXOc9Dto.js +396 -0
- package/dist/throttle-CXOc9Dto.js.map +1 -0
- package/package.json +6 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../node_modules/lodash/noop.js","../../../../node_modules/lodash/uniqueId.js","../../../../node_modules/lodash/isFunction.js","../../../../node_modules/lodash/_coreJsData.js","../../../../node_modules/lodash/_isMasked.js","../../../../node_modules/lodash/_toSource.js","../../../../node_modules/lodash/_baseIsNative.js","../../../../node_modules/lodash/_getValue.js","../../../../node_modules/lodash/_getNative.js","../../../../node_modules/lodash/_nativeCreate.js","../../../../node_modules/lodash/_hashClear.js","../../../../node_modules/lodash/_hashDelete.js","../../../../node_modules/lodash/_hashGet.js","../../../../node_modules/lodash/_hashHas.js","../../../../node_modules/lodash/_hashSet.js","../../../../node_modules/lodash/_Hash.js","../../../../node_modules/lodash/_listCacheClear.js","../../../../node_modules/lodash/eq.js","../../../../node_modules/lodash/_assocIndexOf.js","../../../../node_modules/lodash/_listCacheDelete.js","../../../../node_modules/lodash/_listCacheGet.js","../../../../node_modules/lodash/_listCacheHas.js","../../../../node_modules/lodash/_listCacheSet.js","../../../../node_modules/lodash/_ListCache.js","../../../../node_modules/lodash/_Map.js","../../../../node_modules/lodash/_mapCacheClear.js","../../../../node_modules/lodash/_isKeyable.js","../../../../node_modules/lodash/_getMapData.js","../../../../node_modules/lodash/_mapCacheDelete.js","../../../../node_modules/lodash/_mapCacheGet.js","../../../../node_modules/lodash/_mapCacheHas.js","../../../../node_modules/lodash/_mapCacheSet.js","../../../../node_modules/lodash/_MapCache.js","../../../../node_modules/lodash/_setCacheAdd.js","../../../../node_modules/lodash/_setCacheHas.js","../../../../node_modules/lodash/_SetCache.js","../../../../node_modules/lodash/_baseFindIndex.js","../../../../node_modules/lodash/_baseIsNaN.js","../../../../node_modules/lodash/_strictIndexOf.js","../../../../node_modules/lodash/_baseIndexOf.js","../../../../node_modules/lodash/_arrayIncludes.js","../../../../node_modules/lodash/_arrayIncludesWith.js","../../../../node_modules/lodash/_baseUnary.js","../../../../node_modules/lodash/_cacheHas.js","../../../../node_modules/lodash/_baseDifference.js","../../../../node_modules/lodash/_arrayPush.js","../../../../node_modules/lodash/_baseIsArguments.js","../../../../node_modules/lodash/isArguments.js","../../../../node_modules/lodash/_isFlattenable.js","../../../../node_modules/lodash/_baseFlatten.js","../../../../node_modules/lodash/identity.js","../../../../node_modules/lodash/_apply.js","../../../../node_modules/lodash/_overRest.js","../../../../node_modules/lodash/constant.js","../../../../node_modules/lodash/_defineProperty.js","../../../../node_modules/lodash/_baseSetToString.js","../../../../node_modules/lodash/_shortOut.js","../../../../node_modules/lodash/_setToString.js","../../../../node_modules/lodash/_baseRest.js","../../../../node_modules/lodash/isLength.js","../../../../node_modules/lodash/isArrayLike.js","../../../../node_modules/lodash/isArrayLikeObject.js","../../../../node_modules/lodash/difference.js","../../../../node_modules/lodash/_arrayFilter.js","../../../../node_modules/lodash/_createBaseFor.js","../../../../node_modules/lodash/_baseFor.js","../../../../node_modules/lodash/_baseTimes.js","../../../../node_modules/lodash/stubFalse.js","../../../../node_modules/lodash/isBuffer.js","../../../../node_modules/lodash/_isIndex.js","../../../../node_modules/lodash/_baseIsTypedArray.js","../../../../node_modules/lodash/_nodeUtil.js","../../../../node_modules/lodash/isTypedArray.js","../../../../node_modules/lodash/_arrayLikeKeys.js","../../../../node_modules/lodash/_isPrototype.js","../../../../node_modules/lodash/_overArg.js","../../../../node_modules/lodash/_nativeKeys.js","../../../../node_modules/lodash/_baseKeys.js","../../../../node_modules/lodash/keys.js","../../../../node_modules/lodash/_baseForOwn.js","../../../../node_modules/lodash/_createBaseEach.js","../../../../node_modules/lodash/_baseEach.js","../../../../node_modules/lodash/_baseFilter.js","../../../../node_modules/lodash/_stackClear.js","../../../../node_modules/lodash/_stackDelete.js","../../../../node_modules/lodash/_stackGet.js","../../../../node_modules/lodash/_stackHas.js","../../../../node_modules/lodash/_stackSet.js","../../../../node_modules/lodash/_Stack.js","../../../../node_modules/lodash/_arraySome.js","../../../../node_modules/lodash/_equalArrays.js","../../../../node_modules/lodash/_Uint8Array.js","../../../../node_modules/lodash/_mapToArray.js","../../../../node_modules/lodash/_setToArray.js","../../../../node_modules/lodash/_equalByTag.js","../../../../node_modules/lodash/_baseGetAllKeys.js","../../../../node_modules/lodash/stubArray.js","../../../../node_modules/lodash/_getSymbols.js","../../../../node_modules/lodash/_getAllKeys.js","../../../../node_modules/lodash/_equalObjects.js","../../../../node_modules/lodash/_DataView.js","../../../../node_modules/lodash/_Promise.js","../../../../node_modules/lodash/_Set.js","../../../../node_modules/lodash/_WeakMap.js","../../../../node_modules/lodash/_getTag.js","../../../../node_modules/lodash/_baseIsEqualDeep.js","../../../../node_modules/lodash/_baseIsEqual.js","../../../../node_modules/lodash/_baseIsMatch.js","../../../../node_modules/lodash/_isStrictComparable.js","../../../../node_modules/lodash/_getMatchData.js","../../../../node_modules/lodash/_matchesStrictComparable.js","../../../../node_modules/lodash/_baseMatches.js","../../../../node_modules/lodash/_isKey.js","../../../../node_modules/lodash/memoize.js","../../../../node_modules/lodash/_memoizeCapped.js","../../../../node_modules/lodash/_stringToPath.js","../../../../node_modules/lodash/_castPath.js","../../../../node_modules/lodash/_toKey.js","../../../../node_modules/lodash/_baseGet.js","../../../../node_modules/lodash/get.js","../../../../node_modules/lodash/_baseHasIn.js","../../../../node_modules/lodash/_hasPath.js","../../../../node_modules/lodash/hasIn.js","../../../../node_modules/lodash/_baseMatchesProperty.js","../../../../node_modules/lodash/_baseProperty.js","../../../../node_modules/lodash/_basePropertyDeep.js","../../../../node_modules/lodash/property.js","../../../../node_modules/lodash/_baseIteratee.js","../../../../node_modules/lodash/filter.js","../../../../node_modules/lodash/_baseFindKey.js","../../../../node_modules/lodash/findKey.js","../../../../node_modules/lodash/head.js","../../../../node_modules/lodash/first.js","../../../../node_modules/lodash/_arrayEach.js","../../../../node_modules/lodash/_castFunction.js","../../../../node_modules/lodash/forEach.js","../../../../node_modules/lodash/forOwn.js","../../../../node_modules/lodash/_baseMap.js","../../../../node_modules/lodash/_baseSortBy.js","../../../../node_modules/lodash/_compareAscending.js","../../../../node_modules/lodash/_compareMultiple.js","../../../../node_modules/lodash/_baseOrderBy.js","../../../../node_modules/lodash/_isIterateeCall.js","../../../../node_modules/lodash/sortBy.js","../../src/spatial-nav/WritingDirection.ts","../../src/spatial-nav/VisualDebugger.ts","../../src/spatial-nav/measureLayout.ts","../../src/spatial-nav/SpatialNavigation.ts","../../src/spatial-nav/useFocusContext.ts","../../src/spatial-nav/useFocusable.ts"],"sourcesContent":["/**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\nfunction noop() {\n // No operation performed.\n}\n\nmodule.exports = noop;\n","var toString = require('./toString');\n\n/** Used to generate unique IDs. */\nvar idCounter = 0;\n\n/**\n * Generates a unique ID. If `prefix` is given, the ID is appended to it.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {string} [prefix=''] The value to prefix the ID with.\n * @returns {string} Returns the unique ID.\n * @example\n *\n * _.uniqueId('contact_');\n * // => 'contact_104'\n *\n * _.uniqueId();\n * // => '105'\n */\nfunction uniqueId(prefix) {\n var id = ++idCounter;\n return toString(prefix) + id;\n}\n\nmodule.exports = uniqueId;\n","var baseGetTag = require('./_baseGetTag'),\n isObject = require('./isObject');\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nmodule.exports = isFunction;\n","var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n","var coreJsData = require('./_coreJsData');\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nmodule.exports = isMasked;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nmodule.exports = toSource;\n","var isFunction = require('./isFunction'),\n isMasked = require('./_isMasked'),\n isObject = require('./isObject'),\n toSource = require('./_toSource');\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nmodule.exports = baseIsNative;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nmodule.exports = getValue;\n","var baseIsNative = require('./_baseIsNative'),\n getValue = require('./_getValue');\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nmodule.exports = getNative;\n","var getNative = require('./_getNative');\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nmodule.exports = nativeCreate;\n","var nativeCreate = require('./_nativeCreate');\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nmodule.exports = hashClear;\n","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = hashDelete;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nmodule.exports = hashGet;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nmodule.exports = hashHas;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nmodule.exports = hashSet;\n","var hashClear = require('./_hashClear'),\n hashDelete = require('./_hashDelete'),\n hashGet = require('./_hashGet'),\n hashHas = require('./_hashHas'),\n hashSet = require('./_hashSet');\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nmodule.exports = Hash;\n","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nmodule.exports = listCacheClear;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nmodule.exports = eq;\n","var eq = require('./eq');\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nmodule.exports = assocIndexOf;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nmodule.exports = listCacheDelete;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nmodule.exports = listCacheGet;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nmodule.exports = listCacheHas;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nmodule.exports = listCacheSet;\n","var listCacheClear = require('./_listCacheClear'),\n listCacheDelete = require('./_listCacheDelete'),\n listCacheGet = require('./_listCacheGet'),\n listCacheHas = require('./_listCacheHas'),\n listCacheSet = require('./_listCacheSet');\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nmodule.exports = ListCache;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nmodule.exports = Map;\n","var Hash = require('./_Hash'),\n ListCache = require('./_ListCache'),\n Map = require('./_Map');\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nmodule.exports = mapCacheClear;\n","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nmodule.exports = isKeyable;\n","var isKeyable = require('./_isKeyable');\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nmodule.exports = getMapData;\n","var getMapData = require('./_getMapData');\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = mapCacheDelete;\n","var getMapData = require('./_getMapData');\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nmodule.exports = mapCacheGet;\n","var getMapData = require('./_getMapData');\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nmodule.exports = mapCacheHas;\n","var getMapData = require('./_getMapData');\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nmodule.exports = mapCacheSet;\n","var mapCacheClear = require('./_mapCacheClear'),\n mapCacheDelete = require('./_mapCacheDelete'),\n mapCacheGet = require('./_mapCacheGet'),\n mapCacheHas = require('./_mapCacheHas'),\n mapCacheSet = require('./_mapCacheSet');\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nmodule.exports = MapCache;\n","/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nmodule.exports = setCacheAdd;\n","/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nmodule.exports = setCacheHas;\n","var MapCache = require('./_MapCache'),\n setCacheAdd = require('./_setCacheAdd'),\n setCacheHas = require('./_setCacheHas');\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nmodule.exports = SetCache;\n","/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = baseFindIndex;\n","/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\nfunction baseIsNaN(value) {\n return value !== value;\n}\n\nmodule.exports = baseIsNaN;\n","/**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = strictIndexOf;\n","var baseFindIndex = require('./_baseFindIndex'),\n baseIsNaN = require('./_baseIsNaN'),\n strictIndexOf = require('./_strictIndexOf');\n\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n}\n\nmodule.exports = baseIndexOf;\n","var baseIndexOf = require('./_baseIndexOf');\n\n/**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n}\n\nmodule.exports = arrayIncludes;\n","/**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n}\n\nmodule.exports = arrayIncludesWith;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nmodule.exports = baseUnary;\n","/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\nmodule.exports = cacheHas;\n","var SetCache = require('./_SetCache'),\n arrayIncludes = require('./_arrayIncludes'),\n arrayIncludesWith = require('./_arrayIncludesWith'),\n arrayMap = require('./_arrayMap'),\n baseUnary = require('./_baseUnary'),\n cacheHas = require('./_cacheHas');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of methods like `_.difference` without support\n * for excluding multiple arrays or iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n */\nfunction baseDifference(array, values, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n isCommon = true,\n length = array.length,\n result = [],\n valuesLength = values.length;\n\n if (!length) {\n return result;\n }\n if (iteratee) {\n values = arrayMap(values, baseUnary(iteratee));\n }\n if (comparator) {\n includes = arrayIncludesWith;\n isCommon = false;\n }\n else if (values.length >= LARGE_ARRAY_SIZE) {\n includes = cacheHas;\n isCommon = false;\n values = new SetCache(values);\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee == null ? value : iteratee(value);\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var valuesIndex = valuesLength;\n while (valuesIndex--) {\n if (values[valuesIndex] === computed) {\n continue outer;\n }\n }\n result.push(value);\n }\n else if (!includes(values, computed, comparator)) {\n result.push(value);\n }\n }\n return result;\n}\n\nmodule.exports = baseDifference;\n","/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nmodule.exports = arrayPush;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n","var baseIsArguments = require('./_baseIsArguments'),\n isObjectLike = require('./isObjectLike');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n","var Symbol = require('./_Symbol'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray');\n\n/** Built-in value references. */\nvar spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;\n\n/**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\nfunction isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n}\n\nmodule.exports = isFlattenable;\n","var arrayPush = require('./_arrayPush'),\n isFlattenable = require('./_isFlattenable');\n\n/**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\nfunction baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n}\n\nmodule.exports = baseFlatten;\n","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = identity;\n","/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nmodule.exports = apply;\n","var apply = require('./_apply');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nmodule.exports = overRest;\n","/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nmodule.exports = constant;\n","var getNative = require('./_getNative');\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n","var constant = require('./constant'),\n defineProperty = require('./_defineProperty'),\n identity = require('./identity');\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nmodule.exports = baseSetToString;\n","/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nmodule.exports = shortOut;\n","var baseSetToString = require('./_baseSetToString'),\n shortOut = require('./_shortOut');\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nmodule.exports = setToString;\n","var identity = require('./identity'),\n overRest = require('./_overRest'),\n setToString = require('./_setToString');\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nmodule.exports = baseRest;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n","var isFunction = require('./isFunction'),\n isLength = require('./isLength');\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nmodule.exports = isArrayLike;\n","var isArrayLike = require('./isArrayLike'),\n isObjectLike = require('./isObjectLike');\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\nmodule.exports = isArrayLikeObject;\n","var baseDifference = require('./_baseDifference'),\n baseFlatten = require('./_baseFlatten'),\n baseRest = require('./_baseRest'),\n isArrayLikeObject = require('./isArrayLikeObject');\n\n/**\n * Creates an array of `array` values not included in the other given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * **Note:** Unlike `_.pullAll`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.without, _.xor\n * @example\n *\n * _.difference([2, 1], [2, 3]);\n * // => [1]\n */\nvar difference = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))\n : [];\n});\n\nmodule.exports = difference;\n","/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nmodule.exports = arrayFilter;\n","/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nmodule.exports = createBaseFor;\n","var createBaseFor = require('./_createBaseFor');\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nmodule.exports = baseFor;\n","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nmodule.exports = baseTimes;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = stubFalse;\n","var root = require('./_root'),\n stubFalse = require('./stubFalse');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nmodule.exports = isBuffer;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nmodule.exports = isIndex;\n","var baseGetTag = require('./_baseGetTag'),\n isLength = require('./isLength'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nmodule.exports = baseIsTypedArray;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nmodule.exports = nodeUtil;\n","var baseIsTypedArray = require('./_baseIsTypedArray'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nmodule.exports = isTypedArray;\n","var baseTimes = require('./_baseTimes'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isIndex = require('./_isIndex'),\n isTypedArray = require('./isTypedArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = arrayLikeKeys;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nmodule.exports = isPrototype;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n","var overArg = require('./_overArg');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nmodule.exports = nativeKeys;\n","var isPrototype = require('./_isPrototype'),\n nativeKeys = require('./_nativeKeys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeys;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeys = require('./_baseKeys'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = keys;\n","var baseFor = require('./_baseFor'),\n keys = require('./keys');\n\n/**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n}\n\nmodule.exports = baseForOwn;\n","var isArrayLike = require('./isArrayLike');\n\n/**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n}\n\nmodule.exports = createBaseEach;\n","var baseForOwn = require('./_baseForOwn'),\n createBaseEach = require('./_createBaseEach');\n\n/**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\nvar baseEach = createBaseEach(baseForOwn);\n\nmodule.exports = baseEach;\n","var baseEach = require('./_baseEach');\n\n/**\n * The base implementation of `_.filter` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction baseFilter(collection, predicate) {\n var result = [];\n baseEach(collection, function(value, index, collection) {\n if (predicate(value, index, collection)) {\n result.push(value);\n }\n });\n return result;\n}\n\nmodule.exports = baseFilter;\n","var ListCache = require('./_ListCache');\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nmodule.exports = stackClear;\n","/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nmodule.exports = stackDelete;\n","/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nmodule.exports = stackGet;\n","/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nmodule.exports = stackHas;\n","var ListCache = require('./_ListCache'),\n Map = require('./_Map'),\n MapCache = require('./_MapCache');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nmodule.exports = stackSet;\n","var ListCache = require('./_ListCache'),\n stackClear = require('./_stackClear'),\n stackDelete = require('./_stackDelete'),\n stackGet = require('./_stackGet'),\n stackHas = require('./_stackHas'),\n stackSet = require('./_stackSet');\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nmodule.exports = Stack;\n","/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nmodule.exports = arraySome;\n","var SetCache = require('./_SetCache'),\n arraySome = require('./_arraySome'),\n cacheHas = require('./_cacheHas');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalArrays;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nmodule.exports = Uint8Array;\n","/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nmodule.exports = mapToArray;\n","/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nmodule.exports = setToArray;\n","var Symbol = require('./_Symbol'),\n Uint8Array = require('./_Uint8Array'),\n eq = require('./eq'),\n equalArrays = require('./_equalArrays'),\n mapToArray = require('./_mapToArray'),\n setToArray = require('./_setToArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\nmodule.exports = equalByTag;\n","var arrayPush = require('./_arrayPush'),\n isArray = require('./isArray');\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nmodule.exports = baseGetAllKeys;\n","/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nmodule.exports = stubArray;\n","var arrayFilter = require('./_arrayFilter'),\n stubArray = require('./stubArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nmodule.exports = getSymbols;\n","var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbols = require('./_getSymbols'),\n keys = require('./keys');\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nmodule.exports = getAllKeys;\n","var getAllKeys = require('./_getAllKeys');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalObjects;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nmodule.exports = DataView;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nmodule.exports = Promise;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nmodule.exports = Set;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nmodule.exports = WeakMap;\n","var DataView = require('./_DataView'),\n Map = require('./_Map'),\n Promise = require('./_Promise'),\n Set = require('./_Set'),\n WeakMap = require('./_WeakMap'),\n baseGetTag = require('./_baseGetTag'),\n toSource = require('./_toSource');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nmodule.exports = getTag;\n","var Stack = require('./_Stack'),\n equalArrays = require('./_equalArrays'),\n equalByTag = require('./_equalByTag'),\n equalObjects = require('./_equalObjects'),\n getTag = require('./_getTag'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isTypedArray = require('./isTypedArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nmodule.exports = baseIsEqualDeep;\n","var baseIsEqualDeep = require('./_baseIsEqualDeep'),\n isObjectLike = require('./isObjectLike');\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nmodule.exports = baseIsEqual;\n","var Stack = require('./_Stack'),\n baseIsEqual = require('./_baseIsEqual');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\nfunction baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n}\n\nmodule.exports = baseIsMatch;\n","var isObject = require('./isObject');\n\n/**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\nfunction isStrictComparable(value) {\n return value === value && !isObject(value);\n}\n\nmodule.exports = isStrictComparable;\n","var isStrictComparable = require('./_isStrictComparable'),\n keys = require('./keys');\n\n/**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\nfunction getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n}\n\nmodule.exports = getMatchData;\n","/**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n}\n\nmodule.exports = matchesStrictComparable;\n","var baseIsMatch = require('./_baseIsMatch'),\n getMatchData = require('./_getMatchData'),\n matchesStrictComparable = require('./_matchesStrictComparable');\n\n/**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n}\n\nmodule.exports = baseMatches;\n","var isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/;\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n}\n\nmodule.exports = isKey;\n","var MapCache = require('./_MapCache');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Expose `MapCache`.\nmemoize.Cache = MapCache;\n\nmodule.exports = memoize;\n","var memoize = require('./memoize');\n\n/** Used as the maximum memoize cache size. */\nvar MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nfunction memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n}\n\nmodule.exports = memoizeCapped;\n","var memoizeCapped = require('./_memoizeCapped');\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\nmodule.exports = stringToPath;\n","var isArray = require('./isArray'),\n isKey = require('./_isKey'),\n stringToPath = require('./_stringToPath'),\n toString = require('./toString');\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n}\n\nmodule.exports = castPath;\n","var isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = toKey;\n","var castPath = require('./_castPath'),\n toKey = require('./_toKey');\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n}\n\nmodule.exports = baseGet;\n","var baseGet = require('./_baseGet');\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n}\n\nmodule.exports = get;\n","/**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHasIn(object, key) {\n return object != null && key in Object(object);\n}\n\nmodule.exports = baseHasIn;\n","var castPath = require('./_castPath'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isIndex = require('./_isIndex'),\n isLength = require('./isLength'),\n toKey = require('./_toKey');\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n}\n\nmodule.exports = hasPath;\n","var baseHasIn = require('./_baseHasIn'),\n hasPath = require('./_hasPath');\n\n/**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\nfunction hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n}\n\nmodule.exports = hasIn;\n","var baseIsEqual = require('./_baseIsEqual'),\n get = require('./get'),\n hasIn = require('./hasIn'),\n isKey = require('./_isKey'),\n isStrictComparable = require('./_isStrictComparable'),\n matchesStrictComparable = require('./_matchesStrictComparable'),\n toKey = require('./_toKey');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n}\n\nmodule.exports = baseMatchesProperty;\n","/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\nmodule.exports = baseProperty;\n","var baseGet = require('./_baseGet');\n\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n}\n\nmodule.exports = basePropertyDeep;\n","var baseProperty = require('./_baseProperty'),\n basePropertyDeep = require('./_basePropertyDeep'),\n isKey = require('./_isKey'),\n toKey = require('./_toKey');\n\n/**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': 2 } },\n * { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\nfunction property(path) {\n return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n}\n\nmodule.exports = property;\n","var baseMatches = require('./_baseMatches'),\n baseMatchesProperty = require('./_baseMatchesProperty'),\n identity = require('./identity'),\n isArray = require('./isArray'),\n property = require('./property');\n\n/**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\nfunction baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n}\n\nmodule.exports = baseIteratee;\n","var arrayFilter = require('./_arrayFilter'),\n baseFilter = require('./_baseFilter'),\n baseIteratee = require('./_baseIteratee'),\n isArray = require('./isArray');\n\n/**\n * Iterates over elements of `collection`, returning an array of all elements\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * **Note:** Unlike `_.remove`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.reject\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * _.filter(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, { 'age': 36, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.filter(users, 'active');\n * // => objects for ['barney']\n *\n * // Combining several predicates using `_.overEvery` or `_.overSome`.\n * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));\n * // => objects for ['fred', 'barney']\n */\nfunction filter(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, baseIteratee(predicate, 3));\n}\n\nmodule.exports = filter;\n","/**\n * The base implementation of methods like `_.findKey` and `_.findLastKey`,\n * without support for iteratee shorthands, which iterates over `collection`\n * using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the found element or its key, else `undefined`.\n */\nfunction baseFindKey(collection, predicate, eachFunc) {\n var result;\n eachFunc(collection, function(value, key, collection) {\n if (predicate(value, key, collection)) {\n result = key;\n return false;\n }\n });\n return result;\n}\n\nmodule.exports = baseFindKey;\n","var baseFindKey = require('./_baseFindKey'),\n baseForOwn = require('./_baseForOwn'),\n baseIteratee = require('./_baseIteratee');\n\n/**\n * This method is like `_.find` except that it returns the key of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findKey(users, function(o) { return o.age < 40; });\n * // => 'barney' (iteration order is not guaranteed)\n *\n * // The `_.matches` iteratee shorthand.\n * _.findKey(users, { 'age': 1, 'active': true });\n * // => 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findKey(users, 'active');\n * // => 'barney'\n */\nfunction findKey(object, predicate) {\n return baseFindKey(object, baseIteratee(predicate, 3), baseForOwn);\n}\n\nmodule.exports = findKey;\n","/**\n * Gets the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias first\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the first element of `array`.\n * @example\n *\n * _.head([1, 2, 3]);\n * // => 1\n *\n * _.head([]);\n * // => undefined\n */\nfunction head(array) {\n return (array && array.length) ? array[0] : undefined;\n}\n\nmodule.exports = head;\n","module.exports = require('./head');\n","/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nmodule.exports = arrayEach;\n","var identity = require('./identity');\n\n/**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Function} Returns cast function.\n */\nfunction castFunction(value) {\n return typeof value == 'function' ? value : identity;\n}\n\nmodule.exports = castFunction;\n","var arrayEach = require('./_arrayEach'),\n baseEach = require('./_baseEach'),\n castFunction = require('./_castFunction'),\n isArray = require('./isArray');\n\n/**\n * Iterates over elements of `collection` and invokes `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\"\n * property are iterated like arrays. To avoid this behavior use `_.forIn`\n * or `_.forOwn` for object iteration.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEachRight\n * @example\n *\n * _.forEach([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `1` then `2`.\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\nfunction forEach(collection, iteratee) {\n var func = isArray(collection) ? arrayEach : baseEach;\n return func(collection, castFunction(iteratee));\n}\n\nmodule.exports = forEach;\n","var baseForOwn = require('./_baseForOwn'),\n castFunction = require('./_castFunction');\n\n/**\n * Iterates over own enumerable string keyed properties of an object and\n * invokes `iteratee` for each property. The iteratee is invoked with three\n * arguments: (value, key, object). Iteratee functions may exit iteration\n * early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwnRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\nfunction forOwn(object, iteratee) {\n return object && baseForOwn(object, castFunction(iteratee));\n}\n\nmodule.exports = forOwn;\n","var baseEach = require('./_baseEach'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n}\n\nmodule.exports = baseMap;\n","/**\n * The base implementation of `_.sortBy` which uses `comparer` to define the\n * sort order of `array` and replaces criteria objects with their corresponding\n * values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\nfunction baseSortBy(array, comparer) {\n var length = array.length;\n\n array.sort(comparer);\n while (length--) {\n array[length] = array[length].value;\n }\n return array;\n}\n\nmodule.exports = baseSortBy;\n","var isSymbol = require('./isSymbol');\n\n/**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\nfunction compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined,\n valIsNull = value === null,\n valIsReflexive = value === value,\n valIsSymbol = isSymbol(value);\n\n var othIsDefined = other !== undefined,\n othIsNull = other === null,\n othIsReflexive = other === other,\n othIsSymbol = isSymbol(other);\n\n if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||\n (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||\n (valIsNull && othIsDefined && othIsReflexive) ||\n (!valIsDefined && othIsReflexive) ||\n !valIsReflexive) {\n return 1;\n }\n if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||\n (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||\n (othIsNull && valIsDefined && valIsReflexive) ||\n (!othIsDefined && valIsReflexive) ||\n !othIsReflexive) {\n return -1;\n }\n }\n return 0;\n}\n\nmodule.exports = compareAscending;\n","var compareAscending = require('./_compareAscending');\n\n/**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\nfunction compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = compareAscending(objCriteria[index], othCriteria[index]);\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n var order = orders[index];\n return result * (order == 'desc' ? -1 : 1);\n }\n }\n // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n return object.index - other.index;\n}\n\nmodule.exports = compareMultiple;\n","var arrayMap = require('./_arrayMap'),\n baseGet = require('./_baseGet'),\n baseIteratee = require('./_baseIteratee'),\n baseMap = require('./_baseMap'),\n baseSortBy = require('./_baseSortBy'),\n baseUnary = require('./_baseUnary'),\n compareMultiple = require('./_compareMultiple'),\n identity = require('./identity'),\n isArray = require('./isArray');\n\n/**\n * The base implementation of `_.orderBy` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {string[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\nfunction baseOrderBy(collection, iteratees, orders) {\n if (iteratees.length) {\n iteratees = arrayMap(iteratees, function(iteratee) {\n if (isArray(iteratee)) {\n return function(value) {\n return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);\n }\n }\n return iteratee;\n });\n } else {\n iteratees = [identity];\n }\n\n var index = -1;\n iteratees = arrayMap(iteratees, baseUnary(baseIteratee));\n\n var result = baseMap(collection, function(value, key, collection) {\n var criteria = arrayMap(iteratees, function(iteratee) {\n return iteratee(value);\n });\n return { 'criteria': criteria, 'index': ++index, 'value': value };\n });\n\n return baseSortBy(result, function(object, other) {\n return compareMultiple(object, other, orders);\n });\n}\n\nmodule.exports = baseOrderBy;\n","var eq = require('./eq'),\n isArrayLike = require('./isArrayLike'),\n isIndex = require('./_isIndex'),\n isObject = require('./isObject');\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nmodule.exports = isIterateeCall;\n","var baseFlatten = require('./_baseFlatten'),\n baseOrderBy = require('./_baseOrderBy'),\n baseRest = require('./_baseRest'),\n isIterateeCall = require('./_isIterateeCall');\n\n/**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection thru each iteratee. This method\n * performs a stable sort, that is, it preserves the original sort order of\n * equal elements. The iteratees are invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 30 },\n * { 'user': 'barney', 'age': 34 }\n * ];\n *\n * _.sortBy(users, [function(o) { return o.user; }]);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]\n *\n * _.sortBy(users, ['user', 'age']);\n * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]\n */\nvar sortBy = baseRest(function(collection, iteratees) {\n if (collection == null) {\n return [];\n }\n var length = iteratees.length;\n if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {\n iteratees = [];\n } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {\n iteratees = [iteratees[0]];\n }\n return baseOrderBy(collection, baseFlatten(iteratees, 1), []);\n});\n\nmodule.exports = sortBy;\n","enum WritingDirection {\n LTR,\n RTL\n}\n\nexport default WritingDirection\n","import WritingDirection from \"./WritingDirection\"\n\n// We'll make VisualDebugger no-op for any environments lacking a DOM (e.g. SSR and React Native non-web platforms).\nconst hasDOM = typeof window !== \"undefined\" && window.document\n\nconst MIN_PIXEL_RATIO = 2\n\ninterface NodeLayout {\n left: number;\n top: number;\n readonly right: number;\n readonly bottom: number;\n width: number;\n height: number;\n}\n\nclass VisualDebugger {\n private debugCtx: CanvasRenderingContext2D | null\n\n private layoutsCtx: CanvasRenderingContext2D | null\n\n private writingDirection: WritingDirection\n\n private useViewportCoordinates: boolean\n\n constructor(\n writingDirection: WritingDirection,\n useViewportCoordinates = false\n ) {\n this.debugCtx = null\n this.layoutsCtx = null\n this.writingDirection = writingDirection\n this.useViewportCoordinates = useViewportCoordinates\n\n if (!hasDOM) {\n return\n }\n\n this.debugCtx = VisualDebugger.createCanvas(\n \"sn-debug\",\n \"1010\",\n writingDirection\n )\n this.layoutsCtx = VisualDebugger.createCanvas(\n \"sn-layouts\",\n \"1000\",\n writingDirection\n )\n }\n\n static getViewportSize() {\n return {\n width: window.innerWidth,\n height: window.innerHeight\n }\n }\n\n static getPixelRatio() {\n const devicePixelRatio = window.devicePixelRatio || 1\n return Math.max(devicePixelRatio, MIN_PIXEL_RATIO)\n }\n\n static configureCanvas(\n canvas: HTMLCanvasElement,\n ctx: CanvasRenderingContext2D\n ) {\n const { width, height } = VisualDebugger.getViewportSize()\n const pixelRatio = VisualDebugger.getPixelRatio()\n\n canvas.style.width = `${width}px`\n canvas.style.height = `${height}px`\n\n const scaledWidth = Math.round(width * pixelRatio)\n const scaledHeight = Math.round(height * pixelRatio)\n\n if (canvas.width !== scaledWidth) {\n canvas.width = scaledWidth\n }\n\n if (canvas.height !== scaledHeight) {\n canvas.height = scaledHeight\n }\n\n ctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0)\n }\n\n syncCanvasSizes() {\n if (!hasDOM || !this.debugCtx || !this.layoutsCtx) {\n return\n }\n\n VisualDebugger.configureCanvas(this.debugCtx.canvas, this.debugCtx)\n VisualDebugger.configureCanvas(this.layoutsCtx.canvas, this.layoutsCtx)\n }\n\n getViewportOffset() {\n if (this.useViewportCoordinates) {\n return { x: 0, y: 0 }\n }\n\n return {\n x: window.scrollX,\n y: window.scrollY\n }\n }\n\n static createCanvas(\n id: string,\n zIndex: string,\n writingDirection: WritingDirection\n ) {\n const existingCanvas = document.querySelector<HTMLCanvasElement>(`#${id}`)\n const canvas: HTMLCanvasElement = existingCanvas || document.createElement(\"canvas\")\n\n canvas.setAttribute(\"id\", id)\n canvas.setAttribute(\n \"dir\",\n writingDirection === WritingDirection.LTR ? \"ltr\" : \"rtl\"\n )\n\n const ctx = canvas.getContext(\"2d\")\n if (!ctx) {\n return null\n }\n\n canvas.style.zIndex = zIndex\n canvas.style.position = \"fixed\"\n canvas.style.top = \"0\"\n canvas.style.left = \"0\"\n canvas.style.pointerEvents = \"none\"\n\n if (!canvas.isConnected) {\n document.body.appendChild(canvas)\n }\n\n VisualDebugger.configureCanvas(canvas, ctx)\n\n return ctx\n }\n\n clear() {\n if (!hasDOM || !this.debugCtx) {\n return\n }\n\n this.syncCanvasSizes()\n const { width, height } = VisualDebugger.getViewportSize()\n this.debugCtx.clearRect(0, 0, width, height)\n }\n\n clearLayouts() {\n if (!hasDOM || !this.layoutsCtx) {\n return\n }\n\n this.syncCanvasSizes()\n const { width, height } = VisualDebugger.getViewportSize()\n this.layoutsCtx.clearRect(0, 0, width, height)\n }\n\n drawLayout(layout: NodeLayout, focusKey: string, parentFocusKey?: string) {\n if (!hasDOM || !this.layoutsCtx) {\n return\n }\n\n this.syncCanvasSizes()\n const offset = this.getViewportOffset()\n const left = layout.left - offset.x\n const top = layout.top - offset.y\n\n this.layoutsCtx.strokeStyle = \"green\"\n this.layoutsCtx.strokeRect(left, top, layout.width, layout.height)\n this.layoutsCtx.font = \"11px monospace\"\n this.layoutsCtx.fillStyle = \"red\"\n\n const horizontalStartDirection =\n this.writingDirection === WritingDirection.LTR ? \"left\" : \"right\"\n const horizontalStartCoordinate =\n layout[horizontalStartDirection] - offset.x\n\n this.layoutsCtx.fillText(\n focusKey,\n horizontalStartCoordinate,\n top + 12\n )\n this.layoutsCtx.fillText(\n parentFocusKey ?? \"\",\n horizontalStartCoordinate,\n top + 28\n )\n this.layoutsCtx.fillText(\n `${horizontalStartDirection}: ${horizontalStartCoordinate}`,\n horizontalStartCoordinate,\n top + 44\n )\n this.layoutsCtx.fillText(\n `top: ${top}`,\n horizontalStartCoordinate,\n top + 60\n )\n }\n\n drawPoint(x: number, y: number, color = \"blue\", size = 10) {\n if (!hasDOM || !this.debugCtx) {\n return\n }\n\n this.syncCanvasSizes()\n const offset = this.getViewportOffset()\n const pointX = x - offset.x\n const pointY = y - offset.y\n\n this.debugCtx.strokeStyle = color\n this.debugCtx.lineWidth = 3\n this.debugCtx.strokeRect(\n pointX - size / 2,\n pointY - size / 2,\n size,\n size\n )\n }\n}\n\nexport default VisualDebugger\n","const ELEMENT_NODE = 1\n\nconst getRect = (node: HTMLElement) => {\n let offsetParent = node.offsetParent as HTMLElement\n const height = node.offsetHeight\n const width = node.offsetWidth\n let left = node.offsetLeft\n let top = node.offsetTop\n\n while (offsetParent && offsetParent.nodeType === ELEMENT_NODE) {\n left += offsetParent.offsetLeft - offsetParent.scrollLeft\n top += offsetParent.offsetTop - offsetParent.scrollTop\n offsetParent = offsetParent.offsetParent as HTMLElement\n }\n\n return {\n height,\n left,\n top,\n width\n }\n}\n\nconst measureLayout = (node: HTMLElement | null) => {\n const relativeNode = node && node.parentElement\n\n if (node && relativeNode) {\n const relativeRect = getRect(relativeNode)\n const { height, left, top, width } = getRect(node)\n const x = left - relativeRect.left\n const y = top - relativeRect.top\n\n return {\n x,\n y,\n width,\n height,\n left,\n top,\n get right() {\n return this.left + this.width\n },\n get bottom() {\n return this.top + this.height\n }\n }\n }\n\n return {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n left: 0,\n top: 0,\n right: 0,\n bottom: 0\n }\n}\n\nexport default measureLayout\n\nexport const getBoundingClientRect = (node: HTMLElement | null) => {\n if (node && node.getBoundingClientRect) {\n const rect = node.getBoundingClientRect()\n\n return {\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height,\n left: rect.left,\n top: rect.top,\n get right() {\n return this.left + this.width\n },\n get bottom() {\n return this.top + this.height\n }\n }\n }\n\n return {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n left: 0,\n top: 0,\n right: 0,\n bottom: 0\n }\n}\n","import { DebouncedFunc } from \"lodash\"\nimport debounce from \"lodash/debounce\"\nimport difference from \"lodash/difference\"\nimport filter from \"lodash/filter\"\nimport findKey from \"lodash/findKey\"\nimport first from \"lodash/first\"\nimport forEach from \"lodash/forEach\"\nimport forOwn from \"lodash/forOwn\"\nimport sortBy from \"lodash/sortBy\"\nimport throttle from \"lodash/throttle\"\n\nimport VisualDebugger from \"./VisualDebugger\"\nimport WritingDirection from \"./WritingDirection\"\nimport measureLayout, { getBoundingClientRect } from \"./measureLayout\"\n\n\nconst DIRECTION_LEFT = \"left\"\nconst DIRECTION_RIGHT = \"right\"\nconst DIRECTION_UP = \"up\"\nconst DIRECTION_DOWN = \"down\"\nconst KEY_ENTER = \"enter\"\n\nexport type Direction = \"up\" | \"down\" | \"left\" | \"right\";\n\ntype DistanceCalculationMethod = \"center\" | \"edges\" | \"corners\";\n\ntype DistanceCalculationFunction = (\n refCorners: Corners,\n siblingCorners: Corners,\n isVerticalDirection: boolean,\n distanceCalculationMethod: DistanceCalculationMethod\n) => number;\n\nconst DEFAULT_KEY_MAP = {\n [DIRECTION_LEFT]: [37, \"ArrowLeft\"],\n [DIRECTION_UP]: [38, \"ArrowUp\"],\n [DIRECTION_RIGHT]: [39, \"ArrowRight\"],\n [DIRECTION_DOWN]: [40, \"ArrowDown\"],\n [KEY_ENTER]: [13, \"Enter\"]\n}\n\nexport const ROOT_FOCUS_KEY = \"SN:ROOT\"\n\nconst FOCUSABLE_SELECTOR = [\n \"a[href]\",\n \"button\",\n \"input\",\n \"select\",\n \"textarea\",\n \"summary\",\n \"iframe\",\n \"[contenteditable]\",\n \"[tabindex]\"\n].join(\",\")\n\nconst FORM_FIELD_SELECTOR = [\n \"input\",\n \"select\",\n \"textarea\",\n \"[contenteditable]\"\n].join(\",\")\nconst CHECKBOX_LIKE_SELECTOR = \"input[type=\\\"checkbox\\\"], input[type=\\\"radio\\\"]\"\n\nconst ADJACENT_SLICE_THRESHOLD = 0.2\n\n/**\n * Adjacent slice is 5 times more important than diagonal\n */\nconst ADJACENT_SLICE_WEIGHT = 5\nconst DIAGONAL_SLICE_WEIGHT = 1\n\n/**\n * Main coordinate distance is 5 times more important\n */\nconst MAIN_COORDINATE_WEIGHT = 5\nconst CUT_OFF_COORDINATE_TOLERANCE_PX = 1\nconst PRIMARY_AXIS_PROXIMITY_TOLERANCE_PX = 24\n\nconst AUTO_RESTORE_FOCUS_DELAY = 300\n\nconst DEBUG_FN_COLORS = [\"#0FF\", \"#FF0\", \"#F0F\"]\n\nconst THROTTLE_OPTIONS = {\n leading: true,\n trailing: false\n}\n\nexport interface FocusableComponentLayout {\n left: number;\n top: number;\n readonly right: number;\n readonly bottom: number;\n width: number;\n height: number;\n x: number;\n y: number;\n node: HTMLElement | null;\n}\n\ninterface FocusableComponentConfig {\n focusKey: string;\n node: HTMLElement | null;\n parentFocusKey: string | undefined;\n onEnterPress: (details?: KeyPressDetails) => void;\n onEnterRelease: () => void;\n onArrowPress: (direction: string, details: KeyPressDetails) => boolean;\n onArrowRelease: (direction: string) => void;\n onFocus: (layout: FocusableComponentLayout, details: FocusDetails) => void;\n onBlur: (layout: FocusableComponentLayout, details: FocusDetails) => void;\n onUpdateFocus: (focused: boolean) => void;\n onUpdateHasFocusedChild: (hasFocusedChild: boolean) => void;\n saveLastFocusedChild: boolean;\n trackChildren: boolean;\n preferredChildFocusKey?: string;\n focusable: boolean;\n isFocusBoundary: boolean;\n focusBoundaryDirections?: Direction[];\n autoRestoreFocus: boolean;\n forceFocus: boolean;\n}\n\ninterface FocusableComponent extends FocusableComponentConfig {\n lastFocusedChildKey: string | null;\n layout: FocusableComponentLayout;\n layoutUpdated: boolean;\n}\n\ninterface FocusableComponentUpdatePayload {\n node: HTMLElement | null;\n parentFocusKey: string | undefined;\n preferredChildFocusKey?: string;\n saveLastFocusedChild: boolean;\n trackChildren: boolean;\n focusable: boolean;\n isFocusBoundary: boolean;\n focusBoundaryDirections?: Direction[];\n autoRestoreFocus: boolean;\n forceFocus: boolean;\n onEnterPress: (details?: KeyPressDetails) => void;\n onEnterRelease: () => void;\n onArrowPress: (direction: string, details: KeyPressDetails) => boolean;\n onArrowRelease: (direction: string) => void;\n onFocus: (layout: FocusableComponentLayout, details: FocusDetails) => void;\n onBlur: (layout: FocusableComponentLayout, details: FocusDetails) => void;\n}\n\ninterface FocusableComponentRemovePayload {\n focusKey: string;\n skipFocusRestoration?: boolean;\n}\n\ninterface CornerCoordinates {\n x: number;\n y: number;\n}\n\ninterface Corners {\n a: CornerCoordinates;\n b: CornerCoordinates;\n}\n\nexport type PressedKeys = { [index: string]: number };\n\n/**\n * Extra details about pressed keys passed on the key events\n */\nexport interface KeyPressDetails {\n pressedKeys: PressedKeys;\n}\n\n/**\n * Extra details passed from outside to be bounced back on other callbacks\n */\nexport interface FocusDetails {\n event?: Event;\n nativeEvent?: Event;\n [key: string]: unknown;\n}\n\nexport type BackwardsCompatibleKeyMap = {\n [index: string]: string | number | (number | string)[];\n};\n\nexport type KeyMap = { [index: string]: (string | number)[] };\n\nexport interface InitOptions {\n debug?: boolean;\n visualDebug?: boolean;\n nativeMode?: boolean;\n throttle?: number;\n throttleKeypresses?: boolean;\n useGetBoundingClientRect?: boolean;\n shouldFocusDOMNode?: boolean;\n /**\n * Preferred alias for shouldFocusDOMNode. Enabled by default for browser-native focus support.\n */\n nativeFocus?: boolean;\n domNodeFocusOptions?: FocusOptions;\n shouldUseNativeEvents?: boolean;\n rtl?: boolean;\n distanceCalculationMethod?: DistanceCalculationMethod;\n customDistanceCalculationFunction?: DistanceCalculationFunction;\n /**\n * Keep focus state in sync when browser focus changes through Tab/click/programmatic focus.\n */\n trackNativeFocus?: boolean;\n /**\n * When enabled, keyboard navigation is not intercepted while a form control owns focus.\n */\n blockNavigationOutOfFormFields?: boolean;\n}\n\nconst getChildClosestToOrigin = (\n children: FocusableComponent[],\n writingDirection: WritingDirection\n) => {\n const comparator =\n writingDirection === WritingDirection.LTR\n ? ({ layout }: FocusableComponent) =>\n Math.abs(layout.left) + Math.abs(layout.top)\n : ({ layout }: FocusableComponent) =>\n Math.abs(window.innerWidth - layout.right) + Math.abs(layout.top)\n\n const childrenClosestToOrigin = sortBy(children, comparator)\n\n return first(childrenClosestToOrigin)\n}\n\n/**\n * Takes either a BackwardsCompatibleKeyMap and transforms it into a the new KeyMap format\n * to ensure backwards compatibility.\n */\nconst normalizeKeyMap = (keyMap: BackwardsCompatibleKeyMap) => {\n const newKeyMap: KeyMap = {}\n\n Object.entries(keyMap).forEach(([key, value]) => {\n newKeyMap[key] = Array.isArray(value) ? value : [value]\n })\n\n return newKeyMap\n}\n\nconst isFocusableByDefault = (node: HTMLElement) => {\n if (!node?.matches) {\n return false\n }\n\n return node.matches(FOCUSABLE_SELECTOR)\n}\n\nconst isFormFieldElement = (target: EventTarget | null) => {\n const element = target as HTMLElement | null\n\n if (!element?.matches) {\n return false\n }\n\n return element.matches(FORM_FIELD_SELECTOR)\n}\n\nclass SpatialNavigationService {\n private focusableComponents: { [index: string]: FocusableComponent }\n\n private visualDebugger: VisualDebugger | null\n\n private visualDebugAnimationFrame: number | null\n\n private visualDebugEnabled: boolean\n\n /**\n * Focus key of the currently focused element\n */\n private focusKey: string | null\n\n private shouldFocusDOMNode: boolean\n\n private shouldUseNativeEvents: boolean\n\n private trackNativeFocus: boolean\n\n private blockNavigationOutOfFormFields: boolean\n\n /**\n * This collection contains focus keys of the elements that are having a child focused\n * Might be handy for styling of certain parent components if their child is focused.\n */\n private parentsHavingFocusedChild: string[]\n\n /**\n * When shouldFocusDOMNode is true, this prop specifies the focus options that should be passed to the element being focused.\n */\n private domNodeFocusOptions: FocusOptions\n\n private enabled: boolean\n\n /**\n * Used in the React Native environment\n * In this mode, the library works as a \"read-only\" helper to sync focused\n * states for the components when they are focused by the native focus engine\n */\n private nativeMode: boolean\n\n /**\n * Throttling delay for key presses in milliseconds\n */\n private throttle: number\n\n /**\n * Enables/disables throttling feature\n */\n private throttleKeypresses: boolean\n\n /**\n * Storing pressed keys counter by the eventType\n */\n private pressedKeys: PressedKeys\n\n /**\n * Flag used to block key events from this service\n */\n private paused: boolean\n\n /**\n * Enables/disables getBoundingClientRect\n */\n private useGetBoundingClientRect: boolean\n\n private keyDownEventListener: ((event: KeyboardEvent) => void) | null\n\n private keyDownEventListenerThrottled: DebouncedFunc<\n (event: KeyboardEvent) => void\n > | null\n\n private keyUpEventListener: ((event: KeyboardEvent) => void) | null\n\n private focusInEventListener: ((event: FocusEvent) => void) | null\n\n private keyMap: KeyMap\n\n private debug: boolean\n\n private logIndex: number\n\n private setFocusDebounced: DebouncedFunc<\n (focusKey: string, focusDetails?: FocusDetails) => void\n >\n\n private writingDirection: WritingDirection\n\n private distanceCalculationMethod: DistanceCalculationMethod\n\n private customDistanceCalculationFunction?: DistanceCalculationFunction\n\n /**\n * Used to determine the coordinate that will be used to filter items that are over the \"edge\"\n */\n static getCutoffCoordinate(\n isVertical: boolean,\n isIncremental: boolean,\n isSibling: boolean,\n layout: FocusableComponentLayout,\n writingDirection: WritingDirection\n ) {\n const itemStart = isVertical\n ? layout.top\n : writingDirection === WritingDirection.LTR\n ? layout.left\n : layout.right\n\n const itemEnd = isVertical\n ? layout.bottom\n : writingDirection === WritingDirection.LTR\n ? layout.right\n : layout.left\n\n return isIncremental\n ? isSibling\n ? itemStart\n : itemEnd\n : isSibling\n ? itemEnd\n : itemStart\n }\n\n /**\n * Returns two corners (a and b) coordinates that are used as a reference points\n * Where \"a\" is always leftmost and topmost corner, and \"b\" is rightmost bottommost corner\n */\n static getRefCorners(\n direction: string,\n isSibling: boolean,\n layout: FocusableComponentLayout\n ) {\n const result = {\n a: {\n x: 0,\n y: 0\n },\n b: {\n x: 0,\n y: 0\n }\n }\n\n switch (direction) {\n case DIRECTION_UP: {\n const y = isSibling ? layout.bottom : layout.top\n\n result.a = {\n x: layout.left,\n y\n }\n\n result.b = {\n x: layout.right,\n y\n }\n\n break\n }\n\n case DIRECTION_DOWN: {\n const y = isSibling ? layout.top : layout.bottom\n\n result.a = {\n x: layout.left,\n y\n }\n\n result.b = {\n x: layout.right,\n y\n }\n\n break\n }\n\n case DIRECTION_LEFT: {\n const x = isSibling ? layout.right : layout.left\n\n result.a = {\n x,\n y: layout.top\n }\n\n result.b = {\n x,\n y: layout.bottom\n }\n\n break\n }\n\n case DIRECTION_RIGHT: {\n const x = isSibling ? layout.left : layout.right\n\n result.a = {\n x,\n y: layout.top\n }\n\n result.b = {\n x,\n y: layout.bottom\n }\n\n break\n }\n\n default:\n break\n }\n\n return result\n }\n\n /**\n * Calculates if the sibling node is intersecting enough with the ref node by the secondary coordinate\n */\n static getAdjacentSliceMetrics(\n refCorners: Corners,\n siblingCorners: Corners,\n isVerticalDirection: boolean\n ) {\n const { a: refA, b: refB } = refCorners\n const { a: siblingA, b: siblingB } = siblingCorners\n const coordinate = isVerticalDirection ? \"x\" : \"y\"\n\n const refCoordinateA = refA[coordinate]\n const refCoordinateB = refB[coordinate]\n const siblingCoordinateA = siblingA[coordinate]\n const siblingCoordinateB = siblingB[coordinate]\n\n const refLength = Math.abs(refCoordinateB - refCoordinateA)\n const siblingLength = Math.abs(siblingCoordinateB - siblingCoordinateA)\n const intersectionLength = Math.max(\n 0,\n Math.min(refCoordinateB, siblingCoordinateB) -\n Math.max(refCoordinateA, siblingCoordinateA)\n )\n\n return {\n refLength,\n siblingLength,\n intersectionLength\n }\n }\n\n static isAdjacentSlice(\n refCorners: Corners,\n siblingCorners: Corners,\n isVerticalDirection: boolean\n ) {\n const { refLength, siblingLength, intersectionLength } =\n SpatialNavigationService.getAdjacentSliceMetrics(\n refCorners,\n siblingCorners,\n isVerticalDirection\n )\n\n const thresholdDistance =\n Math.min(refLength, siblingLength) * ADJACENT_SLICE_THRESHOLD\n\n return intersectionLength >= thresholdDistance\n }\n\n static getAdjacentSliceWeight(\n refCorners: Corners,\n siblingCorners: Corners,\n isVerticalDirection: boolean\n ) {\n const { siblingLength, intersectionLength } =\n SpatialNavigationService.getAdjacentSliceMetrics(\n refCorners,\n siblingCorners,\n isVerticalDirection\n )\n\n if (!siblingLength) {\n return DIAGONAL_SLICE_WEIGHT\n }\n\n const overlapRatioOnSibling = Math.min(\n 1,\n Math.max(0, intersectionLength / siblingLength)\n )\n\n return (\n DIAGONAL_SLICE_WEIGHT +\n (ADJACENT_SLICE_WEIGHT - DIAGONAL_SLICE_WEIGHT) * overlapRatioOnSibling\n )\n }\n\n static getPrimaryAxisDistance(\n refCorners: Corners,\n siblingCorners: Corners,\n isVerticalDirection: boolean\n ) {\n const { a: refA } = refCorners\n const { a: siblingA } = siblingCorners\n const coordinate = isVerticalDirection ? \"y\" : \"x\"\n\n return Math.abs(siblingA[coordinate] - refA[coordinate])\n }\n\n static getSecondaryAxisDistance(\n refCorners: Corners,\n siblingCorners: Corners,\n isVerticalDirection: boolean,\n distanceCalculationMethod: DistanceCalculationMethod,\n customDistanceCalculationFunction?: DistanceCalculationFunction\n ) {\n if (customDistanceCalculationFunction) {\n return customDistanceCalculationFunction(\n refCorners,\n siblingCorners,\n isVerticalDirection,\n distanceCalculationMethod\n )\n }\n\n const { a: refA, b: refB } = refCorners\n const { a: siblingA, b: siblingB } = siblingCorners\n const coordinate = isVerticalDirection ? \"x\" : \"y\"\n\n const refCoordinateA = refA[coordinate]\n const refCoordinateB = refB[coordinate]\n const siblingCoordinateA = siblingA[coordinate]\n const siblingCoordinateB = siblingB[coordinate]\n\n if (distanceCalculationMethod === \"center\") {\n const refCoordinateCenter = (refCoordinateA + refCoordinateB) / 2\n const siblingCoordinateCenter =\n (siblingCoordinateA + siblingCoordinateB) / 2\n return Math.abs(refCoordinateCenter - siblingCoordinateCenter)\n }\n if (distanceCalculationMethod === \"edges\") {\n // 1. Find the minimum and maximum coordinates for both ref and sibling\n const refCoordinateEdgeMin = Math.min(refCoordinateA, refCoordinateB)\n const siblingCoordinateEdgeMin = Math.min(\n siblingCoordinateA,\n siblingCoordinateB\n )\n const refCoordinateEdgeMax = Math.max(refCoordinateA, refCoordinateB)\n const siblingCoordinateEdgeMax = Math.max(\n siblingCoordinateA,\n siblingCoordinateB\n )\n\n // 2. Calculate the distances between the closest edges\n const minEdgeDistance = Math.abs(\n refCoordinateEdgeMin - siblingCoordinateEdgeMin\n )\n const maxEdgeDistance = Math.abs(\n refCoordinateEdgeMax - siblingCoordinateEdgeMax\n )\n\n // 3. Return the smallest distance between the edges\n return Math.min(minEdgeDistance, maxEdgeDistance)\n }\n\n // Default to corners\n const distancesToCompare = [\n Math.abs(siblingCoordinateA - refCoordinateA),\n Math.abs(siblingCoordinateA - refCoordinateB),\n Math.abs(siblingCoordinateB - refCoordinateA),\n Math.abs(siblingCoordinateB - refCoordinateB)\n ]\n return Math.min(...distancesToCompare)\n }\n\n /**\n * Inspired by: https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS_for_TV/TV_remote_control_navigation#Algorithm_design\n * Ref Corners are the 2 corners of the current component in the direction of navigation\n * They are used as a base to measure adjacent slices\n */\n sortSiblingsByPriority(\n siblings: FocusableComponent[],\n currentLayout: FocusableComponentLayout,\n direction: string,\n focusKey: string\n ) {\n const isVerticalDirection =\n direction === DIRECTION_DOWN || direction === DIRECTION_UP\n\n const refCorners = SpatialNavigationService.getRefCorners(\n direction,\n false,\n currentLayout\n )\n\n return sortBy(siblings, (sibling) => {\n const siblingCorners = SpatialNavigationService.getRefCorners(\n direction,\n true,\n sibling.layout\n )\n\n const isAdjacentSlice = SpatialNavigationService.isAdjacentSlice(\n refCorners,\n siblingCorners,\n isVerticalDirection\n )\n const adjacentSliceWeight = isAdjacentSlice\n ? SpatialNavigationService.getAdjacentSliceWeight(\n refCorners,\n siblingCorners,\n isVerticalDirection\n )\n : DIAGONAL_SLICE_WEIGHT\n\n const primaryAxisFunction = isAdjacentSlice\n ? SpatialNavigationService.getPrimaryAxisDistance\n : SpatialNavigationService.getSecondaryAxisDistance\n\n const secondaryAxisFunction = isAdjacentSlice\n ? SpatialNavigationService.getSecondaryAxisDistance\n : SpatialNavigationService.getPrimaryAxisDistance\n\n const primaryAxisDistance = primaryAxisFunction(\n refCorners,\n siblingCorners,\n isVerticalDirection,\n this.distanceCalculationMethod,\n this.customDistanceCalculationFunction\n )\n const secondaryAxisDistance = secondaryAxisFunction(\n refCorners,\n siblingCorners,\n isVerticalDirection,\n this.distanceCalculationMethod,\n this.customDistanceCalculationFunction\n )\n\n /**\n * The higher this value is, the less prioritised the candidate is\n */\n const totalDistancePoints =\n primaryAxisDistance * MAIN_COORDINATE_WEIGHT + secondaryAxisDistance\n\n /**\n * + 1 here is in case of distance is zero, but we still want to apply Adjacent priority weight\n */\n const priority =\n (totalDistancePoints + 1) / adjacentSliceWeight\n\n this.log(\n \"smartNavigate\",\n `distance (primary, secondary, total weighted) for ${sibling.focusKey} relative to ${focusKey} is`,\n primaryAxisDistance,\n secondaryAxisDistance,\n totalDistancePoints\n )\n\n this.log(\n \"smartNavigate\",\n `priority for ${sibling.focusKey} relative to ${focusKey} is`,\n priority,\n `(adjacentWeight: ${adjacentSliceWeight})`\n )\n\n if (this.visualDebugger) {\n this.visualDebugger.drawPoint(\n siblingCorners.a.x,\n siblingCorners.a.y,\n \"yellow\",\n 6\n )\n this.visualDebugger.drawPoint(\n siblingCorners.b.x,\n siblingCorners.b.y,\n \"yellow\",\n 6\n )\n }\n\n return priority\n })\n }\n\n constructor() {\n /**\n * Storage for all focusable components\n */\n this.focusableComponents = {}\n\n /**\n * Storing current focused key\n */\n this.focusKey = null\n\n /**\n * This collection contains focus keys of the elements that are having a child focused\n * Might be handy for styling of certain parent components if their child is focused.\n */\n this.parentsHavingFocusedChild = []\n\n this.domNodeFocusOptions = {}\n this.enabled = false\n this.nativeMode = false\n this.throttle = 0\n this.throttleKeypresses = false\n this.useGetBoundingClientRect = false\n this.shouldFocusDOMNode = true\n this.shouldUseNativeEvents = false\n this.trackNativeFocus = true\n this.blockNavigationOutOfFormFields = false\n this.writingDirection = WritingDirection.LTR\n\n this.pressedKeys = {}\n\n /**\n * Flag used to block key events from this service\n * @type {boolean}\n */\n this.paused = false\n\n this.keyDownEventListener = null\n this.keyDownEventListenerThrottled = null\n this.keyUpEventListener = null\n this.focusInEventListener = null\n this.keyMap = DEFAULT_KEY_MAP\n\n this.pause = this.pause.bind(this)\n this.resume = this.resume.bind(this)\n this.setFocus = this.setFocus.bind(this)\n this.updateAllLayouts = this.updateAllLayouts.bind(this)\n this.navigateByDirection = this.navigateByDirection.bind(this)\n this.init = this.init.bind(this)\n this.setThrottle = this.setThrottle.bind(this)\n this.setVisualDebug = this.setVisualDebug.bind(this)\n this.destroy = this.destroy.bind(this)\n this.setKeyMap = this.setKeyMap.bind(this)\n this.getCurrentFocusKey = this.getCurrentFocusKey.bind(this)\n this.doesFocusableExist = this.doesFocusableExist.bind(this)\n this.updateRtl = this.updateRtl.bind(this)\n\n this.setFocusDebounced = debounce(this.setFocus, AUTO_RESTORE_FOCUS_DELAY, {\n leading: false,\n trailing: true\n })\n\n this.debug = false\n this.visualDebugger = null\n this.visualDebugAnimationFrame = null\n this.visualDebugEnabled = false\n\n this.logIndex = 0\n\n this.distanceCalculationMethod = \"corners\"\n }\n\n init({\n debug = false,\n visualDebug = false,\n nativeMode = false,\n throttle: throttleParam = 0,\n throttleKeypresses = false,\n useGetBoundingClientRect = false,\n shouldFocusDOMNode,\n nativeFocus = true,\n domNodeFocusOptions = {},\n shouldUseNativeEvents = false,\n trackNativeFocus = true,\n blockNavigationOutOfFormFields = false,\n rtl = false,\n distanceCalculationMethod = \"corners\" as DistanceCalculationMethod,\n customDistanceCalculationFunction\n }: InitOptions = {}) {\n if (!this.enabled) {\n const resolvedShouldFocusDOMNode =\n typeof shouldFocusDOMNode === \"boolean\"\n ? shouldFocusDOMNode\n : nativeFocus\n\n this.domNodeFocusOptions = domNodeFocusOptions\n this.enabled = true\n this.nativeMode = nativeMode\n this.throttleKeypresses = throttleKeypresses\n this.useGetBoundingClientRect = useGetBoundingClientRect\n this.shouldFocusDOMNode = resolvedShouldFocusDOMNode && !nativeMode\n this.shouldUseNativeEvents = shouldUseNativeEvents\n this.trackNativeFocus = trackNativeFocus\n this.blockNavigationOutOfFormFields = blockNavigationOutOfFormFields\n this.writingDirection = rtl ? WritingDirection.RTL : WritingDirection.LTR\n this.distanceCalculationMethod = distanceCalculationMethod\n this.customDistanceCalculationFunction =\n customDistanceCalculationFunction\n\n this.debug = debug\n\n if (!this.nativeMode) {\n if (Number.isInteger(throttleParam) && throttleParam > 0) {\n this.throttle = throttleParam\n }\n this.bindEventHandlers()\n this.setVisualDebug(visualDebug)\n }\n }\n }\n\n private startVisualDebugLoop() {\n if (\n typeof window === \"undefined\" ||\n !window.requestAnimationFrame ||\n typeof document === \"undefined\"\n ) {\n return\n }\n\n if (!this.visualDebugger) {\n this.visualDebugger = new VisualDebugger(\n this.writingDirection,\n this.useGetBoundingClientRect\n )\n }\n\n const draw = () => {\n const visualDebugger = this.visualDebugger\n if (!this.visualDebugEnabled || !visualDebugger) {\n return\n }\n\n visualDebugger.clearLayouts()\n forOwn(this.focusableComponents, (component, focusKey) => {\n visualDebugger.drawLayout(\n component.layout,\n focusKey,\n component.parentFocusKey\n )\n })\n\n this.visualDebugAnimationFrame = window.requestAnimationFrame(draw)\n }\n\n if (this.visualDebugAnimationFrame === null) {\n draw()\n }\n }\n\n private stopVisualDebugLoop() {\n if (\n this.visualDebugAnimationFrame !== null &&\n typeof window !== \"undefined\" &&\n window.cancelAnimationFrame\n ) {\n window.cancelAnimationFrame(this.visualDebugAnimationFrame)\n }\n\n this.visualDebugAnimationFrame = null\n\n if (this.visualDebugger) {\n this.visualDebugger.clear()\n this.visualDebugger.clearLayouts()\n }\n\n if (typeof document !== \"undefined\") {\n document.querySelector(\"#sn-debug\")?.remove()\n document.querySelector(\"#sn-layouts\")?.remove()\n }\n\n this.visualDebugger = null\n }\n\n setVisualDebug(visualDebug: boolean) {\n this.visualDebugEnabled = visualDebug\n\n if (!this.enabled || this.nativeMode) {\n return\n }\n\n if (visualDebug) {\n this.startVisualDebugLoop()\n } else {\n this.stopVisualDebugLoop()\n }\n }\n\n setThrottle({\n throttle: throttleParam = 0,\n throttleKeypresses = false\n } = {}) {\n this.throttleKeypresses = throttleKeypresses\n\n if (!this.nativeMode) {\n this.unbindEventHandlers()\n if (Number.isInteger(throttleParam)) {\n this.throttle = throttleParam\n }\n this.bindEventHandlers()\n }\n }\n\n destroy() {\n if (this.enabled) {\n this.setFocusDebounced.cancel()\n this.enabled = false\n this.nativeMode = false\n this.throttle = 0\n this.throttleKeypresses = false\n this.focusKey = null\n this.parentsHavingFocusedChild = []\n this.focusableComponents = {}\n this.paused = false\n this.keyMap = DEFAULT_KEY_MAP\n this.trackNativeFocus = true\n this.blockNavigationOutOfFormFields = false\n this.shouldFocusDOMNode = true\n this.shouldUseNativeEvents = false\n this.visualDebugEnabled = false\n\n this.stopVisualDebugLoop()\n\n this.unbindEventHandlers()\n }\n }\n\n getEventType(keyCode: number | string) {\n return findKey(this.getKeyMap(), (codeList) => codeList.includes(keyCode))\n }\n\n static getKeyCode(event: KeyboardEvent) {\n return event.keyCode || event.code || event.key\n }\n\n static isDirectionalEventType(eventType: string) {\n return (\n eventType === DIRECTION_LEFT ||\n eventType === DIRECTION_RIGHT ||\n eventType === DIRECTION_UP ||\n eventType === DIRECTION_DOWN\n )\n }\n\n shouldBypassSpatialNavigationForTarget(\n target: EventTarget | null,\n eventType: string\n ) {\n return (\n this.blockNavigationOutOfFormFields &&\n (eventType === KEY_ENTER ||\n SpatialNavigationService.isDirectionalEventType(eventType)) &&\n isFormFieldElement(target)\n )\n }\n\n makeNodeProgrammaticallyFocusable(component: FocusableComponent) {\n if (!component?.node || !this.shouldFocusDOMNode) {\n return\n }\n\n const { node, focusable } = component\n const hasAutoTabIndex = node.getAttribute?.(\"data-sn-auto-tabindex\")\n\n if (!focusable) {\n if (hasAutoTabIndex) {\n node.removeAttribute?.(\"tabindex\")\n node.removeAttribute?.(\"data-sn-auto-tabindex\")\n }\n\n return\n }\n\n if (isFocusableByDefault(node) || node.getAttribute?.(\"tabindex\") !== null) {\n return\n }\n\n node.setAttribute?.(\"tabindex\", \"-1\")\n node.setAttribute?.(\"data-sn-auto-tabindex\", \"true\")\n }\n\n getLayoutReferenceNode(node: HTMLElement | null) {\n if (!node) {\n return null\n }\n\n if (\n node.matches?.(CHECKBOX_LIKE_SELECTOR) &&\n node.parentElement?.tagName === \"LABEL\"\n ) {\n return node.parentElement\n }\n\n return node\n }\n\n findNativeFocusedComponent(target: EventTarget | null) {\n const targetNode = target as Node | null\n\n if (!targetNode) {\n return null\n }\n\n const matchingComponents = filter(\n this.focusableComponents,\n ({ node, focusable }) =>\n focusable &&\n !!node &&\n (node === targetNode || Boolean(node.contains?.(targetNode)))\n )\n\n if (!matchingComponents.length) {\n return null\n }\n\n const sortedByDepth = sortBy(matchingComponents, ({ node }) => {\n let depth = 0\n let currentNode: HTMLElement | null = node\n\n while (currentNode?.parentElement) {\n depth += 1\n currentNode = currentNode.parentElement\n }\n\n return depth * -1\n })\n\n return first(sortedByDepth)\n }\n\n syncNativeFocus(event: FocusEvent) {\n if (\n this.paused ||\n !this.enabled ||\n this.nativeMode ||\n !this.trackNativeFocus\n ) {\n return\n }\n\n const component = this.findNativeFocusedComponent(event.target)\n\n if (!component || component.focusKey === this.focusKey) {\n return\n }\n\n const focusDetails = {\n event,\n nativeEvent: event\n }\n\n this.setCurrentFocusedKey(component.focusKey, focusDetails)\n this.updateParentsHasFocusedChild(component.focusKey, focusDetails)\n this.updateParentsLastFocusedChild(component.focusKey)\n }\n\n bindEventHandlers() {\n // We check both because the React Native remote debugger implements window, but not window.addEventListener.\n if (typeof window !== \"undefined\" && window.addEventListener) {\n const keyDownEventListener = (event: KeyboardEvent) => {\n if (this.paused === true) {\n return\n }\n\n if (this.debug) {\n this.logIndex += 1\n }\n\n const keyCode = SpatialNavigationService.getKeyCode(event)\n const eventType = this.getEventType(keyCode)\n\n if (!eventType) {\n return\n }\n\n if (this.shouldBypassSpatialNavigationForTarget(event.target, eventType)) {\n return\n }\n\n this.pressedKeys[eventType] = this.pressedKeys[eventType]\n ? this.pressedKeys[eventType] + 1\n : 1\n\n if (!this.shouldUseNativeEvents) {\n event.preventDefault()\n event.stopPropagation()\n }\n\n const keysDetails = {\n pressedKeys: this.pressedKeys\n }\n\n if (eventType === KEY_ENTER && this.focusKey) {\n this.onEnterPress(keysDetails)\n\n return\n }\n\n const preventDefaultNavigation =\n this.onArrowPress(eventType, keysDetails) === false\n\n this.visualDebugger?.clear()\n\n if (preventDefaultNavigation) {\n this.log(\"keyDownEventListener\", \"default navigation prevented\")\n } else {\n this.smartNavigate(eventType, null, { event, nativeEvent: event })\n }\n }\n\n this.keyDownEventListener = keyDownEventListener\n\n let keyDownListener: (event: KeyboardEvent) => void = keyDownEventListener\n\n // Apply throttle only if the option we got is > 0 to avoid limiting the listener to every animation frame\n if (this.throttle) {\n const throttledListener = throttle(\n keyDownEventListener,\n this.throttle,\n THROTTLE_OPTIONS\n )\n this.keyDownEventListenerThrottled = throttledListener\n keyDownListener = throttledListener\n } else {\n this.keyDownEventListenerThrottled = null\n }\n\n // When throttling then make sure to only throttle key down and cancel any queued functions in case of key up\n const keyUpEventListener = (event: KeyboardEvent) => {\n const keyCode = SpatialNavigationService.getKeyCode(event)\n const eventType = this.getEventType(keyCode)\n\n if (!eventType) {\n return\n }\n\n delete this.pressedKeys[eventType]\n\n if (this.shouldBypassSpatialNavigationForTarget(event.target, eventType)) {\n return\n }\n\n if (this.throttle && !this.throttleKeypresses) {\n this.keyDownEventListenerThrottled?.cancel()\n }\n\n if (eventType === KEY_ENTER && this.focusKey) {\n this.onEnterRelease()\n }\n\n if (this.focusKey && (\n eventType === DIRECTION_LEFT ||\n eventType === DIRECTION_RIGHT ||\n eventType === DIRECTION_UP ||\n eventType === DIRECTION_DOWN)) {\n this.onArrowRelease(eventType)\n }\n }\n\n this.keyUpEventListener = keyUpEventListener\n\n window.addEventListener(\"keyup\", keyUpEventListener)\n window.addEventListener(\"keydown\", keyDownListener)\n }\n\n if (\n this.trackNativeFocus &&\n typeof document !== \"undefined\" &&\n document.addEventListener\n ) {\n this.focusInEventListener = (event: FocusEvent) =>\n this.syncNativeFocus(event)\n document.addEventListener(\"focusin\", this.focusInEventListener)\n }\n }\n\n unbindEventHandlers() {\n // We check both because the React Native remote debugger implements window, but not window.removeEventListener.\n if (typeof window !== \"undefined\" && window.removeEventListener) {\n if (this.keyUpEventListener) {\n window.removeEventListener(\"keyup\", this.keyUpEventListener)\n this.keyUpEventListener = null\n }\n\n const listener = this.throttle\n ? this.keyDownEventListenerThrottled\n : this.keyDownEventListener\n\n if (listener) {\n window.removeEventListener(\"keydown\", listener)\n }\n this.keyDownEventListener = null\n this.keyDownEventListenerThrottled = null\n }\n\n if (typeof document !== \"undefined\" && document.removeEventListener) {\n if (this.focusInEventListener) {\n document.removeEventListener(\"focusin\", this.focusInEventListener)\n }\n this.focusInEventListener = null\n }\n }\n\n onEnterPress(keysDetails: KeyPressDetails) {\n if (!this.focusKey) {\n return\n }\n\n const component = this.focusableComponents[this.focusKey]\n\n /* Guard against last-focused component being unmounted at time of onEnterPress (e.g due to UI fading out) */\n if (!component) {\n this.log(\"onEnterPress\", \"noComponent\")\n\n return\n }\n\n /* Suppress onEnterPress if the last-focused item happens to lose its 'focused' status. */\n if (!component.focusable) {\n this.log(\"onEnterPress\", \"componentNotFocusable\")\n\n return\n }\n\n if (component.onEnterPress) {\n component.onEnterPress(keysDetails)\n }\n }\n\n onEnterRelease() {\n if (!this.focusKey) {\n return\n }\n\n const component = this.focusableComponents[this.focusKey]\n\n /* Guard against last-focused component being unmounted at time of onEnterRelease (e.g due to UI fading out) */\n if (!component) {\n this.log(\"onEnterRelease\", \"noComponent\")\n\n return\n }\n\n /* Suppress onEnterRelease if the last-focused item happens to lose its 'focused' status. */\n if (!component.focusable) {\n this.log(\"onEnterRelease\", \"componentNotFocusable\")\n\n return\n }\n\n if (component.onEnterRelease) {\n component.onEnterRelease()\n }\n }\n\n onArrowPress(direction: string, keysDetails: KeyPressDetails) {\n if (!this.focusKey) {\n return undefined\n }\n\n const component = this.focusableComponents[this.focusKey]\n\n /* Guard against last-focused component being unmounted at time of onArrowPress (e.g due to UI fading out) */\n if (!component) {\n this.log(\"onArrowPress\", \"noComponent\")\n\n return undefined\n }\n\n /* It's okay to navigate AWAY from an item that has lost its 'focused' status, so we don't inspect\n * component.focusable. */\n\n return (\n component &&\n component.onArrowPress &&\n component.onArrowPress(direction, keysDetails)\n )\n }\n\n onArrowRelease(direction: string) {\n if (!this.focusKey) {\n return\n }\n\n const component = this.focusableComponents[this.focusKey]\n\n /* Guard against last-focused component being unmounted at time of onArrowRelease (e.g due to UI fading out) */\n if (!component) {\n this.log(\"onArrowRelease\", \"noComponent\")\n\n return\n }\n\n /* Suppress onArrowRelease if the last-focused item happens to lose its 'focused' status. */\n if (!component.focusable) {\n this.log(\"onArrowRelease\", \"componentNotFocusable\")\n\n return\n }\n\n if (component.onArrowRelease) {\n component.onArrowRelease(direction)\n }\n }\n\n /**\n * Move focus by direction, if you can't use buttons or focusing by key.\n *\n * @example\n * navigateByDirection('right') // The focus is moved to right\n */\n navigateByDirection(direction: string, focusDetails: FocusDetails) {\n if (this.paused === true || !this.enabled || this.nativeMode) {\n return\n }\n\n const validDirections = [\n DIRECTION_DOWN,\n DIRECTION_UP,\n DIRECTION_LEFT,\n DIRECTION_RIGHT\n ]\n\n if (validDirections.includes(direction)) {\n this.log(\"navigateByDirection\", \"direction\", direction)\n this.smartNavigate(direction, null, focusDetails)\n } else {\n this.log(\n \"navigateByDirection\",\n `Invalid direction. You passed: \\`${direction}\\`, but you can use only these: `,\n validDirections\n )\n }\n }\n\n /**\n * This function navigates between siblings OR goes up by the Tree\n * Based on the Direction\n */\n smartNavigate(\n direction: string,\n fromParentFocusKey: string | null,\n focusDetails: FocusDetails\n ) {\n if (this.nativeMode) {\n return\n }\n\n const isVerticalDirection =\n direction === DIRECTION_DOWN || direction === DIRECTION_UP\n const isIncrementalDirection =\n direction === DIRECTION_DOWN ||\n (this.writingDirection === WritingDirection.LTR\n ? direction === DIRECTION_RIGHT\n : direction === DIRECTION_LEFT)\n\n this.log(\"smartNavigate\", \"direction\", direction)\n this.log(\"smartNavigate\", \"fromParentFocusKey\", fromParentFocusKey)\n this.log(\"smartNavigate\", \"this.focusKey\", this.focusKey)\n\n if (!fromParentFocusKey) {\n forOwn(this.focusableComponents, (component) => {\n component.layoutUpdated = false\n })\n }\n\n const currentFocusKey = fromParentFocusKey || this.focusKey\n const currentComponent = currentFocusKey\n ? this.focusableComponents[currentFocusKey]\n : undefined\n\n /**\n * When there's no currently focused component, an attempt is made, to force focus one of\n * the Focusable Containers, that have \"forceFocus\" flag enabled.\n */\n if (!fromParentFocusKey && !currentComponent) {\n const forcedFocusKey = this.getForcedFocusKey()\n if (forcedFocusKey) {\n this.setFocus(forcedFocusKey)\n }\n return\n }\n\n this.log(\n \"smartNavigate\",\n \"currentComponent\",\n currentComponent ? currentComponent.focusKey : undefined,\n currentComponent ? currentComponent.node : undefined,\n currentComponent\n )\n\n if (currentComponent) {\n this.updateLayout(currentComponent.focusKey)\n const { parentFocusKey, focusKey, layout } = currentComponent\n\n const currentCutoffCoordinate =\n SpatialNavigationService.getCutoffCoordinate(\n isVerticalDirection,\n isIncrementalDirection,\n false,\n layout,\n this.writingDirection\n )\n\n /**\n * Get only the siblings with the coords on the way of our moving direction\n */\n const siblings = filter(this.focusableComponents, (component) => {\n if (\n component.parentFocusKey === parentFocusKey &&\n component.focusable\n ) {\n this.updateLayout(component.focusKey)\n const siblingCutoffCoordinate =\n SpatialNavigationService.getCutoffCoordinate(\n isVerticalDirection,\n isIncrementalDirection,\n true,\n component.layout,\n this.writingDirection\n )\n\n return isVerticalDirection\n ? isIncrementalDirection\n ? siblingCutoffCoordinate >=\n currentCutoffCoordinate - CUT_OFF_COORDINATE_TOLERANCE_PX // vertical next\n : siblingCutoffCoordinate <=\n currentCutoffCoordinate + CUT_OFF_COORDINATE_TOLERANCE_PX // vertical previous\n : this.writingDirection === WritingDirection.LTR\n ? isIncrementalDirection\n ? siblingCutoffCoordinate >=\n currentCutoffCoordinate - CUT_OFF_COORDINATE_TOLERANCE_PX // horizontal LTR next\n : siblingCutoffCoordinate <=\n currentCutoffCoordinate + CUT_OFF_COORDINATE_TOLERANCE_PX // horizontal LTR previous\n : isIncrementalDirection\n ? siblingCutoffCoordinate <=\n currentCutoffCoordinate + CUT_OFF_COORDINATE_TOLERANCE_PX // horizontal RTL next\n : siblingCutoffCoordinate >=\n currentCutoffCoordinate - CUT_OFF_COORDINATE_TOLERANCE_PX // horizontal RTL previous\n }\n\n return false\n })\n\n if (this.debug) {\n this.log(\n \"smartNavigate\",\n \"currentCutoffCoordinate\",\n currentCutoffCoordinate\n )\n this.log(\n \"smartNavigate\",\n \"siblings\",\n `${siblings.length} elements:`,\n siblings.map((sibling) => sibling.focusKey).join(\", \"),\n siblings.map((sibling) => sibling.node),\n siblings.map((sibling) => sibling)\n )\n }\n\n const refCorners = SpatialNavigationService.getRefCorners(\n direction,\n false,\n layout\n )\n const primaryAxisDistanceThreshold = Math.max(\n isVerticalDirection ? layout.height : layout.width,\n PRIMARY_AXIS_PROXIMITY_TOLERANCE_PX\n )\n const siblingsWithPrimaryAxisDistance = siblings.map((sibling) => {\n const siblingCorners = SpatialNavigationService.getRefCorners(\n direction,\n true,\n sibling.layout\n )\n\n return {\n sibling,\n primaryAxisDistance: SpatialNavigationService.getPrimaryAxisDistance(\n refCorners,\n siblingCorners,\n isVerticalDirection\n )\n }\n })\n const minimumPrimaryAxisDistance = siblingsWithPrimaryAxisDistance.length\n ? Math.min(\n ...siblingsWithPrimaryAxisDistance.map(\n ({ primaryAxisDistance }) => primaryAxisDistance\n )\n )\n : null\n const nearbySiblings =\n minimumPrimaryAxisDistance === null\n ? siblings\n : siblingsWithPrimaryAxisDistance\n .filter(\n ({ primaryAxisDistance }) =>\n primaryAxisDistance <=\n minimumPrimaryAxisDistance + primaryAxisDistanceThreshold\n )\n .map(({ sibling }) => sibling)\n\n if (this.debug) {\n this.log(\n \"smartNavigate\",\n \"nearbySiblings\",\n `${nearbySiblings.length} elements:`,\n nearbySiblings.map((sibling) => sibling.focusKey).join(\", \"),\n `minimumPrimaryAxisDistance: ${minimumPrimaryAxisDistance}`,\n `primaryAxisDistanceThreshold: ${primaryAxisDistanceThreshold}`\n )\n }\n\n if (this.visualDebugger) {\n this.visualDebugger.drawPoint(refCorners.a.x, refCorners.a.y)\n this.visualDebugger.drawPoint(refCorners.b.x, refCorners.b.y)\n }\n\n const sortedSiblings = this.sortSiblingsByPriority(\n nearbySiblings,\n layout,\n direction,\n focusKey\n )\n\n const nextComponent = first(sortedSiblings)\n\n this.log(\n \"smartNavigate\",\n \"nextComponent\",\n nextComponent ? nextComponent.focusKey : undefined,\n nextComponent ? nextComponent.node : undefined,\n nextComponent\n )\n\n if (nextComponent) {\n this.setFocus(nextComponent.focusKey, focusDetails)\n } else {\n if (!parentFocusKey) {\n return\n }\n\n const parentComponent = this.focusableComponents[parentFocusKey]\n\n const focusBoundaryDirections = parentComponent?.isFocusBoundary\n ? parentComponent.focusBoundaryDirections || [direction]\n : []\n\n if (!parentComponent || !focusBoundaryDirections.includes(direction)) {\n this.smartNavigate(direction, parentFocusKey, focusDetails)\n }\n }\n }\n }\n\n saveLastFocusedChildKey(component: FocusableComponent, focusKey: string) {\n if (component) {\n this.log(\n \"saveLastFocusedChildKey\",\n `${component.focusKey} lastFocusedChildKey set`,\n focusKey\n )\n\n component.lastFocusedChildKey = focusKey\n }\n }\n\n log(functionName: string, debugString: string, ...rest: unknown[]) {\n if (this.debug) {\n console.log(\n `%c${functionName}%c${debugString}`,\n `background: ${\n DEBUG_FN_COLORS[this.logIndex % DEBUG_FN_COLORS.length]\n }; color: black; padding: 1px 5px;`,\n \"background: #333; color: #BADA55; padding: 1px 5px;\",\n ...rest\n )\n }\n }\n\n /**\n * Returns the current focus key\n */\n getCurrentFocusKey(): string {\n return this.focusKey!\n }\n\n /**\n * Returns the focus key to which focus can be forced if there are force-focusable components.\n * A component closest to the top left viewport corner (0,0) is returned.\n */\n getForcedFocusKey(): string | undefined {\n const forceFocusableComponents = filter(\n this.focusableComponents,\n (component) => component.focusable && component.forceFocus\n )\n\n /**\n * Searching of the top level component that is closest to the top left viewport corner (0,0).\n * To achieve meaningful and coherent results, 'down' direction is forced.\n */\n const sortedForceFocusableComponents = this.sortSiblingsByPriority(\n forceFocusableComponents,\n {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n left: 0,\n top: 0,\n right: 0,\n bottom: 0,\n node: null\n },\n \"down\",\n ROOT_FOCUS_KEY\n )\n\n return first(sortedForceFocusableComponents)?.focusKey\n }\n\n /**\n * This function tries to determine the next component to Focus\n * It's either the target node OR the one down by the Tree if node has children components\n * Based on \"targetFocusKey\" which means the \"intended component to focus\"\n */\n getNextFocusKey(targetFocusKey: string): string {\n const targetComponent = this.focusableComponents[targetFocusKey]\n\n /**\n * Security check, if component doesn't exist, stay on the same focusKey\n */\n if (!targetComponent || this.nativeMode) {\n return targetFocusKey\n }\n\n const children = filter(\n this.focusableComponents,\n (component) =>\n component.parentFocusKey === targetFocusKey && component.focusable\n )\n\n if (children.length > 0) {\n const { lastFocusedChildKey, preferredChildFocusKey } = targetComponent\n\n this.log(\n \"getNextFocusKey\",\n \"lastFocusedChildKey is\",\n lastFocusedChildKey\n )\n this.log(\n \"getNextFocusKey\",\n \"preferredChildFocusKey is\",\n preferredChildFocusKey\n )\n\n /**\n * First of all trying to focus last focused child\n */\n if (\n lastFocusedChildKey &&\n targetComponent.saveLastFocusedChild &&\n this.isParticipatingFocusableComponent(lastFocusedChildKey)\n ) {\n this.log(\n \"getNextFocusKey\",\n \"lastFocusedChildKey will be focused\",\n lastFocusedChildKey\n )\n\n return this.getNextFocusKey(lastFocusedChildKey)\n }\n\n /**\n * If there is no lastFocusedChild, trying to focus the preferred focused key\n */\n if (\n preferredChildFocusKey &&\n this.isParticipatingFocusableComponent(preferredChildFocusKey)\n ) {\n this.log(\n \"getNextFocusKey\",\n \"preferredChildFocusKey will be focused\",\n preferredChildFocusKey\n )\n\n return this.getNextFocusKey(preferredChildFocusKey)\n }\n\n /**\n * Otherwise, trying to focus something by coordinates\n */\n children.forEach((component) => this.updateLayout(component.focusKey))\n const closestChild = getChildClosestToOrigin(\n children,\n this.writingDirection\n )\n if (!closestChild) {\n return targetFocusKey\n }\n\n const { focusKey: childKey } = closestChild\n\n this.log(\"getNextFocusKey\", \"childKey will be focused\", childKey)\n\n return this.getNextFocusKey(childKey)\n }\n\n /**\n * If no children, just return targetFocusKey back\n */\n this.log(\"getNextFocusKey\", \"targetFocusKey\", targetFocusKey)\n\n return targetFocusKey\n }\n\n addFocusable({\n focusKey,\n node,\n parentFocusKey,\n onEnterPress,\n onEnterRelease,\n onArrowPress,\n onArrowRelease,\n onFocus,\n onBlur,\n saveLastFocusedChild,\n trackChildren,\n onUpdateFocus,\n onUpdateHasFocusedChild,\n preferredChildFocusKey,\n autoRestoreFocus,\n forceFocus,\n focusable,\n isFocusBoundary,\n focusBoundaryDirections\n }: FocusableComponentConfig) {\n this.focusableComponents[focusKey] = {\n focusKey,\n node,\n parentFocusKey,\n onEnterPress,\n onEnterRelease,\n onArrowPress,\n onArrowRelease,\n onFocus,\n onBlur,\n onUpdateFocus,\n onUpdateHasFocusedChild,\n saveLastFocusedChild,\n trackChildren,\n preferredChildFocusKey,\n focusable,\n isFocusBoundary,\n focusBoundaryDirections,\n autoRestoreFocus,\n forceFocus,\n lastFocusedChildKey: null,\n layout: {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n left: 0,\n top: 0,\n right: 0,\n bottom: 0,\n\n /**\n * Node ref is also duplicated in layout to be reported in onFocus callback\n */\n node\n },\n layoutUpdated: false\n }\n\n if (!node) {\n console.warn(\n \"Component added without a node reference. This will result in its coordinates being empty and may cause lost focus. Check the \\\"ref\\\" passed to \\\"useFocusable\\\": \",\n this.focusableComponents[focusKey]\n )\n }\n\n if (this.nativeMode) {\n return\n }\n\n this.makeNodeProgrammaticallyFocusable(this.focusableComponents[focusKey])\n this.updateLayout(focusKey)\n\n this.log(\n \"addFocusable\",\n \"Component added: \",\n this.focusableComponents[focusKey]\n )\n\n /**\n * If for some reason this component was already focused before it was added, call the update\n */\n if (focusKey === this.focusKey) {\n this.setFocus(preferredChildFocusKey || focusKey)\n }\n\n /**\n * Parent nodes are created after children, and child may focus itself.\n * If so, it's required to check if parent lies on a path to focused child.\n */\n const currentFocusKey = this.focusKey\n if (!currentFocusKey) {\n return\n }\n\n let currentComponent = this.focusableComponents[currentFocusKey]\n while (currentComponent) {\n if (currentComponent.parentFocusKey === focusKey) {\n this.updateParentsHasFocusedChild(currentFocusKey, {})\n this.updateParentsLastFocusedChild(currentFocusKey)\n break\n }\n\n if (!currentComponent.parentFocusKey) {\n break\n }\n currentComponent =\n this.focusableComponents[currentComponent.parentFocusKey]\n }\n }\n\n removeFocusable({\n focusKey,\n skipFocusRestoration = false\n }: FocusableComponentRemovePayload) {\n const componentToRemove = this.focusableComponents[focusKey]\n\n if (componentToRemove) {\n const { parentFocusKey, onUpdateFocus } = componentToRemove\n\n onUpdateFocus(false)\n\n this.log(\"removeFocusable\", \"Component removed: \", componentToRemove)\n\n delete this.focusableComponents[focusKey]\n\n const hadFocusedChild = this.parentsHavingFocusedChild.includes(focusKey)\n this.parentsHavingFocusedChild = this.parentsHavingFocusedChild.filter(\n (parentWithFocusedChild) => parentWithFocusedChild !== focusKey\n )\n\n const parentComponent = parentFocusKey\n ? this.focusableComponents[parentFocusKey]\n : undefined\n const isFocused = focusKey === this.focusKey\n\n /**\n * If the component was stored as lastFocusedChild, clear lastFocusedChildKey from parent\n */\n if (parentComponent && parentComponent.lastFocusedChildKey === focusKey) {\n parentComponent.lastFocusedChildKey = null\n }\n\n if (this.nativeMode) {\n return\n }\n\n /**\n * If the component was also focused at this time, OR had focused child, focus its parent -> it will focus another child\n * Normally the order of components unmount is children -> parents, but sometimes parent can be removed before the child\n * So we need to check not only for the current Leaf component focus state, but also if it was a Parent that had focused child\n */\n if (\n !skipFocusRestoration &&\n (isFocused || hadFocusedChild) &&\n parentComponent &&\n parentComponent.autoRestoreFocus\n ) {\n this.log(\n \"removeFocusable\",\n \"Component removed: \",\n isFocused ? \"Leaf component\" : \"Container component\",\n \"Auto restoring focus to: \",\n parentFocusKey\n )\n\n /**\n * Focusing parent with a slight delay\n * This is to avoid multiple focus restorations if multiple children getting unmounted in one render cycle\n */\n this.setFocusDebounced(parentComponent.focusKey)\n }\n }\n }\n\n getNodeLayoutByFocusKey(focusKey: string) {\n const component = this.focusableComponents[focusKey]\n\n if (component) {\n this.updateLayout(component.focusKey)\n\n return component.layout\n }\n\n return null\n }\n\n setCurrentFocusedKey(newFocusKey: string, focusDetails: FocusDetails) {\n const oldFocusKey = this.focusKey\n if (\n oldFocusKey &&\n this.isFocusableComponent(oldFocusKey) &&\n newFocusKey !== oldFocusKey\n ) {\n const oldComponent = this.focusableComponents[oldFocusKey]\n oldComponent.onUpdateFocus(false)\n oldComponent.onBlur(\n this.getNodeLayoutByFocusKey(oldFocusKey)!,\n focusDetails\n )\n\n oldComponent.node?.removeAttribute?.(\"data-focused\")\n\n this.log(\"setCurrentFocusedKey\", \"onBlur\", oldComponent)\n }\n\n this.focusKey = newFocusKey\n\n if (this.isFocusableComponent(newFocusKey)) {\n const newComponent = this.focusableComponents[newFocusKey]\n this.makeNodeProgrammaticallyFocusable(newComponent)\n\n if (\n this.shouldFocusDOMNode &&\n newComponent.node &&\n typeof newComponent.node.focus === \"function\" &&\n (typeof document === \"undefined\" ||\n newComponent.node !== document.activeElement)\n ) {\n newComponent.node.focus(this.domNodeFocusOptions)\n }\n\n newComponent.node?.setAttribute?.(\"data-focused\", \"true\")\n\n newComponent.onUpdateFocus(true)\n newComponent.onFocus(\n this.getNodeLayoutByFocusKey(newFocusKey)!,\n focusDetails\n )\n\n this.log(\"setCurrentFocusedKey\", \"onFocus\", newComponent)\n }\n }\n\n updateParentsHasFocusedChild(focusKey: string, focusDetails: FocusDetails) {\n const parents: string[] = []\n\n let currentComponent: FocusableComponent | undefined =\n this.focusableComponents[focusKey]\n\n /**\n * Recursively iterate the tree up and find all the parents' focus keys\n */\n while (currentComponent) {\n const parentFocusKey: string | undefined = currentComponent.parentFocusKey\n const parentComponent: FocusableComponent | undefined = parentFocusKey\n ? this.focusableComponents[parentFocusKey]\n : undefined\n\n if (parentComponent) {\n parents.push(parentComponent.focusKey)\n }\n\n currentComponent = parentComponent\n }\n\n const parentsToRemoveFlag = difference(\n this.parentsHavingFocusedChild,\n parents\n )\n const parentsToAddFlag = difference(\n parents,\n this.parentsHavingFocusedChild\n )\n\n forEach(parentsToRemoveFlag, (parentFocusKey) => {\n const parentComponent = this.focusableComponents[parentFocusKey]\n\n if (parentComponent && parentComponent.trackChildren) {\n parentComponent.onUpdateHasFocusedChild(false)\n }\n this.onIntermediateNodeBecameBlurred(parentFocusKey, focusDetails)\n })\n\n forEach(parentsToAddFlag, (parentFocusKey) => {\n const parentComponent = this.focusableComponents[parentFocusKey]\n\n if (parentComponent && parentComponent.trackChildren) {\n parentComponent.onUpdateHasFocusedChild(true)\n }\n this.onIntermediateNodeBecameFocused(parentFocusKey, focusDetails)\n })\n\n this.parentsHavingFocusedChild = parents\n }\n\n updateParentsLastFocusedChild(focusKey: string) {\n let currentComponent: FocusableComponent | undefined =\n this.focusableComponents[focusKey]\n\n /**\n * Recursively iterate the tree up and update all the parent's lastFocusedChild\n */\n while (currentComponent) {\n const parentFocusKey: string | undefined = currentComponent.parentFocusKey\n const parentComponent: FocusableComponent | undefined = parentFocusKey\n ? this.focusableComponents[parentFocusKey]\n : undefined\n\n if (parentComponent) {\n this.saveLastFocusedChildKey(\n parentComponent,\n currentComponent.focusKey\n )\n }\n\n currentComponent = parentComponent\n }\n }\n\n getKeyMap() {\n return this.keyMap\n }\n\n setKeyMap(keyMap: BackwardsCompatibleKeyMap) {\n this.keyMap = {\n ...this.getKeyMap(),\n ...normalizeKeyMap(keyMap)\n }\n }\n\n isFocusableComponent(focusKey: string) {\n return !!this.focusableComponents[focusKey]\n }\n\n /**\n * Checks whether the focusableComponent is actually participating in spatial navigation (in other words, is a\n * 'focusable' focusableComponent). Seems less confusing than calling it isFocusableFocusableComponent()\n */\n isParticipatingFocusableComponent(focusKey: string) {\n return (\n this.isFocusableComponent(focusKey) &&\n this.focusableComponents[focusKey].focusable\n )\n }\n\n onIntermediateNodeBecameFocused(\n focusKey: string,\n focusDetails: FocusDetails\n ) {\n if (this.isParticipatingFocusableComponent(focusKey)) {\n const layout = this.getNodeLayoutByFocusKey(focusKey)\n if (!layout) {\n return\n }\n this.focusableComponents[focusKey].onFocus(layout, focusDetails)\n }\n }\n\n onIntermediateNodeBecameBlurred(\n focusKey: string,\n focusDetails: FocusDetails\n ) {\n if (this.isParticipatingFocusableComponent(focusKey)) {\n const layout = this.getNodeLayoutByFocusKey(focusKey)\n if (!layout) {\n return\n }\n this.focusableComponents[focusKey].onBlur(layout, focusDetails)\n }\n }\n\n pause() {\n this.paused = true\n }\n\n resume() {\n this.paused = false\n }\n\n setFocus(focusKey: string, focusDetails: FocusDetails = {}) {\n // Cancel any pending auto-restore focus calls if we are setting focus manually\n this.setFocusDebounced.cancel()\n\n if (!this.enabled) {\n return\n }\n\n this.log(\"setFocus\", \"focusKey\", focusKey)\n\n /**\n * When focusKey is not provided or is equal to `ROOT_FOCUS_KEY`, an attempt is made,\n * to force focus one of the Focusable Containers, that have \"forceFocus\" flag enabled.\n * A component closest to the top left viewport corner (0,0) is force-focused.\n */\n const focusKeyToSet =\n !focusKey || focusKey === ROOT_FOCUS_KEY\n ? this.getForcedFocusKey()\n : focusKey\n\n if (!focusKeyToSet) {\n return\n }\n\n const newFocusKey = this.getNextFocusKey(focusKeyToSet)\n\n this.log(\"setFocus\", \"newFocusKey\", newFocusKey)\n\n this.setCurrentFocusedKey(newFocusKey, focusDetails)\n this.updateParentsHasFocusedChild(newFocusKey, focusDetails)\n this.updateParentsLastFocusedChild(newFocusKey)\n }\n\n updateAllLayouts() {\n if (!this.enabled || this.nativeMode) {\n return\n }\n\n forOwn(this.focusableComponents, (component, focusKey) => {\n this.updateLayout(focusKey)\n })\n }\n\n updateLayout(focusKey: string) {\n const component = this.focusableComponents[focusKey]\n\n if (!component || this.nativeMode || component.layoutUpdated) {\n return\n }\n\n const { node } = component\n const layoutReferenceNode = this.getLayoutReferenceNode(node)\n\n const layout = this.useGetBoundingClientRect\n ? getBoundingClientRect(layoutReferenceNode)\n : measureLayout(layoutReferenceNode)\n\n component.layout = {\n ...layout,\n node\n }\n component.layoutUpdated = true\n }\n\n updateFocusable(\n focusKey: string,\n {\n node,\n parentFocusKey,\n preferredChildFocusKey,\n saveLastFocusedChild,\n trackChildren,\n focusable,\n isFocusBoundary,\n focusBoundaryDirections,\n autoRestoreFocus,\n forceFocus,\n onEnterPress,\n onEnterRelease,\n onArrowPress,\n onArrowRelease,\n onFocus,\n onBlur\n }: FocusableComponentUpdatePayload\n ) {\n if (this.nativeMode) {\n return\n }\n\n const component = this.focusableComponents[focusKey]\n\n if (component) {\n const previousParentFocusKey = component.parentFocusKey\n\n component.parentFocusKey = parentFocusKey\n component.preferredChildFocusKey = preferredChildFocusKey\n component.saveLastFocusedChild = saveLastFocusedChild\n component.trackChildren = trackChildren\n component.focusable = focusable\n component.isFocusBoundary = isFocusBoundary\n component.focusBoundaryDirections = focusBoundaryDirections\n component.autoRestoreFocus = autoRestoreFocus\n component.forceFocus = forceFocus\n component.onEnterPress = onEnterPress\n component.onEnterRelease = onEnterRelease\n component.onArrowPress = onArrowPress\n component.onArrowRelease = onArrowRelease\n component.onFocus = onFocus\n component.onBlur = onBlur\n\n if (node) {\n component.node = node\n }\n\n if (previousParentFocusKey !== parentFocusKey) {\n if (previousParentFocusKey) {\n const previousParentComponent =\n this.focusableComponents[previousParentFocusKey]\n\n if (previousParentComponent?.lastFocusedChildKey === focusKey) {\n previousParentComponent.lastFocusedChildKey = null\n }\n }\n\n const currentFocusKey = this.focusKey\n let currentFocusedComponent = currentFocusKey\n ? this.focusableComponents[currentFocusKey]\n : undefined\n\n while (currentFocusKey && currentFocusedComponent) {\n if (currentFocusedComponent.focusKey === focusKey) {\n this.updateParentsHasFocusedChild(currentFocusKey, {})\n this.updateParentsLastFocusedChild(currentFocusKey)\n break\n }\n\n if (!currentFocusedComponent.parentFocusKey) {\n break\n }\n\n currentFocusedComponent =\n this.focusableComponents[currentFocusedComponent.parentFocusKey]\n }\n }\n\n component.layoutUpdated = false\n this.makeNodeProgrammaticallyFocusable(component)\n }\n }\n\n isNativeMode() {\n return this.nativeMode\n }\n\n doesFocusableExist(focusKey: string) {\n return !!this.focusableComponents[focusKey]\n }\n\n /**\n * This function updates the writing direction\n * @param rtl whether the writing direction is right-to-left\n */\n updateRtl(rtl: boolean) {\n this.writingDirection = rtl ? WritingDirection.RTL : WritingDirection.LTR\n }\n}\n\n/**\n * Export singleton\n */\nexport const SpatialNavigation = new SpatialNavigationService()\n\nexport const {\n init,\n setThrottle,\n setVisualDebug,\n destroy,\n setKeyMap,\n setFocus,\n navigateByDirection,\n pause,\n resume,\n updateAllLayouts,\n getCurrentFocusKey,\n doesFocusableExist,\n updateRtl\n} = SpatialNavigation\n","import { useContext, createContext } from \"react\"\n\nimport { ROOT_FOCUS_KEY } from \"./SpatialNavigation\"\n\n\nexport const FocusContext = createContext(ROOT_FOCUS_KEY)\nFocusContext.displayName = \"FocusContext\"\n\n/** @internal */\nexport const useFocusContext = () => useContext(FocusContext)\n","import {\n RefObject,\n useCallback,\n useMemo,\n useRef,\n useEffect,\n useState\n} from \"react\"\nimport noop from \"lodash/noop\"\nimport uniqueId from \"lodash/uniqueId\"\n\nimport {\n SpatialNavigation,\n FocusableComponentLayout,\n FocusDetails,\n KeyPressDetails,\n Direction\n} from \"./SpatialNavigation\"\nimport { useFocusContext } from \"./useFocusContext\"\n\n\nexport type EnterPressHandler<P = object> = (\n props: P,\n details: KeyPressDetails\n) => void;\n\nexport type EnterReleaseHandler<P = object> = (props: P) => void;\n\nexport type ArrowPressHandler<P = object> = (\n direction: string,\n props: P,\n details: KeyPressDetails\n) => boolean;\n\nexport type ArrowReleaseHandler<P = object> = (\n direction: string,\n props: P,\n) => void;\n\nexport type FocusHandler<P = object> = (\n layout: FocusableComponentLayout,\n props: P,\n details: FocusDetails\n) => void;\n\nexport type BlurHandler<P = object> = (\n layout: FocusableComponentLayout,\n props: P,\n details: FocusDetails\n) => void;\n\nexport interface UseFocusableConfig<P = object> {\n focusable?: boolean;\n saveLastFocusedChild?: boolean;\n trackChildren?: boolean;\n autoRestoreFocus?: boolean;\n forceFocus?: boolean;\n isFocusBoundary?: boolean;\n focusBoundaryDirections?: Direction[];\n focusKey?: string;\n preferredChildFocusKey?: string;\n onEnterPress?: EnterPressHandler<P>;\n onEnterRelease?: EnterReleaseHandler<P>;\n onArrowPress?: ArrowPressHandler<P>;\n onArrowRelease?: ArrowReleaseHandler<P>;\n onFocus?: FocusHandler<P>;\n onBlur?: BlurHandler<P>;\n extraProps?: P;\n}\n\nexport interface UseFocusableResult<E extends HTMLElement = HTMLElement> {\n ref: RefObject<E | null>;\n focusSelf: (focusDetails?: FocusDetails) => void;\n focused: boolean;\n hasFocusedChild: boolean;\n focusKey: string;\n}\n\nconst useFocusableHook = <P, E extends HTMLElement = HTMLElement>({\n focusable = true,\n saveLastFocusedChild = true,\n trackChildren = false,\n autoRestoreFocus = true,\n forceFocus = false,\n isFocusBoundary = false,\n focusBoundaryDirections,\n focusKey: propFocusKey,\n preferredChildFocusKey,\n onEnterPress = noop,\n onEnterRelease = noop,\n onArrowPress = () => true,\n onArrowRelease = noop,\n onFocus = noop,\n onBlur = noop,\n extraProps\n}: UseFocusableConfig<P> = {}): UseFocusableResult<E> => {\n const onEnterPressHandler = useCallback(\n (details?: KeyPressDetails) => {\n if (!details) {\n return\n }\n onEnterPress(extraProps as P, details)\n },\n [onEnterPress, extraProps]\n )\n\n const onEnterReleaseHandler = useCallback(() => {\n onEnterRelease(extraProps as P)\n }, [onEnterRelease, extraProps])\n\n const onArrowPressHandler = useCallback(\n (direction: string, details: KeyPressDetails) =>\n onArrowPress(direction, extraProps as P, details),\n [extraProps, onArrowPress]\n )\n\n const onArrowReleaseHandler = useCallback(\n (direction: string) => {\n onArrowRelease(direction, extraProps as P)\n },\n [onArrowRelease, extraProps]\n )\n\n const onFocusHandler = useCallback(\n (layout: FocusableComponentLayout, details: FocusDetails) => {\n onFocus(layout, extraProps as P, details)\n },\n [extraProps, onFocus]\n )\n\n const onBlurHandler = useCallback(\n (layout: FocusableComponentLayout, details: FocusDetails) => {\n onBlur(layout, extraProps as P, details)\n },\n [extraProps, onBlur]\n )\n\n const ref = useRef<E>(null)\n const registeredFocusKeyRef = useRef<string | null>(null)\n\n const [focused, setFocused] = useState(false)\n const [hasFocusedChild, setHasFocusedChild] = useState(false)\n\n const parentFocusKey = useFocusContext()\n\n /**\n * Either using the propFocusKey passed in, or generating a random one\n */\n const focusKey = useMemo(\n () => propFocusKey || uniqueId(\"sn:focusable-item-\"),\n [propFocusKey]\n )\n\n const focusSelf = useCallback(\n (focusDetails: FocusDetails = {}) => {\n SpatialNavigation.setFocus(focusKey, focusDetails)\n },\n [focusKey]\n )\n\n const registerFocusable = (registrationFocusKey: string) => {\n const node = ref.current as E | null\n\n SpatialNavigation.addFocusable({\n focusKey: registrationFocusKey,\n node,\n parentFocusKey,\n preferredChildFocusKey,\n onEnterPress: onEnterPressHandler,\n onEnterRelease: onEnterReleaseHandler,\n onArrowPress: onArrowPressHandler,\n onArrowRelease: onArrowReleaseHandler,\n onFocus: onFocusHandler,\n onBlur: onBlurHandler,\n onUpdateFocus: (isFocused = false) => setFocused(isFocused),\n onUpdateHasFocusedChild: (isFocused = false) =>\n setHasFocusedChild(isFocused),\n saveLastFocusedChild,\n trackChildren,\n isFocusBoundary,\n focusBoundaryDirections,\n autoRestoreFocus,\n forceFocus,\n focusable\n })\n }\n\n useEffect(() => {\n const registeredFocusKey = registeredFocusKeyRef.current\n\n if (!registeredFocusKey) {\n registerFocusable(focusKey)\n registeredFocusKeyRef.current = focusKey\n return\n }\n\n if (registeredFocusKey === focusKey) {\n return\n }\n\n const wasFocused =\n SpatialNavigation.getCurrentFocusKey() === registeredFocusKey\n\n SpatialNavigation.removeFocusable({\n focusKey: registeredFocusKey,\n skipFocusRestoration: true\n })\n\n registerFocusable(focusKey)\n registeredFocusKeyRef.current = focusKey\n\n if (wasFocused) {\n SpatialNavigation.setFocus(focusKey)\n }\n }, [focusKey]) // eslint-disable-line react-hooks/exhaustive-deps\n\n useEffect(() => {\n return () => {\n const registeredFocusKey = registeredFocusKeyRef.current\n\n if (!registeredFocusKey) {\n return\n }\n\n SpatialNavigation.removeFocusable({\n focusKey: registeredFocusKey\n })\n\n registeredFocusKeyRef.current = null\n }\n }, []) \n\n useEffect(() => {\n const node = ref.current as E | null\n\n SpatialNavigation.updateFocusable(focusKey, {\n node,\n parentFocusKey,\n preferredChildFocusKey,\n saveLastFocusedChild,\n trackChildren,\n focusable,\n isFocusBoundary,\n focusBoundaryDirections,\n autoRestoreFocus,\n forceFocus,\n onEnterPress: onEnterPressHandler,\n onEnterRelease: onEnterReleaseHandler,\n onArrowPress: onArrowPressHandler,\n onArrowRelease: onArrowReleaseHandler,\n onFocus: onFocusHandler,\n onBlur: onBlurHandler\n })\n }, [\n focusKey,\n parentFocusKey,\n preferredChildFocusKey,\n saveLastFocusedChild,\n trackChildren,\n focusable,\n isFocusBoundary,\n focusBoundaryDirections,\n autoRestoreFocus,\n forceFocus,\n onEnterPressHandler,\n onEnterReleaseHandler,\n onArrowPressHandler,\n onArrowReleaseHandler,\n onFocusHandler,\n onBlurHandler\n ])\n\n return {\n ref,\n focusSelf,\n focused,\n hasFocusedChild,\n focusKey // returns either the same focusKey as passed in, or generated one\n }\n}\n\nexport const useFocusable = useFocusableHook\n"],"names":["noop","require$$0","uniqueId","require$$1","require$$2","require$$3","require$$4","require$$5","Symbol","difference","exports","isBuffer","collection","othValue","Promise","require$$6","require$$7","filter","findKey","first","forEach","forOwn","require$$8","sortBy","WritingDirection","LTR","RTL","hasDOM","window","document","MIN_PIXEL_RATIO","VisualDebugger","debugCtx","layoutsCtx","writingDirection","useViewportCoordinates","constructor","createCanvas","getViewportSize","width","innerWidth","height","innerHeight","getPixelRatio","devicePixelRatio","Math","max","configureCanvas","canvas","ctx","pixelRatio","style","scaledWidth","round","scaledHeight","setTransform","syncCanvasSizes","getViewportOffset","x","y","scrollX","scrollY","id","zIndex","existingCanvas","querySelector","createElement","setAttribute","getContext","position","top","left","pointerEvents","isConnected","body","appendChild","clear","clearRect","clearLayouts","drawLayout","layout","focusKey","parentFocusKey","offset","strokeStyle","strokeRect","font","fillStyle","horizontalStartDirection","horizontalStartCoordinate","fillText","drawPoint","color","size","pointX","pointY","lineWidth","ELEMENT_NODE","getRect","node","offsetParent","offsetHeight","offsetWidth","offsetLeft","offsetTop","nodeType","scrollLeft","scrollTop","measureLayout","relativeNode","parentElement","relativeRect","right","bottom","getBoundingClientRect","rect","DIRECTION_LEFT","DIRECTION_RIGHT","DIRECTION_UP","DIRECTION_DOWN","KEY_ENTER","DEFAULT_KEY_MAP","ROOT_FOCUS_KEY","FOCUSABLE_SELECTOR","join","FORM_FIELD_SELECTOR","CHECKBOX_LIKE_SELECTOR","ADJACENT_SLICE_THRESHOLD","ADJACENT_SLICE_WEIGHT","DIAGONAL_SLICE_WEIGHT","MAIN_COORDINATE_WEIGHT","CUT_OFF_COORDINATE_TOLERANCE_PX","PRIMARY_AXIS_PROXIMITY_TOLERANCE_PX","AUTO_RESTORE_FOCUS_DELAY","DEBUG_FN_COLORS","THROTTLE_OPTIONS","leading","trailing","getChildClosestToOrigin","children","comparator","abs","childrenClosestToOrigin","normalizeKeyMap","keyMap","newKeyMap","Object","entries","key","value","Array","isArray","isFocusableByDefault","matches","isFormFieldElement","target","element","SpatialNavigationService","focusableComponents","visualDebugger","visualDebugAnimationFrame","visualDebugEnabled","shouldFocusDOMNode","shouldUseNativeEvents","trackNativeFocus","blockNavigationOutOfFormFields","parentsHavingFocusedChild","domNodeFocusOptions","enabled","nativeMode","throttle","throttleKeypresses","pressedKeys","paused","useGetBoundingClientRect","keyDownEventListener","keyDownEventListenerThrottled","keyUpEventListener","focusInEventListener","debug","logIndex","setFocusDebounced","distanceCalculationMethod","customDistanceCalculationFunction","getCutoffCoordinate","isVertical","isIncremental","isSibling","itemStart","itemEnd","getRefCorners","direction","result","a","b","getAdjacentSliceMetrics","refCorners","siblingCorners","isVerticalDirection","refA","refB","siblingA","siblingB","coordinate","refCoordinateA","refCoordinateB","siblingCoordinateA","siblingCoordinateB","refLength","siblingLength","intersectionLength","min","isAdjacentSlice","thresholdDistance","getAdjacentSliceWeight","overlapRatioOnSibling","getPrimaryAxisDistance","getSecondaryAxisDistance","refCoordinateCenter","siblingCoordinateCenter","refCoordinateEdgeMin","siblingCoordinateEdgeMin","refCoordinateEdgeMax","siblingCoordinateEdgeMax","minEdgeDistance","maxEdgeDistance","distancesToCompare","sortSiblingsByPriority","siblings","currentLayout","sibling","adjacentSliceWeight","primaryAxisFunction","secondaryAxisFunction","primaryAxisDistance","secondaryAxisDistance","totalDistancePoints","priority","log","pause","bind","resume","setFocus","updateAllLayouts","navigateByDirection","init","setThrottle","setVisualDebug","destroy","setKeyMap","getCurrentFocusKey","doesFocusableExist","updateRtl","debounce","visualDebug","throttleParam","nativeFocus","rtl","resolvedShouldFocusDOMNode","Number","isInteger","bindEventHandlers","startVisualDebugLoop","requestAnimationFrame","draw","component","stopVisualDebugLoop","cancelAnimationFrame","remove","unbindEventHandlers","cancel","getEventType","keyCode","getKeyMap","codeList","includes","getKeyCode","event","code","isDirectionalEventType","eventType","shouldBypassSpatialNavigationForTarget","makeNodeProgrammaticallyFocusable","focusable","hasAutoTabIndex","getAttribute","removeAttribute","getLayoutReferenceNode","tagName","findNativeFocusedComponent","targetNode","matchingComponents","Boolean","contains","length","sortedByDepth","depth","currentNode","syncNativeFocus","focusDetails","nativeEvent","setCurrentFocusedKey","updateParentsHasFocusedChild","updateParentsLastFocusedChild","addEventListener","preventDefault","stopPropagation","keysDetails","onEnterPress","preventDefaultNavigation","onArrowPress","smartNavigate","keyDownListener","throttledListener","onEnterRelease","onArrowRelease","removeEventListener","listener","undefined","validDirections","fromParentFocusKey","isIncrementalDirection","layoutUpdated","currentFocusKey","currentComponent","forcedFocusKey","getForcedFocusKey","updateLayout","currentCutoffCoordinate","siblingCutoffCoordinate","map","primaryAxisDistanceThreshold","siblingsWithPrimaryAxisDistance","minimumPrimaryAxisDistance","nearbySiblings","sortedSiblings","nextComponent","parentComponent","focusBoundaryDirections","isFocusBoundary","saveLastFocusedChildKey","lastFocusedChildKey","functionName","debugString","rest","console","forceFocusableComponents","forceFocus","sortedForceFocusableComponents","getNextFocusKey","targetFocusKey","targetComponent","preferredChildFocusKey","saveLastFocusedChild","isParticipatingFocusableComponent","closestChild","childKey","addFocusable","onFocus","onBlur","trackChildren","onUpdateFocus","onUpdateHasFocusedChild","autoRestoreFocus","warn","removeFocusable","skipFocusRestoration","componentToRemove","hadFocusedChild","parentWithFocusedChild","isFocused","getNodeLayoutByFocusKey","newFocusKey","oldFocusKey","isFocusableComponent","oldComponent","newComponent","focus","activeElement","parents","push","parentsToRemoveFlag","parentsToAddFlag","onIntermediateNodeBecameBlurred","onIntermediateNodeBecameFocused","focusKeyToSet","layoutReferenceNode","updateFocusable","previousParentFocusKey","previousParentComponent","currentFocusedComponent","isNativeMode","SpatialNavigation","FocusContext","createContext","displayName","useFocusContext","useContext","useFocusableHook","t0","$","_c","t1","t2","t3","t4","t5","t6","t7","propFocusKey","t8","t9","t10","t11","t12","t13","extraProps","t14","_temp","t15","details","onEnterPressHandler","t16","onEnterReleaseHandler","t17","details_0","onArrowPressHandler","t18","direction_0","onArrowReleaseHandler","t19","details_1","onFocusHandler","t20","layout_0","details_2","onBlurHandler","ref","useRef","registeredFocusKeyRef","focused","setFocused","useState","hasFocusedChild","setHasFocusedChild","t21","t22","t23","focusSelf","registrationFocusKey","current","t24","t25","isFocused_0","registerFocusable","registeredFocusKey","wasFocused","useEffect","t26","t27","for","registeredFocusKey_0","t28","t29","node_0","t30","useFocusable"],"mappings":";;;;;;;;AAYA,WAASA,QAAO;AAAA,EAEhB;AAEA,WAAiBA;;;;;;;;;;AChBjB,MAAI,WAAWC,gBAAA;AAGf,MAAI,YAAY;AAmBhB,WAASC,UAAS,QAAQ;AACxB,QAAI,KAAK,EAAE;AACX,WAAO,SAAS,MAAM,IAAI;AAAA,EAC5B;AAEA,eAAiBA;;;;;;;;;;;;AC3BjB,MAAI,aAAaD,mBAAA,GACb,WAAWE,gBAAA;AAGf,MAAI,WAAW,0BACX,UAAU,qBACV,SAAS,8BACT,WAAW;AAmBf,WAAS,WAAW,OAAO;AACzB,QAAI,CAAC,SAAS,KAAK,GAAG;AACpB,aAAO;AAAA,IACX;AAGE,QAAI,MAAM,WAAW,KAAK;AAC1B,WAAO,OAAO,WAAW,OAAO,UAAU,OAAO,YAAY,OAAO;AAAA,EACtE;AAEA,iBAAiB;;;;;;;;ACpCjB,MAAI,OAAOF,aAAA;AAGX,MAAI,aAAa,KAAK,oBAAoB;AAE1C,gBAAiB;;;;;;;;ACLjB,MAAI,aAAaA,mBAAA;AAGjB,MAAI,cAAc,WAAW;AAC3B,QAAI,MAAM,SAAS,KAAK,cAAc,WAAW,QAAQ,WAAW,KAAK,YAAY,EAAE;AACvF,WAAO,MAAO,mBAAmB,MAAO;AAAA,EAC1C;AASA,WAAS,SAAS,MAAM;AACtB,WAAO,CAA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16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143]}
|