1
0
mirror of https://github.com/nextapps-de/flexsearch.git synced 2025-09-08 21:20:41 +02:00

ADD unminified compact version

This commit is contained in:
Thomas Wilkerling
2018-05-03 11:58:16 +02:00
parent 359c9a31b4
commit 34712d8d12
6 changed files with 743 additions and 55 deletions

View File

@@ -53,7 +53,7 @@ var parameter = (function(opt){
return parameter;
})({
compilation_level: "ADVANCED_OPTIMIZATIONS",
compilation_level: "ADVANCED_OPTIMIZATIONS", //"WHITESPACE"
use_types_for_optimization: true,
new_type_inf: true,
jscomp_warning: "newCheckTypes",
@@ -68,6 +68,7 @@ var parameter = (function(opt){
output_manifest: "log/manifest.log",
output_module_dependencies: "log/module_dependencies.log",
property_renaming_report: "log/renaming_report.log"
//formatting: "PRETTY_PRINT"
});
if(options['RELEASE'] === 'lang'){

682
flexsearch.compact.js Normal file
View File

@@ -0,0 +1,682 @@
/*
FlexSearch v0.2.68
Copyright 2018 Thomas Wilkerling
Released under the Apache 2.0 Licence
https://github.com/nextapps-de/flexsearch
*/
'use strict';
(function(){
provide("FlexSearch", function factory(){
var defaults = {
encode: "icase",
mode: "forward",
suggest: false,
cache: false,
async: false,
worker: false,
threshold: 0,
depth: 0
};
var profiles = {
"memory": {encode: "extra", mode: "strict", threshold: 7},
"speed": {encode: "icase", mode: "strict", threshold: 7, depth: 2},
"match": {encode: "extra", mode: "full"},
"score": {encode: "extra", mode: "strict", threshold: 5, depth: 4},
"balance": {encode: "balance", mode: "ngram", threshold: 6, depth: 3},
"fastest": {encode: "icase", mode: "strict", threshold: 9, depth: 1}
};
var globalMatcher = [];
var idCounter = 0;
var regexSplit = regex("[ -/]");
var filter = createObject();
var stemmer = createObject();
var indexBlacklist = function(){
var array = Object.getOwnPropertyNames({}.__proto__);
var map = createObject();
for(var i = 0; i < array.length; i++){
map[array[i]] = 1;
}
return map;
}();
function FlexSearch(options){
if(typeof options === "string" && !indexBlacklist[options]){
options = profiles[options];
}
options || (options = defaults);
this.id = options["id"] || idCounter++;
this.init(options);
registerProperty(this, "index", function(){
return this._ids;
});
registerProperty(this, "length", function(){
return Object.keys(this._ids).length;
});
}
FlexSearch.new = function(options){
return new this(options);
};
FlexSearch.create = function(options){
return FlexSearch.new(options);
};
FlexSearch.registerMatcher = function(matcher){
for(var key in matcher){
if(matcher.hasOwnProperty(key)){
globalMatcher.push(regex(key), matcher[key]);
}
}
return this;
};
FlexSearch.registerEncoder = function(name, encoder){
if(!indexBlacklist[name]){
globalEncoder[name] = encoder;
}
return this;
};
FlexSearch.registerLanguage = function(lang, languagePack){
if(!indexBlacklist[lang]){
filter[lang] = languagePack["filter"];
stemmer[lang] = languagePack["stemmer"];
}
return this;
};
FlexSearch.encode = function(name, value){
if(indexBlacklist[name]){
return value;
}
else{
return globalEncoder[name].call(globalEncoder, value);
}
};
FlexSearch.prototype.init = function(options){
this._matcher = [];
options || (options = defaults);
var custom = options["profile"];
var profile = custom && !indexBlacklist[custom] ? profiles[custom] : createObject();
this.mode = options["mode"] || profile.mode || this.mode || defaults.mode;
this.threshold = options["threshold"] || profile.threshold || this.threshold || defaults.threshold;
this.depth = options["depth"] || profile.depth || this.depth || defaults.depth;
this.suggest = options["suggest"] || this.suggest || defaults.suggest;
custom = options["encode"] || profile.encode;
this.encoder = custom && !indexBlacklist[custom] && globalEncoder[custom] || (typeof custom === "function" ? custom : this.encoder || false);
if(custom = options["matcher"]){
this.addMatcher(custom);
}
if((custom = options["filter"]) && !indexBlacklist[custom]){
this.filter = initFilter(filter[custom] || custom, this.encoder);
}
if((custom = options["stemmer"]) && !indexBlacklist[custom]){
this.stemmer = initStemmer(stemmer[custom] || custom, this.encoder);
}
this._map = createObject(10);
this._ctx = createObject();
this._ids = createObject();
this._stack = createObject();
this._stackKeys = [];
this._timer = null;
return this;
};
FlexSearch.prototype.encode = function(value){
if(value && globalMatcher.length){
value = replace(value, globalMatcher);
}
if(value && this._matcher.length){
value = replace(value, this._matcher);
}
if(value && this.encoder){
value = this.encoder.call(globalEncoder, value);
}
if(value && this.stemmer){
value = replace(value, this.stemmer);
}
return value;
};
FlexSearch.prototype.addMatcher = function(custom){
var matcher = this._matcher;
for(var key in custom){
if(custom.hasOwnProperty(key)){
matcher.push(regex(key), custom[key]);
}
}
return this;
};
FlexSearch.prototype.add = function(id, content, _skipUpdate){
if(typeof content === "string" && content && (id && !indexBlacklist[id] || id === 0)){
if(this._ids[id] && !_skipUpdate){
this.update(id, content);
}
else{
content = this.encode(content);
if(!content.length){
return this;
}
var tokenizer = this.mode;
var words = typeof tokenizer === "function" ? tokenizer(content) : tokenizer === "ngram" ? ngram(content) : content.split(regexSplit);
var dupes = createObject();
dupes["_ctx"] = createObject();
var threshold = this.threshold;
var depth = this.depth;
var map = this._map;
var wordLength = words.length;
for(var i = 0; i < wordLength; i++){
var value = words[i];
if(value){
var length = value.length;
var contextScore = (wordLength - i) / wordLength;
switch(tokenizer){
case "reverse":
case "both":
var tmp = "";
for(var a = length - 1; a >= 1; a--){
tmp = value[a] + tmp;
addIndex(map, dupes, tmp, id, (length - a) / length, contextScore, threshold);
}
case "forward":
var tmp = "";
for(var a = 0; a < length; a++){
tmp += value[a];
addIndex(map, dupes, tmp, id, 1, contextScore, threshold);
}
break;
case "full":
var tmp = "";
for(var x = 0; x < length; x++){
var partialScore = (length - x) / length;
for(var y = length; y > x; y--){
tmp = value.substring(x, y);
addIndex(map, dupes, tmp, id, partialScore, contextScore, threshold);
}
}
break;
case "strict":
case "ngram":
default:
var score = addIndex(map, dupes, value, id, 1, contextScore, threshold);
if(depth && wordLength > 1 && score >= threshold){
var ctxDupes = dupes["_ctx"][value] || (dupes["_ctx"][value] = createObject());
var ctxTmp = this._ctx[value] || (this._ctx[value] = createObject(10));
var x = i - depth;
var y = i + depth + 1;
if(x < 0){
x = 0;
}
if(y > wordLength){
y = wordLength;
}
for(; x < y; x++){
if(x !== i){
addIndex(ctxTmp, ctxDupes, words[x], id, 0, 10 - (x < i ? i - x : x - i), threshold);
}
}
}
break;
}
}
}
this._ids[id] = "1";
}
}
return this;
};
FlexSearch.prototype.update = function(id, content){
if(this._ids[id] && content && typeof content === "string"){
this.remove(id);
this.add(id, content, true);
}
return this;
};
FlexSearch.prototype.remove = function(id){
if(this._ids[id] && !indexBlacklist[id]){
for(var z = 0; z < 10; z++){
removeIndex(this._map[z], id);
}
if(this.depth){
removeIndex(this._ctx, id);
}
delete this._ids[id];
}
return this;
};
FlexSearch.prototype.search = function(query, limit, callback){
var threshold;
var result = [];
if(query && typeof query === "object"){
callback = query["callback"] || limit;
limit = query["limit"];
threshold = query["threshold"];
query = query["query"];
}
threshold = (threshold || this.threshold || 0) | 0;
if(typeof limit === "function"){
callback = limit;
limit = 1000;
}
else{
limit || (limit = 1000);
}
if(callback){
var self = this;
queue(function(){
callback(self.search(query, limit));
self = null;
}, 1, "search-" + this.id);
return null;
}
if(!query || typeof query !== "string"){
return result;
}
var _query = query;
_query = this.encode(_query);
if(!_query.length){
return result;
}
var tokenizer = this.mode;
var words = typeof tokenizer === "function" ? tokenizer(_query) : tokenizer === "ngram" ? ngram(_query) : _query.split(regexSplit);
var length = words.length;
var found = true;
var check = [];
var checkWords = createObject();
if(length > 1){
if(this.depth){
var useContextual = true;
var ctxRoot = words[0];
checkWords[ctxRoot] = "1";
}
else{
words.sort(sortByLengthDown);
}
}
var ctxMap;
if(!useContextual || (ctxMap = this._ctx)[ctxRoot]){
for(var a = useContextual ? 1 : 0; a < length; a++){
var value = words[a];
if(value && !checkWords[value]){
var map;
var mapFound = false;
var mapCheck = [];
var count = 0;
for(var z = 9; z >= threshold; z--){
map = (useContextual ? ctxMap[ctxRoot] : this._map)[z][value];
if(map){
mapCheck[count++] = map;
mapFound = true;
}
}
if(!mapFound){
if(!this.suggest){
found = false;
break;
}
}
else{
check[check.length] = count > 1 ? check.concat.apply([], mapCheck) : mapCheck[0];
}
checkWords[value] = "1";
}
ctxRoot = value;
}
}
else{
found = false;
}
if(found){
result = intersect(check, limit, this.suggest);
}
return result;
};
FlexSearch.prototype.reset = function(){
this.destroy();
return this.init();
};
FlexSearch.prototype.destroy = function(){
this.filter = this.stemmer = this._scores = this._map = this._ctx = this._ids = this._stack = this._stackKeys = null;
return this;
};
var globalEncoderBalance = function(){
var regexWhitespace = regex("\\s\\s+"), regexStrip = regex("[^a-z0-9 ]"), regexSpace = regex("[-/]"),
regexVowel = regex("[aeiouy]");
var regexPairs = [regexSpace, " ", regexStrip, "", regexWhitespace, " "];
return function(value){
return collapseRepeatingChars(replace(value.toLowerCase(), regexPairs));
};
}();
var globalEncoderIcase = function(value){
return value.toLowerCase();
};
var globalEncoder = Object.create({
"icase": globalEncoderIcase, "simple": function(){
var regexWhitespace = regex("\\s\\s+"), regexStrip = regex("[^a-z0-9 ]"), regexSpace = regex("[-/]"),
regexA = regex("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),
regexE = regex("[\u00e8\u00e9\u00ea\u00eb]"), regexI = regex("[\u00ec\u00ed\u00ee\u00ef]"),
regexO = regex("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),
regexU = regex("[\u00f9\u00fa\u00fb\u00fc\u0171]"), regexY = regex("[\u00fd\u0177\u00ff]"),
regexN = regex("\u00f1"), regexC = regex("\u00e7"), regexS = regex("\u00df"),
regexAnd = regex(" & ");
var regexPairs = [regexA, "a", regexE, "e", regexI, "i", regexO, "o", regexU, "u", regexY, "y", regexN, "n", regexC, "c", regexS, "s", regexAnd, " and ", regexSpace, " ", regexStrip, "", regexWhitespace, " "];
return function(str){
str = replace(str.toLowerCase(), regexPairs);
return str !== " " ? str : "";
};
}(), "advanced": function(){
var regexSpace = regex(" "), regexAe = regex("ae"), regexAi = regex("ai"), regexAy = regex("ay"),
regexEy = regex("ey"), regexOe = regex("oe"), regexUe = regex("ue"), regexIe = regex("ie"),
regexSz = regex("sz"), regexZs = regex("zs"), regexCk = regex("ck"), regexCc = regex("cc"),
regexSh = regex("sh"), regexDt = regex("dt"), regexPh = regex("ph"), regexPf = regex("pf"),
regexOu = regex("ou"), regexUo = regex("uo");
var regexPairs = [regexAe, "a", regexAi, "ei", regexAy, "ei", regexEy, "ei", regexOe, "o", regexUe, "u", regexIe, "i", regexSz, "s", regexZs, "s", regexSh, "s", regexCk, "k", regexCc, "k", regexDt, "t", regexPh, "f", regexPf, "f", regexOu, "o", regexUo, "u"];
return function(string, _skipPostProcessing){
if(!string){
return string;
}
string = this["simple"](string);
if(string.length > 2){
string = replace(string, regexPairs);
}
if(!_skipPostProcessing){
if(string.length > 1){
string = collapseRepeatingChars(string);
}
}
return string;
};
}(), "extra": function(){
var soundexB = regex("p"), soundexS = regex("z"), soundexK = regex("[cgq]"), soundexM = regex("n"),
soundexT = regex("d"), soundexF = regex("[vw]");
var regexVowel = regex("[aeiouy]");
var regexPairs = [soundexB, "b", soundexS, "s", soundexK, "k", soundexM, "m", soundexT, "t", soundexF, "f", regexVowel, ""];
return function(str){
if(!str){
return str;
}
str = this["advanced"](str, true);
if(str.length > 1){
str = str.split(" ");
for(var i = 0; i < str.length; i++){
var current = str[i];
if(current.length > 1){
str[i] = current[0] + replace(current.substring(1), regexPairs);
}
}
str = str.join(" ");
str = collapseRepeatingChars(str);
}
return str;
};
}(), "balance": globalEncoderBalance
});
var queue = null;
return FlexSearch;
function registerProperty(obj, key, fn){
Object.defineProperty(obj, key, {get: fn});
}
function regex(str){
return new RegExp(str, "g");
}
function replace(str, regex, replacement){
if(typeof replacement === "undefined"){
for(var i = 0; i < regex.length; i += 2){
str = str.replace(regex[i], regex[i + 1]);
}
return str;
}
else{
return str.replace(regex, replacement);
}
}
function addIndex(map, dupes, tmp, id, partialScore, contextScore, threshold){
if(typeof dupes[tmp] === "undefined"){
var score = partialScore ? (9 - (threshold || 6)) * contextScore + (threshold || 6) * partialScore : contextScore;
dupes[tmp] = score;
if(score >= threshold){
var arr = map[score + 0.5 | 0];
arr = arr[tmp] || (arr[tmp] = []);
arr[arr.length] = id;
}
}
return score || dupes[tmp];
}
function removeIndex(map, id){
if(map){
var keys = Object.keys(map);
for(var i = 0, lengthKeys = keys.length; i < lengthKeys; i++){
var key = keys[i];
var tmp = map[key];
if(tmp){
for(var a = 0, lengthMap = tmp.length; a < lengthMap; a++){
if(tmp[a] === id){
if(lengthMap === 1){
delete map[key];
}
else{
tmp.splice(a, 1);
}
break;
}
else{
if(typeof tmp[a] === "object"){
removeIndex(tmp[a], id);
}
}
}
}
}
}
}
function ngram(value){
var parts = [];
if(!value){
return parts;
}
var countVowels = 0, countLiteral = 0, countParts = 0;
var tmp = "";
var length = value.length;
for(var i = 0; i < length; i++){
var char = value[i];
var charIsVowel = char === "a" || char === "e" || char === "i" || char === "o" || char === "u" || char === "y";
if(charIsVowel){
countVowels++;
}
else{
countLiteral++;
}
if(char !== " "){
tmp += char;
}
if(char === " " || countVowels >= (length > 8 ? 2 : 1) && countLiteral >= 2 || countVowels >= 2 && countLiteral >= (length > 8 ? 2 : 1) || i === length - 1){
if(tmp){
if(parts[countParts] && tmp.length > 2){
countParts++;
}
if(parts[countParts]){
parts[countParts] += tmp;
}
else{
parts[countParts] = tmp;
}
if(char === " "){
countParts++;
}
tmp = "";
}
countVowels = 0;
countLiteral = 0;
}
}
return parts;
}
function collapseRepeatingChars(string){
var collapsedString = "", charPrev = "", charNext = "";
for(var i = 0; i < string.length; i++){
var char = string[i];
if(char !== charPrev){
if(i && char === "h"){
var charPrevIsVowel = charPrev === "a" || charPrev === "e" || charPrev === "i" || charPrev === "o" || charPrev === "u" || charPrev === "y";
var charNextIsVowel = charNext === "a" || charNext === "e" || charNext === "i" || charNext === "o" || charNext === "u" || charNext === "y";
if(charPrevIsVowel && charNextIsVowel || charPrev === " "){
collapsedString += char;
}
}
else{
collapsedString += char;
}
}
charNext = i === string.length - 1 ? "" : string[i + 1];
charPrev = char;
}
return collapsedString;
}
function initFilter(words, encoder){
var final = createObject();
if(words){
for(var i = 0; i < words.length; i++){
var word = encoder ? encoder.call(globalEncoder, words[i]) : words[i];
final[word] = String.fromCharCode(65000 - words.length + i);
}
}
return final;
}
function initStemmer(stemmer, encoder){
var final = [];
if(stemmer){
for(var key in stemmer){
if(stemmer.hasOwnProperty(key)){
var tmp = encoder ? encoder.call(globalEncoder, key) : key;
final.push(regex("(?=.{" + (tmp.length + 3) + ",})" + tmp + "$"), encoder ? encoder.call(globalEncoder, stemmer[key]) : stemmer[key]);
}
}
}
return final;
}
function sortByLengthDown(a, b){
var diff = a.length - b.length;
return diff < 0 ? 1 : diff > 0 ? -1 : 0;
}
function sortByLengthUp(a, b){
var diff = a.length - b.length;
return diff < 0 ? -1 : diff > 0 ? 1 : 0;
}
function intersect(arrays, limit, suggest){
var result = [];
var suggestions = [];
var lengthZ = arrays.length;
if(lengthZ > 1){
arrays.sort(sortByLengthUp);
var check = createObject();
var arr = arrays[0];
var length = arr.length;
var i = 0;
while(i < length){
check[arr[i++]] = 1;
}
var tmp, count = 0;
var z = 1;
while(z < lengthZ){
var found = false;
var isFinalLoop = z === lengthZ - 1;
suggestions = [];
arr = arrays[z];
length = arr.length;
i = -1;
while(i < length){
var checkVal = check[tmp = arr[++i]];
if(checkVal === z){
if(isFinalLoop){
result[count++] = tmp;
if(limit && count === limit){
return result;
}
}
found = true;
check[tmp] = z + 1;
}
else{
if(suggest){
var currentSuggestion = suggestions[checkVal] || (suggestions[checkVal] = []);
currentSuggestion[currentSuggestion.length] = tmp;
}
}
}
if(!found && !suggest){
break;
}
z++;
}
if(suggest){
limit || (limit = 1000);
count = result.length;
length = suggestions.length;
if(count < limit && length){
for(z = length - 1; z >= 0; z--){
tmp = suggestions[z];
if(tmp){
for(i = 0; i < tmp.length; i++){
result[count++] = tmp[i];
if(limit && count === limit){
return result;
}
}
}
}
}
}
}
else{
if(lengthZ){
result = arrays[0];
if(limit && result.length > limit){
result = result.slice(0, limit);
}
}
}
return result;
}
function createObject(count){
if(count){
var array = new Array(count);
for(var i = 0; i < count; i++){
array[i] = createObject();
}
return array;
}
else{
return Object.create(null);
}
}
}(), this);
function provide(name, factory, root){
var prop;
if((prop = root["define"]) && prop["amd"]){
prop([], function(){
return factory;
});
}
else{
if(prop = root["modules"]){
prop[name.toLowerCase()] = factory;
}
else{
if(typeof module !== "undefined"){
module.exports = factory;
}
else{
root[name] = factory;
}
}
}
}
}).call(this);

View File

@@ -129,7 +129,7 @@ var SUPPORT_ASYNC = true;
var filter = createObject();
var stemmer = createObject();
/** @const {Object} */
/** @const {Object<string|number, number>} */
var indexBlacklist = (function(){
var array = Object.getOwnPropertyNames(/** @type {!Array} */ ({}.__proto__));
@@ -328,7 +328,7 @@ var SUPPORT_ASYNC = true;
//self._ids_count[i] = 0;
self._worker[i] = add_worker(self.id, i, options /*|| defaults*/, function(id, query, result, limit){
self._worker[i] = addWorker(self.id, i, options /*|| defaults*/, function(id, query, result, limit){
if(self._taskCompleted === self.worker){
@@ -449,7 +449,7 @@ var SUPPORT_ASYNC = true;
// initialize primary index
this._map = createObject(null, void 0, 10);
this._map = createObject(10);
this._ctx = createObject();
this._ids = createObject();
this._stack = createObject();
@@ -651,10 +651,8 @@ var SUPPORT_ASYNC = true;
)
);
var dupes = {
"_ctx": createObject()
};
var dupes = createObject();
dupes["_ctx"] = createObject();
var threshold = this.threshold;
var depth = this.depth;
@@ -666,7 +664,7 @@ var SUPPORT_ASYNC = true;
for(var i = 0; i < wordLength; i++){
/** @type {string} */
var value = "" + words[i];
var value = words[i];
if(value){
@@ -767,7 +765,7 @@ var SUPPORT_ASYNC = true;
if(depth && (wordLength > 1) && (score >= threshold)){
var ctxDupes = dupes["_ctx"][value] || (dupes["_ctx"][value] = createObject());
var ctxTmp = this._ctx[value] || (this._ctx[value] = createObject(null, void 0, 10));
var ctxTmp = this._ctx[value] || (this._ctx[value] = createObject(10));
var x = i - depth;
var y = i + depth + 1;
@@ -1047,7 +1045,7 @@ var SUPPORT_ASYNC = true;
if(!useContextual || (ctxMap = this._ctx)[ctxRoot]){
for(var a = useContextual ? 1 : 0; a < length; a++){
for(var a = (useContextual ? 1 : 0); a < length; a++){
var value = words[a];
@@ -1265,7 +1263,7 @@ var SUPPORT_ASYNC = true;
return function(value){
return collapseRepeatingChars(replace(value.toLowerCase(), regexPairs));
}
};
})();
/** @const */
@@ -1642,7 +1640,7 @@ var SUPPORT_ASYNC = true;
function regex(str){
return new RegExp("" + str, "g");
return new RegExp(str, "g");
}
/**
@@ -2431,13 +2429,20 @@ var SUPPORT_ASYNC = true;
}
/**
* @param {Object|null=} prototype
* @param {Object=} properties
* @type {Function}
* @const
* @final
*/
//var emptyObject = new Function("var o={};o.__proto__=null;return o;");
/**
* https://jsperf.com/comparison-object-index-type
* @param {number=} count
* @returns {Object|Array<Object>}
*/
function createObject(prototype, properties, count){
function createObject(count){
if(count){
@@ -2445,18 +2450,18 @@ var SUPPORT_ASYNC = true;
for(var i = 0; i < count; i++){
array[i] = createObject(prototype, properties);
array[i] = createObject();
}
return array;
}
else{
return Object.create(prototype || null, properties);
return Object.create(null); //emptyObject();
}
}
function add_worker(id, core, options, callback){
function addWorker(id, core, options, callback){
var thread = registerWorker(

View File

@@ -4,17 +4,17 @@
Released under the Apache 2.0 Licence
https://github.com/nextapps-de/flexsearch
*/
'use strict';(function(e,x,p){var t;(t=p.define)&&t.amd?t([],function(){return x}):(t=p.modules)?t[e.toLowerCase()]=x:"undefined"!==typeof module?module.exports=x:p[e]=x})("FlexSearch",function(){function e(a){"string"!==typeof a||v[a]||(a=D[a]);a||(a=y);this.id=a.id||I++;this.init(a);x(this,"index",function(){return this.a});x(this,"length",function(){return Object.keys(this.a).length})}function x(a,b,c){Object.defineProperty(a,b,{get:c})}function p(a){return new RegExp(a,"g")}function t(a,b,c){if("undefined"===
typeof c){for(c=0;c<b.length;c+=2)a=a.replace(b[c],b[c+1]);return a}return a.replace(b,c)}function A(a,b,c,d,f,m,g){if("undefined"===typeof b[c]){var h=f?(9-(g||6))*m+(g||6)*f:m;b[c]=h;h>=g&&(a=a[h+.5|0],a=a[c]||(a[c]=[]),a[a.length]=d)}return h||b[c]}function B(a,b){if(a)for(var c=Object.keys(a),d=0,f=c.length;d<f;d++){var m=c[d],g=a[m];if(g)for(var h=0,k=g.length;h<k;h++)if(g[h]===b){1===k?delete a[m]:g.splice(h,1);break}else"object"===typeof g[h]&&B(g[h],b)}}function E(a){var b=[];if(!a)return b;
for(var c=0,d=0,f=0,m="",g=a.length,h=0;h<g;h++){var k=a[h];"a"===k||"e"===k||"i"===k||"o"===k||"u"===k||"y"===k?c++:d++;" "!==k&&(m+=k);if(" "===k||c>=(8<g?2:1)&&2<=d||2<=c&&d>=(8<g?2:1)||h===g-1)m&&(b[f]&&2<m.length&&f++,b[f]=b[f]?b[f]+m:m," "===k&&f++,m=""),d=c=0}return b}function J(a,b){a=a.length-b.length;return 0>a?1:0<a?-1:0}function K(a,b){a=a.length-b.length;return 0>a?-1:0<a?1:0}function L(a,b,c){var d=[],f=[],m=a.length;if(1<m){a.sort(K);for(var g=u(),h=a[0],k=h.length,z=0;z<k;)g[h[z++]]=
1;for(var q,e=0,n=1;n<m;){var l=!1,p=n===m-1;f=[];h=a[n];k=h.length;for(z=-1;z<k;){var r=g[q=h[++z]];if(r===n){if(p&&(d[e++]=q,b&&e===b))return d;l=!0;g[q]=n+1}else c&&(r=f[r]||(f[r]=[]),r[r.length]=q)}if(!l&&!c)break;n++}if(c&&(b||(b=1E3),e=d.length,k=f.length,e<b&&k))for(n=k-1;0<=n;n--)if(q=f[n])for(z=0;z<q.length;z++)if(d[e++]=q[z],b&&e===b)return d}else m&&(d=a[0],b&&d.length>b&&(d=d.slice(0,b)));return d}function u(a,b,c){if(c){for(var d=Array(c),f=0;f<c;f++)d[f]=u(a,b);return d}return Object.create(a||
null,b)}var y={encode:"icase",mode:"forward",f:!1,cache:!1,async:!1,i:!1,threshold:0,depth:0},D={memory:{encode:"extra",mode:"strict",threshold:7},speed:{encode:"icase",mode:"strict",threshold:7,depth:2},match:{encode:"extra",mode:"full"},score:{encode:"extra",mode:"strict",threshold:5,depth:4},balance:{encode:"balance",mode:"ngram",threshold:6,depth:3},fastest:{encode:"icase",mode:"strict",threshold:9,depth:1}},C=[],I=0,F=p("[ -/]"),G=u(),H=u(),v=function(){for(var a=Object.getOwnPropertyNames({}.__proto__),
b=u(),c=0;c<a.length;c++)b[a[c]]=1;return b}();e.new=function(a){return new this(a)};e.create=function(a){return e.new(a)};e.registerMatcher=function(a){for(var b in a)a.hasOwnProperty(b)&&C.push(p(b),a[b]);return this};e.registerEncoder=function(a,b){v[a]||(w[a]=b);return this};e.registerLanguage=function(a,b){v[a]||(G[a]=b.filter,H[a]=b.stemmer);return this};e.encode=function(a,b){return v[a]?b:w[a].call(w,b)};e.prototype.init=function(a){this.h=[];a||(a=y);var b=a.profile;b=b&&!v[b]?D[b]:u();this.mode=
a.mode||b.mode||this.mode||y.mode;this.threshold=a.threshold||b.threshold||this.threshold||y.threshold;this.depth=a.depth||b.depth||this.depth||y.depth;this.f=a.suggest||this.f||y.f;this.c=(b=a.encode||b.encode)&&!v[b]&&w[b]||("function"===typeof b?b:this.c||!1);(b=a.matcher)&&this.addMatcher(b);if((b=a.filter)&&!v[b]){var c=G[b]||b,d=this.c,f=u();if(c)for(var m=0;m<c.length;m++){var g=d?d.call(w,c[m]):c[m];f[g]=String.fromCharCode(65E3-c.length+m)}this.filter=f}if((b=a.stemmer)&&!v[b]){a=H[b]||b;
b=this.c;c=[];if(a)for(var h in a)a.hasOwnProperty(h)&&(d=b?b.call(w,h):h,c.push(p("(?=.{"+(d.length+3)+",})"+d+"$"),b?b.call(w,a[h]):a[h]));this.stemmer=c}this.g=u(null,void 0,10);this.b=u();this.a=u();u();return this};e.prototype.encode=function(a){a&&C.length&&(a=t(a,C));a&&this.h.length&&(a=t(a,this.h));a&&this.c&&(a=this.c.call(w,a));a&&this.stemmer&&(a=t(a,this.stemmer));return a};e.prototype.addMatcher=function(a){var b=this.h,c;for(c in a)a.hasOwnProperty(c)&&b.push(p(c),a[c]);return this};
e.prototype.add=function(a,b,c){if("string"===typeof b&&b&&(a&&!v[a]||0===a))if(this.a[a]&&!c)this.update(a,b);else{b=this.encode(b);if(!b.length)return this;c=this.mode;b="function"===typeof c?c(b):"ngram"===c?E(b):b.split(F);for(var d={_ctx:u()},f=this.threshold,m=this.depth,g=this.g,h=b.length,k=0;k<h;k++){var e=""+b[k];if(e){var q=e.length,p=(h-k)/h;switch(c){case "reverse":case "both":for(var n="",l=q-1;1<=l;l--)n=e[l]+n,A(g,d,n,a,(q-l)/q,p,f);case "forward":n="";for(l=0;l<q;l++)n+=e[l],A(g,
d,n,a,1,p,f);break;case "full":for(l=0;l<q;l++)for(var t=(q-l)/q,r=q;r>l;r--)n=e.substring(l,r),A(g,d,n,a,t,p,f);break;default:if(l=A(g,d,e,a,1,p,f),m&&1<h&&l>=f)for(q=d._ctx[e]||(d._ctx[e]=u()),e=this.b[e]||(this.b[e]=u(null,void 0,10)),l=k-m,r=k+m+1,0>l&&(l=0),r>h&&(r=h);l<r;l++)l!==k&&A(e,q,b[l],a,0,10-(l<k?k-l:l-k),f)}}}this.a[a]="1"}return this};e.prototype.update=function(a,b){this.a[a]&&b&&"string"===typeof b&&(this.remove(a),this.add(a,b,!0));return this};e.prototype.remove=function(a){if(this.a[a]&&
!v[a]){for(var b=0;10>b;b++)B(this.g[b],a);this.depth&&B(this.b,a);delete this.a[a]}return this};e.prototype.search=function(a,b,c){var d=[];if(a&&"object"===typeof a){c=a.callback||b;b=a.limit;var f=a.threshold;a=a.query}f=(f||this.threshold||0)|0;"function"===typeof b?(c=b,b=1E3):b||(b=1E3);if(c){var e=this;M(function(){c(e.search(a,b));e=null},1,"search-"+this.id);return null}if(!a||"string"!==typeof a)return d;var g=this.encode(a);if(!g.length)return d;var h=this.mode;g="function"===typeof h?
h(g):"ngram"===h?E(g):g.split(F);h=g.length;var k=!0,p=[],q=u();if(1<h)if(this.depth){var t=!0,n=g[0];q[n]="1"}else g.sort(J);var l;if(!t||(l=this.b)[n])for(var v=t?1:0;v<h;v++){var r=g[v];if(r&&!q[r]){for(var w,x=!1,y=[],A=0,B=9;B>=f;B--)if(w=(t?l[n]:this.g)[B][r])y[A++]=w,x=!0;if(x)p[p.length]=1<A?p.concat.apply([],y):y[0];else if(!this.f){k=!1;break}q[r]="1"}n=r}else k=!1;k&&(d=L(p,b,this.f));return d};e.prototype.reset=function(){this.destroy();return this.init()};e.prototype.destroy=function(){this.filter=
this.stemmer=this.g=this.b=this.a=null;return this};var w=Object.create({icase:function(a){return a.toLowerCase()},balance:function(){var a=[p("[-/]")," ",p("[^a-z0-9 ]"),"",p("\\s\\s+")," "];return function(b){b=t(b.toLowerCase(),a);for(var c="",d="",f="",e=0;e<b.length;e++){var g=b[e];if(g!==d)if(e&&"h"===g){if(f="a"===f||"e"===f||"i"===f||"o"===f||"u"===f||"y"===f,("a"===d||"e"===d||"i"===d||"o"===d||"u"===d||"y"===d)&&f||" "===d)c+=g}else c+=g;f=e===b.length-1?"":b[e+1];d=g}return c}}()}),M=null;
return e}(!1),this);
'use strict';(function(d,x,p){var t;(t=p.define)&&t.amd?t([],function(){return x}):(t=p.modules)?t[d.toLowerCase()]=x:"undefined"!==typeof module?module.exports=x:p[d]=x})("FlexSearch",function(){function d(a){"string"!==typeof a||v[a]||(a=D[a]);a||(a=y);this.id=a.id||I++;this.init(a);x(this,"index",function(){return this.a});x(this,"length",function(){return Object.keys(this.a).length})}function x(a,b,c){Object.defineProperty(a,b,{get:c})}function p(a){return new RegExp(a,"g")}function t(a,b,c){if("undefined"===
typeof c){for(c=0;c<b.length;c+=2)a=a.replace(b[c],b[c+1]);return a}return a.replace(b,c)}function A(a,b,c,e,m,k,f){if("undefined"===typeof b[c]){var g=m?(9-(f||6))*k+(f||6)*m:k;b[c]=g;g>=f&&(a=a[g+.5|0],a=a[c]||(a[c]=[]),a[a.length]=e)}return g||b[c]}function B(a,b){if(a)for(var c=Object.keys(a),e=0,m=c.length;e<m;e++){var k=c[e],f=a[k];if(f)for(var g=0,h=f.length;g<h;g++)if(f[g]===b){1===h?delete a[k]:f.splice(g,1);break}else"object"===typeof f[g]&&B(f[g],b)}}function E(a){var b=[];if(!a)return b;
for(var c=0,e=0,m=0,k="",f=a.length,g=0;g<f;g++){var h=a[g];"a"===h||"e"===h||"i"===h||"o"===h||"u"===h||"y"===h?c++:e++;" "!==h&&(k+=h);if(" "===h||c>=(8<f?2:1)&&2<=e||2<=c&&e>=(8<f?2:1)||g===f-1)k&&(b[m]&&2<k.length&&m++,b[m]=b[m]?b[m]+k:k," "===h&&m++,k=""),e=c=0}return b}function J(a,b){a=a.length-b.length;return 0>a?1:0<a?-1:0}function K(a,b){a=a.length-b.length;return 0>a?-1:0<a?1:0}function L(a,b,c){var e=[],m=[],k=a.length;if(1<k){a.sort(K);for(var f=u(),g=a[0],h=g.length,z=0;z<h;)f[g[z++]]=
1;for(var q,d=0,n=1;n<k;){var l=!1,p=n===k-1;m=[];g=a[n];h=g.length;for(z=-1;z<h;){var r=f[q=g[++z]];if(r===n){if(p&&(e[d++]=q,b&&d===b))return e;l=!0;f[q]=n+1}else c&&(r=m[r]||(m[r]=[]),r[r.length]=q)}if(!l&&!c)break;n++}if(c&&(b||(b=1E3),d=e.length,h=m.length,d<b&&h))for(n=h-1;0<=n;n--)if(q=m[n])for(z=0;z<q.length;z++)if(e[d++]=q[z],b&&d===b)return e}else k&&(e=a[0],b&&e.length>b&&(e=e.slice(0,b)));return e}function u(a){if(a){for(var b=Array(a),c=0;c<a;c++)b[c]=u();return b}return Object.create(null)}
var y={encode:"icase",mode:"forward",f:!1,cache:!1,async:!1,i:!1,threshold:0,depth:0},D={memory:{encode:"extra",mode:"strict",threshold:7},speed:{encode:"icase",mode:"strict",threshold:7,depth:2},match:{encode:"extra",mode:"full"},score:{encode:"extra",mode:"strict",threshold:5,depth:4},balance:{encode:"balance",mode:"ngram",threshold:6,depth:3},fastest:{encode:"icase",mode:"strict",threshold:9,depth:1}},C=[],I=0,F=p("[ -/]"),G=u(),H=u(),v=function(){for(var a=Object.getOwnPropertyNames({}.__proto__),
b=u(),c=0;c<a.length;c++)b[a[c]]=1;return b}();d.new=function(a){return new this(a)};d.create=function(a){return d.new(a)};d.registerMatcher=function(a){for(var b in a)a.hasOwnProperty(b)&&C.push(p(b),a[b]);return this};d.registerEncoder=function(a,b){v[a]||(w[a]=b);return this};d.registerLanguage=function(a,b){v[a]||(G[a]=b.filter,H[a]=b.stemmer);return this};d.encode=function(a,b){return v[a]?b:w[a].call(w,b)};d.prototype.init=function(a){this.h=[];a||(a=y);var b=a.profile;b=b&&!v[b]?D[b]:u();this.mode=
a.mode||b.mode||this.mode||y.mode;this.threshold=a.threshold||b.threshold||this.threshold||y.threshold;this.depth=a.depth||b.depth||this.depth||y.depth;this.f=a.suggest||this.f||y.f;this.c=(b=a.encode||b.encode)&&!v[b]&&w[b]||("function"===typeof b?b:this.c||!1);(b=a.matcher)&&this.addMatcher(b);if((b=a.filter)&&!v[b]){var c=G[b]||b,e=this.c,m=u();if(c)for(var k=0;k<c.length;k++){var f=e?e.call(w,c[k]):c[k];m[f]=String.fromCharCode(65E3-c.length+k)}this.filter=m}if((b=a.stemmer)&&!v[b]){a=H[b]||b;
b=this.c;c=[];if(a)for(var g in a)a.hasOwnProperty(g)&&(e=b?b.call(w,g):g,c.push(p("(?=.{"+(e.length+3)+",})"+e+"$"),b?b.call(w,a[g]):a[g]));this.stemmer=c}this.g=u(10);this.b=u();this.a=u();u();return this};d.prototype.encode=function(a){a&&C.length&&(a=t(a,C));a&&this.h.length&&(a=t(a,this.h));a&&this.c&&(a=this.c.call(w,a));a&&this.stemmer&&(a=t(a,this.stemmer));return a};d.prototype.addMatcher=function(a){var b=this.h,c;for(c in a)a.hasOwnProperty(c)&&b.push(p(c),a[c]);return this};d.prototype.add=
function(a,b,c){if("string"===typeof b&&b&&(a&&!v[a]||0===a))if(this.a[a]&&!c)this.update(a,b);else{b=this.encode(b);if(!b.length)return this;c=this.mode;b="function"===typeof c?c(b):"ngram"===c?E(b):b.split(F);var e=u();e._ctx=u();for(var m=this.threshold,k=this.depth,f=this.g,g=b.length,h=0;h<g;h++){var d=b[h];if(d){var q=d.length,p=(g-h)/g;switch(c){case "reverse":case "both":for(var n="",l=q-1;1<=l;l--)n=d[l]+n,A(f,e,n,a,(q-l)/q,p,m);case "forward":n="";for(l=0;l<q;l++)n+=d[l],A(f,e,n,a,1,p,m);
break;case "full":for(l=0;l<q;l++)for(var t=(q-l)/q,r=q;r>l;r--)n=d.substring(l,r),A(f,e,n,a,t,p,m);break;default:if(l=A(f,e,d,a,1,p,m),k&&1<g&&l>=m)for(q=e._ctx[d]||(e._ctx[d]=u()),d=this.b[d]||(this.b[d]=u(10)),l=h-k,r=h+k+1,0>l&&(l=0),r>g&&(r=g);l<r;l++)l!==h&&A(d,q,b[l],a,0,10-(l<h?h-l:l-h),m)}}}this.a[a]="1"}return this};d.prototype.update=function(a,b){this.a[a]&&b&&"string"===typeof b&&(this.remove(a),this.add(a,b,!0));return this};d.prototype.remove=function(a){if(this.a[a]&&!v[a]){for(var b=
0;10>b;b++)B(this.g[b],a);this.depth&&B(this.b,a);delete this.a[a]}return this};d.prototype.search=function(a,b,c){var e=[];if(a&&"object"===typeof a){c=a.callback||b;b=a.limit;var m=a.threshold;a=a.query}m=(m||this.threshold||0)|0;"function"===typeof b?(c=b,b=1E3):b||(b=1E3);if(c){var d=this;M(function(){c(d.search(a,b));d=null},1,"search-"+this.id);return null}if(!a||"string"!==typeof a)return e;var f=this.encode(a);if(!f.length)return e;var g=this.mode;f="function"===typeof g?g(f):"ngram"===g?
E(f):f.split(F);g=f.length;var h=!0,p=[],q=u();if(1<g)if(this.depth){var t=!0,n=f[0];q[n]="1"}else f.sort(J);var l;if(!t||(l=this.b)[n])for(var v=t?1:0;v<g;v++){var r=f[v];if(r&&!q[r]){for(var w,x=!1,y=[],A=0,B=9;B>=m;B--)if(w=(t?l[n]:this.g)[B][r])y[A++]=w,x=!0;if(x)p[p.length]=1<A?p.concat.apply([],y):y[0];else if(!this.f){h=!1;break}q[r]="1"}n=r}else h=!1;h&&(e=L(p,b,this.f));return e};d.prototype.reset=function(){this.destroy();return this.init()};d.prototype.destroy=function(){this.filter=this.stemmer=
this.g=this.b=this.a=null;return this};var w=Object.create({icase:function(a){return a.toLowerCase()},balance:function(){var a=[p("[-/]")," ",p("[^a-z0-9 ]"),"",p("\\s\\s+")," "];return function(b){b=t(b.toLowerCase(),a);for(var c="",e="",d="",k=0;k<b.length;k++){var f=b[k];if(f!==e)if(k&&"h"===f){if(d="a"===d||"e"===d||"i"===d||"o"===d||"u"===d||"y"===d,("a"===e||"e"===e||"i"===e||"o"===e||"u"===e||"y"===e)&&d||" "===e)c+=f}else c+=f;d=k===b.length-1?"":b[k+1];e=f}return c}}()}),M=null;return d}(!1),
this);

42
flexsearch.min.js vendored
View File

@@ -7,24 +7,24 @@
'use strict';(function(u,D,f){var w;(w=f.define)&&w.amd?w([],function(){return D}):(w=f.modules)?w[u.toLowerCase()]=D:"undefined"!==typeof module?module.exports=D:f[u]=D})("FlexSearch",function P(u){function f(a){"string"!==typeof a||x[a]||(a=I[a]);a||(a=y);this.id=a.id||Q++;this.init(a);w(this,"index",function(){return this.a});w(this,"length",function(){return Object.keys(this.a).length})}function w(a,b,e){Object.defineProperty(a,b,{get:e})}function d(a){return new RegExp(a,"g")}function A(a,b,
e){if("undefined"===typeof e){for(e=0;e<b.length;e+=2)a=a.replace(b[e],b[e+1]);return a}return a.replace(b,e)}function z(a,b,e,c,l,B,g){if("undefined"===typeof b[e]){var h=l?(9-(g||6))*B+(g||6)*l:B;b[e]=h;h>=g&&(a=a[h+.5|0],a=a[e]||(a[e]=[]),a[a.length]=c)}return h||b[e]}function m(a,b){if(a)for(var e=Object.keys(a),c=0,l=e.length;c<l;c++){var B=e[c],g=a[B];if(g)for(var h=0,d=g.length;h<d;h++)if(g[h]===b){1===d?delete a[B]:g.splice(h,1);break}else"object"===typeof g[h]&&m(g[h],b)}}function J(a){var b=
[];if(!a)return b;for(var e=0,c=0,l=0,B="",g=a.length,h=0;h<g;h++){var d=a[h];"a"===d||"e"===d||"i"===d||"o"===d||"u"===d||"y"===d?e++:c++;" "!==d&&(B+=d);if(" "===d||e>=(8<g?2:1)&&2<=c||2<=e&&c>=(8<g?2:1)||h===g-1)B&&(b[l]&&2<B.length&&l++,b[l]=b[l]?b[l]+B:B," "===d&&l++,B=""),c=e=0}return b}function G(a){for(var b="",e="",c="",l=0;l<a.length;l++){var d=a[l];if(d!==e)if(l&&"h"===d){if(c="a"===c||"e"===c||"i"===c||"o"===c||"u"===c||"y"===c,("a"===e||"e"===e||"i"===e||"o"===e||"u"===e||"y"===e)&&c||
" "===e)b+=d}else b+=d;c=l===a.length-1?"":a[l+1];e=d}return b}function R(a,b){var e=t();if(a)for(var c=0;c<a.length;c++){var l=b?b.call(C,a[c]):a[c];e[l]=String.fromCharCode(65E3-a.length+c)}return e}function S(a,b){var e=[];if(a)for(var c in a)if(a.hasOwnProperty(c)){var l=b?b.call(C,c):c;e.push(d("(?=.{"+(l.length+3)+",})"+l+"$"),b?b.call(C,a[c]):a[c])}return e}function T(a,b){a=a.length-b.length;return 0>a?1:0<a?-1:0}function U(a,b){a=a.length-b.length;return 0>a?-1:0<a?1:0}function V(a,b,e){var c=
[],l=[],d=a.length;if(1<d){a.sort(U);for(var g=t(),h=a[0],f=h.length,n=0;n<f;)g[h[n++]]=1;for(var q,v=0,p=1;p<d;){var k=!1,m=p===d-1;l=[];h=a[p];f=h.length;for(n=-1;n<f;){var r=g[q=h[++n]];if(r===p){if(m&&(c[v++]=q,b&&v===b))return c;k=!0;g[q]=p+1}else e&&(r=l[r]||(l[r]=[]),r[r.length]=q)}if(!k&&!e)break;p++}if(e&&(b||(b=1E3),v=c.length,f=l.length,v<b&&f))for(p=f-1;0<=p;p--)if(q=l[p])for(n=0;n<q.length;n++)if(c[v++]=q[n],b&&v===b)return c}else d&&(c=a[0],b&&c.length>b&&(c=c.slice(0,b)));return c}
function H(a){a.B||(a.B=K(function(){a.B=null;var b=a.async;b&&(a.async=!1);if(a.b.length){for(var e=L(),c;(c=a.b.shift())||0===c;){var d=a.f[c];switch(d[0]){case E.add:a.add(d[1],d[2]);break;case E.remove:a.remove(d[1])}delete a.f[c];if(100<L()-e)break}a.b.length&&H(a)}b&&(a.async=b)},1,"search-async-"+a.id))}function L(){return"undefined"!==typeof performance?performance.now():(new Date).getTime()}function t(a,b,e){if(e){for(var c=Array(e),d=0;d<e;d++)c[d]=t(a,b);return c}return Object.create(a||
null,b)}function W(a,b,e,c){a=u("flexsearch","id"+a,function(){var a,b;self.onmessage=function(c){if(c=c.data)if(c.search){var e=b.search(c.content,c.threshold?{limit:c.limit,threshold:c.threshold}:c.limit);self.postMessage({id:a,content:c.content,limit:c.limit,result:e})}else c.add?b.add(c.id,c.content):c.update?b.update(c.id,c.content):c.remove?b.remove(c.id):c.reset?b.reset():c.info?(c=b.info(),c.worker=a,b.debug&&console.log(c)):c.register&&(a=c.id,c.options.cache=!1,c.options.async=!0,c.options.worker=
!1,b=(new Function(c.register.substring(c.register.indexOf("{")+1,c.register.lastIndexOf("}"))))(),b=new b(c.options))}},function(a){(a=a.data)&&a.result?c(a.id,a.content,a.result,a.limit):e.debug&&console.log(a)},b);var d=P.toString();e.id=b;a.postMessage(b,{register:d,options:e,id:b});return a}var y={encode:"icase",mode:"forward",u:!1,cache:!1,async:!1,c:!1,threshold:0,depth:0},I={memory:{encode:"extra",mode:"strict",threshold:7},speed:{encode:"icase",mode:"strict",threshold:7,depth:2},match:{encode:"extra",
mode:"full"},score:{encode:"extra",mode:"strict",threshold:5,depth:4},balance:{encode:"balance",mode:"ngram",threshold:6,depth:3},fastest:{encode:"icase",mode:"strict",threshold:9,depth:1}},F=[],Q=0,E={add:0,update:1,remove:2},M=d("[ -/]"),N=t(),O=t(),x=function(){for(var a=Object.getOwnPropertyNames({}.__proto__),b=t(),e=0;e<a.length;e++)b[a[e]]=1;return b}();f.new=function(a){return new this(a)};f.create=function(a){return f.new(a)};f.registerMatcher=function(a){for(var b in a)a.hasOwnProperty(b)&&
F.push(d(b),a[b]);return this};f.registerEncoder=function(a,b){x[a]||(C[a]=b);return this};f.registerLanguage=function(a,b){x[a]||(N[a]=b.filter,O[a]=b.stemmer);return this};f.encode=function(a,b){return x[a]?b:C[a].call(C,b)};f.prototype.init=function(a){this.A=[];a||(a=y);var b=a.profile,e=b&&!x[b]?I[b]:t();if(b=a.worker)if("undefined"===typeof Worker)a.worker=!1,this.h=null;else{var c=this;b=parseInt(b,10)||4;c.m=-1;c.o=0;c.g=[];c.w=null;c.h=Array(b);for(var d=0;d<b;d++)c.h[d]=W(c.id,d,a,function(a,
b,e,d){if(c.o!==c.c)return c.g=c.g.concat(e),c.o++,d&&c.g.length>=d&&(c.o=c.c),c.w&&c.o===c.c&&(c.cache&&c.i.set(b,c.g),c.w(c.g),c.g=[]),c})}this.mode=a.mode||e.mode||this.mode||y.mode;this.async=a.async||this.async||y.async;this.c=a.worker||this.c||y.c;this.threshold=a.threshold||e.threshold||this.threshold||y.threshold;this.depth=a.depth||e.depth||this.depth||y.depth;this.u=a.suggest||this.u||y.u;this.s=(b=a.encode||e.encode)&&!x[b]&&C[b]||("function"===typeof b?b:this.s||!1);this.debug=a.debug||
this.debug;(b=a.matcher)&&this.addMatcher(b);(b=a.filter)&&!x[b]&&(this.filter=R(N[b]||b,this.s));(b=a.stemmer)&&!x[b]&&(this.stemmer=S(O[b]||b,this.s));this.j=t(null,void 0,10);this.l=t();this.a=t();this.f=t();this.b=[];this.B=null;this.v=!0;this.i=(this.cache=b=a.cache||this.cache||y.cache)?new X(b):!1;return this};f.prototype.encode=function(a){a&&F.length&&(a=A(a,F));a&&this.A.length&&(a=A(a,this.A));a&&this.s&&(a=this.s.call(C,a));a&&this.stemmer&&(a=A(a,this.stemmer));return a};f.prototype.addMatcher=
function(a){var b=this.A,e;for(e in a)a.hasOwnProperty(e)&&b.push(d(e),a[e]);return this};f.prototype.add=function(a,b,e){if("string"===typeof b&&b&&(a&&!x[a]||0===a))if(this.a[a]&&!e)this.update(a,b);else{if(this.c)return++this.m>=this.h.length&&(this.m=0),this.h[this.m].postMessage(this.m,{add:!0,id:a,content:b}),this.a[a]=""+this.m,this;if(this.async)return this.f[a]||(this.b[this.b.length]=a),this.f[a]=[E.add,a,b],H(this),this;b=this.encode(b);if(!b.length)return this;e=this.mode;b="function"===
typeof e?e(b):"ngram"===e?J(b):b.split(M);for(var c={_ctx:t()},d=this.threshold,f=this.depth,g=this.j,h=b.length,m=0;m<h;m++){var n=""+b[m];if(n){var q=n.length,v=(h-m)/h;switch(e){case "reverse":case "both":for(var p="",k=q-1;1<=k;k--)p=n[k]+p,z(g,c,p,a,(q-k)/q,v,d);case "forward":p="";for(k=0;k<q;k++)p+=n[k],z(g,c,p,a,1,v,d);break;case "full":for(k=0;k<q;k++)for(var u=(q-k)/q,r=q;r>k;r--)p=n.substring(k,r),z(g,c,p,a,u,v,d);break;default:if(k=z(g,c,n,a,1,v,d),f&&1<h&&k>=d)for(q=c._ctx[n]||(c._ctx[n]=
t()),n=this.l[n]||(this.l[n]=t(null,void 0,10)),k=m-f,r=m+f+1,0>k&&(k=0),r>h&&(r=h);k<r;k++)k!==m&&z(n,q,b[k],a,0,10-(k<m?m-k:k-m),d)}}}this.a[a]="1";this.v=!1}return this};f.prototype.update=function(a,b){this.a[a]&&b&&"string"===typeof b&&(this.remove(a),this.add(a,b,!0));return this};f.prototype.remove=function(a){if(this.a[a]&&!x[a]){if(this.c){var b=parseInt(this.a[a],10);this.h[b].postMessage(b,{remove:!0,id:a});delete this.a[a];return this}if(this.async)return this.f[a]||(this.b[this.b.length]=
a),this.f[a]=[E.remove,a],H(this),this;for(b=0;10>b;b++)m(this.j[b],a);this.depth&&m(this.l,a);delete this.a[a];this.v=!1}return this};f.prototype.search=function(a,b,e){var c=[];if(a&&"object"===typeof a){e=a.callback||b;b=a.limit;var d=a.threshold;a=a.query}d=(d||this.threshold||0)|0;"function"===typeof b?(e=b,b=1E3):b||(b=1E3);if(this.c){this.w=e;this.o=0;this.g=[];for(c=0;c<this.c;c++)this.h[c].postMessage(c,{search:!0,limit:b,threshold:d,content:a});return null}if(e){var f=this;K(function(){e(f.search(a,
b));f=null},1,"search-"+this.id);return null}if(!a||"string"!==typeof a)return c;var g=a;if(this.cache)if(this.v){var h=this.i.get(a);if(h)return h}else this.i.reset(),this.v=!0;g=this.encode(g);if(!g.length)return c;h=this.mode;g="function"===typeof h?h(g):"ngram"===h?J(g):g.split(M);h=g.length;var m=!0,n=[],q=t();if(1<h)if(this.depth){var v=!0,p=g[0];q[p]="1"}else g.sort(T);var k;if(!v||(k=this.l)[p])for(var u=v?1:0;u<h;u++){var r=g[u];if(r&&!q[r]){for(var w,x=!1,y=[],A=0,z=9;z>=d;z--)if(w=(v?k[p]:
this.j)[z][r])y[A++]=w,x=!0;if(x)n[n.length]=1<A?n.concat.apply([],y):y[0];else if(!this.u){m=!1;break}q[r]="1"}p=r}else m=!1;m&&(c=V(n,b,this.u));this.cache&&this.i.set(a,c);return c};f.prototype.info=function(){if(this.c)for(var a=0;a<this.c;a++)this.h[a].postMessage(a,{info:!0,id:this.id});else{for(var b,e,c=0,d=0,f=0,g=0;10>g;g++)for(b=Object.keys(this.j[g]),a=0;a<b.length;a++)e=this.j[g][b[a]].length,c+=1*e+2*b[a].length+4,d+=e,f+=2*b[a].length;b=Object.keys(this.a);e=b.length;for(a=0;a<e;a++)c+=
2*b[a].length+2;return{id:this.id,memory:c,items:e,sequences:d,chars:f,cache:this.b.length,matcher:F.length,worker:this.c}}};f.prototype.reset=function(){this.destroy();return this.init()};f.prototype.destroy=function(){this.cache&&(this.i.reset(),this.i=null);this.filter=this.stemmer=this.j=this.l=this.a=this.f=this.b=null;return this};var C=Object.create({icase:function(a){return a.toLowerCase()},simple:function(){var a=[d("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),"a",d("[\u00e8\u00e9\u00ea\u00eb]"),
"e",d("[\u00ec\u00ed\u00ee\u00ef]"),"i",d("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),"o",d("[\u00f9\u00fa\u00fb\u00fc\u0171]"),"u",d("[\u00fd\u0177\u00ff]"),"y",d("\u00f1"),"n",d("\u00e7"),"c",d("\u00df"),"s",d(" & ")," and ",d("[-/]")," ",d("[^a-z0-9 ]"),"",d("\\s\\s+")," "];return function(b){b=A(b.toLowerCase(),a);return" "!==b?b:""}}(),advanced:function(){var a=[d("ae"),"a",d("ai"),"ei",d("ay"),"ei",d("ey"),"ei",d("oe"),"o",d("ue"),"u",d("ie"),"i",d("sz"),"s",d("zs"),"s",d("sh"),"s",d("ck"),"k",
d("cc"),"k",d("dt"),"t",d("ph"),"f",d("pf"),"f",d("ou"),"o",d("uo"),"u"];return function(b,e){if(!b)return b;b=this.simple(b);2<b.length&&(b=A(b,a));e||1<b.length&&(b=G(b));return b}}(),extra:function(){var a=[d("p"),"b",d("z"),"s",d("[cgq]"),"k",d("n"),"m",d("d"),"t",d("[vw]"),"f",d("[aeiouy]"),""];return function(b){if(!b)return b;b=this.advanced(b,!0);if(1<b.length){b=b.split(" ");for(var e=0;e<b.length;e++){var c=b[e];1<c.length&&(b[e]=c[0]+A(c.substring(1),a))}b=b.join(" ");b=G(b)}return b}}(),
balance:function(){var a=[d("[-/]")," ",d("[^a-z0-9 ]"),"",d("\\s\\s+")," "];return function(b){return G(A(b.toLowerCase(),a))}}()}),K=function(){var a=t();return function(b,e,c){var d=a[c];d&&clearTimeout(d);return a[c]=setTimeout(b,e)}}(),X=function(){function a(a){this.reset();this.b=!0!==a&&a}a.prototype.reset=function(){this.cache=t();this.count=t();this.index=t();this.a=[]};a.prototype.set=function(a,d){if(this.b&&"undefined"===typeof this.cache[a]){var b=this.a.length;if(b===this.b){b--;var e=
this.a[b];delete this.cache[e];delete this.count[e];delete this.index[e]}this.index[a]=b;this.a[b]=a;this.count[a]=-1;this.cache[a]=d;this.get(a)}else this.cache[a]=d};a.prototype.get=function(a){var b=this.cache[a];if(this.b&&b){var c=++this.count[a],d=this.index,f=d[a];if(0<f){for(var g=this.a,h=f;this.count[g[--f]]<=c&&-1!==f;);f++;if(f!==h){for(c=h;c>f;c--)h=g[c-1],g[c]=h,d[h]=c;g[f]=a;d[a]=f}}}return b};return a}();return f}(function(){var u=Object.create(null),D=!("undefined"===typeof Blob||
"undefined"===typeof URL||!URL.createObjectURL);return function(f,w,d,A,z){var m=f;f=D?URL.createObjectURL(new Blob(["var SUPPORT_WORKER = true;var SUPPORT_BUILTINS = true;var SUPPORT_DEBUG = true;var SUPPORT_CACHE = true;var SUPPORT_ASYNC = true;("+d.toString()+")()"],{type:"text/javascript"})):"../"+m+".js";m+="-"+w;u[m]||(u[m]=[]);u[m][z]=new Worker(f);u[m][z].onmessage=A;console.log("Register Worker: "+m+"@"+z);return{postMessage:function(d,f){u[m][d].postMessage(f)}}}}()),this);
" "===e)b+=d}else b+=d;c=l===a.length-1?"":a[l+1];e=d}return b}function R(a,b){var e=r();if(a)for(var c=0;c<a.length;c++){var l=b?b.call(C,a[c]):a[c];e[l]=String.fromCharCode(65E3-a.length+c)}return e}function S(a,b){var e=[];if(a)for(var c in a)if(a.hasOwnProperty(c)){var l=b?b.call(C,c):c;e.push(d("(?=.{"+(l.length+3)+",})"+l+"$"),b?b.call(C,a[c]):a[c])}return e}function T(a,b){a=a.length-b.length;return 0>a?1:0<a?-1:0}function U(a,b){a=a.length-b.length;return 0>a?-1:0<a?1:0}function V(a,b,e){var c=
[],l=[],d=a.length;if(1<d){a.sort(U);for(var g=r(),h=a[0],f=h.length,n=0;n<f;)g[h[n++]]=1;for(var q,v=0,p=1;p<d;){var k=!1,m=p===d-1;l=[];h=a[p];f=h.length;for(n=-1;n<f;){var t=g[q=h[++n]];if(t===p){if(m&&(c[v++]=q,b&&v===b))return c;k=!0;g[q]=p+1}else e&&(t=l[t]||(l[t]=[]),t[t.length]=q)}if(!k&&!e)break;p++}if(e&&(b||(b=1E3),v=c.length,f=l.length,v<b&&f))for(p=f-1;0<=p;p--)if(q=l[p])for(n=0;n<q.length;n++)if(c[v++]=q[n],b&&v===b)return c}else d&&(c=a[0],b&&c.length>b&&(c=c.slice(0,b)));return c}
function H(a){a.B||(a.B=K(function(){a.B=null;var b=a.async;b&&(a.async=!1);if(a.b.length){for(var e=L(),c;(c=a.b.shift())||0===c;){var d=a.f[c];switch(d[0]){case E.add:a.add(d[1],d[2]);break;case E.remove:a.remove(d[1])}delete a.f[c];if(100<L()-e)break}a.b.length&&H(a)}b&&(a.async=b)},1,"search-async-"+a.id))}function L(){return"undefined"!==typeof performance?performance.now():(new Date).getTime()}function r(a){if(a){for(var b=Array(a),e=0;e<a;e++)b[e]=r();return b}return Object.create(null)}function W(a,
b,e,c){a=u("flexsearch","id"+a,function(){var a,b;self.onmessage=function(c){if(c=c.data)if(c.search){var e=b.search(c.content,c.threshold?{limit:c.limit,threshold:c.threshold}:c.limit);self.postMessage({id:a,content:c.content,limit:c.limit,result:e})}else c.add?b.add(c.id,c.content):c.update?b.update(c.id,c.content):c.remove?b.remove(c.id):c.reset?b.reset():c.info?(c=b.info(),c.worker=a,b.debug&&console.log(c)):c.register&&(a=c.id,c.options.cache=!1,c.options.async=!0,c.options.worker=!1,b=(new Function(c.register.substring(c.register.indexOf("{")+
1,c.register.lastIndexOf("}"))))(),b=new b(c.options))}},function(a){(a=a.data)&&a.result?c(a.id,a.content,a.result,a.limit):e.debug&&console.log(a)},b);var d=P.toString();e.id=b;a.postMessage(b,{register:d,options:e,id:b});return a}var y={encode:"icase",mode:"forward",u:!1,cache:!1,async:!1,c:!1,threshold:0,depth:0},I={memory:{encode:"extra",mode:"strict",threshold:7},speed:{encode:"icase",mode:"strict",threshold:7,depth:2},match:{encode:"extra",mode:"full"},score:{encode:"extra",mode:"strict",threshold:5,
depth:4},balance:{encode:"balance",mode:"ngram",threshold:6,depth:3},fastest:{encode:"icase",mode:"strict",threshold:9,depth:1}},F=[],Q=0,E={add:0,update:1,remove:2},M=d("[ -/]"),N=r(),O=r(),x=function(){for(var a=Object.getOwnPropertyNames({}.__proto__),b=r(),e=0;e<a.length;e++)b[a[e]]=1;return b}();f.new=function(a){return new this(a)};f.create=function(a){return f.new(a)};f.registerMatcher=function(a){for(var b in a)a.hasOwnProperty(b)&&F.push(d(b),a[b]);return this};f.registerEncoder=function(a,
b){x[a]||(C[a]=b);return this};f.registerLanguage=function(a,b){x[a]||(N[a]=b.filter,O[a]=b.stemmer);return this};f.encode=function(a,b){return x[a]?b:C[a].call(C,b)};f.prototype.init=function(a){this.A=[];a||(a=y);var b=a.profile,e=b&&!x[b]?I[b]:r();if(b=a.worker)if("undefined"===typeof Worker)a.worker=!1,this.h=null;else{var c=this;b=parseInt(b,10)||4;c.m=-1;c.o=0;c.g=[];c.w=null;c.h=Array(b);for(var d=0;d<b;d++)c.h[d]=W(c.id,d,a,function(a,b,e,d){if(c.o!==c.c)return c.g=c.g.concat(e),c.o++,d&&
c.g.length>=d&&(c.o=c.c),c.w&&c.o===c.c&&(c.cache&&c.i.set(b,c.g),c.w(c.g),c.g=[]),c})}this.mode=a.mode||e.mode||this.mode||y.mode;this.async=a.async||this.async||y.async;this.c=a.worker||this.c||y.c;this.threshold=a.threshold||e.threshold||this.threshold||y.threshold;this.depth=a.depth||e.depth||this.depth||y.depth;this.u=a.suggest||this.u||y.u;this.s=(b=a.encode||e.encode)&&!x[b]&&C[b]||("function"===typeof b?b:this.s||!1);this.debug=a.debug||this.debug;(b=a.matcher)&&this.addMatcher(b);(b=a.filter)&&
!x[b]&&(this.filter=R(N[b]||b,this.s));(b=a.stemmer)&&!x[b]&&(this.stemmer=S(O[b]||b,this.s));this.j=r(10);this.l=r();this.a=r();this.f=r();this.b=[];this.B=null;this.v=!0;this.i=(this.cache=b=a.cache||this.cache||y.cache)?new X(b):!1;return this};f.prototype.encode=function(a){a&&F.length&&(a=A(a,F));a&&this.A.length&&(a=A(a,this.A));a&&this.s&&(a=this.s.call(C,a));a&&this.stemmer&&(a=A(a,this.stemmer));return a};f.prototype.addMatcher=function(a){var b=this.A,e;for(e in a)a.hasOwnProperty(e)&&b.push(d(e),
a[e]);return this};f.prototype.add=function(a,b,e){if("string"===typeof b&&b&&(a&&!x[a]||0===a))if(this.a[a]&&!e)this.update(a,b);else{if(this.c)return++this.m>=this.h.length&&(this.m=0),this.h[this.m].postMessage(this.m,{add:!0,id:a,content:b}),this.a[a]=""+this.m,this;if(this.async)return this.f[a]||(this.b[this.b.length]=a),this.f[a]=[E.add,a,b],H(this),this;b=this.encode(b);if(!b.length)return this;e=this.mode;b="function"===typeof e?e(b):"ngram"===e?J(b):b.split(M);var c=r();c._ctx=r();for(var d=
this.threshold,f=this.depth,g=this.j,h=b.length,m=0;m<h;m++){var n=b[m];if(n){var q=n.length,v=(h-m)/h;switch(e){case "reverse":case "both":for(var p="",k=q-1;1<=k;k--)p=n[k]+p,z(g,c,p,a,(q-k)/q,v,d);case "forward":p="";for(k=0;k<q;k++)p+=n[k],z(g,c,p,a,1,v,d);break;case "full":for(k=0;k<q;k++)for(var u=(q-k)/q,t=q;t>k;t--)p=n.substring(k,t),z(g,c,p,a,u,v,d);break;default:if(k=z(g,c,n,a,1,v,d),f&&1<h&&k>=d)for(q=c._ctx[n]||(c._ctx[n]=r()),n=this.l[n]||(this.l[n]=r(10)),k=m-f,t=m+f+1,0>k&&(k=0),t>
h&&(t=h);k<t;k++)k!==m&&z(n,q,b[k],a,0,10-(k<m?m-k:k-m),d)}}}this.a[a]="1";this.v=!1}return this};f.prototype.update=function(a,b){this.a[a]&&b&&"string"===typeof b&&(this.remove(a),this.add(a,b,!0));return this};f.prototype.remove=function(a){if(this.a[a]&&!x[a]){if(this.c){var b=parseInt(this.a[a],10);this.h[b].postMessage(b,{remove:!0,id:a});delete this.a[a];return this}if(this.async)return this.f[a]||(this.b[this.b.length]=a),this.f[a]=[E.remove,a],H(this),this;for(b=0;10>b;b++)m(this.j[b],a);
this.depth&&m(this.l,a);delete this.a[a];this.v=!1}return this};f.prototype.search=function(a,b,e){var c=[];if(a&&"object"===typeof a){e=a.callback||b;b=a.limit;var d=a.threshold;a=a.query}d=(d||this.threshold||0)|0;"function"===typeof b?(e=b,b=1E3):b||(b=1E3);if(this.c){this.w=e;this.o=0;this.g=[];for(c=0;c<this.c;c++)this.h[c].postMessage(c,{search:!0,limit:b,threshold:d,content:a});return null}if(e){var f=this;K(function(){e(f.search(a,b));f=null},1,"search-"+this.id);return null}if(!a||"string"!==
typeof a)return c;var g=a;if(this.cache)if(this.v){var h=this.i.get(a);if(h)return h}else this.i.reset(),this.v=!0;g=this.encode(g);if(!g.length)return c;h=this.mode;g="function"===typeof h?h(g):"ngram"===h?J(g):g.split(M);h=g.length;var m=!0,n=[],q=r();if(1<h)if(this.depth){var v=!0,p=g[0];q[p]="1"}else g.sort(T);var k;if(!v||(k=this.l)[p])for(var u=v?1:0;u<h;u++){var t=g[u];if(t&&!q[t]){for(var w,x=!1,y=[],A=0,z=9;z>=d;z--)if(w=(v?k[p]:this.j)[z][t])y[A++]=w,x=!0;if(x)n[n.length]=1<A?n.concat.apply([],
y):y[0];else if(!this.u){m=!1;break}q[t]="1"}p=t}else m=!1;m&&(c=V(n,b,this.u));this.cache&&this.i.set(a,c);return c};f.prototype.info=function(){if(this.c)for(var a=0;a<this.c;a++)this.h[a].postMessage(a,{info:!0,id:this.id});else{for(var b,e,c=0,d=0,f=0,g=0;10>g;g++)for(b=Object.keys(this.j[g]),a=0;a<b.length;a++)e=this.j[g][b[a]].length,c+=1*e+2*b[a].length+4,d+=e,f+=2*b[a].length;b=Object.keys(this.a);e=b.length;for(a=0;a<e;a++)c+=2*b[a].length+2;return{id:this.id,memory:c,items:e,sequences:d,
chars:f,cache:this.b.length,matcher:F.length,worker:this.c}}};f.prototype.reset=function(){this.destroy();return this.init()};f.prototype.destroy=function(){this.cache&&(this.i.reset(),this.i=null);this.filter=this.stemmer=this.j=this.l=this.a=this.f=this.b=null;return this};var C=Object.create({icase:function(a){return a.toLowerCase()},simple:function(){var a=[d("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),"a",d("[\u00e8\u00e9\u00ea\u00eb]"),"e",d("[\u00ec\u00ed\u00ee\u00ef]"),"i",d("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),
"o",d("[\u00f9\u00fa\u00fb\u00fc\u0171]"),"u",d("[\u00fd\u0177\u00ff]"),"y",d("\u00f1"),"n",d("\u00e7"),"c",d("\u00df"),"s",d(" & ")," and ",d("[-/]")," ",d("[^a-z0-9 ]"),"",d("\\s\\s+")," "];return function(b){b=A(b.toLowerCase(),a);return" "!==b?b:""}}(),advanced:function(){var a=[d("ae"),"a",d("ai"),"ei",d("ay"),"ei",d("ey"),"ei",d("oe"),"o",d("ue"),"u",d("ie"),"i",d("sz"),"s",d("zs"),"s",d("sh"),"s",d("ck"),"k",d("cc"),"k",d("dt"),"t",d("ph"),"f",d("pf"),"f",d("ou"),"o",d("uo"),"u"];return function(b,
e){if(!b)return b;b=this.simple(b);2<b.length&&(b=A(b,a));e||1<b.length&&(b=G(b));return b}}(),extra:function(){var a=[d("p"),"b",d("z"),"s",d("[cgq]"),"k",d("n"),"m",d("d"),"t",d("[vw]"),"f",d("[aeiouy]"),""];return function(b){if(!b)return b;b=this.advanced(b,!0);if(1<b.length){b=b.split(" ");for(var e=0;e<b.length;e++){var c=b[e];1<c.length&&(b[e]=c[0]+A(c.substring(1),a))}b=b.join(" ");b=G(b)}return b}}(),balance:function(){var a=[d("[-/]")," ",d("[^a-z0-9 ]"),"",d("\\s\\s+")," "];return function(b){return G(A(b.toLowerCase(),
a))}}()}),K=function(){var a=r();return function(b,e,c){var d=a[c];d&&clearTimeout(d);return a[c]=setTimeout(b,e)}}(),X=function(){function a(a){this.reset();this.b=!0!==a&&a}a.prototype.reset=function(){this.cache=r();this.count=r();this.index=r();this.a=[]};a.prototype.set=function(a,e){if(this.b&&"undefined"===typeof this.cache[a]){var b=this.a.length;if(b===this.b){b--;var d=this.a[b];delete this.cache[d];delete this.count[d];delete this.index[d]}this.index[a]=b;this.a[b]=a;this.count[a]=-1;this.cache[a]=
e;this.get(a)}else this.cache[a]=e};a.prototype.get=function(a){var b=this.cache[a];if(this.b&&b){var c=++this.count[a],d=this.index,f=d[a];if(0<f){for(var g=this.a,h=f;this.count[g[--f]]<=c&&-1!==f;);f++;if(f!==h){for(c=h;c>f;c--)h=g[c-1],g[c]=h,d[h]=c;g[f]=a;d[a]=f}}}return b};return a}();return f}(function(){var u=Object.create(null),D=!("undefined"===typeof Blob||"undefined"===typeof URL||!URL.createObjectURL);return function(f,w,d,A,z){var m=f;f=D?URL.createObjectURL(new Blob(["var SUPPORT_WORKER = true;var SUPPORT_BUILTINS = true;var SUPPORT_DEBUG = true;var SUPPORT_CACHE = true;var SUPPORT_ASYNC = true;("+
d.toString()+")()"],{type:"text/javascript"})):"../"+m+".js";m+="-"+w;u[m]||(u[m]=[]);u[m][z]=new Worker(f);u[m][z].onmessage=A;console.log("Register Worker: "+m+"@"+z);return{postMessage:function(d,f){u[m][d].postMessage(f)}}}}()),this);

View File

@@ -51,7 +51,7 @@
"devDependencies": {
"chai": "^4.1.2",
"codacy-coverage": "^3.0.0",
"coveralls": "^3.0.0",
"coveralls": "^3.0.1",
"google-closure-compiler": "^20180402.0.0",
"mocha": "^5.1.1",
"mocha-lcov-reporter": "^1.3.0",