You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
149 KiB
JavaScript
25 lines
149 KiB
JavaScript
|
9 months ago
|
"use strict";
|
||
|
|
/*
|
||
|
|
* ATTENTION: An "eval-source-map" devtool has been used.
|
||
|
|
* This devtool is neither made for production nor for readable output files.
|
||
|
|
* It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools.
|
||
|
|
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
||
|
|
* or disable the default devtool with "devtool: false".
|
||
|
|
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
||
|
|
*/
|
||
|
|
exports.id = "vendor-chunks/fuse.js";
|
||
|
|
exports.ids = ["vendor-chunks/fuse.js"];
|
||
|
|
exports.modules = {
|
||
|
|
|
||
|
|
/***/ "(ssr)/./node_modules/fuse.js/dist/fuse.mjs":
|
||
|
|
/*!********************************************!*\
|
||
|
|
!*** ./node_modules/fuse.js/dist/fuse.mjs ***!
|
||
|
|
\********************************************/
|
||
|
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
||
|
|
|
||
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Fuse)\n/* harmony export */ });\n/**\n * Fuse.js v7.0.0 - Lightweight fuzzy-search (http://fusejs.io)\n *\n * Copyright (c) 2023 Kiro Risk (http://kiro.me)\n * All Rights Reserved. Apache Software License 2.0\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */ function isArray(value) {\n return !Array.isArray ? getTag(value) === \"[object Array]\" : Array.isArray(value);\n}\n// Adapted from: https://github.com/lodash/lodash/blob/master/.internal/baseToString.js\nconst INFINITY = 1 / 0;\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 let result = value + \"\";\n return result == \"0\" && 1 / value == -INFINITY ? \"-0\" : result;\n}\nfunction toString(value) {\n return value == null ? \"\" : baseToString(value);\n}\nfunction isString(value) {\n return typeof value === \"string\";\n}\nfunction isNumber(value) {\n return typeof value === \"number\";\n}\n// Adapted from: https://github.com/lodash/lodash/blob/master/isBoolean.js\nfunction isBoolean(value) {\n return value === true || value === false || isObjectLike(value) && getTag(value) == \"[object Boolean]\";\n}\nfunction isObject(value) {\n return typeof value === \"object\";\n}\n// Checks if `value` is object-like.\nfunction isObjectLike(value) {\n return isObject(value) && value !== null;\n}\nfunction isDefined(value) {\n return value !== undefined && value !== null;\n}\nfunction isBlank(value) {\n return !value.trim().length;\n}\n// Gets the `toStringTag` of `value`.\n// Adapted from: https://github.com/lodash/lodash/blob/master/.internal/getTag.js\nfunction getTag(value) {\n return value == null ? value === undefined ? \"[object Undefined]\" : \"[object Null]\" : Object.prototype.toString.call(value);\n}\nconst EXTENDED_SEARCH_UNAVAILABLE = \"Extended search is not available\";\nconst INCORRECT_INDEX_TYPE = \"Incorrect 'index' type\";\nconst LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY = (key)=>`Invalid value for key ${key}`;\nconst PATTERN_LENGTH_TOO_LARGE = (max)=>`Pattern length exceeds max of ${max}.`;\nconst MISSING_KEY_PROPERTY = (name)=>`Missing ${name} property in key`;\nconst INVALID_KEY_WEIGHT_VALUE = (key)=>`Property 'weight' in key '${key}' must be a positive integer`;\nconst hasOwn = Object.prototype.hasOwnProperty;\nclass KeyStore {\n constructor(keys){\n this._keys = [];\n this._keyMap = {};\n let totalWeight = 0;\n keys.forEach((key)=>{\n let obj = createKey(key);\n this._keys.push(obj);\n this._keyMap[obj.id] = obj;\n totalWeight += obj.weight;\n });\n // Normalize weights so that their sum is equal to 1\n this._keys.forEach((key)=>{\n key.weight /= totalWeight;\n });\n }\n get(keyId) {\n return this._keyMap[keyId];\n }\n keys() {\n return this._keys;\n }\n toJSON() {\n return JSON.stringify(this._keys);\n }\n}\nfunction createKey(key) {\n let path = null;\n let id = null;\n let src = null;\n let weight = 1;\n let getFn = null;\n if (isString(key) || isArray(key)) {\n src = key;\n path = createKeyPath(key);\n id = createKeyId(key);\n } else {\n if (!hasOwn.call(key, \"name\")) {\n throw new Error(MISSING_KEY_PROPERTY(\"name\"));\n }\n const name = key.name;\n src = name;\n if (hasOwn.call(key, \"weight\")) {\n weight = key.weight;\n if (weight <= 0) {\n throw new Error(INVALID_KEY_WEIGHT_VALUE(name));\n }\n }\n path = createKeyPath(name);\n id = createKeyId(name);\n getFn = key.getFn;\n }\n return {\n path,\n id,\n weight,\n src,\n getFn\n };\n}\nfunction cr
|
||
|
|
|
||
|
|
/***/ })
|
||
|
|
|
||
|
|
};
|
||
|
|
;
|