@gen-epix/ui-phylogenetic-tree 2.1.0 → 2.2.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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/head.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/first.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_arrayMap.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_freeGlobal.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_root.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_Symbol.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_getRawTag.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_objectToString.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseGetTag.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isObject.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isFunction.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_coreJsData.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_isMasked.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_toSource.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseIsNative.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_getValue.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_getNative.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_nativeCreate.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashClear.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashDelete.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashGet.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashHas.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashSet.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_Hash.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheClear.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/eq.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_assocIndexOf.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheDelete.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheGet.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheHas.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheSet.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_ListCache.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_Map.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheClear.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_isKeyable.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_getMapData.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheDelete.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheGet.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheHas.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheSet.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_MapCache.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_setCacheAdd.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_setCacheHas.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_SetCache.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseFindIndex.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseIsNaN.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_strictIndexOf.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseIndexOf.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_arrayIncludes.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_arrayIncludesWith.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseUnary.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_cacheHas.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseIntersection.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_apply.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_overRest.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/constant.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_defineProperty.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseSetToString.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_shortOut.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_setToString.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseRest.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isLength.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isArrayLike.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isObjectLike.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isArrayLikeObject.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_castArrayLikeObject.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/intersection.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/last.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_trimmedEndIndex.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseTrim.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isSymbol.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/toNumber.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/toFinite.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/toInteger.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isArray.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseToString.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/toString.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_createRound.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/round.js","../../../src/utils/TreeUtil/TreeUtil.ts"],"sourcesContent":["/**\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 `_.map` for arrays without support for iteratee\n * 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 the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nmodule.exports = arrayMap;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var Symbol = require('./_Symbol');\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 * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\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 object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\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 {boolean} 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/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min;\n\n/**\n * The base implementation of methods like `_.intersection`, without support\n * for iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\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 shared values.\n */\nfunction baseIntersection(arrays, iteratee, comparator) {\n var includes = comparator ? arrayIncludesWith : arrayIncludes,\n length = arrays[0].length,\n othLength = arrays.length,\n othIndex = othLength,\n caches = Array(othLength),\n maxLength = Infinity,\n result = [];\n\n while (othIndex--) {\n var array = arrays[othIndex];\n if (othIndex && iteratee) {\n array = arrayMap(array, baseUnary(iteratee));\n }\n maxLength = nativeMin(array.length, maxLength);\n caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))\n ? new SetCache(othIndex && array)\n : undefined;\n }\n array = arrays[0];\n\n var index = -1,\n seen = caches[0];\n\n outer:\n while (++index < length && result.length < maxLength) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (!(seen\n ? cacheHas(seen, computed)\n : includes(result, computed, comparator)\n )) {\n othIndex = othLength;\n while (--othIndex) {\n var cache = caches[othIndex];\n if (!(cache\n ? cacheHas(cache, computed)\n : includes(arrays[othIndex], computed, comparator))\n ) {\n continue outer;\n }\n }\n if (seen) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n}\n\nmodule.exports = baseIntersection;\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","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"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 object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\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 isArrayLikeObject = require('./isArrayLikeObject');\n\n/**\n * Casts `value` to an empty array if it's not an array like object.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array|Object} Returns the cast array-like object.\n */\nfunction castArrayLikeObject(value) {\n return isArrayLikeObject(value) ? value : [];\n}\n\nmodule.exports = castArrayLikeObject;\n","var arrayMap = require('./_arrayMap'),\n baseIntersection = require('./_baseIntersection'),\n baseRest = require('./_baseRest'),\n castArrayLikeObject = require('./_castArrayLikeObject');\n\n/**\n * Creates an array of unique values that are included in all 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 * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersection([2, 1], [2, 3]);\n * // => [2]\n */\nvar intersection = baseRest(function(arrays) {\n var mapped = arrayMap(arrays, castArrayLikeObject);\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped)\n : [];\n});\n\nmodule.exports = intersection;\n","/**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\nfunction last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n}\n\nmodule.exports = last;\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nmodule.exports = trimmedEndIndex;\n","var trimmedEndIndex = require('./_trimmedEndIndex');\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nmodule.exports = baseTrim;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or 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 a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n","var baseTrim = require('./_baseTrim'),\n isObject = require('./isObject'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = toNumber;\n","var toNumber = require('./toNumber');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n MAX_INTEGER = 1.7976931348623157e+308;\n\n/**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\nfunction toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n}\n\nmodule.exports = toFinite;\n","var toFinite = require('./toFinite');\n\n/**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\nfunction toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n}\n\nmodule.exports = toInteger;\n","/**\n * Checks if `value` is classified as an `Array` 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 array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n","var Symbol = require('./_Symbol'),\n arrayMap = require('./_arrayMap'),\n isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = baseToString;\n","var baseToString = require('./_baseToString');\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\nmodule.exports = toString;\n","var root = require('./_root'),\n toInteger = require('./toInteger'),\n toNumber = require('./toNumber'),\n toString = require('./toString');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsFinite = root.isFinite,\n nativeMin = Math.min;\n\n/**\n * Creates a function like `_.round`.\n *\n * @private\n * @param {string} methodName The name of the `Math` method to use when rounding.\n * @returns {Function} Returns the new round function.\n */\nfunction createRound(methodName) {\n var func = Math[methodName];\n return function(number, precision) {\n number = toNumber(number);\n precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);\n if (precision && nativeIsFinite(number)) {\n // Shift with exponential notation to avoid floating-point issues.\n // See [MDN](https://mdn.io/round#Examples) for more details.\n var pair = (toString(number) + 'e').split('e'),\n value = func(pair[0] + 'e' + (+pair[1] + precision));\n\n pair = (toString(value) + 'e').split('e');\n return +(pair[0] + 'e' + (+pair[1] - precision));\n }\n return func(number);\n };\n}\n\nmodule.exports = createRound;\n","var createRound = require('./_createRound');\n\n/**\n * Computes `number` rounded to `precision`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Math\n * @param {number} number The number to round.\n * @param {number} [precision=0] The precision to round to.\n * @returns {number} Returns the rounded number.\n * @example\n *\n * _.round(4.006);\n * // => 4\n *\n * _.round(4.006, 2);\n * // => 4.01\n *\n * _.round(4060, -2);\n * // => 4100\n */\nvar round = createRound('round');\n\nmodule.exports = round;\n","import { Decimal } from 'decimal.js';\nimport first from 'lodash/first';\nimport intersection from 'lodash/intersection';\nimport last from 'lodash/last';\nimport round from 'lodash/round';\nimport { NumberUtil } from '@gen-epix/ui-core/utils/NumberUtil';\nimport { StringUtil } from '@gen-epix/ui-core/utils/StringUtil';\n\nimport type {\n TreeAssembly,\n TreeNode,\n TreePathProperties,\n} from '../../models/tree';\n\ntype NodeAssemblyResult = {\n nodeNames: string[];\n x: number;\n y: number;\n};\n\ntype SanitizeResult = { node: TreeNode; nodesToMove: TreeNode[] };\n\n// [number of lines to draw, genetic distance of single line, minGeneticScaleUnit]\ntype TickerMarkScale = [number, number, number];\n\ntype TreeAssemblyContext = {\n ancestorDotRadius: number;\n itemHeight: number;\n leafDotRadius: number;\n minimumDistancePercentageToShowLabel: number;\n pixelToGeneticDistanceRatio: number;\n rootNode: TreeNode;\n treeAssembly: TreeAssembly;\n treeCanvasWidth: number;\n treePadding: number;\n};\n\nexport class TreeUtil {\n /**\n * Traverses the tree and produces a {@link TreeAssembly} containing all\n * pre-computed `Path2D` shapes and metadata needed to render the tree.\n *\n * Leaf nodes are assembled in DFS order (incrementing `leafIndex`), which\n * determines their vertical position. Ancestor nodes are positioned vertically\n * at the midpoint of their first and last child.\n *\n * @param params.rootNode - The root of the tree to assemble.\n * @param params.treeCanvasWidth - Width of the tree canvas in pixels, used for support lines.\n * @param params.pixelToGeneticDistanceRatio - Pixels per unit of genetic distance.\n * @param params.itemHeight - Height of each row/item in pixels.\n * @param params.sortedLeafNames - Custom sorting order of leaf nodes by name, derived from ordering (e.g. table row order). Must contain all leaf node names.\n * @returns A fully populated {@link TreeAssembly} ready for rendering.\n */\n public static assembleTree(params: { ancestorDotRadius: number; itemHeight: number; leafDotRadius: number; minimumDistancePercentageToShowLabel: number; pixelToGeneticDistanceRatio: number; rootNode: TreeNode; sortedLeafNames: string[]; treeCanvasWidth: number; treePadding: number }): TreeAssembly {\n const { ancestorDotRadius, itemHeight, leafDotRadius, minimumDistancePercentageToShowLabel, pixelToGeneticDistanceRatio, rootNode, sortedLeafNames, treeCanvasWidth, treePadding } = params;\n let leafIndex = 0;\n const treeAssembly: TreeAssembly = {\n ancestorNodes: [],\n distanceTexts: [],\n horizontalAncestorTreeLines: [],\n horizontalLinePathPropertiesMap: new Map(),\n leafNodes: [],\n leafTreeLines: [],\n nodePathPropertiesMap: new Map(),\n supportLines: [],\n verticalAncestorTreeLines: [],\n verticalLinePathPropertiesMap: new Map(),\n };\n\n const treeAssemblyContext: TreeAssemblyContext = {\n ancestorDotRadius,\n itemHeight,\n leafDotRadius,\n minimumDistancePercentageToShowLabel,\n pixelToGeneticDistanceRatio,\n rootNode,\n treeAssembly,\n treeCanvasWidth,\n treePadding,\n };\n\n const traverseTree = (node: TreeNode, distance = 0): NodeAssemblyResult => {\n if (!node) {\n return;\n }\n const nodeRenderResults: NodeAssemblyResult[] = [];\n node.children?.forEach(child => {\n nodeRenderResults.push(traverseTree(child, distance + (node.branchLength?.toNumber() ?? 0)));\n });\n\n if (!node.children?.length) {\n const result = TreeUtil.assembleLeafNode(treeAssemblyContext, node, distance, leafIndex, sortedLeafNames.indexOf(node.name));\n leafIndex++;\n return result;\n }\n\n return TreeUtil.assembleAncestorNode(treeAssemblyContext, node, nodeRenderResults);\n };\n\n traverseTree(rootNode);\n\n return treeAssembly;\n }\n\n\n /**\n * Assigns a dot-notation address to every node in the tree, representing its\n * position in the hierarchy (e.g. `\"1.2.1\"`). Zero-branch-length children are\n * always placed at index `1`; other children are indexed starting at `1` or\n * `2` depending on whether a zero-branch sibling is present.\n *\n * @param rootNode - The root of the tree to address.\n * @returns A map from node name to its dot-notation address string.\n */\n public static createTreeAddresses(rootNode: TreeNode): { [key: string]: string } {\n const treeAddresses: { [key: string]: string } = {};\n const traverse = (node: TreeNode, address: number[] = []): TreeNode => {\n treeAddresses[node.name] = address.join('.');\n if (node.children?.length) {\n const hasZeroBranchLength = node.children.some(child => (child.branchLength?.toNumber() ?? 0) === 0);\n\n let index = hasZeroBranchLength ? 2 : 1;\n node.children.forEach((child) => {\n if ((child.branchLength?.toNumber() ?? 0) === 0) {\n traverse(child, [...address, 1]);\n } else {\n traverse(child, [...address, index]);\n index++;\n }\n });\n }\n return node;\n };\n traverse(rootNode);\n return treeAddresses;\n }\n\n /**\n * Draws a thin horizontal divider line across the full canvas width.\n *\n * Used to visually separate the scale header from the tree body.\n *\n * @param params.canvas - The canvas element to draw onto.\n * @param params.y - Vertical position of the divider in logical pixels.\n * @param params.devicePixelRatio - Screen DPR for correct positioning.\n */\n public static drawDivider(params: { canvas: HTMLCanvasElement; devicePixelRatio: number; y: number }): void {\n const { canvas, devicePixelRatio, y } = params;\n\n TreeUtil.draw(canvas, devicePixelRatio, (ctx) => {\n ctx.strokeStyle = '#EEEEEE';\n ctx.lineWidth = 1;\n ctx.beginPath();\n ctx.moveTo(0, y);\n ctx.lineTo(canvas.width, y);\n ctx.stroke();\n });\n }\n\n /**\n * Draws vertical dashed guide lines on the canvas at each tick mark position.\n *\n * @param params.canvas - The canvas element to draw onto.\n * @param params.tickerMarkScale - Scale tuple from {@link getTickMarkScale}.\n * @param params.geneticTreeWidth - Total genetic width of the tree.\n * @param params.pixelToGeneticDistanceRatio - Pixels per unit of genetic distance.\n * @param params.devicePixelRatio - Screen DPR.\n * @param params.startY - Top of the drawn range in logical pixels (default 0).\n * @param params.endY - Bottom of the drawn range in logical pixels (default canvas height).\n * @param params.zoomLevel - Current zoom level.\n * @param params.horizontalScrollPosition - Current horizontal scroll offset in pixels.\n * @param params.regularFillColorSupportLine - Color for the guide lines.\n */\n public static drawGuides(params: { canvas: HTMLCanvasElement; devicePixelRatio: number; endY?: number; geneticTreeWidth: Decimal; horizontalScrollPosition: number; paddingBottom?: number; paddingTop?: number; pixelToGeneticDistanceRatio: number; regularFillColorSupportLine: string; startY?: number; tickerMarkScale: TickerMarkScale; treePadding: number; zoomLevel: number }): void {\n const { canvas, devicePixelRatio, endY, geneticTreeWidth, horizontalScrollPosition = 0, paddingBottom = 0, paddingTop = 0, pixelToGeneticDistanceRatio, regularFillColorSupportLine, startY, tickerMarkScale, treePadding, zoomLevel } = params;\n const canvasHeight = canvas.clientHeight || canvas.height / devicePixelRatio;\n\n TreeUtil.draw(canvas, devicePixelRatio, (ctx) => {\n ctx.strokeStyle = regularFillColorSupportLine;\n ctx.setLineDash([3, 1]);\n TreeUtil.forEachScaleLine({\n callback: (x) => {\n // Draw the guide lines\n ctx.beginPath();\n ctx.moveTo(x, startY ?? paddingTop);\n ctx.lineTo(x, endY ?? (canvasHeight - paddingBottom));\n ctx.stroke();\n ctx.closePath();\n },\n devicePixelRatio,\n geneticTreeWidth,\n horizontalScrollPosition,\n pixelToGeneticDistanceRatio,\n tickerMarkScale,\n treePadding,\n zoomLevel,\n });\n ctx.setLineDash([0, 0]);\n });\n }\n\n /**\n * Draws the genetic distance scale labels onto the canvas header area.\n *\n * Labels are drawn in reverse order (right-to-left distance decreasing) so\n * the leftmost label shows the largest genetic distance.\n *\n * @param params.canvas - The canvas element to draw onto.\n * @param params.fontFamily - Font family for the scale labels.\n * @param params.scaleColor - Fill colour for the label text.\n * @param params.headerHeight - Height of the header area in logical pixels.\n * @param params.tickerMarkScale - Scale tuple from {@link getTickMarkScale}.\n * @param params.geneticTreeWidth - Total genetic width of the tree.\n * @param params.pixelToGeneticDistanceRatio - Pixels per unit of genetic distance.\n * @param params.zoomLevel - Current zoom level.\n * @param params.devicePixelRatio - Screen DPR.\n * @param params.horizontalScrollPosition - Current horizontal scroll offset in pixels.\n */\n public static drawScale(params: { canvas: HTMLCanvasElement; devicePixelRatio: number; fontFamily: string; geneticTreeWidth: Decimal; headerHeight: number; horizontalScrollPosition: number; pixelToGeneticDistanceRatio: number; scaleColor: string; tickerMarkScale: TickerMarkScale; treePadding: number; zoomLevel: number }): void {\n const { canvas, devicePixelRatio, fontFamily, geneticTreeWidth, headerHeight, horizontalScrollPosition = 0, pixelToGeneticDistanceRatio, scaleColor, tickerMarkScale, treePadding, zoomLevel } = params;\n TreeUtil.draw(canvas, devicePixelRatio, (ctx) => {\n ctx.fillStyle = scaleColor;\n TreeUtil.forEachScaleLine({\n callback: (x, i, numberOfLines) => {\n ctx.beginPath();\n ctx.textAlign = 'center';\n ctx.font = `bold 11px ${fontFamily}`;\n const label = new Decimal(tickerMarkScale[1]).times((numberOfLines - 1) - i).toNumber();\n ctx.fillText(NumberUtil.toStringWithPrecision(label, tickerMarkScale[2]), x, headerHeight * 0.61);\n ctx.closePath();\n },\n devicePixelRatio,\n geneticTreeWidth,\n horizontalScrollPosition,\n pixelToGeneticDistanceRatio,\n tickerMarkScale,\n treePadding,\n zoomLevel,\n });\n });\n }\n\n /**\n * Renders the pre-assembled tree shapes onto a canvas using the 2D context.\n *\n * Applies a transform for zoom and scroll, then draws in order:\n * vertical ancestor lines -> horizontal ancestor lines -> (linked) support lines\n * -> (highlighted) distance labels -> ancestor dots -> leaf branch lines -> leaf dots.\n *\n * When nodes are highlighted, non-highlighted shapes are dimmed via `dimFn`.\n * Leaf dot colours come from `nodeNameColors` when available.\n *\n * @param params.canvas - The canvas element to draw onto.\n * @param params.treeAssembly - Pre-computed tree shapes from {@link assembleTree}.\n * @param params.nodeNameColors - Colour mapping per node name for leaf dots.\n * @param params.treeColor - Base colour for tree lines and dots.\n * @param params.treeFont - CSS font string for distance labels.\n * @param params.dimFn - Returns a dimmed version of a colour for non-highlighted shapes.\n * @param params.supportLineColorLinked - Colour for support lines when linked.\n * @param params.supportLineColorUnlinked - Colour for support lines when unlinked.\n * @param params.zoomLevel - Current zoom level applied as a canvas transform.\n * @param params.highlightedNodeNames - Node names to highlight; all others are dimmed.\n * @param params.verticalScrollPosition - Vertical scroll offset in pixels.\n * @param params.horizontalScrollPosition - Horizontal scroll offset in pixels.\n * @param params.shouldShowDistances - Whether to render branch distance labels.\n * @param params.devicePixelRatio - Screen DPR for crisp rendering on HiDPI displays.\n * @param params.isLinked - Whether to draw the dashed support lines linking leaf nodes to the table.\n * @param params.shouldShowSupportLinesWhenUnlinked - Whether to render support lines when unlinked.\n */\n public static drawTree(params: {\n canvas: HTMLCanvasElement;\n devicePixelRatio: number;\n dimFn: (color: string) => string;\n headerHeight?: number;\n highlightedNodeNames: string[];\n horizontalScrollPosition: number;\n isLinked: boolean;\n itemHeight: number;\n nodeNameColors: { [key: string]: string } | null;\n range: { endIndex: number; startIndex: number };\n scrollPosition?: number;\n shouldShowDistances: boolean;\n shouldShowSupportLinesWhenUnlinked: boolean;\n supportLineColorLinked: string;\n supportLineColorUnlinked: string;\n treeAssembly: TreeAssembly;\n treeColor: string;\n treeFont: string;\n verticalScrollPosition: number;\n zoomLevel: number;\n }): void {\n const { canvas, devicePixelRatio, dimFn, headerHeight = 0, highlightedNodeNames = [], horizontalScrollPosition, isLinked, itemHeight, nodeNameColors, range, scrollPosition = 0, shouldShowDistances, shouldShowSupportLinesWhenUnlinked, supportLineColorLinked, supportLineColorUnlinked, treeAssembly, treeColor, treeFont, verticalScrollPosition, zoomLevel } = params;\n const ctx = TreeUtil.getCanvasContext(canvas);\n const bodyStartY = headerHeight * devicePixelRatio;\n const setRegularTransform = () => {\n ctx.setTransform(\n (1 / zoomLevel) * devicePixelRatio, // The scale factor(X direction)\n 0, // The skew factor (X-axis)\n 0, // The skew factor (Y-axis)\n (1 / zoomLevel) * devicePixelRatio, // The scale factor(Y direction)\n -horizontalScrollPosition + 0.5, // The translation (X direction)\n -verticalScrollPosition + (headerHeight * devicePixelRatio) + 0.5, // The translation (Y direction)\n );\n };\n const setTransFormForSupportLine = () => {\n ctx.setTransform(\n devicePixelRatio, // The scale factor(X direction)\n 0, // The skew factor (X-axis)\n 0, // The skew factor (Y-axis)\n devicePixelRatio, // The scale factor(Y direction)\n -horizontalScrollPosition + 0.5, // The translation (X direction)\n (headerHeight * devicePixelRatio) + 0.5, // The translation (Y direction)\n );\n };\n const drawTreeElements = () => {\n setRegularTransform();\n\n ctx.fillStyle = 'black';\n ctx.strokeStyle = 'black';\n ctx.textAlign = 'center';\n ctx.font = treeFont;\n ctx.lineWidth = 1;\n\n treeAssembly.verticalAncestorTreeLines.forEach(({ nodeNames, shape }) => {\n ctx.strokeStyle = TreeUtil.getFillStyle(treeColor, dimFn, highlightedNodeNames, nodeNames);\n ctx.stroke(shape);\n });\n treeAssembly.horizontalAncestorTreeLines.forEach(({ nodeNames, shape }) => {\n ctx.strokeStyle = TreeUtil.getFillStyle(treeColor, dimFn, highlightedNodeNames, nodeNames);\n ctx.stroke(shape);\n });\n\n if (range) {\n treeAssembly.supportLines.forEach(({ fromX, fromY, nodeName, toX, toY }) => {\n // a) leaf node is visible in the tree canvas viewport\n const canvasBodyHeight = canvas.height - bodyStartY;\n const leafScreenY = (fromY / zoomLevel) * devicePixelRatio - verticalScrollPosition;\n const isLeafVisible = leafScreenY >= 0 && leafScreenY <= canvasBodyHeight;\n\n // b) end position is within the range\n const sortingIndex = itemHeight > 0 ? Math.floor(toY / itemHeight) : -1;\n const isEndInRange = range &&\n sortingIndex >= range.startIndex &&\n sortingIndex <= range.endIndex;\n\n const isHighlighted = highlightedNodeNames.length && highlightedNodeNames.includes(nodeName);\n\n if (!isLeafVisible && !isEndInRange) {\n return;\n }\n\n if (!isHighlighted && !isLinked && !shouldShowSupportLinesWhenUnlinked) {\n return;\n }\n\n if (isLinked) {\n ctx.setLineDash([1, 4]);\n }\n ctx.beginPath();\n if (isLinked) {\n ctx.strokeStyle = TreeUtil.getFillStyle(supportLineColorLinked, dimFn, highlightedNodeNames, nodeName);\n } else {\n ctx.strokeStyle = TreeUtil.getFillStyle(supportLineColorUnlinked, dimFn, highlightedNodeNames, nodeName);\n }\n ctx.moveTo(fromX, fromY);\n setTransFormForSupportLine();\n ctx.lineTo(toX + (horizontalScrollPosition / devicePixelRatio), toY - scrollPosition);\n setRegularTransform();\n ctx.stroke();\n ctx.setLineDash([]);\n });\n }\n\n if (shouldShowDistances) {\n treeAssembly.distanceTexts.forEach(({ nodeNames, text, x, y }) => {\n const isHighlighted = highlightedNodeNames.length && intersection(nodeNames, highlightedNodeNames).length > 0;\n if (isHighlighted) {\n ctx.fillStyle = treeColor;\n ctx.fillText(text, x, y);\n }\n });\n }\n\n treeAssembly.ancestorNodes.forEach(({ nodeNames, shape }) => {\n ctx.fillStyle = TreeUtil.getFillStyle(treeColor, dimFn, highlightedNodeNames, nodeNames);\n ctx.fill(shape);\n });\n\n treeAssembly.leafTreeLines.forEach(({ nodeName, shape }) => {\n ctx.strokeStyle = TreeUtil.getFillStyle(treeColor, dimFn, highlightedNodeNames, nodeName);\n ctx.stroke(shape);\n });\n\n treeAssembly.leafNodes.forEach(({ nodeName, shape }) => {\n ctx.fillStyle = TreeUtil.getFillStyle(nodeNameColors?.[nodeName] ?? treeColor, dimFn, highlightedNodeNames, nodeName);\n ctx.fill(shape);\n });\n };\n\n if (headerHeight > 0) {\n ctx.save();\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.beginPath();\n ctx.rect(0, bodyStartY, canvas.width, Math.max(0, canvas.height - bodyStartY));\n ctx.clip();\n drawTreeElements();\n ctx.restore();\n setRegularTransform();\n return;\n }\n\n drawTreeElements();\n }\n\n /**\n * Fully redraws the tree canvas from scratch.\n *\n * Resets the canvas, resizes it to match its CSS layout size at the current\n * DPR, then sequentially calls {@link drawBackground}, {@link drawGuides},\n * {@link drawScale}, and {@link drawTree}.\n *\n * @param params.canvas - The canvas element to draw onto.\n * @param params.backgroundColor - Fill colour for the canvas background.\n * @param params.treeAssembly - Pre-computed tree shapes from {@link assembleTree}.\n * @param params.nodeNameColors - Colour mapping per node name for leaf dots.\n * @param params.treeColor - Base colour for tree lines and dots.\n * @param params.treeFont - CSS font string for distance labels.\n * @param params.dimFn - Returns a dimmed version of a colour for non-highlighted shapes.\n * @param params.fontFamily - Font family for scale labels.\n * @param params.scaleColor - Fill colour for scale label text.\n * @param params.supportLineColorLinked - Colour for support lines when linked.\n * @param params.supportLineColorUnlinked - Colour for support lines when unlinked.\n * @param params.regularFillColorSupportLine - Colour for the dashed guide lines.\n * @param params.zoomLevel - Current zoom level.\n * @param params.isLinked - Whether to draw dashed support lines.\n * @param params.highlightedNodeNames - Node names to highlight.\n * @param params.verticalScrollPosition - Vertical scroll offset in pixels.\n * @param params.horizontalScrollPosition - Horizontal scroll offset in pixels.\n * @param params.treeCanvasWidth - Logical canvas width in pixels.\n * @param params.treeCanvasHeight - Logical canvas height in pixels.\n * @param params.headerHeight - Height of the scale header area in logical pixels.\n * @param params.pixelToGeneticDistanceRatio - Pixels per unit of genetic distance.\n * @param params.tickerMarkScale - Scale tuple from {@link getTickMarkScale}.\n * @param params.shouldShowDistances - Whether to render branch labels.\n * @param params.shouldShowSupportLinesWhenUnlinked - Whether to render support lines when unlinked.\n * @param params.devicePixelRatio - Screen DPR for HiDPI rendering.\n * @param params.geneticTreeWidth - Total genetic width of the tree.\n */\n public static drawTreeCanvas(params: {\n backgroundColor: string;\n canvas: HTMLCanvasElement;\n devicePixelRatio: number;\n dimFn: (color: string) => string;\n fontFamily: string;\n geneticTreeWidth: Decimal;\n headerHeight?: number;\n highlightedNodeNames?: string[];\n horizontalScrollPosition: number;\n isLinked: boolean;\n itemHeight: number;\n nodeNameColors: { [key: string]: string } | null;\n pixelToGeneticDistanceRatio: number;\n range: { endIndex: number; startIndex: number };\n regularFillColorSupportLine: string;\n scaleColor: string;\n scrollPosition?: number;\n shouldShowDistances: boolean;\n shouldShowSupportLinesWhenUnlinked: boolean;\n supportLineColorLinked: string;\n supportLineColorUnlinked: string;\n tickerMarkScale: TickerMarkScale;\n treeAssembly: TreeAssembly;\n treeCanvasHeight: number;\n treeCanvasWidth: number;\n treeColor: string;\n treeFont: string;\n treePadding: number;\n verticalScrollPosition: number;\n zoomLevel: number;\n }): void {\n const { backgroundColor, canvas, devicePixelRatio, dimFn, fontFamily, geneticTreeWidth, headerHeight = 0, highlightedNodeNames, horizontalScrollPosition, isLinked, itemHeight, nodeNameColors, pixelToGeneticDistanceRatio, range, regularFillColorSupportLine, scaleColor, scrollPosition = 0, shouldShowDistances, shouldShowSupportLinesWhenUnlinked, supportLineColorLinked, supportLineColorUnlinked, tickerMarkScale, treeAssembly, treeCanvasHeight, treeCanvasWidth, treeColor, treeFont, treePadding, verticalScrollPosition, zoomLevel } = params;\n const ctx = TreeUtil.getCanvasContext(canvas);\n ctx.reset();\n canvas.width = canvas.clientWidth * devicePixelRatio;\n canvas.height = canvas.clientHeight * devicePixelRatio;\n ctx.imageSmoothingEnabled = zoomLevel > 1;\n ctx.imageSmoothingQuality = 'high';\n\n TreeUtil.drawBackground({ backgroundColor, canvas, devicePixelRatio, treeCanvasHeight: treeCanvasHeight + headerHeight, treeCanvasWidth });\n TreeUtil.drawGuides({ canvas, devicePixelRatio, endY: headerHeight + treeCanvasHeight, geneticTreeWidth, horizontalScrollPosition, pixelToGeneticDistanceRatio, regularFillColorSupportLine, startY: headerHeight, tickerMarkScale, treePadding, zoomLevel });\n\n if (headerHeight > 0) {\n TreeUtil.drawGuides({ canvas, devicePixelRatio, endY: headerHeight, geneticTreeWidth, horizontalScrollPosition, pixelToGeneticDistanceRatio, regularFillColorSupportLine, startY: headerHeight * 0.7, tickerMarkScale, treePadding, zoomLevel });\n TreeUtil.drawGuides({ canvas, devicePixelRatio, endY: headerHeight * 0.3, geneticTreeWidth, horizontalScrollPosition, pixelToGeneticDistanceRatio, regularFillColorSupportLine, startY: 0, tickerMarkScale, treePadding, zoomLevel });\n TreeUtil.drawScale({ canvas, devicePixelRatio, fontFamily, geneticTreeWidth, headerHeight, horizontalScrollPosition, pixelToGeneticDistanceRatio, scaleColor, tickerMarkScale, treePadding, zoomLevel });\n TreeUtil.drawDivider({ canvas, devicePixelRatio, y: 0 });\n TreeUtil.drawDivider({ canvas, devicePixelRatio, y: headerHeight - 1 });\n }\n\n TreeUtil.drawTree({ canvas, devicePixelRatio, dimFn, headerHeight, highlightedNodeNames, horizontalScrollPosition, isLinked, itemHeight, nodeNameColors, range, scrollPosition, shouldShowDistances, shouldShowSupportLinesWhenUnlinked, supportLineColorLinked, supportLineColorUnlinked, treeAssembly, treeColor, treeFont, verticalScrollPosition, zoomLevel });\n }\n\n /**\n * Finds and returns a new root node for re-rooting the tree.\n *\n * When `selector` is `'node'`, the node with the given name becomes the new root.\n * When `selector` is `'parent'`, the parent of the node with the given name is returned.\n *\n * The returned node has its `branchLength` reset to `0` and its `maxBranchLength`\n * adjusted by subtracting the original branch length, so the scale remains consistent.\n *\n * @param rootNode - The current root of the tree.\n * @param nodeName - Name of the node to search for.\n * @param selector - Whether to return the matching node itself (`'node'`) or its parent (`'parent'`).\n * @returns A shallow copy of the new root with adjusted branch length properties.\n */\n public static findNewTreeRoot(rootNode: TreeNode, nodeName: string, selector: 'node' | 'parent'): TreeNode {\n let newRoot: TreeNode;\n const findNewRoot = (node: TreeNode) => {\n if (newRoot) {\n return;\n }\n\n if (selector === 'node' && node.name === nodeName) {\n newRoot = node;\n }\n if (node.children) {\n const matchingChild = node.children.find(childNode => childNode.name === nodeName);\n if (selector === 'parent' && matchingChild) {\n newRoot = node;\n } else {\n node.children.forEach(childNode => findNewRoot(childNode));\n }\n }\n };\n findNewRoot(rootNode);\n return {\n ...newRoot,\n branchLength: new Decimal(0),\n maxBranchLength: newRoot.maxBranchLength.sub(newRoot.branchLength),\n };\n }\n\n /**\n * Finds the smallest non-zero branch length among all leaf nodes in the tree.\n *\n * This value is used as the minimum scale unit when computing tick mark\n * intervals, ensuring the scale never subdivides below a single measurable step.\n *\n * @param tree - The root node of the tree to inspect.\n * @returns The minimum positive branch length found on any leaf, or `Infinity`\n * if the tree is empty or all leaves have zero/undefined branch lengths.\n */\n public static getMinGeneticScaleUnit(tree: TreeNode): number {\n if (!tree) {\n return Infinity;\n }\n let min: number = Infinity;\n const traverse = (node: TreeNode) => {\n const branchLength = node.branchLength?.toNumber() ?? 0;\n if (!node.children?.length && branchLength && branchLength < min) {\n min = branchLength;\n }\n node?.children?.forEach(child => traverse(child));\n };\n traverse(tree);\n return min;\n }\n\n /**\n * Calculates the new scroll position after a zoom level change so that the\n * point under the cursor stays in the same visual position.\n *\n * @param params.eventOffset - Pixel offset of the zoom event (e.g. mouse position) within the canvas.\n * @param params.scrollPosition - Current scroll position before the zoom change.\n * @param params.dimensionSize - Full logical size of the scrollable dimension in pixels.\n * @param params.currentZoomLevel - The zoom level before the change.\n * @param params.newZoomLevel - The zoom level after the change.\n * @returns The adjusted scroll position that keeps the cursor-point visually stable.\n */\n public static getNewScrollPositionForZoomLevel(params: { currentZoomLevel: number; dimensionSize: number; eventOffset: number; newZoomLevel: number; scrollPosition: number }): number {\n const { currentZoomLevel, dimensionSize, eventOffset, newZoomLevel, scrollPosition } = params;\n\n const fullSizeTreePosition = ((eventOffset * devicePixelRatio) + scrollPosition) * currentZoomLevel;\n const currentSizeTreePosition = fullSizeTreePosition / (dimensionSize / (dimensionSize / currentZoomLevel));\n const newSizeTreePosition = fullSizeTreePosition / (dimensionSize / (dimensionSize / newZoomLevel));\n return scrollPosition - (currentSizeTreePosition - newSizeTreePosition);\n }\n\n /**\n * Performs a hit-test against the tree assembly's path maps to find the\n * tree node or line segment under the mouse cursor.\n *\n * Checks in priority order: node dots (via `isPointInPath`) -> horizontal\n * branch lines (with ±1 px vertical tolerance) -> vertical connector lines\n * (with ±1 px horizontal tolerance).\n *\n * @param params.canvas - The canvas element that received the mouse event.\n * @param params.event - The mouse event providing cursor coordinates.\n * @param params.treeAssembly - The assembly containing path maps to hit-test against.\n * @param params.devicePixelRatio - Screen DPR for correct coordinate scaling.\n * @returns The {@link TreePathProperties} of the hit shape, or `undefined` if nothing was hit.\n */\n public static getPathPropertiesFromCanvas(params: { canvas: HTMLCanvasElement; devicePixelRatio: number; event: MouseEvent; treeAssembly: TreeAssembly }): TreePathProperties {\n const { canvas, devicePixelRatio, event, treeAssembly } = params;\n\n const ctx = TreeUtil.getCanvasContext(canvas);\n const rect = (event.target as HTMLCanvasElement).getBoundingClientRect();\n const canvasX = (event.clientX - rect.left) * devicePixelRatio;\n const canvasY = (event.clientY - rect.top) * devicePixelRatio;\n\n for (const path of treeAssembly.nodePathPropertiesMap.keys()) {\n if (ctx.isPointInPath(path, canvasX, canvasY)) {\n return treeAssembly.nodePathPropertiesMap.get(path);\n }\n }\n\n // Allow for a 1px vertical margin around the mouse position to allow for easier clicking\n const canvasYs = [\n ((event.clientY - 1) - rect.top) * devicePixelRatio,\n canvasY,\n ((event.clientY + 1) - rect.top) * devicePixelRatio,\n ];\n\n for (const path of treeAssembly.horizontalLinePathPropertiesMap.keys()) {\n for (const y of canvasYs) {\n if (ctx.isPointInStroke(path, canvasX, y)) {\n return treeAssembly.horizontalLinePathPropertiesMap.get(path);\n }\n }\n }\n\n // Allow for a 1px horizontal margin around the mouse position to allow for easier clicking\n const canvasXs = [\n ((event.clientX - 1) - rect.left) * devicePixelRatio,\n canvasX,\n ((event.clientX + 1) - rect.left) * devicePixelRatio,\n ];\n for (const path of treeAssembly.verticalLinePathPropertiesMap.keys()) {\n for (const x of canvasXs) {\n if (ctx.isPointInStroke(path, x, canvasY)) {\n return treeAssembly.verticalLinePathPropertiesMap.get(path);\n }\n }\n }\n }\n\n /**\n * Clamps X and Y scroll positions to their valid ranges for the current\n * canvas dimensions, zoom level, and link state.\n *\n * When the tree is linked and at zoom level 1, y-scrolling is constrained\n * tightly to the tree's pixel height. When unlinked or zoomed, the bounds\n * include the full canvas extent to allow free panning.\n *\n * Also applies a device-pixel-ratio-dependent correction offset to prevent\n * subtle over-scroll artefacts at non-integer DPR values (e.g. browser zoom).\n *\n * @param params.positionX - Requested horizontal scroll position.\n * @param params.positionY - Requested vertical scroll position.\n * @param params.treeCanvasWidth - Logical canvas width in pixels.\n * @param params.treeCanvasHeight - Logical canvas height in pixels.\n * @param params.treeHeight - Total rendered height of the full tree in pixels.\n * @param params.devicePixelRatio - Current screen DPR.\n * @param params.internalZoomLevel - Internal zoom level of the tree canvas.\n * @param params.isLinked - Whether the tree is linked to the case list scroll position.\n * @returns Clamped `{ newPositionX, newPositionY }` values.\n */\n public static getSanitizedScrollPosition(params: { devicePixelRatio: number; headerHeight: number; internalZoomLevel: number; isLinked: boolean; positionX: number; positionY: number; treeCanvasHeight: number; treeCanvasWidth: number; treeHeight: number; treePadding: number }): { newPositionX: number; newPositionY: number } {\n const { devicePixelRatio, headerHeight, internalZoomLevel, isLinked, positionX, positionY, treeCanvasHeight, treeCanvasWidth, treeHeight, treePadding } = params;\n let positionYMax: number;\n let positionYMin: number;\n\n const relativeTreePadding = treePadding * devicePixelRatio;\n\n if (isLinked && internalZoomLevel === 1) {\n if (treeHeight < treeCanvasHeight) {\n positionYMin = 0;\n positionYMax = 0;\n } else {\n // some magic needs to be done here to prevent the tree from scrolling too far. I can't detect the exact reason, but it seems to be related to the devicePixelRatio\n // this only happens when you use the zoom functionality of the browser\n const roundedDevicePixelRatio = Math.round(devicePixelRatio * 100) / 100;\n const thresholds = [\n [1, 0],\n [1.1, 1],\n [1.25, 4],\n [1.5, 7],\n [1.75, 11],\n [2, 0],\n [2.2, 4],\n [2.5, 7],\n [3, 15],\n ];\n const divePixelRatioOffset = thresholds.find(([threshold]) => roundedDevicePixelRatio <= threshold)?.[1] ?? 0;\n\n positionYMin = 0;\n positionYMax = (treeHeight * devicePixelRatio) - ((treeCanvasHeight) * devicePixelRatio) - divePixelRatioOffset;\n }\n } else {\n positionYMin = (-treeCanvasHeight * devicePixelRatio) + relativeTreePadding + (headerHeight * devicePixelRatio);\n positionYMax = ((treeHeight / internalZoomLevel) * devicePixelRatio) - relativeTreePadding - (headerHeight * devicePixelRatio);\n }\n const newPositionY = Math.max(Math.min(positionYMax, positionY), positionYMin);\n\n const positionXMin = Math.min(0, -treeCanvasWidth + (2 * relativeTreePadding));\n const positionXMax = Math.max(0, ((treeCanvasWidth / internalZoomLevel) * devicePixelRatio) - (2 * relativeTreePadding));\n const newPositionX = Math.max(Math.min(positionXMax, positionX), positionXMin);\n\n return {\n newPositionX,\n newPositionY,\n };\n }\n\n /**\n * Calculates the vertical scroll position for a tree canvas based on the\n * currently visible rows in a linked table/list view.\n *\n * The goal is to keep the visible portion of the tree centered on the same\n * items that are currently visible in the linked view, accounting for zoom.\n *\n * @param kwArgs.treeCanvasHeight - Height of the visible tree canvas area in pixels.\n * @param kwArgs.treeHeight - Total rendered height of the full tree in pixels.\n * @param kwArgs.treeSize - Total number of leaf items (rows) in the tree.\n * @param kwArgs.verticalScrollPosition - Current vertical scroll position of the linked view in pixels.\n * @param kwArgs.zoomLevel - Current zoom level (>1 means zoomed out, items appear smaller).\n * @returns The new vertical scroll position for the tree canvas, clamped to [0, treeHeight - treeCanvasHeight].\n */\n public static getScrollPositionFromTreeVisibility(kwArgs: {\n itemHeight: number;\n treeCanvasHeight: number;\n treeHeight: number;\n treeSize: number;\n verticalScrollPosition: number;\n zoomLevel: number;\n }): number {\n const { itemHeight, treeCanvasHeight, treeHeight, treeSize, verticalScrollPosition, zoomLevel } = kwArgs;\n\n const scaledItemHeight = itemHeight / zoomLevel;\n const scrolledByItems = Math.round(verticalScrollPosition / scaledItemHeight);\n const maxItemsInView = Math.round(treeCanvasHeight / scaledItemHeight);\n\n const firstItemInView = Math.max(0, scrolledByItems);\n const lastItemInView = Math.min(scrolledByItems + maxItemsInView, treeSize);\n const averageItemInView = (firstItemInView + lastItemInView) / 2;\n\n const newScrollPosition = Math.max(0, Math.min(treeHeight - treeCanvasHeight, averageItemInView * itemHeight - treeCanvasHeight / 2));\n return newScrollPosition;\n }\n\n /**\n * Determines the optimal tick mark scale for the genetic distance axis.\n *\n * Selects the number of scale lines and the genetic distance represented by\n * each interval by searching for the combination with the least leftover\n * (i.e. the product of `numLines × increment` closest to `geneticTreeWidth`).\n * Increments are drawn from `SCALE_INCREMENTS` scaled by an order-of-magnitude\n * multiplier derived from `geneticTreeWidth`, and those smaller than\n * `minGeneticScaleUnit` are skipped.\n *\n * @param params.treeWidthMinusPadding - Width of the drawable canvas area in pixels (excluding padding).\n * @param params.geneticTreeWidth - Total genetic distance represented by the full tree width.\n * @param params.minGeneticScaleUnit - The smallest meaningful genetic distance unit (see {@link getMinGeneticScaleUnit}).\n * @param params.zoomLevel - Current zoom level; divides the effective pixel width.\n * @returns A {@link TickerMarkScale} tuple: `[numberOfLines, geneticDistancePerLine, minGeneticScaleUnit]`.\n * Returns `[0, 0, 0]` when any required input is falsy.\n */\n public static getTickMarkScale(params: { geneticTreeWidth: Decimal; maxScaleWidthPx: number; minGeneticScaleUnit: number; minScaleWidthPx: number; scaleIncrements: number[]; treeWidthMinusPadding: number; zoomLevel: number }): TickerMarkScale {\n const { geneticTreeWidth, maxScaleWidthPx, minGeneticScaleUnit, minScaleWidthPx, scaleIncrements, treeWidthMinusPadding, zoomLevel } = params;\n if (!treeWidthMinusPadding || !geneticTreeWidth || !minGeneticScaleUnit) {\n return [0, 0, 0];\n }\n const width = treeWidthMinusPadding / zoomLevel;\n\n let minNumLines = Math.floor(width / maxScaleWidthPx) + 1;\n let maxNumLines = Math.ceil(width / minScaleWidthPx) + 1;\n\n if (geneticTreeWidth.div(minGeneticScaleUnit).add(1).lessThan(maxNumLines)) {\n maxNumLines = Math.max(geneticTreeWidth.div(minGeneticScaleUnit).ceil().toNumber(), 2);\n }\n if (minNumLines > maxNumLines) {\n minNumLines = maxNumLines;\n }\n if (maxNumLines === 2) {\n return [2, minGeneticScaleUnit, minGeneticScaleUnit];\n }\n\n const geneticTreeWidthDecimal = new Decimal(geneticTreeWidth);\n const multiplier = new Decimal(10).pow(geneticTreeWidthDecimal.log(10).floor().minus(1));\n const multipliedIncrements = scaleIncrements.map(i => new Decimal(i).times(multiplier));\n\n let bestCombination: [Decimal, Decimal, Decimal] = [new Decimal(0), new Decimal(0), new Decimal(Infinity)];\n\n for (let numLines = minNumLines; numLines <= maxNumLines; numLines++) {\n for (const increment of multipliedIncrements) {\n if (increment.lt(minGeneticScaleUnit)) {\n continue;\n }\n const product = increment.times(numLines);\n const leftover = product.minus(geneticTreeWidthDecimal).abs();\n if (leftover.lt(bestCombination[2])) {\n bestCombination = [Decimal(numLines), increment, leftover];\n }\n }\n }\n\n return [bestCombination[0].add(1).toNumber(), bestCombination[1].toNumber(), minGeneticScaleUnit];\n }\n\n /**\n * Sanitizes the tree by collapsing intermediate ancestor nodes that have a\n * zero branch length, hoisting their children up to the parent level.\n *\n * This normalises Newick-parsed trees where polytomies or zero-distance\n * internal nodes would otherwise produce visually redundant branching points.\n *\n * @param rootNode - The root of the tree to sanitize. Mutated in place.\n * @returns The sanitized root node.\n */\n public static sanitizeTree(rootNode: TreeNode, fallbackDistance: number): TreeNode {\n const sanitize = (node: TreeNode): SanitizeResult => {\n const results: SanitizeResult[] = [];\n node.children?.forEach(child => {\n results.push(sanitize(child));\n });\n results.filter(x => !!x).forEach((result) => {\n node.children.splice(node.children.indexOf(result.node), result.node.children.length === result.nodesToMove.length ? 1 : 0, ...result.nodesToMove);\n node.subTreeNames.splice(node.subTreeNames.indexOf(result.node.name), result.node.children.length === result.nodesToMove.length ? 1 : 0, ...result.nodesToMove.map(n => n.subTreeNames).flat());\n });\n\n if (node.children?.length) {\n const nodesToMove: TreeNode[] = [];\n node.children.forEach(child => {\n if ((node.branchLength?.toNumber() ?? 0) === 0) {\n nodesToMove.push(child);\n }\n });\n return {\n node,\n nodesToMove,\n };\n }\n return null;\n };\n sanitize(rootNode);\n\n // Handle edge case: deeply nested zero-distance comb where all children end up with zero branch length\n const allChildrenHaveZeroBranchLength = rootNode.children?.every(child => (child.branchLength?.toNumber() ?? 0) === 0) ?? false;\n if (allChildrenHaveZeroBranchLength && rootNode.children?.length) {\n rootNode.name = `Generated-${StringUtil.createHash(rootNode.subTreeNames.join(','))}`;\n const newRootNode: TreeNode = {\n branchLength: new Decimal(fallbackDistance),\n children: [rootNode],\n maxBranchLength: new Decimal(fallbackDistance),\n name: 'root',\n size: rootNode.size,\n subTreeLeaveNames: rootNode.subTreeLeaveNames,\n subTreeNames: [rootNode.name, ...rootNode.subTreeNames],\n };\n return newRootNode;\n }\n\n return rootNode;\n }\n\n /**\n * Assembles the visual elements for an ancestor (internal) node and appends\n * them to the tree assembly.\n *\n * Produces: vertical connector lines from each child toward the ancestor's\n * Y midpoint (split into two sorted groups above and below center to allow\n * per-segment highlighting), a horizontal branch line, an optional distance\n * label, and a filled dot when all children have positive branch lengths.\n *\n * @param treeAssemblyContext - Shared context holding the assembly target and canvas dimensions.\n * @param node - The ancestor tree node to assemble.\n * @param childRenderResults - Assembly results returned by all direct children.\n * @returns The pixel coordinates of the branch start and aggregated case IDs, for use by the parent.\n */\n private static assembleAncestorNode(treeAssemblyContext: TreeAssemblyContext, node: TreeNode, childRenderResults: NodeAssemblyResult[]): NodeAssemblyResult {\n const firstChild = first(childRenderResults);\n const lastChild = last(childRenderResults);\n\n const ancestorXPxEnd = firstChild.x;\n const ancestorXPxDistance = (node.branchLength?.toNumber() ?? 0) * treeAssemblyContext.pixelToGeneticDistanceRatio;\n const ancestorXPxStart = ancestorXPxEnd - ancestorXPxDistance;\n const ancestorYPx = (firstChild.y + lastChild.y) / 2;\n const nodeNames = childRenderResults.map(r => r.nodeNames).flat();\n const label = TreeUtil.getDistanceLabel(treeAssemblyContext, node.branchLength);\n\n const centerToTopChildRenderResults = childRenderResults.filter(c => c.y < ancestorYPx).sort((a, b) => a.y - b.y);\n const centerToBottomChildRenderResults = childRenderResults.filter(c => c.y > ancestorYPx).sort((a, b) => b.y - a.y);\n\n [centerToTopChildRenderResults, centerToBottomChildRenderResults].forEach(sortedChildRenderResults => {\n const chunkNodeNames: string[] = [];\n\n sortedChildRenderResults.forEach((childRenderResult, index) => {\n const lineToYPx = index === sortedChildRenderResults.length - 1 ? ancestorYPx : sortedChildRenderResults[index + 1].y;\n chunkNodeNames.push(...childRenderResult.nodeNames);\n\n const chunkPath = new Path2D();\n chunkPath.moveTo(childRenderResult.x, childRenderResult.y);\n chunkPath.lineTo(childRenderResult.x, lineToYPx);\n chunkPath.closePath();\n treeAssemblyContext.treeAssembly.verticalAncestorTreeLines.push({ nodeNames: [...chunkNodeNames], shape: chunkPath });\n treeAssemblyContext.treeAssembly.verticalLinePathPropertiesMap.set(chunkPath, {\n subTreeLeaveNames: chunkNodeNames,\n });\n });\n });\n\n // add horizontal line according to distance\n const horizontalLineAccordingToDistancePath = new Path2D();\n horizontalLineAccordingToDistancePath.moveTo(ancestorXPxStart - 0.5, ancestorYPx);\n horizontalLineAccordingToDistancePath.lineTo(ancestorXPxEnd + 0.5, ancestorYPx);\n horizontalLineAccordingToDistancePath.closePath();\n treeAssemblyContext.treeAssembly.horizontalAncestorTreeLines.push({ nodeNames: [node.name, ...nodeNames], shape: horizontalLineAccordingToDistancePath });\n treeAssemblyContext.treeAssembly.horizontalLinePathPropertiesMap.set(horizontalLineAccordingToDistancePath, {\n subTreeLeaveNames: nodeNames,\n });\n\n // add distance text\n if (label) {\n treeAssemblyContext.treeAssembly.distanceTexts.push({ nodeNames: [node.name, ...nodeNames], text: label, x: (ancestorXPxStart + ancestorXPxEnd) / 2, y: ancestorYPx + 12 });\n }\n\n if (node.children.every(child => (child.branchLength?.toNumber() ?? 0) > 0)) {\n // add circle at beginning of the line representing the node itself\n const circlePath = new Path2D();\n circlePath.arc(ancestorXPxEnd, ancestorYPx, treeAssemblyContext.ancestorDotRadius, 0, 2 * Math.PI, false);\n treeAssemblyContext.treeAssembly.ancestorNodes.push({ nodeNames: [node.name, ...nodeNames], shape: circlePath });\n treeAssemblyContext.treeAssembly.nodePathPropertiesMap.set(circlePath, {\n subTreeLeaveNames: node.subTreeLeaveNames,\n treeNode: node,\n });\n }\n\n return {\n nodeNames,\n x: ancestorXPxStart,\n y: ancestorYPx,\n };\n }\n\n /**\n * Assembles the visual elements for a single leaf node and appends them to\n * the tree assembly.\n *\n * Produces: a horizontal branch line, an optional distance label, a dashed\n * support line extending to the canvas edge, and a filled dot.\n *\n * @param treeAssemblyContext - Shared context holding the assembly target and canvas dimensions.\n * @param node - The leaf tree node to assemble.\n * @param distance - Accumulated genetic distance from the root to the start of this node's branch.\n * @param leafIndex - Zero-based vertical index of this leaf, determining its Y position.\n * @param sortingIndex - Sorting index of this leaf derived from linked view order. Used to draw the support line.\n * @returns The pixel coordinates of the branch start and the node name, for use by the parent.\n */\n private static assembleLeafNode(treeAssemblyContext: TreeAssemblyContext, node: TreeNode, distance = 0, leafIndex = 0, sortingIndex = 0): NodeAssemblyResult {\n const leafX = distance + (node.branchLength?.toNumber() ?? 0);\n const leafXPxEnd = leafX * treeAssemblyContext.pixelToGeneticDistanceRatio + treeAssemblyContext.treePadding;\n const leafYPx = ((leafIndex) * treeAssemblyContext.itemHeight) + (treeAssemblyContext.itemHeight / 2);\n const leafXPxDistance = (node.branchLength?.toNumber() ?? 0) * treeAssemblyContext.pixelToGeneticDistanceRatio;\n const leafXPxStart = leafXPxEnd - leafXPxDistance;\n const label = TreeUtil.getDistanceLabel(treeAssemblyContext, node.branchLength);\n\n // add horizontal line according to distance\n const horizontalLineAccordingToDistancePath = new Path2D();\n horizontalLineAccordingToDistancePath.moveTo(leafXPxStart - 0.5, leafYPx);\n horizontalLineAccordingToDistancePath.lineTo(leafXPxEnd, leafYPx);\n horizontalLineAccordingToDistancePath.closePath();\n treeAssemblyContext.treeAssembly.leafTreeLines.push({ nodeName: node.name, shape: horizontalLineAccordingToDistancePath });\n treeAssemblyContext.treeAssembly.horizontalLinePathPropertiesMap.set(horizontalLineAccordingToDistancePath, {\n subTreeLeaveNames: node.subTreeLeaveNames,\n });\n\n // add distance text\n if (label) {\n treeAssemblyContext.treeAssembly.distanceTexts.push({ nodeNames: [node.name], text: label, x: (leafXPxStart + leafXPxEnd) / 2, y: leafYPx + 12 });\n }\n // add horizontal support line to max width\n const supportLineToYpx = sortingIndex * treeAssemblyContext.itemHeight + (treeAssemblyContext.itemHeight / 2);\n treeAssemblyContext.treeAssembly.supportLines.push({ fromX: leafXPxEnd, fromY: leafYPx, nodeName: node.name, toX: treeAssemblyContext.treeCanvasWidth, toY: supportLineToYpx });\n\n // add a dot to represent the node\n const circlePath = new Path2D();\n circlePath.arc(leafXPxEnd, leafYPx, treeAssemblyContext.leafDotRadius, 0, 2 * Math.PI, false);\n circlePath.closePath();\n\n treeAssemblyContext.treeAssembly.nodePathPropertiesMap.set(circlePath, {\n subTreeLeaveNames: node.subTreeLeaveNames,\n treeNode: node,\n });\n treeAssemblyContext.treeAssembly.leafNodes.push({ nodeName: node.name, shape: circlePath });\n\n return {\n nodeNames: [node.name],\n x: leafXPxStart,\n y: leafYPx,\n };\n }\n\n /**\n * Helper that wraps a canvas drawing callback with a DPR-aware scale/translate\n * transform, then restores the context to its pre-call state.\n *\n * @param canvas - The canvas element whose 2D context to use.\n * @param devicePixelRatio - Screen DPR to scale up for HiDPI rendering.\n * @param callback - Drawing operations to perform inside the transform.\n */\n private static draw(canvas: HTMLCanvasElement, devicePixelRatio: number, callback: (ctx: CanvasRenderingContext2D) => void): void {\n const ctx = TreeUtil.getCanvasContext(canvas);\n ctx.scale(devicePixelRatio, devicePixelRatio);\n ctx.translate(0.5, 0.5);\n callback(ctx);\n ctx.translate(-0.5, -0.5);\n ctx.scale(1 / devicePixelRatio, 1 / devicePixelRatio);\n }\n\n /**\n * Fills the tree canvas background with the theme's paper colour.\n *\n * @param params.canvas - The canvas element to draw onto.\n * @param params.theme - MUI theme providing the background colour.\n * @param params.treeCanvasWidth - Width of the area to fill in pixels.\n * @param params.treeCanvasHeight - Height of the area to fill in pixels.\n * @param params.devicePixelRatio - Screen DPR for HiDPI rendering.\n */\n private static drawBackground(params: { backgroundColor: string; canvas: HTMLCanvasElement; devicePixelRatio: number; treeCanvasHeight: number; treeCanvasWidth: number }): void {\n const { backgroundColor, canvas, devicePixelRatio, treeCanvasHeight, treeCanvasWidth } = params;\n TreeUtil.draw(canvas, devicePixelRatio, (ctx) => {\n ctx.fillStyle = backgroundColor;\n ctx.fillRect(0, 0, treeCanvasWidth, treeCanvasHeight);\n });\n }\n\n\n /**\n * Iterates over each scale line position and invokes a callback with its\n * canvas X coordinate.\n *\n * Computes the pixel offset for each tick so that the rightmost line aligns\n * with the genetic tree width, accounting for the current scroll and zoom.\n *\n * @param params.tickerMarkScale - Scale tuple from {@link getTickMarkScale}.\n * @param params.geneticTreeWidth - Total genetic width of the tree.\n * @param params.pixelToGeneticDistanceRatio - Pixels per unit of genetic distance.\n * @param params.zoomLevel - Current zoom level.\n * @param params.devicePixelRatio - Screen DPR.\n * @param params.horizontalScrollPosition - Current horizontal scroll offset in pixels (default 0).\n * @param params.callback - Called for each line with `(x, index, numberOfLines)`.\n */\n private static forEachScaleLine(params: { callback: (x: number, i: number, numberOfLines: number) => void; devicePixelRatio: number; geneticTreeWidth: Decimal; horizontalScrollPosition?: number; pixelToGeneticDistanceRatio: number; tickerMarkScale: TickerMarkScale; treePadding: number; zoomLevel: number }): void {\n const { callback, devicePixelRatio, geneticTreeWidth, horizontalScrollPosition = 0, pixelToGeneticDistanceRatio, tickerMarkScale, treePadding, zoomLevel } = params;\n\n const numberOfLines = tickerMarkScale[0];\n const tickerGeneticWidth = tickerMarkScale[1];\n const tickerWidth = new Decimal(tickerGeneticWidth).times(pixelToGeneticDistanceRatio).div(zoomLevel);\n const totalTickerWidth = tickerWidth.times(numberOfLines - 1);\n const geneticTreeWidthPx = geneticTreeWidth.times(pixelToGeneticDistanceRatio).div(zoomLevel);\n const offset = totalTickerWidth.minus(geneticTreeWidthPx);\n\n for (let i = 0; i < numberOfLines; i++) {\n const x = new Decimal(i).times(tickerWidth).plus(new Decimal(treePadding).div(zoomLevel)).minus(offset).minus(new Decimal(horizontalScrollPosition).div(devicePixelRatio)).toNumber();\n callback(x, i, numberOfLines);\n }\n }\n\n private static getCanvasContext(canvas: HTMLCanvasElement): CanvasRenderingContext2D {\n const ctx = canvas.getContext('2d');\n if (!ctx) {\n throw new Error('Failed to acquire 2D canvas context.');\n }\n return ctx;\n }\n\n /**\n * Returns a formatted distance label string for a branch, or `null` if the\n * label should be suppressed.\n *\n * A label is suppressed when:\n * - The tree has no maximum branch length, or it is zero.\n * - The branch length is zero or undefined.\n * - The branch is shorter than `MINIMUM_DISTANCE_PERCENTAGE_TO_SHOW_LABEL`\n * percent of the maximum branch length in the tree.\n *\n * Precision is derived from the magnitude of `maxBranchLength` to avoid\n * excessive decimal places for large values.\n *\n * @param treeAssemblyContext - Context containing the root node (for `maxBranchLength`).\n * @param branchLength - The genetic distance of the branch to label.\n * @returns A rounded numeric string, or `null` if the label should be hidden.\n */\n private static getDistanceLabel(treeAssemblyContext: TreeAssemblyContext, branchLength: Decimal): string {\n const labelPrecision = treeAssemblyContext.rootNode.maxBranchLength ? Math.max(1, 4 - String(Math.round(treeAssemblyContext.rootNode.maxBranchLength.toNumber())).length) : null;\n if (!treeAssemblyContext.rootNode.maxBranchLength || treeAssemblyContext.rootNode.maxBranchLength.toNumber() === 0 || !branchLength || branchLength.toNumber() === 0) {\n return null;\n }\n if (branchLength.div(treeAssemblyContext.rootNode.maxBranchLength).mul(100).lessThan(treeAssemblyContext.minimumDistancePercentageToShowLabel)) {\n return null;\n }\n return String(round(branchLength.toNumber(), labelPrecision));\n }\n\n /**\n * Returns the fill/stroke colour for a shape, dimming it when highlighted\n * nodes are active and the shape is not among them.\n *\n * @param color - The full-brightness colour to use when highlighted or no highlight is active.\n * @param dimFn - A function that returns a dimmed version of the colour.\n * @param highlightedNodeNames - The currently highlighted node names.\n * @param nodeNames - The node name(s) associated with the shape being drawn.\n * @returns The resolved colour string.\n */\n private static getFillStyle(color: string, dimFn: (color: string) => string, highlightedNodeNames: string[], nodeNames: string | string[]): string {\n if (highlightedNodeNames.length) {\n let isHighlighted: boolean;\n if (Array.isArray(nodeNames)) {\n isHighlighted = intersection(nodeNames, highlightedNodeNames).length > 0;\n } else {\n isHighlighted = highlightedNodeNames.includes(nodeNames);\n }\n if (isHighlighted) {\n return color;\n }\n return dimFn(color);\n }\n return color;\n }\n}\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,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],"mappings":";;;;;CAkBA,SAAS,EAAK,GAAO;EACnB,OAAQ,KAAS,EAAM,SAAU,EAAM,KAAK,KAAA;CAC9C;CAEA,EAAO,UAAU;;CCtBjB,EAAO,UAAA,EAAA;;CCSP,SAAS,EAAS,GAAO,GAAU;EAKjC,KAJA,IAAI,IAAQ,IACR,IAAS,KAAS,OAAO,IAAI,EAAM,QACnC,IAAS,MAAM,CAAM,GAElB,EAAE,IAAQ,IACf,EAAO,KAAS,EAAS,EAAM,IAAQ,GAAO,CAAK;EAErD,OAAO;CACT;CAEA,EAAO,UAAU;;CCjBjB,EAAO,UAFU,OAAO,UAAU,YAAY,UAAU,OAAO,WAAW,UAAU;;CCDpF,IAAI,IAAA,EAAA,GAGA,IAAW,OAAO,QAAQ,YAAY,QAAQ,KAAK,WAAW,UAAU;CAK5E,EAAO,UAFI,KAAc,KAAY,SAAS,aAAa,CAAC,CAAC;;CCD7D,EAAO,UAFH,EAAA,CAAA,CAAc;;CCHlB,IAAI,IAAA,EAAA,GAGA,IAAc,OAAO,WAGrB,IAAiB,EAAY,gBAO7B,IAAuB,EAA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Q;GAC/B,IAAI;GASJ,OARA,AAGE,IAHE,MAAM,QAAQ,CAAS,KACzB,GAAA,EAAA,QAAA,CAA6B,GAAW,CAAoB,CAAC,CAAC,SAAS,IAEvD,EAAqB,SAAS,CAAS,GAErD,IACK,IAEF,EAAM,CAAK;EACpB;EACA,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/head.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/first.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_arrayMap.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_freeGlobal.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_root.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_Symbol.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_getRawTag.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_objectToString.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseGetTag.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isObject.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isFunction.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_coreJsData.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_isMasked.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_toSource.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseIsNative.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_getValue.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_getNative.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_nativeCreate.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashClear.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashDelete.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashGet.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashHas.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashSet.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_Hash.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheClear.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/eq.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_assocIndexOf.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheDelete.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheGet.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheHas.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheSet.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_ListCache.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_Map.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheClear.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_isKeyable.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_getMapData.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheDelete.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheGet.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheHas.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheSet.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_MapCache.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_setCacheAdd.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_setCacheHas.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_SetCache.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseFindIndex.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseIsNaN.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_strictIndexOf.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseIndexOf.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_arrayIncludes.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_arrayIncludesWith.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseUnary.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_cacheHas.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseIntersection.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_apply.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_overRest.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/constant.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_defineProperty.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseSetToString.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_shortOut.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_setToString.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseRest.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isLength.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isArrayLike.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isObjectLike.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isArrayLikeObject.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_castArrayLikeObject.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/intersection.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/last.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_trimmedEndIndex.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseTrim.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isSymbol.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/toNumber.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/toFinite.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/toInteger.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isArray.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseToString.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/toString.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_createRound.js","../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/round.js","../../../src/utils/TreeUtil/TreeUtil.ts"],"sourcesContent":["/**\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 `_.map` for arrays without support for iteratee\n * 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 the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nmodule.exports = arrayMap;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var Symbol = require('./_Symbol');\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 * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\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 object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\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 {boolean} 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/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min;\n\n/**\n * The base implementation of methods like `_.intersection`, without support\n * for iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\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 shared values.\n */\nfunction baseIntersection(arrays, iteratee, comparator) {\n var includes = comparator ? arrayIncludesWith : arrayIncludes,\n length = arrays[0].length,\n othLength = arrays.length,\n othIndex = othLength,\n caches = Array(othLength),\n maxLength = Infinity,\n result = [];\n\n while (othIndex--) {\n var array = arrays[othIndex];\n if (othIndex && iteratee) {\n array = arrayMap(array, baseUnary(iteratee));\n }\n maxLength = nativeMin(array.length, maxLength);\n caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))\n ? new SetCache(othIndex && array)\n : undefined;\n }\n array = arrays[0];\n\n var index = -1,\n seen = caches[0];\n\n outer:\n while (++index < length && result.length < maxLength) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (!(seen\n ? cacheHas(seen, computed)\n : includes(result, computed, comparator)\n )) {\n othIndex = othLength;\n while (--othIndex) {\n var cache = caches[othIndex];\n if (!(cache\n ? cacheHas(cache, computed)\n : includes(arrays[othIndex], computed, comparator))\n ) {\n continue outer;\n }\n }\n if (seen) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n}\n\nmodule.exports = baseIntersection;\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","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"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 object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\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 isArrayLikeObject = require('./isArrayLikeObject');\n\n/**\n * Casts `value` to an empty array if it's not an array like object.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array|Object} Returns the cast array-like object.\n */\nfunction castArrayLikeObject(value) {\n return isArrayLikeObject(value) ? value : [];\n}\n\nmodule.exports = castArrayLikeObject;\n","var arrayMap = require('./_arrayMap'),\n baseIntersection = require('./_baseIntersection'),\n baseRest = require('./_baseRest'),\n castArrayLikeObject = require('./_castArrayLikeObject');\n\n/**\n * Creates an array of unique values that are included in all 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 * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersection([2, 1], [2, 3]);\n * // => [2]\n */\nvar intersection = baseRest(function(arrays) {\n var mapped = arrayMap(arrays, castArrayLikeObject);\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped)\n : [];\n});\n\nmodule.exports = intersection;\n","/**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\nfunction last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n}\n\nmodule.exports = last;\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nmodule.exports = trimmedEndIndex;\n","var trimmedEndIndex = require('./_trimmedEndIndex');\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nmodule.exports = baseTrim;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or 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 a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n","var baseTrim = require('./_baseTrim'),\n isObject = require('./isObject'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = toNumber;\n","var toNumber = require('./toNumber');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n MAX_INTEGER = 1.7976931348623157e+308;\n\n/**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\nfunction toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n}\n\nmodule.exports = toFinite;\n","var toFinite = require('./toFinite');\n\n/**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\nfunction toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n}\n\nmodule.exports = toInteger;\n","/**\n * Checks if `value` is classified as an `Array` 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 array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n","var Symbol = require('./_Symbol'),\n arrayMap = require('./_arrayMap'),\n isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = baseToString;\n","var baseToString = require('./_baseToString');\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\nmodule.exports = toString;\n","var root = require('./_root'),\n toInteger = require('./toInteger'),\n toNumber = require('./toNumber'),\n toString = require('./toString');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsFinite = root.isFinite,\n nativeMin = Math.min;\n\n/**\n * Creates a function like `_.round`.\n *\n * @private\n * @param {string} methodName The name of the `Math` method to use when rounding.\n * @returns {Function} Returns the new round function.\n */\nfunction createRound(methodName) {\n var func = Math[methodName];\n return function(number, precision) {\n number = toNumber(number);\n precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);\n if (precision && nativeIsFinite(number)) {\n // Shift with exponential notation to avoid floating-point issues.\n // See [MDN](https://mdn.io/round#Examples) for more details.\n var pair = (toString(number) + 'e').split('e'),\n value = func(pair[0] + 'e' + (+pair[1] + precision));\n\n pair = (toString(value) + 'e').split('e');\n return +(pair[0] + 'e' + (+pair[1] - precision));\n }\n return func(number);\n };\n}\n\nmodule.exports = createRound;\n","var createRound = require('./_createRound');\n\n/**\n * Computes `number` rounded to `precision`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Math\n * @param {number} number The number to round.\n * @param {number} [precision=0] The precision to round to.\n * @returns {number} Returns the rounded number.\n * @example\n *\n * _.round(4.006);\n * // => 4\n *\n * _.round(4.006, 2);\n * // => 4.01\n *\n * _.round(4060, -2);\n * // => 4100\n */\nvar round = createRound('round');\n\nmodule.exports = round;\n","import { Decimal } from 'decimal.js';\nimport first from 'lodash/first';\nimport intersection from 'lodash/intersection';\nimport last from 'lodash/last';\nimport round from 'lodash/round';\nimport { NumberUtil } from '@gen-epix/ui-core/utils/NumberUtil';\nimport { StringUtil } from '@gen-epix/ui-core/utils/StringUtil';\n\nimport type {\n TreeAssembly,\n TreeNode,\n TreePathProperties,\n} from '../../models/tree';\n\ntype NodeAssemblyResult = {\n nodeNames: string[];\n x: number;\n y: number;\n};\n\ntype SanitizeResult = { node: TreeNode; nodesToMove: TreeNode[] };\n\n// [number of lines to draw, genetic distance of single line, minGeneticScaleUnit]\ntype TickerMarkScale = [number, number, number];\n\ntype TreeAssemblyContext = {\n ancestorDotRadius: number;\n itemHeight: number;\n leafDotRadius: number;\n minimumDistancePercentageToShowLabel: number;\n pixelToGeneticDistanceRatio: number;\n rootNode: TreeNode;\n treeAssembly: TreeAssembly;\n treeCanvasWidth: number;\n treePadding: number;\n};\n\nexport class TreeUtil {\n /**\n * Traverses the tree and produces a {@link TreeAssembly} containing all\n * pre-computed `Path2D` shapes and metadata needed to render the tree.\n *\n * Leaf nodes are assembled in DFS order (incrementing `leafIndex`), which\n * determines their vertical position. Ancestor nodes are positioned vertically\n * at the midpoint of their first and last child.\n *\n * @param params.rootNode - The root of the tree to assemble.\n * @param params.treeCanvasWidth - Width of the tree canvas in pixels, used for support lines.\n * @param params.pixelToGeneticDistanceRatio - Pixels per unit of genetic distance.\n * @param params.itemHeight - Height of each row/item in pixels.\n * @param params.sortedLeafNames - Custom sorting order of leaf nodes by name, derived from ordering (e.g. table row order). Must contain all leaf node names.\n * @returns A fully populated {@link TreeAssembly} ready for rendering.\n */\n public static assembleTree(params: { ancestorDotRadius: number; itemHeight: number; leafDotRadius: number; minimumDistancePercentageToShowLabel: number; pixelToGeneticDistanceRatio: number; rootNode: TreeNode; sortedLeafNames: string[]; treeCanvasWidth: number; treePadding: number }): TreeAssembly {\n const { ancestorDotRadius, itemHeight, leafDotRadius, minimumDistancePercentageToShowLabel, pixelToGeneticDistanceRatio, rootNode, sortedLeafNames, treeCanvasWidth, treePadding } = params;\n let leafIndex = 0;\n const treeAssembly: TreeAssembly = {\n ancestorNodes: [],\n distanceTexts: [],\n horizontalAncestorTreeLines: [],\n horizontalLinePathPropertiesMap: new Map(),\n leafNodes: [],\n leafTreeLines: [],\n nodePathPropertiesMap: new Map(),\n supportLines: [],\n verticalAncestorTreeLines: [],\n verticalLinePathPropertiesMap: new Map(),\n };\n\n const treeAssemblyContext: TreeAssemblyContext = {\n ancestorDotRadius,\n itemHeight,\n leafDotRadius,\n minimumDistancePercentageToShowLabel,\n pixelToGeneticDistanceRatio,\n rootNode,\n treeAssembly,\n treeCanvasWidth,\n treePadding,\n };\n\n const traverseTree = (node: TreeNode, distance = 0): NodeAssemblyResult => {\n if (!node) {\n return;\n }\n const nodeRenderResults: NodeAssemblyResult[] = [];\n node.children?.forEach(child => {\n nodeRenderResults.push(traverseTree(child, distance + (node.branchLength?.toNumber() ?? 0)));\n });\n\n if (!node.children?.length) {\n const result = TreeUtil.assembleLeafNode(treeAssemblyContext, node, distance, leafIndex, sortedLeafNames.indexOf(node.name));\n leafIndex++;\n return result;\n }\n\n return TreeUtil.assembleAncestorNode(treeAssemblyContext, node, nodeRenderResults);\n };\n\n traverseTree(rootNode);\n\n return treeAssembly;\n }\n\n\n /**\n * Assigns a dot-notation address to every node in the tree, representing its\n * position in the hierarchy (e.g. `\"1.2.1\"`). Zero-branch-length children are\n * always placed at index `1`; other children are indexed starting at `1` or\n * `2` depending on whether a zero-branch sibling is present.\n *\n * @param rootNode - The root of the tree to address.\n * @returns A map from node name to its dot-notation address string.\n */\n public static createTreeAddresses(rootNode: TreeNode): { [key: string]: string } {\n const treeAddresses: { [key: string]: string } = {};\n const traverse = (node: TreeNode, address: number[] = []): TreeNode => {\n treeAddresses[node.name] = address.join('.');\n if (node.children?.length) {\n const hasZeroBranchLength = node.children.some(child => (child.branchLength?.toNumber() ?? 0) === 0);\n\n let index = hasZeroBranchLength ? 2 : 1;\n node.children.forEach((child) => {\n if ((child.branchLength?.toNumber() ?? 0) === 0) {\n traverse(child, [...address, 1]);\n } else {\n traverse(child, [...address, index]);\n index++;\n }\n });\n }\n return node;\n };\n traverse(rootNode);\n return treeAddresses;\n }\n\n /**\n * Draws a thin horizontal divider line across the full canvas width.\n *\n * Used to visually separate the scale header from the tree body.\n *\n * @param params.canvas - The canvas element to draw onto.\n * @param params.y - Vertical position of the divider in logical pixels.\n * @param params.devicePixelRatio - Screen DPR for correct positioning.\n */\n public static drawDivider(params: { canvas: HTMLCanvasElement; devicePixelRatio: number; y: number }): void {\n const { canvas, devicePixelRatio, y } = params;\n\n TreeUtil.draw(canvas, devicePixelRatio, (ctx) => {\n ctx.strokeStyle = '#EEEEEE';\n ctx.lineWidth = 1;\n ctx.beginPath();\n ctx.moveTo(0, y);\n ctx.lineTo(canvas.width, y);\n ctx.stroke();\n });\n }\n\n /**\n * Draws vertical dashed guide lines on the canvas at each tick mark position.\n *\n * @param params.canvas - The canvas element to draw onto.\n * @param params.tickerMarkScale - Scale tuple from {@link getTickMarkScale}.\n * @param params.geneticTreeWidth - Total genetic width of the tree.\n * @param params.pixelToGeneticDistanceRatio - Pixels per unit of genetic distance.\n * @param params.devicePixelRatio - Screen DPR.\n * @param params.startY - Top of the drawn range in logical pixels (default 0).\n * @param params.endY - Bottom of the drawn range in logical pixels (default canvas height).\n * @param params.zoomLevel - Current zoom level.\n * @param params.horizontalScrollPosition - Current horizontal scroll offset in pixels.\n * @param params.regularFillColorSupportLine - Color for the guide lines.\n */\n public static drawGuides(params: { canvas: HTMLCanvasElement; devicePixelRatio: number; endY?: number; geneticTreeWidth: Decimal; horizontalScrollPosition: number; paddingBottom?: number; paddingTop?: number; pixelToGeneticDistanceRatio: number; regularFillColorSupportLine: string; startY?: number; tickerMarkScale: TickerMarkScale; treePadding: number; zoomLevel: number }): void {\n const { canvas, devicePixelRatio, endY, geneticTreeWidth, horizontalScrollPosition = 0, paddingBottom = 0, paddingTop = 0, pixelToGeneticDistanceRatio, regularFillColorSupportLine, startY, tickerMarkScale, treePadding, zoomLevel } = params;\n const canvasHeight = canvas.clientHeight || canvas.height / devicePixelRatio;\n\n TreeUtil.draw(canvas, devicePixelRatio, (ctx) => {\n ctx.strokeStyle = regularFillColorSupportLine;\n ctx.setLineDash([3, 1]);\n TreeUtil.forEachScaleLine({\n callback: (x) => {\n // Draw the guide lines\n ctx.beginPath();\n ctx.moveTo(x, startY ?? paddingTop);\n ctx.lineTo(x, endY ?? (canvasHeight - paddingBottom));\n ctx.stroke();\n ctx.closePath();\n },\n devicePixelRatio,\n geneticTreeWidth,\n horizontalScrollPosition,\n pixelToGeneticDistanceRatio,\n tickerMarkScale,\n treePadding,\n zoomLevel,\n });\n ctx.setLineDash([0, 0]);\n });\n }\n\n /**\n * Draws the genetic distance scale labels onto the canvas header area.\n *\n * Labels are drawn in reverse order (right-to-left distance decreasing) so\n * the leftmost label shows the largest genetic distance.\n *\n * @param params.canvas - The canvas element to draw onto.\n * @param params.fontFamily - Font family for the scale labels.\n * @param params.scaleColor - Fill colour for the label text.\n * @param params.headerHeight - Height of the header area in logical pixels.\n * @param params.tickerMarkScale - Scale tuple from {@link getTickMarkScale}.\n * @param params.geneticTreeWidth - Total genetic width of the tree.\n * @param params.pixelToGeneticDistanceRatio - Pixels per unit of genetic distance.\n * @param params.zoomLevel - Current zoom level.\n * @param params.devicePixelRatio - Screen DPR.\n * @param params.horizontalScrollPosition - Current horizontal scroll offset in pixels.\n */\n public static drawScale(params: { canvas: HTMLCanvasElement; devicePixelRatio: number; fontFamily: string; geneticTreeWidth: Decimal; headerHeight: number; horizontalScrollPosition: number; pixelToGeneticDistanceRatio: number; scaleColor: string; tickerMarkScale: TickerMarkScale; treePadding: number; zoomLevel: number }): void {\n const { canvas, devicePixelRatio, fontFamily, geneticTreeWidth, headerHeight, horizontalScrollPosition = 0, pixelToGeneticDistanceRatio, scaleColor, tickerMarkScale, treePadding, zoomLevel } = params;\n TreeUtil.draw(canvas, devicePixelRatio, (ctx) => {\n ctx.fillStyle = scaleColor;\n TreeUtil.forEachScaleLine({\n callback: (x, i, numberOfLines) => {\n ctx.beginPath();\n ctx.textAlign = 'center';\n ctx.font = `bold 11px ${fontFamily}`;\n const label = new Decimal(tickerMarkScale[1]).times((numberOfLines - 1) - i).toNumber();\n ctx.fillText(NumberUtil.toStringWithPrecision(label, tickerMarkScale[2]), x, headerHeight * 0.61);\n ctx.closePath();\n },\n devicePixelRatio,\n geneticTreeWidth,\n horizontalScrollPosition,\n pixelToGeneticDistanceRatio,\n tickerMarkScale,\n treePadding,\n zoomLevel,\n });\n });\n }\n\n /**\n * Renders the pre-assembled tree shapes onto a canvas using the 2D context.\n *\n * Applies a transform for zoom and scroll, then draws in order:\n * vertical ancestor lines -> horizontal ancestor lines -> (linked) support lines\n * -> (highlighted) distance labels -> ancestor dots -> leaf branch lines -> leaf dots.\n *\n * When nodes are highlighted, non-highlighted shapes are dimmed via `dimFn`.\n * Leaf dot colours come from `nodeNameColors` when available.\n *\n * @param params.canvas - The canvas element to draw onto.\n * @param params.treeAssembly - Pre-computed tree shapes from {@link assembleTree}.\n * @param params.nodeNameColors - Colour mapping per node name for leaf dots.\n * @param params.treeColor - Base colour for tree lines and dots.\n * @param params.treeFont - CSS font string for distance labels.\n * @param params.dimFn - Returns a dimmed version of a colour for non-highlighted shapes.\n * @param params.supportLineColorLinked - Colour for support lines when linked.\n * @param params.supportLineColorUnlinked - Colour for support lines when unlinked.\n * @param params.zoomLevel - Current zoom level applied as a canvas transform.\n * @param params.highlightedNodeNames - Node names to highlight; all others are dimmed.\n * @param params.verticalScrollPosition - Vertical scroll offset in pixels.\n * @param params.horizontalScrollPosition - Horizontal scroll offset in pixels.\n * @param params.shouldShowDistances - Whether to render branch distance labels.\n * @param params.devicePixelRatio - Screen DPR for crisp rendering on HiDPI displays.\n * @param params.isLinked - Whether to draw the dashed support lines linking leaf nodes to the table.\n * @param params.shouldShowSupportLinesWhenUnlinked - Whether to render support lines when unlinked.\n */\n public static drawTree(params: {\n canvas: HTMLCanvasElement;\n devicePixelRatio: number;\n dimFn: (color: string) => string;\n headerHeight?: number;\n highlightedNodeNames: string[];\n horizontalScrollPosition: number;\n isLinked: boolean;\n itemHeight: number;\n nodeNameColors: { [key: string]: string } | null;\n range: { endIndex: number; startIndex: number };\n scrollPosition?: number;\n shouldShowDistances: boolean;\n shouldShowSupportLinesWhenUnlinked: boolean;\n supportLineColorLinked: string;\n supportLineColorUnlinked: string;\n treeAssembly: TreeAssembly;\n treeColor: string;\n treeFont: string;\n verticalScrollPosition: number;\n zoomLevel: number;\n }): void {\n const { canvas, devicePixelRatio, dimFn, headerHeight = 0, highlightedNodeNames = [], horizontalScrollPosition, isLinked, itemHeight, nodeNameColors, range, scrollPosition = 0, shouldShowDistances, shouldShowSupportLinesWhenUnlinked, supportLineColorLinked, supportLineColorUnlinked, treeAssembly, treeColor, treeFont, verticalScrollPosition, zoomLevel } = params;\n const ctx = TreeUtil.getCanvasContext(canvas);\n const bodyStartY = headerHeight * devicePixelRatio;\n const setRegularTransform = () => {\n ctx.setTransform(\n (1 / zoomLevel) * devicePixelRatio, // The scale factor(X direction)\n 0, // The skew factor (X-axis)\n 0, // The skew factor (Y-axis)\n (1 / zoomLevel) * devicePixelRatio, // The scale factor(Y direction)\n -horizontalScrollPosition + 0.5, // The translation (X direction)\n -verticalScrollPosition + (headerHeight * devicePixelRatio) + 0.5, // The translation (Y direction)\n );\n };\n const setTransFormForSupportLine = () => {\n ctx.setTransform(\n devicePixelRatio, // The scale factor(X direction)\n 0, // The skew factor (X-axis)\n 0, // The skew factor (Y-axis)\n devicePixelRatio, // The scale factor(Y direction)\n -horizontalScrollPosition + 0.5, // The translation (X direction)\n (headerHeight * devicePixelRatio) + 0.5, // The translation (Y direction)\n );\n };\n const drawTreeElements = () => {\n setRegularTransform();\n\n ctx.fillStyle = 'black';\n ctx.strokeStyle = 'black';\n ctx.textAlign = 'center';\n ctx.font = treeFont;\n ctx.lineWidth = 1;\n\n treeAssembly.verticalAncestorTreeLines.forEach(({ nodeNames, shape }) => {\n ctx.strokeStyle = TreeUtil.getFillStyle(treeColor, dimFn, highlightedNodeNames, nodeNames);\n ctx.stroke(shape);\n });\n treeAssembly.horizontalAncestorTreeLines.forEach(({ nodeNames, shape }) => {\n ctx.strokeStyle = TreeUtil.getFillStyle(treeColor, dimFn, highlightedNodeNames, nodeNames);\n ctx.stroke(shape);\n });\n\n if (range) {\n treeAssembly.supportLines.forEach(({ fromX, fromY, nodeName, toX, toY }) => {\n // a) leaf node is visible in the tree canvas viewport\n const canvasBodyHeight = canvas.height - bodyStartY;\n const leafScreenY = (fromY / zoomLevel) * devicePixelRatio - verticalScrollPosition;\n const isLeafVisible = leafScreenY >= 0 && leafScreenY <= canvasBodyHeight;\n\n // b) end position is within the range\n const sortingIndex = itemHeight > 0 ? Math.floor(toY / itemHeight) : -1;\n const isEndInRange = range &&\n sortingIndex >= range.startIndex &&\n sortingIndex <= range.endIndex;\n\n const isHighlighted = highlightedNodeNames.length && highlightedNodeNames.includes(nodeName);\n\n if (!isLeafVisible && !isEndInRange) {\n return;\n }\n\n if (!isHighlighted && !isLinked && !shouldShowSupportLinesWhenUnlinked) {\n return;\n }\n\n if (isLinked) {\n ctx.setLineDash([1, 4]);\n }\n ctx.beginPath();\n if (isLinked) {\n ctx.strokeStyle = TreeUtil.getFillStyle(supportLineColorLinked, dimFn, highlightedNodeNames, nodeName);\n } else {\n ctx.strokeStyle = TreeUtil.getFillStyle(supportLineColorUnlinked, dimFn, highlightedNodeNames, nodeName);\n }\n ctx.moveTo(fromX, fromY);\n setTransFormForSupportLine();\n ctx.lineTo(toX + (horizontalScrollPosition / devicePixelRatio), toY - scrollPosition);\n setRegularTransform();\n ctx.stroke();\n ctx.setLineDash([]);\n });\n }\n\n if (shouldShowDistances) {\n treeAssembly.distanceTexts.forEach(({ nodeNames, text, x, y }) => {\n const isHighlighted = highlightedNodeNames.length && intersection(nodeNames, highlightedNodeNames).length > 0;\n if (isHighlighted) {\n ctx.fillStyle = treeColor;\n ctx.fillText(text, x, y);\n }\n });\n }\n\n treeAssembly.ancestorNodes.forEach(({ nodeNames, shape }) => {\n ctx.fillStyle = TreeUtil.getFillStyle(treeColor, dimFn, highlightedNodeNames, nodeNames);\n ctx.fill(shape);\n });\n\n treeAssembly.leafTreeLines.forEach(({ nodeName, shape }) => {\n ctx.strokeStyle = TreeUtil.getFillStyle(treeColor, dimFn, highlightedNodeNames, nodeName);\n ctx.stroke(shape);\n });\n\n treeAssembly.leafNodes.forEach(({ nodeName, shape }) => {\n ctx.fillStyle = TreeUtil.getFillStyle(nodeNameColors?.[nodeName] ?? treeColor, dimFn, highlightedNodeNames, nodeName);\n ctx.fill(shape);\n });\n };\n\n if (headerHeight > 0) {\n ctx.save();\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.beginPath();\n ctx.rect(0, bodyStartY, canvas.width, Math.max(0, canvas.height - bodyStartY));\n ctx.clip();\n drawTreeElements();\n ctx.restore();\n setRegularTransform();\n return;\n }\n\n drawTreeElements();\n }\n\n /**\n * Fully redraws the tree canvas from scratch.\n *\n * Resets the canvas, resizes it to match its CSS layout size at the current\n * DPR, then sequentially calls {@link drawBackground}, {@link drawGuides},\n * {@link drawScale}, and {@link drawTree}.\n *\n * @param params.canvas - The canvas element to draw onto.\n * @param params.backgroundColor - Fill colour for the canvas background.\n * @param params.treeAssembly - Pre-computed tree shapes from {@link assembleTree}.\n * @param params.nodeNameColors - Colour mapping per node name for leaf dots.\n * @param params.treeColor - Base colour for tree lines and dots.\n * @param params.treeFont - CSS font string for distance labels.\n * @param params.dimFn - Returns a dimmed version of a colour for non-highlighted shapes.\n * @param params.fontFamily - Font family for scale labels.\n * @param params.scaleColor - Fill colour for scale label text.\n * @param params.supportLineColorLinked - Colour for support lines when linked.\n * @param params.supportLineColorUnlinked - Colour for support lines when unlinked.\n * @param params.regularFillColorSupportLine - Colour for the dashed guide lines.\n * @param params.zoomLevel - Current zoom level.\n * @param params.isLinked - Whether to draw dashed support lines.\n * @param params.highlightedNodeNames - Node names to highlight.\n * @param params.verticalScrollPosition - Vertical scroll offset in pixels.\n * @param params.horizontalScrollPosition - Horizontal scroll offset in pixels.\n * @param params.treeCanvasWidth - Logical canvas width in pixels.\n * @param params.treeCanvasHeight - Logical canvas height in pixels.\n * @param params.headerHeight - Height of the scale header area in logical pixels.\n * @param params.pixelToGeneticDistanceRatio - Pixels per unit of genetic distance.\n * @param params.tickerMarkScale - Scale tuple from {@link getTickMarkScale}.\n * @param params.shouldShowDistances - Whether to render branch labels.\n * @param params.shouldShowSupportLinesWhenUnlinked - Whether to render support lines when unlinked.\n * @param params.devicePixelRatio - Screen DPR for HiDPI rendering.\n * @param params.geneticTreeWidth - Total genetic width of the tree.\n */\n public static drawTreeCanvas(params: {\n backgroundColor: string;\n canvas: HTMLCanvasElement;\n devicePixelRatio: number;\n dimFn: (color: string) => string;\n fontFamily: string;\n geneticTreeWidth: Decimal;\n headerHeight?: number;\n highlightedNodeNames?: string[];\n horizontalScrollPosition: number;\n isLinked: boolean;\n itemHeight: number;\n nodeNameColors: { [key: string]: string } | null;\n pixelToGeneticDistanceRatio: number;\n range: { endIndex: number; startIndex: number };\n regularFillColorSupportLine: string;\n scaleColor: string;\n scrollPosition?: number;\n shouldShowDistances: boolean;\n shouldShowSupportLinesWhenUnlinked: boolean;\n supportLineColorLinked: string;\n supportLineColorUnlinked: string;\n tickerMarkScale: TickerMarkScale;\n treeAssembly: TreeAssembly;\n treeCanvasHeight: number;\n treeCanvasWidth: number;\n treeColor: string;\n treeFont: string;\n treePadding: number;\n verticalScrollPosition: number;\n zoomLevel: number;\n }): void {\n const { backgroundColor, canvas, devicePixelRatio, dimFn, fontFamily, geneticTreeWidth, headerHeight = 0, highlightedNodeNames, horizontalScrollPosition, isLinked, itemHeight, nodeNameColors, pixelToGeneticDistanceRatio, range, regularFillColorSupportLine, scaleColor, scrollPosition = 0, shouldShowDistances, shouldShowSupportLinesWhenUnlinked, supportLineColorLinked, supportLineColorUnlinked, tickerMarkScale, treeAssembly, treeCanvasHeight, treeCanvasWidth, treeColor, treeFont, treePadding, verticalScrollPosition, zoomLevel } = params;\n const ctx = TreeUtil.getCanvasContext(canvas);\n ctx.reset();\n canvas.width = canvas.clientWidth * devicePixelRatio;\n canvas.height = canvas.clientHeight * devicePixelRatio;\n ctx.imageSmoothingEnabled = zoomLevel > 1;\n ctx.imageSmoothingQuality = 'high';\n\n TreeUtil.drawBackground({ backgroundColor, canvas, devicePixelRatio, treeCanvasHeight: treeCanvasHeight + headerHeight, treeCanvasWidth });\n TreeUtil.drawGuides({ canvas, devicePixelRatio, endY: headerHeight + treeCanvasHeight, geneticTreeWidth, horizontalScrollPosition, pixelToGeneticDistanceRatio, regularFillColorSupportLine, startY: headerHeight, tickerMarkScale, treePadding, zoomLevel });\n\n if (headerHeight > 0) {\n TreeUtil.drawGuides({ canvas, devicePixelRatio, endY: headerHeight, geneticTreeWidth, horizontalScrollPosition, pixelToGeneticDistanceRatio, regularFillColorSupportLine, startY: headerHeight * 0.7, tickerMarkScale, treePadding, zoomLevel });\n TreeUtil.drawGuides({ canvas, devicePixelRatio, endY: headerHeight * 0.3, geneticTreeWidth, horizontalScrollPosition, pixelToGeneticDistanceRatio, regularFillColorSupportLine, startY: 0, tickerMarkScale, treePadding, zoomLevel });\n TreeUtil.drawScale({ canvas, devicePixelRatio, fontFamily, geneticTreeWidth, headerHeight, horizontalScrollPosition, pixelToGeneticDistanceRatio, scaleColor, tickerMarkScale, treePadding, zoomLevel });\n TreeUtil.drawDivider({ canvas, devicePixelRatio, y: 0 });\n TreeUtil.drawDivider({ canvas, devicePixelRatio, y: headerHeight - 1 });\n }\n\n TreeUtil.drawTree({ canvas, devicePixelRatio, dimFn, headerHeight, highlightedNodeNames, horizontalScrollPosition, isLinked, itemHeight, nodeNameColors, range, scrollPosition, shouldShowDistances, shouldShowSupportLinesWhenUnlinked, supportLineColorLinked, supportLineColorUnlinked, treeAssembly, treeColor, treeFont, verticalScrollPosition, zoomLevel });\n }\n\n /**\n * Finds and returns a new root node for re-rooting the tree.\n *\n * When `selector` is `'node'`, the node with the given name becomes the new root.\n * When `selector` is `'parent'`, the parent of the node with the given name is returned.\n *\n * The returned node has its `branchLength` reset to `0` and its `maxBranchLength`\n * adjusted by subtracting the original branch length, so the scale remains consistent.\n *\n * @param rootNode - The current root of the tree.\n * @param nodeName - Name of the node to search for.\n * @param selector - Whether to return the matching node itself (`'node'`) or its parent (`'parent'`).\n * @returns A shallow copy of the new root with adjusted branch length properties.\n */\n public static findNewTreeRoot(rootNode: TreeNode, nodeName: string, selector: 'node' | 'parent'): TreeNode {\n let newRoot: TreeNode;\n const findNewRoot = (node: TreeNode) => {\n if (newRoot) {\n return;\n }\n\n if (selector === 'node' && node.name === nodeName) {\n newRoot = node;\n }\n if (node.children) {\n const matchingChild = node.children.find(childNode => childNode.name === nodeName);\n if (selector === 'parent' && matchingChild) {\n newRoot = node;\n } else {\n node.children.forEach(childNode => findNewRoot(childNode));\n }\n }\n };\n findNewRoot(rootNode);\n return {\n ...newRoot,\n branchLength: new Decimal(0),\n maxBranchLength: newRoot.maxBranchLength.sub(newRoot.branchLength),\n };\n }\n\n /**\n * Finds the smallest non-zero branch length among all leaf nodes in the tree.\n *\n * This value is used as the minimum scale unit when computing tick mark\n * intervals, ensuring the scale never subdivides below a single measurable step.\n *\n * @param tree - The root node of the tree to inspect.\n * @returns The minimum positive branch length found on any leaf, or `Infinity`\n * if the tree is empty or all leaves have zero/undefined branch lengths.\n */\n public static getMinGeneticScaleUnit(tree: TreeNode): number {\n if (!tree) {\n return Infinity;\n }\n let min: number = Infinity;\n const traverse = (node: TreeNode) => {\n const branchLength = node.branchLength?.toNumber() ?? 0;\n if (!node.children?.length && branchLength && branchLength < min) {\n min = branchLength;\n }\n node?.children?.forEach(child => traverse(child));\n };\n traverse(tree);\n return min;\n }\n\n /**\n * Calculates the new scroll position after a zoom level change so that the\n * point under the cursor stays in the same visual position.\n *\n * @param params.eventOffset - Pixel offset of the zoom event (e.g. mouse position) within the canvas.\n * @param params.scrollPosition - Current scroll position before the zoom change.\n * @param params.dimensionSize - Full logical size of the scrollable dimension in pixels.\n * @param params.currentZoomLevel - The zoom level before the change.\n * @param params.newZoomLevel - The zoom level after the change.\n * @returns The adjusted scroll position that keeps the cursor-point visually stable.\n */\n public static getNewScrollPositionForZoomLevel(params: { currentZoomLevel: number; dimensionSize: number; eventOffset: number; newZoomLevel: number; scrollPosition: number }): number {\n const { currentZoomLevel, dimensionSize, eventOffset, newZoomLevel, scrollPosition } = params;\n\n const fullSizeTreePosition = ((eventOffset * devicePixelRatio) + scrollPosition) * currentZoomLevel;\n const currentSizeTreePosition = fullSizeTreePosition / (dimensionSize / (dimensionSize / currentZoomLevel));\n const newSizeTreePosition = fullSizeTreePosition / (dimensionSize / (dimensionSize / newZoomLevel));\n return scrollPosition - (currentSizeTreePosition - newSizeTreePosition);\n }\n\n /**\n * Performs a hit-test against the tree assembly's path maps to find the\n * tree node or line segment under the mouse cursor.\n *\n * Checks in priority order: node dots (via `isPointInPath`) -> horizontal\n * branch lines (with ±1 px vertical tolerance) -> vertical connector lines\n * (with ±1 px horizontal tolerance).\n *\n * @param params.canvas - The canvas element that received the mouse event.\n * @param params.event - The mouse event providing cursor coordinates.\n * @param params.treeAssembly - The assembly containing path maps to hit-test against.\n * @param params.devicePixelRatio - Screen DPR for correct coordinate scaling.\n * @returns The {@link TreePathProperties} of the hit shape, or `undefined` if nothing was hit.\n */\n public static getPathPropertiesFromCanvas(params: { canvas: HTMLCanvasElement; devicePixelRatio: number; event: MouseEvent; treeAssembly: TreeAssembly }): TreePathProperties {\n const { canvas, devicePixelRatio, event, treeAssembly } = params;\n\n const ctx = TreeUtil.getCanvasContext(canvas);\n const rect = (event.target as HTMLCanvasElement).getBoundingClientRect();\n const canvasX = (event.clientX - rect.left) * devicePixelRatio;\n const canvasY = (event.clientY - rect.top) * devicePixelRatio;\n\n for (const path of treeAssembly.nodePathPropertiesMap.keys()) {\n if (ctx.isPointInPath(path, canvasX, canvasY)) {\n return treeAssembly.nodePathPropertiesMap.get(path);\n }\n }\n\n // Allow for a 1px vertical margin around the mouse position to allow for easier clicking\n const canvasYs = [\n ((event.clientY - 1) - rect.top) * devicePixelRatio,\n canvasY,\n ((event.clientY + 1) - rect.top) * devicePixelRatio,\n ];\n\n for (const path of treeAssembly.horizontalLinePathPropertiesMap.keys()) {\n for (const y of canvasYs) {\n if (ctx.isPointInStroke(path, canvasX, y)) {\n return treeAssembly.horizontalLinePathPropertiesMap.get(path);\n }\n }\n }\n\n // Allow for a 1px horizontal margin around the mouse position to allow for easier clicking\n const canvasXs = [\n ((event.clientX - 1) - rect.left) * devicePixelRatio,\n canvasX,\n ((event.clientX + 1) - rect.left) * devicePixelRatio,\n ];\n for (const path of treeAssembly.verticalLinePathPropertiesMap.keys()) {\n for (const x of canvasXs) {\n if (ctx.isPointInStroke(path, x, canvasY)) {\n return treeAssembly.verticalLinePathPropertiesMap.get(path);\n }\n }\n }\n }\n\n /**\n * Clamps X and Y scroll positions to their valid ranges for the current\n * canvas dimensions, zoom level, and link state.\n *\n * When the tree is linked and at zoom level 1, y-scrolling is constrained\n * tightly to the tree's pixel height. When unlinked or zoomed, the bounds\n * include the full canvas extent to allow free panning.\n *\n * Also applies a device-pixel-ratio-dependent correction offset to prevent\n * subtle over-scroll artefacts at non-integer DPR values (e.g. browser zoom).\n *\n * @param params.positionX - Requested horizontal scroll position.\n * @param params.positionY - Requested vertical scroll position.\n * @param params.treeCanvasWidth - Logical canvas width in pixels.\n * @param params.treeCanvasHeight - Logical canvas height in pixels.\n * @param params.treeHeight - Total rendered height of the full tree in pixels.\n * @param params.devicePixelRatio - Current screen DPR.\n * @param params.internalZoomLevel - Internal zoom level of the tree canvas.\n * @param params.isLinked - Whether the tree is linked to the case list scroll position.\n * @returns Clamped `{ newPositionX, newPositionY }` values.\n */\n public static getSanitizedScrollPosition(params: { devicePixelRatio: number; headerHeight: number; internalZoomLevel: number; isLinked: boolean; positionX: number; positionY: number; treeCanvasHeight: number; treeCanvasWidth: number; treeHeight: number; treePadding: number }): { newPositionX: number; newPositionY: number } {\n const { devicePixelRatio, headerHeight, internalZoomLevel, isLinked, positionX, positionY, treeCanvasHeight, treeCanvasWidth, treeHeight, treePadding } = params;\n let positionYMax: number;\n let positionYMin: number;\n\n const relativeTreePadding = treePadding * devicePixelRatio;\n\n if (isLinked && internalZoomLevel === 1) {\n if (treeHeight < treeCanvasHeight) {\n positionYMin = 0;\n positionYMax = 0;\n } else {\n // some magic needs to be done here to prevent the tree from scrolling too far. I can't detect the exact reason, but it seems to be related to the devicePixelRatio\n // this only happens when you use the zoom functionality of the browser\n const roundedDevicePixelRatio = Math.round(devicePixelRatio * 100) / 100;\n const thresholds = [\n [1, 0],\n [1.1, 1],\n [1.25, 4],\n [1.5, 7],\n [1.75, 11],\n [2, 0],\n [2.2, 4],\n [2.5, 7],\n [3, 15],\n ];\n const divePixelRatioOffset = thresholds.find(([threshold]) => roundedDevicePixelRatio <= threshold)?.[1] ?? 0;\n\n positionYMin = 0;\n positionYMax = (treeHeight * devicePixelRatio) - ((treeCanvasHeight) * devicePixelRatio) - divePixelRatioOffset;\n }\n } else {\n positionYMin = (-treeCanvasHeight * devicePixelRatio) + relativeTreePadding + (headerHeight * devicePixelRatio);\n positionYMax = ((treeHeight / internalZoomLevel) * devicePixelRatio) - relativeTreePadding - (headerHeight * devicePixelRatio);\n }\n const newPositionY = Math.max(Math.min(positionYMax, positionY), positionYMin);\n\n const positionXMin = Math.min(0, -treeCanvasWidth + (2 * relativeTreePadding));\n const positionXMax = Math.max(0, ((treeCanvasWidth / internalZoomLevel) * devicePixelRatio) - (2 * relativeTreePadding));\n const newPositionX = Math.max(Math.min(positionXMax, positionX), positionXMin);\n\n return {\n newPositionX,\n newPositionY,\n };\n }\n\n /**\n * Calculates the vertical scroll position for a tree canvas based on the\n * currently visible rows in a linked table/list view.\n *\n * The goal is to keep the visible portion of the tree centered on the same\n * items that are currently visible in the linked view, accounting for zoom.\n *\n * @param kwArgs.treeCanvasHeight - Height of the visible tree canvas area in pixels.\n * @param kwArgs.treeHeight - Total rendered height of the full tree in pixels.\n * @param kwArgs.treeSize - Total number of leaf items (rows) in the tree.\n * @param kwArgs.verticalScrollPosition - Current vertical scroll position of the linked view in pixels.\n * @param kwArgs.zoomLevel - Current zoom level (>1 means zoomed out, items appear smaller).\n * @returns The new vertical scroll position for the tree canvas, clamped to [0, treeHeight - treeCanvasHeight].\n */\n public static getScrollPositionFromTreeVisibility(kwArgs: {\n itemHeight: number;\n treeCanvasHeight: number;\n treeHeight: number;\n treeSize: number;\n verticalScrollPosition: number;\n zoomLevel: number;\n }): number {\n const { itemHeight, treeCanvasHeight, treeHeight, treeSize, verticalScrollPosition, zoomLevel } = kwArgs;\n\n const scaledItemHeight = itemHeight / zoomLevel;\n const scrolledByItems = Math.round(verticalScrollPosition / scaledItemHeight);\n const maxItemsInView = Math.round(treeCanvasHeight / scaledItemHeight);\n\n const firstItemInView = Math.max(0, scrolledByItems);\n const lastItemInView = Math.min(scrolledByItems + maxItemsInView, treeSize);\n const averageItemInView = (firstItemInView + lastItemInView) / 2;\n\n const newScrollPosition = Math.max(0, Math.min(treeHeight - treeCanvasHeight, averageItemInView * itemHeight - treeCanvasHeight / 2));\n return newScrollPosition;\n }\n\n /**\n * Determines the optimal tick mark scale for the genetic distance axis.\n *\n * Selects the number of scale lines and the genetic distance represented by\n * each interval by searching for the combination with the least leftover\n * (i.e. the product of `numLines × increment` closest to `geneticTreeWidth`).\n * Increments are drawn from `SCALE_INCREMENTS` scaled by an order-of-magnitude\n * multiplier derived from `geneticTreeWidth`, and those smaller than\n * `minGeneticScaleUnit` are skipped.\n *\n * @param params.treeWidthMinusPadding - Width of the drawable canvas area in pixels (excluding padding).\n * @param params.geneticTreeWidth - Total genetic distance represented by the full tree width.\n * @param params.minGeneticScaleUnit - The smallest meaningful genetic distance unit (see {@link getMinGeneticScaleUnit}).\n * @param params.zoomLevel - Current zoom level; divides the effective pixel width.\n * @returns A {@link TickerMarkScale} tuple: `[numberOfLines, geneticDistancePerLine, minGeneticScaleUnit]`.\n * Returns `[0, 0, 0]` when any required input is falsy.\n */\n public static getTickMarkScale(params: { geneticTreeWidth: Decimal; maxScaleWidthPx: number; minGeneticScaleUnit: number; minScaleWidthPx: number; scaleIncrements: number[]; treeWidthMinusPadding: number; zoomLevel: number }): TickerMarkScale {\n const { geneticTreeWidth, maxScaleWidthPx, minGeneticScaleUnit, minScaleWidthPx, scaleIncrements, treeWidthMinusPadding, zoomLevel } = params;\n if (!treeWidthMinusPadding || !geneticTreeWidth || !minGeneticScaleUnit) {\n return [0, 0, 0];\n }\n const width = treeWidthMinusPadding / zoomLevel;\n\n let minNumLines = Math.floor(width / maxScaleWidthPx) + 1;\n let maxNumLines = Math.ceil(width / minScaleWidthPx) + 1;\n\n if (geneticTreeWidth.div(minGeneticScaleUnit).add(1).lessThan(maxNumLines)) {\n maxNumLines = Math.max(geneticTreeWidth.div(minGeneticScaleUnit).ceil().toNumber(), 2);\n }\n if (minNumLines > maxNumLines) {\n minNumLines = maxNumLines;\n }\n if (maxNumLines === 2) {\n return [2, minGeneticScaleUnit, minGeneticScaleUnit];\n }\n\n const geneticTreeWidthDecimal = new Decimal(geneticTreeWidth);\n const multiplier = new Decimal(10).pow(geneticTreeWidthDecimal.log(10).floor().minus(1));\n const multipliedIncrements = scaleIncrements.map(i => new Decimal(i).times(multiplier));\n\n let bestCombination: [Decimal, Decimal, Decimal] = [new Decimal(0), new Decimal(0), new Decimal(Infinity)];\n\n for (let numLines = minNumLines; numLines <= maxNumLines; numLines++) {\n for (const increment of multipliedIncrements) {\n if (increment.lt(minGeneticScaleUnit)) {\n continue;\n }\n const product = increment.times(numLines);\n const leftover = product.minus(geneticTreeWidthDecimal).abs();\n if (leftover.lt(bestCombination[2])) {\n bestCombination = [Decimal(numLines), increment, leftover];\n }\n }\n }\n\n return [bestCombination[0].add(1).toNumber(), bestCombination[1].toNumber(), minGeneticScaleUnit];\n }\n\n /**\n * Sanitizes the tree by collapsing intermediate ancestor nodes that have a\n * zero branch length, hoisting their children up to the parent level.\n *\n * This normalises Newick-parsed trees where polytomies or zero-distance\n * internal nodes would otherwise produce visually redundant branching points.\n *\n * @param rootNode - The root of the tree to sanitize. Mutated in place.\n * @returns The sanitized root node.\n */\n public static sanitizeTree(rootNode: TreeNode, fallbackDistance: number): TreeNode {\n const sanitize = (node: TreeNode): SanitizeResult => {\n const results: SanitizeResult[] = [];\n node.children?.forEach(child => {\n results.push(sanitize(child));\n });\n results.filter(x => !!x).forEach((result) => {\n node.children.splice(node.children.indexOf(result.node), result.node.children.length === result.nodesToMove.length ? 1 : 0, ...result.nodesToMove);\n node.subTreeNames.splice(node.subTreeNames.indexOf(result.node.name), result.node.children.length === result.nodesToMove.length ? 1 : 0, ...result.nodesToMove.map(n => n.subTreeNames).flat());\n });\n\n if (node.children?.length) {\n const nodesToMove: TreeNode[] = [];\n node.children.forEach(child => {\n if ((node.branchLength?.toNumber() ?? 0) === 0) {\n nodesToMove.push(child);\n }\n });\n return {\n node,\n nodesToMove,\n };\n }\n return null;\n };\n sanitize(rootNode);\n\n // Handle edge case: deeply nested zero-distance comb where all children end up with zero branch length\n const allChildrenHaveZeroBranchLength = rootNode.children?.every(child => (child.branchLength?.toNumber() ?? 0) === 0) ?? false;\n if (allChildrenHaveZeroBranchLength && rootNode.children?.length) {\n rootNode.name = `Generated-${StringUtil.createHash(rootNode.subTreeNames.join(','))}`;\n const newRootNode: TreeNode = {\n branchLength: new Decimal(fallbackDistance),\n children: [rootNode],\n maxBranchLength: new Decimal(fallbackDistance),\n name: 'root',\n size: rootNode.size,\n subTreeLeaveNames: rootNode.subTreeLeaveNames,\n subTreeNames: [rootNode.name, ...rootNode.subTreeNames],\n };\n return newRootNode;\n }\n\n return rootNode;\n }\n\n /**\n * Assembles the visual elements for an ancestor (internal) node and appends\n * them to the tree assembly.\n *\n * Produces: vertical connector lines from each child toward the ancestor's\n * Y midpoint (split into two sorted groups above and below center to allow\n * per-segment highlighting), a horizontal branch line, an optional distance\n * label, and a filled dot when all children have positive branch lengths.\n *\n * @param treeAssemblyContext - Shared context holding the assembly target and canvas dimensions.\n * @param node - The ancestor tree node to assemble.\n * @param childRenderResults - Assembly results returned by all direct children.\n * @returns The pixel coordinates of the branch start and aggregated case IDs, for use by the parent.\n */\n private static assembleAncestorNode(treeAssemblyContext: TreeAssemblyContext, node: TreeNode, childRenderResults: NodeAssemblyResult[]): NodeAssemblyResult {\n const firstChild = first(childRenderResults);\n const lastChild = last(childRenderResults);\n\n const ancestorXPxEnd = firstChild.x;\n const ancestorXPxDistance = (node.branchLength?.toNumber() ?? 0) * treeAssemblyContext.pixelToGeneticDistanceRatio;\n const ancestorXPxStart = ancestorXPxEnd - ancestorXPxDistance;\n const ancestorYPx = (firstChild.y + lastChild.y) / 2;\n const nodeNames = childRenderResults.map(r => r.nodeNames).flat();\n const label = TreeUtil.getDistanceLabel(treeAssemblyContext, node.branchLength);\n\n const centerToTopChildRenderResults = childRenderResults.filter(c => c.y < ancestorYPx).sort((a, b) => a.y - b.y);\n const centerToBottomChildRenderResults = childRenderResults.filter(c => c.y > ancestorYPx).sort((a, b) => b.y - a.y);\n\n [centerToTopChildRenderResults, centerToBottomChildRenderResults].forEach(sortedChildRenderResults => {\n const chunkNodeNames: string[] = [];\n\n sortedChildRenderResults.forEach((childRenderResult, index) => {\n const lineToYPx = index === sortedChildRenderResults.length - 1 ? ancestorYPx : sortedChildRenderResults[index + 1].y;\n chunkNodeNames.push(...childRenderResult.nodeNames);\n\n const chunkPath = new Path2D();\n chunkPath.moveTo(childRenderResult.x, childRenderResult.y);\n chunkPath.lineTo(childRenderResult.x, lineToYPx);\n chunkPath.closePath();\n treeAssemblyContext.treeAssembly.verticalAncestorTreeLines.push({ nodeNames: [...chunkNodeNames], shape: chunkPath });\n treeAssemblyContext.treeAssembly.verticalLinePathPropertiesMap.set(chunkPath, {\n subTreeLeaveNames: chunkNodeNames,\n });\n });\n });\n\n // add horizontal line according to distance\n const horizontalLineAccordingToDistancePath = new Path2D();\n horizontalLineAccordingToDistancePath.moveTo(ancestorXPxStart - 0.5, ancestorYPx);\n horizontalLineAccordingToDistancePath.lineTo(ancestorXPxEnd + 0.5, ancestorYPx);\n horizontalLineAccordingToDistancePath.closePath();\n treeAssemblyContext.treeAssembly.horizontalAncestorTreeLines.push({ nodeNames: [node.name, ...nodeNames], shape: horizontalLineAccordingToDistancePath });\n treeAssemblyContext.treeAssembly.horizontalLinePathPropertiesMap.set(horizontalLineAccordingToDistancePath, {\n subTreeLeaveNames: nodeNames,\n });\n\n // add distance text\n if (label) {\n treeAssemblyContext.treeAssembly.distanceTexts.push({ nodeNames: [node.name, ...nodeNames], text: label, x: (ancestorXPxStart + ancestorXPxEnd) / 2, y: ancestorYPx + 12 });\n }\n\n if (node.children.every(child => (child.branchLength?.toNumber() ?? 0) > 0)) {\n // add circle at beginning of the line representing the node itself\n const circlePath = new Path2D();\n circlePath.arc(ancestorXPxEnd, ancestorYPx, treeAssemblyContext.ancestorDotRadius, 0, 2 * Math.PI, false);\n treeAssemblyContext.treeAssembly.ancestorNodes.push({ nodeNames: [node.name, ...nodeNames], shape: circlePath });\n treeAssemblyContext.treeAssembly.nodePathPropertiesMap.set(circlePath, {\n subTreeLeaveNames: node.subTreeLeaveNames,\n treeNode: node,\n });\n }\n\n return {\n nodeNames,\n x: ancestorXPxStart,\n y: ancestorYPx,\n };\n }\n\n /**\n * Assembles the visual elements for a single leaf node and appends them to\n * the tree assembly.\n *\n * Produces: a horizontal branch line, an optional distance label, a dashed\n * support line extending to the canvas edge, and a filled dot.\n *\n * @param treeAssemblyContext - Shared context holding the assembly target and canvas dimensions.\n * @param node - The leaf tree node to assemble.\n * @param distance - Accumulated genetic distance from the root to the start of this node's branch.\n * @param leafIndex - Zero-based vertical index of this leaf, determining its Y position.\n * @param sortingIndex - Sorting index of this leaf derived from linked view order. Used to draw the support line.\n * @returns The pixel coordinates of the branch start and the node name, for use by the parent.\n */\n private static assembleLeafNode(treeAssemblyContext: TreeAssemblyContext, node: TreeNode, distance = 0, leafIndex = 0, sortingIndex = 0): NodeAssemblyResult {\n const leafX = distance + (node.branchLength?.toNumber() ?? 0);\n const leafXPxEnd = leafX * treeAssemblyContext.pixelToGeneticDistanceRatio + treeAssemblyContext.treePadding;\n const leafYPx = ((leafIndex) * treeAssemblyContext.itemHeight) + (treeAssemblyContext.itemHeight / 2);\n const leafXPxDistance = (node.branchLength?.toNumber() ?? 0) * treeAssemblyContext.pixelToGeneticDistanceRatio;\n const leafXPxStart = leafXPxEnd - leafXPxDistance;\n const label = TreeUtil.getDistanceLabel(treeAssemblyContext, node.branchLength);\n\n // add horizontal line according to distance\n const horizontalLineAccordingToDistancePath = new Path2D();\n horizontalLineAccordingToDistancePath.moveTo(leafXPxStart - 0.5, leafYPx);\n horizontalLineAccordingToDistancePath.lineTo(leafXPxEnd, leafYPx);\n horizontalLineAccordingToDistancePath.closePath();\n treeAssemblyContext.treeAssembly.leafTreeLines.push({ nodeName: node.name, shape: horizontalLineAccordingToDistancePath });\n treeAssemblyContext.treeAssembly.horizontalLinePathPropertiesMap.set(horizontalLineAccordingToDistancePath, {\n subTreeLeaveNames: node.subTreeLeaveNames,\n });\n\n // add distance text\n if (label) {\n treeAssemblyContext.treeAssembly.distanceTexts.push({ nodeNames: [node.name], text: label, x: (leafXPxStart + leafXPxEnd) / 2, y: leafYPx + 12 });\n }\n // add horizontal support line to max width\n const supportLineToYpx = sortingIndex * treeAssemblyContext.itemHeight + (treeAssemblyContext.itemHeight / 2);\n treeAssemblyContext.treeAssembly.supportLines.push({ fromX: leafXPxEnd, fromY: leafYPx, nodeName: node.name, toX: treeAssemblyContext.treeCanvasWidth, toY: supportLineToYpx });\n\n // add a dot to represent the node\n const circlePath = new Path2D();\n circlePath.arc(leafXPxEnd, leafYPx, treeAssemblyContext.leafDotRadius, 0, 2 * Math.PI, false);\n circlePath.closePath();\n\n treeAssemblyContext.treeAssembly.nodePathPropertiesMap.set(circlePath, {\n subTreeLeaveNames: node.subTreeLeaveNames,\n treeNode: node,\n });\n treeAssemblyContext.treeAssembly.leafNodes.push({ nodeName: node.name, shape: circlePath });\n\n return {\n nodeNames: [node.name],\n x: leafXPxStart,\n y: leafYPx,\n };\n }\n\n /**\n * Helper that wraps a canvas drawing callback with a DPR-aware scale/translate\n * transform, then restores the context to its pre-call state.\n *\n * @param canvas - The canvas element whose 2D context to use.\n * @param devicePixelRatio - Screen DPR to scale up for HiDPI rendering.\n * @param callback - Drawing operations to perform inside the transform.\n */\n private static draw(canvas: HTMLCanvasElement, devicePixelRatio: number, callback: (ctx: CanvasRenderingContext2D) => void): void {\n const ctx = TreeUtil.getCanvasContext(canvas);\n ctx.scale(devicePixelRatio, devicePixelRatio);\n ctx.translate(0.5, 0.5);\n callback(ctx);\n ctx.translate(-0.5, -0.5);\n ctx.scale(1 / devicePixelRatio, 1 / devicePixelRatio);\n }\n\n /**\n * Fills the tree canvas background with the theme's paper colour.\n *\n * @param params.canvas - The canvas element to draw onto.\n * @param params.theme - MUI theme providing the background colour.\n * @param params.treeCanvasWidth - Width of the area to fill in pixels.\n * @param params.treeCanvasHeight - Height of the area to fill in pixels.\n * @param params.devicePixelRatio - Screen DPR for HiDPI rendering.\n */\n private static drawBackground(params: { backgroundColor: string; canvas: HTMLCanvasElement; devicePixelRatio: number; treeCanvasHeight: number; treeCanvasWidth: number }): void {\n const { backgroundColor, canvas, devicePixelRatio, treeCanvasHeight, treeCanvasWidth } = params;\n TreeUtil.draw(canvas, devicePixelRatio, (ctx) => {\n ctx.fillStyle = backgroundColor;\n ctx.fillRect(0, 0, treeCanvasWidth, treeCanvasHeight);\n });\n }\n\n\n /**\n * Iterates over each scale line position and invokes a callback with its\n * canvas X coordinate.\n *\n * Computes the pixel offset for each tick so that the rightmost line aligns\n * with the genetic tree width, accounting for the current scroll and zoom.\n *\n * @param params.tickerMarkScale - Scale tuple from {@link getTickMarkScale}.\n * @param params.geneticTreeWidth - Total genetic width of the tree.\n * @param params.pixelToGeneticDistanceRatio - Pixels per unit of genetic distance.\n * @param params.zoomLevel - Current zoom level.\n * @param params.devicePixelRatio - Screen DPR.\n * @param params.horizontalScrollPosition - Current horizontal scroll offset in pixels (default 0).\n * @param params.callback - Called for each line with `(x, index, numberOfLines)`.\n */\n private static forEachScaleLine(params: { callback: (x: number, i: number, numberOfLines: number) => void; devicePixelRatio: number; geneticTreeWidth: Decimal; horizontalScrollPosition?: number; pixelToGeneticDistanceRatio: number; tickerMarkScale: TickerMarkScale; treePadding: number; zoomLevel: number }): void {\n const { callback, devicePixelRatio, geneticTreeWidth, horizontalScrollPosition = 0, pixelToGeneticDistanceRatio, tickerMarkScale, treePadding, zoomLevel } = params;\n\n const numberOfLines = tickerMarkScale[0];\n const tickerGeneticWidth = tickerMarkScale[1];\n const tickerWidth = new Decimal(tickerGeneticWidth).times(pixelToGeneticDistanceRatio).div(zoomLevel);\n const totalTickerWidth = tickerWidth.times(numberOfLines - 1);\n const geneticTreeWidthPx = geneticTreeWidth.times(pixelToGeneticDistanceRatio).div(zoomLevel);\n const offset = totalTickerWidth.minus(geneticTreeWidthPx);\n\n for (let i = 0; i < numberOfLines; i++) {\n const x = new Decimal(i).times(tickerWidth).plus(new Decimal(treePadding).div(zoomLevel)).minus(offset).minus(new Decimal(horizontalScrollPosition).div(devicePixelRatio)).toNumber();\n callback(x, i, numberOfLines);\n }\n }\n\n private static getCanvasContext(canvas: HTMLCanvasElement): CanvasRenderingContext2D {\n const ctx = canvas.getContext('2d');\n if (!ctx) {\n throw new Error('Failed to acquire 2D canvas context.');\n }\n return ctx;\n }\n\n /**\n * Returns a formatted distance label string for a branch, or `null` if the\n * label should be suppressed.\n *\n * A label is suppressed when:\n * - The tree has no maximum branch length, or it is zero.\n * - The branch length is zero or undefined.\n * - The branch is shorter than `MINIMUM_DISTANCE_PERCENTAGE_TO_SHOW_LABEL`\n * percent of the maximum branch length in the tree.\n *\n * Precision is derived from the magnitude of `maxBranchLength` to avoid\n * excessive decimal places for large values.\n *\n * @param treeAssemblyContext - Context containing the root node (for `maxBranchLength`).\n * @param branchLength - The genetic distance of the branch to label.\n * @returns A rounded numeric string, or `null` if the label should be hidden.\n */\n private static getDistanceLabel(treeAssemblyContext: TreeAssemblyContext, branchLength: Decimal): string {\n const labelPrecision = treeAssemblyContext.rootNode.maxBranchLength ? Math.max(1, 4 - String(Math.round(treeAssemblyContext.rootNode.maxBranchLength.toNumber())).length) : null;\n if (!treeAssemblyContext.rootNode.maxBranchLength || treeAssemblyContext.rootNode.maxBranchLength.toNumber() === 0 || !branchLength || branchLength.toNumber() === 0) {\n return null;\n }\n if (branchLength.div(treeAssemblyContext.rootNode.maxBranchLength).mul(100).lessThan(treeAssemblyContext.minimumDistancePercentageToShowLabel)) {\n return null;\n }\n return String(round(branchLength.toNumber(), labelPrecision));\n }\n\n /**\n * Returns the fill/stroke colour for a shape, dimming it when highlighted\n * nodes are active and the shape is not among them.\n *\n * @param color - The full-brightness colour to use when highlighted or no highlight is active.\n * @param dimFn - A function that returns a dimmed version of the colour.\n * @param highlightedNodeNames - The currently highlighted node names.\n * @param nodeNames - The node name(s) associated with the shape being drawn.\n * @returns The resolved colour string.\n */\n private static getFillStyle(color: string, dimFn: (color: string) => string, highlightedNodeNames: string[], nodeNames: string | string[]): string {\n if (highlightedNodeNames.length) {\n let isHighlighted: boolean;\n if (Array.isArray(nodeNames)) {\n isHighlighted = intersection(nodeNames, highlightedNodeNames).length > 0;\n } else {\n isHighlighted = highlightedNodeNames.includes(nodeNames);\n }\n if (isHighlighted) {\n return color;\n }\n return dimFn(color);\n }\n return color;\n }\n}\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,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],"mappings":";;;;;CAkBA,SAAS,EAAK,GAAO;EACnB,OAAQ,KAAS,EAAM,SAAU,EAAM,KAAK,KAAA;CAC9C;CAEA,EAAO,UAAU;;CCtBjB,EAAO,UAAA,EAAA;;CCSP,SAAS,EAAS,GAAO,GAAU;EAKjC,KAJA,IAAI,IAAQ,IACR,IAAS,KAAS,OAAO,IAAI,EAAM,QACnC,IAAS,MAAM,CAAM,GAElB,EAAE,IAAQ,IACf,EAAO,KAAS,EAAS,EAAM,IAAQ,GAAO,CAAK;EAErD,OAAO;CACT;CAEA,EAAO,UAAU;;CCjBjB,EAAO,UAFU,OAAO,UAAU,YAAY,UAAU,OAAO,WAAW,UAAU;;CCDpF,IAAI,IAAA,EAAA,GAGA,IAAW,OAAO,QAAQ,YAAY,QAAQ,KAAK,WAAW,UAAU;CAK5E,EAAO,UAFI,KAAc,KAAY,SAAS,aAAa,CAAC,CAAC;;CCD7D,EAAO,UAFH,EAAA,CAAA,CAAc;;CCHlB,IAAI,I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